home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 155
/
MOBICLIC155.ISO
/
mac
/
DATA
/
DSS155
/
DSS155_03
/
DSS155_03.swf
/
scripts
/
dss155_03
/
CapsuleAlgo.as
Wrap
Text File
|
2013-07-08
|
13KB
|
385 lines
package dss155_03
{
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.engine.typeargument.CommentObject;
import com.milanpresse.engine.typeargument.NoiseObject;
import com.milanpresse.tools.GlobalesFunctions;
import flash.display.MovieClip;
import flash.events.Event;
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 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;
public var gDrag:MovieClip = null;
public var gListeCible:Array;
private var playedDER_EPR:Boolean = false;
private var F_AIDE:InteractiveMovie;
private var gPieceSelected:MovieClip = null;
private var gZone:int;
private var CARTE:MovieClip;
private var gDoneSonAT:Boolean = false;
public function CapsuleAlgo(engine:Engine)
{
this.labelsCallback = {
"_01_07":this.testeFin,
"_02_05":this.testeFin,
"_03_06":this.testeFin,
"_04_05":this.testeFin
};
this.gListDone = [0,0,0,0];
this.gListeCible = [];
super();
this._engine = engine;
this._engine.playMusic({"code":"MU"});
this._engine.setSubtitles(this._engine.host.subtitlesOn);
this._engine.setFrameRate(24);
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.so = SharedObject.getLocal(this._engine.config.rubriqueName,"/");
this.so.data.gModule = this._engine.config.moduleNum;
this.so.flush();
this.firstLabel = this.mainTimeline.currentLabels[0].name;
this._timeline_.GotoAndPlayUntil({"labelStop":this.firstLabel});
}
public function label_09() : void
{
this._engine.showImage({
"code":"PH_09",
"parent":this.mainTimeline.anim.CADRE_PHOTO.PHOTO
});
}
public function label_10() : void
{
this._engine.showImage({
"code":"PH_10",
"parent":this.mainTimeline.anim.CADRE_PHOTO.PHOTO
});
}
public function labelATTENTE_01() : void
{
var myIm:InteractiveMovie = null;
var myIm2:InteractiveMovie = null;
var myIm3:InteractiveMovie = null;
trace("gDoneSonAT : " + this.gDoneSonAT);
if(this.gDoneSonAT == false)
{
this._engine.playComment(new CommentObject({"code":"AT_00"}));
this.gDoneSonAT = true;
}
this._engine.cursorInit({
"mc":this.mainTimeline.CURSEUR_CIBLE,
"parent":this.mainTimeline
});
for(var i:int = 1; i <= 4; i++)
{
myIm = new InteractiveMovie(this.mainTimeline["ZONE_" + this.G2D(i)],this._timelineManager);
myIm2 = new InteractiveMovie(this.mainTimeline["ICONE_" + this.G2D(i)],this._timelineManager);
myIm3 = new InteractiveMovie(this.mainTimeline["LM_Z_" + this.G2D(i)],this._timelineManager);
myIm3.mc.mouseEnabled = false;
myIm2.mc.pNum = i;
myIm2.mc.onPress = function(p:Object):void
{
_engine.playNoise(new NoiseObject({"code":"B_ZONE"}));
gZone = this.pNum;
_engine.cursor.destroy();
_timeline_.GotoAndPlayUntil({"labelStop":"_" + G2D(gZone) + "_01"});
};
myIm.mc.pNum = i;
myIm.mc.mcI = myIm;
myIm.mc.icone = myIm2;
myIm.mc.LM = myIm3;
if(this.gListDone[i - 1] == 0)
{
myIm.mc.rollOverFrame = "E0";
myIm.mc.rollOutFrame = "E0";
myIm2.gotoAndStop("E0");
myIm3.gotoAndStop("E1");
myIm.mc.onPress = function(p:Object):void
{
_engine.playNoise(new NoiseObject({"code":"B_ZONE"}));
this.mcI.gotoAndStop("E2");
this.rollOutFrame = "E1";
this.rollOverFrame = "E1";
this.icone.gotoAndStop("E1");
this.icone.activeMC();
this.LM.gotoAndStop("E2");
this.kill();
gZone = this.pNum;
gListDone[this.pNum - 1] = 1;
CARTE.removeEventListener(Event.ENTER_FRAME,CARTE.onEnterFrame);
_engine.cursor.change("fleche");
_engine.cursor.destroy();
_engine.playComment(new CommentObject({
"code":"AT_" + G2D(this.pNum),
"callback":goZone
}));
};
myIm.activeMC();
}
else
{
myIm.mc.rollOverFrame = "E2";
myIm.mc.rollOutFrame = "E1";
myIm2.gotoAndStop("E1");
myIm2.activeMC();
myIm3.gotoAndStop("E2");
}
myIm.gotoAndStop(myIm.mc.rollOutFrame);
if(this.gListDone[i - 1] == 0)
{
myIm.mc.BTN.useHandCursor = false;
}
}
this.CARTE = this.mainTimeline["CARTE"];
this.CARTE.mouseEnabled = false;
this.CARTE.onEnterFrame = function(p:Object):void
{
var pPixX:Number = NaN;
var pPixY:Number = NaN;
if(CARTE.hitTestPoint(mainTimeline.mouseX,mainTimeline.mouseY,true))
{
_engine.cursor.change("E1");
pPixX = mainTimeline.CURSEUR_CIBLE.x - CARTE.x + 250;
pPixY = mainTimeline.CURSEUR_CIBLE.y - CARTE.y + 250;
mainTimeline.CURSEUR_CIBLE.LONGITUDE.text = Math.round((117.3 - pPixX / 500) * 100) / 100 + " O";
mainTimeline.CURSEUR_CIBLE.LATITUDE.text = Math.round((37 - pPixY / 500) * 100) / 100 + " N";
}
else
{
_engine.cursor.change("fleche");
}
};
this.CARTE.addEventListener(Event.ENTER_FRAME,this.CARTE.onEnterFrame);
}
public function testeFin() : void
{
if(this.gListDone.indexOf(0) == -1)
{
this._timeline_.GotoAndPlayUntil({"labelStop":"_F_01"});
}
else
{
this._engine.playComment(new CommentObject({
"code":this.mainTimeline.currentFrameLabel.substr(1,this.mainTimeline.currentFrameLabel.length - 1),
"callback":this.retourATTENTE_01
}));
}
}
public function goZone() : void
{
this._timeline_.GotoAndPlayUntil({"labelStop":"_" + this.G2D(this.gZone) + "_01"});
}
public function retourATTENTE_01() : void
{
this._timeline_.GotoAndPlayUntil({"labelStop":"ATTENTE_01"});
}
public function label_01_04() : void
{
this._engine.showImage({
"code":"PH_01_04",
"parent":this.mainTimeline.anim.CADRE_PHOTO.PHOTO
});
}
public function label_01_06() : void
{
this._engine.showImage({
"code":"PH_01_06",
"parent":this.mainTimeline.anim.CADRE_PHOTO.PHOTO
});
}
public function label_02_04() : void
{
this._engine.showImage({
"code":"PH_02_04",
"parent":this.mainTimeline.anim.CADRE_PHOTO.PHOTO
});
}
public function label_03_02() : void
{
this._engine.showImage({
"code":"PH_03_02",
"parent":this.mainTimeline.anim.CADRE_PHOTO.PHOTO
});
}
public function label_03_05() : void
{
this._engine.showImage({
"code":"PH_03_05",
"parent":this.mainTimeline.anim.CADRE_PHOTO.PHOTO
});
}
public function label_04_02() : void
{
this._engine.showImage({
"code":"PH_04_02",
"parent":this.mainTimeline.anim.CADRE_PHOTO.PHOTO
});
}
public function label_04_04() : void
{
this._engine.showImage({
"code":"PH_04_04",
"parent":this.mainTimeline.anim.CADRE_PHOTO.PHOTO
});
}
public function labelATTENTE_02() : void
{
var myIm:InteractiveMovie = null;
trace("labelATTENTE_02 : ");
this._engine.cursorInit({
"mc":this.mainTimeline.CURSEUR_CIBLE,
"parent":this.mainTimeline
});
myIm = new InteractiveMovie(this.mainTimeline["ZONE"],this._timelineManager);
myIm.mc.onPress = function(p:Object):void
{
this.kill();
CARTE.removeEventListener(Event.ENTER_FRAME,CARTE.onEnterFrame);
_engine.cursor.change("fleche");
_engine.cursor.destroy();
_timeline_.nextLabel();
};
myIm.activeMC();
this.CARTE = this.mainTimeline["CARTE"];
this.CARTE.mouseEnabled = false;
this.CARTE.onEnterFrame = function(p:Object):void
{
var pPixX:Number = NaN;
var pPixY:Number = NaN;
if(CARTE.hitTestPoint(mainTimeline.mouseX,mainTimeline.mouseY,true))
{
_engine.cursor.change("E1");
pPixX = mainTimeline.CURSEUR_CIBLE.x - CARTE.x + 250;
pPixY = mainTimeline.CURSEUR_CIBLE.y - CARTE.y + 250;
mainTimeline.CURSEUR_CIBLE.LONGITUDE.text = Math.round((117.3 - pPixX / 500) * 100) / 100 + " O";
mainTimeline.CURSEUR_CIBLE.LATITUDE.text = Math.round((37 - pPixY / 500) * 100) / 100 + " N";
}
else
{
_engine.cursor.change("fleche");
}
};
this.CARTE.addEventListener(Event.ENTER_FRAME,this.CARTE.onEnterFrame);
}
public function G2D(value:int) : String
{
return GlobalesFunctions.gimme2digits(value);
}
public function GCI(lettre:String) : int
{
return GlobalesFunctions.getCharIndex(lettre);
}
public function GC(value:int) : String
{
return GlobalesFunctions.getChar(value);
}
public function endMODULE() : void
{
trace("fin du module");
this._engine.host.changeModule({"numMod":4});
}
public function sleep() : void
{
this._pauseManager = new PauseManager(this._engine,this._timelineManager);
this._pauseManager.sleepMovie(this.mainTimeline);
}
public function wake() : void
{
if(this._pauseManager != null)
{
this._pauseManager.wakeMovie(this.mainTimeline);
}
}
public function destroy() : void
{
this._engine.stopAllSounds();
this._timeline_.kilListeners();
}
}
}