Fruitfly is a library for dynamic creation of Starling display objects from native Flash display objects. It enables the creation of MovieClips and Images from Flash DisplayObjects and, when using Adobe Air, the saving and reloading of the resulting Starling assets from local storage.

Most Starling development uses pre-rendered bitmap assets, usually as spritesheets. These assets have to be created for specific screen resolutions and this loses one of the benefits of Flash – resolution independent vector graphics. Resolution independence is particularly useful on mobile platforms where games are displayed full-screen. This library restores that resolution independence by creating the spritesheets at run-time.


var dynamicAssets : Fruitfly = new Fruitfly( "assets1" );
dynamicAssets.loadComplete.add( assets1Ready );
dynamicAssets.loadFailed.add( createAssets1 );

private function createAssets1() : void {
    dynamicAssets.addDisplayObject( "background", new Scene1Background(), 1 );
    dynamicAssets.addButton( "playBtn", new PlayBtn(), 1 );
    dynamicAssets.addMovieClip( "logo", new AnimatedLogo(), 1 );
    dynamicAssets.generateStarlingAssets( StageQuality.HIGH );

private function assets1Ready() : void {
    var background : Image = dynamicAssets.getImage( "background" );
    var playBtn : Button = dynamicAssets.getButton( "playBtn" );
    var logo : MovieClip = dynamicAssets.getMovieClip( "logo" );
Misc . URL.