Tutorials to .com

Tutorials to .com » Website » Flash » The role of updateAfterEvent

The role of updateAfterEvent

Print View , by: iSee ,Total views: 8 ,Word Count: 373 ,Date: Wed, 26 Aug 2009 Time: 3:59 PM

There are a lot of people do follow the effect of the mouse when the mouse is not always found smooth, do not know how to solve.
In fact, very simple, you just need to add a updateAfterEvent () on the ok of.

Let's look at how to help is to explain updateAfterEvent follows:
/ * In the onClipEvent () handler is called within this function, or as passed to the setInterval () as part of a function or method calls, it will update the display (and for the film was set in frames per second has nothing to do). If updateAfterEvent call is not onClipEvent () handler, within, nor is it passed to the setInterval () function or part of the methodology, then the flash will ignore the call. This function is only for certain Mouse and MovieClip handlers play: Mouse Class mouseDown, mouseUp, mouseMove, keyDown, and keyUp handlers; MovieClip class onMouseMove, onMouseDown, onMouseUp, onKeyDown and onKeyUp handlers. Key categories it does not work. * /

In fact, the final analysis, the role of updateAfterEvent is to make the cursor appear more smoothly.

Here is what I am doing a comparison example of the purpose of more convenient for everyone to understand its role.
When the mouse moves left the stage, "the Executive updateAfterEvent" region, the mouse movement will be smooth, and when the mouse moves to the stage right side of the "no implementation of the updateAfterEvent" of the zone, move the mouse over there will be intermittent, not smooth.

Flash Animation

Take a look as:

/ / Use updateAfterEvent () to continue to refresh the stage to make the cursor movement looks smooth.
Mouse.hide ();
/ / trace (this)
mc.swapDepths (this.getNextHighestDepth ());
mc.onMouseMove = function () (
if (this.hitTest (you)) (
this._x = this._parent._xmouse;
this._y = this._parent._ymouse;
updateAfterEvent ();
)
if (this.hitTest (wu)) (
this._x = this._parent._xmouse;
this._y = this._parent._ymouse;
)
)


Adobe Flash Articles


Can't Find What You're Looking For?


Rating: Not yet rated

Comments

No comments posted.