home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 145
/
MOBICLIC145.ISO
/
pc
/
DATA
/
DSS145
/
DSS145_10
/
DSS145_10.swf
/
scripts
/
dss145_10
/
CapsuleAlgo.as
< prev
next >
Wrap
Text File
|
2012-07-18
|
7KB
|
193 lines
package dss145_10
{
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.tools.GlobalesFunctions;
import flash.display.MovieClip;
import flash.display.Sprite;
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 gDoneDepart:Boolean;
private var _clipBloquant:Sprite;
private var BT_RETOUR:BtRetour;
private var CURSEUR:Cursor;
public function CapsuleAlgo(param1:Engine)
{
var engine:Engine = param1;
this.labelsCallback = {};
super();
this._engine = engine;
this._timelineManager = new TimelineManager();
this._e = new EngineExt(this._engine,this._timelineManager);
this._engine.logsTrace();
if(this._engine.config.musicOn == true)
{
this._engine.playMusic({"code":"MU"});
}
this._engine.setSubtitles(this._engine.host.subtitlesOn);
this._engine.setFrameRate(12);
this.CURSEUR = new Cursor(this._engine.getMediaSwf("CURSEUR").swfContent,this._engine.config.layers["top"]);
this._e.instanceToDestroyAdd(this.CURSEUR);
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._engine.levelCZ = this._engine.config.layers["content"];
this._clipBloquant = GlobalesFunctions.createRectangle({
"x":0,
"y":0,
"w":800,
"h":600,
"alpha":0
}) as MovieClip;
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 labelATTENTE_PARCHEMIN() : void
{
var _loc1_:AttenteParchemin = new AttenteParchemin(this._e,this.labelATTENTE_PARCHEMIN_CALLBACK);
var _loc2_:int = 1;
while(_loc2_ <= 10)
{
_loc1_.config.BUTTONS.push(this.mainTimeline.getChildByName("BT_" + GlobalesFunctions.gimme2digits(_loc2_)));
_loc2_++;
}
_loc1_.config.BT_CROIX = this.mainTimeline.getChildByName("BT_CROIX");
_loc1_.init();
}
private function labelATTENTE_PARCHEMIN_CALLBACK() : void
{
this._timeline_.GotoAndPlayUntil({"labelStop":"_12"});
}
public function labelATTENTE_JEU() : void
{
var _loc1_:AttenteJeu = new AttenteJeu(this._e,this.labelATTENTE_JEU_CALLBACK);
_loc1_.CURSEUR = this.CURSEUR;
_loc1_.config.CONTAINER = this.mainTimeline;
_loc1_.config.mainAlgo = this;
_loc1_.config.BT_REJOUER = this.mainTimeline.getChildByName("BT_REJOUER");
_loc1_.config.HERAKLES = this.mainTimeline.getChildByName("HERAKLES");
_loc1_.config.GERYON = this.mainTimeline.getChildByName("GERYON");
_loc1_.config.BT_FLECHE_DO = this.mainTimeline.getChildByName("BT_FLECHE_DO");
_loc1_.config.BT_FLECHE_UP = this.mainTimeline.getChildByName("BT_FLECHE_UP");
_loc1_.config.BT_AIDE = this.mainTimeline.getChildByName("BT_AIDE");
_loc1_.config.CLIP_AIDE = this.mainTimeline.getChildByName("CLIP_AIDE");
_loc1_.config.JAUGE = this.mainTimeline.getChildByName("JAUGE");
_loc1_.config.BLOC_QUESTIONS = this.mainTimeline.getChildByName("BANQUE_QUESTIONS");
_loc1_.config.BLOC_QUESTIONS_DRAG = new BANQUE_QUESTION();
_loc1_.init();
}
private function labelATTENTE_JEU_CALLBACK() : void
{
this.BT_RETOUR.visible = false;
this.save();
this._timeline_.GotoAndPlayUntil({"labelStop":"_16"});
}
public function labelATTENTE_FIN() : void
{
this.endMODULE();
}
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.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();
this._engine.host.changeModule({"numMod":0});
}
public function sleep() : void
{
this._e.movieClipSleep(this.mainTimeline);
}
public function wake() : void
{
this._e.movieClipWake(this.mainTimeline);
}
public function destroy() : void
{
this._timeline_.kilListeners();
this._e.destroy();
}
}
}