home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 174
/
MOBICLIC174.ISO
/
mac
/
DATA
/
FAB174
/
FAB174_00
/
moteur.swf
/
scripts
/
frame_1
/
DoAction.as
Wrap
Text File
|
2015-04-27
|
14KB
|
526 lines
function gimme2digits(X)
{
if(Number(X) < 10)
{
lX = "0" + Number(X);
}
else
{
lX = String(X);
}
return lX;
}
function gimme3digits(X)
{
if(Number(X) < 10)
{
lX = "00" + Number(X);
}
else if(Number(X) < 100)
{
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 GetFilePath(fichier)
{
var _loc2_ = AntiSlashToSlash(fichier);
var _loc1_ = _loc2_.split("/");
_loc1_.pop();
return _loc1_.join("/");
}
function AntiSlashToSlash(chaine)
{
return str_replace(chaine,"\\","/");
}
function str_replace(str, search, replace)
{
return str.split(search).join(replace);
}
function InitMascotte(p)
{
var _loc4_ = this.MediasExternes[p.mc._name].ParamsXml;
var _loc3_ = p.mc;
_loc3_.ParamsXml = this.MediasExternes[_loc3_._name].ParamsXml;
_loc3_._x = _loc4_.x != undefined ? _loc4_.x : _loc3_._x;
_loc3_._y = _loc4_.y != undefined ? _loc4_.y : _loc3_._y;
_loc3_._xscale = _loc4_.scale != undefined ? Number(_loc4_.scale) : _loc3_._xscale;
_loc3_._yscale = _loc4_.scale != undefined ? Math.abs(Number(_loc4_.scale)) : _loc3_._yscale;
return _loc3_;
}
function afficherMascottes(mascottes)
{
_root.AFFICHAGE_MASCOTTES = false;
if(_root.MascottesMode == "AutoHide")
{
var _loc2_ = 0;
while(_loc2_ < _root.MASCOTTES_LISTE.length)
{
_root.MASCOTTES_LISTE[_loc2_]._visible = false;
_root.MASCOTTES_LISTE[_loc2_].ETAT = "E2";
_loc2_ = _loc2_ + 1;
}
}
if(mascottes != undefined)
{
_root.AFFICHAGE_MASCOTTES = true;
var _loc3_ = undefined;
_loc2_ = 0;
while(_loc2_ < mascottes.length)
{
_loc3_ = _root["MASC_" + mascottes[_loc2_].nom];
_loc3_.ETAT = mascottes[_loc2_].action;
_loc3_.gotoAndStop(mascottes[_loc2_].action);
if(_loc3_.NOT_RESIZE != true)
{
}
_loc3_._visible = true;
_loc2_ = _loc2_ + 1;
}
}
}
function cacherMascottes()
{
var _loc2_ = 0;
while(_loc2_ < _root.MASCOTTES_LISTE.length)
{
_root.MASCOTTES_LISTE[_loc2_]._visible = false;
_root.MASCOTTES_LISTE[_loc2_].ETAT = "E2";
_loc2_ = _loc2_ + 1;
}
}
function testeDebutCommentSpecial()
{
var _loc2_ = _root.gCommentOn.id.split("_")[_root.gCommentOn.id.split("_").length - 1];
switch(_loc2_)
{
case "bz":
case "BZ":
_root.DesactiveOEIL();
if(_root.BT_OEIL.gEtat !== 3)
{
_root.BT_OEIL.gotoAndPlay("E3");
}
else
{
_root.BT_OEIL.OEIL_P.gotoAndPlay("parle");
}
break;
case "ze":
case "ZE":
_root.DesactiveOEIL();
if(_root.BT_OEIL.gEtat !== 3)
{
_root.BT_OEIL.gotoAndPlay("E3");
}
else
{
_root.BT_OEIL.OEIL_P.gotoAndPlay("parle");
}
_root.afficherRolls();
break;
case "sp":
case "SP":
_root.MASCOTTE_SPAM.gotoAndStop("E1");
_root.MASCOTTE_SPAM._visible = true;
break;
case "wk":
case "WK":
_root.MASCOTTE_WIKI.gotoAndStop("E1");
_root.MASCOTTE_WIKI._visible = true;
break;
case "bg":
case "BG":
_root.MASCOTTE_BUG.gotoAndStop("E1");
_root.MASCOTTE_BUG._visible = true;
}
}
function testeFinCommentSpecial()
{
var _loc2_ = _root.gCommentOn.id.split("_")[_root.gCommentOn.id.split("_").length - 1];
switch(_loc2_)
{
case "bz":
case "BZ":
_root.ActiveOEIL();
_root.BT_OEIL.OEIL_P.gotoAndPlay("rentre");
_root.BT_OEIL.gClicOn = undefined;
break;
case "ze":
case "ZE":
_root.ActiveOEIL();
_root.BT_OEIL.OEIL_P.gotoAndPlay("rentre");
_root.BT_OEIL.gClicOn = undefined;
_root.masquerRolls();
break;
case "sp":
case "SP":
_root.MASCOTTE_SPAM.gotoAndStop("E2");
if(_root.MASCOTTE_SPAM.CacherApres != false)
{
_root.MASCOTTE_SPAM._visible = false;
}
break;
case "wk":
case "WK":
_root.MASCOTTE_WIKI.gotoAndStop("E2");
if(_root.MASCOTTE_WIKI.CacherApres != false)
{
_root.MASCOTTE_WIKI._visible = false;
}
break;
case "bg":
case "BG":
_root.MASCOTTE_BUG.gotoAndStop("E2");
if(_root.MASCOTTE_BUG.CacherApres != false)
{
_root.MASCOTTE_BUG._visible = false;
}
}
}
function activePause()
{
activePauseSons();
activePauseClip(gClipGen);
activePauseInterval();
}
function activePauseSons()
{
if(gCommentOn !== undefined)
{
gCommentOnPause = gCommentOn;
gCommentOnPause.p = gCommentOn.p;
xtrace("++++++++ " + gCommentOn.p);
gCommentOnPausePos = gCommentOn.position;
stopComment();
}
if(gListeBruitage !== undefined)
{
gListePosBruitage = [];
gListeBruitageP = [];
i = gListeBruitage.length - 1;
while(i >= 0)
{
var _loc1_ = gListePosBruitage.push[soundObjects[gBruitageName + gListeBruitage[i]].position];
gListeBruitageP.push[soundObjects[gBruitageName + gListeBruitage[i]].p];
stopBruitage(soundObjects[gBruitageName + gListeBruitage[i]].p);
i--;
}
}
if(gMusicOn)
{
gPosMusic = soundObjects[gMusic].position;
soundObjects[gMusic].stop();
}
}
function desactivePause()
{
desactivePauseSons();
desactivePauseClip();
desactivePauseInterval();
}
function desactivePauseSons()
{
if(gCommentOnPausePos !== undefined)
{
if(gCommentOnPause.duration / 1000 !== gCommentOnPausePos / 1000)
{
joueSon(gCommentOnPause.p);
}
}
if(gMusicOn)
{
soundObjects[gMusic].start(0,2000);
gPosMusic = undefined;
}
}
function findClipAnimRecursive(lClip, ListeClipAnim)
{
for(var _loc3_ in lClip)
{
if(typeof lClip[_loc3_] == "movieclip")
{
if(getPos(gListeClipPause,lClip[_loc3_]) == -1)
{
gListeClipPause.push(lClip[_loc3_]);
gListeClipPauseFrame.push(lClip[_loc3_]._currentframe);
var _loc2_ = lClip[_loc3_];
findClipAnimRecursive(_loc2_);
}
}
}
}
function compareClipFrame(lClip)
{
var _loc1_ = 0;
while(_loc1_ < gListeClipPause.length)
{
if(gListeClipPauseFrame[_loc1_] == gListeClipPause[_loc1_]._currentframe)
{
gListeClipPauseJoueur.push(0);
}
else
{
gListeClipPauseJoueur.push(1);
}
gListeClipPause[_loc1_].gotoAndStop(gListeClipPauseFrame[_loc1_]);
_loc1_ = _loc1_ + 1;
}
}
function activePauseClip(lClip)
{
gListeClipPause = [];
gListeClipPauseFrame = [];
gListeClipPauseJoueur = [];
lClip.pFrame = 0;
lClip.onEnterFrame = function()
{
this.pFrame += 1;
switch(this.pFrame)
{
case 1:
findClipAnimRecursive(this);
break;
case 2:
compareClipFrame(this);
delete this.onEnterFrame;
mcPause = creerRectangle({nom:"mcPause",pere:_root,level:15001,width:gWidth,height:gHeight,x:0,y:0,alpha:0});
mcPause.useHandCursor = false;
mcPause.onPress = function()
{
};
}
};
}
function desactivePauseClip()
{
var _loc1_ = 0;
while(_loc1_ < gListeClipPause.length)
{
if(gListeClipPauseJoueur[_loc1_] == 1)
{
gListeClipPause[_loc1_].gotoAndPlay(gListeClipPauseFrame[_loc1_]);
}
else
{
gListeClipPause[_loc1_].gotoAndStop(gListeClipPauseFrame[_loc1_]);
}
_loc1_ = _loc1_ + 1;
}
gListeClipPause = undefined;
gListeClipPauseFrame = undefined;
gListeClipPauseJoueur = undefined;
}
function spacePause()
{
if(gPauseOn == undefined)
{
activePause();
gPauseOn = 1;
}
else
{
removeMovieClip(mcPause);
desactivePause();
gPauseOn = undefined;
}
}
function playClipAnim(lClip)
{
playClipAnimRecursive(lClip,[]);
}
this.CIBLE = _root;
_global.gimme2digits = gimme2digits;
_global.gimme3digits = gimme3digits;
_global.randomValue = randomValue;
_root.InitMascotte = InitMascotte;
_root.afficherMascottes = afficherMascottes;
_root.MascottesMode = "AutoHide";
_root.cacherMascottes = cacherMascottes;
var CIBLE = _root;
this.xPauseOn = function()
{
_global.pauseComment();
this.moteur.PauseMCs = [];
this.moteur.xPause_rec({clipref:_root});
};
this.xPauseOff = function()
{
this.moteur.PauseDesactive();
_global.continueComment();
};
this.PAUSEINTFUNC = function()
{
var _loc3_ = getTimer();
if(_loc3_ - this.firstTime >= 100)
{
clearInterval(this.PAUSEINT);
this.xPause_rec2({clipref:_root});
}
};
this.xPause_rec = function(p)
{
for(prop in p.clipref)
{
if(typeof p.clipref[prop] == "movieclip" && p.clipref[prop] != _root && p.clipref[prop].NoPause != true)
{
p.clipref[prop].DetectFrameFirst = p.clipref[prop]._currentframe;
this.xPause_rec({clipref:p.clipref[prop]});
}
}
if(p.clipref == _root)
{
this.firstTime = getTimer();
this.PAUSEINT = setInterval(this,"PAUSEINTFUNC",10);
}
};
this.xPause_rec2 = function(p)
{
for(prop in p.clipref)
{
if(typeof p.clipref[prop] == "movieclip" && p.clipref[prop] != _root && p.clipref[prop].NoPause != true)
{
p.clipref[prop].DetectFrameLast = p.clipref[prop]._currentframe;
if(p.clipref[prop].DetectFrameLast != p.clipref[prop].DetectFrameFirst)
{
this.PauseMCs.push(p.clipref[prop]);
}
this.xPause_rec2({clipref:p.clipref[prop]});
}
}
if(p.clipref == _root)
{
this.PauseActive();
}
};
this.PauseActive = function()
{
for(prop in this.PauseMCs)
{
this.PauseMCs[prop].stop();
}
};
this.PauseDesactive = function()
{
for(prop in this.PauseMCs)
{
this.PauseMCs[prop].play();
}
};
this.CIBLE = _root;
if(_global.gDataPath == undefined)
{
_global.gDataPath = "../../";
}
this.ChargeMoteur = function(p)
{
_root.moduleXmlRoot = _global.moduleXmlRoot;
_root.gModulePath = GetFilePath(this.CIBLE._url) + "/";
if(!_root.moduleOnline)
{
_root.XmlStocker = new XML();
_root.XmlStocker.ignoreWhite = true;
_root.XmlStocker.load(_root.gModulePath + "localConfig.xml");
_root.XmlStocker.onLoad = _root.onlocalConfigLoaded;
}
else
{
_root.Main();
}
};
_root.ChargeMoteur = this.ChargeMoteur;
this.CIBLE.onlocalConfigLoaded = function(success)
{
if(success)
{
_root.moduleXmlRoot = _root.gModulePath + this.firstChild.attributes.src;
_root.Main();
}
};
this.CIBLE.Main = function()
{
this.CIBLE.moduleInfo = _root.moduleInfo = new prod.moteur.V001_xb_ChargementXML(this.CIBLE,_root.moduleXmlRoot,_root.moduleOnline);
};
this.CIBLE.xmlLoaded = function()
{
_global.HOTE.LoadingProgress(70);
this.initGen();
this.gModuleName = this.moduleInfo.returnNodeByPath("BackOffice").firstChild.attributes.id;
this.gCommentName = "S_" + this.gLangue + "_" + this.gModuleName + "_";
this.gBruitageName = "B_" + this.gModuleName + "_";
this.gImagesPath = this.gModulePath + "/I_" + this.gModuleName;
var _loc3_ = this.gModuleName.split("_");
this.gModuleNumber = Number(_loc3_[_loc3_.length - 1]);
this.gRubriqueName = _loc3_[0].substr(0,3);
this.gCdName = _loc3_[0].substr(3,3);
this.traceModuleInfos();
this.mediaChargeur = new prod.moteur.V007xb_ChargementMedias(this.CIBLE,this.CIBLE.moduleInfo,this.CIBLE.moduleOnline);
this.gereTextes = new prod.moteur.V014xb1_GereTextes(this.CIBLE,this.CIBLE.moduleInfo);
};
this.CIBLE.mediaLoaded = function()
{
if(typeof this.mediaChargeur == "undefined")
{
this.OnlySoundExterneHack = setInterval(this,"mediaLoaded",20);
}
else
{
this.soundObjects = this.mediaChargeur.returnSoundObject();
clearInterval(this.OnlySoundExterneHack);
this.initModule();
}
};
this.CIBLE.initModule = function()
{
_global.HOTE.LoadingProgress(90);
this.CIBLE.initVariables();
};
_root.initKeyPause = function()
{
gPauseOn = 0;
gPauseSpaceOn = 0;
gPauseSpaceEnCours = 0;
};
_root.initGen = function()
{
_root.gClipGen = _global.gClipGen = this;
Stage.showMenu = false;
this.gLangue = _global.HOTE.LocalConfig.Langue != undefined ? _global.HOTE.LocalConfig.Langue.toUpperCase() : "FR";
this.gMusicOn = 1;
this.gSousTitre = 0;
this.gST = 0;
this.gVolume = 100;
this.gWidth = moduleInfo.returnNodeByPath("BackOffice").firstChild.attributes.width;
this.gHeight = moduleInfo.returnNodeByPath("BackOffice").firstChild.attributes.height;
if(this.gWidth == undefined)
{
this.gWidth = 800;
}
else
{
this.gWidth = Number(this.gWidth);
}
if(this.gHeight == undefined)
{
this.gHeight = 600;
}
else
{
this.gHeight = Number(this.gHeight);
}
initKeyPause();
};
_root.traceModuleInfos = function()
{
};
stop();