PDA

View Full Version : Follow mouse areas?



valpez1
August 22nd, 2004, 01:36 AM
Sorry for the peculiar thread title; i didn't know how to sum up my problem in a few words.

I have an mc, that i need to have follow the mouse on the x axis. I have that just fine. But my problem is that i need a certain frame within the mc to play if the mouse is at a certain area of the stage.
For example, if the mouse is at the x coordinate of 235 to the left, frame 2 of the movieclip will play. I uploaded just a test fla that i was practicing on.

Thanks for any help whatsoever.

Take care,
victor

pete
August 22nd, 2004, 05:01 AM
if you compare two values you must not write if(a=b)
because this gives a the value of b and if b is not 0,undefined or null the if always returns true!!!!

i send you the .fla but i wrote that if x is bigger than the values then the frames are switched because it is very hard to point at a specific pixel with the mouse !

keep on trying!!

Prophet
August 22nd, 2004, 06:43 AM
not having looked at your fla :S i dont know if youv already done this but if you want it in a certain area:
if(_root._xmouse < 250 && _root._xmouse > 150){}

Prophet.

deQue
August 22nd, 2004, 10:18 AM
If it's important for you to know exactly where the mouse is, use this:

if(_root._xmouse <= 250 && _root._xmouse >= 150){
// Tell the movie to go to the correct frame.
}

If you want it to go to a certain frame in either cases:

if(_root._xmouse <= 250 || _root._xmouse >= 150){
// Tell the movie to go to the correct frame.
}

Prophet
August 22nd, 2004, 11:39 AM
i take it you didnt read what he wanted then...

Prophet.

valpez1
August 22nd, 2004, 01:35 PM
Thanks a lot you all. It works a lot better now. :thumb:

Victor