home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 148
/
MOBICLIC148.ISO
/
mac
/
DATA
/
DSS148
/
DSS148_00
/
DSS148_00.swf
/
scripts
/
dss148_00
/
CapsuleAlgo.as
Wrap
Text File
|
2012-10-16
|
8KB
|
231 lines
package dss148_00
{
import com.milanpresse.engine.Engine;
import com.milanpresse.engine.initmovieclip.InteractiveMovie;
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.engineaddons.facades.EngineExt;
import com.milanpresse.engineaddons.initdisplayobject.ExtendedClip;
import com.milanpresse.tools.debug.TestBox;
import dss148.Commun;
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;
public var _engine:Engine;
public var _e:EngineExt;
private var labelList:Array;
private var _timeline_:TimelineLinear;
public var _timelineManager:TimelineManager;
private var _pauseManager:PauseManager;
private var labelsCallback:Object;
private var firstLabel:String;
private var so:SharedObject;
private var goLabelATTENTE:String;
private var BT_ZAP_INTRO:InteractiveMovie;
private var zapIntroDone:Boolean = false;
private var gClic:int;
private var gRoll:MovieClip;
private var gListDone:Array;
private var gDoneMythe:Boolean = false;
private var gFromNumMod:int;
private var TRANSITION:InteractiveMovie;
private var gImageNum:int;
private var playedDER_EPR:Boolean = false;
private var _commun:Commun;
private var testBox:TestBox;
private var choixPartie:ExtendedClip;
public function CapsuleAlgo(param1:Engine, param2:Commun)
{
var btn:ExtendedClip = null;
var engine:Engine = param1;
var commun:Commun = param2;
this.labelsCallback = {};
super();
this._engine = engine;
this._engine.playMusic({"code":"MU"});
this._engine.setSubtitles(this._engine.host.subtitlesOn);
this._engine.setFrameRate(12);
this._engine.levelCZ = this._engine.config.layers["top"];
this._timelineManager = new TimelineManager();
this._e = new EngineExt(this._engine,this._timelineManager);
this._commun = commun;
this._commun.init(this);
if(this._commun.memo.savePoint.moduleNum == 0 && this._commun.memo.savePoint.status == "NEW_GAME")
{
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._timeline_.GotoAndStop(1);
this.mainTimeline.visible = false;
}
this.testBox = new TestBox(this._engine);
this.testBox.buttons = [{
"name":"CHOIX",
"label":"Aller au CHOIX"
}];
this.testBox.onClick = function(param1:String):void
{
switch(param1)
{
case "CHOIX":
_engine.stopComment();
if(mainTimeline != null)
{
mainTimeline.visible = false;
_timeline_.GotoAndStop(1);
}
_commun.memo.savePoint = {"status":"CHOIX"};
_commun.memo.save();
_commun.ecranChoixShow();
}
};
this.testBox.visible = false;
if(this._commun.memo.savePoint.moduleNum == 0 && this._commun.memo.savePoint.status == "NEW_GAME")
{
if(this.mainTimeline != null)
{
this._timeline_.GotoAndPlayUntil({"labelStop":"WAIT_zanim01"});
this.mainTimeline.visible = true;
}
}
else
{
this.choixPartie = new ExtendedClip(this._engine.showSwf({
"code":"A_" + this._e.config.rubriqueName + "_MEMO",
"parent":this._engine.config.layers["content"]
}).swfContent as MovieClip,this._e);
this.choixPartie.gotoAndStop("ATTENTE");
this.choixPartie.movie.mouseChildren = true;
this.choixPartie.movie.useHandCursor = false;
btn = new ExtendedClip(this.choixPartie.getChildByName("BT_NEW") as MovieClip,this._e);
btn.onRollOverState = {
"label":"E2",
"noiseCode":"B_NEW"
};
btn.onRollOutState = {"label":"E1"};
btn.timeline = new Timeline(btn.movie,this._timelineManager,this._engine);
btn.onPress = function():void
{
this.enabled = false;
_e.noisePlay({"code":"B_CLIC"});
_commun.memo.clear();
this.timeline.GotoAndPlayUntil({
"labelPlay":"E3",
"beforelabelStop":"FIN",
"callback":function():void
{
_engine.host.changeModule({"numMod":0});
}
});
};
btn.init();
btn.enabled = true;
btn = new ExtendedClip(this.choixPartie.getChildByName("BT_REPRISE") as MovieClip,this._e);
btn.onRollOverState = {
"label":"E2",
"noiseCode":"B_REP"
};
btn.onRollOutState = {"label":"E1"};
btn.timeline = new Timeline(btn.movie,this._timelineManager,this._engine);
btn.onPress = function():void
{
this.enabled = false;
_e.noisePlay({"code":"B_CLIC"});
this.timeline.GotoAndPlayUntil({
"labelPlay":"E3",
"beforelabelStop":"FIN",
"callback":function():void
{
if(_commun.memo.nbModulesFinished >= 5)
{
_engine.host.changeModule({"numMod":5});
}
else if(_commun.memo.savePoint.moduleNum != 0 && _commun.memo.modules[_commun.memo.savePoint.moduleNum].vu == false)
{
_engine.host.changeModule({"numMod":_commun.memo.savePoint.moduleNum});
}
else
{
choixPartie.visible = false;
_commun.ecranChoixShow();
}
}
});
};
btn.init();
btn.enabled = true;
}
}
public function endMODULE() : void
{
this._commun.memo.savePoint = {"status":"CHOIX"};
this._commun.memo.save();
this._commun.ecranChoixShow();
}
public function sleep() : void
{
this._pauseManager = new PauseManager(this._engine,this._timelineManager);
this._pauseManager.sleepMovie(this._engine.config.scene);
}
public function wake() : void
{
if(this._pauseManager != null)
{
this._pauseManager.wakeMovie(this._engine.config.scene);
}
}
public function destroy() : void
{
this._engine.stopAllSounds();
this._timeline_.kilListeners();
}
}
}