Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mouse track limit?

Status
Not open for further replies.

august

MIS
Joined
Aug 24, 2000
Messages
150
Location
PH
I made a little bit of mouse inhancement on my movie i make a movie to track the mouse whenever it goes, now my problem is how can i put some limit to track the mouse pointer on my screen for example i have a window with 5x5(width/Height)
i want the mouse wont have track when it goes out of my window what should i do?

Thanks in advance!

Thanks,
August
 
Are you displaying the mouse position and just want the position not to be displayed when it's out of a certain rectangle for instance?
mywink.gif
ldnewbie
 
Work out what your window position is on the stage (in pixels) and then check to see if the mouse has gone outside it with an if statement.

For a window 200 x 200 pixels placed 100 pixels down from the top of the screen and 100 pixels in from the left your if statement would be...

if(_root._xmouse>100 && _root._xmouse<300 && _root._ymouse >100 && _root._ymouse<300){
//do your stuff here
}
 
Thank you again!

Thanks,
August
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top