home *** CD-ROM | disk | FTP | other *** search
- package RES.WINDOWS
- {
- import ENGINE.CORE.OGlobal;
- import ENGINE.DISPLAY.OBitmap;
- import ENGINE.DISPLAY.ODisplay;
- import ENGINE.DISPLAY.OSprite;
- import ENGINE.INTERFACE.OIObject;
- import ENGINE.INTERFACE.OWindow;
- import flash.display.DisplayObject;
- import flash.events.Event;
- import flash.events.MouseEvent;
-
- public class OWIntro extends OWindow
- {
-
- public static var stHide:int = 6;
-
- public static var stNormal:int = 5;
-
- public static var stShowName:int = 4;
-
- public static var stShowHeader:int = 2;
-
- public static var stInvisible:int = 7;
-
- public static var stShowLogo:int = 1;
-
- public static var stShowFooter:int = 3;
-
- public static var stBeforeShow:int = 0;
-
-
- public var iGameName:OIObject;
-
- public var iHeader:OBitmap;
-
- private var iTimer:Number;
-
- public var iHit:OSprite;
-
- public var iFooter:OBitmap;
-
- private var iAlpha:Array;
-
- private var iLogo:OWLogo;
-
- public function OWIntro()
- {
- ClusterzL.OWIntroParam[0][1] = [[ODisplay.SpriteRect,800 * OGlobal.Scale,600 * OGlobal.Scale]];
- super(ClusterzL.OWIntroParam);
- }
-
- override public function Init() : void
- {
- var _loc1_:int = 0;
- var _loc2_:int = 0;
- var _loc3_:DisplayObject = null;
- super.Init();
- this.iHeader.alpha = 0;
- this.iFooter.alpha = 0;
- this.iGameName.prY = 320 - this.iGameName.prHeight / 2;
- _loc1_ = this.iGameName.numChildren;
- this.iAlpha = new Array(_loc1_);
- _loc2_ = 0;
- while(_loc2_ < _loc1_)
- {
- _loc3_ = this.iGameName.getChildAt(_loc2_);
- _loc3_.alpha = 0;
- this.iAlpha[_loc2_] = -_loc2_ * 0.3;
- _loc2_++;
- }
- this.hitArea = this.iHit;
- iLogo = new OWLogo();
- iLogo.SetVisible(false);
- this.addChild(iLogo);
- this.State = stBeforeShow;
- }
-
- override public function Free() : void
- {
- super.Free();
- this.iHeader = null;
- this.iFooter = null;
- }
-
- override public function OnMouseDown(param1:MouseEvent) : void
- {
- if(this.iState < OWIntro.stShowFooter)
- {
- return;
- }
- this.prVisible = false;
- super.OnMouseDown(param1);
- }
-
- override public function OnEnterFrame(param1:Event) : void
- {
- var _loc2_:int = 0;
- switch(this.iState)
- {
- case stBeforeShow:
- if(this.iTimer-- <= 0)
- {
- this.State = stShowLogo;
- }
- break;
- case stShowLogo:
- if(this.iTimer-- <= 0)
- {
- this.State = stShowHeader;
- }
- break;
- case stShowHeader:
- if(this.iHeader.alpha >= 1)
- {
- this.iHeader.alpha = 1;
- this.State = stShowFooter;
- }
- else
- {
- this.iHeader.alpha += 0.025;
- }
- break;
- case stShowFooter:
- if(this.iFooter.alpha >= 1)
- {
- this.iFooter.alpha = 1;
- this.State = stShowName;
- }
- else
- {
- this.iFooter.alpha += 0.025;
- }
- break;
- case stShowName:
- if(this.iGameName.getChildAt(this.iGameName.numChildren - 1).alpha >= 1)
- {
- this.State = stNormal;
- }
- else
- {
- _loc2_ = 0;
- while(_loc2_ < this.iGameName.numChildren)
- {
- this.iAlpha[_loc2_] += 0.025;
- if(this.iAlpha[_loc2_] > 1)
- {
- this.iAlpha[_loc2_] = 1;
- }
- if(this.iAlpha[_loc2_] >= 0)
- {
- this.iGameName.getChildAt(_loc2_).alpha = this.iAlpha[_loc2_];
- }
- _loc2_++;
- }
- }
- break;
- case stNormal:
- if(this.iTimer-- <= 0)
- {
- this.State = stHide;
- }
- break;
- case stHide:
- if(this.iFooter.alpha <= 0)
- {
- this.State = stInvisible;
- }
- else
- {
- this.iHeader.alpha -= 0.05;
- this.iFooter.alpha -= 0.05;
- this.iGameName.alpha -= 0.05;
- }
- }
- }
-
- override public function set State(param1:int) : void
- {
- this.iState = param1;
- switch(this.iState)
- {
- case stShowLogo:
- iLogo.scaleX = OGlobal.Scale;
- iLogo.scaleY = OGlobal.Scale;
- iLogo.prVisible = true;
- this.iTimer = 105;
- break;
- case stShowHeader:
- iLogo.prVisible = false;
- break;
- case stBeforeShow:
- this.iTimer = 20;
- break;
- case stNormal:
- this.iTimer = 180;
- break;
- case stInvisible:
- this.prVisible = false;
- }
- }
- }
- }
-