home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 136 / MOBICLIC136.ISO / pc / DATA / BLA136 / BLA136_05 / BLA136_05.swf / scripts / frame_13 / DoAction.as
Text File  |  2011-07-20  |  5KB  |  163 lines

  1. function testeSWF_fin()
  2. {
  3.    if(gAnimSwf._currentframe == gAnimSwf._totalframes)
  4.    {
  5.       if(gFin == 1)
  6.       {
  7.          gotoAndStop("fin_anim");
  8.          gAnimSwf.anim.stop();
  9.          BT_PLAY.pDepth = BT_PLAY.getDepth();
  10.          BT_PLAY.swapDepths(this.getNextHighestDepth());
  11.          BT_PLAY.onRollOver = function()
  12.          {
  13.             gereCursor(2);
  14.          };
  15.          BT_PLAY.onRollOut = function()
  16.          {
  17.             gereCursor(1);
  18.          };
  19.          BT_PLAY.onPress = function()
  20.          {
  21.             gereCursor(1);
  22.             gFin = 0;
  23.             this.swapDepths(this.pDepth);
  24.             gAnimSwf._visible = 0;
  25.             gAnim = 1;
  26.             gotoAndStop("relance_anim");
  27.             play();
  28.          };
  29.          BT_PLAY._visible = true;
  30.       }
  31.       else
  32.       {
  33.          animSuivante();
  34.       }
  35.       clearInterval(intervalID);
  36.    }
  37. }
  38. BT_PLAY._visible = false;
  39. gListLM = [];
  40. gListeBruitages = [];
  41. gListeFrameBruitage = [];
  42. gListeNameBruitage = [];
  43. if(gAnim <= gNbAnim)
  44. {
  45.    if(gAnim == gNbAnim)
  46.    {
  47.       gFin = 1;
  48.    }
  49.    gPriorite = animNode.childNodes[gAnim - 1].attributes.priorite;
  50.    trace(gPriorite);
  51.    gAttenteClic = animNode.childNodes[gAnim - 1].attributes.attenteClic;
  52.    trace(gAttenteClic);
  53.    trace("ANIMNODE " + animNode);
  54.    var h = 0;
  55.    for(; h < animNode.childNodes[gAnim - 1].childNodes.length; h++)
  56.    {
  57.       switch(animNode.childNodes[gAnim - 1].childNodes[h].attributes.type)
  58.       {
  59.          case "swf":
  60.             gAnimSwf = this.swfStocker[animNode.childNodes[gAnim - 1].childNodes[h].attributes.id];
  61.             trace("AN " + animNode.childNodes[gAnim - 1].childNodes[h]);
  62.             trace("ID " + this.swfStocker[animNode.childNodes[gAnim - 1].childNodes[h].attributes.id]);
  63.             trace("gAnimSwf " + gAnimSwf);
  64.             gAnimSwf.gotoAndPlay(1);
  65.             gAnimSwf.anim.gotoAndPlay(1);
  66.             lX = animNode.childNodes[gAnim - 1].childNodes[h].attributes.x;
  67.             if(lX !== undefined)
  68.             {
  69.                posX = Number(lX);
  70.             }
  71.             else
  72.             {
  73.                posX = 0;
  74.             }
  75.             lY = animNode.childNodes[gAnim - 1].childNodes[h].attributes.y;
  76.             if(lY !== undefined)
  77.             {
  78.                posY = Number(lY);
  79.             }
  80.             else
  81.             {
  82.                posY = 0;
  83.             }
  84.             lScale = animNode.childNodes[gAnim - 1].childNodes[h].attributes.scale;
  85.             if(lScale !== undefined)
  86.             {
  87.                gAnimSwf._xscale = Number(lScale);
  88.                gAnimSwf._yscale = Number(lScale);
  89.             }
  90.             afficheClipPos(gAnimSwf,posX,posY);
  91.             continue;
  92.          case "mp3":
  93.             var lSon = animNode.childNodes[gAnim - 1].childNodes[h].attributes.id;
  94.             lSon = lSon.substr(gCommentName.length,10);
  95.             trace(lSon);
  96.             joueSon({nomSon:lSon,actionFin:"testeFin"});
  97.             continue;
  98.          case "LM":
  99.             gListLM.push(animNode.childNodes[gAnim - 1].childNodes[h].attributes.id);
  100.             gereTextes.afficheLM({codeLM:animNode.childNodes[gAnim - 1].childNodes[h].attributes.id});
  101.             continue;
  102.          case "bruitage_continu":
  103.             gListeBruitages.push(animNode.childNodes[gAnim - 1].childNodes[h].attributes.id);
  104.             soundObjects[animNode.childNodes[gAnim - 1].childNodes[h].attributes.id].start(0,1000);
  105.             continue;
  106.          case "bruitage":
  107.             gListeBruitages.push(animNode.childNodes[gAnim - 1].childNodes[h].attributes.id);
  108.             listeTemp = animNode.childNodes[gAnim - 1].childNodes[h].attributes.frame.split(",");
  109.             j = 0;
  110.             while(j < listeTemp.length)
  111.             {
  112.                gListeFrameBruitage.push(listeTemp[j]);
  113.                gListeNameBruitage.push(animNode.childNodes[gAnim - 1].childNodes[h].attributes.id);
  114.                j++;
  115.             }
  116.             gAnimSwf.pos = h;
  117.             gAnimSwf.onEnterFrame = function()
  118.             {
  119.                if(getPos(gListeFrameBruitage,this._currentframe) !== -1)
  120.                {
  121.                   soundObjects[gListeNameBruitage[getPos(gListeFrameBruitage,this._currentframe)]].start();
  122.                }
  123.             };
  124.             break;
  125.          case "bruitageFin":
  126.             break;
  127.          default:
  128.             continue;
  129.       }
  130.       var lSon = animNode.childNodes[gAnim - 1].childNodes[h].attributes.id;
  131.       lSon = lSon.substr(gBruitageName.length,100);
  132.       joueBruitage({nomSon:lSon});
  133.    }
  134.    gereTextes.init_gListeLM(gListLM);
  135. }
  136. if(gAttenteClic == 1)
  137. {
  138.    BT_INTER._alpha = 100;
  139.    BT_INTER.pDepth = BT_INTER.getDepth();
  140.    BT_INTER.swapDepths(1000);
  141.    BT_INTER.onRollOver = function()
  142.    {
  143.       gereCursor(2);
  144.    };
  145.    BT_INTER.onRollOut = function()
  146.    {
  147.       gereCursor(1);
  148.    };
  149.    BT_INTER.onPress = function()
  150.    {
  151.       gereCursor(1);
  152.       delete this.onPress;
  153.       this._alpha = 0;
  154.       BT_INTER.swapDepths(this.pDepth);
  155.       animSuivante();
  156.    };
  157. }
  158. else if(gPriorite == "swf")
  159. {
  160.    intervalID = setInterval(this,"testeSWF_fin",100);
  161. }
  162. stop();
  163.