User Guide
Creating interactivity and visual effects 183
The Mouse.hide() method hides the pointer when the movie clip first appears on the Stage;
the
onMouseMove function positions the custom pointer at the same place as the pointer and
calls
updateAfterEvent whenever the user moves the mouse.
The
updateAfterEvent function immediately refreshes the screen after the specified event
occurs, rather than when the next frame is drawn, which is the default behavior. For more
information about the methods of the Color class, see the Color class entry in ActionScript
Dictionary Help.
6.
Select Control > Test Movie to test your custom pointer.
Buttons still function when you use a custom pointer. Itâs a good idea to put the custom pointer
on the top layer of the Timeline so that, as you move the mouse in the SWF file, the custom
pointer appears in front of buttons and other objects in other layers. Also, the tip of a custom
pointer is the registration point of the movie clip youâre using as the custom pointer. Therefore, if
you want a certain part of the movie clip to act as the tip of the pointer, set the registration point
coordinates of the clip to be that point.
For more information about the methods of the Color class, see the Color class entry in
ActionScript Dictionary Help.
Getting the pointer position
You can use the
_xmouse and _ymouse properties to find the location of the pointer in a SWF file.
These properties could be used, for example, in a map application that gets the value of the
_xmouse and _ymouse properties and uses them to calculate the longitude and latitude of a
specific location.
Each Timeline has an
_xmouse and _ymouse property that returns the location of the pointer
within its coordinate system. The position is always relative to the registration point. For the main
Timeline (
_level0), the registration point is the upper left corner. For a movie clip, the
registration point depends on the registration point set when the clip was created or its placement
on the Stage.
The _xmouse and _ymouse properties within the main Timeline and a movie clip Timeline