home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 145
/
MOBICLIC145.ISO
/
pc
/
DATA
/
DSS145
/
DSS145_13
/
DSS145_13.swf
/
scripts
/
dss145_13
/
CapsuleAlgo.as
Wrap
Text File
|
2012-07-19
|
4KB
|
114 lines
package dss145_13
{
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.engine.timers.ExtendedTimer;
import com.milanpresse.tools.GlobalesFunctions;
import flash.display.MovieClip;
import flash.events.TimerEvent;
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;
private var timer:ExtendedTimer;
public function CapsuleAlgo(param1:Engine)
{
this.labelsCallback = {};
super();
this._engine = param1;
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.timer = new ExtendedTimer(2000);
}
public function G2D(param1:int) : String
{
return GlobalesFunctions.gimme2digits(param1);
}
public function endMODULE() : void
{
this.timer.addEventListener(TimerEvent.TIMER,this.reallyGo);
this.timer.start();
}
public function reallyGo(param1:TimerEvent) : void
{
this.timer.removeEventListener(TimerEvent.TIMER,this.reallyGo);
this._engine.host.changeModule({
"codeRub":this._engine.host.hostConfig.magSom,
"numMod":0
});
}
public function sleep() : void
{
this.timer.pause();
this._pauseManager = new PauseManager(this._engine,this._timelineManager);
this._pauseManager.sleepMovie(this.mainTimeline);
}
public function wake() : void
{
this.timer.resume();
this._pauseManager.wakeMovie(this.mainTimeline);
}
public function destroy() : void
{
this._engine.stopAllSounds();
this._timeline_.kilListeners();
}
}
}