all groups > flash actionscript > august 2006 >
You're in the

flash actionscript

group:

detecting mouse on stage


detecting mouse on stage leaguer44
8/31/2006 5:46:30 PM
flash actionscript:
i have built a drop down menu with xml and actionscript but i need multiple
instances of the menu on the stage so i want to detect when the mouse touches
the stage so i may close all current open menus.

thanks
Re: detecting mouse on stage kglad
8/31/2006 6:12:20 PM
Re: detecting mouse on stage leaguer44
8/31/2006 6:16:56 PM
Re: detecting mouse on stage kglad
9/1/2006 1:45:54 AM
no, that wouldn't be good. that would interfere with the response of mouse
handlers of movieclips/buttons below the invisible button.

i'd use:



_root.onMouseMove=function(){
trace('mouse is over stage");
}
Re: detecting mouse on stage abeall
9/1/2006 3:44:44 AM
There's no real way to do it from within Flash... the problem with onMouseMove
is, as kglad mentioned, that if the user stops moving the mouse, it stops
executing.

If you use AS3 and Flash 9, use Event.MOUSE_LEAVE on the stage:

stage.addEventListener('mouseLeave', mouseLeave);
function mouseLeave(){
//mouse has left the stage
}
AddThis Social Bookmark Button