home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 135
/
MOBICLIC135.ISO
/
pc
/
DATA
/
HOTE
/
prod_gen_ED
/
moteur.swf
/
scripts
/
frame_1
/
DoAction.as
Wrap
Text File
|
2011-06-22
|
9KB
|
320 lines
function activePause(lClip)
{
trace("pause generale du clip " + 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 _loc2_ = lClip.soundObjects[lClip.gBruitageName + lClip.gListeBruitage[i]];
_loc2_.p.offset = _loc2_.position / 1000;
lClip.gListeBruitageP["Bruit_" + i] = _loc2_.p;
stopBruit(_loc2_.p);
i--;
}
}
}
function desactivePause(lClip)
{
desactivePauseClips(lClip);
desactivePauseSons(lClip);
desactivePauseInterval(lClip);
}
function desactivePauseSons(lClip)
{
if(lClip.gCommentOnPausePos !== undefined)
{
if(lClip.gCommentOnPause.duration / 1000 !== lClip.gCommentOnPausePos / 1000)
{
joueSon(lClip.gCommentOnPause.p);
}
}
if(lClip.gListeBruitageP !== undefined)
{
for(var _loc2_ in lClip.gListeBruitageP)
{
joueBruitage(lClip.gListeBruitageP[_loc2_]);
}
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;
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;
if(_global.gDataPath == undefined)
{
_global.gDataPath = "../../";
}
this.ChargeMoteur = function(p)
{
_root.moduleXmlRoot = _global.moduleXmlRoot;
trace("_ChargeMoteur() - Chargement du moteur (prod/moteur/main.as)" + _root);
if(_global.gModulePath == undefined)
{
_root.gModulePath = _global.gModulePath = "";
}
else
{
_root.gModulePath = _global.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("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();
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.mediaChargeur = new prod.moteur.V007_ED_ChargementMedias(this.CIBLE,this.CIBLE.moduleInfo,this.CIBLE.moduleOnline);
this.gereTextes = new prod.moteur.V017_GereTextes(this.CIBLE,this.CIBLE.moduleInfo);
};
this.CIBLE.mediaLoaded = function()
{
trace("mediaLoaded =");
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();