Jump to content
Search Community

TimelineLite and Tweens involving functions.

rob_v_5712 test
Moderator Tag

Recommended Posts

Well I have been diving head first into TimelineLite and so far love it.  Since I moved to v12 - things just seem to be alot easier for me to control.

 

I have a question that I hope someone can help me out with.

Out side the scope of this post - I need to move my animations to use timelineLite (or Max).

 

Here is the situation.

 

I currently have an animation that has 10 arrows fly in and points to 10 boxes. Those 10 boxes then start display random numbers for a few seconds then stops.

 

To do this, I just created a simple MC that is just a dynamic text box with flipping numbers.

They are named numBox_X - where X is just a number 0 - 9.  So numBox_0, numBox_2, etc...

 

Its 60 frames, every 5 frames I have it generate a random number and display it in the text box, then at the end it stops, so all 10 MCs at the end display 10 different numbers.

 

Right now I just tween in the arrows (using TweenLite), then on the timeline I would just add actionScript numBox_X.gotoAndPlay('flip');

(where X is the number box I want to start flipping).

 

 

I have a few other things along the same line where I have multiple MCs on the stage that have animations in them.

 

I can use timelineLite to get the arrows in as well as the boxes, Im just having trouble understanding how to fire off the number flipper MC.  And once I do get it to fire off, how can I reverse it?

 

I have no problem at all if I need to re-write things - Just looking for the best way to handle this type of situation or is that outside the scope of what TimelineMax/Lite and handle?

 

As Im writing this - Im thinking something along the lines of tweening in the box - then call a function.

Im going to start working on it, but figure Id throw a post out here as well for some suggestions.

 

Thanks again for a killer product!

 

Link to comment
Share on other sites

If you use the frame plugin (activated with TweenMax) you can tween through frames of a movieclip and then that tween can be added to a timeline (and thus reversed);

 

you can do something like this

//import and activate frame plugin just in case you aren't using TweenMax
import com.greensock.plugins.*;
TweenPlugin.activat([FramePlugin]);

var timeline = new TimelineLite();
timeline.to(number_mc, 0.5, {frame:20})
.to(number2_mc, 0.5, {frame:30})

here's an example and description of Frame and FrameLabelPlugin http://www.snorkl.tv/2010/10/overview-of-tweenmax-framelabel-and-frame-plugins-nifty-way-to-play-a-flash-timeline-backwards/

Link to comment
Share on other sites

  • 2 weeks later...

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...