3 Replies Latest reply on Apr 18, 2013 3:20 PM by kglad

    Loading external SWF in Actionscript 2

    bod4000

      I am creating an animation within Flash CS4 in Actionscript 2.0 / Flash Player 7

      At the moment I have a handler (Movie Clip) called myHolder that is used to play other swf files within one main swf file, when called by a button

      Within a button that load the swf into the main timeline - For Example

      on (press) { loadMovie("BulletTrainDRAFT.swf", myHolder); }

      This works fine with bring other swf files into the main swf file timeline, but when I bring a swf file that has video controls for a video within it, they do not respond within the handler when played, but they do work when that swf file is played within its own external flash player window (The video is within a (Movie Clip) on its own timeline within its design fla)

      Video buttons - ActionScript 2.0

      btnStop.onPress = function()

      {  _root.vid.stop();  }

      btnPlay.onPress = function()

      {  _root.vid.play();  } 

      btn_fastforward.onPress = function()

      {  _root.vid.nextFrame();  } 

      btn_Rewind.onPress = function()

      {  _root.vid.prevFrame();  }

      I tried ActionScript 3.0 code as well

      Pausebtn.addEventListener(MouseEvent.CLICK,pauseHandler);

      Stopbtn.addEventListener(MouseEvent.CLICK, stopHandler);

      Playbtn.addEventListener(MouseEvent.CLICK,playHandler); 


      function stopHandler(event:MouseEvent):void

      { // Pause the stream and move the playhead back to // the beginning of the stream. video.gotoAndStop(1); }

      function playHandler(event:MouseEvent):void

      { // Pause the stream and move the playhead back to // the beginning of the stream. video.play(); }

      function pauseHandler(event:MouseEvent):void

      { // Pause the stream and move the playhead back to // the beginning of the stream. video.stop(); }

      Problem I have I think, is that a movie the external swf loads on the existing timeline as a child and doesn't unload the timeline resulting the actionscript not functional, but I can't fix this.