FlashCS3 - Full Screen Flash Website - II (True Full Screen)
Click HERE For Full Screen Window
Click anywhere on the stage after you click on the link above.
Source File - fullScreen2.zip
package {
import flash.display.*;
import flash.events.*;
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;
import flash.text.*;
public class fullScreen2 extends MovieClip {
public function fullScreen2():void {
stage.align=StageAlign.TOP_LEFT;
stage.scaleMode=StageScaleMode.NO_SCALE;
stage.addEventListener(Event.RESIZE,stageResized);
StageElementMiddle.x=stage.stageWidth / 2;
StageElementMiddle.y=stage.stageHeight / 2;
ArrangeItems();
stage.addEventListener(MouseEvent.CLICK,FullScreen);
}
function stageResized(e:Event):void {
ArrangeItems();
}
function positionFn(TweenMC:MovieClip,StageWidth:Number,StageHeight:Number):void {
var tween_handler_1 = new Tween(TweenMC,"x",Elastic.easeInOut,TweenMC.x,StageWidth,1,true);
var tween_handler_2 = new Tween(TweenMC,"y",Elastic.easeInOut,TweenMC.y,StageHeight,1,true);
tween_handler_1.addEventListener(TweenEvent.MOTION_FINISH,UpdateStatus);
tween_handler_2.addEventListener(TweenEvent.MOTION_FINISH,UpdateStatus);
}
function UpdateStatus(e:TweenEvent):void {
StageElementMiddle.XTxt.text="X= " + Math.floor(StageElementMiddle.x);
StageElementMiddle.YTxt.text="Y= " + Math.floor(StageElementMiddle.y);
}
function ArrangeItems():void {
Header.x=0;
Footer.x=0;
Header.y=0;
Footer.y=stage.stageHeight - Footer.height;
Header.width=stage.stageWidth;
Footer.width=stage.stageWidth;
StageElementLeft.x=0 + StageElementLeft.width / 2;
StageElementLeft.y=stage.stageHeight / 2;
StageElementLeft.XTxt.text="X= " + Math.floor(StageElementLeft.x);
StageElementLeft.YTxt.text="Y= " + Math.floor(StageElementLeft.y);
StageElementRight.x=stage.stageWidth - StageElementRight.width / 2;
StageElementRight.y=stage.stageHeight / 2;
StageElementRight.XTxt.text="X= " + Math.floor(StageElementRight.x);
StageElementRight.YTxt.text="Y= " + Math.floor(StageElementRight.y);
StageElementTop.x=stage.stageWidth / 2;
StageElementTop.y=StageElementTop.height / 2;
StageElementTop.XTxt.text="X= " + Math.floor(StageElementTop.x);
StageElementTop.YTxt.text="Y= " + Math.floor(StageElementTop.y);
positionFn(StageElementMiddle,stage.stageWidth / 2,stage.stageHeight / 2);
StageElementMiddle.XTxt.text="X= " + Math.floor(StageElementMiddle.x);
StageElementMiddle.YTxt.text="Y= " + Math.floor(StageElementMiddle.y);
StageElementBottom.x=stage.stageWidth / 2;
StageElementBottom.y=stage.stageHeight - StageElementBottom.height / 2;
StageElementBottom.XTxt.text="X= " + Math.floor(StageElementBottom.x);
StageElementBottom.YTxt.text="Y= " + Math.floor(StageElementBottom.y);
Swidth.text="Width = " + stage.stageWidth;
Sheight.text="Height = " + stage.stageHeight;
}
function FullScreen(e:MouseEvent):void {
stage['displayState'] = "fullScreen";
}
}
}
Comments
Work from home India