Table of Contents

updateAfterEvent( ) Global Function Flash 5

render the contents of the Stage between frames
updateAfterEvent()

Description

When a function executes between frames in the Flash Player, any visual changes to the screen are not displayed until the next frame is rendered. However, within the following functions, we can force a screen refresh manually by invoking updateAfterEvent( ):

Note, however, that updateAfterEvent( ) is not an arbitrary screen-refreshing tool; outside of setInterval( ) and the handlers in the previous list, it has no effect. In Flash 6, even the Mouse and Key objects' event handlers do not support updateAfterEvent( ); however, they are expected to support it in future versions of the Player.

Example

The following script causes pointer_mc to follow the mouse pointer. It uses updateAfterEvent( ) to refresh the screen every time the pointer moves (which may be more often than the frame rate):

pointer_mc.onMouseMove = function () {
  this._x = _root._xmouse;
  this._y = _root._ymouse;
  updateAfterEvent();
}

See Also

"Refreshing the Screen with updateAfterEvent( )," in Chapter 10


Table of Contents