home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 155 / MOBICLIC155.ISO / mac / DATA / TRC155 / TRC155_00 / TRC155_00.swf / scripts / frame_6 / DoAction.as
Text File  |  2013-07-08  |  3KB  |  128 lines

  1. function init_BT_PLAY_PAUSE()
  2. {
  3.    onPlay = true;
  4.    BT_PLAY_PAUSE._alpha = 100;
  5.    BT_PLAY_PAUSE.gotoAndStop(2);
  6.    BT_PLAY_PAUSE.onRollOver = function()
  7.    {
  8.       this.useHandCursor = 0;
  9.       if(this._alpha == 100)
  10.       {
  11.          this.useHandCursor = 1;
  12.          this.BT.gotoAndStop("E2");
  13.          gereCursor(2);
  14.       }
  15.    };
  16.    BT_PLAY_PAUSE.onRollOut = function()
  17.    {
  18.       if(this._alpha == 100)
  19.       {
  20.          this.BT.gotoAndStop("E1");
  21.          gereCursor(1);
  22.       }
  23.    };
  24.    BT_PLAY_PAUSE.onPress = function()
  25.    {
  26.       if(this._alpha == 100)
  27.       {
  28.          if(_root.onPlay == true)
  29.          {
  30.             _root.onPlay = false;
  31.             this.gotoAndStop(1);
  32.             _root.stopVideo();
  33.          }
  34.          else
  35.          {
  36.             _root.onPlay = true;
  37.             this.gotoAndStop(2);
  38.             _root.playVideo();
  39.          }
  40.       }
  41.    };
  42. }
  43. function playVideo()
  44. {
  45.    FLVLecture.play();
  46.    BT_PLAY_PAUSE._alpha = 100;
  47.    _root.onPlay = true;
  48.    _root.BT_PLAY_PAUSE.gotoAndStop(2);
  49. }
  50. function stopVideo()
  51. {
  52.    FLVLecture.stop();
  53. }
  54. function init_BT_REWIND()
  55. {
  56.    BT_REWIND.onRollOver = function()
  57.    {
  58.       this.gotoAndStop("E2");
  59.       gereCursor(2);
  60.    };
  61.    BT_REWIND.onRollOut = function()
  62.    {
  63.       this.gotoAndStop("E1");
  64.       gereCursor(1);
  65.    };
  66.    BT_REWIND.onPress = function()
  67.    {
  68.       _root.rewindVideo();
  69.    };
  70. }
  71. function rewindVideo()
  72. {
  73.    doneLogo = undefined;
  74.    BT_PLAY_PAUSE._alpha = 100;
  75.    FLVLecture.playheadTime = 0;
  76. }
  77. trace("start frame");
  78. BT_FERMER.onRollOver = function()
  79. {
  80.    this.useHandCursor = true;
  81.    joueBruitage({nomSon:"B_FERMER"});
  82.    this.gotoAndPlay("E2");
  83. };
  84. BT_FERMER.onPress = function()
  85. {
  86.    ChangeModule({codeRub:"MOB",numMod:0,FromModule:true});
  87. };
  88. BT_FERMER.onRollOut = function()
  89. {
  90.    this.gotoAndPlay("E1");
  91. };
  92. FLVLecture.contentPath = _root.gModulePath + "V_" + _root.gModuleName + "/EPISODE.flv";
  93. trace(FLVLecture.playheadTime);
  94. playVideo();
  95. init_BT_PLAY_PAUSE();
  96. init_BT_REWIND();
  97. FLVLecture.onEnterFrame = function()
  98. {
  99.    trace(this.totalTime);
  100.    if(doneLogo == undefined)
  101.    {
  102.       if(this.playheadTime > this.totalTime - 14)
  103.       {
  104.          trace("PLAY LOGO");
  105.          doneLogo = 1;
  106.          _root.gotoAndPlay("PLAY_LOGO");
  107.       }
  108.    }
  109.    if(this.playheadPercentage >= 100)
  110.    {
  111.       _root.onPlay = false;
  112.       _root.BT_PLAY_PAUSE.gotoAndStop(1);
  113.       _root.BT_PLAY_PAUSE._alpha = 50;
  114.    }
  115.    if(this.playheadPercentage <= 1)
  116.    {
  117.       if(this.doneShunt == undefined)
  118.       {
  119.          this.doneShunt = 1;
  120.          _root.onPlay = true;
  121.          _root.BT_PLAY_PAUSE.gotoAndStop(2);
  122.          _root.gotoAndStop("REWIND");
  123.       }
  124.       _root.BT_PLAY_PAUSE._alpha = 100;
  125.    }
  126. };
  127. stop();
  128.