The Importance of Setting a Background Color When Deploying to Mobile Devices

The video below demonstrates the importance of setting a background color when you deploy to devices which support orientation changes:


The code below shows how to use SWF metadata to set a background color and avoid the ugly white bars:

package
{
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    
    [SWF(frameRate="24", backgroundColor="#666666")]
    public class ReversiIphone extends Sprite
    {
        private var reversi:Reversi;
        public function ReversiIphone()
        { 
            super();
            this.stage.scaleMode = StageScaleMode.NO_SCALE;
            this.stage.align = StageAlign.TOP_LEFT;
            this.reversi = new Reversi(-1);
            this.addChild(this.reversi);
        } 
    }
}