home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 141
/
MOBICLIC141.ISO
/
mac
/
DATA
/
HOTE
/
prod_gen
/
moteur.swf
/
scripts
/
frame_1
/
DoAction.as
Wrap
Text File
|
2012-01-10
|
10KB
|
350 lines
function activePause()
{
trace("paused ?");
activePauseSons();
activePauseClip(gClipGen);
activePauseInterval();
}
function activePauseSons()
{
trace("active pause");
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
{
trace(gListeClipPause[_loc1_] + " _ " + gListeClipPauseFrame[_loc1_] + " _ " + gListeClipPause[_loc1_]._currentframe);
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)
{
trace("PAUSE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ");
activePause();
gPauseOn = 1;
}
else
{
trace("ARRETE LA PAUSE !!!!!!!!!!!!!!!!!!!!! ");
removeMovieClip(mcPause);
desactivePause();
gPauseOn = undefined;
}
}
function playClipAnim(lClip)
{
playClipAnimRecursive(lClip,[]);
}
this.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;
this.CIBLE.ChargeMoteur = function(p)
{
_root.moduleXmlRoot = _global.moduleXmlRoot;
trace("_ChargeMoteur() - Chargement du moteur (prod/moteur/main.as)" + this.CIBLE);
trace("this.CIBLE.gModulePath " + _global.gModulePath + " _ " + this + " " + _global.moduleOnline + " " + moduleOnline);
if(_global.gModulePath == undefined)
{
this.gModulePath = _global.gModulePath = "";
}
else
{
this.gModulePath = _global.gModulePath;
}
if(!moduleOnline)
{
this.XmlStocker = new XML();
this.XmlStocker.ignoreWhite = true;
this.XmlStocker.load(this.gModulePath + "localConfig.xml");
this.XmlStocker.onLoad = this.onlocalConfigLoaded;
}
else
{
_root.Main();
}
};
this.CIBLE.onlocalConfigLoaded = function(success)
{
trace("onlocalConfigLoaded " + this);
if(success)
{
_root.moduleXmlRoot = _root.gModulePath + this.firstChild.attributes.src;
_root.Main();
}
};
this.CIBLE.Main = function()
{
trace(this.CIBLE);
this.CIBLE.moduleInfo = _root.moduleInfo = new prod.moteur.V000_ChargementXML(this.CIBLE,_root.moduleXmlRoot,_root.moduleOnline);
};
this.CIBLE.xmlLoaded = function()
{
trace("__xmlLoaded() " + this.CIBLE);
_global.HOTE.LoadingProgress(70);
this.initGen();
trace("this.gLangue 1===== " + this.gLangue);
trace("gLangue 1===== " + gLangue);
this.gModuleName = this.moduleInfo.returnNodeByPath("BackOffice").firstChild.attributes.id;
this.gCommentName = "S_" + this.gLangue + "_" + this.gModuleName + "_";
this.gBruitageName = "B_" + this.gModuleName + "_";
trace("gBruitageName = " + gBruitageName);
trace("_root.gBruitageName = " + _root.gBruitageName);
trace("this.gBruitageName = " + this.gBruitageName);
this.gImagesPath = this.gModulePath + "/I_" + this.gModuleName;
var _loc4_ = this.gModuleName.split("_");
this.gModuleNumber = Number(_loc4_[_loc4_.length - 1]);
this.mediaChargeur = new prod.moteur.V004_ChargementMedias(this.CIBLE,this.CIBLE.moduleInfo,this.CIBLE.moduleOnline);
this.gereTextes = new prod.moteur.V013_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()
{
_root.gClipGen = _global.gClipGen = this;
trace("______________________________ " + 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();
};
trace("zzzz " + _root + " " + this.CIBLE);
stop();