home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 136 / MOBICLIC136.ISO / pc / DATA / HOTE / libs / xlib1 / xlib1.swf / scripts / frame_1 / DoAction.as
Text File  |  2011-07-20  |  45KB  |  1,560 lines

  1. function IncString(str, seuil)
  2. {
  3.    var _loc2_ = str.split("_");
  4.    var _loc1_ = _loc2_.length - 1;
  5.    var _loc3_ = Number(_loc2_[_loc1_]) + 1;
  6.    while(_loc3_ > seuil)
  7.    {
  8.       _loc2_[_loc1_] = gimme2digits(0);
  9.       _loc1_ = _loc1_ - 1;
  10.       _loc3_ = Number(_loc2_[_loc1_]) + 1;
  11.    }
  12.    _loc2_[_loc1_] = gimme2digits(_loc3_);
  13.    return _loc2_.join("_");
  14. }
  15. function DecString(str)
  16. {
  17.    var _loc1_ = str.split("_");
  18.    trace(_loc1_);
  19.    var _loc2_ = _loc1_.length - 1;
  20.    trace(Number(_loc1_[_loc2_]));
  21.    _loc1_[_loc2_] = gimme2digits(Number(_loc1_[_loc2_]) - 1);
  22.    return _loc1_.join("_");
  23. }
  24. function RetourneLettreAlphabet(no)
  25. {
  26.    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"];
  27.    trace("RetourneLettreAlphabet() : lettre no " + no + " :" + _loc1_[no - 1]);
  28.    return _loc1_[no - 1];
  29. }
  30. function xGetConfig()
  31. {
  32.    trace("xGetConfig()x");
  33.    _root.xConfig = {};
  34.    _root.xConfig.Params = {};
  35.    _root.xConfig.Set = function(p)
  36.    {
  37.       if(this[p.nom] == undefined)
  38.       {
  39.          if(p.defaut == "OBLIGATOIRE")
  40.          {
  41.             trace({mess:"/!\\ERROR /!\\Param├¿tre du xml obligatoire manquant dans la balise Config: " + p.nom,group:"error"});
  42.          }
  43.          else
  44.          {
  45.             this[p.nom] = p.defaut;
  46.             if(p.type == "number")
  47.             {
  48.                this[p.nom] = Number(this[p.nom]);
  49.             }
  50.             if(p.type == "boolean")
  51.             {
  52.                this[p.nom] = !(this[p.nom] == "true" || this[p.nom] == true) ? false : true;
  53.             }
  54.          }
  55.       }
  56.       else
  57.       {
  58.          if(p.type == "number")
  59.          {
  60.             this[p.nom] = Number(this[p.nom]);
  61.          }
  62.          if(p.type == "boolean")
  63.          {
  64.             this[p.nom] = !(this[p.nom] == "true" || this[p.nom] == true) ? false : true;
  65.          }
  66.       }
  67.       this.Params[p.nom] = {nom:p.nom,type:p.type,desc:p.desc,valeur:this[p.nom]};
  68.    };
  69.    _root.xConfig.ToXml = function()
  70.    {
  71.       trace("_root.xConfig.ToXml : " + _root.xConfig.ToXml);
  72.       var _loc3_ = "";
  73.       trace("");
  74.       trace("");
  75.       trace("");
  76.       trace("(!)_____ xConfig en XML _______");
  77.       trace("<Params>");
  78.       for(var _loc4_ in this.Params)
  79.       {
  80.          this.Params[_loc4_].desc = this.Params[_loc4_].desc != undefined ? this.Params[_loc4_].desc : "";
  81.          _loc3_ = "<Param nom=\"" + _loc4_ + "\" valeur=\"" + this.Params[_loc4_].valeur + "\" /> <!-- " + this.Params[_loc4_].desc + " -->\r" + _loc3_;
  82.       }
  83.       trace(_loc3_);
  84.       trace("</Params>");
  85.       trace("(!)_____ xConfig en XML- FIN _______");
  86.       trace("");
  87.       trace("");
  88.       trace("");
  89.    };
  90.    _root.xConfig._name = "xConfig";
  91.    var _loc3_ = _root.moduleInfo.returnNodeByPath("Module.Config.Params").childNodes;
  92.    for(props in _loc3_)
  93.    {
  94.       _root.xConfig[_loc3_[props].attributes.nom] = _loc3_[props].attributes.valeur;
  95.    }
  96. }
  97. function GetFilePath(fichier)
  98. {
  99.    var _loc2_ = AntiSlashToSlash(fichier);
  100.    var _loc1_ = _loc2_.split("/");
  101.    _loc1_.pop();
  102.    return _loc1_.join("/");
  103. }
  104. function AntiSlashToSlash(chaine)
  105. {
  106.    return str_replace(chaine,"\\","/");
  107. }
  108. function DistancePoints(p)
  109. {
  110.    return Math.sqrt(Math.pow(p.x2 - p.x1,2) + Math.pow(p.y2 - p.y1,2));
  111. }
  112. function SetInterval(p)
  113. {
  114.    if(_root.INTERVAL_IDS == undefined)
  115.    {
  116.       _root.INTERVAL_IDS = [];
  117.    }
  118.    if(p.mcRef == undefined)
  119.    {
  120.       p.mcRef = _root;
  121.    }
  122.    if(p.methode == undefined)
  123.    {
  124.       return false;
  125.    }
  126.    if(p.interval == undefined)
  127.    {
  128.       return false;
  129.    }
  130.    if(p.params == undefined)
  131.    {
  132.       p.params = {};
  133.    }
  134.    var _loc3_ = setInterval(p.mcRef,p.methode,p.interval,p.params);
  135.    _root.INTERVAL_IDS.push(_loc3_);
  136.    return _loc3_;
  137. }
  138. function ClearInterval(id)
  139. {
  140.    clearInterval(id);
  141.    var _loc2_ = 0;
  142.    while(_loc2_ < _root.INTERVAL_IDS.length)
  143.    {
  144.       if(_root.INTERVAL_IDS[_loc2_] == id)
  145.       {
  146.          _root.INTERVAL_IDS.splice(_loc2_,1);
  147.          return undefined;
  148.       }
  149.       _loc2_ = _loc2_ + 1;
  150.    }
  151. }
  152. function ClearAllIntervals()
  153. {
  154.    var _loc2_ = 0;
  155.    while(_loc2_ < _root.INTERVAL_IDS.length)
  156.    {
  157.       clearInterval(_root.INTERVAL_IDS[_loc2_]);
  158.       _loc2_ = _loc2_ + 1;
  159.    }
  160.    _root.INTERVAL_IDS = [];
  161. }
  162. function ExecuterApresDelai(p)
  163. {
  164.    var tdep = getTimer();
  165.    var tfin;
  166.    var _loc3_ = "ExecuterApresDelai" + Number(++_root.ExecuterApresDelaiNo);
  167.    var id;
  168.    var delai = p.delai * 1000;
  169.    var _loc4_ = p.mcRef[p.methode];
  170.    var mcRef = p.mcRef;
  171.    var methode = p.methode;
  172.    var params = p.params;
  173.    _root[_loc3_] = function()
  174.    {
  175.       tfin = getTimer();
  176.       if(tfin - tdep >= delai)
  177.       {
  178.          ClearInterval(id);
  179.          mcRef[methode](params);
  180.       }
  181.    };
  182.    id = SetInterval({methode:_loc3_,interval:p.delai});
  183.    return id;
  184. }
  185. function str_replace(str, search, replace)
  186. {
  187.    return str.split(search).join(replace);
  188. }
  189. function JoindreObjets(objects)
  190. {
  191.    var _loc2_ = new Object();
  192.    var _loc1_ = 0;
  193.    while(_loc1_ < objects.length)
  194.    {
  195.       p1 = objects[_loc1_];
  196.       for(props in p1)
  197.       {
  198.          _loc2_[props] = p1[props];
  199.       }
  200.       _loc1_ = _loc1_ + 1;
  201.    }
  202.    return _loc2_;
  203. }
  204. function GetOriginalSize(mc)
  205. {
  206.    var _loc2_ = mc._rotation;
  207.    mc._rotation = 0;
  208.    var _loc3_ = {w:mc._width * mc._xscale / 100,h:mc._height * mc._yscale / 100};
  209.    mc._rotation = _loc2_;
  210.    return _loc3_;
  211. }
  212. function GetOriginalWidth(mc)
  213. {
  214.    var _loc2_ = mc._rotation;
  215.    mc._rotation = 0;
  216.    var _loc3_ = mc._width * mc._xscale / 100;
  217.    var _loc4_ = mc._height * mc._yscale / 100;
  218.    mc._rotation = _loc2_;
  219.    return _loc3_;
  220. }
  221. function GetOriginalHeight(mc)
  222. {
  223.    var _loc2_ = mc._rotation;
  224.    mc._rotation = 0;
  225.    var _loc4_ = mc._width * mc._xscale / 100;
  226.    var _loc3_ = mc._height * mc._yscale / 100;
  227.    mc._rotation = _loc2_;
  228.    return _loc3_;
  229. }
  230. function CreerCache(p)
  231. {
  232.    var _loc4_ = p.level != undefined ? p.level : _global.Levels.cache;
  233.    var _loc2_ = p.mc.createEmptyMovieClip("CACHE",_loc4_);
  234.    _loc2_.beginFill(65280,50);
  235.    _loc2_.moveTo(0,0);
  236.    _loc2_.lineTo(p.width,0);
  237.    _loc2_.lineTo(p.width,p.height);
  238.    _loc2_.lineTo(0,p.height);
  239.    _loc2_.lineTo(0,0);
  240.    _loc2_.endFill();
  241.    p.mc.setMask(_loc2_);
  242. }
  243. function ConvertCoord(mc_src, mc_dest)
  244. {
  245.    var _loc1_ = {x:0,y:0};
  246.    mc_src.localToGlobal(_loc1_);
  247.    mc_dest.globalToLocal(_loc1_);
  248.    return _loc1_;
  249. }
  250. function getGlobalCoord(xc, yc, mc)
  251. {
  252.    var _loc1_ = {x:xc * 100 / mc._xscale,y:yc * 100 / mc._yscale};
  253.    mc.localToGlobal(_loc1_);
  254.    return _loc1_;
  255. }
  256. function getLocalCoord(xc, yc, mc)
  257. {
  258.    var _loc1_ = new Object({x:xc,y:yc});
  259.    mc.globalToLocal(_loc1_);
  260.    _loc1_.x = _loc1_.x / 100 * mc._xscale;
  261.    _loc1_.y = _loc1_.y / 100 * mc._yscale;
  262.    return _loc1_;
  263. }
  264. function length_ass(arr)
  265. {
  266.    var _loc1_ = 0;
  267.    for(prop in arr)
  268.    {
  269.       _loc1_ = _loc1_ + 1;
  270.    }
  271.    return _loc1_;
  272. }
  273. function ExplodeString(chaine)
  274. {
  275.    var _loc3_ = new Array();
  276.    var _loc1_ = 0;
  277.    while(_loc1_ < chaine.length)
  278.    {
  279.       _loc3_.push(chaine.charAt(_loc1_));
  280.       _loc1_ = _loc1_ + 1;
  281.    }
  282.    return _loc3_;
  283. }
  284. function TrimString(chaine)
  285. {
  286.    var _loc3_ = "";
  287.    var _loc5_ = "";
  288.    var _loc2_ = false;
  289.    var _loc1_ = 0;
  290.    while(_loc1_ < chaine.length)
  291.    {
  292.       if(chaine.charAt(_loc1_) != " ")
  293.       {
  294.          _loc2_ = true;
  295.       }
  296.       if(_loc2_ == true)
  297.       {
  298.          _loc3_ += chaine.charAt(_loc1_);
  299.       }
  300.       _loc1_ = _loc1_ + 1;
  301.    }
  302.    _loc2_ = false;
  303.    _loc1_ = _loc3_.length - 1;
  304.    while(_loc1_ >= 0)
  305.    {
  306.       if(_loc3_.charAt(_loc1_) != " ")
  307.       {
  308.          _loc2_ = true;
  309.       }
  310.       if(_loc2_ == true)
  311.       {
  312.          _loc5_ = _loc3_.charAt(_loc1_) + _loc5_;
  313.       }
  314.       _loc1_ = _loc1_ - 1;
  315.    }
  316.    return _loc5_;
  317. }
  318. function BloquerActives()
  319. {
  320.    if(_global.ClipBloquant == undefined)
  321.    {
  322.       var _loc0_ = null;
  323.       var _loc3_ = _global.ClipBloquant = _root.createEmptyMovieClip("ClipBloquant",10123);
  324.       _loc3_.attachMovie("ClipInvisible","ClipInvisible",2);
  325.       _loc3_._width = Stage.width;
  326.       _loc3_._height = Stage.height;
  327.       _loc3_._x = 0;
  328.       _loc3_._y = 0;
  329.       _loc3_.useHandCursor = false;
  330.       _loc3_.onPress = function()
  331.       {
  332.       };
  333.    }
  334. }
  335. function DebloquerActives()
  336. {
  337.    if(_global.ClipBloquant != undefined)
  338.    {
  339.       _global.ClipBloquant.removeMovieClip();
  340.       _global.ClipBloquant = undefined;
  341.    }
  342. }
  343. function afficheLM_x2(p)
  344. {
  345.    viderLM_x2();
  346.    _root.gereTextes.afficheLM({codeLM:p.codeLM,X:p.LMrep._x,Y:p.LMrep._y,width:p.LMrep._width,height:p.LMrep._height});
  347.    LMaVider2.push(p);
  348. }
  349. function viderLM_x2()
  350. {
  351.    var _loc3_ = 0;
  352.    while(_loc3_ < _global.LMaVider2.length)
  353.    {
  354.       _root.gereTextes.masqueLM(_global.LMaVider2[_loc3_]);
  355.       _loc3_ = _loc3_ + 1;
  356.    }
  357. }
  358. function afficheLM_x(p)
  359. {
  360.    _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});
  361.    _global.LMaVider.push(p);
  362. }
  363. function viderLM_x()
  364. {
  365.    var _loc3_ = 0;
  366.    while(_loc3_ < _global.LMaVider.length)
  367.    {
  368.       _root.gereTextes.masqueLM(_global.LMaVider[_loc3_]);
  369.       _loc3_ = _loc3_ + 1;
  370.    }
  371. }
  372. function ConvertMcToArray(p)
  373. {
  374.    xtrace("Convertion du bitmap en tableau de nombres");
  375.    var _loc3_ = p.mc;
  376.    var _loc5_ = _loc3_._rotation;
  377.    _loc3_._rotation = 0;
  378.    var _loc1_ = _loc3_._width * 100 / _loc3_._xscale;
  379.    var _loc4_ = _loc3_._height * 100 / _loc3_._yscale;
  380.    _loc3_._rotation = _loc5_;
  381.    _loc3_.MCwidth = _loc1_;
  382.    _loc3_.MCheight = _loc4_;
  383.    xtrace("WH " + _loc1_ + " " + _loc4_);
  384.    var _loc2_ = new flash.display.BitmapData(_loc1_,_loc4_,true,0);
  385.    _loc2_.draw(_loc3_);
  386.    var _loc6_ = new Array();
  387.    lv = new LoadVars();
  388.    lv.tab = new Array();
  389.    i = 0;
  390.    while(i < _loc4_)
  391.    {
  392.       j = 0;
  393.       while(j < _loc1_)
  394.       {
  395.          lv.tab.push(_loc2_.getPixel(j,i));
  396.          j++;
  397.       }
  398.       i++;
  399.    }
  400.    return lv.tab;
  401. }
  402. function ConvertMcToBitmap(p)
  403. {
  404.    var _loc1_ = p.mc;
  405.    var _loc2_ = new flash.display.BitmapData(_loc1_._width,_loc1_._height,true,16777215);
  406.    _loc2_.draw(_loc1_,_loc1_.transform.matrix);
  407.    _loc1_._parent.createEmptyMovieClip(_loc1_._name,_loc1_.getDepth());
  408.    _loc1_.attachBitmap(_loc2_,2,"always",true);
  409. }
  410. function CloneMcToBitmap(p)
  411. {
  412.    var _loc1_ = p.mc;
  413.    var _loc9_ = p.pere;
  414.    var _loc8_ = p.nom;
  415.    var _loc5_ = p.level;
  416.    trace("-*-*-* " + _loc1_._width + " " + _loc1_._height);
  417.    var _loc7_ = _loc1_._x;
  418.    var _loc6_ = _loc1_._y;
  419.    _loc1_._x = 0;
  420.    _loc1_._y = 0;
  421.    var _loc4_ = new flash.display.BitmapData(_loc1_._width,_loc1_._height,true,16755370);
  422.    trace(_loc1_.transform.matrix.toString());
  423.    var _loc2_ = _loc9_.createEmptyMovieClip(_loc8_,_loc5_);
  424.    _loc2_._visible = false;
  425.    _loc2_.attachBitmap(_loc4_,2,"auto",true);
  426.    _loc4_.draw(_loc1_,_loc1_.transform.matrix);
  427.    _loc1_._x = _loc7_;
  428.    _loc1_._y = _loc6_;
  429.    trace("CloneMcToBitmap" + _loc2_);
  430.    return _loc2_;
  431. }
  432. function InitMC(p)
  433. {
  434.    trace("InitMCo() " + p.mc);
  435.    var mc = typeof p != "movieclip" ? p.mc : p;
  436.    if(p.level != undefined)
  437.    {
  438.       var ceMC_name_old = mc._name + "_old";
  439.       var ceMC_name = mc._name;
  440.       mc._name = ceMC_name_old;
  441.       mc.duplicateMovieClip(ceMC_name,p.level);
  442.       mc._visible = false;
  443.       mc = this[ceMC_name];
  444.    }
  445.    if(mc.OriginalMC == undefined)
  446.    {
  447.       mc.OriginalMC = {};
  448.       mc.OriginalMC._x = mc._x;
  449.       mc.OriginalMC._y = mc._y;
  450.       mc.OriginalMC._xscale = mc._xscale;
  451.       mc.OriginalMC._yscale = mc._yscale;
  452.       mc.OriginalMC._width = mc._width;
  453.    }
  454.    var fonction = p.fonction != undefined ? eval("InitMC_" + p.fonction) : InitMC_standart;
  455.    mc.InitMC = fonction;
  456.    InitMC_reccurent(mc);
  457.    mc.InitMC(p);
  458. }
  459. function InitMC_reccurent(mc)
  460. {
  461.    mc.oriX = mc._x;
  462.    mc.oriY = mc._y;
  463.    mc.oriW = mc._width;
  464.    mc.oriH = mc._height;
  465.    mc.BackToInitialPos = function()
  466.    {
  467.       this._x = this.oriX;
  468.       this._y = this.oriY;
  469.    };
  470.    mc.BackToInitialSize = function()
  471.    {
  472.       this._width = this.oriW;
  473.       this._height = this.oriH;
  474.    };
  475. }
  476. function ResetMC(p)
  477. {
  478.    var _loc1_ = p.mc;
  479.    delete _loc1_.onPress;
  480.    delete _loc1_.onRollOver;
  481.    delete _loc1_.onRollOut;
  482.    delete _loc1_.onRelease;
  483.    delete _loc1_.onReleaseOutside;
  484.    delete _loc1_.BTN.onPress;
  485.    delete _loc1_.BTN.onRollOver;
  486.    delete _loc1_.BTN.onRollOut;
  487.    delete _loc1_.BTN.onRelease;
  488.    delete _loc1_.BTN.onReleaseOutside;
  489. }
  490. function InitMC_standart(p)
  491. {
  492.    trace("InitMC_standart : " + InitMC_standart);
  493.    if(p.IB != undefined)
  494.    {
  495.       if(typeof p.IBrep == "movieclip")
  496.       {
  497.          var IBrepere = p.IBrep;
  498.       }
  499.       else if(typeof _MOD_["IBrep_" + p.IB] == "movieclip" && p.IBrep != false)
  500.       {
  501.          var IBrepere = _MOD_["IBrep_" + p.IB];
  502.       }
  503.       else
  504.       {
  505.          var IBrepere = p.mc;
  506.       }
  507.       this.afficheIB = function()
  508.       {
  509.          _root.gereTextes.afficheIB({codeIB:p.IB,mc:IBrepere});
  510.       };
  511.       this.masqueIB = function()
  512.       {
  513.          _root.gereTextes.masqueIB();
  514.       };
  515.    }
  516.    if(p.UseLabels != false)
  517.    {
  518.       this.reposFrame = p.reposFrame != undefined ? p.reposFrame : "E1";
  519.       this.pressFrame = p.pressFrame != undefined ? p.pressFrame : "E2";
  520.       this.overFrame = p.overFrame != undefined ? p.overFrame : "E2";
  521.       this.outFrame = p.outFrame != undefined ? p.outFrame : "E1";
  522.       this.releaseFrame = p.releaseFrame != undefined ? p.releaseFrame : "E1";
  523.       this.releaseOutFrame = p.releaseOutFrame != undefined ? p.releaseOutFrame : "E1";
  524.       this.activeFrame = p.activeFrame != undefined ? p.activeFrame : undefined;
  525.       this.desactiveFrame = p.desactiveFrame != undefined ? p.desactiveFrame : undefined;
  526.    }
  527.    if(p.reposFrame != undefined)
  528.    {
  529.       this.gotoAndStop(p.reposFrame);
  530.    }
  531.    this.p = p;
  532.    ┬º┬ºpush(this);
  533.    ┬º┬ºpush("joueson");
  534.    if(p.son == undefined)
  535.    {
  536.       ┬º┬ºpush(undefined);
  537.    }
  538.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  539.    ┬º┬ºpush(this);
  540.    ┬º┬ºpush("stopson");
  541.    if(p.nostop != undefined)
  542.    {
  543.       ┬º┬ºpush(undefined);
  544.    }
  545.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  546.    if(p.sonOnPress != undefined)
  547.    {
  548.       this.sonOnPress = p.sonOnPress;
  549.       this.sonOnPress_offset = p.sonOnPress_offset != undefined ? Number(p.sonOnPress_offset) : 0;
  550.       this.sonOnPress_loopSon = p.sonOnPress_loopSon != undefined ? Number(p.sonOnPress_loopSon) : 0;
  551.       this.jouesonOnPress = function()
  552.       {
  553.          joueBruitage({nomSon:this.sonOnPress,offset:this.sonOnPress_offset,loopSon:this.sonOnPress_loopSon});
  554.       };
  555.       this.stopsonOnPress = function()
  556.       {
  557.          stopBruitage({nomSon:this.sonOnPress});
  558.       };
  559.    }
  560.    else
  561.    {
  562.       this.jouesonOnMove = undefined;
  563.       this.stopsonOnMove = undefined;
  564.    }
  565.    this.UseHandCursor = p.useHandCursor != undefined ? p.useHandCursor : true;
  566.    if(p.UseCurseur != false)
  567.    {
  568.       this.curseur_after_press = p.goto != undefined ? "fleche" : "doigt";
  569.       this.curseur_on_roll = p.curseurOnRoll != undefined ? p.curseurOnRoll : "doigt";
  570.       this.curseur_onRollOut = p.curseur_onRollOut != undefined ? p.curseur_onRollOut : "fleche";
  571.       this.curseur_after_press = p.curseurAfterPress != undefined ? p.curseurAfterPress : "doigt";
  572.       this.curseur_onRelease = p.curseur_onRelease != undefined ? p.curseur_onRelease : "doigt";
  573.       this.curseur_onReleaseOutside = p.curseur_onReleaseOutside != undefined ? p.curseur_onReleaseOutside : "fleche";
  574.    }
  575.    this.goto = p.goto;
  576.    this.Activer = function()
  577.    {
  578.       if(this.Actif == true)
  579.       {
  580.          return undefined;
  581.       }
  582.       this.enabled = true;
  583.       this.BTN.enabled = true;
  584.       this.Actif = true;
  585.       this.gotoAndStop(this.activeFrame);
  586.    };
  587.    this.Desactiver = function()
  588.    {
  589.       if(this.Actif == false)
  590.       {
  591.          return undefined;
  592.       }
  593.       this.enabled = false;
  594.       this.BTN.enabled = false;
  595.       this.Actif = false;
  596.       this.stopsonOnPress();
  597.       this.masqueIB();
  598.       this.gotoAndStop(this.desactiveFrame);
  599.    };
  600.    this.SetUseHandCursor = function(flag)
  601.    {
  602.       this.UseHandCursor = flag;
  603.       this.useHandCursor = this.UseHandCursor;
  604.       this.BTN.useHandCursor = this.UseHandCursor;
  605.    };
  606.    this.Activer();
  607.    this.GS = this.gotoAndStop;
  608.    this.MConPress = function()
  609.    {
  610.       if(this.p.blockOnPress == true)
  611.       {
  612.          this.enabled = false;
  613.          this.BTN.enabled = false;
  614.       }
  615.       this.stopson();
  616.       this.jouesonOnPress();
  617.       this.masqueIB();
  618.       this.gotoAndStop(this.pressFrame);
  619.       gereCursor(this.curseur_after_press);
  620.       _root.gotoAndStop(this.goto);
  621.       var p = this.OnPress();
  622.    };
  623.    this.MConRollOver = function()
  624.    {
  625.       this.joueson();
  626.       this.afficheIB();
  627.       this.gotoAndStop(this.overFrame);
  628.       gereCursor(this.curseur_on_roll);
  629.       var _loc2_ = this.OnRollOver();
  630.    };
  631.    this.MConRollOut = function()
  632.    {
  633.       this.stopson();
  634.       this.masqueIB();
  635.       this.gotoAndStop(this.outFrame);
  636.       gereCursor(this.curseur_onRollOut);
  637.       var _loc2_ = this.OnRollOut();
  638.    };
  639.    this.MConRelease = function()
  640.    {
  641.       this.gotoAndStop(this.releaseFrame);
  642.       gereCursor(this.curseur_onRelease);
  643.       var _loc2_ = this.OnRelease();
  644.    };
  645.    this.MConReleaseOutside = function()
  646.    {
  647.       this.gotoAndStop(this.releaseOutFrame);
  648.       gereCursor(this.curseur_onReleaseOutside);
  649.       var _loc2_ = this.OnReleaseOutside();
  650.    };
  651.    if(this.BTN == undefined || p.BTN == false)
  652.    {
  653.       this.useHandCursor = this.UseHandCursor;
  654.       this.onPress = this.MConPress;
  655.       this.onRollOver = this.MConRollOver;
  656.       this.onRollOut = this.MConRollOut;
  657.       this.onRelease = this.MConRelease;
  658.       this.onReleaseOutside = this.MConReleaseOutside;
  659.    }
  660.    else
  661.    {
  662.       this.BTN.useHandCursor = this.UseHandCursor;
  663.       this.BTN.onPress = function()
  664.       {
  665.          this._parent.MConPress();
  666.       };
  667.       this.BTN.onRollOver = function()
  668.       {
  669.          this._parent.MConRollOver();
  670.       };
  671.       this.BTN.onRollOut = function()
  672.       {
  673.          this._parent.MConRollOut();
  674.       };
  675.       this.BTN.onRelease = function()
  676.       {
  677.          this._parent.MConRelease();
  678.       };
  679.       this.BTN.onReleaseOutside = function()
  680.       {
  681.          this._parent.MConReleaseOutside();
  682.       };
  683.    }
  684.    this.Refresh();
  685. }
  686. function InitMC_BTN(p)
  687. {
  688.    if(p.IB != undefined)
  689.    {
  690.       if(p.IBrep == true)
  691.       {
  692.          var IBrepere = _MOD_["IBrep_" + p.IB];
  693.       }
  694.       else
  695.       {
  696.          var IBrepere = p.mc;
  697.       }
  698.       this.afficheIB = function()
  699.       {
  700.          gereTextes.afficheIB({codeIB:p.IB,mc:IBrepere});
  701.       };
  702.       this.masqueIB = function()
  703.       {
  704.          gereTextes.masqueIB();
  705.       };
  706.    }
  707.    this.enabled = true;
  708.    ┬º┬ºpush(this);
  709.    ┬º┬ºpush("joueson");
  710.    if(p.son == undefined)
  711.    {
  712.       ┬º┬ºpush(undefined);
  713.    }
  714.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  715.    ┬º┬ºpush(this);
  716.    ┬º┬ºpush("stopson");
  717.    if(p.nostop != undefined)
  718.    {
  719.       ┬º┬ºpush(undefined);
  720.    }
  721.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  722.    var curseur_after_press = p.goto != undefined ? "fleche" : "doigt";
  723.    this.goto = p.goto;
  724.    this.BTN.onPress = function()
  725.    {
  726.       this._parent.stopson();
  727.       this._parent.masqueIB();
  728.       this._parent.gotoAndStop("E3");
  729.       gereCursor(curseur_after_press);
  730.       _root.gotoAndStop(this.goto);
  731.       var _loc3_ = this._parent.OnPress();
  732.    };
  733.    this.BTN.onRollOver = function()
  734.    {
  735.       this._parent.joueson();
  736.       this._parent.afficheIB();
  737.       this._parent.gotoAndStop("E2");
  738.       gereCursor("doigt");
  739.       var _loc2_ = this._parent.OnRollOver();
  740.    };
  741.    this.BTN.onRollOut = function()
  742.    {
  743.       this._parent.stopson();
  744.       this._parent.masqueIB();
  745.       this._parent.gotoAndStop("E1");
  746.       gereCursor("fleche");
  747.       var _loc2_ = this._parent.OnRollOut();
  748.    };
  749.    this.BTN.onRelease = function()
  750.    {
  751.       this._parent.gotoAndStop("E2");
  752.       gereCursor("doigt");
  753.       var _loc2_ = this._parent.OnRelease();
  754.    };
  755.    this.BTN.onReleaseOutside = function()
  756.    {
  757.       this._parent.gotoAndStop("E1");
  758.       gereCursor("fleche");
  759.       var _loc2_ = this._parent.OnReleaseOutside();
  760.    };
  761. }
  762. function InitMC_dragdrop(p)
  763. {
  764.    trace("InitMC_dragdrop_X");
  765.    if(p.IB != undefined)
  766.    {
  767.       if(p.IBrep == true)
  768.       {
  769.          var IBrepere = _MOD_["IBrep_" + p.IB];
  770.       }
  771.       else
  772.       {
  773.          var IBrepere = p.mc;
  774.       }
  775.       this.afficheIB = function()
  776.       {
  777.          _root.gereTextes.afficheIB({codeIB:p.IB,mc:IBrepere});
  778.       };
  779.       this.masqueIB = function()
  780.       {
  781.          _root.gereTextes.masqueIB();
  782.       };
  783.    }
  784.    this.BTN = typeof p.BTN != "movieclip" ? this.BTN : p.BTN;
  785.    this.pDepth = this.getDepth();
  786.    this.PressLevel = p.PressLevel != undefined ? p.PressLevel : 15832;
  787.    this.pressFrame = p.pressFrame != undefined ? p.pressFrame : "E3";
  788.    this.overFrame = p.overFrame != undefined ? p.overFrame : "E2";
  789.    this.CibleOverFrame = p.CibleOverFrame != undefined ? p.CibleOverFrame : "E3";
  790.    this.CibleOutFrame = p.CibleOutFrame != undefined ? p.CibleOutFrame : "E1";
  791.    ┬º┬ºpush(this);
  792.    ┬º┬ºpush("joueson");
  793.    if(p.son == undefined)
  794.    {
  795.       ┬º┬ºpush(undefined);
  796.    }
  797.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  798.    ┬º┬ºpush(this);
  799.    ┬º┬ºpush("stopson");
  800.    if(p.son == undefined)
  801.    {
  802.       ┬º┬ºpush(undefined);
  803.    }
  804.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  805.    ┬º┬ºpush(this);
  806.    ┬º┬ºpush("jouesonOnPress");
  807.    if(p.sonOnPress == undefined)
  808.    {
  809.       ┬º┬ºpush(undefined);
  810.    }
  811.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  812.    ┬º┬ºpush(this);
  813.    ┬º┬ºpush("stopsonOnPress");
  814.    if(p.sonOnPress == undefined)
  815.    {
  816.       ┬º┬ºpush(undefined);
  817.    }
  818.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  819.    ┬º┬ºpush(this);
  820.    ┬º┬ºpush("jouesonOnOverCible");
  821.    if(p.sonOnOverCible == undefined)
  822.    {
  823.       ┬º┬ºpush(undefined);
  824.    }
  825.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  826.    ┬º┬ºpush(this);
  827.    ┬º┬ºpush("stopsonOnOverCible");
  828.    if(p.sonOnOverCible == undefined)
  829.    {
  830.       ┬º┬ºpush(undefined);
  831.    }
  832.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  833.    var _loc16_ = p.goto != undefined ? "fleche" : "doigt";
  834.    this.goto = p.goto;
  835.    this.ModeDrag = p.ModeDrag != undefined ? p.ModeDrag : "lache_au_rollout";
  836.    this.CentrerOnStartDrag = p.CentrerOnStartDrag != undefined ? p.CentrerOnStartDrag : false;
  837.    this.ModeHitTest = p.ModeHitTest != undefined ? p.ModeHitTest : "bounds";
  838.    this.ZoneDragLimites = p.ZoneDragLimites != undefined ? p.ZoneDragLimites : {x:0,y:0,w:800,h:600};
  839.    this.MethodeDetecteDrag = this.ModeHitTest != "mouse" ? "DetectDrag" : "DetectDrag2";
  840.    this.DragEnCours = false;
  841.    this.DetectDrag = function()
  842.    {
  843.       this._x = _xmouse - this.ecart_mousex;
  844.       this._y = _ymouse - this.ecart_mousey;
  845.       if(this._x < this.ZoneDragLimites.x)
  846.       {
  847.          this._x = this.ZoneDragLimites.x;
  848.       }
  849.       if(this._x > this.ZoneDragLimites.x + this.ZoneDragLimites.w)
  850.       {
  851.          this._x = this.ZoneDragLimites.x + this.ZoneDragLimites.w;
  852.       }
  853.       if(this._y < this.ZoneDragLimites.y)
  854.       {
  855.          this._y = this.ZoneDragLimites.y;
  856.       }
  857.       if(this._y > this.ZoneDragLimites.y + this.ZoneDragLimites.h)
  858.       {
  859.          this._y = this.ZoneDragLimites.y + this.ZoneDragLimites.h;
  860.       }
  861.       this.CiblesTouchees = [];
  862.       var _loc2_ = 0;
  863.       while(_loc2_ < this.CiblesDrag.length)
  864.       {
  865.          if(this.hitTest(this.CiblesDrag[_loc2_]))
  866.          {
  867.             this.CiblesDrag[_loc2_].gotoAndStop(this.CibleOverFrame);
  868.             this.CiblesTouchees.push(this.CiblesDrag[_loc2_]);
  869.             this.touche = this.touche + 1;
  870.          }
  871.          else
  872.          {
  873.             this.CiblesDrag[_loc2_].gotoAndStop(this.CibleOutFrame);
  874.          }
  875.          _loc2_ = _loc2_ + 1;
  876.       }
  877.       if(this.touche == 1)
  878.       {
  879.          this.jouesonOnOverCible();
  880.       }
  881.       if(this.CiblesTouchees.length <= 0)
  882.       {
  883.          this.touche = 0;
  884.          this.stopsonOnOverCible();
  885.       }
  886.       this.PendantDrag();
  887.       updateAfterEvent();
  888.    };
  889.    this.DetectDrag2 = function()
  890.    {
  891.       this._x = _xmouse - this.ecart_mousex;
  892.       this._y = _ymouse - this.ecart_mousey;
  893.       this.CiblesTouchees = [];
  894.       var _loc2_ = 0;
  895.       while(_loc2_ < this.CiblesDrag.length)
  896.       {
  897.          if(this.CiblesDrag[_loc2_].hitTest(_xmouse,_ymouse,true))
  898.          {
  899.             this.CiblesDrag[_loc2_].gotoAndStop(this.CibleOverFrame);
  900.             this.CiblesTouchees.push(this.CiblesDrag[_loc2_]);
  901.             this.touche = this.touche + 1;
  902.          }
  903.          else
  904.          {
  905.             this.CiblesDrag[_loc2_].gotoAndStop(this.CibleOutFrame);
  906.          }
  907.          _loc2_ = _loc2_ + 1;
  908.       }
  909.       if(this.touche == 1)
  910.       {
  911.          this.jouesonOnOverCible();
  912.       }
  913.       if(this.CiblesTouchees.length <= 0)
  914.       {
  915.          this.touche = 0;
  916.          this.stopsonOnOverCible();
  917.       }
  918.       this.PendantDrag();
  919.       updateAfterEvent();
  920.    };
  921.    this.StartDrag = function()
  922.    {
  923.       if(this.CentrerOnStartDrag != true)
  924.       {
  925.          this.ecart_mousex = _xmouse - this._x;
  926.          this.ecart_mousey = _ymouse - this._y;
  927.       }
  928.       else
  929.       {
  930.          this._x = _xmouse;
  931.          this._y = _ymouse;
  932.          this.ecart_mousex = _xmouse - this._x;
  933.          this.ecart_mousey = _ymouse - this._y;
  934.       }
  935.       this.IntervalId = _global.SetInterval({mcRef:this,methode:this.MethodeDetecteDrag,interval:10});
  936.       this.swapDepths(this.PressLevel);
  937.       this.DragEnCours = true;
  938.    };
  939.    this.ContinueDrag = function()
  940.    {
  941.       this.gotoAndStop(this.pressFrame);
  942.       gereCursor("mainF");
  943.       this.ecart_mousex = _xmouse - this._x;
  944.       this.ecart_mousey = _ymouse - this._y;
  945.       if(this.IntervalId != undefined)
  946.       {
  947.          _global.ClearInterval(this.IntervalId);
  948.       }
  949.       this.IntervalId = _global.SetInterval({mcRef:this,methode:this.MethodeDetecteDrag,interval:10});
  950.       this.swapDepths(this.PressLevel);
  951.       this.DragEnCours = true;
  952.    };
  953.    this.StopDrag = function()
  954.    {
  955.       _global.ClearInterval(this.IntervalId);
  956.       this.swapDepths(this.pDepth);
  957.       this.DragEnCours = false;
  958.    };
  959.    this.ComeBack = function()
  960.    {
  961.       this._x = this.xOri;
  962.       this._y = this.yOri;
  963.       this.gotoAndStop("E1");
  964.       this.DragEnCours = false;
  965.    };
  966.    this.Activer = function()
  967.    {
  968.       this.enabled = true;
  969.       this.BTN.enabled = true;
  970.    };
  971.    this.Desactiver = function()
  972.    {
  973.       this.enabled = false;
  974.       this.BTN.enabled = false;
  975.    };
  976.    this.CibleLaPlusProche = function(p)
  977.    {
  978.       if(this.CiblesTouchees.length == 0)
  979.       {
  980.          return null;
  981.       }
  982.       var _loc3_ = undefined;
  983.       var _loc9_ = this.CiblesTouchees[0];
  984.       var _loc8_ = undefined;
  985.       var _loc6_ = undefined;
  986.       if(p.mcRef == undefined)
  987.       {
  988.          _loc8_ = _xmouse;
  989.          _loc6_ = _ymouse;
  990.       }
  991.       else if(p.mcRef == "center")
  992.       {
  993.          _loc8_ = this._x + this._width / 2;
  994.          _loc6_ = this._y + this._height / 2;
  995.       }
  996.       else
  997.       {
  998.          var _loc10_ = new flash.geom.Point(p.mcRef._x,p.mcRef._y);
  999.          mcRef.localToGlobal(_loc10_);
  1000.          _loc8_ = _loc10_.x;
  1001.          _loc6_ = _loc10_.y;
  1002.       }
  1003.       var _loc4_ = DistancePoints({x1:_loc8_,y1:_loc6_,x2:this.CiblesTouchees[0]._x,y2:this.CiblesTouchees[0]._y});
  1004.       var _loc2_ = 1;
  1005.       while(_loc2_ < this.CiblesTouchees.length)
  1006.       {
  1007.          _loc3_ = DistancePoints({x1:_loc8_,y1:_loc6_,x2:this.CiblesTouchees[_loc2_]._x,y2:this.CiblesTouchees[_loc2_]._y});
  1008.          trace(this.CiblesTouchees[_loc2_] + " - " + _loc3_);
  1009.          if(_loc3_ < _loc4_)
  1010.          {
  1011.             _loc4_ = _loc3_;
  1012.             _loc9_ = this.CiblesTouchees[_loc2_];
  1013.          }
  1014.          _loc2_ = _loc2_ + 1;
  1015.       }
  1016.       trace("primo : " + _loc9_);
  1017.       return _loc9_;
  1018.    };
  1019.    this.MConPress = function()
  1020.    {
  1021.       if(this.ModeDrag == "lache_au_clic" && this.DragEnCours == true)
  1022.       {
  1023.          this.FirstPress = false;
  1024.          this.DragEnCours = false;
  1025.          gereCursor("mainO");
  1026.          this.stopsonOnPress();
  1027.          this.gotoAndStop("E2");
  1028.          _global.ClearInterval(this.IntervalId);
  1029.          this.CiblesTouchees = [];
  1030.          if(this.ModeHitTest == "mouse")
  1031.          {
  1032.             var _loc3_ = 0;
  1033.             while(_loc3_ < this.CiblesDrag.length)
  1034.             {
  1035.                if(this.CiblesDrag[_loc3_].hitTest(_xmouse,_ymouse,true))
  1036.                {
  1037.                   this.CiblesTouchees.push(this.CiblesDrag[_loc3_]);
  1038.                }
  1039.                _loc3_ = _loc3_ + 1;
  1040.             }
  1041.          }
  1042.          else
  1043.          {
  1044.             _loc3_ = 0;
  1045.             while(_loc3_ < this.CiblesDrag.length)
  1046.             {
  1047.                if(this.hitTest(this.CiblesDrag[_loc3_]))
  1048.                {
  1049.                   this.CiblesTouchees.push(this.CiblesDrag[_loc3_]);
  1050.                }
  1051.                _loc3_ = _loc3_ + 1;
  1052.             }
  1053.          }
  1054.          this.swapDepths(this.pDepth);
  1055.          this.ApresDrag();
  1056.       }
  1057.       else
  1058.       {
  1059.          this.FirstPress = true;
  1060.          this.jouesonOnPress();
  1061.          this.xOri = this._x;
  1062.          this.yOri = this._y;
  1063.          this.masqueIB();
  1064.          this.gotoAndStop(this.pressFrame);
  1065.          gereCursor("mainF");
  1066.          this.StartDrag();
  1067.          var _loc4_ = this.OnPress();
  1068.       }
  1069.    };
  1070.    this.MConRollOver = function()
  1071.    {
  1072.       if(this.DragEnCours == true)
  1073.       {
  1074.          return undefined;
  1075.       }
  1076.       this.joueson();
  1077.       this.afficheIB();
  1078.       this.gotoAndStop(this.overFrame);
  1079.       gereCursor("mainO");
  1080.       var _loc2_ = this.OnRollOver();
  1081.    };
  1082.    this.MConRollOut = function()
  1083.    {
  1084.       if(this.DragEnCours == true)
  1085.       {
  1086.          return undefined;
  1087.       }
  1088.       this.stopson();
  1089.       this.gotoAndStop("E1");
  1090.       this.masqueIB();
  1091.       gereCursor("fleche");
  1092.       var _loc2_ = this.OnRollOut();
  1093.    };
  1094.    this.MConRelease = function()
  1095.    {
  1096.       if(this.ModeDrag != "lache_au_rollout")
  1097.       {
  1098.          return undefined;
  1099.       }
  1100.       this.DragEnCours = false;
  1101.       gereCursor("mainO");
  1102.       this.stopsonOnPress();
  1103.       this.gotoAndStop("E2");
  1104.       _global.ClearInterval(this.IntervalId);
  1105.       this.CiblesTouchees = [];
  1106.       if(this.ModeHitTest == "mouse")
  1107.       {
  1108.          var _loc3_ = 0;
  1109.          while(_loc3_ < this.CiblesDrag.length)
  1110.          {
  1111.             if(this.CiblesDrag[_loc3_].hitTest(_xmouse,_ymouse,true))
  1112.             {
  1113.                this.CiblesTouchees.push(this.CiblesDrag[_loc3_]);
  1114.             }
  1115.             _loc3_ = _loc3_ + 1;
  1116.          }
  1117.       }
  1118.       else
  1119.       {
  1120.          _loc3_ = 0;
  1121.          while(_loc3_ < this.CiblesDrag.length)
  1122.          {
  1123.             if(this.hitTest(this.CiblesDrag[_loc3_]))
  1124.             {
  1125.                this.CiblesTouchees.push(this.CiblesDrag[_loc3_]);
  1126.             }
  1127.             _loc3_ = _loc3_ + 1;
  1128.          }
  1129.       }
  1130.       this.swapDepths(this.pDepth);
  1131.       this.ApresDrag();
  1132.       var _loc4_ = this.OnRelease();
  1133.    };
  1134.    this.MConReleaseOutside = this.MConRelease;
  1135.    if(this.BTN == undefined || p.BTN == false)
  1136.    {
  1137.       this.onPress = this.MConPress;
  1138.       this.onRollOver = this.MConRollOver;
  1139.       this.onRollOut = this.MConRollOut;
  1140.       this.onRelease = this.MConRelease;
  1141.       this.onReleaseOutside = this.MConReleaseOutside;
  1142.    }
  1143.    else
  1144.    {
  1145.       this.BTN.onPress = function()
  1146.       {
  1147.          this._parent.MConPress();
  1148.       };
  1149.       this.BTN.onRollOver = function()
  1150.       {
  1151.          this._parent.MConRollOver();
  1152.       };
  1153.       this.BTN.onRollOut = function()
  1154.       {
  1155.          this._parent.MConRollOut();
  1156.       };
  1157.       this.BTN.onRelease = function()
  1158.       {
  1159.          this._parent.MConRelease();
  1160.       };
  1161.       this.BTN.onReleaseOutside = function()
  1162.       {
  1163.          this._parent.MConReleaseOutside();
  1164.       };
  1165.    }
  1166. }
  1167. function InitMC_slider(p)
  1168. {
  1169.    if(p.IB != undefined)
  1170.    {
  1171.       if(p.IBrep == true)
  1172.       {
  1173.          var IBrepere = _MOD_["IBrep_" + p.IB];
  1174.       }
  1175.       else
  1176.       {
  1177.          var IBrepere = p.mc;
  1178.       }
  1179.       this.afficheIB = function()
  1180.       {
  1181.          gereTextes.afficheIB({codeIB:p.IB,mc:IBrepere});
  1182.       };
  1183.       this.masqueIB = function()
  1184.       {
  1185.          gereTextes.masqueIB();
  1186.       };
  1187.    }
  1188.    ┬º┬ºpush(this);
  1189.    ┬º┬ºpush("joueson");
  1190.    if(p.son == undefined)
  1191.    {
  1192.       ┬º┬ºpush(undefined);
  1193.    }
  1194.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  1195.    ┬º┬ºpush(this);
  1196.    ┬º┬ºpush("stopson");
  1197.    if(p.son == undefined)
  1198.    {
  1199.       ┬º┬ºpush(undefined);
  1200.    }
  1201.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  1202.    var _loc7_ = p.goto != undefined ? "fleche" : "doigt";
  1203.    this.goto = p.goto;
  1204.    this.EnMouvement = false;
  1205.    if(p.sonOnMove != undefined)
  1206.    {
  1207.       this.sonOnMove = p.sonOnMove;
  1208.       this.sonOnMove_offset = p.sonOnMove_offset != undefined ? Number(p.sonOnMove_offset) : 0;
  1209.       this.sonOnMove_loopSon = p.sonOnMove_loopSon != undefined ? Number(p.sonOnMove_loopSon) : 0;
  1210.       this.jouesonOnMove = function()
  1211.       {
  1212.          joueBruitage({nomSon:this.sonOnMove,offset:this.sonOnMove_offset,loopSon:this.sonOnMove_loopSon});
  1213.       };
  1214.       this.stopsonOnMove = function()
  1215.       {
  1216.          stopBruitage({nomSon:this.sonOnMove});
  1217.       };
  1218.    }
  1219.    else
  1220.    {
  1221.       this.jouesonOnMove = undefined;
  1222.       this.stopsonOnMove = undefined;
  1223.    }
  1224.    if(p.sonOnPress != undefined)
  1225.    {
  1226.       this.sonOnPress = p.sonOnPress;
  1227.       this.sonOnPress_offset = p.sonOnPress_offset != undefined ? Number(p.sonOnPress_offset) : 0;
  1228.       this.sonOnPress_loopSon = p.sonOnPress_loopSon != undefined ? Number(p.sonOnPress_loopSon) : 0;
  1229.       this.jouesonOnPress = function()
  1230.       {
  1231.          joueBruitage({nomSon:this.sonOnPress,offset:this.sonOnPress_offset,loopSon:this.sonOnPress_loopSon});
  1232.       };
  1233.       this.stopsonOnPress = function()
  1234.       {
  1235.          stopBruitage({nomSon:this.sonOnPress});
  1236.       };
  1237.    }
  1238.    else
  1239.    {
  1240.       this.jouesonOnMove = undefined;
  1241.       this.stopsonOnMove = undefined;
  1242.    }
  1243.    this.DragZoneLargeur = p.DragZoneLargeur != undefined ? p.DragZoneLargeur : 0;
  1244.    this.DragZoneHauteur = p.DragZoneHauteur != undefined ? p.DragZoneHauteur : 0;
  1245.    this.DragZoneLargeur_pourcent = p.DragZoneLargeur / 100;
  1246.    this.DragZoneHauteur_pourcent = p.DragZoneHauteur / 100;
  1247.    this.DragZone = {left:this._x,right:this._x + this.DragZoneLargeur,top:this._y,bottom:this._y + this.DragZoneHauteur};
  1248.    this.Activer = function()
  1249.    {
  1250.       this.enabled = true;
  1251.    };
  1252.    this.Desactiver = function()
  1253.    {
  1254.       this.enabled = false;
  1255.    };
  1256.    this.SetPosition = this.SetPositionX = function(pourcent)
  1257.    {
  1258.       this._x = this.DragZone.left + this.DragZoneLargeur_pourcent * pourcent;
  1259.    };
  1260.    this.SetPositionY = function(pourcent)
  1261.    {
  1262.       this._y = this.DragZone.top + this.DragZoneHauteur_pourcent * pourcent;
  1263.    };
  1264.    this.GetPosition = this.GetPositionX = function()
  1265.    {
  1266.       return (this._x - this.DragZone.left) / this.DragZoneLargeur_pourcent;
  1267.    };
  1268.    this.GetPositionY = function()
  1269.    {
  1270.       return (this._y - this.DragZone.top) / this.DragZoneHauteur_pourcent;
  1271.    };
  1272.    this.DetectDrag = function()
  1273.    {
  1274.       this._x = _root._xmouse - this.ecart_mousex;
  1275.       this._y = _root._ymouse - this.ecart_mousey;
  1276.       if(this._x <= this.DragZone.left)
  1277.       {
  1278.          this._x = this.DragZone.left;
  1279.       }
  1280.       if(this._y < this.DragZone.top)
  1281.       {
  1282.          this._y = this.DragZone.top;
  1283.       }
  1284.       if(this._x >= this.DragZone.right)
  1285.       {
  1286.          this._x = this.DragZone.right;
  1287.       }
  1288.       if(this._y > this.DragZone.bottom)
  1289.       {
  1290.          this._y = this.DragZone.bottom;
  1291.       }
  1292.       updateAfterEvent();
  1293.       if(this._x == this.lastx && this._y == this.lasty)
  1294.       {
  1295.          if(this.EnMouvement == true)
  1296.          {
  1297.             this.EnMouvement = false;
  1298.             this.stopsonOnMove();
  1299.          }
  1300.       }
  1301.       else if(this.EnMouvement == false)
  1302.       {
  1303.          this.EnMouvement = true;
  1304.          this.jouesonOnMove();
  1305.       }
  1306.       this.lastx = this._x;
  1307.       this.lasty = this._y;
  1308.       this.PendantSlide();
  1309.    };
  1310.    this.StartDrag = function()
  1311.    {
  1312.       this.ecart_mousex = _root._xmouse - this._x;
  1313.       this.ecart_mousey = _root._ymouse - this._y;
  1314.       this.lastx = this._x;
  1315.       this.lasty = this._y;
  1316.       this.IntervalId = _global.SetInterval({mcRef:this,methode:"DetectDrag",interval:1});
  1317.    };
  1318.    this.onPress = function()
  1319.    {
  1320.       this.jouesonOnPress();
  1321.       this.masqueIB();
  1322.       this.gotoAndStop("E3");
  1323.       gereCursor("mainF");
  1324.       this.StartDrag();
  1325.       var _loc2_ = this.OnPress();
  1326.    };
  1327.    this.onRollOver = function()
  1328.    {
  1329.       this.joueson();
  1330.       this.afficheIB();
  1331.       this.gotoAndStop("E2");
  1332.       gereCursor("mainO");
  1333.       var _loc2_ = this.OnRollOver();
  1334.    };
  1335.    this.onRollOut = function()
  1336.    {
  1337.       this.stopson();
  1338.       this.stopsonOnPress();
  1339.       this.stopsonOnMove();
  1340.       this.gotoAndStop("E1");
  1341.       this.masqueIB();
  1342.       gereCursor("fleche");
  1343.       var _loc2_ = this.OnRollOut();
  1344.    };
  1345.    this.onRelease = function()
  1346.    {
  1347.       this.gotoAndStop("E2");
  1348.       _global.ClearInterval(this.IntervalId);
  1349.       this.stopson();
  1350.       this.stopsonOnPress();
  1351.       this.stopsonOnMove();
  1352.       gereCursor("mainO");
  1353.       var _loc3_ = this.OnRelease();
  1354.    };
  1355.    this.onReleaseOutside = function()
  1356.    {
  1357.       this.onRelease();
  1358.       gereCursor("fleche");
  1359.       var _loc2_ = this.OnReleaseOutside();
  1360.    };
  1361. }
  1362. function InitMC_titre(p)
  1363. {
  1364.    this.LMaVider = [];
  1365.    this.offsetx = p.offsetx != undefined ? Number(p.offsetx) : 0;
  1366.    this.offsety = p.offsety != undefined ? Number(p.offsety) : 0;
  1367.    this.ChangeTexte = function(p)
  1368.    {
  1369.       this.viderLM();
  1370.       _root.gereTextes.afficheLM({codeLM:p.codeLM,X:this._x + this.offsetx,Y:this._y + this.offsety,width:this._width,height:this._height});
  1371.       this.LMaVider.push(p);
  1372.    };
  1373.    this.viderLM = function()
  1374.    {
  1375.       var _loc3_ = 0;
  1376.       while(_loc3_ < this.LMaVider.length)
  1377.       {
  1378.          _root.gereTextes.masqueLM(this.LMaVider[_loc3_]);
  1379.          _loc3_ = _loc3_ + 1;
  1380.       }
  1381.    };
  1382. }
  1383. function InitMC_texte(p)
  1384. {
  1385.    trace("InitMC_titre()");
  1386.    xlisteObj(p);
  1387.    this.LMaVider = [];
  1388.    this.pere = p.pere != undefined ? Number(p.pere) : _root;
  1389.    this.offsetx = p.offsetx != undefined ? Number(p.offsetx) : 0;
  1390.    this.offsety = p.offsety != undefined ? Number(p.offsety) : 0;
  1391.    this.level = p.level != undefined ? Number(p.level) : this.pere.getNextHighestDepth();
  1392.    this.texte = p.texte != undefined ? p.texte : "";
  1393.    this.MC = p.mc;
  1394.    this.MC._visible = false;
  1395.    if(p.style == undefined)
  1396.    {
  1397.       this.Style = {};
  1398.    }
  1399.    else
  1400.    {
  1401.       this.Style = p.style;
  1402.    }
  1403.    this.Style.multiline = this.Style.multiline != undefined ? this.Style.multiline : true;
  1404.    this.Style.wordWrap = this.Style.wordWrap != undefined ? this.Style.wordWrap : true;
  1405.    this.Style.border = this.Style.border != undefined ? this.Style.border : false;
  1406.    this.Style.color = this.Style.color != undefined ? this.Style.color : 16711680;
  1407.    this.Style.size = this.Style.size != undefined ? this.Style.size : 12;
  1408.    this.Style.font = this.Style.font != undefined ? this.Style.font : "Comic Sans MS";
  1409.    this.Style.align = this.Style.align != undefined ? this.Style.align : "center";
  1410.    this.Style.underline = this.Style.underline != undefined ? this.Style.underline : false;
  1411.    this.Style.selectable = this.Style.selectable != undefined ? this.Style.selectable : false;
  1412.    var _loc4_ = this.pere.createTextField(this.MC._name + "_txt",this.level,this.MC._x,this.MC._y,this.MC._width,this.MC._height);
  1413.    _loc4_.multiline = this.Style.multiline;
  1414.    _loc4_.wordWrap = this.Style.wordWrap;
  1415.    _loc4_.border = this.Style.border;
  1416.    _loc4_.selectable = this.Style.selectable;
  1417.    _loc4_.embedFonts = true;
  1418.    var my_fmt = new TextFormat();
  1419.    my_fmt.font = this.Style.font;
  1420.    my_fmt.size = this.Style.size;
  1421.    my_fmt.color = this.Style.color;
  1422.    my_fmt.align = this.Style.align;
  1423.    my_fmt.underline = this.Style.underline;
  1424.    _loc4_.text = this.texte;
  1425.    _loc4_.setTextFormat(my_fmt);
  1426.    this.TexteMC = _loc4_;
  1427.    this.ChangeTexte = function(p)
  1428.    {
  1429.       this.texte = p.texte;
  1430.       this.TexteMC.text = p.texte;
  1431.       this.TexteMC.setTextFormat(my_fmt);
  1432.    };
  1433. }
  1434. function TexteFxGo(p)
  1435. {
  1436.    trace("TexteFxGo");
  1437.    var _loc15_ = p.vitesse != undefined ? Number(p.vitesse) : 50;
  1438.    var _loc4_ = _root.moduleInfo.returnNodeByPath("Module.StylesTextes.StylesLM");
  1439.    var _loc14_ = _root.moduleInfo.returnNodeByPath("Module." + _root.gLangue + ".LegendesMedias");
  1440.    var _loc13_ = {};
  1441.    var _loc17_ = p.texte;
  1442.    _loc17_ = _root.gereTextes.getTextById(_loc14_,"LM00");
  1443.    var texte_arr = ExplodeString(_loc17_);
  1444.    var cible = p.mc;
  1445.    var no_lettre = 0;
  1446.    var texte_up = "";
  1447.    var _loc9_ = [];
  1448.    var retour_func = p.retour;
  1449.    var _loc11_ = "LM00";
  1450.    var _loc10_ = "LM";
  1451.    var _loc22_ = 0;
  1452.    gFmtBase = new TextFormat();
  1453.    var _loc8_ = new XML();
  1454.    var _loc20_ = "00";
  1455.    var _loc3_ = 0;
  1456.    while(_loc3_ < _loc4_.childNodes.length)
  1457.    {
  1458.       if(_loc4_.childNodes[_loc3_].attributes.id == _loc10_)
  1459.       {
  1460.          var _loc7_ = 0;
  1461.          while(_loc7_ < _loc4_.childNodes[_loc3_].childNodes.length)
  1462.          {
  1463.             var _loc6_ = _loc4_.childNodes[_loc3_].childNodes[_loc7_].nodeName;
  1464.             var _loc5_ = _loc4_.childNodes[_loc3_].childNodes[_loc7_].firstChild.nodeValue;
  1465.             _loc9_[_loc6_] = _loc5_;
  1466.             _loc7_ = _loc7_ + 1;
  1467.          }
  1468.       }
  1469.       else
  1470.       {
  1471.          if(_loc4_.childNodes[_loc3_].attributes.id == _loc11_)
  1472.          {
  1473.             _loc8_ = _loc4_.childNodes[_loc3_];
  1474.             break;
  1475.          }
  1476.          if(_loc4_.childNodes[_loc3_].attributes.id == myStyle)
  1477.          {
  1478.             _loc8_ = _loc4_.childNodes[_loc3_];
  1479.             break;
  1480.          }
  1481.       }
  1482.       _loc3_ = _loc3_ + 1;
  1483.    }
  1484.    if(_loc8_.childNodes.length !== 0)
  1485.    {
  1486.       _loc7_ = 0;
  1487.       while(_loc7_ < _loc8_.childNodes.length)
  1488.       {
  1489.          _loc6_ = _loc8_.childNodes[_loc7_].nodeName;
  1490.          _loc5_ = _loc8_.childNodes[_loc7_].firstChild.nodeValue;
  1491.          _loc9_[_loc6_] = _loc5_;
  1492.          _loc7_ = _loc7_ + 1;
  1493.       }
  1494.    }
  1495.    trace(texte_arr);
  1496.    trace(_loc9_);
  1497.    InitMC({mc:p.mc,fonction:"texte",texte:"",style:{align:_loc9_.justify,size:_loc9_.corps,color:_loc9_.couleurT,font:_loc9_.police}});
  1498.    _loc13_.Boucle = function()
  1499.    {
  1500.       texte_up += texte_arr[no_lettre];
  1501.       cible.ChangeTexte({texte:texte_up});
  1502.       no_lettre++;
  1503.       if(texte_arr[no_lettre] == undefined)
  1504.       {
  1505.          clearInterval(this.BoucleID);
  1506.          retour_func.call();
  1507.       }
  1508.    };
  1509.    _loc13_.BoucleID = setInterval(_loc13_,"Boucle",_loc15_);
  1510. }
  1511. function Liste(p)
  1512. {
  1513.    var _loc1_ = new xb.classes.Liste(p);
  1514.    return _loc1_;
  1515. }
  1516. function CompteurTemps(p)
  1517. {
  1518.    var _loc1_ = new xb.classes.CompteurTemps(p);
  1519.    return _loc1_;
  1520. }
  1521. _global.DistancePoints = DistancePoints;
  1522. _global.SetInterval = SetInterval;
  1523. _global.ClearInterval = ClearInterval;
  1524. _global.ClearAllIntervals = ClearAllIntervals;
  1525. _root.ExecuterApresDelaiNo = 0;
  1526. _global.ExecuterApresDelai = ExecuterApresDelai;
  1527. _global.LMaVider = new Array();
  1528. _global.LMaVider2 = new Array();
  1529. _global.InitMC = InitMC;
  1530. _global.InitMC_reccurent = InitMC_reccurent;
  1531. _global.ResetMC = ResetMC;
  1532. _global.InitMC_standart = InitMC_standart;
  1533. _global.InitMC_BTN = InitMC_BTN;
  1534. _global.InitMC_dragdrop = InitMC_dragdrop;
  1535. _global.InitMC_slider = InitMC_slider;
  1536. _global.InitMC_titre = InitMC_titre;
  1537. _global.InitMC_texte = InitMC_texte;
  1538. MovieClip.prototype._xlib1_ = this;
  1539. _global.IncString = IncString;
  1540. _global.DecString = DecString;
  1541. _global.GetFilePath = GetFilePath;
  1542. _global.AntiSlashToSlash = AntiSlashToSlash;
  1543. _global.str_replace = str_replace;
  1544. _global.JoindreObjets = JoindreObjets;
  1545. _global.xGetConfig = xGetConfig;
  1546. _global.GetOriginalSize = GetOriginalSize;
  1547. _global.GetOriginalHeight = GetOriginalHeight;
  1548. _global.CreerCache = CreerCache;
  1549. _global.ConvertCoord = ConvertCoord;
  1550. _global.getGlobalCoord = getGlobalCoord;
  1551. _global.getLocalCoord = getLocalCoord;
  1552. _global.length_ass = length_ass;
  1553. _global.ExplodeString = ExplodeString;
  1554. _global.BloquerActives = BloquerActives;
  1555. _global.DebloquerActives = DebloquerActives;
  1556. _global.afficheLM_x = afficheLM_x;
  1557. _global.viderLM_x = viderLM_x;
  1558. _global.afficheLM_x2 = afficheLM_x2;
  1559. _global.viderLM_x2 = viderLM_x2;
  1560.