0 Replies Latest reply on Apr 27, 2006 1:10 PM by stardustworld

    Controlling Movie Clips with Play, Stop, FF, RR

    stardustworld
      I'm putting together a multimedia site that will have a lot of video on it. Right now I'm trying to figure out how to control a movie clip with the traditional controls. Here is the script I'm using:

      stop();
      play_btn.onRelease = function (){
      play();
      }
      pause_btn.onRelease=function(){
      stop();
      }
      forward_btn.onPress=function (){
      _root.createEmptyMovieClip("controller_mc",1);
      controller_mc.onEnterFrame=function(){
      _root.gotoAndStop(_root._currentframe+3);
      if (_root._currentframe+3 > _root._totalframes){
      _root.gotoAndStop(_root._totalframes);
      }
      }
      }
      forward_btn.onRelease=function (){
      controller_mc.removeMovieClip();
      }
      forward_btn.onReleaseOutside=function (){
      controller_mc.removeMovieClip();
      }
      rewind_btn.onPress=function (){
      _root.createEmptyMovieClip("controller_mc",1);
      controller_mc.onEnterFrame=function(){
      _root.gotoAndStop(_root._currentframe-3);
      if (_root._currentframe-3 < 1){
      _root.gotoAndStop(1);
      }
      }
      }
      rewind_btn.onRelease=function (){
      controller_mc.removeMovieClip();
      }
      rewind_btn.onReleaseOutside=function (){
      controller_mc.removeMovieClip();
      }

      The play and pause buttons work great. The fast forward and rewind buttons don't work at all. I don't know why. My movie is set up so that in the main timeline I've got a preloader on the first frame and the movie clip is contained in the second frame. Inside the movie clip are the buttons and the movie itself. The script has been placed on the first frame inside the movie clip and not on the buttons.

      Also, this script calls for the movie not playing until the play button is pressed. Can I simply remove the very first stop(); and have it play automatically? When I tried that, whenever I pressed the play button, it would start the movie over from the beginning. Keep in mind that I'm a novice actionscripter and I don't understand code jargon well at all. Please explain in as simple terms as possible. I've searched the internet and keep hearing people talk about the buttons being in the root part of the timeline? I don't know what they mean by this. Thanks.