import flash.events.Event; import flash.net.*; var index:Number = 0; //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_btn.addEventListener(MouseEvent.CLICK, captureScreen); function captureScreen(event:MouseEvent):void { var coords:String = new String(); //for (var i:Number = 0; i<3; i++){ 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; //}; trace(coords); var myData:URLRequest = new URLRequest("coords.php"); myData.method = URLRequestMethod.POST; var variables:URLVariables = new URLVariables(); variables.c = coords; myData.data = variables; var loader:URLLoader = new URLLoader(); loader.dataFormat = URLLoaderDataFormat.VARIABLES; loader.load(myData); } pageRight_btn.addEventListener(MouseEvent.CLICK, pageRight); var myLoader:URLLoader; var myRequest:URLRequest; var myVariables:URLVariables ; var loader:URLLoader; function pageRight (Event2:MouseEvent):void { //sending id var myData:URLRequest = new URLRequest("return.php"); myData.method = URLRequestMethod.POST; var variables:URLVariables = new URLVariables(); variables.id = index ++; myData.data = variables; loader = new URLLoader(); loader.dataFormat = URLLoaderDataFormat.VARIABLES; loader.load(myData); //getting coords myRequest = new URLRequest("http://newmedia.emerson.edu/~joshua_hoekwater/return.php"); myLoader = new URLLoader(); myVariables = new URLVariables(); myRequest.method = URLRequestMethod.GET; myRequest.data = myVariables; myLoader.addEventListener(Event.COMPLETE, onLoaded); myLoader.load(myRequest); } function onLoaded(evt:Event):void { trace(myLoader.data); }