ActionScript 3: Smooth Programming Animation

I want to animate MoviveClips / Sprite objects as smoothly as possible. However, so far the only way that works is to place the motion code in the EnterFrame event handler. There is one problem with this approach: when the frame rate on a particular machine is lower than the required frame rate, then the whole game slows down. I want to be able to do this in a time-independent manner.

+5
source share
2 answers

There are two ways to make programmatic animation in a Flash player. The first thing you specified with onEnterFrame. However, as you already noticed, in order to get smooth animation, you need to increase the overall frame rate of your movie. It will also increase the processor load over the entire life of your SWF. This is not what you always want.

Another way to perform programmatic animation is to use a timer. Inside the timer handler, you can call a function with a name updateAfterEventthat will update the screen regardless of the FPS that you set for your SWF. Therefore, using a timer leaves the gateway to perform smooth animation inside the Flash player without increasing the overall frame rate of your SWF.

Flash (- ). Coretween, , , , . . SWF 12 , , , , , 60 , SWF. , 60 , Flash Player . , , .

, 1.0, , . , . Coretween , StGeorge , .

+12

, ActionScript:

TweenMax

Tweener

, .

+2

All Articles