var index:Number = 0; var current:Number = 0; var coordsArray:Array = new Array(); //Start Drag Function and Event Listener function startMove(event:MouseEvent):void { if (event.target != capture_btn){ if (event.target != restart_btn){ if (event.target != pageRight_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 != restart_btn){ if (event.target != pageRight_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 = word0.x + "," + word0.y + "," + word1.x + "," + word1.y + "," + word2.x + "," + word2.y + "," + word3.x + "," + word3.y + "," + word4.x + "," + word4.y + "," + word5.x + "," + word5.y + "," + word6.x + "," + word6.y + "," + word7.x + "," + word7.y + "," + word8.x + "," + word8.y + "," + word9.x + "," + word9.y + "," + word10.x + "," + word10.y + "," + word11.x + "," + word11.y + "," + word12.x + "," + word12.y + "," + word13.x + "," + word13.y + "," + word14.x + "," + word14.y + "," +word15.x + "," + word15.y + "," + word16.x + "," + word16.y + "," + word17.x + "," + word17.y + "," + word18.x + "," +word18.y + "," + word19.x + "," + word19.y + "," + word20.x + "," + word20.y + "," + word21.x + "," + word21.y + "," + word22.x + "," + word22.y + "," + word23.x + "," + word23.y + "," + word24.x + "," + word24.y + "," + word25.x + "," + word25.y + "," + word26.x + "," + word26.y + "," + word27.x + "," + word27.y + "," + word28.x + "," + word28.y + "," + word29.x + "," + word29.y + "," + word30.x + "," + word30.y + "," + word31.x + "," + word31.y + "," + word32.x + "," + word32.y + "," + word33.x + "," + word33.y + "," + word34.x + "," + word34.y + "," + word35.x + "," + word35.y + "," + word36.x + "," + word36.y + "," + word37.x + "," + word37.y + "," + word38.x + "," + word38.y + "," + word39.x + "," + word39.y; //coordsArray[index] = coords; index += 1; } //if the user clicks the Next button, load the next string pageRight_btn.addEventListener(MouseEvent.CLICK, pageRight); function pageRight (event:MouseEvent):void { var next = coordsArray[current+1]; for (int i=0; i