home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 174
/
MOBICLIC174.ISO
/
pc
/
DATA
/
HOTE
/
prod_gen_XB
/
moteur.swf
/
scripts
/
frame_1
/
DoAction.as
Wrap
Text File
|
2015-04-27
|
16KB
|
568 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)
{
trace("InitMascotte " + this);
var _loc3_ = this.MediasExternes[p.mc._name].ParamsXml;
var _loc4_ = p.mc;
_loc4_.ParamsXml = this.MediasExternes[_loc4_._name].ParamsXml;
trace("this.MediasExternes : " + _root.MediasExternes);
trace("mascotte._name : " + _loc4_._name);
trace("this.MediasExternes[mascotte._name].ParamsXml : " + this.MediasExternes[_loc4_._name].ParamsXml);
trace("this.MediasExternes[mascotte._name] : " + this.MediasExternes[_loc4_._name]);
_loc4_._x = _loc3_.x != undefined ? _loc3_.x : 0;
trace("params_xml.x : " + _loc3_.x);
_loc4_._y = _loc3_.y != undefined ? _loc3_.y : 0;
trace("params_xml.y : " + _loc3_.y);
_loc4_._xscale = _loc3_.scale != undefined ? Number(_loc3_.scale) : 100;
trace("params_xml.scale : " + _loc3_.scale);
_loc4_._yscale = _loc3_.scale != undefined ? Math.abs(Number(_loc3_.scale)) : 100;
trace("params_xml.scale : " + _loc3_.scale);
return _loc4_;
}
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 _loc4_ = undefined;
_loc2_ = 0;
while(_loc2_ < mascottes.length)
{
_loc4_ = _root["MASC_" + mascottes[_loc2_].nom];
_loc4_.ETAT = mascottes[_loc2_].action;
trace("mascottes[i].action : " + mascottes[_loc2_].action);
_loc4_.gotoAndStop(mascottes[_loc2_].action);
_root.InitMascotte({mc:_loc4_});
_loc4_._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":
trace("------- BZ on-----------");
_root.DesactiveOEIL();
if(_root.BT_OEIL.gEtat !== 3)
{
trace("E3");
_root.BT_OEIL.gotoAndPlay("E3");
}
else
{
trace("PARLE");
_root.BT_OEIL.OEIL_P.gotoAndPlay("parle");
}
break;
case "ze":
case "ZE":
trace("------- ZE on-----------");
_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":
trace("------- SP on-----------");
_root.MASCOTTE_SPAM.gotoAndStop("E1");
_root.MASCOTTE_SPAM._visible = true;
break;
case "wk":
case "WK":
trace("------- WK on-----------");
trace("------- MASCOTTE_WIKI-----------");
_root.MASCOTTE_WIKI.gotoAndStop("E1");
_root.MASCOTTE_WIKI._visible = true;
break;
case "bg":
case "BG":
trace("------- BG on-----------");
_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":
trace("------- BZ off-----------");
_root.ActiveOEIL();
_root.BT_OEIL.OEIL_P.gotoAndPlay("rentre");
_root.BT_OEIL.gClicOn = undefined;
break;
case "ze":
case "ZE":
trace("------- ZE off-----------");
_root.ActiveOEIL();
_root.BT_OEIL.OEIL_P.gotoAndPlay("rentre");
_root.BT_OEIL.gClicOn = undefined;
_root.masquerRolls();
break;
case "sp":
case "SP":
trace("------- SP off-----------");
_root.MASCOTTE_SPAM.gotoAndStop("E2");
if(_root.MASCOTTE_SPAM.CacherApres != false)
{
_root.MASCOTTE_SPAM._visible = false;
}
break;
case "wk":
case "WK":
trace("------- WK off-----------");
_root.MASCOTTE_WIKI.gotoAndStop("E2");
if(_root.MASCOTTE_WIKI.CacherApres != false)
{
_root.MASCOTTE_WIKI._visible = false;
}
break;
case "bg":
case "BG":
trace("------- BG off-----------");
_root.MASCOTTE_BUG.gotoAndStop("E2");
if(_root.MASCOTTE_BUG.CacherApres != false)
{
_root.MASCOTTE_BUG._visible = false;
}
}
}
function activePause(lClip)
{
if(lClip.streamVideoPlaying !== undefined)
{
lClip.streamVideoPlaying.pause();
}
trace("pause generale du clip " + lClip);
activePauseClips(lClip);
activePauseSons(lClip);
activePauseInterval(lClip);
}
function activePauseSons(lClip)
{
trace("active pause sons");
if(lClip.gCommentOn !== undefined)
{
lClip.gCommentOnPause = lClip.gCommentOn;
lClip.gCommentOnPause.p = lClip.gCommentOn.p;
lClip.gCommentOnPausePos = lClip.gCommentOn.position;
stopComment();
}
if(lClip.gListeBruitage !== undefined)
{
lClip.gListeBruitageP = new Object();
i = lClip.gListeBruitage.length - 1;
while(i >= 0)
{
var _loc1_ = lClip.soundObjects[lClip.gBruitageName + lClip.gListeBruitage[i]];
_loc1_.p.offset = _loc1_.position / 1000;
_loc1_.p.media = _loc1_;
lClip.gListeBruitageP["Bruit_" + i] = _loc1_.p;
stopBruit(_loc1_.p);
i--;
}
}
}
function desactivePause(lClip)
{
desactivePauseClips(lClip);
desactivePauseSons(lClip);
desactivePauseInterval(lClip);
if(lClip.streamVideoPlaying !== undefined)
{
lClip.streamVideoPlaying.pause();
}
}
function desactivePauseSons(lClip)
{
if(lClip.gCommentOnPausePos !== undefined)
{
if(lClip.gCommentOnPause.duration / 1000 !== lClip.gCommentOnPausePos / 1000)
{
joueSon(lClip.gCommentOnPause.p);
}
else
{
lClip.commentFini();
}
}
if(lClip.gListeBruitageP !== undefined)
{
for(var _loc2_ in lClip.gListeBruitageP)
{
if(lClip.gListeBruitageP[_loc2_].duration / 1000 !== lClip.gListeBruitageP[_loc2_].offset)
{
joueBruitage(lClip.gListeBruitageP[_loc2_]);
}
else if(lClip.gListeBruitageP[_loc2_].actionFin !== undefined)
{
lClip[lClip.gListeBruitageP[_loc2_].actionFin]();
}
}
lClip.gListeBruitageP = undefined;
lClip.gListePosBruitage = undefined;
}
}
function pauseClipRecursive(mc, lClip)
{
for(var _loc5_ in lClip)
{
if(typeof lClip[_loc5_] == "movieclip")
{
if(_root.getPos(mc.gListeClips,lClip[_loc5_]) == -1)
{
mc.gListeClips.push(lClip[_loc5_]);
mc.gListeClipFrame.push(lClip[_loc5_]._currentframe);
var _loc4_ = mc.gListeClips[mc.gListeClips.length - 1];
pauseClipRecursive(mc,_loc4_);
}
}
}
}
function activePauseClips(pClip)
{
pClip.createEmptyMovieClip("testPause",chercheDepthPlus(pClip,300));
trace("testPause = " + pClip.testPause);
var _loc3_ = pClip.testPause;
_loc3_.gListeClips = [];
_loc3_.gListeClipFrame = [];
_loc3_.gListeClipsPlayStop = [];
_loc3_.gListeClipEnterFrame = [];
_loc3_.pFrame = 0;
_loc3_.onEnterFrame = function()
{
this.pFrame += 1;
if(this.pFrame == 1)
{
this.gListeClips.push(pClip);
this.gListeClipFrame.push(pClip._currentframe);
pauseClipRecursive(this,pClip);
}
else
{
var _loc2_ = 0;
while(_loc2_ < this.gListeClips.length)
{
if(this.gListeClips[_loc2_]._currentframe !== this.gListeClipFrame[_loc2_])
{
this.gListeClipsPlayStop[_loc2_] = 1;
}
else
{
this.gListeClipsPlayStop[_loc2_] = 0;
}
this.gListeClips[_loc2_].gotoAndStop(this.gListeClipFrame[_loc2_]);
_loc2_ = _loc2_ + 1;
}
delete this.onEnterFrame;
}
};
}
function desactivePauseClips(pClip)
{
var _loc2_ = pClip.testPause;
var _loc1_ = 0;
while(_loc1_ < _loc2_.gListeClips.length)
{
if(_loc2_.gListeClipsPlayStop[_loc1_] == 1)
{
_loc2_.gListeClips[_loc1_].gotoAndPlay(_loc2_.gListeClipFrame[_loc1_]);
}
else
{
_loc2_.gListeClips[_loc1_].gotoAndStop(_loc2_.gListeClipFrame[_loc1_]);
}
_loc1_ = _loc1_ + 1;
}
removeMovieClip(_loc2_);
}
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()
{
trace("xPauseOn " + this + " " + _global.pauseComment);
_global.pauseComment();
this.moteur.PauseMCs = [];
this.moteur.xPause_rec({clipref:_root});
};
this.xPauseOff = function()
{
trace("xPauseOff " + this);
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()
{
trace("PAUSEACTIVE " + this.PauseMCs.length);
for(prop in this.PauseMCs)
{
trace(this.PauseMCs[prop]);
this.PauseMCs[prop].stop();
}
};
this.PauseDesactive = function()
{
trace("PAUSEDESACTIVE " + this.PauseMCs.length);
for(prop in this.PauseMCs)
{
trace(this.PauseMCs[prop]);
this.PauseMCs[prop].play();
}
};
this.CIBLE = _root;
trace("GetFilePath " + GetFilePath);
if(_global.gDataPath == undefined)
{
_global.gDataPath = "../../";
}
this.ChargeMoteur = function(p)
{
_root.moduleXmlRoot = _global.moduleXmlRoot;
trace("_ChargeMoteur2() - Chargement du moteur (prod/moteur/main.as)" + _root);
_root.gModulePath = GetFilePath(this.CIBLE._url) + "/";
trace(GetFilePath);
trace(this.CIBLE._url);
trace("_root.gModulePath : " + _root.gModulePath);
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)
{
trace("xml.onlocalConfigLoaded ");
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_ChargementXML(this.CIBLE,_root.moduleXmlRoot,_root.moduleOnline);
};
this.CIBLE.xmlLoaded = function()
{
trace("(!) xmlLoaded() ");
_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
{
trace("__mediaLoaded()");
this.soundObjects = this.mediaChargeur.returnSoundObject();
clearInterval(this.OnlySoundExterneHack);
this.initModule();
}
};
this.CIBLE.initModule = function()
{
trace("__initModule()" + this.CIBLE + " _ " + this.CIBLE.initVariables);
_global.HOTE.LoadingProgress(90);
this.CIBLE.initVariables();
};
_root.initKeyPause = function()
{
gPauseOn = 0;
gPauseSpaceOn = 0;
gPauseSpaceEnCours = 0;
};
_root.initGen = function()
{
trace("(!) initGen (HOTE/prod_gen??/prod/moteur/main.as)");
_root.gClipGen = _global.gClipGen = this;
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()
{
trace("");
trace("(!)_________ traceModuleInfos _________");
trace("gLangue : " + this.gLangue);
trace("gCdName : " + this.gCdName);
trace("gRubriqueName : " + this.gRubriqueName);
trace("gModuleNumber : " + this.gModuleNumber);
trace("(!)____________________________________");
trace("");
};
stop();