Sprite Animation in Flex/AS3

You are missing some Flash content that should appear here! Perhaps your browser cannot display it, or maybe it did not initialize correctly.

Demo | Source

The animation of the sprite (animated image made of multiple frames) requires the writing of custom classes. AnimationSheet.as for the storage of the sprite sheet on top of the screen. AnimationClip.as for the management of the animation sequence. The former knows how to retrieve the bitmapData for any frame in the animation. The later moves the playhead on the animation.

The movement from left to right can be done with Flex built-in move effect


<mx:Move
id="moveAnim" target="{animView}" repeatCount="0"
xFrom="-5" xTo="260"
duration="{Math.round(Math.random()*500+2000)}"
easingFunction="mx.effects.easing.Linear.easeOut"
/>

Powered by Drupal, an open source content management system