7 days of WordPress plugins, themes & templates - for free!* Unlimited asset downloads! Start 7-Day Free Trial
  1. Code
  2. Animation

Handling Animation States With Starling

Scroll to top
Read Time: 2 mins

The Starling Framework is an AS3 API that mimics the display list, with one crucial difference: it uses Flash Player 11's new features to render all content by the GPU. In this tutorial, you will learn to add multiple animations to a sprite using the Starling Framework. It assumes a basic understanding of using spritesheets with Starling.

Final Result Preview

Click here to view the demo we'll be working towards. Click left or right of the monkey to make it walk in that direction; notice how it displays a walking animation when moving and a static frame when standing still.

Initial Code

The entire demo's source files (in both the initial and final states) are in the source download. However, we'll mainly be working with one file, MonkeySprite.as, so here are the contents, for reference:

Watch the Screencast

Here are the URLs mentioned in the video:

Want More Starling Tutorials?

Let us know in the comments!

Did you find this post useful?
Want a weekly email summary?
Subscribe below and we’ll send you a weekly email summary of all new Code tutorials. Never miss out on learning about the next big thing.
Looking for something to help kick start your next project?
Envato Market has a range of items for sale to help get you started.