home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 161
/
MOBICLIC161.ISO
/
pc
/
DATA
/
ANI161
/
ANI161_00
/
ANI161_00.swf
/
scripts
/
ani_00
/
Console.as
< prev
next >
Wrap
Text File
|
2014-01-15
|
43KB
|
1,199 lines
package ani_00
{
import com.milanpresse.engine.Engine;
import com.milanpresse.engine.initmovieclip.InteractiveMovie;
import com.milanpresse.engine.managers.TimelineManager;
import com.milanpresse.engine.timelines.TimelineLinear;
import com.milanpresse.engine.typeargument.NoiseObject;
import com.milanpresse.tools.GlobalesFunctions;
import flash.display.MovieClip;
public class Console
{
private var mainTimeline:MovieClip;
private var _engine:Engine;
private var _levelFunction;
private var _timelineManager:TimelineManager;
private var _timeline_:TimelineLinear;
public var gOutil:String = "";
public function Console(mainClip:MovieClip, _e:Engine, levelFunction:*, timelineManager:TimelineManager, timeline:TimelineLinear)
{
var myMc:InteractiveMovie = null;
super();
var myListOutils:Array = ["03","04","05"];
this.mainTimeline = mainClip;
this._engine = _e;
this._levelFunction = levelFunction;
this._timelineManager = timelineManager;
this._timeline_ = timeline;
for(var i:int = 1; i <= 10; i++)
{
if(myListOutils.indexOf(GlobalesFunctions.gimme2digits(i)) == -1)
{
myMc = new InteractiveMovie(this.mainTimeline["OUTIL_" + GlobalesFunctions.gimme2digits(i)],this._timelineManager);
myMc.gotoAndStop("E1");
}
}
}
private function initOutil01() : void
{
var pOutil:String = "01";
var myMc:InteractiveMovie = new InteractiveMovie(this.mainTimeline["OUTIL_" + pOutil],this._timelineManager);
myMc.gotoAndStop("E1");
myMc.mc.pNum = pOutil;
myMc.mc.mcI = myMc;
myMc.mc.onRollOver = function(p:Object):void
{
if(_levelFunction.gDrag == null)
{
_engine.playNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.showIB({
"id":"IB" + this.pNum,
"reference":this,
"position":6
});
this.mcI.gotoAndPlayUntil({
"labelplay":"E2",
"beforeLabelStop":"E3"
});
}
};
myMc.mc.onRollOut = function(p:Object):void
{
if(_levelFunction.gDrag == null)
{
_engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.hideIB();
this.mcI.gotoAndStop("E1");
}
};
myMc.mc.onPress = function(p:Object):void
{
initAllOutils(this.pNum);
_engine.hideIB();
this.kill();
this.mcI.gotoAndStop("E3");
_engine.playNoise(new NoiseObject({"code":"B_DIODE"}));
var pLabel:String = "PLAY_" + this.pNum + "_DEBUT";
var pos:int = _timeline_.getPosFrameLabelByName(mainTimeline,pLabel) + 1;
_timeline_.GotoAndPlayUntil({
"labelPlay":pLabel,
"labelStop":mainTimeline.currentLabels[pos].frame - 1,
"callback":_timeline_.nextLabel
});
};
myMc.activeMC();
}
private function initOutil02() : void
{
var pOutil:String = "02";
var myMc:InteractiveMovie = new InteractiveMovie(this.mainTimeline["OUTIL_" + pOutil],this._timelineManager);
myMc.gotoAndStop("E1");
myMc.mc.pNum = pOutil;
myMc.mc.mcI = myMc;
myMc.mc.onRollOver = function(p:Object):void
{
if(_levelFunction.gDrag == null)
{
_engine.playNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.showIB({
"id":"IB" + this.pNum,
"reference":this,
"position":6
});
_engine.changeCursor("mainO");
this.mcI.gotoAndPlayUntil({
"labelplay":"E2",
"beforeLabelStop":"E3"
});
}
};
myMc.mc.onRollOut = function(p:Object):void
{
if(_levelFunction.gDrag == null)
{
_engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.hideIB();
_engine.changeCursor("auto");
this.mcI.gotoAndStop("E1");
}
};
myMc.mc.onMouseDown = function(p:Object):void
{
_engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.hideIB();
this.pY = this.stage.mouseY;
_levelFunction.gDrag = this;
this.pOk = 0;
_engine.changeCursor("mainF");
if(_engine.pad !== null)
{
_engine.pad.activated = false;
}
};
myMc.mc.onMouseUp = function(p:Object):void
{
var pLabel:String = null;
var pos:int = 0;
_levelFunction.gDrag = null;
if(this.pOk == 1)
{
initAllOutils(this.pNum);
this.kill();
_engine.changeCursor("auto");
this.mcI.gotoAndStop("E4");
pLabel = "PLAY_" + this.pNum + "_DEBUT";
pos = _timeline_.getPosFrameLabelByName(mainTimeline,pLabel) + 1;
_timeline_.GotoAndPlayUntil({
"labelPlay":pLabel,
"labelStop":mainTimeline.currentLabels[pos].frame - 1,
"callback":_timeline_.nextLabel
});
}
else if(this.hitTestPoint(this.stage.mouseX,this.stage.mouseY,true))
{
this.onRollOver(p);
}
else
{
this.onRollOut(p);
}
if(_engine.pad !== null)
{
_engine.pad.activated = true;
}
};
myMc.mc.onEnterFrame = function(p:Object):void
{
if(this.stage.mouseY - this.pY > 10)
{
if(this.pOk != 1)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 1;
this.mcI.gotoAndStop("E3");
}
else
{
if(this.pOk != 0)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 0;
this.mcI.gotoAndStop("E2_1");
}
};
myMc.activeDragAndDropMC({
"changeDepth":false,
"changePos":false
});
}
private function initOutil03() : void
{
var pOutil:String = "03";
var myMc:InteractiveMovie = new InteractiveMovie(this.mainTimeline["OUTIL_" + pOutil],this._timelineManager);
myMc.mc.pNum = pOutil;
myMc.mc.mcI = myMc;
myMc.mc.rollOverFrame = "E" + myMc.mc.pNbCran;
myMc.mc.rollOutFrame = "E" + myMc.mc.pNbCran;
myMc.gotoAndStop("E" + myMc.mc.pNbCran);
myMc.mc.onRollOver = function(p:Object):void
{
if(_levelFunction.gDrag == null)
{
_engine.playNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.showIB({
"id":"IB" + this.pNum,
"reference":this,
"position":6
});
_engine.changeCursor("mainO");
}
};
myMc.mc.onRollOut = function(p:Object):void
{
if(_levelFunction.gDrag == null)
{
_engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.hideIB();
_engine.changeCursor("auto");
}
};
myMc.mc.onMouseDown = function(p:Object):void
{
_engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.hideIB();
this.pY = this.stage.mouseY;
_levelFunction.gDrag = this;
this.pOk = 0;
_engine.changeCursor("mainF");
if(_engine.pad !== null)
{
_engine.pad.activated = false;
}
};
myMc.mc.onMouseUp = function(p:Object):void
{
var pLabel:String = null;
var pos:int = 0;
_engine.changeCursor("auto");
_levelFunction.gDrag = null;
switch(this.pOk)
{
case 0:
if(this.hitTestPoint(this.stage.mouseX,this.stage.mouseY,true))
{
this.onRollOver(p);
}
else
{
this.onRollOut(p);
}
break;
default:
initAllOutils(this.pNum);
this.kill();
this.mcI.gotoAndStop("E" + this.pNbCran + "_" + this.pOk);
pLabel = "PLAY_" + this.pNum + "_" + GlobalesFunctions.gimme2digits(this.pOk) + "_DEBUT";
pos = _timeline_.getPosFrameLabelByName(mainTimeline,pLabel) + 1;
_timeline_.GotoAndPlayUntil({
"labelPlay":pLabel,
"labelStop":mainTimeline.currentLabels[pos].frame - 1,
"callback":_timeline_.nextLabel
});
}
if(_engine.pad !== null)
{
_engine.pad.activated = true;
}
};
myMc.mc.onEnterFrame = function(p:Object):void
{
if(this.stage.mouseY - this.pY >= 30)
{
switch(this.pNbCran)
{
case 3:
if(this.pOk != 3)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 3;
this.mcI.gotoAndStop("E" + this.pNbCran + "_3");
break;
case 2:
if(this.pOk != 2)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 2;
this.mcI.gotoAndStop("E" + this.pNbCran + "_2");
break;
case 1:
if(this.pOk != 1)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 1;
this.mcI.gotoAndStop("E" + this.pNbCran + "_1");
}
}
else if(this.stage.mouseY - this.pY >= 20)
{
switch(this.pNbCran)
{
case 3:
case 2:
if(this.pOk != 2)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 2;
this.mcI.gotoAndStop("E" + this.pNbCran + "_2");
break;
case 1:
if(this.pOk != 1)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 1;
this.mcI.gotoAndStop("E" + this.pNbCran + "_1");
}
}
else if(this.stage.mouseY - this.pY >= 10)
{
if(this.pOk != 1)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 1;
this.mcI.gotoAndStop("E" + this.pNbCran + "_1");
}
else
{
if(this.pOk != 0)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 0;
this.mcI.gotoAndStop("E" + this.pNbCran);
}
};
myMc.activeDragAndDropMC({
"changeDepth":false,
"changePos":false
});
}
private function initOutil04() : void
{
var pOutil:String = "04";
var myMc:InteractiveMovie = new InteractiveMovie(this.mainTimeline["OUTIL_" + pOutil],this._timelineManager);
myMc.mc.pNum = pOutil;
myMc.mc.mcI = myMc;
if(myMc.mc.pNbCran == 1 && myMc.mc.etatActif == 2)
{
myMc.mc.rollOverFrame = "E" + Number(myMc.mc.pNbCran) + "_1_1-0";
myMc.mc.rollOutFrame = "E" + Number(myMc.mc.pNbCran) + "_1_1-0";
}
else
{
myMc.mc.rollOverFrame = "E" + myMc.mc.pNbCran;
myMc.mc.rollOutFrame = "E" + myMc.mc.pNbCran;
}
myMc.gotoAndStop(myMc.mc.rollOverFrame);
myMc.mc.onRollOver = function(p:Object):void
{
if(_levelFunction.gDrag == null)
{
_engine.playNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.showIB({
"id":"IB" + this.pNum,
"reference":this,
"position":6
});
_engine.changeCursor("mainO");
}
};
myMc.mc.onRollOut = function(p:Object):void
{
if(_levelFunction.gDrag == null)
{
_engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.hideIB();
_engine.changeCursor("auto");
}
};
myMc.mc.onMouseDown = function(p:Object):void
{
_engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.hideIB();
this.pX = this.stage.mouseX;
_levelFunction.gDrag = this;
this.pOk = 0;
_engine.changeCursor("mainF");
if(_engine.pad !== null)
{
_engine.pad.activated = false;
}
};
myMc.mc.onMouseUp = function(p:Object):void
{
var pLabel:String = null;
var pos:int = 0;
_engine.changeCursor("auto");
_levelFunction.gDrag = null;
switch(this.pOk)
{
case 0:
if(this.hitTestPoint(this.stage.mouseX,this.stage.mouseY,true))
{
this.onRollOver(p);
}
else
{
this.onRollOut(p);
}
break;
default:
initAllOutils(this.pNum);
this.kill();
this.mcI.gotoAndStop("E" + this.pNbCran + "_" + this.pOk);
pLabel = "PLAY_" + this.pNum + "_" + GlobalesFunctions.gimme2digits(this.pOk) + "_DEBUT";
pos = _timeline_.getPosFrameLabelByName(mainTimeline,pLabel) + 1;
_timeline_.GotoAndPlayUntil({
"labelPlay":pLabel,
"labelStop":mainTimeline.currentLabels[pos].frame - 1,
"callback":_timeline_.nextLabel
});
}
if(_engine.pad !== null)
{
_engine.pad.activated = true;
}
};
myMc.mc.onEnterFrame = function(p:Object):void
{
if(this.stage.mouseX - this.pX >= 30)
{
switch(this.pNbCran)
{
case 2:
if(this.pOk != 2)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 2;
this.mcI.gotoAndStop("E" + this.pNbCran + "_2");
break;
case 1:
if(this.etatActif == 2)
{
if(this.pOk != 2)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.mcI.gotoAndStop("E" + this.pNbCran + "_2_1-0");
this.pOk = 2;
}
else
{
if(this.pOk != 1)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.mcI.gotoAndStop("E" + this.pNbCran + "_1");
this.pOk = 1;
}
}
}
else if(this.stage.mouseX - this.pX >= 10)
{
switch(this.pNbCran)
{
case 2:
if(this.pOk != 1)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 1;
this.mcI.gotoAndStop("E" + this.pNbCran + "_1");
break;
case 1:
if(this.etatActif == 1)
{
if(this.pOk != 1)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 1;
this.mcI.gotoAndStop("E" + this.pNbCran + "_1");
}
}
}
else
{
if(this.pOk != 0)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 0;
if(this.pNbCran == 1 && this.etatActif == 2)
{
this.mcI.gotoAndStop("E" + this.pNbCran + "_1_1-0");
}
else
{
this.mcI.gotoAndStop("E" + this.pNbCran);
}
}
};
myMc.activeDragAndDropMC({
"changeDepth":false,
"changePos":false
});
}
private function initOutil05() : void
{
var pOutil:String = "05";
var myMc:InteractiveMovie = new InteractiveMovie(this.mainTimeline["OUTIL_" + pOutil],this._timelineManager);
myMc.mc.pNum = pOutil;
myMc.mc.mcI = myMc;
if(myMc.mc.pNbCran == 1 && myMc.mc.etatActif == 2)
{
myMc.mc.rollOverFrame = "E" + Number(myMc.mc.pNbCran) + "_1_1-0";
myMc.mc.rollOutFrame = "E" + Number(myMc.mc.pNbCran) + "_1_1-0";
}
else
{
myMc.mc.rollOverFrame = "E" + myMc.mc.pNbCran;
myMc.mc.rollOutFrame = "E" + myMc.mc.pNbCran;
}
myMc.gotoAndStop(myMc.mc.rollOverFrame);
myMc.mc.onRollOver = function(p:Object):void
{
if(_levelFunction.gDrag == null)
{
_engine.playNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.showIB({
"id":"IB" + this.pNum,
"reference":this,
"position":6
});
_engine.changeCursor("mainO");
}
};
myMc.mc.onRollOut = function(p:Object):void
{
if(_levelFunction.gDrag == null)
{
_engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.hideIB();
_engine.changeCursor("auto");
}
};
myMc.mc.onMouseDown = function(p:Object):void
{
_engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.hideIB();
this.pX = this.stage.mouseX;
_levelFunction.gDrag = this;
this.pOk = 0;
_engine.changeCursor("mainF");
if(_engine.pad !== null)
{
_engine.pad.activated = false;
}
};
myMc.mc.onMouseUp = function(p:Object):void
{
var pLabel:String = null;
var pos:int = 0;
_engine.changeCursor("auto");
_levelFunction.gDrag = null;
switch(this.pOk)
{
case 0:
if(this.hitTestPoint(this.stage.mouseX,this.stage.mouseY,true))
{
this.onRollOver(p);
}
else
{
this.onRollOut(p);
}
break;
default:
initAllOutils(this.pNum);
this.kill();
this.mcI.gotoAndStop("E" + this.pNbCran + "_" + this.pOk);
pLabel = "PLAY_" + this.pNum + "_" + GlobalesFunctions.gimme2digits(this.pOk) + "_DEBUT";
pos = _timeline_.getPosFrameLabelByName(mainTimeline,pLabel) + 1;
_timeline_.GotoAndPlayUntil({
"labelPlay":pLabel,
"labelStop":mainTimeline.currentLabels[pos].frame - 1,
"callback":_timeline_.nextLabel
});
}
if(_engine.pad !== null)
{
_engine.pad.activated = true;
}
};
myMc.mc.onEnterFrame = function(p:Object):void
{
if(this.stage.mouseX - this.pX >= 30)
{
switch(this.pNbCran)
{
case 2:
if(this.pOk != 2)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 2;
this.mcI.gotoAndStop("E" + this.pNbCran + "_2");
break;
case 1:
if(this.etatActif == 2)
{
if(this.pOk != 2)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.mcI.gotoAndStop("E" + this.pNbCran + "_2_1-0");
this.pOk = 2;
}
else
{
if(this.pOk != 1)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.mcI.gotoAndStop("E" + this.pNbCran + "_1");
this.pOk = 1;
}
}
}
else if(this.stage.mouseX - this.pX >= 10)
{
switch(this.pNbCran)
{
case 2:
if(this.pOk != 1)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 1;
this.mcI.gotoAndStop("E" + this.pNbCran + "_1");
break;
case 1:
if(this.etatActif == 1)
{
if(this.pOk != 1)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 1;
this.mcI.gotoAndStop("E" + this.pNbCran + "_1");
}
}
}
else
{
if(this.pOk != 0)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 0;
if(this.pNbCran == 1 && this.etatActif == 2)
{
this.mcI.gotoAndStop("E" + this.pNbCran + "_1_1-0");
}
else
{
this.mcI.gotoAndStop("E" + this.pNbCran);
}
}
};
myMc.activeDragAndDropMC({
"changeDepth":false,
"changePos":false
});
}
private function initOutil06() : void
{
var pOutil:String = "06";
var myMc:InteractiveMovie = new InteractiveMovie(this.mainTimeline["OUTIL_" + pOutil],this._timelineManager);
myMc.gotoAndStop("E1");
myMc.mc.pNum = pOutil;
myMc.mc.mcI = myMc;
myMc.mc.onRollOver = function(p:Object):void
{
if(_levelFunction.gDrag == null)
{
_engine.playNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.showIB({
"id":"IB" + this.pNum,
"reference":this,
"position":6
});
}
else
{
this.mcI.gotoAndStop("E1");
}
};
myMc.mc.onRollOut = function(p:Object):void
{
if(_levelFunction.gDrag == null)
{
_engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.hideIB();
}
};
myMc.mc.onPress = function(p:Object):void
{
initAllOutils(this.pNum);
_engine.hideIB();
this.kill();
this.mcI.gotoAndStop("E2");
_engine.playNoise(new NoiseObject({"code":"B_DIODE"}));
var pLabel:String = "PLAY_" + this.pNum + "_DEBUT";
var pos:int = _timeline_.getPosFrameLabelByName(mainTimeline,pLabel) + 1;
_timeline_.GotoAndPlayUntil({
"labelPlay":pLabel,
"labelStop":mainTimeline.currentLabels[pos].frame - 1,
"callback":_timeline_.nextLabel
});
};
myMc.activeMC();
}
private function initOutil07() : void
{
var pOutil:String = "07";
var myMc:InteractiveMovie = new InteractiveMovie(this.mainTimeline["OUTIL_" + pOutil],this._timelineManager);
myMc.gotoAndStop("E1");
myMc.mc.pNum = pOutil;
myMc.mc.mcI = myMc;
myMc.mc.onRollOver = function(p:Object):void
{
if(_levelFunction.gDrag == null)
{
_engine.playNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.showIB({
"id":"IB" + this.pNum,
"reference":this,
"position":6
});
_engine.changeCursor("mainO");
this.mcI.gotoAndPlayUntil({
"labelplay":"E2",
"beforeLabelStop":"E3"
});
}
};
myMc.mc.onRollOut = function(p:Object):void
{
if(_levelFunction.gDrag == null)
{
_engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.hideIB();
_engine.changeCursor("auto");
this.mcI.gotoAndStop("E1");
}
};
myMc.mc.onMouseDown = function(p:Object):void
{
_engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.hideIB();
this.pY = this.stage.mouseY;
_levelFunction.gDrag = this;
this.pOk = 0;
_engine.changeCursor("mainF");
if(_engine.pad !== null)
{
_engine.pad.activated = false;
}
};
myMc.mc.onMouseUp = function(p:Object):void
{
var pLabel:String = null;
var pos:int = 0;
_levelFunction.gDrag = null;
if(this.pOk == 1)
{
initAllOutils(this.pNum);
this.kill();
_engine.changeCursor("auto");
this.mcI.gotoAndStop("E4");
pLabel = "PLAY_" + this.pNum + "_DEBUT";
pos = _timeline_.getPosFrameLabelByName(mainTimeline,pLabel) + 1;
_timeline_.GotoAndPlayUntil({
"labelPlay":pLabel,
"labelStop":mainTimeline.currentLabels[pos].frame - 1,
"callback":_timeline_.nextLabel
});
}
else if(this.hitTestPoint(this.stage.mouseX,this.stage.mouseY,true))
{
this.onRollOver(p);
}
else
{
this.onRollOut(p);
}
if(_engine.pad !== null)
{
_engine.pad.activated = true;
}
};
myMc.mc.onEnterFrame = function(p:Object):void
{
if(this.stage.mouseY - this.pY > 30)
{
if(this.pOk != 1)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 1;
this.mcI.gotoAndStop("E3");
}
else
{
if(this.pOk != 0)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 0;
this.mcI.gotoAndStop("E2_1");
}
};
myMc.activeDragAndDropMC({
"changeDepth":false,
"changePos":false
});
}
private function initOutil08() : void
{
var pOutil:String = "08";
var myMc:InteractiveMovie = new InteractiveMovie(this.mainTimeline["OUTIL_" + pOutil],this._timelineManager);
myMc.gotoAndStop("E1");
myMc.mc.pNum = pOutil;
myMc.mc.mcI = myMc;
myMc.mc.onRollOver = function(p:Object):void
{
if(_levelFunction.gDrag == null)
{
_engine.playNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.showIB({
"id":"IB" + this.pNum,
"reference":this,
"position":6
});
_engine.changeCursor("mainO");
this.mcI.gotoAndPlayUntil({
"labelplay":"E2",
"beforeLabelStop":"E3"
});
}
};
myMc.mc.onRollOut = function(p:Object):void
{
if(_levelFunction.gDrag == null)
{
_engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.hideIB();
_engine.changeCursor("auto");
this.mcI.gotoAndStop("E1");
}
};
myMc.mc.onMouseDown = function(p:Object):void
{
_engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.hideIB();
this.pY = this.stage.mouseY;
_levelFunction.gDrag = this;
this.pOk = 0;
_engine.changeCursor("mainF");
if(_engine.pad !== null)
{
_engine.pad.activated = false;
}
};
myMc.mc.onMouseUp = function(p:Object):void
{
var pLabel:String = null;
var pos:int = 0;
_levelFunction.gDrag = null;
if(this.pOk == 1)
{
initAllOutils(this.pNum);
this.kill();
_engine.changeCursor("auto");
this.mcI.gotoAndStop("E4");
pLabel = "PLAY_" + this.pNum + "_DEBUT";
pos = _timeline_.getPosFrameLabelByName(mainTimeline,pLabel) + 1;
_timeline_.GotoAndPlayUntil({
"labelPlay":pLabel,
"labelStop":mainTimeline.currentLabels[pos].frame - 1,
"callback":_timeline_.nextLabel
});
}
else if(this.hitTestPoint(this.stage.mouseX,this.stage.mouseY,true))
{
this.onRollOver(p);
}
else
{
this.onRollOut(p);
}
if(_engine.pad !== null)
{
_engine.pad.activated = true;
}
};
myMc.mc.onEnterFrame = function(p:Object):void
{
if(this.stage.mouseY - this.pY > 30)
{
if(this.pOk != 1)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 1;
this.mcI.gotoAndStop("E3");
}
else
{
if(this.pOk != 0)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 0;
this.mcI.gotoAndStop("E2_1");
}
};
myMc.activeDragAndDropMC({
"changeDepth":false,
"changePos":false
});
}
private function initOutil09() : void
{
var pOutil:String = "09";
var myMc:InteractiveMovie = new InteractiveMovie(this.mainTimeline["OUTIL_" + pOutil],this._timelineManager);
myMc.mc.pNum = pOutil;
myMc.mc.mcI = myMc;
myMc.gotoAndStop("E1");
myMc.mc.rollOverFrame = "E1";
myMc.mc.onRollOver = function(p:Object):void
{
if(_levelFunction.gDrag == null)
{
_engine.playNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.showIB({
"id":"IB" + this.pNum,
"reference":this,
"position":6
});
_engine.changeCursor("mainO");
}
};
myMc.mc.onRollOut = function(p:Object):void
{
if(_levelFunction.gDrag == null)
{
_engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.hideIB();
_engine.changeCursor("auto");
}
};
myMc.mc.onMouseDown = function(p:Object):void
{
_engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.hideIB();
this.pY = this.stage.mouseY;
_levelFunction.gDrag = this;
this.pOk = 0;
_engine.changeCursor("mainF");
if(_engine.pad !== null)
{
_engine.pad.activated = false;
}
};
myMc.mc.onMouseUp = function(p:Object):void
{
var pLabel:String = null;
var pos:int = 0;
_engine.changeCursor("auto");
_levelFunction.gDrag = null;
switch(this.pOk)
{
case 0:
if(this.hitTestPoint(this.stage.mouseX,this.stage.mouseY,true))
{
this.onRollOver(p);
}
else
{
this.onRollOut(p);
}
break;
default:
initAllOutils(this.pNum);
this.kill();
pLabel = "PLAY_" + this.pNum + "_" + GlobalesFunctions.gimme2digits(this.pOk) + "_DEBUT";
pos = _timeline_.getPosFrameLabelByName(mainTimeline,pLabel) + 1;
_timeline_.GotoAndPlayUntil({
"labelPlay":pLabel,
"labelStop":mainTimeline.currentLabels[pos].frame - 1,
"callback":_timeline_.nextLabel
});
}
if(_engine.pad !== null)
{
_engine.pad.activated = true;
}
};
myMc.mc.onEnterFrame = function(p:Object):void
{
if(this.stage.mouseY - this.pY >= 20)
{
if(this.pOk != 2)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 2;
this.mcI.gotoAndStop("E3");
}
else if(this.stage.mouseY - this.pY >= 10)
{
if(this.pOk != 1)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 1;
this.mcI.gotoAndStop("E2");
}
else
{
if(this.pOk != 0)
{
_engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
}
this.pOk = 0;
this.mcI.gotoAndStop("E1");
}
};
myMc.activeDragAndDropMC({
"changeDepth":false,
"changePos":false
});
}
private function initOutil10() : void
{
var pOutil:String = "10";
var myMc:InteractiveMovie = new InteractiveMovie(this.mainTimeline["OUTIL_" + pOutil],this._timelineManager);
myMc.gotoAndStop("E1");
myMc.mc.pNum = pOutil;
myMc.mc.mcI = myMc;
myMc.mc.onRollOver = function(p:Object):void
{
if(_levelFunction.gDrag == null)
{
_engine.playNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.showIB({
"id":"IB" + this.pNum,
"reference":this,
"position":6
});
this.mcI.gotoAndPlayUntil({
"labelplay":"E2",
"beforeLabelStop":"E3"
});
}
};
myMc.mc.onRollOut = function(p:Object):void
{
if(_levelFunction.gDrag == null)
{
_engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
_engine.hideIB();
this.mcI.gotoAndStop("E1");
}
};
myMc.mc.onPress = function(p:Object):void
{
initAllOutils(this.pNum);
_engine.hideIB();
this.kill();
this.mcI.gotoAndStop("E3");
_engine.playNoise(new NoiseObject({"code":"B_DIODE"}));
var pLabel:String = "PLAY_" + this.pNum + "_DEBUT";
var pos:int = _timeline_.getPosFrameLabelByName(mainTimeline,pLabel) + 1;
_timeline_.GotoAndPlayUntil({
"labelPlay":pLabel,
"labelStop":mainTimeline.currentLabels[pos].frame - 1,
"callback":_timeline_.nextLabel
});
};
myMc.activeMC();
}
public function initOutils() : void
{
var pNum:int = 0;
if(this._levelFunction.gDrag !== null)
{
pNum = Number(this._levelFunction.gDrag.pNum);
}
for(var i:int = 1; i < 11; i++)
{
if(pNum !== i)
{
this["initOutil" + GlobalesFunctions.gimme2digits(i)]();
}
else
{
trace("l\'outil " + pNum + "ne doit pas être initialisé");
}
}
}
public function initAllOutils(myNum:String) : void
{
var myMc:InteractiveMovie = null;
this._engine.stopComment();
if(this._levelFunction.videoPlaying !== null)
{
this._levelFunction.videoPlaying.close();
this._levelFunction.videoPlaying = null;
}
if(this._levelFunction.gTimerOn == true)
{
this._levelFunction.OUTIL_10.timerBloc.stop();
}
trace("§§§§§§§§§§§§§§§§§§§§§§§ " + this.gOutil);
if(this.gOutil !== "")
{
this["initOutil" + this.gOutil]();
}
for(var i:int = 1; i < 11; i++)
{
if(GlobalesFunctions.gimme2digits(i) != myNum)
{
myMc = new InteractiveMovie(this.mainTimeline["OUTIL_" + GlobalesFunctions.gimme2digits(i)],this._timelineManager);
switch(i)
{
case 1:
case 2:
case 6:
case 7:
case 8:
case 9:
case 10:
myMc.gotoAndStop("E1");
break;
case 3:
myMc.gotoAndStop("E" + myMc.mc.pNbCran);
break;
case 4:
case 5:
if(myMc.mc.pNbCran == 1 && myMc.mc.etatActif == 2)
{
myMc.gotoAndStop("E" + myMc.mc.pNbCran + "_1_1-0");
}
else
{
myMc.gotoAndStop("E" + myMc.mc.pNbCran);
}
}
}
else
{
this.gOutil = GlobalesFunctions.gimme2digits(i);
}
}
}
}
}