onMouseMove is global, meaning anyone who listens for it, gets it whenever 
the mouse moves.

_root.onMouseMove, mc.onMouseMove, my_mc.nestedClip.my_mc2.onMouseMove, etc.

The same goes for onMouseDown, and onMouseUp.

onPress, onRelease, and the rest, however, are movieclip specific.  So:

mc.onPress will only run for mc, not for _root.  Additionally, if a parent 
of the mc has onPress on it, children will not get onPress, onRelease, ect. 
events.

onMouseMove merely says that the mouse moved, not where.  That's when you 
check _xmouse and _ymouse of _root, mc, whatever.

onMouseDown/onMouseUp merely says the mouse was clicked, not where.  You 
have to either check a hitTarget, the _xmouse/_ymouse of the mouse to do a 
hitTest, or use a droptarget.


----- Original Message ----- 
From: "Matt Ganz" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com>
Sent: Wednesday, October 26, 2005 11:24 AM
Subject: Re: [Flashcoders] listening for all button events


i've been using this method to listen for mouse movements and mouse
clicks on the first frame of my .fla:

_root.onMouseMove = function()
{
   trace( "mouse moving" );
};
_root.onMouseUp = function()
{
   trace( "mouse being clicked" );
};

is that not a good way to do this?

On 10/26/05, JesterXL <[EMAIL PROTECTED]> wrote:
> Mouse.onMouseDown/onMouseUp already does this.  If you are using the v2
> component framework, or if you are not, you can see how they are doing it
> via mx.events.LowLevelEvents.
>
> ----- Original Message -----
> From: "Matt Ganz" <[EMAIL PROTECTED]>
> To: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com>
> Sent: Wednesday, October 26, 2005 10:38 AM
> Subject: [Flashcoders] listening for all button events
>
>
> hi.
>
> is there any way to have one listener listen for all button events.
> you know, like you can have with "Key". or do i have to give all my
> buttons instance names and use addListener on each instance?
>
> thanks.
>
> matt.
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders 

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to