Section 1
//GAMEOVER_MC_24 (madokatrain2_fla.GAMEOVER_MC_24)
package madokatrain2_fla {
import flash.display.*;
import flash.text.*;
public dynamic class GAMEOVER_MC_24 extends MovieClip {
public var score_txt:TextField;
public var rankin_mc:MovieClip;
public var nextGame_mc:MovieClip;
}
}//package madokatrain2_fla
Section 2
//MainTimeline (madokatrain2_fla.MainTimeline)
package madokatrain2_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.ui.*;
public dynamic class MainTimeline extends MovieClip {
public const PHP_RANKING = "php198712/ranking.php";
public var bgmVolume:int;
public var trainOk:Boolean;
public var seVolume:int;
public var rankingLastScore:int;
public var seList:Dictionary;
public var hiScore:int;
public var titleDisp:int;
public var madokaMove:Boolean;
public var ranking_mc:MovieClip;
public var madokaX:Array;
public var scoreName:String;
public var so:SharedObject;
public var rankingScore_array:Array;
public var stage_mc:MovieClip;
public var bgm_txt:TextField;
public var gameOverFlag:Boolean;
public var gameOver_mc:MovieClip;
public var score:int;
public var info:LoaderInfo;
public var keysDown:Array;
public var blackMask_mc:MovieClip;
public var se_txt:TextField;
public var playSeNo:int;
public var bgmLoopTime_array:Array;
public var trainNext:int;
public var testFlag:Boolean;
public var cursor_mc:MovieClip;
public var hikareFlag:Boolean;
public var hiScore_txt:TextField;
public var score_txt:TextField;
public var bgmCh;
public var trainX:Array;
public var test_txt:TextField;
public var train_array:Array;
public var link1_mc:SimpleButton;
public var bgmTr;
public var madoka_mc:MovieClip;
public var rails_mc:MovieClip;
public var rankingXmlLoader:URLLoader;
public var bgmList:Dictionary;
public var trainWait:int;
public var stepCount:int;
public var cursorX_array:Array;
public var sndCh;
public var cursorNo:int;
public var link2_mc:SimpleButton;
public var mask_mc:MovieClip;
public var sndTr;
public var playBgmNo:int;
public var trainStage:int;
public var madokaPoint:int;
public var XML_RANKING;
public var beforeTrain:int;
public var rankingPage:int;
public var trainNow:Array;
public var counter;
public function MainTimeline(){
addFrameScript(0, this.frame1, 1, this.frame2, 2, this.frame3, 3, this.frame4, 4, this.frame5);
}
public function xKeyDown(_arg1:KeyboardEvent):void{
this.keysDown[_arg1.keyCode] = true;
}
public function errorHandler(_arg1:IOErrorEvent):void{
}
public function addGameEvent():void{
addEventListener(Event.ENTER_FRAME, this.xEnterMain);
stage.addEventListener(KeyboardEvent.KEY_DOWN, this.xKeyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, this.xKeyUp);
}
function frame3(){
stop();
this.ranking_mc.visible = false;
this.updateVolume();
this.titleDisp = 0;
this.cursorNo = 0;
this.cursorX_array = [300, 340, 380, 420];
this.rankingPage = 0;
this.hiScore_txt.text = (("recorde " + this.hiScore) + " ");
this.updateRanking();
this.blackMask_mc.addEventListener(Event.ENTER_FRAME, this.xFadeInTitle);
}
public function xClickRankNoSend(_arg1:MouseEvent):void{
this.gameOver_mc.rankin_mc.send_btn.removeEventListener(MouseEvent.CLICK, this.xClickRankSend);
this.gameOver_mc.rankin_mc.noSend_btn.removeEventListener(MouseEvent.CLICK, this.xClickRankNoSend);
this.playSe(1);
this.gameOver_mc.rankin_mc.visible = false;
this.gameOver_mc.nextGame_mc.visible = true;
}
function frame5(){
stop();
this.gameOver_mc.visible = false;
this.gameOver_mc.alpha = 0;
this.gameOver_mc.rankin_mc.visible = false;
this.gameOver_mc.rankin_mc.rankName_txt.restrict = "^,<>";
this.counter = 0;
this.train_array = [];
this.train_array[0] = [0, 0, 1, 700, 2, 1400, 3, 2100, 4, 4200, 2, 6300, 0, 7000, 3, 8400, 1, 11200, 4, 12600];
this.train_array[1] = [1, 0, 3, 1000];
this.keysDown = [];
this.madokaPoint = 2;
this.madokaX = [35, 165, 295, 425, 555];
this.trainX = [0, 130, 260, 390, 520];
this.trainNow = [0, 0, 0, 0, 0];
this.beforeTrain = 0;
this.madokaMove = false;
this.stepCount = 0;
this.trainWait = 0;
this.trainNext = 200;
this.trainStage = 0;
this.trainOk = true;
this.score = 0;
this.hikareFlag = false;
this.gameOverFlag = false;
if (this.playBgmNo != 0){
this.playBgmLoop(0);
};
this.blackMask_mc.addEventListener(Event.ENTER_FRAME, this.xFadeInGame);
}
public function playSeLoop(_arg1){
if (this.playSeNo == -1){
this.playSeNo = _arg1;
this.sndCh = this.seList[_arg1].play(1, 1, this.sndTr);
this.sndCh.addEventListener(Event.SOUND_COMPLETE, this.gameSeComplete);
};
}
function frame1(){
stop();
this.hiScore = 0;
this.scoreName = "";
this.contextInit();
this.bgmVolume = 2;
this.seVolume = 2;
this.bgmList = new Dictionary();
this.playBgmNo = -1;
this.bgmTr = new SoundTransform();
this.bgmCh = new SoundChannel();
this.bgmTr.volume = (this.bgmVolume * 0.1);
this.bgmCh.soundTransform = this.bgmTr;
this.bgmLoopTime_array = [];
this.bgmLoopTime_array[0] = 0;
this.seList = new Dictionary();
this.playSeNo = -1;
this.sndTr = new SoundTransform();
this.sndCh = new SoundChannel();
this.sndTr.volume = (this.seVolume * 0.2);
this.sndCh.soundTransform = this.sndTr;
this.loadSound();
this.so = SharedObject.getLocal("madokatrain");
this.soInit();
this.info = root.loaderInfo;
stage.addEventListener(Event.ENTER_FRAME, this.xLoadEnter);
}
function frame4(){
stop();
gotoAndStop("game");
}
function frame2(){
stop();
this.testFlag = false;
this.XML_RANKING = "xml418501/ranking.xml";
if (this.testFlag == false){
this.XML_RANKING = ("xml418501/ranking.xml?" + new Date().getTime());
};
this.rankingScore_array = [];
this.rankingLastScore = 0;
this.rankingXmlLoader = new URLLoader();
this.rankingXmlLoader.addEventListener(Event.COMPLETE, this.xCompleteRanking);
this.rankingXmlLoader.addEventListener(IOErrorEvent.IO_ERROR, this.errorHandler);
this.rankingXmlLoader.load(new URLRequest(this.XML_RANKING));
}
public function xFadeInTitle(_arg1:Event):void{
this.blackMask_mc.alpha = (this.blackMask_mc.alpha - 0.05);
if (this.blackMask_mc.alpha < 0){
this.blackMask_mc.alpha = 0;
this.blackMask_mc.visible = false;
this.blackMask_mc.removeEventListener(Event.ENTER_FRAME, this.xFadeInTitle);
this.addTitleEvent();
};
}
public function xFadeGameToTitle(_arg1:Event):void{
this.blackMask_mc.alpha = (this.blackMask_mc.alpha + 0.05);
if (this.blackMask_mc.alpha >= 1){
this.stopBgm();
this.blackMask_mc.removeEventListener(Event.ENTER_FRAME, this.xFadeGameToTitle);
gotoAndStop("loadRanking");
};
}
public function addTitleEvent():void{
stage.addEventListener(KeyboardEvent.KEY_UP, this.xKeyUpTitle);
this.link1_mc.addEventListener(MouseEvent.CLICK, this.xClickLink1);
this.link2_mc.addEventListener(MouseEvent.CLICK, this.xClickLink2);
}
public function playSe(_arg1){
this.seList[_arg1].play(0, 1, this.sndTr);
}
public function gameOverCheck():void{
if (this.score > this.hiScore){
this.hiScore = this.score;
this.so.data.hiScore = this.hiScore;
if (this.rankingLastScore < this.score){
this.gameOver_mc.rankin_mc.rankName_txt.text = this.scoreName;
stage.focus = this.gameOver_mc.rankin_mc.rankName_txt;
this.gameOver_mc.rankin_mc.visible = true;
this.gameOver_mc.nextGame_mc.visible = false;
this.gameOver_mc.rankin_mc.send_btn.addEventListener(MouseEvent.CLICK, this.xClickRankSend);
this.gameOver_mc.rankin_mc.noSend_btn.addEventListener(MouseEvent.CLICK, this.xClickRankNoSend);
};
};
}
public function removeTitleEvent():void{
stage.removeEventListener(KeyboardEvent.KEY_UP, this.xKeyUpTitle);
this.link1_mc.removeEventListener(MouseEvent.CLICK, this.xClickLink1);
this.link2_mc.removeEventListener(MouseEvent.CLICK, this.xClickLink2);
}
public function gameBgmComplete(_arg1:Event):void{
this.bgmCh.removeEventListener(Event.SOUND_COMPLETE, this.gameBgmComplete);
this.bgmCh = null;
this.bgmCh = this.bgmList[this.playBgmNo].play(this.bgmLoopTime_array[this.playBgmNo], 1, this.bgmTr);
this.bgmCh.addEventListener(Event.SOUND_COMPLETE, this.gameBgmComplete);
}
public function xFadeGameToRetry(_arg1:Event):void{
this.blackMask_mc.alpha = (this.blackMask_mc.alpha + 0.05);
if (this.blackMask_mc.alpha >= 1){
this.blackMask_mc.removeEventListener(Event.ENTER_FRAME, this.xFadeGameToRetry);
gotoAndStop("reset");
};
}
public function xFadeInGame(_arg1:Event):void{
this.blackMask_mc.alpha = (this.blackMask_mc.alpha - 0.05);
if (this.blackMask_mc.alpha < 0){
this.blackMask_mc.alpha = 0;
this.blackMask_mc.visible = false;
this.blackMask_mc.removeEventListener(Event.ENTER_FRAME, this.xFadeInGame);
this.addGameEvent();
};
}
public function xEnterMain(_arg1:Event):void{
this.counter++;
if (this.hikareFlag == false){
if (this.madokaMove == false){
if (this.keysDown[Keyboard.LEFT] == true){
this.madokaPoint--;
this.madokaMove = true;
if (this.madokaPoint < 0){
this.madokaPoint = 0;
};
} else {
if (this.keysDown[Keyboard.RIGHT] == true){
this.madokaPoint++;
this.madokaMove = true;
if (this.madokaPoint > 4){
this.madokaPoint = 4;
};
};
};
};
if (this.madokaMove == true){
if (this.madoka_mc.x == this.madokaX[this.madokaPoint]){
this.madokaMove = false;
} else {
if (this.madoka_mc.x < this.madokaX[this.madokaPoint]){
this.madoka_mc.x = (this.madoka_mc.x + 13);
} else {
if (this.madoka_mc.x > this.madokaX[this.madokaPoint]){
this.madoka_mc.x = (this.madoka_mc.x - 13);
};
};
};
};
this.rails_mc.y = (this.rails_mc.y + 0.5);
if (this.rails_mc.y >= 960){
this.rails_mc.y = 0;
};
this.score_txt.text = (this.score + " ");
this.trainWait++;
if (this.trainWait >= this.trainNext){
this.addTrain();
this.trainWait = 0;
if (this.trainNext >= 100){
this.trainNext = (this.trainNext - 10);
} else {
this.trainNext = (this.trainNext - 2);
};
if (this.trainNext <= 50){
this.trainNext = 50;
};
};
} else {
if (this.gameOverFlag == false){
this.madoka_mc.y = (this.madoka_mc.y + 20);
if ((((this.stepCount == 0)) && ((this.madoka_mc.y >= 650)))){
if (this.gameOver_mc.visible == false){
this.gameOver_mc.score_txt.text = this.score.toString();
this.gameOver_mc.visible = true;
this.gameOverCheck();
};
this.gameOver_mc.alpha = (this.gameOver_mc.alpha + 0.05);
if (this.gameOver_mc.alpha >= 0.9){
this.stopSe();
this.gameOverFlag = true;
};
};
};
};
this.test_txt.text = this.trainNow.toString();
}
public function xFadeLoadToTitle(_arg1:Event):void{
this.blackMask_mc.alpha = (this.blackMask_mc.alpha + 0.05);
if (this.blackMask_mc.alpha >= 1){
this.blackMask_mc.removeEventListener(Event.ENTER_FRAME, this.xFadeLoadToTitle);
gotoAndStop("loadRanking");
};
}
public function xCompleteRanking(_arg1:Event):void{
var _loc2_:XML;
var _loc3_:XMLList;
var _loc4_:Array;
var _loc5_:Array;
var _loc6_:*;
_loc2_ = new XML(this.rankingXmlLoader.data);
_loc3_ = _loc2_.ranking;
_loc4_ = [];
for each (_loc2_ in _loc3_) {
_loc4_.push({name:_loc2_.name, score:_loc2_.score, player:_loc2_.player});
};
_loc4_.sortOn(["score"], [(Array.DESCENDING | Array.NUMERIC)]);
_loc5_ = [];
_loc6_ = 0;
while ((((this.rankingScore_array.length < 300)) && ((_loc6_ < _loc4_.length)))) {
if (_loc5_.indexOf(_loc4_[_loc6_].name.toString()) == -1){
this.rankingScore_array.push(_loc4_[_loc6_]);
_loc5_.push(_loc4_[_loc6_].name.toString());
};
_loc6_++;
};
_loc4_.sortOn(["score"], [(Array.DESCENDING | Array.NUMERIC)]);
_loc4_ = null;
_loc5_ = null;
if (this.rankingScore_array[299] != null){
this.rankingLastScore = this.rankingScore_array[299].score;
} else {
this.rankingLastScore = 0;
};
this.rankingXmlLoader.removeEventListener(Event.COMPLETE, this.xCompleteRanking);
this.rankingXmlLoader.removeEventListener(IOErrorEvent.IO_ERROR, this.errorHandler);
gotoAndStop("title");
}
public function addTrain2():void{
var _loc1_:*;
var _loc2_:MovieClip;
var _loc3_:*;
if (this.trainOk == true){
this.trainOk = false;
_loc1_ = 0;
while (_loc1_ < this.train_array[this.trainStage].length) {
_loc2_ = new TRAIN_MC();
_loc3_ = Math.floor((Math.random() * 5));
if (this.beforeTrain == _loc3_){
_loc3_++;
if (_loc3_ > 4){
_loc3_ = 0;
};
};
_loc2_.x = this.trainX[this.train_array[this.trainStage][_loc1_]];
_loc2_.y = ((-50 - _loc2_.height) - this.train_array[this.trainStage][(_loc1_ + 1)]);
this.stage_mc.addChild(_loc2_);
this.stepCount++;
_loc1_ = (_loc1_ + 2);
};
this.trainStage++;
if (this.train_array.length <= this.trainStage){
this.trainStage = 0;
};
};
}
public function updateRanking():void{
var _loc1_:*;
_loc1_ = 0;
_loc1_ = 0;
while (_loc1_ < 10) {
this.ranking_mc[(("list" + _loc1_) + "_mc")].rank_txt.text = ((((this.rankingPage * 10) + _loc1_) + 1) + "位 :");
if (this.rankingScore_array[((this.rankingPage * 10) + _loc1_)] != null){
this.ranking_mc[(("list" + _loc1_) + "_mc")].name_txt.text = this.rankingScore_array[((this.rankingPage * 10) + _loc1_)].name;
this.ranking_mc[(("list" + _loc1_) + "_mc")].score_txt.text = (this.rankingScore_array[((this.rankingPage * 10) + _loc1_)].score + " 回");
} else {
this.ranking_mc[(("list" + _loc1_) + "_mc")].name_txt.text = "-";
this.ranking_mc[(("list" + _loc1_) + "_mc")].score_txt.text = "-";
};
_loc1_++;
};
}
public function gameSeComplete(_arg1:Event):void{
this.sndCh.removeEventListener(Event.SOUND_COMPLETE, this.gameSeComplete);
if (this.hikareFlag == false){
this.playSeNo = -1;
this.playSeNo = 5;
this.sndCh = this.seList[this.playSeNo].play(0, 1, this.sndTr);
this.sndCh.addEventListener(Event.SOUND_COMPLETE, this.gameSeComplete);
};
}
public function updateVolume():void{
var _loc1_:*;
this.se_txt.text = "Se ";
_loc1_ = 0;
while (_loc1_ < this.seVolume) {
this.se_txt.appendText("☆");
_loc1_++;
};
this.bgm_txt.text = "Bgm ";
_loc1_ = 0;
while (_loc1_ < this.bgmVolume) {
this.bgm_txt.appendText("☆");
_loc1_++;
};
this.bgmTr.volume = (this.bgmVolume * 0.1);
this.bgmCh.soundTransform = this.bgmTr;
this.sndTr.volume = (this.seVolume * 0.2);
this.sndCh.soundTransform = this.sndTr;
this.so.data.bgmVolume = this.bgmVolume;
this.so.data.seVolume = this.seVolume;
}
public function contextInit():void{
var _loc1_:*;
var _loc2_:*;
_loc1_ = new ContextMenu();
_loc1_.hideBuiltInItems();
_loc2_ = new Sprite();
stage.addChildAt(_loc2_, 0);
_loc2_.graphics.beginFill(0xFF0000, 0);
_loc2_.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
_loc2_.graphics.endFill();
_loc2_.contextMenu = _loc1_;
}
public function stopBgm(){
this.bgmCh.removeEventListener(Event.SOUND_COMPLETE, this.gameBgmComplete);
this.bgmCh.stop();
this.playBgmNo = -1;
}
public function xClickLink1(_arg1:MouseEvent):void{
var _loc2_:String;
var _loc3_:URLRequest;
_loc2_ = "http://3-me.net/";
_loc3_ = new URLRequest(_loc2_);
navigateToURL(_loc3_, "_blank");
}
public function xClickLink2(_arg1:MouseEvent):void{
var _loc2_:String;
var _loc3_:URLRequest;
_loc2_ = "http://chacocco.blog94.fc2.com/";
_loc3_ = new URLRequest(_loc2_);
navigateToURL(_loc3_, "_blank");
}
public function soInit():void{
if (this.so.size == 0){
this.so.data.scoreName = "";
this.so.data.hiScore = 0;
this.so.data.bgmVolume = 2;
this.so.data.seVolume = 2;
} else {
if (this.so.data.scoreName != null){
this.scoreName = this.so.data.scoreName;
};
if (this.so.data.hiScore != null){
this.hiScore = this.so.data.hiScore;
};
if (this.so.data.bgmVolume != null){
this.bgmVolume = this.so.data.bgmVolume;
};
if (this.so.data.seVolume != null){
this.seVolume = this.so.data.seVolume;
};
};
}
public function removeGameEvent():void{
removeEventListener(Event.ENTER_FRAME, this.xEnterMain);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, this.xKeyDown);
stage.removeEventListener(KeyboardEvent.KEY_UP, this.xKeyUp);
}
public function xKeyUpTitle(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 90){
if (this.titleDisp == 0){
if (this.cursorNo == 0){
this.removeTitleEvent();
this.blackMask_mc.visible = true;
this.blackMask_mc.addEventListener(Event.ENTER_FRAME, this.xFadeTitleToGame);
} else {
if (this.cursorNo == 1){
this.titleDisp = 1;
this.ranking_mc.visible = true;
} else {
if (this.cursorNo == 2){
this.bgmVolume++;
if (this.bgmVolume > 5){
this.bgmVolume = 0;
};
this.updateVolume();
} else {
if (this.cursorNo == 3){
this.seVolume++;
if (this.seVolume > 5){
this.seVolume = 0;
};
this.updateVolume();
};
};
};
};
} else {
if (this.titleDisp == 1){
this.titleDisp = 0;
this.ranking_mc.visible = false;
};
};
this.playSe(1);
} else {
if (_arg1.keyCode == Keyboard.UP){
if (this.titleDisp == 0){
this.cursorNo--;
if (this.cursorNo < 0){
this.cursorNo = 0;
};
this.playSe(0);
this.cursor_mc.y = this.cursorX_array[this.cursorNo];
} else {
if (this.titleDisp == 1){
this.rankingPage--;
if (this.rankingPage < 0){
this.rankingPage = 0;
};
this.playSe(0);
this.updateRanking();
};
};
} else {
if (_arg1.keyCode == Keyboard.DOWN){
if (this.titleDisp == 0){
this.cursorNo++;
if (this.cursorNo > 3){
this.cursorNo = 3;
};
this.playSe(0);
this.cursor_mc.y = this.cursorX_array[this.cursorNo];
} else {
if (this.titleDisp == 1){
this.rankingPage++;
if (this.rankingPage > 29){
this.rankingPage = 29;
};
this.playSe(0);
this.updateRanking();
};
};
};
};
};
}
public function xKeyUp(_arg1:KeyboardEvent):void{
var _loc2_:String;
var _loc3_:String;
var _loc4_:URLRequest;
this.keysDown[_arg1.keyCode] = false;
if ((((this.gameOverFlag == true)) && ((this.gameOver_mc.rankin_mc.visible == false)))){
if (_arg1.keyCode == 90){
this.playSe(1);
this.removeGameEvent();
this.blackMask_mc.visible = true;
this.blackMask_mc.addEventListener(Event.ENTER_FRAME, this.xFadeGameToRetry);
} else {
if (_arg1.keyCode == Keyboard.SPACE){
this.playSe(1);
this.removeGameEvent();
this.blackMask_mc.visible = true;
this.blackMask_mc.addEventListener(Event.ENTER_FRAME, this.xFadeGameToTitle);
} else {
if (_arg1.keyCode == Keyboard.SHIFT){
this.playSe(1);
_loc2_ = escapeMultiByte((("まどかは " + this.score) + "回 避けたところで XXにXかれました。 http://bit.ly/ftrvsH #madoka_train"));
_loc3_ = ("http://twitter.com/intent/tweet?text=+" + _loc2_);
_loc4_ = new URLRequest(_loc3_);
navigateToURL(_loc4_, "_blank");
};
};
};
};
}
public function loadSound():void{
this.bgmList[0] = new BGM();
this.seList[0] = new cursor0();
this.seList[1] = new enter0();
this.seList[2] = new fue();
this.seList[3] = new train0();
this.seList[4] = new train1();
this.seList[5] = new train2();
this.seList[6] = new train3();
this.seList[7] = new miss0();
}
public function xFadeTitleToGame(_arg1:Event):void{
this.blackMask_mc.alpha = (this.blackMask_mc.alpha + 0.05);
if (this.blackMask_mc.alpha >= 1){
this.blackMask_mc.removeEventListener(Event.ENTER_FRAME, this.xFadeTitleToGame);
gotoAndStop("game");
};
}
public function playBgmLoop(_arg1){
this.playBgmNo = _arg1;
this.bgmCh = this.bgmList[_arg1].play(1, 1, this.bgmTr);
this.bgmCh.addEventListener(Event.SOUND_COMPLETE, this.gameBgmComplete);
}
public function registHiscore(_arg1:String, _arg2:int):void{
var param1:String = _arg1;
var param2 = _arg2;
var url:URLRequest;
var playerNo:int;
var variables:URLVariables;
var loader:URLLoader;
var nameStr:String = param1;
var scoreInt = param2;
url = new URLRequest(this.PHP_RANKING);
playerNo = 0;
variables = new URLVariables();
variables.name = nameStr;
variables.score = scoreInt;
variables.player = playerNo;
url.data = variables.toString();
url.method = URLRequestMethod.POST;
loader = new URLLoader();
try {
loader.load(url);
} catch(e:Error) {
};
url = null;
loader = null;
}
public function xClickRankSend(_arg1:MouseEvent):void{
this.playSe(1);
if (this.gameOver_mc.rankin_mc.rankName_txt.length != 0){
this.gameOver_mc.rankin_mc.send_btn.removeEventListener(MouseEvent.CLICK, this.xClickRankSend);
this.gameOver_mc.rankin_mc.noSend_btn.removeEventListener(MouseEvent.CLICK, this.xClickRankNoSend);
this.registHiscore(this.gameOver_mc.rankin_mc.rankName_txt.text, this.score);
this.scoreName = this.gameOver_mc.rankin_mc.rankName_txt.text;
this.so.data.scoreName = this.scoreName;
this.gameOver_mc.rankin_mc.visible = false;
this.gameOver_mc.nextGame_mc.visible = true;
};
}
public function addTrain():void{
var _loc1_:int;
var _loc2_:Boolean;
var _loc3_:*;
var _loc4_:Boolean;
var _loc5_:*;
var _loc6_:int;
var _loc7_:*;
var _loc8_:*;
var _loc9_:*;
var _loc10_:Boolean;
var _loc11_:Boolean;
var _loc12_:*;
var _loc13_:MovieClip;
_loc1_ = (Math.floor((Math.random() * 2)) + 1);
_loc1_ = 2;
_loc2_ = false;
_loc3_ = 0;
while (_loc3_ < _loc1_) {
_loc4_ = true;
_loc5_ = Math.floor((Math.random() * 5));
if (this.beforeTrain == _loc5_){
++_loc5_;
if (_loc5_ > 4){
_loc5_ = 0;
};
_loc4_ = false;
};
if (this.madokaPoint == _loc5_){
_loc8_ = (this.madokaPoint - 1);
_loc9_ = (this.madokaPoint + 1);
_loc10_ = false;
_loc11_ = false;
if ((((this.trainNow[_loc8_] >= 1)) || ((_loc8_ == -1)))){
_loc10_ = true;
};
if ((((this.trainNow[_loc9_] >= 1)) || ((_loc9_ == 5)))){
_loc11_ = true;
};
if ((((_loc10_ == true)) && ((_loc11_ == true)))){
_loc4_ = false;
};
};
_loc8_ = (_loc5_ - 1);
_loc9_ = (_loc5_ + 1);
_loc10_ = false;
_loc11_ = false;
if ((((this.trainNow[_loc8_] >= 1)) || ((_loc8_ == -1)))){
_loc10_ = true;
};
if ((((this.trainNow[_loc9_] >= 1)) || ((_loc9_ == 5)))){
_loc11_ = true;
};
if ((((((_loc10_ == true)) && ((_loc11_ == true)))) && ((((((_loc8_ == this.madokaPoint)) || ((_loc9_ == this.madokaPoint)))) || ((_loc5_ == this.madokaPoint)))))){
_loc4_ = false;
};
_loc6_ = 0;
_loc7_ = 0;
while (_loc7_ < this.trainNow.length) {
_loc6_ = (_loc6_ + this.trainNow[_loc7_]);
_loc7_++;
};
if (_loc6_ >= 4){
_loc4_ = false;
};
if (_loc4_ == true){
_loc12_ = 0;
switch (Math.floor((Math.random() * 3))){
case 0:
default:
_loc13_ = new TRAIN_MC();
break;
case 1:
_loc13_ = new TRAIN1_MC();
break;
case 2:
_loc13_ = new TRAIN2_MC();
};
_loc13_.x = this.trainX[_loc5_];
this.beforeTrain = _loc5_;
var _local14 = this.trainNow;
var _local15 = _loc5_;
var _local16 = (_local14[_local15] + 1);
_local14[_local15] = _local16;
_loc13_.railNo = _loc5_;
if (_loc3_ >= 1){
if (Math.floor((Math.random() * 3)) == 0){
_loc13_.y = (-50 - _loc13_.height);
} else {
_loc13_.y = (((-50 - _loc13_.height) - Math.floor((Math.random() * 400))) - 500);
};
} else {
_loc13_.y = (-50 - _loc13_.height);
};
_loc2_ = true;
this.stage_mc.addChild(_loc13_);
this.stepCount++;
};
_loc3_++;
};
if (_loc2_ == true){
this.playSe(2);
};
}
public function stopSe(){
this.sndCh.removeEventListener(Event.SOUND_COMPLETE, this.gameSeComplete);
this.sndCh.stop();
this.playSeNo = -1;
}
public function xLoadEnter(_arg1:Event):void{
var _loc2_:*;
_loc2_ = Math.floor(((this.info.bytesLoaded / this.info.bytesTotal) * 100));
if (this.info.bytesLoaded == this.info.bytesTotal){
stage.removeEventListener(Event.ENTER_FRAME, this.xLoadEnter);
this.blackMask_mc.addEventListener(Event.ENTER_FRAME, this.xFadeLoadToTitle);
};
}
}
}//package madokatrain2_fla
Section 3
//RANKIN_MC_25 (madokatrain2_fla.RANKIN_MC_25)
package madokatrain2_fla {
import flash.display.*;
import flash.text.*;
public dynamic class RANKIN_MC_25 extends MovieClip {
public var noSend_btn:SimpleButton;
public var rankName_txt:TextField;
public var send_btn:SimpleButton;
}
}//package madokatrain2_fla
Section 4
//RANKING_LIST_6 (madokatrain2_fla.RANKING_LIST_6)
package madokatrain2_fla {
import flash.display.*;
import flash.text.*;
public dynamic class RANKING_LIST_6 extends MovieClip {
public var score_txt:TextField;
public var name_txt:TextField;
public var rank_txt:TextField;
}
}//package madokatrain2_fla
Section 5
//RANKING_MC_5 (madokatrain2_fla.RANKING_MC_5)
package madokatrain2_fla {
import flash.display.*;
import flash.text.*;
public dynamic class RANKING_MC_5 extends MovieClip {
public var list9_mc:MovieClip;
public var list1_mc:MovieClip;
public var list4_mc:MovieClip;
public var list7_mc:MovieClip;
public var rankTitle_txt:TextField;
public var list2_mc:MovieClip;
public var list8_mc:MovieClip;
public var list5_mc:MovieClip;
public var list0_mc:MovieClip;
public var list3_mc:MovieClip;
public var list6_mc:MovieClip;
}
}//package madokatrain2_fla
Section 6
//TRAINHEAD_MC_30 (madokatrain2_fla.TRAINHEAD_MC_30)
package madokatrain2_fla {
import flash.display.*;
public dynamic class TRAINHEAD_MC_30 extends MovieClip {
public function TRAINHEAD_MC_30(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package madokatrain2_fla
Section 7
//BGM (BGM)
package {
import flash.media.*;
public dynamic class BGM extends Sound {
}
}//package
Section 8
//cursor0 (cursor0)
package {
import flash.media.*;
public dynamic class cursor0 extends Sound {
}
}//package
Section 9
//enter0 (enter0)
package {
import flash.media.*;
public dynamic class enter0 extends Sound {
}
}//package
Section 10
//fue (fue)
package {
import flash.media.*;
public dynamic class fue extends Sound {
}
}//package
Section 11
//miss0 (miss0)
package {
import flash.media.*;
public dynamic class miss0 extends Sound {
}
}//package
Section 12
//TRAIN_MC (TRAIN_MC)
package {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.printing.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class TRAIN_MC extends MovieClip {
public var railNo;
public var rectLeft:Number;
public var scrollSpeedY:Number;
public var head_mc:MovieClip;
public var rectRight:Number;
public var safeFlag:Boolean;
public var rootObj:MovieClip;
public var deleteFlag:Boolean;
public function TRAIN_MC(){
addFrameScript(0, frame1);
}
public function xEnterStep(_arg1:Event):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
this.y = (this.y + scrollSpeedY);
_local2 = rootObj.madoka_mc.x;
_local3 = (rootObj.madoka_mc.x + 40);
_local4 = rootObj.madoka_mc.y;
_local5 = (rootObj.madoka_mc.y + 80);
_local6 = (this.x - 0);
_local7 = (this.x + 100);
_local8 = this.y;
_local9 = (this.y + 1900);
if ((((((((((_local2 < _local7)) && ((_local3 > _local6)))) && ((_local4 < _local9)))) && ((_local5 > _local8)))) && ((rootObj.hikareFlag == false)))){
rootObj.playSe(7);
rootObj.hikareFlag = true;
};
if ((((this.y > 200)) && ((safeFlag == false)))){
safeFlag = true;
var _local10 = rootObj.trainNow;
var _local11 = railNo;
var _local12 = (_local10[_local11] - 1);
_local10[_local11] = _local12;
};
if (this.y > 650){
deleteFlag = true;
if (rootObj.hikareFlag == false){
rootObj.score++;
if ((rootObj.score % 10) == 0){
if (rootObj.madoka_mc.y > 180){
rootObj.madoka_mc.y = (rootObj.madoka_mc.y - 1);
};
};
};
};
if (deleteFlag == true){
removeThisObject();
};
}
public function removeThisObject():void{
if (rootObj != null){
removeEventListener(Event.ENTER_FRAME, xEnterStep);
rootObj.stepCount--;
rootObj = null;
this.parent.removeChild(this);
};
}
function frame1(){
stop();
rootObj = (this.root as MovieClip);
deleteFlag = false;
scrollSpeedY = 20;
rectLeft = 50;
rectRight = 50;
safeFlag = false;
if (Math.floor((Math.random() * 500)) == 0){
head_mc.gotoAndStop("rare");
};
rootObj.playSeLoop(5);
addEventListener(Event.ENTER_FRAME, xEnterStep);
}
}
}//package
Section 13
//train0 (train0)
package {
import flash.media.*;
public dynamic class train0 extends Sound {
}
}//package
Section 14
//train1 (train1)
package {
import flash.media.*;
public dynamic class train1 extends Sound {
}
}//package
Section 15
//TRAIN1_MC (TRAIN1_MC)
package {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.printing.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class TRAIN1_MC extends MovieClip {
public var railNo;
public var rectLeft:Number;
public var scrollSpeedY:Number;
public var head_mc:MovieClip;
public var rectRight:Number;
public var safeFlag:Boolean;
public var rootObj:MovieClip;
public var deleteFlag:Boolean;
public function TRAIN1_MC(){
addFrameScript(0, frame1);
}
public function xEnterStep(_arg1:Event):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
this.y = (this.y + scrollSpeedY);
_local2 = rootObj.madoka_mc.x;
_local3 = (rootObj.madoka_mc.x + 40);
_local4 = rootObj.madoka_mc.y;
_local5 = (rootObj.madoka_mc.y + 80);
_local6 = (this.x - 0);
_local7 = (this.x + 100);
_local8 = this.y;
_local9 = (this.y + 1150);
if ((((((((((_local2 < _local7)) && ((_local3 > _local6)))) && ((_local4 < _local9)))) && ((_local5 > _local8)))) && ((rootObj.hikareFlag == false)))){
rootObj.playSe(7);
rootObj.hikareFlag = true;
};
if ((((this.y > 200)) && ((safeFlag == false)))){
safeFlag = true;
var _local10 = rootObj.trainNow;
var _local11 = railNo;
var _local12 = (_local10[_local11] - 1);
_local10[_local11] = _local12;
};
if (this.y > 650){
deleteFlag = true;
if (rootObj.hikareFlag == false){
rootObj.score++;
if ((rootObj.score % 10) == 0){
if (rootObj.madoka_mc.y > 180){
rootObj.madoka_mc.y = (rootObj.madoka_mc.y - 1);
};
};
};
};
if (deleteFlag == true){
removeThisObject();
};
}
public function removeThisObject():void{
if (rootObj != null){
removeEventListener(Event.ENTER_FRAME, xEnterStep);
rootObj.stepCount--;
rootObj = null;
this.parent.removeChild(this);
};
}
function frame1(){
stop();
rootObj = (this.root as MovieClip);
deleteFlag = false;
scrollSpeedY = 20;
rectLeft = 50;
rectRight = 50;
safeFlag = false;
if (Math.floor((Math.random() * 500)) == 0){
head_mc.gotoAndStop("rare");
};
rootObj.playSeLoop(5);
addEventListener(Event.ENTER_FRAME, xEnterStep);
}
}
}//package
Section 16
//train2 (train2)
package {
import flash.media.*;
public dynamic class train2 extends Sound {
}
}//package
Section 17
//TRAIN2_MC (TRAIN2_MC)
package {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.printing.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class TRAIN2_MC extends MovieClip {
public var railNo;
public var rectLeft:Number;
public var scrollSpeedY:Number;
public var head_mc:MovieClip;
public var rectRight:Number;
public var safeFlag:Boolean;
public var rootObj:MovieClip;
public var deleteFlag:Boolean;
public function TRAIN2_MC(){
addFrameScript(0, frame1);
}
public function xEnterStep(_arg1:Event):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
this.y = (this.y + scrollSpeedY);
_local2 = rootObj.madoka_mc.x;
_local3 = (rootObj.madoka_mc.x + 40);
_local4 = rootObj.madoka_mc.y;
_local5 = (rootObj.madoka_mc.y + 80);
_local6 = (this.x - 0);
_local7 = (this.x + 100);
_local8 = this.y;
_local9 = (this.y + 450);
if ((((((((((_local2 < _local7)) && ((_local3 > _local6)))) && ((_local4 < _local9)))) && ((_local5 > _local8)))) && ((rootObj.hikareFlag == false)))){
rootObj.playSe(7);
rootObj.hikareFlag = true;
};
if ((((this.y > 200)) && ((safeFlag == false)))){
safeFlag = true;
var _local10 = rootObj.trainNow;
var _local11 = railNo;
var _local12 = (_local10[_local11] - 1);
_local10[_local11] = _local12;
};
if (this.y > 650){
deleteFlag = true;
if (rootObj.hikareFlag == false){
rootObj.score++;
if ((rootObj.score % 10) == 0){
if (rootObj.madoka_mc.y > 180){
rootObj.madoka_mc.y = (rootObj.madoka_mc.y - 1);
};
};
};
};
if (deleteFlag == true){
removeThisObject();
};
}
public function removeThisObject():void{
if (rootObj != null){
removeEventListener(Event.ENTER_FRAME, xEnterStep);
rootObj.stepCount--;
rootObj = null;
this.parent.removeChild(this);
};
}
function frame1(){
stop();
rootObj = (this.root as MovieClip);
deleteFlag = false;
scrollSpeedY = 20;
rectLeft = 50;
rectRight = 50;
safeFlag = false;
if (Math.floor((Math.random() * 500)) == 0){
head_mc.gotoAndStop("rare");
};
rootObj.playSeLoop(5);
addEventListener(Event.ENTER_FRAME, xEnterStep);
}
}
}//package
Section 18
//train3 (train3)
package {
import flash.media.*;
public dynamic class train3 extends Sound {
}
}//package