home *** CD-ROM | disk | FTP | other *** search
- package dss160_00
- {
- import com.milanpresse.engine.*;
- import com.milanpresse.engine.initmovieclip.*;
- import com.milanpresse.engine.managers.*;
- import com.milanpresse.engine.medias.*;
- import com.milanpresse.engine.timelines.*;
- import com.milanpresse.engine.timers.ExtendedTimer;
- import com.milanpresse.engine.typeargument.*;
- import com.milanpresse.tools.GlobalesFunctions;
- import flash.display.*;
- import flash.events.TimerEvent;
- import flash.net.*;
- import flash.text.AntiAliasType;
- import flash.text.TextField;
- import flash.text.TextFormat;
- import flash.text.TextFormatAlign;
-
- 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 saveClip:MediaSwf;
-
- private var saveTimeline:MovieClip;
-
- private var saveTl:Timeline;
-
- private var bulleRepriseMc:MovieClip;
-
- private var bulleNouvelleMc:MovieClip;
-
- private var question:int;
-
- private var myMc:MovieClip;
-
- private var myIm:InteractiveMovie;
-
- private var chatMc:MovieClip;
-
- private var chatIm:InteractiveMovie;
-
- private var timerMc:MovieClip;
-
- private var timerIm:InteractiveMovie;
-
- private var sandMc:MovieClip;
-
- private var sandIm:InteractiveMovie;
-
- private var bulleMc:MovieClip;
-
- private var bulleIm:InteractiveMovie;
-
- private var bulle2Mc:MovieClip;
-
- private var bulle2Im:InteractiveMovie;
-
- private var okAnnulMc:MovieClip;
-
- private var okAnnulIm:InteractiveMovie;
-
- private var okMc:MovieClip;
-
- private var okIm:InteractiveMovie;
-
- private var annulerMc:MovieClip;
-
- private var annulerIm:InteractiveMovie;
-
- private var zoneQMc:MovieClip;
-
- private var zoneQIm:InteractiveMovie;
-
- private var flecheGMc:MovieClip;
-
- private var flecheGIm:InteractiveMovie;
-
- private var flecheDMc:MovieClip;
-
- private var flecheDIm:InteractiveMovie;
-
- private var fondClicMc:MovieClip;
-
- private var fondClicIm:InteractiveMovie;
-
- private var listPersos:Array;
-
- private var listReponses:Array;
-
- private var nbPerso:int;
-
- private var perso:int;
-
- private var sandTimer:ExtendedTimer;
-
- private var J02Timer:ExtendedTimer;
-
- private var doneAide2:Boolean;
-
- private var doneAide34:Boolean;
-
- private var nbEliminated:int;
-
- private var lastStele:MovieClip;
-
- private var persoDone:Array;
-
- private var tourFait:Boolean;
-
- private var correctAnswer: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.so = SharedObject.getLocal(this._engine.config.rubriqueName,"/");
- this.firstLabel = "WAIT_zanim00";
- trace("so.size",this.so.size);
- trace("so.data.ecranEnCours",this.so.data.ecranEnCours);
- trace("so.data.etatJeux",this.so.data.etatJeux);
- if(this.so.size == 0)
- {
- this.so.data.ecranEnCours = 0;
- this.so.data.etatJeux = new Array(0,0,0,0);
- this.so.flush();
- }
- if(this._engine.config.callerParameters.fromCodeRub == "MOB")
- {
- this.so.data.startAgain = undefined;
- }
- if(this.so.data.ecranEnCours == 0 && this.so.data.startAgain !== 1)
- {
- switch(this.so.data.etatJeux[0])
- {
- case 0:
- this._timeline_.GotoAndPlayUntil({"labelStop":this.firstLabel});
- break;
- default:
- this._timeline_.GotoAndStop(1);
- this.initEnregistrement();
- }
- }
- else
- {
- this._timeline_.GotoAndStop(1);
- this.initEnregistrement();
- }
- }
-
- private function initEnregistrement() : void
- {
- var stringMemo:String = null;
- var myMc:InteractiveMovie = null;
- stringMemo = this._engine.config.moduleName + "_MEMO";
- this.saveClip = this._engine.showSwf({
- "code":stringMemo,
- "parent":this._engine.config.layers["content"]
- });
- this.saveTimeline = this.saveClip.swfContent;
- this.saveTl = new Timeline(this.saveTimeline,this._timelineManager);
- if(this.so.data.startAgain !== 1)
- {
- this.saveTl.GotoAndStop(1);
- myMc = new InteractiveMovie(this.saveTimeline["BT_REPRISE"],this._timelineManager);
- myMc.gotoAndStop(1);
- myMc.mc.mcI = myMc;
- this._engine.showLM({
- "id":"LM_REPRISE",
- "findModelIn":this.saveTimeline
- });
- myMc.mc.onRollOver = function(p:Object):void
- {
- this.mcI.gotoAndStop("E2");
- };
- myMc.mc.onRollOut = function(p:Object):void
- {
- this.mcI.gotoAndStop("E1");
- };
- myMc.mc.onPress = function(p:Object):void
- {
- this.kill();
- if(so.data.ecranEnCours == 0)
- {
- switch(so.data.etatJeux[0])
- {
- case 1:
- _timeline_.GotoAndPlayUntil({"labelStop":"ATTENTE_J_00"});
- break;
- case 2:
- _timeline_.GotoAndPlayUntil({"labelStop":"_16"});
- }
- _engine.hideSwf({"code":stringMemo});
- }
- else
- {
- _engine.host.changeModule({"numMod":so.data.ecranEnCours});
- }
- };
- myMc.activeMC();
- }
- else
- {
- this.saveTl.GotoAndStop("E2");
- }
- myMc = new InteractiveMovie(this.saveTimeline["BT_NEW"],this._timelineManager);
- myMc.gotoAndStop(1);
- myMc.mc.mcI = myMc;
- this._engine.showLM({
- "id":"LM_NEW",
- "findModelIn":this.saveTimeline
- });
- myMc.mc.onRollOver = function(p:Object):void
- {
- this.mcI.gotoAndStop("E2");
- };
- myMc.mc.onRollOut = function(p:Object):void
- {
- this.mcI.gotoAndStop("E1");
- };
- myMc.mc.onPress = function(p:Object):void
- {
- this.kill();
- so.clear();
- so.data.ecranEnCours = 0;
- so.data.etatJeux = new Array(0,0,0,0);
- so.flush();
- _engine.hideSwf({"code":stringMemo});
- _timeline_.GotoAndPlayUntil({"labelStop":firstLabel});
- };
- myMc.activeMC();
- }
-
- public function labelATTENTE_J_00() : void
- {
- this.so.data.etatJeux[0] = 1;
- this.so.flush();
- this.question = 1;
- this.showQuestion(1);
- this.initBTZap();
- this._engine.playComment(new CommentObject({
- "code":"J_00",
- "callback":this._timeline_.nextLabel
- }));
- }
-
- public function labelATTENTE_J_02() : void
- {
- this.question = 2;
- this.showQuestion(1);
- this._engine.playComment(new CommentObject({
- "code":"J_02",
- "callback":this.suiteJ02
- }));
- this.J02Timer = new ExtendedTimer(2000);
- this.J02Timer.addEventListener(TimerEvent.TIMER,this.demoQuestion);
- this.J02Timer.start();
- }
-
- private function demoQuestion(evt:TimerEvent) : void
- {
- this.question += 1;
- if(this.question == 9)
- {
- this.question = 1;
- }
- this.showQuestion(1);
- }
-
- private function suiteJ02() : void
- {
- this._timeline_.nextLabel();
- }
-
- public function labelATTENTE_J_03() : void
- {
- this._engine.playComment(new CommentObject({
- "code":"J_03",
- "callback":this.suiteJ02
- }));
- this.J02Timer.removeEventListener(TimerEvent.TIMER,this.demoQuestion);
- this.question = 2;
- this.showQuestion(1);
- }
-
- public function labelATTENTE() : void
- {
- this.doneAide2 = false;
- this.doneAide34 = false;
- this.listReponses = [[1,0,0,1,0,1,0,0],[0,1,1,0,0,0,1,0],[0,0,1,1,1,1,0,0],[1,1,0,0,1,0,1,1],[0,0,1,0,1,0,0,0],[1,0,0,0,0,0,0,1]];
- this.listPersos = GlobalesFunctions.randomArrayFromXtoY(1,6);
- trace("listPersos",this.listPersos);
- this.persoDone = [0,0,0,0,0,0];
- this.nbPerso = 0;
- this.tourFait = false;
- this.question = 1;
- this.showQuestion(0);
- this.initChat();
- this.initTimer();
- this.initAide();
- this.initValidAnnul();
- this.initZoneQ();
- this.initPersos();
- this.initZoneP();
- this.initFleches();
- this.initFondClic();
- this.initPerso();
- this.initLM();
- this.nbEliminated = 0;
- this.afficheAide(1,570,190);
- }
-
- private function initLM() : void
- {
- var textHolder:MovieClip = null;
- for(var i:int = 1; i <= 6; i++)
- {
- textHolder = this.mainTimeline["LM_P_" + this.G2D(i)];
- textHolder.visible = false;
- }
- }
-
- private function showQuestion(onIntro:int) : void
- {
- var textHolder:MovieClip = null;
- if(onIntro == 1)
- {
- textHolder = this.mainTimeline.LM_QUESTION;
- }
- else
- {
- textHolder = this.mainTimeline.ZONE_QUESTION.LM_QUESTION;
- }
- for(var i:int = 0; i < textHolder.numChildren; i++)
- {
- if(textHolder.getChildAt(i).name == "TEXT")
- {
- textHolder.removeChildAt(i);
- }
- }
- var id:String = "LM_Q_" + GlobalesFunctions.gimme2digits(this.question);
- var questionText:String = this._engine.config.texteManager.getTexteByID(id);
- var textfield:TextField = new TextField();
- textfield.name = "TEXT";
- textfield.width = textHolder.width;
- textfield.thickness = 0;
- textfield.text = questionText;
- textfield.embedFonts = true;
- textfield.antiAliasType = AntiAliasType.ADVANCED;
- textfield.selectable = false;
- var textFormat:TextFormat = new TextFormat("Arcena",20,10596,null,null,null,null,null,TextFormatAlign.CENTER,null,null,null,1);
- textfield.setTextFormat(textFormat);
- textHolder.addChild(textfield);
- }
-
- private function initChat() : void
- {
- this.chatMc = this.mainTimeline.CHAT;
- this.chatIm = new InteractiveMovie(this.chatMc,this._timelineManager);
- this.chatIm.gotoAndStop("E1");
- }
-
- private function initTimer() : void
- {
- this.timerMc = this.mainTimeline.TIMER;
- this.timerIm = new InteractiveMovie(this.timerMc,this._timelineManager);
- this.timerIm.gotoAndStop("E1");
- this.sandMc = this.timerMc.SAND;
- this.sandIm = new InteractiveMovie(this.sandMc,this._timelineManager);
- this.sandIm.gotoAndStop(1);
- this.sandTimer = new ExtendedTimer(1500);
- this.sandTimer.addEventListener(TimerEvent.TIMER,this.sandsOfTime);
- this.sandTimer.start();
- }
-
- private function sandsOfTime(evt:TimerEvent) : void
- {
- this.sandIm.gotoAndStop(this.sandIm.mc.currentFrame + 1);
- if(this.sandIm.mc.currentFrame == this.sandIm.mc.totalFrames)
- {
- this.correctAnswer = false;
- this.hideAide();
- this.hideValider();
- this.sandTimer.removeEventListener(TimerEvent.TIMER,this.sandsOfTime);
- this.killJeu();
- this.timerIm.gotoAndStop("E2");
- this._engine.playNoise(new NoiseObject({"code":"B_TIME"}));
- this._engine.playComment(new CommentObject({
- "code":"E_04",
- "callback":this.restartJeu
- }));
- this.chatIm.gotoAndStop("E2");
- }
- }
-
- private function killJeu() : void
- {
- this.chatIm.gotoAndStop("E1");
- this.zoneQIm.desactive();
- this.flecheDIm.desactive();
- this.flecheGIm.desactive();
- for(var i:int = 1; i <= 24; i++)
- {
- this.myMc = this.mainTimeline["PERSO_" + this.G2D(i)];
- this.myIm = new InteractiveMovie(this.myMc,this._timelineManager);
- this.myIm.desactive();
- }
- }
-
- private function restartJeu() : void
- {
- var i:int = 0;
- if(this.correctAnswer)
- {
- this.myMc = this.mainTimeline["ZONE_P_" + this.G2D(this.perso)];
- this.myIm = new InteractiveMovie(this.myMc,this._timelineManager);
- this.myIm.gotoAndStop("E2");
- this.myMc = this.mainTimeline["ZONE_P_" + this.G2D(this.perso)].ANIM.ANIM;
- this.myIm = new InteractiveMovie(this.myMc,this._timelineManager);
- this.myIm.gotoAndStop(1);
- }
- this.initPersos();
- this.sandIm.gotoAndStop(1);
- this.chatIm.gotoAndStop("E2");
- if(this.persoDone.indexOf(0) == -1)
- {
- this.so.data.etatJeux[0] = 2;
- this.so.flush();
- this._engine.playComment(new CommentObject({
- "code":"J_GAGNE",
- "callback":this.suiteZap
- }));
- for(i = 1; i <= 6; i++)
- {
- this.myMc = this.mainTimeline["ZONE_P_" + this.G2D(i)];
- this.myIm = new InteractiveMovie(this.myMc,this._timelineManager);
- this.myIm.gotoAndStop("E3");
- this.myMc = this.mainTimeline["ZONE_P_" + this.G2D(i)].ANIM.ANIM;
- this.myIm = new InteractiveMovie(this.myMc,this._timelineManager);
- this.myIm.gotoAndStop("E5");
- }
- }
- else
- {
- if(this.nbPerso == 6 && this.tourFait == false)
- {
- trace("TOURFAIT");
- trace("persoDone",this.persoDone);
- this.tourFait = true;
- }
- this.nbEliminated = 0;
- this.initPerso();
- this._engine.playComment(new CommentObject({
- "code":"J_SUITE",
- "callback":this.nextPerso
- }));
- }
- }
-
- private function nextPerso() : void
- {
- this.stopChat();
- this.initTimer();
- }
-
- private function initAide() : void
- {
- this.bulleMc = this.mainTimeline.BULLE_AIDE;
- this.bulleIm = new InteractiveMovie(this.bulleMc,this._timelineManager);
- this.bulleMc.visible = false;
- this.bulle2Mc = this.mainTimeline.BULLE_AIDE_02;
- this.bulle2Im = new InteractiveMovie(this.bulle2Mc,this._timelineManager);
- this.bulle2Mc.visible = false;
- }
-
- private function initValidAnnul() : void
- {
- this.okAnnulMc = this.mainTimeline.BULLE_AIDE_BT;
- this.okAnnulIm = new InteractiveMovie(this.okAnnulMc,this._timelineManager);
- this.okAnnulMc.visible = false;
- this.okMc = this.okAnnulMc.BT_VALIDER;
- this.okIm = new InteractiveMovie(this.okMc,this._timelineManager);
- this.okIm.gotoAndStop(1);
- this.okIm.mc.onRollOver = function(p:Object):void
- {
- _engine.playNoise(new NoiseObject({"code":"B_OK_01"}));
- this.gotoAndStop("E2");
- };
- this.okIm.mc.onRollOut = function(p:Object):void
- {
- _engine.stopNoise(new NoiseObject({"code":"B_OK_01"}));
- this.gotoAndStop("E1");
- };
- this.okIm.mc.onPress = function(p:Object):void
- {
- killJeu();
- sandTimer.removeEventListener(TimerEvent.TIMER,sandsOfTime);
- _engine.stopNoise(new NoiseObject({"code":"B_OK_01"}));
- _engine.playNoise(new NoiseObject({"code":"B_OK_02"}));
- hideValider();
- trace("perso",perso,lastStele.perso);
- if(perso == lastStele.perso)
- {
- _engine.playNoise(new NoiseObject({
- "code":"B_GOOD",
- "callback":suiteOK
- }));
- myMc = mainTimeline["ZONE_P_" + G2D(perso)];
- myIm = new InteractiveMovie(myMc,_timelineManager);
- myIm.gotoAndStop("E2");
- myMc = mainTimeline["ZONE_P_" + G2D(perso)].ANIM.ANIM;
- myIm = new InteractiveMovie(myMc,_timelineManager);
- myIm.gotoAndStop(1);
- }
- else
- {
- _engine.playNoise(new NoiseObject({
- "code":"B_BAD",
- "callback":suiteBad
- }));
- }
- };
- this.okIm.activeMC();
- this.annulerMc = this.okAnnulMc.BT_ANNUL;
- this.annulerIm = new InteractiveMovie(this.annulerMc,this._timelineManager);
- this.annulerIm.gotoAndStop(1);
- this.annulerIm.mc.onRollOver = function(p:Object):void
- {
- _engine.playNoise(new NoiseObject({"code":"B_ANNUL"}));
- this.gotoAndStop("E2");
- };
- this.annulerIm.mc.onRollOut = function(p:Object):void
- {
- _engine.stopNoise(new NoiseObject({"code":"B_ANNUL"}));
- this.gotoAndStop("E1");
- };
- this.annulerIm.mc.onPress = function(p:Object):void
- {
- _engine.stopNoise(new NoiseObject({"code":"B_ANNUL"}));
- hideValider();
- };
- this.annulerIm.activeMC();
- }
-
- private function suiteOK() : void
- {
- var textHolder:MovieClip = null;
- this.correctAnswer = true;
- this.myMc = this.mainTimeline["ZONE_P_" + this.G2D(this.perso)];
- this.myIm = new InteractiveMovie(this.myMc,this._timelineManager);
- this.myIm.gotoAndStop("E3");
- this.myMc = this.mainTimeline["ZONE_P_" + this.G2D(this.perso)].ANIM.ANIM;
- this.myIm = new InteractiveMovie(this.myMc,this._timelineManager);
- this.myIm.gotoAndStop(1);
- textHolder = this.mainTimeline["LM_P_" + this.G2D(this.perso)];
- textHolder.visible = true;
- this.chatIm.gotoAndStop("E2");
- this._engine.playComment(new CommentObject({
- "code":"S_" + this.G2D(this.perso),
- "callback":this.restartJeu
- }));
- this.persoDone[this.nbPerso - 1] = 1;
- trace("persoDone",this.persoDone);
- }
-
- private function suiteBad() : void
- {
- this.correctAnswer = false;
- var myEchec:int = int(GlobalesFunctions.randomInt(1,3));
- this.chatIm.gotoAndStop("E2");
- this._engine.playComment(new CommentObject({
- "code":"E_" + this.G2D(myEchec),
- "callback":this.restartJeu
- }));
- }
-
- private function afficheAide(myAide:int, myX:int, myY:int) : void
- {
- var textHolder:MovieClip = null;
- if(myAide == 4)
- {
- textHolder = this.mainTimeline.BULLE_AIDE_02.LM_AIDE;
- }
- else
- {
- textHolder = this.mainTimeline.BULLE_AIDE.LM_AIDE;
- }
- for(var i:int = 0; i < textHolder.numChildren; i++)
- {
- if(textHolder.getChildAt(i).name == "TEXT")
- {
- textHolder.removeChildAt(i);
- }
- }
- var id:String = "LM_AIDE_" + GlobalesFunctions.gimme2digits(myAide);
- var aideText:String = this._engine.config.texteManager.getTexteByID(id);
- var textfield:TextField = new TextField();
- textfield.name = "TEXT";
- textfield.width = textHolder.width;
- textfield.thickness = 0;
- textfield.text = aideText;
- textfield.embedFonts = true;
- textfield.antiAliasType = AntiAliasType.ADVANCED;
- textfield.selectable = false;
- textfield.wordWrap = true;
- var textFormat:TextFormat = new TextFormat("Arcena",14,7149611,null,null,null,null,null,TextFormatAlign.CENTER,null,null,null,1);
- textfield.setTextFormat(textFormat);
- textHolder.addChild(textfield);
- if(myAide == 4)
- {
- this.bulle2Mc.visible = true;
- this.bulle2Mc.x = myX;
- this.bulle2Mc.y = myY;
- }
- else
- {
- this.bulleMc.visible = true;
- this.bulleMc.x = myX;
- this.bulleMc.y = myY;
- }
- }
-
- private function hideAide() : void
- {
- this.bulleMc.visible = false;
- this.bulle2Mc.visible = false;
- }
-
- private function initZoneQ() : void
- {
- this.zoneQMc = this.mainTimeline.ZONE_QUESTION;
- this.zoneQIm = new InteractiveMovie(this.zoneQMc,this._timelineManager);
- this.zoneQIm.gotoAndStop(1);
- this.zoneQIm.mc.mcI = this.zoneQMc;
- this.zoneQIm.mc.onRollOver = function(p:Object):void
- {
- _engine.playNoise(new NoiseObject({"code":"B_QUESTION"}));
- this.mcI.gotoAndStop("E2");
- };
- this.zoneQIm.mc.onRollOut = function(p:Object):void
- {
- _engine.stopNoise(new NoiseObject({"code":"B_QUESTION"}));
- this.mcI.gotoAndStop("E1");
- };
- this.zoneQIm.mc.onPress = function(p:Object):void
- {
- this.mcI.gotoAndStop("E3");
- this.desactive();
- _engine.playNoise(new NoiseObject({"code":"B_CLIC"}));
- flecheDIm.desactive();
- flecheGIm.desactive();
- askCat();
- hideAide();
- };
- this.zoneQIm.activeMC();
- }
-
- private function askCat() : void
- {
- var catReponse:int = 0;
- catReponse = int(this.listReponses[this.perso - 1][this.question - 1]);
- if(catReponse == 1)
- {
- this._engine.playNoise(new NoiseObject({
- "code":"B_OUI",
- "callback":this.suiteCat
- }));
- this.chatIm.mc.gotoAndStop("E3");
- }
- else
- {
- this._engine.playNoise(new NoiseObject({
- "code":"B_NON",
- "callback":this.suiteCat
- }));
- this.chatIm.mc.gotoAndStop("E4");
- }
- }
-
- private function suiteCat() : void
- {
- this.stopChat();
- if(!this.doneAide2)
- {
- this.doneAide2 = true;
- this.afficheAide(2,650,370);
- }
- }
-
- private function stopChat() : void
- {
- this.zoneQIm.active();
- this.flecheDIm.active();
- this.flecheGIm.active();
- this.zoneQIm.mc.gotoAndStop("E1");
- this.chatIm.mc.gotoAndStop("E1");
- }
-
- private function initPersos() : void
- {
- var i:int;
- for(i = 1; i <= 24; i++)
- {
- this.myMc = this.mainTimeline["PERSO_" + this.G2D(i)];
- this.myIm = new InteractiveMovie(this.myMc,this._timelineManager);
- this.myIm.active();
- this.myIm.gotoAndStop(1);
- this.myIm.mc.eliminated = false;
- this.myIm.mc.perso = i;
- this.myIm.mc.onRollOver = function(p:Object):void
- {
- if(!this.eliminated)
- {
- this.gotoAndStop("E2");
- }
- else
- {
- this.gotoAndStop("E4");
- }
- };
- this.myIm.mc.onRollOut = function(p:Object):void
- {
- if(!this.eliminated)
- {
- this.gotoAndStop("E1");
- }
- else
- {
- this.gotoAndStop("E3");
- }
- };
- this.myIm.mc.onPress = function(p:Object):void
- {
- var myX:int = 0;
- if(!this.eliminated)
- {
- hideAide();
- if(!doneAide34)
- {
- doneAide34 = true;
- if(this.x > 680)
- {
- myX = 680;
- }
- else
- {
- myX = int(this.x);
- }
- afficheAide(4,myX,this.y - 70);
- if(this.x < 400)
- {
- afficheAide(3,585,185);
- }
- else
- {
- afficheAide(3,206,185);
- }
- }
- _engine.playNoise(new NoiseObject({"code":"B_SUP"}));
- this.gotoAndStop("E3");
- this.eliminated = true;
- nbEliminated += 1;
- doneAide2 = true;
- }
- else
- {
- hideAide();
- _engine.playNoise(new NoiseObject({"code":"B_AFF"}));
- this.gotoAndStop("E1");
- this.eliminated = false;
- nbEliminated -= 1;
- }
- if(nbEliminated == 23)
- {
- showValider();
- }
- else
- {
- hideValider();
- }
- };
- this.myIm.activeMC();
- }
- }
-
- private function showValider() : void
- {
- for(var i:int = 1; i <= 24; i++)
- {
- this.myMc = this.mainTimeline["PERSO_" + this.G2D(i)];
- if(this.myMc.eliminated == false)
- {
- this.lastStele = this.myMc;
- break;
- }
- }
- this.okAnnulMc.visible = true;
- this.okAnnulMc.x = this.lastStele.x;
- this.okAnnulMc.y = this.lastStele.y - 80;
- }
-
- private function hideValider() : void
- {
- this.okAnnulMc.visible = false;
- }
-
- private function initZoneP() : void
- {
- for(var i:int = 1; i <= 6; i++)
- {
- this.myMc = this.mainTimeline["ZONE_P_" + this.G2D(i)];
- this.myIm = new InteractiveMovie(this.myMc,this._timelineManager);
- this.myIm.gotoAndStop(1);
- }
- }
-
- private function initFleches() : void
- {
- this.flecheGMc = this.mainTimeline["FLE_G"];
- this.flecheGIm = new InteractiveMovie(this.flecheGMc,this._timelineManager);
- this.flecheGIm.gotoAndStop(1);
- this.flecheGIm.mc.onPress = function(p:Object):void
- {
- _engine.playNoise(new NoiseObject({"code":"B_FLE_G"}));
- question -= 1;
- if(question == 0)
- {
- question = 8;
- }
- showQuestion(0);
- hideAide();
- };
- this.flecheGIm.activeMC();
- this.flecheDMc = this.mainTimeline["FLE_D"];
- this.flecheDIm = new InteractiveMovie(this.flecheDMc,this._timelineManager);
- this.flecheDIm.gotoAndStop(1);
- this.flecheDIm.mc.onPress = function(p:Object):void
- {
- _engine.playNoise(new NoiseObject({"code":"B_FLE_D"}));
- question += 1;
- if(question == 9)
- {
- question = 1;
- }
- showQuestion(0);
- hideAide();
- };
- this.flecheDIm.activeMC();
- }
-
- private function initFondClic() : void
- {
- this.fondClicMc = this.mainTimeline.FOND_CLIC;
- this.fondClicIm = new InteractiveMovie(this.fondClicMc,this._timelineManager);
- this.fondClicIm.mc.onPress = function(p:Object):void
- {
- hideAide();
- };
- this.fondClicIm.activeMC();
- this.fondClicIm.mc.useHandCursor = false;
- }
-
- private function initPerso() : void
- {
- trace("listPersos",this.listPersos);
- if(this.tourFait)
- {
- this.nbPerso = GlobalesFunctions.randomInt(1,6);
- while(this.persoDone[this.nbPerso - 1] == 1)
- {
- this.nbPerso = GlobalesFunctions.randomInt(1,6);
- }
- }
- else
- {
- this.nbPerso += 1;
- }
- trace("nbPerso",this.nbPerso);
- this.perso = this.listPersos[this.nbPerso - 1];
- trace("perso à trouver",this.perso);
- }
-
- private function initBTZap() : void
- {
- this.myMc = this.mainTimeline.BT_ZAP;
- this.myIm = new InteractiveMovie(this.myMc,this._timelineManager);
- this.myIm.gotoAndStop(1);
- this.myIm.mc.onRollOver = function(p:Object):void
- {
- _engine.playNoise(new NoiseObject({"code":"B_ZAP"}));
- _engine.showIB({
- "id":"IB_ZAP",
- "x":this.x,
- "y":this.y + 25
- });
- };
- this.myIm.mc.onRollOut = function(p:Object):void
- {
- _engine.hideIB();
- };
- this.myIm.mc.onPress = function(p:Object):void
- {
- so.data.etatJeux[0] = 2;
- so.flush();
- killJeu();
- chatIm.gotoAndStop("E2");
- _engine.playComment(new CommentObject({
- "code":"J_PASSE",
- "callback":suiteZap
- }));
- };
- this.myIm.activeMC();
- }
-
- public function suiteZap() : void
- {
- this._timeline_.GotoAndPlayUntil({"labelStop":"WAIT_transition"});
- }
-
- public function G2D(value:int) : String
- {
- return GlobalesFunctions.gimme2digits(value);
- }
-
- private function goNextModule() : void
- {
- }
-
- public function endMODULE() : void
- {
- trace("fin du module");
- this.so.data.ecranEnCours = 1;
- this._engine.host.changeModule({"numMod":this.so.data.ecranEnCours});
- }
-
- 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();
- }
- }
- }
-
-