View comments | RSS feed

MovieClip.onMouseMove

Availability

Flash Player 6.

Usage

my_mc.onMouseMove = function() {
   // your statements here
}

Parameters

None.

Returns

Nothing.

Description

Event handler; invoked when the mouse moves. You must define a function that executes when the event handler is invoked. You can define the function on the Timeline or in a class file that extends the MovieClip class or is linked to a symbol in the library. For more information, see "Assigning a class to a movie clip symbol" in Using ActionScript in Flash.

Example

The following example defines a function for the onMouseMove method that sends a trace() action to the Output panel:

my_mc.onMouseMove = function () {
  trace ("onMouseMove called");
};

Comments


No screen name said on Feb 11, 2005 at 5:05 AM :
Placing this event inside movieClip is quite confusing.

This event will fire whenever the mouse moves REGARDLESS of whether the mouse is actually over your MC or not.

It 's real functionality is in the stage scope and should have probably been created there and removed from the MovieClip object event list.
liambennett said on Feb 23, 2005 at 10:13 AM :
The point of this event is that it allows individual movie clips to do effects away from the mouse pointer.

If you had it in the Stage scope then you would have to write your own event handlers to handle this for each MovieClip you needed it on.
liambennett said on Feb 23, 2005 at 10:14 AM :
Incidentally, if required you can use the hitTest function within this event to see if the mouse move event was within the bounds of the mc.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/mx2004/main_7_2/00001536.html