home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 145
/
MOBICLIC145.ISO
/
pc
/
DATA
/
DSS145
/
DSS145_12
/
DSS145_12.swf
/
scripts
/
dss145_12
/
CapsuleAlgo.as
< prev
next >
Wrap
Text File
|
2012-07-19
|
7KB
|
205 lines
package dss145_12
{
import com.milanpresse.engine.Engine;
import com.milanpresse.engine.managers.TimelineManager;
import com.milanpresse.engine.medias.MediaSwf;
import com.milanpresse.engine.timelines.TimelineLinear;
import com.milanpresse.engineaddons.facades.EngineExt;
import com.milanpresse.engineaddons.initdisplayobject.ExtendedClip;
import com.milanpresse.tools.GlobalesFunctions;
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.SharedObject;
public class CapsuleAlgo
{
private var _e:EngineExt;
private var mainClip:MediaSwf;
private var mainTimeline:MovieClip;
private var _engine:Engine;
private var _timeline_:TimelineLinear;
private var _timelineManager:TimelineManager;
private var labelsCallback:Object;
private var firstLabel:String;
private var so:SharedObject;
private var gListDone:Array;
private var gListeObjet:Array;
private var gListeCibles:Array;
private var gListeCurrentCibles:Array;
private var gDoneDepart:Boolean;
private var BT_REJOUER2:ExtendedClip;
private var BT_RETOUR:BtRetour;
private var attenteJeu:AttenteJeu = null;
private var isSleeping:Boolean = false;
public function CapsuleAlgo(param1:Engine)
{
var engine:Engine = param1;
this.labelsCallback = {"_11":"prioAnim"};
super();
this.initStandardLinear(engine);
this.firstLabel = this.mainTimeline.currentLabels[0].name;
this._timeline_.GotoAndPlayUntil({"labelStop":this.firstLabel});
this.so = SharedObject.getLocal(this._engine.config.rubriqueName,"/");
this.gListDone = this.so.data.listDone;
this.gDoneDepart = this.gListDone[this._engine.config.moduleNum - 1] == 1;
this.BT_RETOUR = new BtRetour(this._engine,this._timelineManager,this.so);
this.BT_RETOUR.setFunctionHideCursorSpecial(function():void
{
});
this.BT_RETOUR.setFunctionShowCursorSpecial(function():void
{
});
}
public function initStandardLinear(param1:Engine) : void
{
this._engine = param1;
this._timelineManager = new TimelineManager();
this._e = new EngineExt(this._engine,this._timelineManager);
this._engine.logsTrace();
this._engine.playMusic({"code":"MU"});
this._engine.setSubtitles(this._engine.host.subtitlesOn);
this._engine.setFrameRate(12);
this._engine.levelCZ = this._engine.config.layers["content"];
this.mainClip = this._engine.showSwf({
"code":"A_" + this._engine.config.moduleName,
"parent":this._engine.config.layers["content"]
});
this.mainTimeline = this.mainClip.swfContent;
this._timeline_ = new TimelineLinear(this.mainTimeline,this._engine,this,this._timelineManager,this.labelsCallback);
this.firstLabel = this.mainTimeline.currentLabels[0].name;
}
public function labelATTENTE_11() : void
{
this._e.commentPlay({"code":"11"});
this.mainTimeline.addEventListener(MouseEvent.CLICK,this.frame_11_Handler);
this.mainTimeline.mouseEnabled = true;
this.mainTimeline.buttonMode = true;
this.mainTimeline.useHandCursor = true;
this.mainTimeline.enabled = true;
}
private function frame_11_Handler(param1:Event) : void
{
this.mainTimeline.removeEventListener(MouseEvent.CLICK,this.frame_11_Handler);
this._e.commentStop();
this.mainTimeline.mouseEnabled = false;
this.mainTimeline.buttonMode = false;
this.mainTimeline.useHandCursor = false;
this.mainTimeline.enabled = false;
this._timeline_.GotoAndPlayUntil({"labelStop":"_12"});
}
public function labelATTENTE_JEU() : void
{
this.attenteJeu = new AttenteJeu(this._e,this.mainTimeline.GAME_CONTAINER,this.labelATTENTE_JEU_CALLBACK);
this.attenteJeu.init();
}
private function labelATTENTE_JEU_CALLBACK() : void
{
this.attenteJeu.destroy();
this.attenteJeu = null;
this.BT_RETOUR.visible = false;
this.save();
this._timeline_.GotoAndPlayUntil({"labelStop":"ATTENTE_SUCCES"});
}
public function labelATTENTE_SUCCES() : void
{
this._e.noisePlay({
"code":"B_SUCCES",
"callback":this.labelATTENTE_SUCCES_CALLBACK
});
}
public function labelATTENTE_SUCCES_CALLBACK() : void
{
this._timeline_.GotoAndPlayUntil({"labelStop":"_14"});
}
public function G2D(param1:int) : String
{
return GlobalesFunctions.gimme2digits(param1);
}
public function save() : void
{
this.BT_RETOUR._gameWon = true;
this.gListDone[this._engine.config.moduleNum - 1] = 1;
if(this.gDoneDepart)
{
this.so.data.lastDone = 2;
}
else
{
this.so.data.lastDone = 1;
}
this.so.data.listDone = this.gListDone;
this.so.flush();
}
public function endMODULE() : void
{
this._engine.host.changeModule({"numMod":13});
}
public function sleep() : void
{
if(this.isSleeping)
{
return;
}
this.isSleeping = true;
if(this.attenteJeu != null)
{
this.attenteJeu.gamePause();
}
this._e.movieClipSleep(this.mainTimeline);
}
public function wake() : void
{
if(this.isSleeping == false)
{
return;
}
this.isSleeping = false;
if(this.attenteJeu != null)
{
this.attenteJeu.gameResume();
}
this._e.movieClipWake(this.mainTimeline);
}
public function destroy() : void
{
this.mainTimeline.removeEventListener(MouseEvent.CLICK,this.frame_11_Handler);
this._timeline_.kilListeners();
this._e.destroy();
}
}
}