home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 135
/
MOBICLIC135.ISO
/
pc
/
DATA
/
HOTE
/
libs
/
xlib1
/
xlib1.swf
/
scripts
/
frame_1
/
DoAction.as
Wrap
Text File
|
2011-06-22
|
45KB
|
1,560 lines
function IncString(str, seuil)
{
var _loc2_ = str.split("_");
var _loc1_ = _loc2_.length - 1;
var _loc3_ = Number(_loc2_[_loc1_]) + 1;
while(_loc3_ > seuil)
{
_loc2_[_loc1_] = gimme2digits(0);
_loc1_ = _loc1_ - 1;
_loc3_ = Number(_loc2_[_loc1_]) + 1;
}
_loc2_[_loc1_] = gimme2digits(_loc3_);
return _loc2_.join("_");
}
function DecString(str)
{
var _loc1_ = str.split("_");
trace(_loc1_);
var _loc2_ = _loc1_.length - 1;
trace(Number(_loc1_[_loc2_]));
_loc1_[_loc2_] = gimme2digits(Number(_loc1_[_loc2_]) - 1);
return _loc1_.join("_");
}
function RetourneLettreAlphabet(no)
{
var _loc1_ = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];
trace("RetourneLettreAlphabet() : lettre no " + no + " :" + _loc1_[no - 1]);
return _loc1_[no - 1];
}
function xGetConfig()
{
trace("xGetConfig()x");
_root.xConfig = {};
_root.xConfig.Params = {};
_root.xConfig.Set = function(p)
{
if(this[p.nom] == undefined)
{
if(p.defaut == "OBLIGATOIRE")
{
trace({mess:"/!\\ERROR /!\\Paramètre du xml obligatoire manquant dans la balise Config: " + p.nom,group:"error"});
}
else
{
this[p.nom] = p.defaut;
if(p.type == "number")
{
this[p.nom] = Number(this[p.nom]);
}
if(p.type == "boolean")
{
this[p.nom] = !(this[p.nom] == "true" || this[p.nom] == true) ? false : true;
}
}
}
else
{
if(p.type == "number")
{
this[p.nom] = Number(this[p.nom]);
}
if(p.type == "boolean")
{
this[p.nom] = !(this[p.nom] == "true" || this[p.nom] == true) ? false : true;
}
}
this.Params[p.nom] = {nom:p.nom,type:p.type,desc:p.desc,valeur:this[p.nom]};
};
_root.xConfig.ToXml = function()
{
trace("_root.xConfig.ToXml : " + _root.xConfig.ToXml);
var _loc3_ = "";
trace("");
trace("");
trace("");
trace("(!)_____ xConfig en XML _______");
trace("<Params>");
for(var _loc4_ in this.Params)
{
this.Params[_loc4_].desc = this.Params[_loc4_].desc != undefined ? this.Params[_loc4_].desc : "";
_loc3_ = "<Param nom=\"" + _loc4_ + "\" valeur=\"" + this.Params[_loc4_].valeur + "\" /> <!-- " + this.Params[_loc4_].desc + " -->\r" + _loc3_;
}
trace(_loc3_);
trace("</Params>");
trace("(!)_____ xConfig en XML- FIN _______");
trace("");
trace("");
trace("");
};
_root.xConfig._name = "xConfig";
var _loc3_ = _root.moduleInfo.returnNodeByPath("Module.Config.Params").childNodes;
for(props in _loc3_)
{
_root.xConfig[_loc3_[props].attributes.nom] = _loc3_[props].attributes.valeur;
}
}
function GetFilePath(fichier)
{
var _loc2_ = AntiSlashToSlash(fichier);
var _loc1_ = _loc2_.split("/");
_loc1_.pop();
return _loc1_.join("/");
}
function AntiSlashToSlash(chaine)
{
return str_replace(chaine,"\\","/");
}
function DistancePoints(p)
{
return Math.sqrt(Math.pow(p.x2 - p.x1,2) + Math.pow(p.y2 - p.y1,2));
}
function SetInterval(p)
{
if(_root.INTERVAL_IDS == undefined)
{
_root.INTERVAL_IDS = [];
}
if(p.mcRef == undefined)
{
p.mcRef = _root;
}
if(p.methode == undefined)
{
return false;
}
if(p.interval == undefined)
{
return false;
}
if(p.params == undefined)
{
p.params = {};
}
var _loc3_ = setInterval(p.mcRef,p.methode,p.interval,p.params);
_root.INTERVAL_IDS.push(_loc3_);
return _loc3_;
}
function ClearInterval(id)
{
clearInterval(id);
var _loc2_ = 0;
while(_loc2_ < _root.INTERVAL_IDS.length)
{
if(_root.INTERVAL_IDS[_loc2_] == id)
{
_root.INTERVAL_IDS.splice(_loc2_,1);
return undefined;
}
_loc2_ = _loc2_ + 1;
}
}
function ClearAllIntervals()
{
var _loc2_ = 0;
while(_loc2_ < _root.INTERVAL_IDS.length)
{
clearInterval(_root.INTERVAL_IDS[_loc2_]);
_loc2_ = _loc2_ + 1;
}
_root.INTERVAL_IDS = [];
}
function ExecuterApresDelai(p)
{
var tdep = getTimer();
var tfin;
var _loc3_ = "ExecuterApresDelai" + Number(++_root.ExecuterApresDelaiNo);
var id;
var delai = p.delai * 1000;
var _loc4_ = p.mcRef[p.methode];
var mcRef = p.mcRef;
var methode = p.methode;
var params = p.params;
_root[_loc3_] = function()
{
tfin = getTimer();
if(tfin - tdep >= delai)
{
ClearInterval(id);
mcRef[methode](params);
}
};
id = SetInterval({methode:_loc3_,interval:p.delai});
return id;
}
function str_replace(str, search, replace)
{
return str.split(search).join(replace);
}
function JoindreObjets(objects)
{
var _loc2_ = new Object();
var _loc1_ = 0;
while(_loc1_ < objects.length)
{
p1 = objects[_loc1_];
for(props in p1)
{
_loc2_[props] = p1[props];
}
_loc1_ = _loc1_ + 1;
}
return _loc2_;
}
function GetOriginalSize(mc)
{
var _loc2_ = mc._rotation;
mc._rotation = 0;
var _loc3_ = {w:mc._width * mc._xscale / 100,h:mc._height * mc._yscale / 100};
mc._rotation = _loc2_;
return _loc3_;
}
function GetOriginalWidth(mc)
{
var _loc2_ = mc._rotation;
mc._rotation = 0;
var _loc3_ = mc._width * mc._xscale / 100;
var _loc4_ = mc._height * mc._yscale / 100;
mc._rotation = _loc2_;
return _loc3_;
}
function GetOriginalHeight(mc)
{
var _loc2_ = mc._rotation;
mc._rotation = 0;
var _loc4_ = mc._width * mc._xscale / 100;
var _loc3_ = mc._height * mc._yscale / 100;
mc._rotation = _loc2_;
return _loc3_;
}
function CreerCache(p)
{
var _loc4_ = p.level != undefined ? p.level : _global.Levels.cache;
var _loc2_ = p.mc.createEmptyMovieClip("CACHE",_loc4_);
_loc2_.beginFill(65280,50);
_loc2_.moveTo(0,0);
_loc2_.lineTo(p.width,0);
_loc2_.lineTo(p.width,p.height);
_loc2_.lineTo(0,p.height);
_loc2_.lineTo(0,0);
_loc2_.endFill();
p.mc.setMask(_loc2_);
}
function ConvertCoord(mc_src, mc_dest)
{
var _loc1_ = {x:0,y:0};
mc_src.localToGlobal(_loc1_);
mc_dest.globalToLocal(_loc1_);
return _loc1_;
}
function getGlobalCoord(xc, yc, mc)
{
var _loc1_ = {x:xc * 100 / mc._xscale,y:yc * 100 / mc._yscale};
mc.localToGlobal(_loc1_);
return _loc1_;
}
function getLocalCoord(xc, yc, mc)
{
var _loc1_ = new Object({x:xc,y:yc});
mc.globalToLocal(_loc1_);
_loc1_.x = _loc1_.x / 100 * mc._xscale;
_loc1_.y = _loc1_.y / 100 * mc._yscale;
return _loc1_;
}
function length_ass(arr)
{
var _loc1_ = 0;
for(prop in arr)
{
_loc1_ = _loc1_ + 1;
}
return _loc1_;
}
function ExplodeString(chaine)
{
var _loc3_ = new Array();
var _loc1_ = 0;
while(_loc1_ < chaine.length)
{
_loc3_.push(chaine.charAt(_loc1_));
_loc1_ = _loc1_ + 1;
}
return _loc3_;
}
function TrimString(chaine)
{
var _loc3_ = "";
var _loc5_ = "";
var _loc2_ = false;
var _loc1_ = 0;
while(_loc1_ < chaine.length)
{
if(chaine.charAt(_loc1_) != " ")
{
_loc2_ = true;
}
if(_loc2_ == true)
{
_loc3_ += chaine.charAt(_loc1_);
}
_loc1_ = _loc1_ + 1;
}
_loc2_ = false;
_loc1_ = _loc3_.length - 1;
while(_loc1_ >= 0)
{
if(_loc3_.charAt(_loc1_) != " ")
{
_loc2_ = true;
}
if(_loc2_ == true)
{
_loc5_ = _loc3_.charAt(_loc1_) + _loc5_;
}
_loc1_ = _loc1_ - 1;
}
return _loc5_;
}
function BloquerActives()
{
if(_global.ClipBloquant == undefined)
{
var _loc0_ = null;
var _loc3_ = _global.ClipBloquant = _root.createEmptyMovieClip("ClipBloquant",10123);
_loc3_.attachMovie("ClipInvisible","ClipInvisible",2);
_loc3_._width = Stage.width;
_loc3_._height = Stage.height;
_loc3_._x = 0;
_loc3_._y = 0;
_loc3_.useHandCursor = false;
_loc3_.onPress = function()
{
};
}
}
function DebloquerActives()
{
if(_global.ClipBloquant != undefined)
{
_global.ClipBloquant.removeMovieClip();
_global.ClipBloquant = undefined;
}
}
function afficheLM_x2(p)
{
viderLM_x2();
_root.gereTextes.afficheLM({codeLM:p.codeLM,X:p.LMrep._x,Y:p.LMrep._y,width:p.LMrep._width,height:p.LMrep._height});
LMaVider2.push(p);
}
function viderLM_x2()
{
var _loc3_ = 0;
while(_loc3_ < _global.LMaVider2.length)
{
_root.gereTextes.masqueLM(_global.LMaVider2[_loc3_]);
_loc3_ = _loc3_ + 1;
}
}
function afficheLM_x(p)
{
_root.gereTextes.afficheLM({codeLM:p.codeLM,X:p.LMrep._x - p.width / 2,Y:p.LMrep._y - p.height / 2,width:p.width,height:p.height});
_global.LMaVider.push(p);
}
function viderLM_x()
{
var _loc3_ = 0;
while(_loc3_ < _global.LMaVider.length)
{
_root.gereTextes.masqueLM(_global.LMaVider[_loc3_]);
_loc3_ = _loc3_ + 1;
}
}
function ConvertMcToArray(p)
{
xtrace("Convertion du bitmap en tableau de nombres");
var _loc3_ = p.mc;
var _loc5_ = _loc3_._rotation;
_loc3_._rotation = 0;
var _loc1_ = _loc3_._width * 100 / _loc3_._xscale;
var _loc4_ = _loc3_._height * 100 / _loc3_._yscale;
_loc3_._rotation = _loc5_;
_loc3_.MCwidth = _loc1_;
_loc3_.MCheight = _loc4_;
xtrace("WH " + _loc1_ + " " + _loc4_);
var _loc2_ = new flash.display.BitmapData(_loc1_,_loc4_,true,0);
_loc2_.draw(_loc3_);
var _loc6_ = new Array();
lv = new LoadVars();
lv.tab = new Array();
i = 0;
while(i < _loc4_)
{
j = 0;
while(j < _loc1_)
{
lv.tab.push(_loc2_.getPixel(j,i));
j++;
}
i++;
}
return lv.tab;
}
function ConvertMcToBitmap(p)
{
var _loc1_ = p.mc;
var _loc2_ = new flash.display.BitmapData(_loc1_._width,_loc1_._height,true,16777215);
_loc2_.draw(_loc1_,_loc1_.transform.matrix);
_loc1_._parent.createEmptyMovieClip(_loc1_._name,_loc1_.getDepth());
_loc1_.attachBitmap(_loc2_,2,"always",true);
}
function CloneMcToBitmap(p)
{
var _loc1_ = p.mc;
var _loc9_ = p.pere;
var _loc8_ = p.nom;
var _loc5_ = p.level;
trace("-*-*-* " + _loc1_._width + " " + _loc1_._height);
var _loc7_ = _loc1_._x;
var _loc6_ = _loc1_._y;
_loc1_._x = 0;
_loc1_._y = 0;
var _loc4_ = new flash.display.BitmapData(_loc1_._width,_loc1_._height,true,16755370);
trace(_loc1_.transform.matrix.toString());
var _loc2_ = _loc9_.createEmptyMovieClip(_loc8_,_loc5_);
_loc2_._visible = false;
_loc2_.attachBitmap(_loc4_,2,"auto",true);
_loc4_.draw(_loc1_,_loc1_.transform.matrix);
_loc1_._x = _loc7_;
_loc1_._y = _loc6_;
trace("CloneMcToBitmap" + _loc2_);
return _loc2_;
}
function InitMC(p)
{
trace("InitMCo() " + p.mc);
var mc = typeof p != "movieclip" ? p.mc : p;
if(p.level != undefined)
{
var ceMC_name_old = mc._name + "_old";
var ceMC_name = mc._name;
mc._name = ceMC_name_old;
mc.duplicateMovieClip(ceMC_name,p.level);
mc._visible = false;
mc = this[ceMC_name];
}
if(mc.OriginalMC == undefined)
{
mc.OriginalMC = {};
mc.OriginalMC._x = mc._x;
mc.OriginalMC._y = mc._y;
mc.OriginalMC._xscale = mc._xscale;
mc.OriginalMC._yscale = mc._yscale;
mc.OriginalMC._width = mc._width;
}
var fonction = p.fonction != undefined ? eval("InitMC_" + p.fonction) : InitMC_standart;
mc.InitMC = fonction;
InitMC_reccurent(mc);
mc.InitMC(p);
}
function InitMC_reccurent(mc)
{
mc.oriX = mc._x;
mc.oriY = mc._y;
mc.oriW = mc._width;
mc.oriH = mc._height;
mc.BackToInitialPos = function()
{
this._x = this.oriX;
this._y = this.oriY;
};
mc.BackToInitialSize = function()
{
this._width = this.oriW;
this._height = this.oriH;
};
}
function ResetMC(p)
{
var _loc1_ = p.mc;
delete _loc1_.onPress;
delete _loc1_.onRollOver;
delete _loc1_.onRollOut;
delete _loc1_.onRelease;
delete _loc1_.onReleaseOutside;
delete _loc1_.BTN.onPress;
delete _loc1_.BTN.onRollOver;
delete _loc1_.BTN.onRollOut;
delete _loc1_.BTN.onRelease;
delete _loc1_.BTN.onReleaseOutside;
}
function InitMC_standart(p)
{
trace("InitMC_standart : " + InitMC_standart);
if(p.IB != undefined)
{
if(typeof p.IBrep == "movieclip")
{
var IBrepere = p.IBrep;
}
else if(typeof _MOD_["IBrep_" + p.IB] == "movieclip" && p.IBrep != false)
{
var IBrepere = _MOD_["IBrep_" + p.IB];
}
else
{
var IBrepere = p.mc;
}
this.afficheIB = function()
{
_root.gereTextes.afficheIB({codeIB:p.IB,mc:IBrepere});
};
this.masqueIB = function()
{
_root.gereTextes.masqueIB();
};
}
if(p.UseLabels != false)
{
this.reposFrame = p.reposFrame != undefined ? p.reposFrame : "E1";
this.pressFrame = p.pressFrame != undefined ? p.pressFrame : "E2";
this.overFrame = p.overFrame != undefined ? p.overFrame : "E2";
this.outFrame = p.outFrame != undefined ? p.outFrame : "E1";
this.releaseFrame = p.releaseFrame != undefined ? p.releaseFrame : "E1";
this.releaseOutFrame = p.releaseOutFrame != undefined ? p.releaseOutFrame : "E1";
this.activeFrame = p.activeFrame != undefined ? p.activeFrame : undefined;
this.desactiveFrame = p.desactiveFrame != undefined ? p.desactiveFrame : undefined;
}
if(p.reposFrame != undefined)
{
this.gotoAndStop(p.reposFrame);
}
this.p = p;
§§push(this);
§§push("joueson");
if(p.son == undefined)
{
§§push(undefined);
}
§§pop()[§§pop()] = §§pop();
§§push(this);
§§push("stopson");
if(p.nostop != undefined)
{
§§push(undefined);
}
§§pop()[§§pop()] = §§pop();
if(p.sonOnPress != undefined)
{
this.sonOnPress = p.sonOnPress;
this.sonOnPress_offset = p.sonOnPress_offset != undefined ? Number(p.sonOnPress_offset) : 0;
this.sonOnPress_loopSon = p.sonOnPress_loopSon != undefined ? Number(p.sonOnPress_loopSon) : 0;
this.jouesonOnPress = function()
{
joueBruitage({nomSon:this.sonOnPress,offset:this.sonOnPress_offset,loopSon:this.sonOnPress_loopSon});
};
this.stopsonOnPress = function()
{
stopBruitage({nomSon:this.sonOnPress});
};
}
else
{
this.jouesonOnMove = undefined;
this.stopsonOnMove = undefined;
}
this.UseHandCursor = p.useHandCursor != undefined ? p.useHandCursor : true;
if(p.UseCurseur != false)
{
this.curseur_after_press = p.goto != undefined ? "fleche" : "doigt";
this.curseur_on_roll = p.curseurOnRoll != undefined ? p.curseurOnRoll : "doigt";
this.curseur_onRollOut = p.curseur_onRollOut != undefined ? p.curseur_onRollOut : "fleche";
this.curseur_after_press = p.curseurAfterPress != undefined ? p.curseurAfterPress : "doigt";
this.curseur_onRelease = p.curseur_onRelease != undefined ? p.curseur_onRelease : "doigt";
this.curseur_onReleaseOutside = p.curseur_onReleaseOutside != undefined ? p.curseur_onReleaseOutside : "fleche";
}
this.goto = p.goto;
this.Activer = function()
{
if(this.Actif == true)
{
return undefined;
}
this.enabled = true;
this.BTN.enabled = true;
this.Actif = true;
this.gotoAndStop(this.activeFrame);
};
this.Desactiver = function()
{
if(this.Actif == false)
{
return undefined;
}
this.enabled = false;
this.BTN.enabled = false;
this.Actif = false;
this.stopsonOnPress();
this.masqueIB();
this.gotoAndStop(this.desactiveFrame);
};
this.SetUseHandCursor = function(flag)
{
this.UseHandCursor = flag;
this.useHandCursor = this.UseHandCursor;
this.BTN.useHandCursor = this.UseHandCursor;
};
this.Activer();
this.GS = this.gotoAndStop;
this.MConPress = function()
{
if(this.p.blockOnPress == true)
{
this.enabled = false;
this.BTN.enabled = false;
}
this.stopson();
this.jouesonOnPress();
this.masqueIB();
this.gotoAndStop(this.pressFrame);
gereCursor(this.curseur_after_press);
_root.gotoAndStop(this.goto);
var p = this.OnPress();
};
this.MConRollOver = function()
{
this.joueson();
this.afficheIB();
this.gotoAndStop(this.overFrame);
gereCursor(this.curseur_on_roll);
var _loc2_ = this.OnRollOver();
};
this.MConRollOut = function()
{
this.stopson();
this.masqueIB();
this.gotoAndStop(this.outFrame);
gereCursor(this.curseur_onRollOut);
var _loc2_ = this.OnRollOut();
};
this.MConRelease = function()
{
this.gotoAndStop(this.releaseFrame);
gereCursor(this.curseur_onRelease);
var _loc2_ = this.OnRelease();
};
this.MConReleaseOutside = function()
{
this.gotoAndStop(this.releaseOutFrame);
gereCursor(this.curseur_onReleaseOutside);
var _loc2_ = this.OnReleaseOutside();
};
if(this.BTN == undefined || p.BTN == false)
{
this.useHandCursor = this.UseHandCursor;
this.onPress = this.MConPress;
this.onRollOver = this.MConRollOver;
this.onRollOut = this.MConRollOut;
this.onRelease = this.MConRelease;
this.onReleaseOutside = this.MConReleaseOutside;
}
else
{
this.BTN.useHandCursor = this.UseHandCursor;
this.BTN.onPress = function()
{
this._parent.MConPress();
};
this.BTN.onRollOver = function()
{
this._parent.MConRollOver();
};
this.BTN.onRollOut = function()
{
this._parent.MConRollOut();
};
this.BTN.onRelease = function()
{
this._parent.MConRelease();
};
this.BTN.onReleaseOutside = function()
{
this._parent.MConReleaseOutside();
};
}
this.Refresh();
}
function InitMC_BTN(p)
{
if(p.IB != undefined)
{
if(p.IBrep == true)
{
var IBrepere = _MOD_["IBrep_" + p.IB];
}
else
{
var IBrepere = p.mc;
}
this.afficheIB = function()
{
gereTextes.afficheIB({codeIB:p.IB,mc:IBrepere});
};
this.masqueIB = function()
{
gereTextes.masqueIB();
};
}
this.enabled = true;
§§push(this);
§§push("joueson");
if(p.son == undefined)
{
§§push(undefined);
}
§§pop()[§§pop()] = §§pop();
§§push(this);
§§push("stopson");
if(p.nostop != undefined)
{
§§push(undefined);
}
§§pop()[§§pop()] = §§pop();
var curseur_after_press = p.goto != undefined ? "fleche" : "doigt";
this.goto = p.goto;
this.BTN.onPress = function()
{
this._parent.stopson();
this._parent.masqueIB();
this._parent.gotoAndStop("E3");
gereCursor(curseur_after_press);
_root.gotoAndStop(this.goto);
var _loc3_ = this._parent.OnPress();
};
this.BTN.onRollOver = function()
{
this._parent.joueson();
this._parent.afficheIB();
this._parent.gotoAndStop("E2");
gereCursor("doigt");
var _loc2_ = this._parent.OnRollOver();
};
this.BTN.onRollOut = function()
{
this._parent.stopson();
this._parent.masqueIB();
this._parent.gotoAndStop("E1");
gereCursor("fleche");
var _loc2_ = this._parent.OnRollOut();
};
this.BTN.onRelease = function()
{
this._parent.gotoAndStop("E2");
gereCursor("doigt");
var _loc2_ = this._parent.OnRelease();
};
this.BTN.onReleaseOutside = function()
{
this._parent.gotoAndStop("E1");
gereCursor("fleche");
var _loc2_ = this._parent.OnReleaseOutside();
};
}
function InitMC_dragdrop(p)
{
trace("InitMC_dragdrop_X");
if(p.IB != undefined)
{
if(p.IBrep == true)
{
var IBrepere = _MOD_["IBrep_" + p.IB];
}
else
{
var IBrepere = p.mc;
}
this.afficheIB = function()
{
_root.gereTextes.afficheIB({codeIB:p.IB,mc:IBrepere});
};
this.masqueIB = function()
{
_root.gereTextes.masqueIB();
};
}
this.BTN = typeof p.BTN != "movieclip" ? this.BTN : p.BTN;
this.pDepth = this.getDepth();
this.PressLevel = p.PressLevel != undefined ? p.PressLevel : 15832;
this.pressFrame = p.pressFrame != undefined ? p.pressFrame : "E3";
this.overFrame = p.overFrame != undefined ? p.overFrame : "E2";
this.CibleOverFrame = p.CibleOverFrame != undefined ? p.CibleOverFrame : "E3";
this.CibleOutFrame = p.CibleOutFrame != undefined ? p.CibleOutFrame : "E1";
§§push(this);
§§push("joueson");
if(p.son == undefined)
{
§§push(undefined);
}
§§pop()[§§pop()] = §§pop();
§§push(this);
§§push("stopson");
if(p.son == undefined)
{
§§push(undefined);
}
§§pop()[§§pop()] = §§pop();
§§push(this);
§§push("jouesonOnPress");
if(p.sonOnPress == undefined)
{
§§push(undefined);
}
§§pop()[§§pop()] = §§pop();
§§push(this);
§§push("stopsonOnPress");
if(p.sonOnPress == undefined)
{
§§push(undefined);
}
§§pop()[§§pop()] = §§pop();
§§push(this);
§§push("jouesonOnOverCible");
if(p.sonOnOverCible == undefined)
{
§§push(undefined);
}
§§pop()[§§pop()] = §§pop();
§§push(this);
§§push("stopsonOnOverCible");
if(p.sonOnOverCible == undefined)
{
§§push(undefined);
}
§§pop()[§§pop()] = §§pop();
var _loc16_ = p.goto != undefined ? "fleche" : "doigt";
this.goto = p.goto;
this.ModeDrag = p.ModeDrag != undefined ? p.ModeDrag : "lache_au_rollout";
this.CentrerOnStartDrag = p.CentrerOnStartDrag != undefined ? p.CentrerOnStartDrag : false;
this.ModeHitTest = p.ModeHitTest != undefined ? p.ModeHitTest : "bounds";
this.ZoneDragLimites = p.ZoneDragLimites != undefined ? p.ZoneDragLimites : {x:0,y:0,w:800,h:600};
this.MethodeDetecteDrag = this.ModeHitTest != "mouse" ? "DetectDrag" : "DetectDrag2";
this.DragEnCours = false;
this.DetectDrag = function()
{
this._x = _xmouse - this.ecart_mousex;
this._y = _ymouse - this.ecart_mousey;
if(this._x < this.ZoneDragLimites.x)
{
this._x = this.ZoneDragLimites.x;
}
if(this._x > this.ZoneDragLimites.x + this.ZoneDragLimites.w)
{
this._x = this.ZoneDragLimites.x + this.ZoneDragLimites.w;
}
if(this._y < this.ZoneDragLimites.y)
{
this._y = this.ZoneDragLimites.y;
}
if(this._y > this.ZoneDragLimites.y + this.ZoneDragLimites.h)
{
this._y = this.ZoneDragLimites.y + this.ZoneDragLimites.h;
}
this.CiblesTouchees = [];
var _loc2_ = 0;
while(_loc2_ < this.CiblesDrag.length)
{
if(this.hitTest(this.CiblesDrag[_loc2_]))
{
this.CiblesDrag[_loc2_].gotoAndStop(this.CibleOverFrame);
this.CiblesTouchees.push(this.CiblesDrag[_loc2_]);
this.touche = this.touche + 1;
}
else
{
this.CiblesDrag[_loc2_].gotoAndStop(this.CibleOutFrame);
}
_loc2_ = _loc2_ + 1;
}
if(this.touche == 1)
{
this.jouesonOnOverCible();
}
if(this.CiblesTouchees.length <= 0)
{
this.touche = 0;
this.stopsonOnOverCible();
}
this.PendantDrag();
updateAfterEvent();
};
this.DetectDrag2 = function()
{
this._x = _xmouse - this.ecart_mousex;
this._y = _ymouse - this.ecart_mousey;
this.CiblesTouchees = [];
var _loc2_ = 0;
while(_loc2_ < this.CiblesDrag.length)
{
if(this.CiblesDrag[_loc2_].hitTest(_xmouse,_ymouse,true))
{
this.CiblesDrag[_loc2_].gotoAndStop(this.CibleOverFrame);
this.CiblesTouchees.push(this.CiblesDrag[_loc2_]);
this.touche = this.touche + 1;
}
else
{
this.CiblesDrag[_loc2_].gotoAndStop(this.CibleOutFrame);
}
_loc2_ = _loc2_ + 1;
}
if(this.touche == 1)
{
this.jouesonOnOverCible();
}
if(this.CiblesTouchees.length <= 0)
{
this.touche = 0;
this.stopsonOnOverCible();
}
this.PendantDrag();
updateAfterEvent();
};
this.StartDrag = function()
{
if(this.CentrerOnStartDrag != true)
{
this.ecart_mousex = _xmouse - this._x;
this.ecart_mousey = _ymouse - this._y;
}
else
{
this._x = _xmouse;
this._y = _ymouse;
this.ecart_mousex = _xmouse - this._x;
this.ecart_mousey = _ymouse - this._y;
}
this.IntervalId = _global.SetInterval({mcRef:this,methode:this.MethodeDetecteDrag,interval:10});
this.swapDepths(this.PressLevel);
this.DragEnCours = true;
};
this.ContinueDrag = function()
{
this.gotoAndStop(this.pressFrame);
gereCursor("mainF");
this.ecart_mousex = _xmouse - this._x;
this.ecart_mousey = _ymouse - this._y;
if(this.IntervalId != undefined)
{
_global.ClearInterval(this.IntervalId);
}
this.IntervalId = _global.SetInterval({mcRef:this,methode:this.MethodeDetecteDrag,interval:10});
this.swapDepths(this.PressLevel);
this.DragEnCours = true;
};
this.StopDrag = function()
{
_global.ClearInterval(this.IntervalId);
this.swapDepths(this.pDepth);
this.DragEnCours = false;
};
this.ComeBack = function()
{
this._x = this.xOri;
this._y = this.yOri;
this.gotoAndStop("E1");
this.DragEnCours = false;
};
this.Activer = function()
{
this.enabled = true;
this.BTN.enabled = true;
};
this.Desactiver = function()
{
this.enabled = false;
this.BTN.enabled = false;
};
this.CibleLaPlusProche = function(p)
{
if(this.CiblesTouchees.length == 0)
{
return null;
}
var _loc3_ = undefined;
var _loc9_ = this.CiblesTouchees[0];
var _loc8_ = undefined;
var _loc6_ = undefined;
if(p.mcRef == undefined)
{
_loc8_ = _xmouse;
_loc6_ = _ymouse;
}
else if(p.mcRef == "center")
{
_loc8_ = this._x + this._width / 2;
_loc6_ = this._y + this._height / 2;
}
else
{
var _loc10_ = new flash.geom.Point(p.mcRef._x,p.mcRef._y);
mcRef.localToGlobal(_loc10_);
_loc8_ = _loc10_.x;
_loc6_ = _loc10_.y;
}
var _loc4_ = DistancePoints({x1:_loc8_,y1:_loc6_,x2:this.CiblesTouchees[0]._x,y2:this.CiblesTouchees[0]._y});
var _loc2_ = 1;
while(_loc2_ < this.CiblesTouchees.length)
{
_loc3_ = DistancePoints({x1:_loc8_,y1:_loc6_,x2:this.CiblesTouchees[_loc2_]._x,y2:this.CiblesTouchees[_loc2_]._y});
trace(this.CiblesTouchees[_loc2_] + " - " + _loc3_);
if(_loc3_ < _loc4_)
{
_loc4_ = _loc3_;
_loc9_ = this.CiblesTouchees[_loc2_];
}
_loc2_ = _loc2_ + 1;
}
trace("primo : " + _loc9_);
return _loc9_;
};
this.MConPress = function()
{
if(this.ModeDrag == "lache_au_clic" && this.DragEnCours == true)
{
this.FirstPress = false;
this.DragEnCours = false;
gereCursor("mainO");
this.stopsonOnPress();
this.gotoAndStop("E2");
_global.ClearInterval(this.IntervalId);
this.CiblesTouchees = [];
if(this.ModeHitTest == "mouse")
{
var _loc3_ = 0;
while(_loc3_ < this.CiblesDrag.length)
{
if(this.CiblesDrag[_loc3_].hitTest(_xmouse,_ymouse,true))
{
this.CiblesTouchees.push(this.CiblesDrag[_loc3_]);
}
_loc3_ = _loc3_ + 1;
}
}
else
{
_loc3_ = 0;
while(_loc3_ < this.CiblesDrag.length)
{
if(this.hitTest(this.CiblesDrag[_loc3_]))
{
this.CiblesTouchees.push(this.CiblesDrag[_loc3_]);
}
_loc3_ = _loc3_ + 1;
}
}
this.swapDepths(this.pDepth);
this.ApresDrag();
}
else
{
this.FirstPress = true;
this.jouesonOnPress();
this.xOri = this._x;
this.yOri = this._y;
this.masqueIB();
this.gotoAndStop(this.pressFrame);
gereCursor("mainF");
this.StartDrag();
var _loc4_ = this.OnPress();
}
};
this.MConRollOver = function()
{
if(this.DragEnCours == true)
{
return undefined;
}
this.joueson();
this.afficheIB();
this.gotoAndStop(this.overFrame);
gereCursor("mainO");
var _loc2_ = this.OnRollOver();
};
this.MConRollOut = function()
{
if(this.DragEnCours == true)
{
return undefined;
}
this.stopson();
this.gotoAndStop("E1");
this.masqueIB();
gereCursor("fleche");
var _loc2_ = this.OnRollOut();
};
this.MConRelease = function()
{
if(this.ModeDrag != "lache_au_rollout")
{
return undefined;
}
this.DragEnCours = false;
gereCursor("mainO");
this.stopsonOnPress();
this.gotoAndStop("E2");
_global.ClearInterval(this.IntervalId);
this.CiblesTouchees = [];
if(this.ModeHitTest == "mouse")
{
var _loc3_ = 0;
while(_loc3_ < this.CiblesDrag.length)
{
if(this.CiblesDrag[_loc3_].hitTest(_xmouse,_ymouse,true))
{
this.CiblesTouchees.push(this.CiblesDrag[_loc3_]);
}
_loc3_ = _loc3_ + 1;
}
}
else
{
_loc3_ = 0;
while(_loc3_ < this.CiblesDrag.length)
{
if(this.hitTest(this.CiblesDrag[_loc3_]))
{
this.CiblesTouchees.push(this.CiblesDrag[_loc3_]);
}
_loc3_ = _loc3_ + 1;
}
}
this.swapDepths(this.pDepth);
this.ApresDrag();
var _loc4_ = this.OnRelease();
};
this.MConReleaseOutside = this.MConRelease;
if(this.BTN == undefined || p.BTN == false)
{
this.onPress = this.MConPress;
this.onRollOver = this.MConRollOver;
this.onRollOut = this.MConRollOut;
this.onRelease = this.MConRelease;
this.onReleaseOutside = this.MConReleaseOutside;
}
else
{
this.BTN.onPress = function()
{
this._parent.MConPress();
};
this.BTN.onRollOver = function()
{
this._parent.MConRollOver();
};
this.BTN.onRollOut = function()
{
this._parent.MConRollOut();
};
this.BTN.onRelease = function()
{
this._parent.MConRelease();
};
this.BTN.onReleaseOutside = function()
{
this._parent.MConReleaseOutside();
};
}
}
function InitMC_slider(p)
{
if(p.IB != undefined)
{
if(p.IBrep == true)
{
var IBrepere = _MOD_["IBrep_" + p.IB];
}
else
{
var IBrepere = p.mc;
}
this.afficheIB = function()
{
gereTextes.afficheIB({codeIB:p.IB,mc:IBrepere});
};
this.masqueIB = function()
{
gereTextes.masqueIB();
};
}
§§push(this);
§§push("joueson");
if(p.son == undefined)
{
§§push(undefined);
}
§§pop()[§§pop()] = §§pop();
§§push(this);
§§push("stopson");
if(p.son == undefined)
{
§§push(undefined);
}
§§pop()[§§pop()] = §§pop();
var _loc7_ = p.goto != undefined ? "fleche" : "doigt";
this.goto = p.goto;
this.EnMouvement = false;
if(p.sonOnMove != undefined)
{
this.sonOnMove = p.sonOnMove;
this.sonOnMove_offset = p.sonOnMove_offset != undefined ? Number(p.sonOnMove_offset) : 0;
this.sonOnMove_loopSon = p.sonOnMove_loopSon != undefined ? Number(p.sonOnMove_loopSon) : 0;
this.jouesonOnMove = function()
{
joueBruitage({nomSon:this.sonOnMove,offset:this.sonOnMove_offset,loopSon:this.sonOnMove_loopSon});
};
this.stopsonOnMove = function()
{
stopBruitage({nomSon:this.sonOnMove});
};
}
else
{
this.jouesonOnMove = undefined;
this.stopsonOnMove = undefined;
}
if(p.sonOnPress != undefined)
{
this.sonOnPress = p.sonOnPress;
this.sonOnPress_offset = p.sonOnPress_offset != undefined ? Number(p.sonOnPress_offset) : 0;
this.sonOnPress_loopSon = p.sonOnPress_loopSon != undefined ? Number(p.sonOnPress_loopSon) : 0;
this.jouesonOnPress = function()
{
joueBruitage({nomSon:this.sonOnPress,offset:this.sonOnPress_offset,loopSon:this.sonOnPress_loopSon});
};
this.stopsonOnPress = function()
{
stopBruitage({nomSon:this.sonOnPress});
};
}
else
{
this.jouesonOnMove = undefined;
this.stopsonOnMove = undefined;
}
this.DragZoneLargeur = p.DragZoneLargeur != undefined ? p.DragZoneLargeur : 0;
this.DragZoneHauteur = p.DragZoneHauteur != undefined ? p.DragZoneHauteur : 0;
this.DragZoneLargeur_pourcent = p.DragZoneLargeur / 100;
this.DragZoneHauteur_pourcent = p.DragZoneHauteur / 100;
this.DragZone = {left:this._x,right:this._x + this.DragZoneLargeur,top:this._y,bottom:this._y + this.DragZoneHauteur};
this.Activer = function()
{
this.enabled = true;
};
this.Desactiver = function()
{
this.enabled = false;
};
this.SetPosition = this.SetPositionX = function(pourcent)
{
this._x = this.DragZone.left + this.DragZoneLargeur_pourcent * pourcent;
};
this.SetPositionY = function(pourcent)
{
this._y = this.DragZone.top + this.DragZoneHauteur_pourcent * pourcent;
};
this.GetPosition = this.GetPositionX = function()
{
return (this._x - this.DragZone.left) / this.DragZoneLargeur_pourcent;
};
this.GetPositionY = function()
{
return (this._y - this.DragZone.top) / this.DragZoneHauteur_pourcent;
};
this.DetectDrag = function()
{
this._x = _root._xmouse - this.ecart_mousex;
this._y = _root._ymouse - this.ecart_mousey;
if(this._x <= this.DragZone.left)
{
this._x = this.DragZone.left;
}
if(this._y < this.DragZone.top)
{
this._y = this.DragZone.top;
}
if(this._x >= this.DragZone.right)
{
this._x = this.DragZone.right;
}
if(this._y > this.DragZone.bottom)
{
this._y = this.DragZone.bottom;
}
updateAfterEvent();
if(this._x == this.lastx && this._y == this.lasty)
{
if(this.EnMouvement == true)
{
this.EnMouvement = false;
this.stopsonOnMove();
}
}
else if(this.EnMouvement == false)
{
this.EnMouvement = true;
this.jouesonOnMove();
}
this.lastx = this._x;
this.lasty = this._y;
this.PendantSlide();
};
this.StartDrag = function()
{
this.ecart_mousex = _root._xmouse - this._x;
this.ecart_mousey = _root._ymouse - this._y;
this.lastx = this._x;
this.lasty = this._y;
this.IntervalId = _global.SetInterval({mcRef:this,methode:"DetectDrag",interval:1});
};
this.onPress = function()
{
this.jouesonOnPress();
this.masqueIB();
this.gotoAndStop("E3");
gereCursor("mainF");
this.StartDrag();
var _loc2_ = this.OnPress();
};
this.onRollOver = function()
{
this.joueson();
this.afficheIB();
this.gotoAndStop("E2");
gereCursor("mainO");
var _loc2_ = this.OnRollOver();
};
this.onRollOut = function()
{
this.stopson();
this.stopsonOnPress();
this.stopsonOnMove();
this.gotoAndStop("E1");
this.masqueIB();
gereCursor("fleche");
var _loc2_ = this.OnRollOut();
};
this.onRelease = function()
{
this.gotoAndStop("E2");
_global.ClearInterval(this.IntervalId);
this.stopson();
this.stopsonOnPress();
this.stopsonOnMove();
gereCursor("mainO");
var _loc3_ = this.OnRelease();
};
this.onReleaseOutside = function()
{
this.onRelease();
gereCursor("fleche");
var _loc2_ = this.OnReleaseOutside();
};
}
function InitMC_titre(p)
{
this.LMaVider = [];
this.offsetx = p.offsetx != undefined ? Number(p.offsetx) : 0;
this.offsety = p.offsety != undefined ? Number(p.offsety) : 0;
this.ChangeTexte = function(p)
{
this.viderLM();
_root.gereTextes.afficheLM({codeLM:p.codeLM,X:this._x + this.offsetx,Y:this._y + this.offsety,width:this._width,height:this._height});
this.LMaVider.push(p);
};
this.viderLM = function()
{
var _loc3_ = 0;
while(_loc3_ < this.LMaVider.length)
{
_root.gereTextes.masqueLM(this.LMaVider[_loc3_]);
_loc3_ = _loc3_ + 1;
}
};
}
function InitMC_texte(p)
{
trace("InitMC_titre()");
xlisteObj(p);
this.LMaVider = [];
this.pere = p.pere != undefined ? Number(p.pere) : _root;
this.offsetx = p.offsetx != undefined ? Number(p.offsetx) : 0;
this.offsety = p.offsety != undefined ? Number(p.offsety) : 0;
this.level = p.level != undefined ? Number(p.level) : this.pere.getNextHighestDepth();
this.texte = p.texte != undefined ? p.texte : "";
this.MC = p.mc;
this.MC._visible = false;
if(p.style == undefined)
{
this.Style = {};
}
else
{
this.Style = p.style;
}
this.Style.multiline = this.Style.multiline != undefined ? this.Style.multiline : true;
this.Style.wordWrap = this.Style.wordWrap != undefined ? this.Style.wordWrap : true;
this.Style.border = this.Style.border != undefined ? this.Style.border : false;
this.Style.color = this.Style.color != undefined ? this.Style.color : 16711680;
this.Style.size = this.Style.size != undefined ? this.Style.size : 12;
this.Style.font = this.Style.font != undefined ? this.Style.font : "Comic Sans MS";
this.Style.align = this.Style.align != undefined ? this.Style.align : "center";
this.Style.underline = this.Style.underline != undefined ? this.Style.underline : false;
this.Style.selectable = this.Style.selectable != undefined ? this.Style.selectable : false;
var _loc4_ = this.pere.createTextField(this.MC._name + "_txt",this.level,this.MC._x,this.MC._y,this.MC._width,this.MC._height);
_loc4_.multiline = this.Style.multiline;
_loc4_.wordWrap = this.Style.wordWrap;
_loc4_.border = this.Style.border;
_loc4_.selectable = this.Style.selectable;
_loc4_.embedFonts = true;
var my_fmt = new TextFormat();
my_fmt.font = this.Style.font;
my_fmt.size = this.Style.size;
my_fmt.color = this.Style.color;
my_fmt.align = this.Style.align;
my_fmt.underline = this.Style.underline;
_loc4_.text = this.texte;
_loc4_.setTextFormat(my_fmt);
this.TexteMC = _loc4_;
this.ChangeTexte = function(p)
{
this.texte = p.texte;
this.TexteMC.text = p.texte;
this.TexteMC.setTextFormat(my_fmt);
};
}
function TexteFxGo(p)
{
trace("TexteFxGo");
var _loc15_ = p.vitesse != undefined ? Number(p.vitesse) : 50;
var _loc4_ = _root.moduleInfo.returnNodeByPath("Module.StylesTextes.StylesLM");
var _loc14_ = _root.moduleInfo.returnNodeByPath("Module." + _root.gLangue + ".LegendesMedias");
var _loc13_ = {};
var _loc17_ = p.texte;
_loc17_ = _root.gereTextes.getTextById(_loc14_,"LM00");
var texte_arr = ExplodeString(_loc17_);
var cible = p.mc;
var no_lettre = 0;
var texte_up = "";
var _loc9_ = [];
var retour_func = p.retour;
var _loc11_ = "LM00";
var _loc10_ = "LM";
var _loc22_ = 0;
gFmtBase = new TextFormat();
var _loc8_ = new XML();
var _loc20_ = "00";
var _loc3_ = 0;
while(_loc3_ < _loc4_.childNodes.length)
{
if(_loc4_.childNodes[_loc3_].attributes.id == _loc10_)
{
var _loc7_ = 0;
while(_loc7_ < _loc4_.childNodes[_loc3_].childNodes.length)
{
var _loc6_ = _loc4_.childNodes[_loc3_].childNodes[_loc7_].nodeName;
var _loc5_ = _loc4_.childNodes[_loc3_].childNodes[_loc7_].firstChild.nodeValue;
_loc9_[_loc6_] = _loc5_;
_loc7_ = _loc7_ + 1;
}
}
else
{
if(_loc4_.childNodes[_loc3_].attributes.id == _loc11_)
{
_loc8_ = _loc4_.childNodes[_loc3_];
break;
}
if(_loc4_.childNodes[_loc3_].attributes.id == myStyle)
{
_loc8_ = _loc4_.childNodes[_loc3_];
break;
}
}
_loc3_ = _loc3_ + 1;
}
if(_loc8_.childNodes.length !== 0)
{
_loc7_ = 0;
while(_loc7_ < _loc8_.childNodes.length)
{
_loc6_ = _loc8_.childNodes[_loc7_].nodeName;
_loc5_ = _loc8_.childNodes[_loc7_].firstChild.nodeValue;
_loc9_[_loc6_] = _loc5_;
_loc7_ = _loc7_ + 1;
}
}
trace(texte_arr);
trace(_loc9_);
InitMC({mc:p.mc,fonction:"texte",texte:"",style:{align:_loc9_.justify,size:_loc9_.corps,color:_loc9_.couleurT,font:_loc9_.police}});
_loc13_.Boucle = function()
{
texte_up += texte_arr[no_lettre];
cible.ChangeTexte({texte:texte_up});
no_lettre++;
if(texte_arr[no_lettre] == undefined)
{
clearInterval(this.BoucleID);
retour_func.call();
}
};
_loc13_.BoucleID = setInterval(_loc13_,"Boucle",_loc15_);
}
function Liste(p)
{
var _loc1_ = new xb.classes.Liste(p);
return _loc1_;
}
function CompteurTemps(p)
{
var _loc1_ = new xb.classes.CompteurTemps(p);
return _loc1_;
}
_global.DistancePoints = DistancePoints;
_global.SetInterval = SetInterval;
_global.ClearInterval = ClearInterval;
_global.ClearAllIntervals = ClearAllIntervals;
_root.ExecuterApresDelaiNo = 0;
_global.ExecuterApresDelai = ExecuterApresDelai;
_global.LMaVider = new Array();
_global.LMaVider2 = new Array();
_global.InitMC = InitMC;
_global.InitMC_reccurent = InitMC_reccurent;
_global.ResetMC = ResetMC;
_global.InitMC_standart = InitMC_standart;
_global.InitMC_BTN = InitMC_BTN;
_global.InitMC_dragdrop = InitMC_dragdrop;
_global.InitMC_slider = InitMC_slider;
_global.InitMC_titre = InitMC_titre;
_global.InitMC_texte = InitMC_texte;
MovieClip.prototype._xlib1_ = this;
_global.IncString = IncString;
_global.DecString = DecString;
_global.GetFilePath = GetFilePath;
_global.AntiSlashToSlash = AntiSlashToSlash;
_global.str_replace = str_replace;
_global.JoindreObjets = JoindreObjets;
_global.xGetConfig = xGetConfig;
_global.GetOriginalSize = GetOriginalSize;
_global.GetOriginalHeight = GetOriginalHeight;
_global.CreerCache = CreerCache;
_global.ConvertCoord = ConvertCoord;
_global.getGlobalCoord = getGlobalCoord;
_global.getLocalCoord = getLocalCoord;
_global.length_ass = length_ass;
_global.ExplodeString = ExplodeString;
_global.BloquerActives = BloquerActives;
_global.DebloquerActives = DebloquerActives;
_global.afficheLM_x = afficheLM_x;
_global.viderLM_x = viderLM_x;
_global.afficheLM_x2 = afficheLM_x2;
_global.viderLM_x2 = viderLM_x2;