Section 1
//MainTimeline (gensokyo_fla.MainTimeline)
package gensokyo_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.ui.*;
public dynamic class MainTimeline extends MovieClip {
public var bgInst:MovieClip;
public var loadingText:TextField;
public var cMenu:ContextMenu;
public var introSound:Sound;
public var introChannel:SoundChannel;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2);
}
public function LoadingHandler(_arg1:Event):void{
var _local2:Number = (this.stage.loaderInfo.bytesLoaded / this.stage.loaderInfo.bytesTotal);
loadingText.text = (Math.floor((_local2 * 100)).toString() + " percent");
loadingText.alpha = (1 - (_local2 * _local2));
if (_local2 >= 1){
removeEventListener(Event.ENTER_FRAME, LoadingHandler);
play();
};
}
public function IntroHandler(_arg1:Event):void{
var _local2:Number = (introChannel.position / introSound.length);
bgInst.alpha = ((2 * _local2) - (_local2 * _local2));
}
public function SoundCompleteHandler(_arg1:Event){
removeEventListener(Event.ENTER_FRAME, IntroHandler);
introChannel.removeEventListener(Event.SOUND_COMPLETE, SoundCompleteHandler);
gotoAndStop(3);
}
function frame1(){
stage.scaleMode = StageScaleMode.NO_SCALE;
cMenu = new ContextMenu();
cMenu.hideBuiltInItems();
cMenu.customItems.push(new ContextMenuItem("Song:", false, false));
cMenu.customItems.push(new ContextMenuItem("神々が恋した幻想郷 (The Gensokyo the Gods Loved), arrangement by =NeutraL=", false, true));
contextMenu = cMenu;
stop();
addEventListener(Event.ENTER_FRAME, LoadingHandler);
}
function frame2(){
stop();
introSound = new IntroSound();
introChannel = introSound.play();
introChannel.addEventListener(Event.SOUND_COMPLETE, SoundCompleteHandler);
addEventListener(Event.ENTER_FRAME, IntroHandler);
}
}
}//package gensokyo_fla
Section 2
//IntroSound (IntroSound)
package {
import flash.media.*;
public dynamic class IntroSound extends Sound {
}
}//package