View comments | RSS feed

updateAfterEvent function

updateAfterEvent() : Void

Updates the display (independent of the frames per second set for the movie) when you call it within an onClipEvent() handler or as part of a function or method that you pass to setInterval(). Flash ignores calls to updateAfterEvent that are not within an onClipEvent() handler or part of a function or method passed to setInterval(). This function works only with certain Mouse and MovieClip handlers: the mouseDown, mouseUp, mouseMove, keyDown and keyUp handlers for the Mouse class; the onMouseMove, onMouseDown, onMouseUp, onKeyDown, and onKeyUp handlers for the MovieClip class. It does not work with the Key class.

Availability: ActionScript 1.0; Flash Player 5

Example

The following example show how to create a custom cursor called cursor_mc. ActionScript is used to replace the mouse cursor with cursor_mc. Then updateAfterEvent() is used to continually refresh the Stage to make the cursor's movement appear smooth.

Mouse.hide();
cursor_mc.onMouseMove = function() {
 this._x = this._parent._xmouse;
 this._y = this._parent._ymouse;
 updateAfterEvent();
};

See also

onClipEvent handler, setInterval function


Version 8

Comments


David Stiller said on Feb 19, 2007 at 6:12 PM :
This entry states that Flash ignores calls to updateAfterEvent() not associated with an onClipEvent() handler or setInterval(). Testing shows, however, that the display is updated after all in the case of dot notation event handlers that correspond to those valid for the onClipEvent() approach (i.e., myClip.onMouseMove = function():Void {}, etc., works just fine). In addition, updateAfterEvent() is also successful with the setTimeout() function, which was inadvertently omitted from the documentation.

 

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

Current page: http://livedocs.adobe.com/flash/8/main/00001782.html