Skip to main content
Known Participant
June 15, 2007
Answered

Passing Mouse Positions to PHP

  • June 15, 2007
  • 12 replies
  • 501 views
Hi

I am drawing using the following code. I want to put the x and y continouse mouse positions into an array and pass that array to the php.


This topic has been closed for replies.
Correct answer Greg Dove
Use

myLV.send(" http://localhost/yourtestscript.php","_blank","POST");

instead of sendAndLoad (sorry I thought you were doing that already)

where your php test page contains the code I gave earlier
It will show that php has access to the string version of the array, by just printing it back for the browser to show.

12 replies

Inspiring
June 15, 2007
no problems. good luck with the next step manipulating it in php. I'll have to work on learning the server side stuff... I'm completely lost there!
Known Participant
June 15, 2007
Thanks GWD,I really appreciate it. Its working just fine.
Greg DoveCorrect answer
Inspiring
June 15, 2007
Use

myLV.send(" http://localhost/yourtestscript.php","_blank","POST");

instead of sendAndLoad (sorry I thought you were doing that already)

where your php test page contains the code I gave earlier
It will show that php has access to the string version of the array, by just printing it back for the browser to show.
Known Participant
June 15, 2007
yeah i publish the movie to html and when I draw from the browser, not php page opens up . When I try to open the php page there aren't any values there.

Can you please guide me how I can display values in the php.

Thanks
Inspiring
June 15, 2007
All that does is confirm that php has received it though... You will have to convert it back to an array in php and do whatever else you want with it.
Inspiring
June 15, 2007
That's the part where it only works from the browser... I knew it was there somewhere! Flash sends GET with the send method from the IDE even if you say to send POST.

So it will work if you run the swf in a browser
Known Participant
June 15, 2007
Thanks man, but how can I get the values in the php. When I open the php page its output is only

result=
Inspiring
June 15, 2007
Check the code above now... that should at least report no errors. I didn't expect autoFormat to introduce them so didn't check it after I autoFormatted!
Inspiring
June 15, 2007
That's bizarre. autoFormat did that. I used undo and got an error free version. I'll correct the code above
Known Participant
June 15, 2007
Thanks man, but i am getting this error when i run it in flash ide.

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 47: Syntax error.
};

Total ActionScript Errors: 6 Reported Errors: 6