home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 130
/
MOBICLIC130.ISO
/
pc
/
DATA
/
GEN130
/
GEN130_00
/
GEN130_00.swf
/
scripts
/
frame_1
/
DoAction.as
Wrap
Text File
|
2010-12-13
|
41KB
|
1,556 lines
function initKAParoles()
{
nodeAnimsParams = moduleInfo.returnNodeByPath("Module.Config.AnimsParams");
animsWidth = nodeAnimsParams.attributes.Width != undefined ? Number(nodeAnimsParams.attributes.Width) : 800;
animsHeight = nodeAnimsParams.attributes.Height != undefined ? Number(nodeAnimsParams.attributes.Height) : 600;
animsX = nodeAnimsParams.attributes.X != undefined ? Number(nodeAnimsParams.attributes.X) : 0;
animsY = nodeAnimsParams.attributes.Y != undefined ? Number(nodeAnimsParams.attributes.Y) : 0;
nodeMelodieAide = moduleInfo.returnNodeByPath("Module.Config.MelodieAide");
aide = Number(nodeMelodieAide.attributes.Aide);
nodePartition = moduleInfo.returnNodeByPath("Module.Config.Partition");
part = Number(nodePartition.attributes.Part);
nodeScrollLimit = moduleInfo.returnNodeByPath("Module.Config.ScrollLimit");
lowerScrollLimit = Number(nodeScrollLimit.attributes.Debut);
upperScrollLimit = Number(nodeScrollLimit.attributes.Fin);
nodeEnAvance = moduleInfo.returnNodeByPath("Module.Config.EnAvance");
avance = Number(nodeEnAvance.attributes.Avance);
nodeAnimTimeCodes = moduleInfo.returnNodeByPath("Module.Config.Anims");
listAnimTimeCodes = [];
listAnim = [];
actualAnim = undefined;
i = 0;
while(i < 100)
{
if(nodeAnimTimeCodes.childNodes[i] === undefined)
{
break;
}
listAnimTimeCodes.push(nodeAnimTimeCodes.childNodes[i].attributes.TCAnim);
listAnim.push(nodeAnimTimeCodes.childNodes[i].attributes.anim);
i++;
}
trace("listAnim " + listAnim);
trace("listAnimTimeCodes " + listAnimTimeCodes);
nodeParoleTimeCodes = moduleInfo.returnNodeByPath("Module.Config.Paroles");
listParolesTimeCodes = [];
listParoles = [];
listLignes = [];
i = 0;
while(i < 100)
{
if(nodeParoleTimeCodes.childNodes[i] === undefined)
{
break;
}
listParolesTimeCodes.push(nodeParoleTimeCodes.childNodes[i].attributes.TCParole);
listParoles.push(nodeParoleTimeCodes.childNodes[i].attributes.parole);
listLignes.push(nodeParoleTimeCodes.childNodes[i].attributes.ligne);
i++;
}
totalTextV = undefined;
actualParole = undefined;
parolesOrigY = clipParoles.paroles._y;
initParoles();
clipParoles.swapDepths(16001);
clipParoles._visible = 0;
jpgPartition = _root.photoStocker["I_" + _root.gModuleName];
}
function initKABoutonsVars()
{
lectureEtat = 0;
listMusicKA = [gCommentName + "01_KA",gCommentName + "02_KA"];
}
function playMusic()
{
var _loc3_ = soundObjects[listMusicKA[0]].position / 1000;
this.bloqueMusicControl = true;
_root.changeMusicOn(0);
clipParoles._visible = 1;
_root.gereTextes.masqueLM({codeLM:"LM00"});
i = 0;
while(i < listMusicKA.length)
{
trace("PLAY " + listMusicKA[i]);
if(lectureEtat == 0)
{
soundObjects[listMusicKA[i]].start(0);
if(i == 0)
{
intervalScrollbar = setInterval(this,"checkSound",80);
}
}
if(gMusicKA == i)
{
soundObjects[listMusicKA[i]].setVolume(100);
}
else
{
soundObjects[listMusicKA[i]].setVolume(0);
}
if(gListeBruitage == undefined)
{
gListeBruitage = [];
gListeBruitage.push(soundObjects[listMusicKA[i]]);
}
else
{
gListeBruitage.push(soundObjects[listMusicKA[i]]);
}
i++;
}
trace(gListeBruitage);
lectureEtat = 1;
soundObjects[listMusicKA[0]].onSoundComplete = Delegate.create(this,stopKar);
}
function checkSound()
{
gereAnims();
if(actualParole !== paroleTC())
{
gereParoles();
}
scrollParole();
}
function stopKar()
{
clearInterval(intervalScrollbar);
ActiveOEIL();
hideAnims();
anim00();
_root.musicChoix = undefined;
lectureEtat = 0;
Interface.ECOUTE_01.gotoAndStop("E1");
Interface.CHANTE_01.gotoAndStop("E1");
this.bloqueMusicControl = false;
if(_global.ModuleMusicOn != false)
{
changeMusicOn(1);
}
clipParoles.paroles._y = parolesOrigY;
clipParoles._visible = 0;
gereTextes.afficheLM({codeLM:"LM00"});
LM00.swapDepths(16000);
}
function anim00()
{
gAnimKar = "A_" + gModuleName + "_ANIMKAR_AT";
this.ANIMKAR.swfStocker[gAnimKar]._visible = true;
}
function hideAnims()
{
var _loc2_ = undefined;
_loc2_ = 0;
while(_loc2_ < listAnimKAR.length)
{
this.ANIMKAR.swfStocker[listAnimKAR[_loc2_]]._visible = false;
_loc2_ = _loc2_ + 1;
}
}
function gereAnims()
{
var _loc3_ = soundObjects[listMusicKA[0]].position / 1000;
lAnim = undefined;
var _loc2_ = undefined;
_loc2_ = 0;
while(_loc2_ < listAnimTimeCodes.length)
{
if(_loc3_ > listAnimTimeCodes[_loc2_])
{
if(_loc2_ == listAnimTimeCodes.length - 1)
{
lAnim = _loc2_;
break;
}
if(_loc3_ <= listAnimTimeCodes[_loc2_ + 1])
{
lAnim = _loc2_;
break;
}
}
_loc2_ = _loc2_ + 1;
}
if(lAnim !== actualAnim)
{
trace("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
trace("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
trace(this.ANIMKAR.swfStocker[gAnimKar]._totalframes + " " + this.ANIMKAR.swfStocker[gAnimKar]._currentframe);
trace("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
trace("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
trace("ANIM " + _loc2_ + " : " + _loc3_ + " : " + listAnimTimeCodes[_loc2_]);
actualAnim = lAnim;
hideAnims();
gAnimKar = listAnim[lAnim];
trace(_loc3_ + " " + listAnimTimeCodes[_loc2_]);
trace("CHANGE ANIM " + lAnim + " " + gAnimKar);
this.ANIMKAR.swfStocker[gAnimKar]._visible = true;
this.ANIMKAR.swfStocker[gAnimKar].gotoAndPlay(1);
this.ANIMKAR.swfStocker[gAnimKar].ANIM.gotoAndPlay(1);
this.ANIMKAR.swfStocker[gAnimKar].ANIM.ANIM.gotoAndPlay(1);
}
else if(this.ANIMKAR.swfStocker[gAnimKar]._currentframe % 3 == 0)
{
this.ANIMKAR.swfStocker[gAnimKar].gotoAndPlay(this.ANIMKAR.swfStocker[gAnimKar]._currentframe + 1);
}
}
function initParolesStyle()
{
var _loc4_ = "LM_KAR";
var _loc3_ = this.moduleInfo.returnNodeByPath("Module.StylesTextes.StylesLM");
var _loc2_ = 0;
while(_loc2_ < _loc3_.childNodes.length)
{
if(_loc3_.childNodes[_loc2_].attributes.id == _loc4_)
{
nodeKAR = _loc3_.childNodes[_loc2_];
break;
}
_loc2_ = _loc2_ + 1;
}
boldKA = "0";
_loc2_ = 0;
while(_loc2_ < nodeKAR.childNodes.length)
{
switch(nodeKAR.childNodes[_loc2_].nodeName)
{
case "police":
policeKA = nodeKAR.childNodes[_loc2_].firstChild.nodeValue;
break;
case "corps":
corpsKA = nodeKAR.childNodes[_loc2_].firstChild.nodeValue;
break;
case "bold":
boldKA = nodeKAR.childNodes[_loc2_].firstChild.nodeValue;
break;
case "leading":
leadingKA = nodeKAR.childNodes[_loc2_].firstChild.nodeValue;
}
_loc2_ = _loc2_ + 1;
}
if(boldKA == "1")
{
policeKA += "_b";
}
else
{
policeKA += "_p";
}
clipParoles.paroles.embedFonts = true;
var _loc5_ = new TextFormat();
_loc5_.font = policeKA;
_loc5_.size = corpsKA;
_loc5_.leading = leadingKA;
_loc5_.color = 10053324;
clipParoles.paroles.setTextFormat(_loc5_);
}
function initParoles()
{
listChars = [];
clipParoles.paroles.text = "";
var _loc2_ = "";
var _loc1_ = 0;
while(_loc1_ < listLignes.length)
{
var _loc3_ = Number(listLignes[_loc1_]);
if(_loc3_ != listLignes[_loc1_ + 1])
{
if(listParoles[_loc1_] != "sautDeLigne")
{
if(_loc2_ != "")
{
_loc2_ += " " + listParoles[_loc1_];
}
else
{
_loc2_ += listParoles[_loc1_];
}
}
clipParoles.paroles.text += _loc2_ + "\r";
listChars.push(clipParoles.paroles.length);
_loc2_ = "";
}
else
{
if(_loc2_ != "")
{
_loc2_ += " " + listParoles[_loc1_];
}
else
{
_loc2_ += listParoles[_loc1_];
}
listChars.push(clipParoles.paroles.length + _loc2_.length);
}
_loc1_ = _loc1_ + 1;
}
initParolesStyle();
if(totalTextV == undefined)
{
totalTextV = clipParoles.paroles.textHeight - clipParoles.paroles._height;
clipParoles.paroles._height = clipParoles.paroles.textHeight;
}
trace("totalTextV " + totalTextV);
myColorFormat = new TextFormat();
ColorFormat = clipParoles.paroles.getTextFormat();
Selection.setFocus(clipParoles.paroles);
Selection.setSelection(0,0);
}
function changeColor()
{
Selection.setSelection(listChars[tcNb - 1],listChars[tcNb]);
myColorFormat = ColorFormat;
myColorFormat.color = "0x9966CC";
clipParoles.paroles.setTextFormat(ColorFormat);
myColorFormat.color = "0x4c2771";
clipParoles.paroles.setTextFormat(listChars[tcNb - 1],listChars[tcNb],myColorFormat);
Selection.setSelection(0,0);
}
function gereParoles()
{
tcNb = paroleTC();
changeColor();
}
function ExgereParoles()
{
clipParoles.paroles.htmlText = "";
var _loc2_ = "";
var _loc1_ = 0;
while(_loc1_ < listLignes.length)
{
var _loc3_ = Number(listLignes[_loc1_]);
if(_loc3_ != listLignes[_loc1_ + 1])
{
if(listParoles[_loc1_] == "sautDeLigne")
{
_loc2_ = "\r";
}
else if(_loc2_ != "")
{
if(_loc1_ == paroleTC())
{
_loc2_ += " <font color=\'#FFFFFE\'>" + listParoles[_loc1_] + "</font>";
}
else
{
_loc2_ += " <font color=\'#009999\'>" + listParoles[_loc1_] + "</font>";
}
}
else if(_loc1_ == paroleTC())
{
_loc2_ += "<font color=\'#FFFFFE\'>" + listParoles[_loc1_] + "</font>";
}
else
{
_loc2_ += "<font color=\'#009999\'>" + listParoles[_loc1_] + "</font>";
}
clipParoles.paroles.text += _loc2_;
_loc2_ = "";
}
else if(_loc2_ != "")
{
if(_loc1_ == paroleTC())
{
_loc2_ += " <font color=\'#FFFFFE\'>" + listParoles[_loc1_] + "</font>";
}
else
{
_loc2_ += " <font color=\'#009999\'>" + listParoles[_loc1_] + "</font>";
}
}
else if(_loc1_ == paroleTC())
{
_loc2_ += "<font color=\'#FFFFFE\'>" + listParoles[_loc1_] + "</font>";
}
else
{
_loc2_ += "<font color=\'#009999\'>" + listParoles[_loc1_] + "</font>";
}
_loc1_ = _loc1_ + 1;
}
actualParole = paroleTC();
initParolesStyle();
if(totalTextV == undefined)
{
totalTextV = clipParoles.paroles.textHeight - clipParoles.paroles._height;
clipParoles.paroles._height = clipParoles.paroles.textHeight;
}
}
function paroleTC()
{
var _loc2_ = soundObjects[listMusicKA[0]].position / 1000;
lParole = undefined;
var _loc1_ = undefined;
_loc1_ = 0;
while(_loc1_ < listParolesTimeCodes.length)
{
if(_loc2_ > listParolesTimeCodes[_loc1_])
{
if(_loc1_ == listParolesTimeCodes.length - 1)
{
lParole = _loc1_;
break;
}
temps = listParolesTimeCodes[_loc1_ + 1] - avance;
if(temps < 0)
{
temps = 0;
}
if(_loc2_ < temps)
{
lParole = _loc1_;
break;
}
}
_loc1_ = _loc1_ + 1;
}
return lParole;
}
function scrollParole()
{
if(tcNb >= listParolesTimeCodes.length - 1)
{
_global.HOTE.Quitter();
}
var _loc2_ = soundObjects[listMusicKA[0]].position / 1000;
clipParoles.paroles._y = parolesOrigY - (tcNb + (_loc2_ - listParolesTimeCodes[tcNb]) / (listParolesTimeCodes[tcNb + 1] - listParolesTimeCodes[tcNb])) * (clipParoles.paroles._height / listParolesTimeCodes.length);
return undefined;
}
function initKABoutons()
{
onDemo = 1;
_root.musicChoix = undefined;
initKABoutonsVars();
listKABoutons = ["ECOUTE_01","CHANTE_01"];
i = 0;
while(i < listKABoutons.length)
{
this.Interface[listKABoutons[i]].pName = this.Interface[listKABoutons[i]]._name;
this.Interface[listKABoutons[i]].onRollOver = function()
{
if(!onDemo)
{
if(_root.musicChoix != this.pName)
{
gereCursor(2);
this.useHandCursor = 1;
this.gotoAndStop("e2");
}
else
{
this.useHandCursor = 0;
}
}
else
{
this.useHandCursor = 0;
}
};
this.Interface[listKABoutons[i]].onRollOut = function()
{
gereCursor(1);
if(!onDemo)
{
if(_root.musicChoix != this.pName)
{
this.gotoAndStop("e1");
}
}
};
this.Interface[listKABoutons[i]].onPress = function()
{
if(!onDemo)
{
if(_root.musicChoix != this.pName)
{
DesactiveOEIL();
gereCursor(1);
if(_root.musicChoix != undefined)
{
_root[_root.musicChoix].gotoAndStop("E1");
}
_root.sgMusicChoix = _root.musicChoix;
_root.musicChoix = this.pName;
this.useHandCursor = 0;
switch(_root.musicChoix)
{
case "ECOUTE_01":
_root.Interface.CHANTE_01.gotoAndStop("E1");
gMusicKA = 0;
playMusic();
break;
case "CHANTE_01":
_root.Interface.ECOUTE_01.gotoAndStop("E1");
gMusicKA = 1;
playMusic();
}
}
}
};
i++;
}
}
function allumeKABoutons()
{
var _loc2_ = 0;
while(_loc2_ < listKABoutons.length)
{
this.Interface[listKABoutons[_loc2_]].gotoAndStop("E1");
_loc2_ = _loc2_ + 1;
}
}
function eteindreKABoutons()
{
var _loc2_ = 0;
while(_loc2_ < listKABoutons.length)
{
this.Interface[listKABoutons[_loc2_]].gotoAndStop("E0");
_loc2_ = _loc2_ + 1;
}
}
function initPrintBoutons()
{
Interface.BT_PRINT.onRollOver = function()
{
if(!onDemo)
{
gereCursor(2);
this.gotoAndStop("E2");
this.useHandCursor = 1;
}
else
{
this.useHandCursor = 0;
}
};
Interface.BT_PRINT.onRollOut = function()
{
gereCursor(2);
this.gotoAndStop("E1");
};
Interface.BT_PRINT.onPress = function()
{
if(!onDemo)
{
gereCursor(1);
this.gotoAndStop("E1");
oldDepth = partition.getDepth();
partition.swapDepths(20000);
partition._alpha = 100;
Interface._visible = false;
if(_global.HOTE.ImprimerEcran())
{
partition._alpha = 0;
partition.swapDepths(oldDepth);
Interface._visible = true;
}
else
{
partition._alpha = 0;
partition.swapDepths(oldDepth);
Interface._visible = true;
}
}
};
}
function initKeyPause()
{
gPauseOn = 0;
gPauseSpaceOn = 0;
gPauseSpaceEnCours = 0;
}
function initGen()
{
this._lockroot = true;
gClipGen = this;
Stage.showMenu = false;
gLangue = "FR";
gMusicOn = 1;
gSousTitre = 0;
gST = 0;
gVolume = 100;
gWidth = moduleInfo.returnNodeByPath("BackOffice").firstChild.attributes.width;
gHeight = moduleInfo.returnNodeByPath("BackOffice").firstChild.attributes.height;
if(gWidth == undefined)
{
gWidth = 800;
}
else
{
gWidth = Number(gWidth);
}
if(gHeight == undefined)
{
gHeight = 600;
}
else
{
gHeight = Number(gHeight);
}
initKeyPause();
}
function testeDebutCommentSpecial()
{
switch(gCommentOn.id.split("_")[gCommentOn.id.split("_").length - 1])
{
case "bz":
case "BZ":
trace("------- BZ on-----------");
DesactiveOEIL();
if(BT_OEIL.gEtat !== 3)
{
trace("E3");
BT_OEIL.gotoAndPlay("E3");
}
else
{
trace("PARLE");
BT_OEIL.OEIL_P.gotoAndPlay("parle");
}
break;
case "ze":
case "ZE":
trace("------- ZE on-----------");
DesactiveOEIL();
if(BT_OEIL.gEtat !== 3)
{
BT_OEIL.gotoAndPlay("E3");
}
else
{
BT_OEIL.OEIL_P.gotoAndPlay("parle");
}
afficherRolls();
}
}
function testeFinCommentSpecial()
{
switch(gCommentOn.id.split("_")[gCommentOn.id.split("_").length - 1])
{
case "bz":
case "BZ":
trace("------- BZ off-----------");
ActiveOEIL();
BT_OEIL.OEIL_P.gotoAndPlay("rentre");
BT_OEIL.gClicOn = undefined;
break;
case "ze":
case "ZE":
trace("------- ZE off-----------");
ActiveOEIL();
BT_OEIL.OEIL_P.gotoAndPlay("rentre");
BT_OEIL.gClicOn = undefined;
masquerRolls();
}
}
function stopComment()
{
if(gCommentOn !== undefined)
{
testeFinCommentSpecial();
delete gCommentOn.onSoundComplete;
gCommentOn.stop();
gCommentOn = undefined;
if(gPauseOn == undefined || gPauseOn == 0)
{
removeMovieClip("mcClicZap");
}
gBlockST = undefined;
gereTextes.masqueST();
if(gClipTarget !== undefined)
{
gClipTarget.gotoAndStop(gClipTargetLabel);
gClipTarget = undefined;
gClipTargetLabel = undefined;
}
}
}
function pauseComment()
{
trace("pauseComment " + gCommentOn);
if(gCommentOn !== undefined)
{
gCommentOn.stop();
mcClicZap._visible = false;
}
}
function continueComment()
{
trace("continueComment " + gCommentOn);
if(gCommentOn !== undefined)
{
gCommentOn.start(gCommentOn.position / 1000);
mcClicZap._visible = true;
}
}
function joueSon(p)
{
var _loc4_ = p.nomSon;
gSoundString = _loc4_;
if(p.mc !== undefined)
{
gClipRef = p.mc;
}
else
{
gClipRef = _root;
}
if(p.zapBlock !== undefined)
{
gClicZap = p.zapBlock;
}
else
{
gClicZap = "ZAP_BLOCK";
}
if(p.actionFin !== undefined)
{
gActionFinSon = p.actionFin;
}
else
{
gActionFinSon = "PLAY";
}
stopComment();
if(p.mcCible !== undefined)
{
if(typeof p.mcCible == "movieclip")
{
gClipTarget = p.mcCible;
}
else
{
gClipTarget = gClipRef[p.mcCible];
}
if(p.mcLabelOut !== undefined)
{
gClipTargetLabel = p.mcLabelOut;
}
else
{
gClipTargetLabel = gClipTarget._currentframe;
}
if(p.mcLabelIn !== undefined)
{
gClipTarget.gotoAndPlay(p.mcLabelIn);
}
else
{
gClipTarget.gotoAndPlay("parle");
}
}
gCommentName = "S_" + gLangue + "_" + gModuleName + "_";
trace("joueSon " + gCommentName + _loc4_);
mySound = soundObjects[gCommentName + _loc4_];
if(mySound !== undefined)
{
gCommentOn = mySound;
gCommentOn.p = p;
gCommentOn.id = gCommentName + _loc4_;
testeDebutCommentSpecial();
if(gMusicOn == 1 && gMusic !== undefined && gBlockMusic == undefined)
{
soundObjects[gMusic].setVolume(gVolume * 40 / 100);
}
mySound.setVolume(gVolume);
if(gCommentOnPausePos !== undefined)
{
mySound.start(gCommentOnPausePos / 1000);
gCommentOnPause = undefined;
gCommentOnPausePos = undefined;
}
else
{
mySound.start();
}
}
else
{
trace("______" + getSoundByID(gCommentName + _loc4_) + gCommentName);
var _loc5_ = getSoundByID(gCommentName + _loc4_);
if(_loc5_ !== undefined)
{
mySound = new Sound();
mySound.onLoad = function(success)
{
if(success)
{
if(gCommentOnPausePos !== undefined)
{
mySound.start(gCommentOnPausePos / 1000);
gCommentOnPause = undefined;
gCommentOnPausePos = undefined;
}
else
{
mySound.start();
}
}
};
mySound.loadSound(this.gModulePath + _loc5_.attributes.src,true);
gCommentOn = mySound;
gCommentOn.p = p;
gCommentOn.id = gCommentName + _loc4_;
testeDebutCommentSpecial();
if(gMusicOn == 1 && gMusic !== undefined && gBlockMusic == undefined)
{
soundObjects[gMusic].setVolume(gVolume * 40 / 100);
}
}
}
if(mySound == undefined)
{
return undefined;
}
mySound.onSoundComplete = commentFini;
if(gClicZap !== "NOZAP_NOBLOCK")
{
trace("creerRectangle " + creerRectangle + " " + gHeight + " " + gWidth);
mcClicZap = creerRectangle({nom:"mcClicZap",pere:_root,level:15000,width:gWidth,height:gHeight,x:0,y:0,alpha:0});
switch(gClicZap.split("_")[0])
{
case "ZAP":
mcClicZap.useHandCursor = false;
mcClicZap.onPress = function()
{
trace("clic zap son");
stopSon();
};
break;
case "NOZAP":
mcClicZap.useHandCursor = false;
mcClicZap.onPress = function()
{
trace("no clic allowed");
};
}
mcClicZap._visible = true;
}
if(gST == 1 && gBlockST == undefined)
{
gereTextes.afficheST(gCommentName + _loc4_);
}
}
function creerClicZap(p)
{
if(_global.mcClicZap2 != undefined)
{
removeMovieClip(_root.mcClicZap2);
}
var _loc0_ = null;
var _loc4_ = _global.mcClicZap2 = creerRectangle({nom:"mcClicZap2",pere:_root,level:15001,width:gWidth,height:gHeight,x:0,y:0,alpha:0});
_loc4_.p = p;
_loc4_.useHandCursor = false;
_loc4_.onPress = function()
{
trace("clic zap " + this.p);
this.p.retour.call(this.p.ecouteur);
removeMovieClip(this);
_global.mcClicZap2 = undefined;
};
_loc4_._visible = true;
}
function creerRectangle(p)
{
var _loc15_ = p.x != undefined ? p.x : 0;
var _loc13_ = p.y != undefined ? p.y : 0;
if(p.w != undefined)
{
var _loc16_ = p.w;
}
else if(p.width != undefined)
{
_loc16_ = p.width;
}
if(p.h != undefined)
{
var _loc14_ = p.h;
}
else if(p.height != undefined)
{
_loc14_ = p.height;
}
var _loc11_ = p.pere != undefined ? p.pere : _root;
var _loc9_ = p.level != undefined ? p.level : 10;
var _loc12_ = p.couleur != undefined ? p.couleur : 0;
var _loc10_ = p.nom != undefined ? p.nom : "ClipSansNom";
var _loc4_ = p.courbure != undefined ? p.courbure : 0;
var _loc17_ = p.alpha != undefined ? p.alpha : 100;
var _loc6_ = 0;
var _loc7_ = 0;
var _loc8_ = _loc16_;
var _loc5_ = _loc14_;
var _loc3_ = _loc11_.createEmptyMovieClip(_loc10_,_loc9_);
_loc3_._alpha = _loc17_;
_loc3_.beginFill(_loc12_,100);
_loc3_.moveTo(_loc6_,_loc5_ - _loc4_);
_loc3_.lineTo(_loc6_,_loc7_ + _loc4_);
_loc3_.curveTo(_loc6_,_loc7_,_loc6_ + _loc4_,_loc7_);
_loc3_.lineTo(_loc8_ - _loc4_,_loc7_);
_loc3_.curveTo(_loc8_,_loc7_,_loc8_,_loc7_ + _loc4_);
_loc3_.lineTo(_loc8_,_loc5_ - _loc4_);
_loc3_.curveTo(_loc8_,_loc5_,_loc8_ - _loc4_,_loc5_);
_loc3_.lineTo(_loc6_ + _loc4_,_loc5_);
_loc3_.curveTo(_loc6_,_loc5_,_loc6_,_loc5_ - _loc4_);
_loc3_.endFill();
_loc3_._x = _loc15_;
_loc3_._y = _loc13_;
return _loc3_;
}
function stopSon()
{
gCommentOn.stop();
commentFini();
}
function commentFini()
{
testeFinCommentSpecial();
if(gClicZap !== "NOZAP_NOBLOCK")
{
removeMovieClip("mcClicZap");
}
gCommentOn = undefined;
gBlockST = undefined;
gereTextes.masqueST();
if(gMusicOn == 1 && gMusic !== undefined && gBlockMusic == undefined)
{
soundObjects[gMusic].setVolume(gVolume);
}
if(gClipTarget !== undefined)
{
gClipTarget.gotoAndStop(gClipTargetLabel);
gClipTarget = undefined;
gClipTargetLabel = undefined;
}
switch(gActionFinSon)
{
case "RIEN":
break;
case "PLAY":
if(_root.gNextLabel == undefined)
{
if(gLineaireOn != undefined)
{
if((_loc0_ = gLineaireOn) !== "_")
{
lSonSuivant = gLineaireOn + gimme2digits(Number(gSoundString.split("_")[gSoundString.split("_").length - 1]) + 1);
lLabel = lSonSuivant;
}
else
{
lSonSuivant = gimme2digits(Number(gSoundString.split("_")[gSoundString.split("_").length - 1]) + 1);
lLabel = gLineaireOn + lSonSuivant;
}
joueSon({mc:gClipRef,nomSon:lSonSuivant,zapBlock:gClicZap,actionFin:gActionFinSon});
gClipRef.gotoAndStop(lLabel);
}
else
{
gClipRef.play();
}
}
else
{
gClipRef.gotoAndPlay(_root.gNextLabel);
_root.gNextLabel = undefined;
gLineaireOn = undefined;
}
break;
default:
_root[gActionFinSon]();
}
}
function joueBruitage(p)
{
var _loc1_ = soundObjects[gBruitageName + p.nomSon];
if(gListeBruitage == undefined)
{
gListeBruitage = [];
gListeA_fin_Bruitage = [];
gListeLoop_Bruitage = [];
}
_loc1_.setVolume(gVolume);
_loc1_.id = p.nomSon;
gListeBruitage.push(_loc1_.id);
if(p.actionFin !== undefined)
{
gActionFinBruitage = p.actionFin;
gListeA_fin_Bruitage.push(gActionFinBruitage);
}
else
{
gActionFinBruitage = undefined;
gListeA_fin_Bruitage.push("");
}
_loc1_.p = p;
_loc1_.onSoundComplete = Delegate.create(_loc1_,finBruitage);
if(p.loopSon == undefined)
{
_loc1_.start(p.offset);
gListeLoop_Bruitage.push("");
}
else
{
_loc1_.start(p.offset,p.loopSon);
gListeLoop_Bruitage.push(p.loopSon);
}
if(_loc1_ == undefined)
{
trace("joueBruitage : " + p.nomSon + " : " + _loc1_);
}
}
function stopBruitage(p)
{
trace("stopBruitage");
var _loc1_ = soundObjects[gBruitageName + p.nomSon];
finBruitage(p.nomSon);
_loc1_.stop();
}
function finBruitage(lSon)
{
if(lSon == undefined)
{
lSon = this.id;
}
trace("lson = " + lSon);
if(gListeBruitage !== undefined)
{
if(getPos(gListeBruitage,lSon) !== -1)
{
if(gListeA_fin_Bruitage[getPos(gListeBruitage,lSon)] !== "")
{
if(typeof gListeA_fin_Bruitage[getPos(gListeBruitage,lSon)] == "string")
{
gClipGen[gListeA_fin_Bruitage[getPos(gListeBruitage,lSon)]]();
}
else
{
gListeA_fin_Bruitage[getPos(gListeBruitage,lSon)].call(this.p.MC);
}
}
gListeA_fin_Bruitage.splice(getPos(gListeBruitage,lSon),1);
gListeLoop_Bruitage.splice(getPos(gListeBruitage,lSon),1);
gListeBruitage.splice(getPos(gListeBruitage,lSon),1);
if(gListeBruitage.length == 0)
{
gListeBruitage = undefined;
gListeA_fin_Bruitage = undefined;
gListeLoop_Bruitage = undefined;
}
}
}
}
function getPos(myList, myValue)
{
lPresent = -1;
maPosition = 0;
while(maPosition <= myList.length)
{
if(myList[maPosition] == myValue)
{
lPresent = maPosition;
break;
}
maPosition++;
}
return lPresent;
}
function trouvePosMax(myList)
{
lMax = myList[0];
lPosMax = 0;
i = 1;
while(i <= myList.length)
{
if(myList[i] > lMax)
{
lMax = myList[i];
lPosMax = i;
}
i++;
}
return lPosMax;
}
function duplicate(myList)
{
newList = [];
i = 0;
while(i <= myList.length - 1)
{
newList.push(myList[i]);
i++;
}
return newList;
}
function randomiseList(myList)
{
var _loc3_ = duplicate(myList);
var _loc4_ = [];
var _loc5_ = _loc3_.length;
var _loc2_ = 0;
while(_loc2_ < _loc5_)
{
var _loc1_ = randomValue(0,_loc3_.length - 1);
_loc4_.push(_loc3_[_loc1_]);
_loc3_.splice(_loc1_,1);
_loc2_ = _loc2_ + 1;
}
return _loc4_;
}
function returnNodeByPathRandomise(nodeSent)
{
var _loc4_ = new XML();
var _loc5_ = nodeSent.childNodes.length;
var _loc1_ = 0;
while(_loc1_ < _loc5_)
{
var _loc2_ = randomValue(0,nodeSent.childNodes.length - 1);
_loc4_.appendChild(nodeSent.childNodes[_loc2_]);
_loc1_ = _loc1_ + 1;
}
return _loc4_;
}
function zapIntro(myLabel)
{
mcClicZapIntro = this.createEmptyMovieClip("mcClicZapIntro",16031);
mcClicZapIntro.attachMovie("ClipInvisible","ClipInvisible",2);
mcClicZapIntro._width = gClipGen._width;
mcClicZapIntro._height = gClipGen._height;
mcClicZapIntro._x = 0;
mcClicZapIntro._y = 0;
mcClicZapIntro.useHandCursor = false;
mcClicZapIntro.onPress = function()
{
trace("clic zappIntro " + this);
stopComment();
gotoAndPlay(myLabel);
removeZapIntro();
};
}
function removeZapIntro()
{
trace("mcClicZapIntrO " + mcClicZapIntro._name + " " + this);
if(mcClicZapIntro._x != undefined)
{
trace("suppression");
removeMovieClip(mcClicZapIntro);
}
}
function onMcOut(myMc)
{
gereCursor(1);
if(myMc.pLabelOut == undefined)
{
myMc.gotoAndPlay("E1");
}
else
{
myMc.gotoAndPlay(myMc.pLabelOut);
}
if(myMc.pSon.split("")[0] == "B")
{
stopBruitage({nomSon:myMc.pSon});
}
else
{
stopComment();
}
if(myMc.pIB !== undefined)
{
gereTextes.masqueIB();
}
}
function onMcOver(p)
{
var myMc = p.mc;
myMc.pIB = p.codeIB;
if(p.nomSon == undefined)
{
if(p.nomSonC == undefined)
{
myMc.pSon = "B_" + myMc._name.split("_")[1];
}
else
{
myMc.pSon = p.nomSonC;
}
}
else
{
myMc.pSon = p.nomSon;
}
if(p.actionFin == undefined)
{
myMc.actionFin = "RIEN";
}
else
{
myMc.actionFin = p.actionFin;
}
myMc.pLabelOut = p.mcLabelOut;
myMc.onRollOver = function()
{
gereCursor(2);
if(p.mcLabelIn == undefined)
{
this.gotoAndPlay("E2");
}
else
{
this.gotoAndPlay(p.mcLabelIn);
}
if(this.pSon.split("")[0] == "B")
{
joueBruitage({nomSon:this.pSon});
}
else
{
joueSon({nomSon:this.pSon,zapBlock:"NOZAP_NOBLOCK",actionFin:this.actionFin});
}
if(this.pIB !== undefined)
{
gereTextes.afficheIB({mc:this,codeIB:this.pIB});
}
};
myMc.onRollOut = myMc.onDragOut = function()
{
onMcOut(myMc);
};
}
function desactiveClip(pClip)
{
trace(pClip);
delete pClip.onRollOver;
delete pClip.onRollOut;
delete pClip.onDragOut;
delete pClip.onPress;
delete pClip.onRelease;
delete pClip.onReleaseOutside;
}
function afficheClipPos(myMc, myX, myY)
{
myMc._x = myX;
myMc._y = myY;
myMc._visible = true;
}
function gimme2digits(X)
{
if(Number(X) < 10)
{
lX = "0" + Number(X);
}
else
{
lX = String(X);
}
return lX;
}
function randomValue(min, max)
{
var _loc1_ = Math.floor(Math.random() * (max - min + 1)) + min;
return _loc1_;
}
function chercheDepthPlus(myMc, myDepth)
{
var _loc1_ = myDepth;
while(_loc1_ < 17000)
{
if(myMc.getInstanceAtDepth(_loc1_) == undefined)
{
break;
}
_loc1_ = _loc1_ + 1;
}
return _loc1_;
}
function chercheDepthMoins(myMc, myDepth)
{
var _loc1_ = myDepth;
while(_loc1_ > -16383)
{
if(myMc.getInstanceAtDepth(_loc1_) == undefined)
{
break;
}
_loc1_ = _loc1_ - 1;
}
return _loc1_;
}
function changeST(myST)
{
trace("changeST : " + myST);
if(myST == "1")
{
gST = 1;
if(gCommentOn !== undefined)
{
gereTextes.afficheST(gCommentOn.id);
}
}
else
{
sousTitre = 0;
gST = 0;
gereTextes.masqueST(this);
}
}
function changeMusicOn(myChangeMusicOn)
{
trace("changeMusicOn : " + myChangeMusicOn);
switch(String(myChangeMusicOn))
{
case "1":
gMusicOn = 1;
if(gMusic == undefined)
{
gMusic = gBruitageName + "MU";
}
trace("changeMusicOn2 : " + gMusic + " - " + gVolume);
if(gBlockMusic == undefined)
{
if(gCommentOn !== undefined)
{
soundObjects[gMusic].setVolume(gVolume * 0.4);
}
else
{
soundObjects[gMusic].setVolume(gVolume);
}
}
else
{
soundObjects[gMusic].setVolume(0);
}
soundObjects[gMusic].start(0,1000);
break;
case "0":
soundObjects[gMusic].stop();
gMusicOn = 0;
break;
default:
if(gMusic !== undefined)
{
soundObjects[gMusic].stop();
}
gMusic = gBruitageName + myChangeMusicOn;
if(gMusicOn == 1)
{
if(gBlockMusic == undefined)
{
if(gCommentOn !== undefined)
{
soundObjects[gMusic].setVolume(gVolume * 0.4);
}
else
{
soundObjects[gMusic].setVolume(gVolume);
}
}
else
{
soundObjects[gMusic].setVolume(0);
}
soundObjects[gMusic].start(0,1000);
}
}
}
function changeVolume(myChangeVolume)
{
trace("changeVolume : " + myChangeVolume);
gVolume = Number(myChangeVolume);
if(gCommentOn !== undefined)
{
gCommentOn.setVolume(gVolume);
if(gMusicOn == 1)
{
soundObjects[gMusic].setVolume(gVolume * 0.4);
}
}
else if(gMusicOn == 1)
{
soundObjects[gMusic].setVolume(gVolume);
}
}
function DesactiveBZ()
{
BT_BZ.useHandCursor = false;
BT_BZ.gBZactif = 0;
}
function ActiveBZ()
{
BT_BZ.useHandCursor = true;
BT_BZ.gBZactif = 1;
}
function getSoundByID(attributeValue)
{
var _loc2_ = this.moduleInfo.filterNode(this.moduleInfo.returnNodeByPath("Resources.ResourcesZip"),"type","mp3");
mySound = undefined;
mySound = this.recusiveGetSoundByAttribute(_loc2_,"id",attributeValue);
if(mySound == undefined)
{
trace(attributeValue + " n\'existe pas dans XML");
}
return mySound;
}
function recusiveGetSoundByAttribute(node, attribute, attributeValue)
{
var _loc2_ = 0;
while(_loc2_ < node.childNodes.length)
{
if(node.childNodes[_loc2_].attributes[attribute] == attributeValue)
{
mySound = node.childNodes[_loc2_];
break;
}
if(node.childNodes[_loc2_].hasChildNodes())
{
this.recusiveGetSoundByAttribute(node.childNodes[_loc2_],attribute,attributeValue);
}
_loc2_ = _loc2_ + 1;
}
return mySound;
}
function gereCursor(myCursor)
{
switch(myCursor)
{
case 1:
case "fleche":
myCursor = "fleche";
break;
case 2:
case "doigt":
myCursor = "doigt";
break;
case 3:
case "mainO":
myCursor = "mainO";
break;
case 4:
case "mainF":
myCursor = "mainF";
break;
case 0:
case "O":
myCursor = "O";
}
trace("cursor " + myCursor);
_global.CURSEUR.Action(myCursor);
}
function ConvertCoord(mc_src, mc_dest)
{
var _loc1_ = {x:0,y:0};
mc_src.localToGlobal(_loc1_);
mc_dest.globalToLocal(_loc1_);
return _loc1_;
}
function initLib(p)
{
trace(" ____ __ initLib _ __ _");
var _loc3_ = this;
var _loc4_ = _loc3_.createEmptyMovieClip("_" + p.nom + "_",this.getNextHighestDepth());
var _loc5_ = gLibsPath + "/" + nom_lib + "/" + nom_lib + ".swf";
this.mclR = new MovieClipLoader();
this.mclR.loadClip(p.url,_loc4_);
this.mclR.onLoadInit = function(myClip)
{
trace("onLoadInit " + myClip._name);
myClip.ChargeMoteur();
_root.Init();
};
}
stop();
this._lockroot = true;
this.prodVersion = "prod_gen_XB";
if(_global.gModulePath == undefined)
{
this.gModulePath = _global.gModulePath = "";
}
else
{
this.gModulePath = _global.gModulePath;
}
_global._MOD_ = this;
this.CIBLE = this;
if(_global.HOTE != undefined)
{
MovieClip.prototype.gHotePath = _global.gPARAMS.HOTE_DIR + "/DATA/HOTE";
}
else
{
MovieClip.prototype.gHotePath = "../../HOTE";
}
this.prodPath = gHotePath + "/" + this.prodVersion;
MovieClip.prototype.gLibsPath = gHotePath + "/libs";
trace("FONCTIONS : KARAOKE");
_global.stopComment = stopComment;
_global.joueSon = joueSon;
_root.creerClicZap = creerClicZap;
_global.joueBruitage = joueBruitage;
_global.stopBruitage = stopBruitage;
_global.gimme2digits = gimme2digits;
this.randRange = randomValue;
_global.chercheDepthPlus = chercheDepthPlus;
_global.chercheDepthMoins = chercheDepthMoins;
_global.DesactiveBZ = DesactiveBZ;
_root.DesactiveBZ = DesactiveBZ;
_global.ActiveBZ = ActiveBZ;
_root.ActiveBZ = ActiveBZ;
_global.gereCursor = gereCursor;
this.initVariables = function()
{
trace("initVariables()");
this.gotoAndStop("INIT");
};
_global._o_ = new Object();
MovieClip.prototype._o_ = _o_;
this.Init = function()
{
trace("<<<<<<<<<<<<< Init() >>>>>>>>>>>");
if(_xlib1_ == undefined)
{
initLib({nom:"xlib1",url:gLibsPath + "/xlib1/xlib1.swf"});
return undefined;
}
if(_xb_ == undefined)
{
initLib({nom:"xb",url:gLibsPath + "/o/xb.swf"});
return undefined;
}
if(_moteur_ == undefined)
{
initLib({nom:"moteur",url:this.prodPath + "/moteur.swf"});
return undefined;
}
};
this.InitOk = function()
{
trace("<<<<<<<<<<<<< InitOk() >>>>>>>>>>>");
if(HOTE == undefined)
{
this.Start();
}
else
{
HOTE.InitFin(this);
}
};
this.Start = function()
{
trace("<<<<<<<<<<<<< Start() >>>>>>>>>>>");
gereCursor("fleche");
this.gotoAndStop("START");
};
if(HOTE == undefined)
{
this.onEnterFrame = function()
{
var _loc2_ = this.getBytesLoaded();
var _loc3_ = this.getBytesTotal();
if(_loc2_ >= _loc3_)
{
this.Init();
delete this.onEnterFrame;
}
};
}
stop();