import flash.events.Event; import flash.net.*; var current:Number = -1; var numCoords:Number = 0; //get vars from php var myRowsLoader:URLLoader; var myRowsRequest:URLRequest; var myRowsVariables:URLVariables ; //get the number of rows in the db this.addEventListener(Event.ENTER_FRAME, getNumRows); function getNumRows(evt:Event):void { myRowsRequest = new URLRequest("http://newmedia.emerson.edu/~joshua_hoekwater/numRows.php"); myRowsLoader = new URLLoader(); myRowsVariables = new URLVariables(); myRowsRequest.method = URLRequestMethod.GET; myRowsRequest.data = myRowsVariables; myRowsLoader.addEventListener(Event.COMPLETE, onLoadedNumRows); myRowsLoader.load(myRowsRequest); }; function onLoadedNumRows(eventNumRows:Event):void { numCoords = Number(myRowsLoader.data); Coords_txt.text = String(current) + ":" + String(numCoords); }; //call to get number of rows this.addEventListener(Event.COMPLETE, getNumRows); //Start Drag Function and Event Listener function startMove(event:MouseEvent):void { if (event.target != capture_btn){ if (event.target != pageRight_btn){ if (event.target != pagePrev_btn){ event.target.startDrag();}}} }; this.addEventListener(MouseEvent.MOUSE_DOWN, startMove); //Stop Drag Function and Event Listener function stopMove(event:MouseEvent):void { if (event.target != capture_btn){ if (event.target != pageRight_btn){ if (event.target != pagePrev_btn){ event.target.stopDrag();}}} }; this.addEventListener(MouseEvent.MOUSE_UP, stopMove); //capture the coordinates of each word capture_btn.addEventListener(MouseEvent.CLICK, captureScreen); function captureScreen(event:MouseEvent):void { var coords:String = new String(); coords = Math.round(word0.x) + "," + Math.round(word0.y) + "," + Math.round(word1.x) + "," + Math.round(word1.y) + "," + Math.round(word2.x) + "," + Math.round(word2.y) + "," + Math.round(word3.x) + "," + Math.round(word3.y) + "," + Math.round(word4.x) + "," + Math.round(word4.y) + "," + Math.round(word5.x) + "," + Math.round(word5.y) + "," + Math.round(word6.x) + "," + Math.round(word6.y) + "," + Math.round(word7.x) + "," + Math.round(word7.y) + "," + Math.round(word8.x) + "," + Math.round(word8.y) + "," + Math.round(word9.x) + "," + Math.round(word9.y) + "," + Math.round(word10.x) + "," + Math.round(word10.y) + "," + Math.round(word11.x) + "," + Math.round(word11.y) + "," + Math.round(word12.x) + "," + Math.round(word12.y) + "," + Math.round(word13.x) + "," + Math.round(word13.y) + "," + Math.round(word14.x) + "," + Math.round(word14.y) + "," + Math.round(word15.x) + "," + Math.round(word15.y) + "," + Math.round(word16.x) + "," + Math.round(word16.y) + "," + Math.round(word17.x) + "," + Math.round(word17.y) + "," + Math.round(word18.x) + "," + Math.round(word18.y) + "," + Math.round(word19.x) + "," + Math.round(word19.y) + "," + Math.round(word20.x) + "," + Math.round(word20.y) + "," + Math.round(word21.x) + "," + Math.round(word21.y) + "," + Math.round(word22.x) + "," + Math.round(word22.y) + "," + Math.round(word23.x) + "," + Math.round(word23.y) + "," + Math.round(word24.x) + "," + Math.round(word24.y) + "," + Math.round(word25.x) + "," + Math.round(word25.y) + "," + Math.round(word26.x) + "," + Math.round(word26.y) + "," + Math.round(word27.x) + "," + Math.round(word27.y) + "," + Math.round(word28.x) + "," + Math.round(word28.y) + "," + Math.round(word29.x) + "," + Math.round(word29.y) + "," + Math.round(word30.x) + "," + Math.round(word30.y) + "," + Math.round(word31.x) + "," + Math.round(word31.y) + "," + Math.round(word32.x) + "," + Math.round(word32.y) + "," + Math.round(word33.x) + "," + Math.round(word33.y) + "," + Math.round(word34.x) + "," + Math.round(word34.y) + "," + Math.round(word35.x) + "," + Math.round(word35.y) + "," + Math.round(word36.x) + "," + Math.round(word36.y) + "," + Math.round(word37.x) + "," + Math.round(word37.y) + "," + Math.round(word38.x) + "," + Math.round(word38.y) + "," + Math.round(word39.x) + "," + Math.round(word39.y); //send it to php/sql var myCoordsData:URLRequest = new URLRequest("http://newmedia.emerson.edu/~joshua_hoekwater/coords.php"); myCoordsData.method = URLRequestMethod.POST; var Coordsvariables:URLVariables = new URLVariables(); Coordsvariables.c = coords; myCoordsData.data = Coordsvariables; var Coordsloader:URLLoader = new URLLoader(); Coordsloader.dataFormat = URLLoaderDataFormat.VARIABLES; Coordsloader.load(myCoordsData); //call getNumRows to update this.addEventListener(Event.COMPLETE, getNumRows); Coords_txt.text = String(current) + ":" + String(numCoords); }; //get vars var myIDLoader:URLLoader; var myIDRequest:URLRequest; var myIDVariables:URLVariables ; var IDloader:URLLoader; //send the current+1 var and get the coords pageRight_btn.addEventListener(MouseEvent.CLICK, pageRight); function pageRight (Event2:MouseEvent):void { //sending id var myIDData:URLRequest = new URLRequest("http://newmedia.emerson.edu/~joshua_hoekwater/return.php"); myIDData.method = URLRequestMethod.POST; var IDvariables:URLVariables = new URLVariables(); if ((current+1) == numCoords) { IDvariables.id = 0; current = 0; } else { IDvariables.id = current + 1; current += 1; } myIDData.data = IDvariables; IDloader = new URLLoader(); IDloader.dataFormat = URLLoaderDataFormat.VARIABLES; IDloader.load(myIDData); //getting coords myIDRequest = new URLRequest("http://newmedia.emerson.edu/~joshua_hoekwater/return.php"); myIDLoader = new URLLoader(); myIDVariables = new URLVariables(); myIDRequest.method = URLRequestMethod.GET; myIDRequest.data = myIDVariables; myIDLoader.addEventListener(Event.COMPLETE, onLoadedNext); myIDLoader.load(myIDRequest); }; function onLoadedNext(eventNext:Event):void { Coords_txt.text = String(current) + ":" + String(numCoords); trace(myIDLoader.data); var nextCoords = ""; nextCoords = myIDLoader.data; //moving words word0.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word0.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word1.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word1.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word2.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word2.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word3.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word3.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word4.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word4.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word5.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word5.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word6.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word6.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word7.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word7.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word8.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word8.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word9.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word9.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word10.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word10.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word11.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word11.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word12.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word12.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word13.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word13.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word14.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word14.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word15.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word15.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word16.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word16.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word17.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word17.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word18.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word18.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word19.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word19.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word20.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word20.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word21.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word21.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word22.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word22.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word23.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word23.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word24.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word24.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word25.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word25.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word26.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word26.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word27.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word27.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word28.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word28.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word29.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word29.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word30.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word30.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word31.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word31.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word32.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word32.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word33.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word33.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word34.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word34.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word35.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word35.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word36.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word36.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word37.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word37.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word38.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word38.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word39.x = nextCoords.slice(0, nextCoords.indexOf(",", 0)); nextCoords = nextCoords.slice((nextCoords.indexOf(",",0))+1); word39.y = nextCoords.slice(0, nextCoords.indexOf(",", 0)); }; //send the current-1 var and get the coords pagePrev_btn.addEventListener(MouseEvent.CLICK, pagePrev); function pagePrev (Event3:MouseEvent):void { //sending id var myIDData:URLRequest = new URLRequest("http://newmedia.emerson.edu/~joshua_hoekwater/return.php"); myIDData.method = URLRequestMethod.POST; var IDvariables:URLVariables = new URLVariables(); if ((current-1) < 0) { IDvariables.id = numCoords-1; current = numCoords-1; } else { IDvariables.id = current - 1; current -= 1; } myIDData.data = IDvariables; IDloader = new URLLoader(); IDloader.dataFormat = URLLoaderDataFormat.VARIABLES; IDloader.load(myIDData); //getting coords myIDRequest = new URLRequest("http://newmedia.emerson.edu/~joshua_hoekwater/return.php"); myIDLoader = new URLLoader(); myIDVariables = new URLVariables(); myIDRequest.method = URLRequestMethod.GET; myIDRequest.data = myIDVariables; myIDLoader.addEventListener(Event.COMPLETE, onLoadedPrev); myIDLoader.load(myIDRequest); }; function onLoadedPrev(eventPrev:Event):void { Coords_txt.text = String(current) + ":" + String(numCoords); trace(myIDLoader.data); var prevCoords = ""; prevCoords = myIDLoader.data; word0.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word0.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word1.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word1.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word2.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word2.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word3.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word3.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word4.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word4.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word5.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word5.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word6.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word6.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word7.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word7.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word8.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word8.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word9.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word9.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word10.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word10.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word11.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word11.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word12.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word12.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word13.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word13.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word14.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word14.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word15.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word15.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word16.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word16.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word17.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word17.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word18.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word18.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word19.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word19.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word20.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word20.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word21.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word21.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word22.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word22.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word23.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word23.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word24.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word24.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word25.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word25.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word26.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word26.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word27.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word27.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word28.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word28.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word29.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word29.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word30.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word30.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word31.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word31.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word32.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word32.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word33.x = prevCoords.slice(0, prevCoords.indexOf(",", 0));prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word33.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word34.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word34.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word35.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word35.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word36.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word36.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word37.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word37.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word38.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word38.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word39.x = prevCoords.slice(0, prevCoords.indexOf(",", 0)); prevCoords = prevCoords.slice((prevCoords.indexOf(",",0))+1); word39.y = prevCoords.slice(0, prevCoords.indexOf(",", 0)); };