home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 130 / MOBICLIC130.ISO / pc / DATA / BID130 / BID130_00 / BID130_00.swf / scripts / frame_20 / DoAction.as
Text File  |  2010-12-13  |  4KB  |  158 lines

  1. function joueSonJLM(p)
  2. {
  3.    var _loc4_ = p.nomSon;
  4.    gSoundString = _loc4_;
  5.    if(p.gNextLabel != undefined)
  6.    {
  7.       _root.gNextLabel = p.gNextLabel;
  8.    }
  9.    if(p.mc !== undefined)
  10.    {
  11.       gClipRef = p.mc;
  12.    }
  13.    else
  14.    {
  15.       gClipRef = _root;
  16.    }
  17.    if(p.zapBlock !== undefined)
  18.    {
  19.       gClicZap = p.zapBlock;
  20.    }
  21.    else
  22.    {
  23.       gClicZap = "ZAP_BLOCK";
  24.    }
  25.    if(p.actionFin !== undefined)
  26.    {
  27.       gActionFinSon = p.actionFin;
  28.    }
  29.    else
  30.    {
  31.       gActionFinSon = "PLAY";
  32.    }
  33.    stopComment();
  34.    if(p.mcCible !== undefined)
  35.    {
  36.       if(typeof p.mcCible == "movieclip")
  37.       {
  38.          gClipTarget = p.mcCible;
  39.       }
  40.       else
  41.       {
  42.          gClipTarget = gClipRef[p.mcCible];
  43.       }
  44.       if(p.mcLabelOut !== undefined)
  45.       {
  46.          gClipTargetLabel = p.mcLabelOut;
  47.       }
  48.       else
  49.       {
  50.          gClipTargetLabel = gClipTarget._currentframe;
  51.       }
  52.       if(p.mcLabelIn !== undefined)
  53.       {
  54.          gClipTarget.gotoAndPlay(p.mcLabelIn);
  55.       }
  56.       else
  57.       {
  58.          gClipTarget.gotoAndPlay("parle");
  59.       }
  60.    }
  61.    gCommentName = "S_" + gLangue + "_" + gModuleName + "_";
  62.    trace("joueSon " + gCommentName + _loc4_);
  63.    mySound = soundObjects[gCommentName + _loc4_];
  64.    _root.afficherMascottes(p.Mascottes);
  65.    if(mySound !== undefined)
  66.    {
  67.       gCommentOn = mySound;
  68.       gCommentOn.p = p;
  69.       gCommentOn.id = gCommentName + _loc4_;
  70.       testeDebutCommentSpecial();
  71.       if(gMusicOn == 1 && gMusic !== undefined && gBlockMusic == undefined)
  72.       {
  73.          soundObjects[gMusic].setVolume(gVolume * 40 / 100);
  74.       }
  75.       mySound.setVolume(gVolume);
  76.       if(gCommentOnPausePos !== undefined)
  77.       {
  78.          mySound.start(gCommentOnPausePos / 1000);
  79.          gCommentOnPause = undefined;
  80.          gCommentOnPausePos = undefined;
  81.       }
  82.       else
  83.       {
  84.          mySound.start();
  85.       }
  86.    }
  87.    else
  88.    {
  89.       trace("______" + getSoundByID(gCommentName + _loc4_) + gCommentName);
  90.       var _loc5_ = getSoundByID(gCommentName + _loc4_);
  91.       if(_loc5_ !== undefined)
  92.       {
  93.          mySound = new Sound();
  94.          mySound.onLoad = function(success)
  95.          {
  96.             if(success)
  97.             {
  98.                if(gCommentOnPausePos !== undefined)
  99.                {
  100.                   mySound.start(gCommentOnPausePos / 1000);
  101.                   gCommentOnPause = undefined;
  102.                   gCommentOnPausePos = undefined;
  103.                }
  104.                else
  105.                {
  106.                   mySound.start();
  107.                }
  108.             }
  109.          };
  110.          mySound.loadSound(this.gModulePath + _loc5_.attributes.src,true);
  111.          gCommentOn = mySound;
  112.          gCommentOn.p = p;
  113.          gCommentOn.id = gCommentName + _loc4_;
  114.          testeDebutCommentSpecial();
  115.          if(gMusicOn == 1 && gMusic !== undefined && gBlockMusic == undefined)
  116.          {
  117.             soundObjects[gMusic].setVolume(gVolume * 40 / 100);
  118.          }
  119.       }
  120.    }
  121.    if(mySound == undefined)
  122.    {
  123.       return undefined;
  124.    }
  125.    mySound.onSoundComplete = commentFini;
  126.    if(gClicZap !== "NOZAP_NOBLOCK")
  127.    {
  128.       trace("creerRectangle " + creerRectangle + " " + gHeight + " " + gWidth);
  129.       mcClicZap = creerRectangle({nom:"mcClicZap",pere:_root,level:15000,width:gWidth,height:gHeight,x:0,y:0,alpha:0});
  130.       switch(gClicZap.split("_")[0])
  131.       {
  132.          case "ZAP":
  133.             mcClicZap.useHandCursor = false;
  134.             mcClicZap.onPress = function()
  135.             {
  136.                trace("clic zap son");
  137.                _root.flagClicZap = true;
  138.                stopSon();
  139.             };
  140.             break;
  141.          case "NOZAP":
  142.             mcClicZap.useHandCursor = false;
  143.             mcClicZap.onPress = function()
  144.             {
  145.                trace("no clic allowed");
  146.             };
  147.       }
  148.       mcClicZap._visible = true;
  149.    }
  150.    if(gST == 1 && gBlockST == undefined)
  151.    {
  152.       gereTextes.afficheST(gCommentName + _loc4_);
  153.    }
  154. }
  155. stop();
  156. _mod_.gerelabelATTENTE_00();
  157. _global.joueSonJLM = joueSonJLM;
  158.