Instance of Symbol 23 MovieClip [YamzPreload] in Frame 2
//component parameters
onClipEvent (initialize) {
url = "";
_targetInstanceName = "";
startLoading = true;
action = "gotoAndStop";
label = "config";
endValue = 100;
endType = "%";
idGraphic = "";
version = false;
group = "";
order = 0;
}
Instance of Symbol 20 MovieClip [yamzConfig] in Frame 17
//component parameters
onClipEvent (initialize) {
config = "yamz.swf";
gotoAnd = "Stop";
label = "lang";
NetDebugTarget = "_level0";
}
Frame 22
if (Language == undefined) {
_level0.createEmptyMovieClip("Language", 2000000);
_global.Language = _level0.Language;
Language.load = function (pLanguage, pUrl) {
if (pLanguage == undefined) {
pLanguage = System.capabilities.language.substring(0, 2);
}
var i = 0;
while (i < this.available.length) {
if (pLanguage == this.available[i]) {
break;
}
i++;
}
if (i == this.available.length) {
pLanguage = this.available[0];
}
this.vName = pLanguage;
if ((pUrl.length > 0) && (pUrl.substring(pUrl.length - 1) != "/")) {
pUrl = pUrl + "/";
}
this.loadVariables((pUrl + this.vName) + ".swf");
};
Language.get = function (pInit) {
return((pInit ? (System.capabilities.language.substring(0, 2)) : (this.vName)));
};
Language.available = ["en", "fr"];
} else {
trace("=================================================");
trace("objet LANGUAGE: message d'erreur");
trace("Attention vous tentez de cr\u00E9er un deuxi\u00E8me objet");
trace("Language ou vous avez d\u00E9fini une variable du m\u00EAme");
trace("nom.");
trace("Pour r\u00E9soudre le probl\u00E8me, choisissez un autre nom");
trace("pour votre variable");
trace("=================================================");
}
_focusrect = false;
Stage.showMenu = false;
Language.available = ["en"];
Language.onData = function () {
gotoAndStop (27);
};
Language.load();
Instance of Symbol 18 MovieClip [yamzSoundManager] in Frame 27
//component parameters
onClipEvent (initialize) {
_config = "yamzsound.xml";
_todo = "gotoAndStop";
_nframe = "loading";
}
Frame 32
var lPG = (new yamz.Preloadgroup());
preload_mc.group = lPG;
attachMovie("YamzPreload", "mcPreSound", 0, {url:"soundmain.swf", target:mcSound, order:0, group:lPG});
attachMovie("YamzPreload", "mcPreInterf", 1, {url:"interface.swf", target:interface_mc, order:1, group:lPG});
lPG.onLoadComplete = function () {
yamz.SoundManager.current.addSoundFile("main", yamz.SoundManager.current._parent, "", "hifi");
yamz.SoundManager.current.onBuild = function (pFile) {
nextFrame();
interface_mc.nextFrame();
yamz.SoundManager.current._intro.start();
yamz.SoundManager.current._intro.onSoundComplete = function () {
yamz.SoundManager.current._MainBoucle.start(0, 999);
delete this.onSoundComplete;
};
};
};
_quality = "BEST";
lPG.loadGroup(false, true, false);
Symbol 10 MovieClip Frame 1
mcBar._xscale = (mcTotalBar._xscale = 0);
this._parent.onLoadProgress = function (pCurrent, pCurrentLoaded, pCurrentTotal, pLoaded, pTotal, pSpeed, pCurrentTime, pTime) {
speed = pSpeed + "kb/s";
time = pTime + "s";
file = pCurrent;
currentLoading = ((((pCurrentLoaded + "/") + pCurrentTotal) + " [") + pCurrentTime) + "s]";
loading = ((((pLoaded + "/") + pTotal) + " [") + pTime) + " s]";
mcBar._xscale = 100 * (pCurrentLoaded / pCurrentTotal);
mcTotalBar._xscale = 100 * (pLoaded / pTotal);
};
Symbol 11 MovieClip [YamzPreloadQ] Frame 1
#initclip 3
if (_level0.yamz == undefined) {
_level0.yamz = {};
}
if (_global.yamz == undefined) {
_global.yamz = _level0.yamz;
}
if (yamz.PreloadQ == undefined) {
yamz.PreloadQ = function () {
if (this.stopWhenLoading == undefined) {
this.stopWhenLoading = true;
}
if (this.serverGet === undefined) {
this.serverGet = true;
}
if (this.version == undefined) {
this.version = false;
}
this.vLoader = new LoadVars();
var lParent = this;
this.vLoader.onData = function () {
if (this.getBytesTotal() == undefined) {
lParent.onLoadError({level:"error", description:"fichier inexistant: " + lParent.current, code:0});
}
};
this.setGraphic(this.idGraphic);
if (this.stopWhenLoading && (yamz.Preload == undefined)) {
this.onLoadError({level:"warning", description:"classe yamz.Preload non d\u00E9finie, support stopWhenLoading d\u00E9sactiv\u00E9" + lParent.current, code:2});
}
if (this.startLoading) {
this.load();
}
};
Object.registerClass("yamzPreloadQ", yamz.PreloadQ);
yamz.PreloadQ.prototype = new MovieClip();
yamz.PreloadQ.__getURL = function (pUrl, pVersion) {
var lPath = yamz.System.mainPath;
if (((pUrl.indexOf("://") != -1) || (lPath == undefined)) || (lPath == "")) {
var lUrl = pUrl;
} else {
var lLength = (lPath.length - 1);
if (lPath.charAt(lLength) == "/") {
lPath = lPath.substring(0, lLength);
}
if (!lPath.indexOf("..")) {
var lUrl = ((lPath + "/") + pUrl);
} else {
var lLength = (lPath.length - 1);
if (lPath.charAt(lLength) == "/") {
lPath = lPath.substring(0, lLength);
}
var lParent = pUrl.split("../");
lLength = lParent.length - 1;
var lUrl = lPath.split("/");
lUrl = lUrl.slice(0, lUrl.length - lLength).join("/");
if (lUrl != "") {
lUrl = lUrl + "/";
}
lUrl = lUrl + lParent[lLength];
}
}
return((((MMSave == undefined) && (pVersion)) ? ((lUrl + "?") + yamz.System.version) : (lUrl)));
};
yamz.PreloadQ.prototype.loadProgress = function () {
if (!this.files.length) {
this.loading = false;
this.onLoadComplete();
if (this.getDepth() < 0) {
this.swapDepths(1048575);
}
this.removeMovieClip();
return(undefined);
}
if (this.stopWhenLoading && (yamz.Preload.loading)) {
this.loading = false;
return(this.loadProgress);
}
this.current = yamz.PreloadQ.__getURL(this.files.shift(), this.version);
this.loading = true;
this.vLoader.load(this.current);
var lStartTime = getTimer();
return(function () {
var lCurrentLoaded = this.vLoader.getBytesLoaded();
var lCurrentTotal = this.vLoader.getBytesTotal();
var lCurrentProgress = (lCurrentLoaded / lCurrentTotal);
if (isNaN(lCurrentProgress)) {
lCurrentProgress = 0;
}
var lLoaded = (this.serverGet ? (this.vLoaded + lCurrentLoaded) : (((this.vTotal - 1) - this.files.length) + lCurrentProgress));
if (lCurrentTotal > 0) {
var lTime = (getTimer() - this.vStartTime);
var lCurrentTime = (getTimer() - lStartTime);
var lSpeed = (this.serverGet ? (lLoaded / lTime) : (lCurrentLoaded / lCurrentTime));
var lCurrentTimeLeft = Math.ceil((lCurrentTotal - lCurrentLoaded) / (lSpeed * 1000));
var lTimeLeft = (this.serverGet ? (Math.ceil((this.vTotal - lLoaded) / (lSpeed * 1000))) : "?");
this.onLoadProgress(this.current, lCurrentLoaded, lCurrentTotal, lLoaded, this.vTotal, Math.round(lSpeed), lCurrentTimeLeft, lTimeLeft);
if (lCurrentLoaded >= lCurrentTotal) {
this.vLoaded = this.vLoaded + lCurrentTotal;
this.onCurrentLoadComplete(this.current);
this.onEnterFrame = this.loadProgress();
}
}
});
};
yamz.PreloadQ.prototype.load = function (pFiles, pVersion) {
if (pFiles != undefined) {
this.files = pFiles;
}
if (pVersion != undefined) {
this.version = pVersion;
}
if ((typeof(this.files) == "string") && (this.files != "")) {
this.files = [this.files];
} else if ((this.files instanceof Array) && (this.files.length)) {
this.files = this.files.slice();
} else {
this.onLoadError({level:"error", description:"cible non d\u00E9finie", code:1});
return(undefined);
}
this.total = this.files.length;
this.vStartTime = getTimer();
this.vLoaded = 0;
this.vTotal = 0;
this.mcGraphic._visible = true;
if (this.serverGet) {
var getFile = new LoadVars();
getFile.files = this.files.join("|");
var lThis = this;
getFile.onLoad = function () {
if (this.total != undefined) {
lThis.vTotal = Number(this.total);
} else {
lThis.onLoadError({level:"warning", description:"calcul du poids total impossible", code:1});
lThis.vTotal = lThis.files.length;
lThis.serverGet = false;
}
lThis.onEnterFrame = lThis.loadProgress();
};
getFile.sendAndLoad("gettotalsize.php", getFile);
} else {
this.vTotal = this.files.length;
this.onEnterFrame = this.loadProgress();
}
};
yamz.PreloadQ.prototype.setGraphic = function (pId) {
if ((arguments.length > 0) && (!(pId === undefined))) {
this.idGraphic = pId;
if ((pId == null) || (pId != "")) {
if (this.mcGraphic != undefined) {
this.mcGraphic.swapDepths(1048575);
this.mcGraphic.removeMovieClip();
}
if (pId != "") {
this.attachMovie(pId, "mcGraphic", 0);
}
}
}
this.mcGraphic._visible = false;
};
yamz.PreloadQ.prototype.onLoadError = function (pError) {
if (yamz.System.netDebug) {
debug("yamz.PreloaQ Erreur", pError);
} else {
trace("==== yamz.PreloadQ ERREUR ====");
for (var z in pError) {
trace((z + ": ") + pError[z]);
}
}
};
yamz.PreloadQ.prototype.onLoadProgress = function (pCurrent, pCurrentLoaded, pCurrentTotal, pLoaded, pTotal, pSpeed, pCurrentTimeLeft, pTimeLeft) {
if (yamz.System.netDebug) {
debug(((((((((((((((pCurrent + ": ") + pCurrentLoaded) + "/") + pCurrentTotal) + " | ") + pLoaded) + "/") + pTotal) + " [") + pSpeed) + "kb/s] [") + pCurrentTimeLeft) + "s | ") + pTimeLeft) + "s]");
} else {
trace(((((((((((((((pCurrent + ": ") + pCurrentLoaded) + "/") + pCurrentTotal) + " | ") + pLoaded) + "/") + pTotal) + " [") + pSpeed) + "kb/s] [") + pCurrentTimeLeft) + "s | ") + pTimeLeft) + "s]");
}
};
yamz.PreloadQ.prototype.onCurrentLoadComplete = function (pCurrent) {
if (yamz.System.netDebug) {
debug(pCurrent + ": chargement termin\u00E9");
} else {
trace(pCurrent + ": chargement termin\u00E9");
}
};
yamz.PreloadQ.prototype.onLoadComplete = function () {
if (yamz.System.netDebug) {
debug(this._name + ": chargement complet termin\u00E9");
} else {
trace(this._name + ": chargement complet termin\u00E9");
}
};
}
#endinitclip
Symbol 14 MovieClip [YamzPreloadGroup] Frame 1
mcBar._xscale = (mcTotalBar._xscale = 0);
var lThis = this;
this.group.onLoadProgress = function (pCurrent, pCurrentLoaded, pCurrentTotal, pLoaded, pTotal, pSpeed, pCurrentTime, pTime) {
speed = pSpeed + "kb/s";
time = pTime + "s";
file = pCurrent;
currentLoading = ((((pCurrentLoaded + "/") + pCurrentTotal) + " [") + pCurrentTime) + "s]";
loading = ((((pLoaded + "/") + pTotal) + " [") + pTime) + " s]";
mcBar._xscale = 100 * (pCurrentLoaded / pCurrentTotal);
mcTotalBar._xscale = 100 * (pLoaded / pTotal);
bob = mcTotalBar._xscale;
debug(arguments, mcTotalBar._xscale);
};
Symbol 18 MovieClip [yamzSoundManager] Frame 1
#initclip 1
MovieClip.prototype.getMaxDepth = function (pMax) {
if (!pMax) {
pMax = 0;
}
for (var z in this) {
var lDepth = this[z].getDepth();
var lTemp = this[z]._parent;
delete this[z]._parent;
if ((((z == this[z]._name) && (this[z]._parent == this)) && (lDepth != undefined)) && (lDepth < 1048575)) {
if (this[z]._parent != lTemp) {
this[z]._parent = lTemp;
}
return(((pMax > (lDepth + 1)) ? (pMax) : (lDepth + 1)));
}
}
if (this[z]._parent != lTemp) {
this[z]._parent = lTemp;
}
return(undefined);
};
ASSetPropFlags(MovieClip.prototype, "getMaxDepth", 1);
Object.prototype.clone = function () {
var lobj = {};
for (var z in this) {
if (typeof(this[z]) == "object") {
lobj[z] = this[z].clone();
} else {
lobj[z] = this[z];
}
}
return(lobj);
};
ASSetPropFlags(Object.prototype, "clone", 1);
if (_level0.yamz == undefined) {
_level0.yamz = {};
_global.yamz = _level0.yamz;
}
yamz.Sound = function (pClip) {
this.setManager(pClip);
};
yamz.Sound.prototype = new Sound();
yamz.Sound.prototype._start = Sound.prototype.start;
yamz.Sound.prototype.start = function () {
if (yamz.SoundManager.current.mute) {
return(undefined);
}
if (!yamz.SoundManager.current.inscriptSound(this)) {
delete this.onSoundComplete;
delete this.restart;
return(undefined);
}
this.isPlaying = true;
this.inFade = false;
this.boucle = arguments[1];
if (!this.isFinishing) {
this.manager.onEnterFrame = null;
}
this._start.apply(this, arguments);
};
ASSetPropFlags(yamz.Sound.prototype, "_start", 1);
yamz.Sound.prototype._stop = Sound.prototype.stop;
yamz.Sound.prototype.stop = function () {
if (this.isPlaying) {
yamz.SoundManager.current.garbageSound(this);
this.pos = Math.round(this.position / 1000);
this.isPlaying = false;
this.inFade = false;
delete this.boucle;
if (!this.isFinishing) {
this.manager.onEnterFrame = null;
}
}
this._stop.apply(this, arguments);
};
ASSetPropFlags(yamz.Sound.prototype, "_stop", 1);
yamz.Sound.prototype.stopAll = function () {
delete this.onSoundComplete;
if (this.isFinishing) {
this.boucle = 1;
this.replace();
} else {
this.stop();
}
if (this.restart) {
if (yamz.SoundManager.cleaning) {
delete this.restart;
} else {
this.boucle = 1;
}
}
};
yamz.Sound.prototype.startEv = function () {
if (yamz.SoundManager.current.mute) {
return(undefined);
}
if (this.isPlaying) {
return(undefined);
}
this.start(0, 999);
};
yamz.Sound.prototype.startEvCont = function () {
if (yamz.SoundManager.current.mute) {
return(undefined);
}
if (this.isPlaying) {
return(undefined);
}
this.onSoundComplete = function () {
this.stop();
delete this.onSoundComplete;
};
this.start();
};
yamz.Sound.prototype.startBoucle = function (pPos) {
if (yamz.SoundManager.current.mute) {
return(undefined);
}
if (pPos == undefined) {
pPos = 0;
}
if (this.isPlaying) {
return(undefined);
}
this.onSoundComplete = function () {
this.stop();
delete this.restart;
delete this.onSoundComplete;
};
this.start(pPos, 1);
this.restart = function () {
this.startBoucle(this.pos);
};
};
yamz.Sound.prototype.endBoucle = function () {
delete this.onSoundComplete;
delete this.restart;
};
yamz.Sound.prototype.startAlone = function () {
yamz.SoundManager.current.mute = false;
this.start();
yamz.SoundManager.current.mute = true;
};
yamz.Sound.prototype.setManager = function (pClip) {
this.manager = pClip;
super(pClip);
};
yamz.Sound.prototype.fadeIn = function (pSpeed, pVol, pStartVol, pPos, pBoucle) {
if (this.isFinishing) {
return(undefined);
}
var lThis = this;
if (pSpeed == undefined) {
pSpeed = 2;
}
if (pVol == undefined) {
pVol = 100;
}
if (pBoucle == undefined) {
pBoucle = 999;
}
this.setVolume(((pStartVol != undefined) ? (pStartVol) : 0));
pPos = ((pPos == undefined) ? 0 : (pPos));
if (!this.isPlaying) {
this.start(pPos, pBoucle);
}
this.manager.onEnterFrame = null;
this.inFade = true;
this.manager.onEnterFrame = function () {
lThis.setVolume(lThis.getVolume() + pSpeed);
if (lThis.getVolume() >= pVol) {
lThis.inFade = false;
lThis.setVolume(pVol);
if (!lThis.isFinishing) {
this.onEnterFrame = null;
}
}
};
};
yamz.Sound.prototype.fadeOut = function (pSpeed, pVol, pStartVol) {
if (this.isFinishing) {
delete this.boucle;
return(undefined);
}
var lThis = this;
this.isPlaying = false;
if (pSpeed == undefined) {
pSpeed = 2;
}
this.setVolume(((pStartVol != undefined) ? (pStartVol) : (this.getVolume())));
if (pVol == undefined) {
pVol = 0;
}
this.manager.onEnterFrame = null;
this.inFade = true;
this.manager.onEnterFrame = function () {
lThis.setVolume(lThis.getVolume() - pSpeed);
if (lThis.getVolume() <= pVol) {
lThis.inFade = false;
lThis.setVolume(pVol);
if (pVol <= 0) {
lThis.stop();
}
}
};
};
yamz.Sound.prototype.fadeInAndOut = function (pSpeed, pVol, pStartVol, pBoucle) {
if (this.isFinishing) {
return(undefined);
}
var lThis = this;
if (pSpeed == undefined) {
pSpeed = 2;
}
if (pVol == undefined) {
pVol = 0;
}
if (pBoucle == undefined) {
pBoucle = 999;
}
this.setVolume(((pStartVol != undefined) ? (pStartVol) : (this.getVolume())));
if (!this.isPlaying) {
this.start(0, pBoucle);
}
this.manager.onEnterFrame = null;
this.inFade = true;
var ltot = this.duration;
var ldur = (ltot / 2);
this.manager.onEnterFrame = function () {
var lpourc = (Math.abs(lThis.position - ldur) / ltot);
lpourc = Math.ceil((0.5 - lpourc) * 50);
lThis.setVolume(pStartVol + Math.max(lpourc, 20));
};
};
yamz.Sound.prototype.finishLife = function (pNewSon, pTarg) {
if (this.isFinishing) {
return(undefined);
}
var lenterF = this.manager.onEnterFrame;
var lthis = this;
this.oldpos = this.position;
this.newSon = pNewSon;
this.targ = pTarg;
if (this.inFade) {
this.manager.onEnterFrame = function () {
if (lthis.inFade) {
lenterF();
} else {
this.onEnterFrame = function () {
lthis.watchDeath();
};
}
};
} else {
this.manager.onEnterFrame = function () {
lthis.watchDeath();
};
}
this.isFinishing = true;
};
yamz.Sound.prototype.watchDeath = function () {
var lpos = this.position;
if ((lpos < this.oldpos) || (lpos == this.duration)) {
this.replace(this.newSon, this.targ);
} else {
this.oldpos = lpos;
}
};
yamz.Sound.prototype.replace = function () {
var lnewson = this.newSon;
var ltarg = this.targ;
this.isFinishing = false;
this.manager.onEnterFrame = null;
var lboucle = this.boucle;
lnewson.onSoundComplete = this.onSoundComplete;
delete this.onSoundComplete;
if (lboucle > 1) {
lnewson.start(0, lboucle);
}
lnewson.setVolume(this.getVolume());
yamz.SoundManager.current[ltarg] = lnewson;
this.stop();
delete this.oldpos;
};
yamz.SoundManager = function () {
trace("new yamz.SoundManager");
yamz.SoundManager.current = this;
this.createGroup();
this.mute = false;
this.broadcaster = {};
ASBroadcaster.initialize(this.broadcaster);
this.garbage = {};
if ((this._config == undefined) || (this._config.length == 0)) {
this.displayError(0, "vous devez d\u00E9finir un fichier de config");
} else {
this.init();
}
};
Object.registerClass("yamzSoundManager", yamz.SoundManager);
yamz.SoundManager.prototype = new MovieClip();
yamz.SoundManager.soundFiles = {};
yamz.SoundManager.currentFile;
yamz.SoundManager.cleaning;
yamz.SoundManager.prototype.init = function () {
var lpre = this._parent.attachMovie("YamzPreload", "mcPreloadSoundConfig", this._parent.getMaxDepth(), {_visible:false});
var lxml = new XML();
lxml.ignoreWhite = true;
lpre.onLoadComplete = function () {
if (lxml.status != 0) {
this.displayError(0, "erreur de syntaxe dans le fichier de config");
} else {
yamz.SoundManager.current.onInit(lxml);
}
};
lpre.loadClip(this._config, lxml);
};
yamz.SoundManager.prototype.onInit = function (pXML) {
var lnodes = pXML.firstChild.childNodes;
var i = 0;
while (i < lnodes.length) {
var lnode = lnodes[i];
if (lnode.attributes.hifi.indexOf(".swf") == -1) {
return(undefined);
}
yamz.SoundManager.soundFiles[lnode.attributes.id] = {hifi:lnode.attributes.hifi, lofi:lnode.attributes.lofi, musics:[], fx:[]};
var lmusic = lnode.firstChild.childNodes;
var lref = yamz.SoundManager.soundFiles[lnode.attributes.id].musics;
var j = 0;
while (j < lmusic.length) {
lref[j] = lmusic[j].nodeName;
j++;
}
var lfx = lnode.childNodes[1].childNodes;
var lref = yamz.SoundManager.soundFiles[lnode.attributes.id].fx;
var j = 0;
while (j < lfx.length) {
lref[j] = lfx[j].nodeName;
j++;
}
i++;
}
trace("yamz.SoundManager : description charg\u00E9e");
this.mcGraphic.swapDepths(0);
this.mcGraphic.removeMovieClip();
this.onReady();
};
yamz.SoundManager.prototype.onReady = function () {
if (this._todo != "null") {
if ((Number(this._nframe) > 0) || (this._nframe.length > 0)) {
this._parent[this._todo](this._nframe);
} else {
this.displayError(0, "initialisez la frame de destination");
}
} else {
this.displayError(0, "action \u00E0 null - impl\u00E9mentez la m\u00E9thode onReady");
}
};
yamz.SoundManager.prototype.displayError = function (pCode, pDescr) {
trace((("yamz.SoundManager error (" + pCode) + ") : ") + pDescr);
debug((("yamz.SoundManager error (" + pCode) + ") : ") + pDescr);
};
yamz.SoundManager.prototype.createGroup = function () {
var lMG = this.createEmptyMovieClip("mcMusicGroupe", this.getMaxDepth());
this.music = new yamz.Sound(lMg);
var lFxG = this.createEmptyMovieClip("mcFXGroupe", this.getMaxDepth());
this.soundFx = new yamz.Sound(lFxG);
};
yamz.SoundManager.prototype.inscriptSound = function (pSound) {
var lind = 0;
if (this.broadcaster._listeners.length > 8) {
var ltab = this.broadcaster._listeners;
while (lind < ltab.length) {
if (ltab[lind].boucle == undefined) {
ltab[lind].stopAll();
break;
}
lind++;
}
}
if (lind >= 8) {
return(false);
}
this.broadcaster.removeListener(pSound);
this.broadcaster.addListener(pSound);
return(true);
};
yamz.SoundManager.prototype.garbageSound = function (pSound) {
if (!pSound.restart) {
this.garbage[pSound.manager._name] = pSound;
clearInterval(this.idGarbage);
delete this.idGarbage;
this.idGarbage = setInterval(this, "clean", 100);
}
};
yamz.SoundManager.prototype.clean = function () {
clearInterval(this.idGarbage);
delete this.idGarbage;
var lgarb = this.garbage;
for (var z in lgarb) {
this.broadcaster.removeListener(lgarb[z]);
delete lgarb[z];
}
};
yamz.SoundManager.prototype.stopAllSounds = function (pClean) {
this.mute = true;
yamz.SoundManager.cleaning = pClean;
this.broadcaster.broadcastMessage("stopAll");
};
yamz.SoundManager.prototype.restartAllSounds = function (pFlag) {
this.mute = false;
if (!pFlag) {
this.broadcaster.broadcastMessage("restart");
}
};
yamz.SoundManager.prototype.setVolumeFx = function (pVol) {
this.soundFx.setVolume(pVol);
};
yamz.SoundManager.prototype.setVolumeMusic = function (pVol) {
this.music.setVolume(pVol);
};
yamz.SoundManager.prototype.setVolumeGen = function (pVol) {
this.setVolumeFx(pVol);
this.setVolumeMusic(pVol);
};
yamz.SoundManager.prototype.fadeIn = function () {
this.music.fadeIn();
this.soundFx.fadeIn();
};
yamz.SoundManager.prototype.fadeOut = function () {
var lvol = 100;
this.setVolumeGen(lvol);
return(function () {
lvol = lvol - 10;
if (lvol <= 0) {
lvol = 0;
this.onEnterFrame = null;
}
this.setVolumeGen(lvol);
});
};
yamz.SoundManager.prototype.addSoundFile = function (pKey, pRefL, pPath, pType) {
var lInfo = yamz.SoundManager.soundFiles[pKey];
var lMG = this.mcMusicGroupe;
var lFxG = this.mcFXGroupe;
if (yamz.SoundManager.currentFile != undefined) {
return(false);
}
if (lInfo.loaded == "hifi") {
yamz.SoundManager.current.onBuild(pKey);
return(undefined);
}
var ltype;
if (lInfo.loaded == "lofi") {
ltype = "hifi";
} else {
ltype = ((pType == undefined) ? "lofi" : (pType));
}
var lfile = (pPath + lInfo[ltype]);
var lmus = lMG.createEmptyMovieClip((("mcMusic_" + ltype) + "_") + pKey, lMG.getMaxDepth());
var lFx = lFxG.createEmptyMovieClip((("mcFx_" + ltype) + "_") + pKey, lFxG.getMaxDepth());
yamz.SoundManager.currentFile = pKey;
var lPreloadGroup = (new yamz.preloadGroup());
var lms = lInfo.musics;
var lfxs = lInfo.fx;
var lpre = pRefL.attachMovie("YamzPreload", "preloadMG" + pKey, pRefL.getMaxDepth(), {url:lfile, target:lmus, order:0, group:lPreloadGroup, _visible:false});
var lpre1 = pRefL.attachMovie("YamzPreload", "preloadFxG" + pKey, pRefL.getMaxDepth(), {url:lfile, target:lFx, order:1, group:lPreloadGroup, _visible:false});
lPreloadGroup.onLoadComplete = function () {
yamz.SoundManager.current.build(lmus, lFx, lms, lfxs);
lInfo.loaded = ltype;
yamz.SoundManager.currentFile = undefined;
yamz.SoundManager.current.onBuild(pKey);
};
lPreloadGroup.loadGroup();
};
yamz.SoundManager.prototype.addSoundFileTab = function (pTab, pRefL, pPath, pType) {
if (yamz.SoundManager.currentFile != undefined) {
return(false);
}
var lPreloadGroup = (new yamz.preloadGroup());
var lind = 0;
var lMG = this.mcMusicGroupe;
var lFxG = this.mcFXGroupe;
var i = 0;
while (i < pTab.length) {
var lkey = pTab[i];
var lInfo = yamz.SoundManager.soundFiles[lKey];
if (lInfo.loaded == "hifi") {
} else {
var ltype;
if (lInfo.loaded == "lofi") {
ltype = "hifi";
} else {
ltype = ((pType == undefined) ? "lofi" : (pType));
}
lMG[(("mcMusic_" + ltype) + "_") + lKey].removeMovieClip();
lFxG[(("mcFx_" + ltype) + "_") + lKey].removeMovieClip();
lMG.createEmptyMovieClip((("mcMusic_" + ltype) + "_") + lKey, lMG.getMaxDepth());
lFxG.createEmptyMovieClip((("mcFx_" + ltype) + "_") + lKey, lFxG.getMaxDepth());
var lfile = (pPath + lInfo[ltype]);
yamz.SoundManager.currentFile = lKey;
pRefL.attachMovie("YamzPreload", "preloadMG" + lKey, pRefL.getMaxDepth(), {url:lfile, target:lMG[(("mcMusic_" + ltype) + "_") + lKey], order:lind++, group:lPreloadGroup, _visible:false});
pRefL.attachMovie("YamzPreload", "preloadFxG" + lKey, pRefL.getMaxDepth(), {url:lfile, target:lFxG[(("mcFx_" + ltype) + "_") + lKey], order:lind++, group:lPreloadGroup, _visible:false});
}
i++;
}
lPreloadGroup.onLoadComplete = function () {
var i = 0;
while (i < pTab.length) {
var lkey = pTab[i];
var lInfo = yamz.SoundManager.soundFiles[lKey];
debug((lkey + " quality => ") + lInfo.loaded);
if (lInfo.loaded == "hifi") {
} else {
var ltype;
if (lInfo.loaded == "lofi") {
ltype = "hifi";
} else {
ltype = ((pType == undefined) ? "lofi" : (pType));
}
var lms = lInfo.musics;
var lfxs = lInfo.fx;
var lmus = yamz.SoundManager.current.mcMusicGroupe[(("mcMusic_" + ltype) + "_") + lKey];
var lFx = yamz.SoundManager.current.mcFXGroupe[(("mcFx_" + ltype) + "_") + lKey];
yamz.SoundManager.current.build(lmus, lFx, lms, lfxs);
lInfo.loaded = ltype;
}
i++;
}
yamz.SoundManager.currentFile = undefined;
yamz.SoundManager.current.onBuildTab();
};
lPreloadGroup.loadGroup();
};
yamz.SoundManager.prototype.build = function (pMusic, pFx, pMs, pFxs) {
var lvol = 100;
var lMusics = pMs;
var lLength = lMusics.length;
var i = 0;
while (i < lLength) {
var lMusicMc = pMusic.createEmptyMovieClip("mc" + lMusics[i], i);
var lnson = (new yamz.Sound(lMusicMc));
lnson.attachSound("id" + lMusics[i]);
var lsound = this[lMusics[i]];
this.replaceSound(lsound, lnson, lMusics[i]);
i++;
}
var lFXs = pFxs;
var lLength = lFXs.length;
var i = 0;
while (i < lLength) {
var lFXMc = pFX.createEmptyMovieClip("mc" + lFXs[i], i);
var lnson = (new yamz.Sound(lFXMc));
lnson.attachSound("id" + lFXs[i]);
var lsound = this[lFXs[i]];
this.replaceSound(lsound, lnson, lFXs[i]);
i++;
}
};
yamz.SoundManager.prototype.replaceSound = function (pSon, pNewSon, pTarg) {
var lisPlaying = pSon.isPlaying;
if (!lisPlaying) {
this[pTarg] = pNewSon;
} else {
pSon.finishLife(pNewSon, pTarg);
}
};
yamz.SoundManager.prototype.onBuild = function (pKey) {
trace(("int\u00E9gration du fichier " + pKey) + " termin\u00E9");
};
yamz.SoundManager.prototype.onBuildTab = function () {
};
#endinitclip
Symbol 20 MovieClip [yamzConfig] Frame 1
_parent.stop();
var lThis = this;
NetDebugTarget = eval (NetDebugTarget);
if (_level0.yamz == undefined) {
_level0.yamz = {};
}
if (_global.yamz == undefined) {
_global.yamz = _level0.yamz;
}
yamz.System = new LoadVars();
yamz.System.onLoad = function (pSucces) {
if (pSucces) {
this.netDebug = this.netDebug == "true";
if (this.netDebug) {
if (yamz.Preload == undefined) {
trace("==== yamz.System ERREUR ====");
trace("classe inexistante: yamz.Preload");
} else {
var lPreload = lThis.attachMovie("YamzPreload", "mcPreload", 0);
var lNetDebug = lThis.NetDebugTarget.createEmptyMovieClip("NetDebug_mc", -1000);
lPreload.onLoadComplete = function () {
lThis.next();
};
lPreload.loadClip("netdebug.swf", lNetDebug);
}
} else {
_global.debug = function () {
trace(arguments.join(" | "));
};
lThis.next();
}
} else {
trace("==== yamz.System ERREUR ====");
trace("fichier inexistant:" + config);
}
};
next = function () {
var lLabel = (isNaN(parseInt(lThis.label)) ? (lThis.label) : (Number(lThis.label)));
lThis._parent["gotoAnd" + lThis.gotoAnd](lThis.label);
lThis.swapDepths(104857);
lThis.removeMovieClip();
};
if (MMSave == undefined) {
yamz.System.load((config + "?") + new Date().getTime());
} else {
yamz.System.load(config);
}
Symbol 22 MovieClip Frame 1
mcBar._xscale = 0;
this._parent.onLoadProgress = function (pLoaded, pTotal, pSpeed, pTime) {
speed = pSpeed + "kb/s";
time = pTime + "s";
loading = (pLoaded + "/") + pTotal;
mcBar._xscale = 100 * (pLoaded / pTotal);
};
Symbol 23 MovieClip [YamzPreload] Frame 1
#initclip 2
if (_level0.yamz == undefined) {
_level0.yamz = {};
}
if (_global.yamz == undefined) {
_global.yamz = _level0.yamz;
}
if (yamz.PreloadGroup == undefined) {
yamz.PreloadGroup = function (pStartLoading, pAction, pLabel, pEndValue, pEndType, pGraphic, pVersion, pServerGet, pVisible) {
this.startLoading = pStartLoading;
this.action = pAction;
this.label = pLabel;
this.endValue = ((pEndValue == undefined) ? 100 : (pEndValue));
this.endType = pEndType;
this.endValue = pEndValue;
this.serverGet = false;
this.version = ((pVersion == undefined) ? false : (pVersion));
this.visible = ((pVisible == undefined) ? false : (pVisible));
this.vCurrentTotal = 0;
this.idGraphic = pGraphic;
this.list = [];
};
yamz.PreloadGroup.prototype.loadProgress = function (pCurrent, pCurrentLoaded, pCurrentTotal, pCurrentTimeLeft) {
var lCurrentLoaded = (this.serverGet ? (Math.floor(pCurrentLoaded * (this.vCurrentTotal / pCurrentTotal))) : (pCurrentLoaded / pCurrentTotal));
var lLoaded = (this.serverGet ? (this.loaded + lCurrentLoaded) : (((this.vTotal - 1) - this.list.length) + lCurrentLoaded));
var lTime = (getTimer() - this.vStartTime);
var lSpeed = (this.serverGet ? (lLoaded / lTime) : (pCurrentLoaded / pCurrentTime));
var lTimeLeft = (this.serverGet ? (Math.ceil((this.vTotal - lLoaded) / (lSpeed * 1000))) : "?");
this.onLoadProgress(pCurrent, pCurrentLoaded, pCurrentTotal, lLoaded, this.vTotal, Math.round(lSpeed), pCurrentTimeLeft, lTimeLeft);
};
yamz.PreloadGroup.prototype.initOrder = function (pTarget) {
this.list[pTarget.order] = pTarget;
};
yamz.PreloadGroup.prototype.load = function (pPrevTotal) {
this.loaded = this.loaded + this.vCurrentTotal;
this.vCurrentTotal = Number(this.vFileSize.shift());
while (this.list.length) {
var lRef = this.list.shift();
if (lRef instanceof yamz.Preload) {
this.current = lRef;
lRef.loadClip();
return(undefined);
}
}
yamz.Preload.loading = false;
this.onLoadComplete();
};
yamz.PreloadGroup.prototype.loadGroup = function (pVisible, pVersion, pServerGet) {
if ((!(pVisible === undefined)) && (!(pVisible === null))) {
this.visible = pVisible;
}
if ((!(pServerGet === undefined)) && (!(pServerGet === null))) {
this.serverGet = pServerGet;
}
debug("SERVERGET:", pServerGet, this.serverGet);
if ((!(pVersion === undefined)) && (!(pServerGet === null))) {
this.version = pVersion;
}
var lNbFiles = this.list.length;
if (this.serverGet) {
var getFile = new LoadVars();
getFile.files = [];
var i = 0;
while (i < lNbFiles) {
getFile.files.push(this.list[i].url);
i++;
}
getFile.files = getFile.files.join("|");
var lThis = this;
getFile.onLoad = function (pSuccess) {
if (this.total != undefined) {
lThis.vTotal = Number(this.total);
lThis.vFileSize = this.fileSize.split("|");
lThis.vStartTime = getTimer();
lThis.loaded = 0;
} else {
lThis.onLoadError({level:"warning", description:"calcul du poids total impossible", code:1});
lThis.serverGet = false;
lThis.vTotal = lNbFiles;
}
lThis.load(0);
};
getFile.sendAndLoad("gettotalsize.php", getFile);
} else {
this.vTotal = lNbFiles;
this.load(0);
}
};
yamz.PreloadGroup.prototype.onLoadError = function (pError) {
if (yamz.System.netDebug) {
debug("yamz.PreloadGroup ERREUR", pError);
} else {
trace("==== yamz.PreloadGroup ERREUR ====");
for (var z in pError) {
trace((z + ": ") + pError[z]);
}
}
};
yamz.PreloadGroup.prototype.onLoadProgress = function (pCurrent, pCurrentLoaded, pCurrentTotal, pLoaded, pTotal, pSpeed, pCurrentTimeLeft, pTimeLeft) {
if (yamz.System.netDebug) {
debug(((((((((((((((pCurrent + "(groupe): ") + pCurrentLoaded) + "/") + pCurrentTotal) + " | ") + pLoaded) + "/") + pTotal) + " [") + pSpeed) + "kb/s] [") + pCurrentTimeLeft) + "s | ") + pTimeLeft) + "s]");
}
trace(((((((((((((((pCurrent + "(groupe): ") + pCurrentLoaded) + "/") + pCurrentTotal) + " | ") + pLoaded) + "/") + pTotal) + " [") + pSpeed) + "kb/s] [") + pCurrentTimeLeft) + "s | ") + pTimeLeft) + "s]");
};
yamz.PreloadGroup.prototype.onLoadComplete = function () {
if (yamz.System.netDebug) {
debug("chargement de l'ensemble du groupe termin\u00E9");
}
trace("chargement de l'ensemble du groupe termin\u00E9");
};
}
if (yamz.Preload == undefined) {
yamz.Preload = function () {
if (this.group == "") {
this.group = null;
}
if ((this.group != undefined) && (this.order == undefined)) {
yamz.Preload.loading = false;
this.onLoadError({level:"error", description:this._name + ": manque l'ordre dans le groupe", code:2});
return(undefined);
}
if (this.group != null) {
if (!(this.group instanceof yamz.PreloadGroup)) {
var lTempGroup = this.group.split(".");
var lEndGroup = lTempGroup.pop();
var lBeginGroup = (lTempGroup.length ? (eval ("this._parent." + lTempGroup.join("."))) : (this._parent));
if (lBeginGroup[lEndGroup] instanceof yamz.PreloadGroup) {
this.group = lBeginGroup[lEndGroup];
} else {
this.group = (lBeginGroup[lEndGroup] = new yamz.PreloadGroup(true));
}
}
this.group.initOrder(this);
}
if (this.group != undefined) {
this.startLoading = ((this.order === 0) ? (this.group.startLoading) : false);
}
if (this.version == undefined) {
this.version = ((this.group != undefined) ? (this.group.version) : false);
}
if ((this.action == undefined) || (this.action == "")) {
if (this.group == undefined) {
this.setAction(null);
} else {
this.setAction(this.group.action, this.group.label);
}
} else {
this.setAction(this.action, this.label);
}
if ((this.group == undefined) || (this.group.idGraphic === undefined)) {
this.setGraphic(this.idGraphic);
} else {
this.setGraphic(this.group.idGraphic);
}
if (((this.group == undefined) || (this.group.endValue === undefined)) || (this.group.endType === undefined)) {
this.setLoadingEnd(this.endValue, this.endType);
} else {
this.setLoadingEnd(this.group.endValue, this.group.endType);
}
if (this.startLoading) {
if (this.group != undefined) {
this.group.list[this.order] = undefined;
}
this.loadClip();
}
};
Object.registerClass("YamzPreload", yamz.Preload);
yamz.Preload.prototype = new MovieClip();
yamz.Preload.loading = false;
yamz.Preload.__getURL = function (pUrl, pVersion) {
var lPath = yamz.System.mainPath;
if (((pUrl.indexOf("://") != -1) || (lPath == undefined)) || (lPath == "")) {
var lUrl = pUrl;
} else {
var lLength = (lPath.length - 1);
if (lPath.charAt(lLength) == "/") {
lPath = lPath.substring(0, lLength);
}
if (!lPath.indexOf("..")) {
var lUrl = ((lPath + "/") + pUrl);
} else {
var lLength = (lPath.length - 1);
if (lPath.charAt(lLength) == "/") {
lPath = lPath.substring(0, lLength);
}
var lParent = pUrl.split("../");
lLength = lParent.length - 1;
var lUrl = lPath.split("/");
lUrl = lUrl.slice(0, lUrl.length - lLength).join("/");
if (lUrl != "") {
lUrl = lUrl + "/";
}
lUrl = lUrl + lParent[lLength];
}
}
return((((MMSave == undefined) && (pVersion)) ? ((lUrl + "?") + yamz.System.version) : (lUrl)));
};
yamz.Preload.prototype.initLevel = function () {
yamz.Preload.loading = true;
if (this["_level" + this._targetInstanceName]) {
this.target = this["_level" + this._targetInstanceName];
this.onEnterFrame = this.loadProgress();
}
};
yamz.Preload.prototype.initClip = function () {
yamz.Preload.loading = true;
if (this.target.getBytesTotal() === 0) {
this.target.loadMovie(this.url);
this.onEnterFrame = this.loadProgress();
}
};
yamz.Preload.prototype.loadProgress = function () {
var lStartTime = getTimer();
if ((this.group != undefined) && (this.visible == undefined)) {
this.mcGraphic._visible = this.group.visible;
} else if (this.visible != undefined) {
this.mcGraphic._visible = this.visible;
} else {
this.mcGraphic._visible = true;
}
return(function () {
yamz.Preload.loading = true;
var lLoaded = this.target.getBytesLoaded();
var lTotal = this.target.getBytesTotal();
if (this.endType == "image") {
var lTypeLoaded = this.target._framesloaded;
var lTypeTotal = this.endValue;
} else {
var lTypeLoaded = lLoaded;
if (this.endType == "%") {
var lTypeTotal = Math.floor((lTotal * this.endValue) / 100);
} else {
var lTypeTotal = (this.endValue * 1000);
}
}
if (lTotal > 0) {
var lTime = (getTimer() - lStartTime);
var lSpeed = (lTypeLoaded / lTime);
var lTimeLeft = Math.ceil((lTypeTotal - lTypeLoaded) / (lSpeed * 1000));
var lLoadBytes = Math.max(0, Math.min(lTypeLoaded, lTypeTotal));
if (this.group != undefined) {
this.group.loadProgress(this.url, lLoadBytes, lTypeTotal, lTimeLeft);
}
this.onLoadProgress(lLoadBytes, lTypeTotal, Math.round(lSpeed), lTimeLeft);
if (lTypeLoaded >= lTypeTotal) {
this.onLoadComplete();
this.runAction();
if (this.group != undefined) {
this.group.load(lTypeTotal);
} else {
yamz.Preload.loading = false;
}
delete this.onEnterFrame;
if (this.getDepth() < 0) {
this.swapDepths(1048575);
}
this.removeMovieClip();
return(undefined);
}
}
});
};
yamz.Preload.prototype.loadClip = function (pUrl, pTarget, pVersion) {
if (pTarget != undefined) {
if ((((pTarget instanceof MovieClip) || (pTarget instanceof Sound)) || (pTarget instanceof LoadVars)) || (pTarget instanceof XML)) {
this.target = pTarget;
} else {
this._targetInstanceName = pTarget;
}
}
if (pVersion != undefined) {
this.version = pVersion;
}
debug("version => " + this.version);
this.url = yamz.Preload.__getURL(((pUrl != undefined) ? (pUrl) : (this.url)), this.version);
debug("url => " + this.url);
if ((this.url == "") && (this._targetInstanceName == "")) {
this.target = this._parent;
this.onEnterFrame = this.loadProgress();
return(undefined);
}
if (this.url == "") {
yamz.Preload.loading = false;
this.onLoadError({level:"error", description:"fichier \u00E0 charger non d\u00E9fini", code:0});
return(undefined);
}
if ((this._targetInstanceName == "") && (!((((this.target instanceof MovieClip) || (this.target instanceof Sound)) || (this.target instanceof LoadVars)) || (this.target instanceof XML)))) {
yamz.Preload.loading = false;
this.onLoadError({level:"error", description:"cible non d\u00E9finie", code:1});
return(undefined);
}
if (this.target instanceof Sound) {
yamz.Preload.loading = true;
this.target.loadSound(this.url, false);
this.onEnterFrame = this.loadProgress();
} else if ((this.target instanceof LoadVars) || (this.target instanceof XML)) {
yamz.Preload.loading = true;
this.target.load(this.url);
this.onEnterFrame = this.loadProgress();
} else if (isNaN(parseInt(this._targetInstanceName)) || (this.target instanceof MovieClip)) {
if (!(this.target instanceof MovieClip)) {
this.target = eval ("this._parent." + this._targetInstanceName);
}
this.target.unloadMovie();
this.onEnterFrame = this.initClip;
} else {
var lTarget = parseInt(this._targetInstanceName);
loadMovieNum (this.url, lTarget);
this.onEnterFrame = this.initLevel;
}
};
yamz.Preload.prototype.setAction = function (pAction, pLabel) {
if (arguments.length > 0) {
if (pAction == null) {
this.runAction = null;
} else {
this.runAction = function () {
this.target[pAction](pLabel);
};
}
}
};
yamz.Preload.prototype.setGraphic = function (pId) {
if ((arguments.length > 0) && (!(pId === undefined))) {
this.idGraphic = pId;
if ((pId == null) || (pId != "")) {
if (this.mcGraphic != undefined) {
this.mcGraphic.swapDepths(1048575);
this.mcGraphic.removeMovieClip();
}
if (pId != "") {
this.attachMovie(pId, "mcGraphic", 0);
}
}
}
this.mcGraphic._visible = false;
};
yamz.Preload.prototype.setLoadingEnd = function (pValue, pType) {
if (((pType != "image") && (pType != "%")) && (pType != "kb")) {
pValue = 100;
pType = "%";
}
this.endValue = pValue;
this.endType = pType;
};
yamz.Preload.prototype.onLoadError = function (pError) {
if (yamz.System.netDebug) {
debug("yamz.Preload ERREUR", pError);
} else {
trace("==== yamz.Preload ERREUR ====");
for (var z in pError) {
trace((z + ": ") + pError[z]);
}
}
};
yamz.Preload.prototype.onLoadProgress = function (pLoadBytes, pTotalBytes, pSpeed, pTimeLeft) {
if (yamz.System.netDebug) {
debug(((((((((this.target + ": ") + pLoadBytes) + "/") + pTotalBytes) + " [") + pSpeed) + "kb/s] [") + pTimeLeft) + "s]");
} else {
trace(((((((((this.target + ": ") + pLoadBytes) + "/") + pTotalBytes) + " [") + pSpeed) + "kb/s] [") + pTimeLeft) + "s]");
}
};
yamz.Preload.prototype.onLoadComplete = function () {
if (yamz.System.netDebug) {
debug(this.target + ": chargement termin\u00E9");
} else {
trace(this.target + ": chargement termin\u00E9");
}
};
}
#endinitclip
Symbol 27 MovieClip Frame 7
stop();