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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detect mouse?

Status
Not open for further replies.

august

MIS
Aug 24, 2000
150
PH
How can i detect the mouse pointer if move to the left/right it is possible? if it is, what would be my first step? thanks in advance.

Thanks,
August
 
Check thread250-78085

Regards,
mywink.gif
ldnewbie
 
Try this...

Set up a movie clip (doesn't matter where on the stage), select it and add these actions...

onClipEvent (load) {

// get initial mouse position
lastMouse = _root._xmouse;
}
onClipEvent (mouseMove) {

// get latest mouse position
newMouse = _root._xmouse;

// compare the two mouse positions
if (newMouse-lastMouse>0) {
trace ("Mouse moved right");
} else if (lastMouse-newMouse>0) {
trace ("Mouse moved left");
}

// reset the mouse position
lastMouse = newMouse;
}
}
 
Thank you all!
I'll try it!

Thanks,
August
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top