A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: playing video movie clip backwards

  1. #1
    human
    Join Date
    May 2000
    Posts
    132

    playing video movie clip backwards

    can't use the reverse frames on an imported MPEG, so
    what is the most efficient way to play the video forward then backward in a loop?

    thanks!!!

  2. #2

  3. #3
    human
    Join Date
    May 2000
    Posts
    132
    thanks! I finally did a search in the forums and found something....it worked perfectly! Should have done that in the first place! Hind Site - 20/20

    Cheers!!!



  4. #4
    Flash Video Moderator Wheels's Avatar
    Join Date
    Dec 2000
    Location
    Minneapolis
    Posts
    1,590
    Well... Where is it? Do share.

  5. #5
    human
    Join Date
    May 2000
    Posts
    132
    Make a MC that has this actionscript on it and drop it on the timeline of the MC that contains your movie
    Code:
    onClipEvent (enterFrame) {
       if (parent.mode == "reverse") {
           _parent.prevFrame();
       }else {
           _parent.nextFrame();
       }
    }

    In the MC that contains your video put a lable on frame 1 called "forward" and on the last frame of your movie put a label called "reverse"

    This worked very well for me!
    I found the code in the video forum, but can't remember who was the clever poster of the info.
    Luck!

  6. #6
    Flash Video Moderator Wheels's Avatar
    Join Date
    Dec 2000
    Location
    Minneapolis
    Posts
    1,590
    So you are just reversing if the movie reaches the last frame?

    You could write a function:

    Code:
    // on first frame (root)
    _root.runReverse = false;
         function reverseIt() {
    	          this.onEnterFrame = function() {
    		          if (runReverse) {
    			              stop();
    			              prevFrame();
    		          } else {
    			              play();
    		              	this.onEnterframe = null;
    		          }
    	      };
    } 
    
    //  then on last frame
    
    stop();
    _root.runReverse= true;
    reverseIt();
    This could be more effiecient, since it will only run when you call it. That way there is no event running while the video is playing forward, only backward.
    Last edited by Wheels; 11-25-2002 at 02:21 PM.

  7. #7
    human
    Join Date
    May 2000
    Posts
    132
    so if there is a script running constantly, does it slow down the play of the movie?
    or is this better if you have a situation where you might not reach the last frame?
    thanks!

  8. #8
    Flash Video Moderator Wheels's Avatar
    Join Date
    Dec 2000
    Location
    Minneapolis
    Posts
    1,590
    I just tested it and made some changes, so I edited the code.

    You can call the function with a button as well:

    Code:
    on(release){
          _root.runReverse = true;
          reverseIt();
    }
    Yes, this will keep from having a script running in the background at all times. It is always best not to run an event unless you have to - especially with video. This is one of the nice new features of scripting with MX.
    Last edited by Wheels; 11-25-2002 at 02:12 PM.

  9. #9
    Escape artist condorcet's Avatar
    Join Date
    Jun 2001
    Location
    Australia
    Posts
    133
    Originally posted by meredith

    In the MC that contains your video put a lable on frame 1 called "forward" and on the last frame of your movie put a label called "reverse"

    this may be a really silly question but here goes:

    how do you put a label on frame one and the last frame? When i import the video it lays out over all the frame, then when you try to create a frame it asks if you need to add all the frames to handle the vid again? am i doing somehting wrong? do i need to add empty frames or another layer??
    You can't have everything...where would you put it?

  10. #10
    Flash Video Moderator Wheels's Avatar
    Join Date
    Dec 2000
    Location
    Minneapolis
    Posts
    1,590
    Right, just create another layer and make key frames at each end and lable the frames in the properties inspector.

    You can add as much other content this way as you like. You just do it on other layers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center