Jump to content
Search Community

Playing parts of a MovieClip in reverse

mosk test
Moderator Tag

Recommended Posts

I have a movie clip called myClip which is 100 frames long and has labels at the following frames:

0-start; 50-middle; 100-end

 

Can someone explain how to make my myClip play from start to middle and back to start during a mouse ROLL_OVER event for one button,

and from end to middle to end when I roll over another button.

 

Ideally I'd be able to loop over those ranges as well (so keep bouncing from start to middle to start to middle until ROLL_OUT from button).

 

I'm pretty sure this can be done through Greensock's Tweening and Timeline platform, but can't quite get it working.

 

Thanks for any assistance.

Link to comment
Share on other sites

sure just use the FrameLabelPlugin

 

here is an example of the FramePlugin, which works virtually the same way:

 

http://www.snorkl.tv/2010/10/overview-o ... backwards/

 

 

 


import com.greensock.*;
import com.greensock.easing.*;

//tween myClip to frame middle and back to beginning indefinitely

TweenMax.to(myClip, 1, {frameLabel:"middle", repeat:-1, yoyo:true, ease:Linear.easeNone})

//or try

//tween myClip from end to middle to end to middle indefinitely

//TweenMax.fromTo(myClip, 1, {frameLabel:"end"}, {frameLabel:"middle", ease:Linear.easeNone, repeat:-1, yoyo:true})

 

based on your framerate you may have to adjust the duration: frames/frameRate = duration

 

100frames / 25fps = duration of 4 seconds.

 

--

 

also in your tween you can set useFrames:true and just pass in the number of frames for the duration

 

please read the getting started guide: http://www.greensock.com/get-started-tweening/

Link to comment
Share on other sites

Hey carl -

 

Thanks for the detailed reply with code and links.

I've watched a number of your tutorials (and just watched the one you linked to in your reply) - and they're some of the best ones out there. You do a great job at mixing the necessary coding details with examples that show real world functionality, and while I was reluctant to add Greensock onto the teetering stack of web programs / platforms / languages that I'm trying to get a handle on, your tutorials helped convince me to make the leap - so much thanks for those as well.

 

Have things working nicely now, and look forward to using the increased timeline flexibility in future projects.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...