Full screen in AS3 - Air
Hi I am trying to the get my andoid app to show up full screen. But this doesnt work.
My stage is 480x800
And this is the code that I attempted to use:
package
{
import flash.display.MovieClip;
import com.greensock.*;
import com.greensock.easing.*;
import flash.events.MouseEvent;
import flash.system.Capabilities;
import flash.display.StageDisplayState;
import flash.display.StageScaleMode;
import flash.display.StageAlign;
public class mainclass extends MovieClip
{
private var holder:holder_mc = new holder_mc ;
private var btn:BTN = new BTN ;
private var side1:side_mc = new side_mc ;
private var side2:side_mc = new side_mc ;
public function mainclass()
{
super();
stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
stage.showDefaultContextMenu = false;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
holder.width = Capabilities.screenResolutionX;
holder.height = Capabilities.screenResolutionY;
addChild(holder);
trace(holder.width)
trace(stage.stageWidth)
btn.x = 250;
btn.y = 300;
holder.addChild(btn);
side1.width = holder.width / 2;
side1.height = holder.height;
side1.x = - side1.width;
side1.y = 0;
holder.addChild(side1);
side2.width = holder.width / 2;
side2.height = holder.height;
side2.x = holder.width + side1.width;
side2.y = 0;
holder.addChild(side2);
//btn.addEventListener(MouseEvent.CLICK, closedoors);
}
private function closedoors(e:MouseEvent):void
{
btn.removeEventListener(MouseEvent.CLICK, closedoors);
TweenLite.to(side1, .8, {x:0, ease:Bounce.easeOut});
TweenLite.to(side2, .8, {x:side2.width, ease:Bounce.easeOut});
}
private function opendoors():void
{
TweenLite.to(side1, .8, {x:-side2.width, ease:Bounce.easeOut,delay:.3});
TweenLite.to(side2, .8, {x:stage.stageWidth, ease:Bounce.easeOut,delay:.3,onComplete:addList});
}
private function addList():void
{
btn.addEventListener(MouseEvent.CLICK, closedoors);
}
}
}
Any help is much appriciated.
Thx pavel
