pass mouse coordinates
- Started
- Last post
- 6 Responses
- the_pencil
A little help needed! I am trying to record my mouse coordinates (in flash) on mouse click and pass the coordinates to a new window in html. can anyone point me in the right direction? (it's for a spot the ball competition)
- UndoUndo0
_xmouse [x pos]
_ymouse [y pos]bingo. send via sendAndLoad
- the_pencil0
could you shed a bit more light for me please, a bit new to this : )
- UndoUndo0
place a button over yr image called myButton on the root timeline. make a new layer and call it actions. in the first frame place this code.
_root.myButton.onPress = Function(){
curMouseX = _xmouse;
curMouseY = _ymouse
getURL("http://www.yourdomain.co... ,"_blank")
}
in your html page the variables mousex and mousey will be available for use:)
- the_pencil0
thank you!!!! : )
- the_pencil0
Hi Undo,
This works but not on mouse down. The new page pops up as soon as the flash is loaded. Any suggestions?
- tGP0
make sure you copy/pasted all the code that was posted, that should work...
also, make sure that you are using a movieclip as the button, not a tradional flash button, and place that code on a keyframe on the root timeline, not on the movieclip button itself...
cheers