1 Reply Latest reply on Mar 29, 2010 9:48 PM by kglad

    loaded video inside movieclip

    Bruno Morello

      Hi everybody,

       

      I'm working with several videos each inside their own movieclips. When I click my forward button to jump to the next video I get the second

      video playing over the first one especially towards the end part of the first video. I can play and stop the movies just fine but it's the gotoAndPlay that's causing me problems right now with forwarding and rewinding clips.

       

      Hope my explanation was clear cause I'm just starting out with AS3

       

      Here's the code if it can be useful,

       

      Any help would be appreciated.

       

       

       

      import fl.video.*;

       


      navbar.visible = true;

       

      navbar.addEventListener(MouseEvent.MOUSE_OVER, showmenu);
      function showmenu(e:MouseEvent):void{
              navbar.alpha = 1;
      }

       

      navbar.addEventListener(MouseEvent.MOUSE_OUT, hidemenu);
      function hidemenu(e:MouseEvent):void{
              navbar.alpha = 0;
      }

       


      navbar.next_btn.addEventListener(MouseEvent.CLICK, nextButtonClick);
      navbar.prev_btn.addEventListener(MouseEvent.CLICK, previousButtonClick);
      navbar.play_btn.addEventListener(MouseEvent.CLICK, playButtonClick);
      navbar.stop_btn.addEventListener(MouseEvent.CLICK, stopButtonClick);
      navbar.menu_btn.addEventListener(MouseEvent.CLICK, menuButtonClick);

       

       

       


      function stopButtonClick(e:MouseEvent):void
      {

       

      if(delay1)
      {
      delay1.VidDesign1.stop();
      delay1.stop();
      }

       


      else if (delay2)
      {
      delay2.Video2.stop();
      delay2.stop();
      }

       


      else if (delay3)
      {
      delay3.VidDesign3.stop();
      delay3.stop();
      }

       


      else if (delay4)
      {
      delay4.VidDesign4.stop();
      delay4.stop();
      }

       


      else if (analysis1)
      {
      analysis1.VidDesign5.stop();
      analysis1.stop();
      }

       


      else if (analysis2)
      {
      analysis2.VidDesign6.stop();
      analysis2.stop();
      }

       


      else if (analysis3)
      {
      analysis3.VidDesign7.stop();
      analysis3.stop();
      }

       

      stop();
      }

       

       

       

      function playButtonClick(e:MouseEvent):void
      {
      if(delay1)
      {
      delay1.VidDesign1.play();
      delay1.play();
      }

       

      else if(delay2)
      {
      delay2.VidDesign2.play();
      delay2.play();
      }

       

      else if(delay3)
      {
      delay3.VidDesign3.play();
      delay3.play();
      }

       

      else if(delay4)
      {
      delay4.VidDesign4.play();
      delay4.play();
      }

       

      else if (analysis1)
      {
      analysis1.VidDesign5.play();
      analysis1.play();
      }

       

      else if (analysis2)
      {
      analysis2.VidDesign6.play();
      analysis2.play();
      }

       

      else if (analysis3)
      {
      analysis3.VidDesign7.play();
      analysis3.play();
      }

       

      play();
      }

       

       

       

       

       

      function previousButtonClick(e:MouseEvent):void
      {

       

      if(delay1)
      {
      delay1.VidDesign1.stop();
      delay1.stop();
      }

       

      else if (delay2)
      {
      delay2.Video2.stop();
      delay2.stop();
      gotoAndPlay("delay1");
      }

       

      else if (delay3)
      {
      delay3.VidDesign3.stop();
      delay3.stop();
      gotoAndPlay("delay2");
      }

       

      else if (delay4)
      {
      delay4.VidDesign4.stop();
      delay4.stop();
      gotoAndPlay("delay3");
      }

       

      else if (analysis1)
      {
      analysis1.VidDesign6.stop();
      analysis1.play();

       

      }

       

      else if (analysis2)
      {
      analysis2.VidDesign7.play();
      analysis2.play();
      gotoAndPlay("analysis1");
      }

       

      else if (analysis3)
      {
      analysis3.VidDesign7.stop();
      analysis3.stop();
      gotoAndPlay("analysis2");

       

      }

       

      gotoAndStop(currentFrame - 250);
      }

       


      function nextButtonClick(e:MouseEvent):void
      {

       

      if(delay1)
      {
      delay1.VidDesign1.stop();
      delay1.stop();
      gotoAndPlay("delay2");
      }

       

      else if(delay2)
      {
      delay2.VidDesign2.stop();
      delay2.stop();
      gotoAndPlay("delay3");
      }

       

      else if (delay3)
      {
      delay3.VidDesign3.stop();
      delay3.stop();
      gotoAndPlay("delay4");
      }

       

      else if (delay4)
      {
      delay4.VidDesign4.stop();
      delay4.stop();
      }

       

      else if (analysis1)
      {
      analysis1.VidDesign5.stop();
      analysis1.stop();
      gotoAndPlay("analysis2");
      }

       

      else if (analysis2)
      {
      analysis2.VidDesign6.stop();
      analysis2.stop();
      gotoAndPlay("analysis3");
      }

       

      else if (analysis3)
      {
      analysis3.VidDesign7.stop();
      }

       

      gotoAndStop(currentFrame + 250);     
      }

       

       

       

      function menuButtonClick(e:MouseEvent):void
      {

       

      if(delay1)
      {
      delay1.stop();
      }

       

      else if (delay2)
      {
      delay2.stop();
      }

       

      else if (delay3)
      {
      delay3.stop();
      }

       

      else if (delay4)
      {
      delay4.stop();
      }

       

      else if (analysis1)
      {
      VidDesign5.stop();
      }

       

      else if (analysis2)
      {
      VidDesign6.stop();
      }

       

      else if (analysis3)
      {
      VidDesign7.stop();
      }

       


      gotoAndPlay(1);
      }