Ultrashock Forums > Flash > Flash Professional
• Tweener: Dynamically controlling the animation?
Member Blogs
 
Post Reply | View first unread | Rate Thread Search this Thread | Thread Tools | Display Modes

#1
Bookmark and Share!
Tweener: Dynamically controlling the animation?
Old 2008-07-17

Picture this scenario...

I have a slider that has the values of 0-100.
If I have the slider at the value of 0 my tweener animation would be at time 0 of the animation. If the slider is at value 100, then my tweener animation would be at the time of 100 (or however long my animation is).

Is there a way to control that with Tweener?

The reason I want to use Tweener is because I'm doing this in a Papervision project and the path it is animating along is a curvy complex path.
postbit arrow 3 comments | 281 views postbit arrow Reply: with Quote   
Pain
Registered User
Pain is offline
seperator
Posts: 30
2001-10-17
Age: 29
Pain lives in United States
seperator

Ultrashock Member Comments:
Gregaz81's Avatar Gregaz81 Gregaz81 is offline Gregaz81 lives in Sweden 3 Blog Entries 2008-07-18 #2 Old  
by "time" are you talking about the time for the animation to complete or do you mean "frame-wise"?
If yourŽre talking about the time of the animation you could set up variables to control this
(guessing your using AS3 then )
var _time:uint = 0;
var _frame:uint = 0;

you could then use a timer with interval you wanna to check what current value the slider got then pass in the value as "time" in your tweener-code

Oopps.. gotta run but IŽll see if I can help you out more later..
Is this what your looking for=?
Reply With Quote  
Pain Pain is offline Pain lives in United States 2008-07-18 #3 Old  
Thanks Gregaz,
Not quite what I'm after though.

Hmmm, how to explain... Imagine your tweener animation, it has 0-100%. 0% being the start of your animation and 100% being the end of your animation. How could I control how far into the animation it is? Or is it possible to jump back and forth in the animation? Hope this helps to explain it better.
Reply With Quote  
Gregaz81's Avatar Gregaz81 Gregaz81 is offline Gregaz81 lives in Sweden 3 Blog Entries 2008-07-18 #4 Old  
Hey.. okey now I get it.

Im not using Tweener myself, Im using TweenMax which I find more robust and better in many ways

You can download TweenMax from here

TweenMax got a great function called, (very logic) "progress" you can use it like this:

ActionScript Code:
  1. import gs.TweenMax;
  2. var myTween = TweenMax.to(mc, 2, {x:300});
  3. myTween.progress = 0.75;
The code above would put your "mc" to x:225 if it started at 0 that is.
Then you could control the "progress" through a variable controlled by your "slider" you mentioned.

Hope this can help you out!
Let me know how it goes.
Reply With Quote  
Thread Tools
Display Modes Rate This Thread
Rate This Thread: