- Customizing Your Pointer
- Eliminate Flickering Graphics
- Beginning to Animate with ActionScript
Eliminate Flickering Graphics
Use the function updateAfterEvent to force Flash to redraw the screen independent of the movie's frame rate. This eliminates the flicker associated with graphics moving around the screen faster than Flash can update the display, and is especially important when you use a custom pointer. The action updateAfterEvent can only be used with the following clip events: mouseMove, mouseDown, mouseUp, keyDown, and keyUp. Enter one of these clip events as the argument for the updateAfterEvent method.
To update the graphics on screen:
-
Continue with the previous file created in the previous task. Select the movie clip of the magnifying glass and open the Actions panel.
-
Select the last setProperty statement under the onClipEvent (mouseMove) handler.
-
Choose Actions > evaluate. A new statement line appears in the Actions List and an Expression field appears in the Parameters pane.
-
Choose Functions > updateAfterEvent. The updateAfterEvent function appears in the Expression field.
-
Enter the event mouseMove within the parentheses of the updateAfterEvent function (Figure 6).
Add the updateAfterEvent action to force Flash to refresh the display and create smoother motion.
Flash updates the graphics on the screen each time the pointer moves, creating smoother motions.
Tip
-
Explore using multiple movie clips that track the location of your pointer. For example, a vertical line that follows _xmouse and a horizontal line that follows _ymouse create moving crosshairs.