• AIR for Android performance

    I wrote the Tumble Game app in the Android Marketplace, which was published in Flash Builder 4. After a few iterations of the app, I figured out how to get better game play performance.

    First I set the the renderMode in the XML settings to “gpu”.

    Then for each game piece, I used an PNG graphic instead of a movieclip, and I set the cacheAsBitmap to true and the cacheAsBitmapMatrix to a new Matrix.

    
    [Embed( source="assets/greenStar.png" )]
    private var Asset:Class;
    
    var assetBitmap:Bitmap = new Asset( );
    assetBitmap.smoothing = true;
    assetBitmap.cacheAsBitmap = true;
    assetBitmap.cacheAsBitmapMatrix = new Matrix();
    
    

    After doing those few things, the frames per second went from 9 to 22. Thats a big improvement.