FORUMS: list search recent posts

mouse position condition

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Footbaggin
mouse position condition
on Feb 2, 2007 at 9:56:59 am

I am trying to create a code that would apply a condition to the x value of the mouse cursor. Does anyone know a working code for the following concept...

If the mouse pointer x value is > 200, then mcClip will rotate 10.

This is the code I tried... it doesn't work though, and I have no other ideas.

onClipEvent (load) {
if(_root._xmouse > 200) {
this._rotation += 10;
}
}

any help will be greatly appreciated.




Return to posts index

grafxflow
Re: mouse position condition
on Feb 7, 2007 at 12:50:39 am

Hi,

Try

onClipEvent (enterFrame){
trace(_root._xmouse);
if(_root._xmouse > 200) {
this._rotation += 10;
}
}

You can delete the 'trace(_root._xmouse);' line, it's just incase you choose the menu 'control/test movie' inside of flash. It will bring up a window showing the xposition of the mouse live.

Hope this helps.
grafxflow

grafx that flow!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]