home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 149 / MOBICLIC149.ISO / pc / DATA / EPP149 / EPP149_00 / EPP149_00.swf / scripts / frame_1 / DoAction_2.as next >
Text File  |  2012-11-21  |  15KB  |  510 lines

  1. function initBT_01()
  2. {
  3.    var _loc2_ = BT_01;
  4.    _loc2_.pIB = "IB_01";
  5.    _loc2_.onRollOver = function()
  6.    {
  7.       gereCursor(2);
  8.       this.gotoAndPlay("E2");
  9.       joueBruitage({nomSon:"B_01"});
  10.       gereTextes.afficheIB({codeIB:this.pIB,X:this._x + 60,Y:this._y + this._height});
  11.    };
  12.    _loc2_.onRollOut = function()
  13.    {
  14.       gereCursor(1);
  15.       this.gotoAndPlay("E1");
  16.       stopBruitage({nomSon:"B_01"});
  17.       gereTextes.masqueIB({codeIB:this.pIB});
  18.    };
  19.    _loc2_.onPress = function()
  20.    {
  21.       gereCursor(1);
  22.       this.gotoAndPlay("E1");
  23.       stopBruitage({nomSon:"B_01"});
  24.       gereTextes.masqueIB({codeIB:this.pIB});
  25.       initDone = undefined;
  26.       desinitVignettes();
  27.       removeVignettes();
  28.       if(gClic !== undefined)
  29.       {
  30.          gClic._parent.gotoAndPlay("E1");
  31.          gClic._parent._xscale = 100;
  32.          gClic._parent._yscale = 100;
  33.          gClic._parent._x += 5;
  34.          gClic = undefined;
  35.       }
  36.       gotoAndStop("_01");
  37.       play();
  38.    };
  39. }
  40. function initBT_02()
  41. {
  42.    trace("gVisuelVID AVANT = " + gVisuelVID);
  43.    if(gVisuelVID == undefined)
  44.    {
  45.       gVisuelVID = gVisuel;
  46.    }
  47.    trace("gVisuelVID APRES = " + gVisuelVID);
  48.    var _loc3_ = 1;
  49.    while(_loc3_ < 5)
  50.    {
  51.       var _loc4_ = gVisuelVID["VID_" + gimme2digits(_loc3_)];
  52.       _loc4_.Media = _global.gModulePath + moduleInfo.getResourceById("V_" + gModuleName + "_MEDIA_02_" + gimme2digits(_loc3_)).firstChild.attributes.src;
  53.       _loc4_.onRollOver = function()
  54.       {
  55.          gereCursor(2);
  56.          this.gotoAndPlay("E2");
  57.       };
  58.       _loc4_.onRollOut = function()
  59.       {
  60.          gereCursor(1);
  61.          this.gotoAndPlay("E1");
  62.       };
  63.       _loc4_.onPress = function()
  64.       {
  65.          gereCursor(1);
  66.          this.gotoAndPlay("E1");
  67.          desinitBT_02();
  68.          VISUEL.videoPath = this.Media;
  69.          VISUEL.gotoAndPlay("VIDEO");
  70.          gVisuelVID._visible = false;
  71.          gVisuel = "video";
  72.          afficheBT_VIDEO();
  73.       };
  74.       _loc3_ = _loc3_ + 1;
  75.    }
  76. }
  77. function desinitBT_02()
  78. {
  79.    var _loc1_ = 1;
  80.    while(_loc1_ < 5)
  81.    {
  82.       var _loc2_ = gVisuel["VID_" + gimme2digits(_loc1_)];
  83.       desactiveClip(_loc2_);
  84.       _loc1_ = _loc1_ + 1;
  85.    }
  86. }
  87. function desinitBT_PDF()
  88. {
  89.    var _loc1_ = BT_PDF;
  90.    _loc1_.gotoAndPlay("E0");
  91.    desactiveClip(_loc1_);
  92. }
  93. function initBT_PDF()
  94. {
  95.    var _loc2_ = BT_PDF;
  96.    _loc2_.pBRUIT = "B_TELECHARGER_ROLL";
  97.    _loc2_.gotoAndPlay("E1");
  98.    _loc2_.onRollOver = function()
  99.    {
  100.       gereCursor(2);
  101.       this.gotoAndPlay("E2");
  102.       joueBruitage({nomSon:this.pBRUIT});
  103.    };
  104.    _loc2_.onRollOut = _loc2_.onDragOut = function()
  105.    {
  106.       gereCursor(1);
  107.       this.gotoAndPlay("E1");
  108.       stopBruitage({nomSon:this.pBRUIT});
  109.    };
  110.    _loc2_.onPress = function()
  111.    {
  112.       gereCursor(1);
  113.       this.gotoAndPlay("E3");
  114.       stopBruitage({nomSon:this.pBRUIT});
  115.    };
  116.    _loc2_.onRelease = function()
  117.    {
  118.       HoldOS = System.capabilities.os;
  119.       TrackOS = HoldOS.slice(0,3);
  120.       trace("TrackOS = " + TrackOS);
  121.       trace("gClic.nomPDF = " + gClic.nomPDF);
  122.       if(TrackOS == "Win")
  123.       {
  124.          getURL("FSCommand:exec",gClic.nomPDF + ".exe");
  125.       }
  126.       if(TrackOS == "Mac")
  127.       {
  128.          getURL("FSCommand:exec",gClic.nomPDF + ".app");
  129.       }
  130.    };
  131. }
  132. function adapteImage(myC)
  133. {
  134.    trace("myC = " + myC);
  135.    trace("cadreWidth = " + cadreWidth);
  136.    trace("myC._width = " + myC._width);
  137.    if(myC._width > myC._height)
  138.    {
  139.       var _loc2_ = cadreWidth * 100 / myC._width;
  140.       if(myC._height * _loc2_ / 100 > cadreHeight)
  141.       {
  142.          _loc2_ = cadreHeight * 100 / myC._height;
  143.       }
  144.    }
  145.    else
  146.    {
  147.       _loc2_ = cadreHeight * 100 / myC._height;
  148.       if(myC._width * _loc2_ / 100 > cadreWidth)
  149.       {
  150.          _loc2_ = cadreWidth * 100 / myC._width;
  151.       }
  152.    }
  153.    trace("pCent = " + _loc2_);
  154.    myC._width = myC._width * _loc2_ / 100;
  155.    myC._height = myC._height * _loc2_ / 100;
  156.    myC.SCALE = _loc2_;
  157.    myC._visible = true;
  158. }
  159. function removeVignettes()
  160. {
  161.    var _loc1_ = 1;
  162.    while(_loc1_ <= gNbVignette)
  163.    {
  164.       var _loc2_ = VIGNETTES["VIGNETTE_" + gimme2digits(gNbVignette)];
  165.       removeMovieClip(_loc2_);
  166.       _loc1_ = _loc1_ + 1;
  167.    }
  168. }
  169. function desafficheBT_VIDEO()
  170. {
  171.    var _loc1_ = BT_PLAY;
  172.    _loc1_._visible = false;
  173.    _loc1_ = BT_REWIND;
  174.    _loc1_._visible = false;
  175. }
  176. function afficheBT_VIDEO()
  177. {
  178.    gPlaying = 1;
  179.    var _loc2_ = BT_PLAY;
  180.    _loc2_._visible = true;
  181.    _loc2_.gotoAndPlay("E1");
  182.    _loc2_.pBRUIT = "B_BT_PLAY";
  183.    _loc2_.onRollOver = function()
  184.    {
  185.       gereCursor(2);
  186.       if(gPlaying == 1)
  187.       {
  188.          this.gotoAndPlay("E2");
  189.       }
  190.       else
  191.       {
  192.          this.gotoAndPlay("E4");
  193.       }
  194.       joueBruitage({nomSon:this.pBRUIT});
  195.    };
  196.    _loc2_.onRollOut = function()
  197.    {
  198.       gereCursor(1);
  199.       if(gPlaying == 1)
  200.       {
  201.          this.gotoAndPlay("E1");
  202.       }
  203.       else
  204.       {
  205.          this.gotoAndPlay("E3");
  206.       }
  207.       stopBruitage({nomSon:this.pBRUIT});
  208.    };
  209.    _loc2_.onPress = function()
  210.    {
  211.       gereCursor(1);
  212.       if(gPlaying == 1)
  213.       {
  214.          this.gotoAndPlay("E4");
  215.          gPlaying = 0;
  216.       }
  217.       else
  218.       {
  219.          this.gotoAndPlay("E2");
  220.          gPlaying = 1;
  221.       }
  222.       VISUEL.stream_ns.pause();
  223.       stopBruitage({nomSon:this.pBRUIT});
  224.    };
  225.    _loc2_ = BT_REWIND;
  226.    _loc2_._visible = true;
  227.    _loc2_.pBRUIT = "B_BT_REWIND";
  228.    _loc2_.gotoAndPlay("E1");
  229.    _loc2_.onRollOver = function()
  230.    {
  231.       gereCursor(2);
  232.       this.gotoAndPlay("E2");
  233.       joueBruitage({nomSon:this.pBRUIT});
  234.    };
  235.    _loc2_.onRollOut = function()
  236.    {
  237.       gereCursor(1);
  238.       this.gotoAndPlay("E1");
  239.       stopBruitage({nomSon:this.pBRUIT});
  240.    };
  241.    _loc2_.onPress = function()
  242.    {
  243.       gereCursor(1);
  244.       this.gotoAndPlay("E1");
  245.       stopBruitage({nomSon:this.pBRUIT});
  246.       VISUEL.stream_ns.seek(0);
  247.       if(gPlaying == 1)
  248.       {
  249.          VISUEL.stream_ns.play();
  250.       }
  251.       else
  252.       {
  253.          VISUEL.stream_ns.pause();
  254.       }
  255.       gPlaying = 1;
  256.       BT_PLAY.gotoAndPlay("E1");
  257.    };
  258. }
  259. function desinitVignettes()
  260. {
  261.    gNbVignette = 0;
  262.    var _loc1_ = 1;
  263.    while(_loc1_ < 20)
  264.    {
  265.       var _loc4_ = "I_" + gModuleName + "_VIGNETTE_" + gimme2digits(_loc1_);
  266.       var _loc2_ = VIGNETTES[_loc4_];
  267.       if(_loc2_ !== undefined)
  268.       {
  269.          gNbVignette += 1;
  270.          var _loc3_ = VIGNETTES["VIGNETTE_" + gimme2digits(gNbVignette)].ACCEUIL;
  271.          desactiveClip(_loc3_);
  272.       }
  273.       else
  274.       {
  275.          _loc1_ = 20;
  276.       }
  277.       _loc1_ = _loc1_ + 1;
  278.    }
  279. }
  280. function initVignettes()
  281. {
  282.    gNbVignette = 0;
  283.    VISUEL_W = VISUEL._width;
  284.    VISUEL_H = VISUEL._height;
  285.    var _loc4_ = 1;
  286.    while(_loc4_ < 20)
  287.    {
  288.       var _loc12_ = "I_" + gModuleName + "_VIGNETTE_" + gimme2digits(_loc4_);
  289.       var _loc3_ = VIGNETTES[_loc12_];
  290.       if(_loc3_ !== undefined)
  291.       {
  292.          gNbVignette += 1;
  293.          VIGNETTES.attachMovie("VIGNETTE","VIGNETTE_" + gimme2digits(gNbVignette),chercheDepthMoins(VIGNETTES,20));
  294.          var _loc2_ = VIGNETTES["VIGNETTE_" + gimme2digits(gNbVignette)].ACCEUIL;
  295.          var _loc6_ = new flash.display.BitmapData(_loc3_._width,_loc3_._height,true,0);
  296.          _loc6_.draw(_loc3_);
  297.          _loc2_.attachBitmap(_loc6_,_loc2_.getNextHighestDepth(),"auto",true);
  298.          cadreWidth = 97.8;
  299.          cadreHeight = 73.3;
  300.          adapteImage(_loc2_);
  301.          _loc2_._parent._x = (gNbVignette - 1) * (cadreWidth + 7.3);
  302.          testeMEDIA(_loc2_,gNbVignette);
  303.          _loc2_.pNum = gimme2digits(gNbVignette);
  304.          _loc2_.pIB = "IB_VIGNETTE_" + gimme2digits(gNbVignette);
  305.          _loc2_.pB_ROLL = "B_VIGNETTE_ROLL";
  306.          _loc2_.pB_CLIC = "B_VIGNETTE_CLIC";
  307.          _loc2_.onRollOver = function()
  308.          {
  309.             if(gClic !== this)
  310.             {
  311.                this.useHandCursor = true;
  312.                gereCursor(2);
  313.                this._parent.gotoAndPlay("E2");
  314.                this._parent._xscale = 110;
  315.                this._parent._yscale = 110;
  316.                this._parent._x -= 5;
  317.                joueBruitage({nomSon:this.pB_ROLL});
  318.                var _loc3_ = this._parent._parent._x + this._parent._x;
  319.                var _loc2_ = this._parent._parent._y;
  320.                gereTextes.afficheIB({codeIB:this.pIB,X:_loc3_ - 30,Y:_loc2_ - 20});
  321.             }
  322.             else
  323.             {
  324.                this.useHandCursor = false;
  325.             }
  326.          };
  327.          _loc2_.onRollOut = function()
  328.          {
  329.             if(gClic !== this)
  330.             {
  331.                this.useHandCursor = true;
  332.                gereCursor(1);
  333.                this._parent.gotoAndPlay("E1");
  334.                this._parent._xscale = 100;
  335.                this._parent._yscale = 100;
  336.                this._parent._x += 5;
  337.                stopBruitage({nomSon:this.pB_ROLL});
  338.                gereTextes.masqueIB({codeIB:this.pIB});
  339.             }
  340.             else
  341.             {
  342.                this.useHandCursor = false;
  343.             }
  344.          };
  345.          _loc2_.onPress = function()
  346.          {
  347.             if(gClic !== this)
  348.             {
  349.                VISUEL.SWF_02._visible = false;
  350.                desinitBT_PDF();
  351.                this.useHandCursor = true;
  352.                gereCursor(1);
  353.                if(gVisuel !== undefined)
  354.                {
  355.                   if(gVisuel == "video")
  356.                   {
  357.                      TIMELINE.gotoAndStop(1);
  358.                      clearInterval(VISUEL.time_interval);
  359.                      desafficheBT_VIDEO();
  360.                      VISUEL.gotoAndPlay("E1");
  361.                      VISUEL.stream_ns.close();
  362.                   }
  363.                   else
  364.                   {
  365.                      gVisuel._visible = false;
  366.                   }
  367.                }
  368.                if(gClic !== this && gClic !== undefined)
  369.                {
  370.                   gClic._parent.gotoAndPlay("E1");
  371.                   gClic._parent._xscale = 100;
  372.                   gClic._parent._yscale = 100;
  373.                   gClic._parent._x += 5;
  374.                }
  375.                gClic = this;
  376.                stopBruitage({nomSon:this.pB_ROLL});
  377.                joueBruitage({nomSon:this.pB_CLIC});
  378.                gereTextes.masqueIB({codeIB:this.pIB});
  379.                switch(this.typeMedia)
  380.                {
  381.                   case "swf":
  382.                      VISUEL.gotoAndPlay("E1");
  383.                      if(VISUEL["SWF_" + this.pNum] == undefined)
  384.                      {
  385.                         var _loc5_ = VISUEL.createEmptyMovieClip("SWF_" + this.pNum,chercheDepthPlus(VISUEL,0));
  386.                         this.mclSWF = new MovieClipLoader();
  387.                         this.mclSWF.pNum = this.pNum;
  388.                         this.mclSWF.loadClip(this.Media._url,_loc5_);
  389.                         this.mclSWF.onLoadInit = function(myClip)
  390.                         {
  391.                            gVisuel = myClip;
  392.                            if(this.pNum == "02")
  393.                            {
  394.                               initBT_02();
  395.                            }
  396.                         };
  397.                      }
  398.                      else
  399.                      {
  400.                         gVisuel = VISUEL["SWF_" + this.pNum];
  401.                         gVisuel._visible = true;
  402.                         if(this.pNum == "02")
  403.                         {
  404.                            initBT_02();
  405.                         }
  406.                      }
  407.                      break;
  408.                   case "flv":
  409.                      VISUEL.videoPath = this.Media;
  410.                      VISUEL.gotoAndPlay("VIDEO");
  411.                      gVisuel = "video";
  412.                      afficheBT_VIDEO();
  413.                      break;
  414.                   case "jpg":
  415.                      VISUEL.gotoAndPlay("E1");
  416.                      if(VISUEL["IMAGE_" + this.pNum] == undefined)
  417.                      {
  418.                         var _loc2_ = this.Media;
  419.                         var _loc3_ = new flash.display.BitmapData(_loc2_._width,_loc2_._height,true,0);
  420.                         var _loc4_ = VISUEL.createEmptyMovieClip("IMAGE_" + this.pNum,chercheDepthPlus(VISUEL,0));
  421.                         _loc3_.draw(_loc2_);
  422.                         _loc4_.attachBitmap(_loc3_,_loc4_.getNextHighestDepth(),"auto",true);
  423.                      }
  424.                      else
  425.                      {
  426.                         _loc4_ = VISUEL["IMAGE_" + this.pNum];
  427.                         _loc4_._visible = true;
  428.                      }
  429.                      gVisuel = _loc4_;
  430.                      if(this.pNum == "05")
  431.                      {
  432.                         joueSon({nomSon:"DEMO_TOBO",actionFin:"enchaineVideo"});
  433.                      }
  434.                      else
  435.                      {
  436.                         initBT_PDF();
  437.                      }
  438.                }
  439.             }
  440.             else
  441.             {
  442.                this.useHandCursor = false;
  443.             }
  444.          };
  445.       }
  446.       else
  447.       {
  448.          _loc4_ = 20;
  449.       }
  450.       _loc4_ = _loc4_ + 1;
  451.    }
  452. }
  453. function enchaineVideo()
  454. {
  455.    gVisuel._visible = false;
  456.    VISUEL.videoPath = _global.gModulePath + moduleInfo.getResourceById("V_" + gModuleName + "_MEDIA_05").firstChild.attributes.src;
  457.    VISUEL.gotoAndPlay("VIDEO");
  458.    gVisuel = "video";
  459.    afficheBT_VIDEO();
  460. }
  461. function testeMEDIA(mc, lNum)
  462. {
  463.    if(swfStocker["A_" + gModuleName + "_MEDIA_" + gimme2digits(lNum)] !== undefined)
  464.    {
  465.       var _loc6_ = swfStocker["A_" + gModuleName + "_MEDIA_" + gimme2digits(lNum)];
  466.       var _loc7_ = "swf";
  467.    }
  468.    else if(photoStocker["I_" + gModuleName + "_MEDIA_" + gimme2digits(lNum)] !== undefined)
  469.    {
  470.       _loc6_ = photoStocker["I_" + gModuleName + "_MEDIA_" + gimme2digits(lNum)];
  471.       _loc7_ = "jpg";
  472.       var _loc5_ = this.moduleInfo.returnNodeByPath("Module.Config.Vignettes");
  473.       var _loc8_ = _loc5_.childNodes[lNum - 1].attributes.media;
  474.    }
  475.    else
  476.    {
  477.       _loc6_ = _global.gModulePath + moduleInfo.getResourceById("V_" + gModuleName + "_MEDIA_" + gimme2digits(lNum)).firstChild.attributes.src;
  478.       _loc7_ = "flv";
  479.    }
  480.    mc.typeMedia = _loc7_;
  481.    mc.Media = _loc6_;
  482.    mc.nomPDF = _loc8_;
  483.    gVisuel = undefined;
  484. }
  485. function finVideo()
  486. {
  487.    trace("fin Video gClic.pNum = " + gClic.pNum);
  488.    if(gClic.pNum == "02")
  489.    {
  490.       gVisuelVID._visible = true;
  491.       desafficheBT_VIDEO();
  492.       initBT_02();
  493.    }
  494.    else
  495.    {
  496.       gClic = undefined;
  497.    }
  498. }
  499. function initEPP()
  500. {
  501.    trace("initDone = " + initDone);
  502.    if(initDone == undefined)
  503.    {
  504.       initDone = 1;
  505.       initBT_01();
  506.       initVignettes();
  507.       desafficheBT_VIDEO();
  508.    }
  509. }
  510.