home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 161
/
MOBICLIC161.ISO
/
pc
/
DATA
/
DSS161
/
DSS161_00
/
DSS161_00.swf
/
scripts
/
dss161_00
/
CapsuleAlgo.as
< prev
next >
Wrap
Text File
|
2014-01-15
|
11KB
|
318 lines
package dss161_00
{
import com.milanpresse.engine.managers.PauseManager;
import dss161.engineaddons.facades.GameEngine;
import dss161.engineaddons.gamesprotos.Actor;
import dss161.engineaddons.gamesprotos.actors.actorClip.ActorClip;
public class CapsuleAlgo
{
private var game:GameEngine;
private var mainTimeline:ActorClip;
protected var currentLabelActorGroup:Actor;
private var memoClip:MemoClip;
private var testBox:TestBox;
private var actor:Actor;
private var actorClip:ActorClip;
private var comeFromGame:Boolean = false;
private var _pauseManager_:PauseManager;
private var contentIsSleeping:Boolean = false;
public var toWake:Array;
public function CapsuleAlgo()
{
this.toWake = [];
super();
this.game = Actor.game;
this.game.framerate = 24;
this.game.levelCZ = this.game.config.layers.content;
this.game.moduleConfig = new ModuleConfig(this.game.config.XmlConfig.Module.Config.Params);
this.game.memo.clear("MODULE");
this.testBox = new TestBox(this.game,this);
this.testBox.visible = false;
this.currentLabelActorGroup = this.game.addActor(new Actor(this.game));
this.currentLabelActorGroup.name = "currentLabelActorGroup";
}
public function start() : void
{
var memoClip:MemoClip = null;
this.game.playMusic({"code":"MU"});
var savePoint:Object = this.game.memo.getValue("RUBRIQUE.savePoint",{
"mod":0,
"step":"INTRO"
});
if(savePoint.mod == 0 && savePoint.step == "INTRO")
{
this.showMainTimeline();
this.mainTimeline.gotoAndPlay("firstLabel");
}
else
{
memoClip = this.game.addActor({
"type":MemoClip,
"name":"memoClip",
"onNew":function():void
{
game.memo.clear("RUBRIQUE");
game.changeModule({"numMod":0});
},
"onContinue":function():void
{
var _loc1_:* = game.memo.getValue("RUBRIQUE.savePoint",{
"mod":0,
"step":"INTRO"
});
if(_loc1_.mod == 0)
{
showMainTimeline();
switch(_loc1_.step)
{
case "INTRO_JEU_PLANCHE":
mainTimeline.gotoAndPlay("_JEU_01_INTRO_1");
break;
case "FIN_JEU_PLANCHE":
mainTimeline.gotoAndPlay("_13");
break;
case "INTRO_JEU_INDICES":
mainTimeline.gotoAndPlay("_JEU_02_INTRO");
break;
case "FIN_JEU_INDICES":
mainTimeline.gotoAndPlay("_23");
}
}
else
{
game.changeModule({"numMod":_loc1_.mod});
}
}
});
}
Performer.dico[this.mainTimeline] = "maintimeline";
Performer.dico[memoClip] = "memoClip";
}
private function showMainTimeline() : void
{
this.mainTimeline = this.game.addActor({
"code":"A_" + this.game.config.moduleName,
"parent":this.game.config.layers.content
});
this.mainTimeline.labelATTENTE_01 = this.mainTimeline.label_JEU_01_INTRO_1 = function(param1:* = null):void
{
var result:* = param1;
game.memo.setValue("RUBRIQUE.savePoint.step","INTRO_JEU_PLANCHE");
var attente:* = currentLabelActorGroup.addActor({
"type":ATTENTE_01,
"container":mainTimeline,
"onEvent":function(param1:* = null):void
{
var result:* = param1;
if(result == "zap")
{
mainTimeline.gotoAndStop("_JEU_01_ZAP",{"labelLastCallback":function():void
{
mainTimeline.gotoAndPlay("WAIT_zanim14");
}});
}
else if(game.memo.getValue("MODULE.jeuplanche1",false))
{
mainTimeline.gotoAndStop("ATTENTE_02");
}
else
{
game.memo.setValue("MODULE.jeuplanche1",true);
mainTimeline.gotoAndPlay("_JEU_PLANCHE_01");
}
}
});
attente.name = "ATTENTE";
};
this.mainTimeline.label_JEU_PLANCHE_01 = this.mainTimeline.label_JEU_PLANCHE_02 = this.mainTimeline.label_JEU_PLANCHE_03 = this.mainTimeline.labelATTENTE_02 = function(param1:* = null):void
{
var result:* = param1;
var attente:* = currentLabelActorGroup.addActor({
"type":JEU_PLANCHE,
"container":mainTimeline,
"onEvent":function(param1:* = null):void
{
if(game.numCaptures < 10)
{
mainTimeline.gotoAndStop("ATTENTE_01");
}
else
{
game.memo.setValue("RUBRIQUE.savePoint.step","FIN_JEU_PLANCHE");
mainTimeline.gotoAndPlay("_13");
}
}
});
};
this.mainTimeline.labelATTENTE_03 = this.mainTimeline.label_JEU_02_INTRO = function(param1:* = null):void
{
var result:* = param1;
game.memo.setValue("RUBRIQUE.savePoint.step","INTRO_JEU_INDICES");
var attente:* = currentLabelActorGroup.addActor({
"type":ATTENTE_03,
"container":mainTimeline,
"onEvent":function(param1:* = null):void
{
var result:* = param1;
if(result == "zap")
{
game.memo.setValue("RUBRIQUE.savePoint.step","FIN_JEU_INDICES");
mainTimeline.gotoAndPlay("_JEU_02_ZONE_01");
return;
}
mainTimeline.gotoAndStop("_JEU_02_ZONE_0" + result,{"labelLastCallback":function():void
{
var _loc1_:* = 0;
var _loc2_:* = 1;
while(_loc2_ <= 5)
{
if(game.memo.getValue("MODULE.zone" + _loc2_,false))
{
_loc1_++;
}
_loc2_++;
}
if(_loc1_ < 5)
{
mainTimeline.gotoAndStop("ATTENTE_03");
}
else
{
game.memo.setValue("RUBRIQUE.savePoint.step","FIN_JEU_INDICES");
mainTimeline.gotoAndPlay("_23");
}
}});
}
});
};
this.mainTimeline.onLabelExit = function(param1:* = null):void
{
currentLabelActorGroup.destroyChildren();
};
this.mainTimeline.endMODULE = this.endMODULE;
}
public function restart() : void
{
this.game.memo.clear("MODULE");
this.mainTimeline.gotoAndPlay("firstLabel");
}
public function endMODULE() : void
{
this.game.memo.setValue("RUBRIQUE.savePoint",{"mod":1});
this.game.changeModule({"numMod":1});
}
public function sleep() : void
{
this.toWake = [];
}
public function wake() : void
{
var _loc1_:int = 0;
while(_loc1_ < this.toWake.length)
{
this.toWake[_loc1_]();
_loc1_++;
}
}
public function destroy() : void
{
var _loc1_:* = undefined;
this.currentLabelActorGroup.destroy();
this.currentLabelActorGroup = null;
for(_loc1_ in this.mainTimeline)
{
if(this.mainTimeline[_loc1_] is Function)
{
this.mainTimeline[_loc1_] = null;
}
}
this.mainTimeline = null;
this.currentLabelActorGroup = null;
this.testBox = null;
this.actorClip = null;
this.game = null;
}
}
}
import dss161.engineaddons.gamesprotos.Actor;
import dss161.engineaddons.gamesprotos.actors.actorClip.ActorClip;
class MemoClip extends Actor
{
private var memoClip:ActorClip;
function MemoClip(param1:* = null)
{
var params:* = param1;
super();
this.memoClip = game.addActor({
"code":"A_" + game.config.moduleName + "_MEMO",
"parent":game.config.layers.content
});
if(game.memo.getValue("RUBRIQUE.allFinished",false) == false)
{
this.memoClip.addActor({
"mc":this.memoClip.getChildByName("BT_REPRISE"),
"onRollOverState":{
"label":"E2",
"noiseCode":"B_ROLL"
},
"onRollOutState":{"label":"E1"},
"onClick":function(param1:ActorClip):void
{
game.noisePlay({"code":"B_REP"});
params.onContinue();
},
"enabled":true
});
}
else
{
this.memoClip.gotoAndStop(2);
}
this.memoClip.addActor({
"mc":this.memoClip.getChildByName("BT_NEW"),
"onRollOverState":{
"label":"E2",
"noiseCode":"B_ROLL"
},
"onRollOutState":{"label":"E1"},
"onClick":function(param1:ActorClip):void
{
game.noisePlay({"code":"B_NEW"});
params.onNew();
},
"enabled":true
});
}
override protected function _destroy() : void
{
this.memoClip = null;
}
}