60 lines
1.6 KiB
ActionScript
60 lines
1.6 KiB
ActionScript
package com.arc.dh.state
|
|
{
|
|
import flash.display.Loader;
|
|
import flash.events.Event;
|
|
import flash.media.SoundMixer;
|
|
import flash.system.ApplicationDomain;
|
|
import flash.system.LoaderContext;
|
|
import org.flixel.FlxG;
|
|
import org.flixel.FlxState;
|
|
|
|
public class AG extends FlxState
|
|
{
|
|
|
|
private static var AG:Class = AG_AG;
|
|
|
|
private var len:Number = 220;
|
|
|
|
private var zoomFactor:int = 1;
|
|
|
|
private var movie:Loader;
|
|
|
|
public function AG()
|
|
{
|
|
super();
|
|
}
|
|
|
|
override public function create() : void
|
|
{
|
|
this.movie = new Loader();
|
|
var _loc1_:LoaderContext = new LoaderContext(false,ApplicationDomain.currentDomain);
|
|
this.movie.loadBytes(new AG(),_loc1_);
|
|
this.movie.contentLoaderInfo.addEventListener(Event.COMPLETE,this.contentsRetrieve);
|
|
}
|
|
|
|
private function contentsRetrieve(param1:Event) : void
|
|
{
|
|
this.movie.scaleX = 1 / this.zoomFactor;
|
|
this.movie.scaleY = 1 / this.zoomFactor;
|
|
this.movie.x = 10;
|
|
this.movie.y = 40;
|
|
FlxG.stage.addChildAt(this.movie,0);
|
|
this.movie.addEventListener(Event.EXIT_FRAME,this.next);
|
|
}
|
|
|
|
private function next(param1:Event) : void
|
|
{
|
|
--this.len;
|
|
if(this.len <= 0)
|
|
{
|
|
FlxG.stage.removeChildAt(0);
|
|
SoundMixer.stopAll();
|
|
this.movie.removeEventListener(Event.EXIT_FRAME,this.next);
|
|
this.movie.unload();
|
|
FlxG.switchState(new MainMenu());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|