Flash mouse position
- Started
- Last post
- 10 Responses
- Parent
Anyone know how to detect mouse position in flash? basically so i can say if it's in a certain area of the stage to play a clip?
thanks
- stewart0
sure you can!
- ozhanlion0
he doesn't say can I, he says how can I..
you can do couple of things. you can use hitTest().
other than that, _xMouse, and _yMouse is what you are looking for.
- Parent0
trying that.. but i an't work it out.. done it before but lost the file and now it's really bugging me!.. help?!
- schjetne0
That is pretty basic AS...
_xMouse and _yMouse for sure.
- ozhanlion0
spit your code
- elkew0
actionscript is case sensitive so use: _xmouse and _ymouse
- ozhanlion0
actionscript is not case sensitive. flash 7 is case sensitive. flash is not.
...
- mac100
put this on a MC
onClipEvent (enterFrame) {
x = _root._xmouse;
y = _root._ymouse;
if (this.hitTest(x, y, true)) {
yourMC.gotoAndPlay(1);
}
}hope this helps
mac-10
- Parent0
thanks dude