Create your Game
Once your IDE is set up correctly, it's extremely easy to get going with Starling. Link your project to the Starling SWC library and use the following startup class:
[SWF(width="400", height="300", frameRate="60", backgroundColor="#ffffff")]
public class Startup extends Sprite
private var _starling:Starling;
public function Startup()
_starling = new Starling(Game, stage);
This will initiate a Starling instance and start it up. The "Game" parameter of the constructor expects a class that is a Starling display object. This is your portal into the GPU accelerated world: Starling has its own set of display objects. In their usage, they are almost identical to conventional display objects; behind the scenes, however, they use Stage3D to render content on the screen.
public class Game extends Sprite
public function Game()
var textField:TextField = new TextField(400, 300, "Welcome to Starling!");
The biggest "gotcha" in Starling is to use the right classes. Your IDE's autocompletion will default to the "flash.display" classes, while you want classes within "starling.display". When something goes wrong, always check the package imports above your class: you're probably using the wrong package.