home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 145
/
MOBICLIC145.ISO
/
pc
/
DATA
/
DSS145
/
DSS145_11
/
DSS145_11.swf
/
scripts
/
dss145_11
/
CapsuleAlgo.as
< prev
Wrap
Text File
|
2012-07-18
|
4KB
|
116 lines
package dss145_11
{
import com.milanpresse.engine.Engine;
import com.milanpresse.engine.managers.PauseManager;
import com.milanpresse.engine.managers.TimelineManager;
import com.milanpresse.engine.medias.MediaSwf;
import com.milanpresse.engine.timelines.Timeline;
import com.milanpresse.engine.timelines.TimelineLinear;
import com.milanpresse.tools.GlobalesFunctions;
import flash.display.MovieClip;
import flash.net.SharedObject;
public class CapsuleAlgo
{
private var menu:MediaSwf;
private var menuTimeline:MovieClip;
private var menuTL:Timeline;
private var mainClip:MediaSwf;
private var mainTimeline:MovieClip;
private var _engine:Engine;
private var labelList:Array;
private var _timeline_:TimelineLinear;
private var _timelineManager:TimelineManager;
private var _pauseManager:PauseManager;
private var labelsCallback:Object;
private var firstLabel:String;
private var so:SharedObject;
private var gListDone:Array;
private var gDoneDepart:Boolean;
public function CapsuleAlgo(engine:Engine)
{
this.labelsCallback = {};
super();
this._engine = engine;
this._engine.playMusic({"code":"MU"});
this._engine.setSubtitles(this._engine.host.subtitlesOn);
this._engine.setFrameRate(12);
this.mainClip = this._engine.showSwf({
"code":"A_" + this._engine.config.moduleName,
"parent":this._engine.config.layers["content"]
});
this.mainTimeline = this.mainClip.swfContent;
this._timelineManager = new TimelineManager();
this._timeline_ = new TimelineLinear(this.mainTimeline,this._engine,this,this._timelineManager,this.labelsCallback);
this._engine.levelCZ = this._engine.config.layers["content"];
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;
var bt:BtRetour = new BtRetour(this._engine,this._timelineManager,this.so);
}
public function label_10() : void
{
this._engine.hideSwf({"code":"BT_RETOUR"});
}
public function G2D(value:int) : String
{
return GlobalesFunctions.gimme2digits(value);
}
public function endMODULE() : void
{
trace("fin du module");
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._pauseManager = new PauseManager(this._engine,this._timelineManager);
this._pauseManager.sleepMovie(this.mainTimeline);
}
public function wake() : void
{
this._pauseManager.wakeMovie(this.mainTimeline);
}
public function destroy() : void
{
this._engine.stopAllSounds();
this._timeline_.kilListeners();
}
}
}