Hey Isaac. What exactly are you trying to accomplish with the
renderTime(10)? Your example tween was only 1 second long, so where does the
10 come from? If you want to skip to a certain time in a TweenMax tween,
make sure you're using the latest v11 (http://blog.greensock.com/v11beta/)
and just set the currentTime property like myTween.currentTime = 10 would
make it go to the 10-second point. Or use the currentProgress property
(always between 0 and 1 where 0.5 is halfway finished) like
myTween.currentProgress = 0.5. Don’t use renderTime() - use the currentTime,
currentProgress, totalTime, or totalProgress getters/setters. The
convenience of these getters/setters is that they can easily be tweened for
advanced effects.

And there's an easier way to accomplish your repeatReverse() functionality.
Just use the yoyo and repeat features like:

var plantaTween:TweenMax = new TweenMax(planta, 1, {y:414, repeat:1,
yoyo:true, ease:Sine.easeInOut});

That'll repeat it once and since yoyo is true, it'll play forward the first
time through and backwards the second time through. 

Full ASDoc documentation is at http://www.greensock.com/as/docs/tween/

Again, make sure you've got v11: http://blog.greensock.com/v11beta/. Feel
free to use the forums at http://forums.greensock.com for these types of
questions. I try to be pretty active in responding there.

Jack

PS For the record, TweenLite/Max does NOT use a Timer to drive updates. It's
ENTER_FRAME driven which is generally optimal for many reasons (I won't bore
you with an explanation here). You can have any tween base its timing on
frames instead of time if you prefer (new in v11) by setting useFrames:true.

-----Original Message-----
From: Isaac Alves [mailto:isaacal...@gmail.com] 
Sent: Monday, September 14, 2009 9:04 AM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] Re: time based smooth animation w/ GTween. HELP!

Hey Joel, so, I´m giving a try with TweenMax.

as far as I understood, tweenmax´s default timing mode is set to "time
based" , not frame.
how can I change then the renderTime? I-ve tried to do so but no success.

var plantaTween:TweenMax = new TweenMax(planta, 1, {y:414, onComplete:
repeatReverse, immediateRender:true, ease:Sine.easeInOut});

//  TweenMax.renderTime(10);
// this doesn´t work, how should I set it ?
                        
function repeatReverse():void
{
        plantaTween.reverse();
}

thanks!

----------------------------------------------------------------------
Grant has now merged forces with Jack Doyle, author of TweenLite, TweenMax
and TweenGroup. The syntax is almost identical and I think you'll have an
easier time achieving the effect you want. A tweens "pulse" can be updated
via a setInterval, use of a Timer object, based on the milliseconds a flash
movie has been running (getTime) or Enter_Frame events. Enter_Frame has
proven to be the most reliable but due to differences in computer speed and
network conditions none of them are bullet proof. TweenLite, I believe uses
a combination of enter_frame and a Timer where the pulse is updated via
enter_frame and the Timer object is then used to determine exactly which
"frame" of the tween is to be rendered. This means if for some reason the
flash movie lags, you may see a jump in animation in order to complete in
the time you've allotted. You do not have to specify this when using
TweenLite but keep in mind your movies framerate, the distance of the tween
and the amount of time you are allowing for the tween to finish all factor
in to the smoothness of playback.

On Fri, Sep 11, 2009 at 10:48 AM, Isaac Alves <isaacal...@gmail.com> wrote:

> Hello!
>
> I would like to create a time based and very smooth animation with
> GTween (or another one).
> But I´m used to GTween , though.
>
> here is my code:
>
> var plantaTween = new GTween(planta, 1.5, {y: 414}, {delay: 0.8,
> reversed: true, reflect: true, repeat: 999, ease:Quartic.easeInOut});
>
> I´ve read the following examples in Gtween´s documentation and
> somewhere else but i can-t quite understand it ......
>
>         GTween.timingMode = GTween.TIME;
>
> at http://www.gskinner.com/blog/archives/2008/08/gtween_a_new_tw.html
>
> should I use:
>  plantaTween.timingMode = GTween.TIME;
> or:
>  GTween.timingMode = GTween.TIME; ?
>
> What does the latter exactly means? it doesn´t do nothing. maybe cause
> the default timeInterval property is 25ms. how do i set it ?
>
> the first one throws a reference error Error #1056:
>
> and i-ve seen this also at the documentation
> http://www.gskinner.com/libraries/gtween/docs/
>
>     Implementation
>         public static function get timeInterval():uint
>         public function set timeInterval(value:uint):void
>
>     Implementation
>         public static function get timingMode():String
>         public function set timingMode(value:String):void
>
> but cannot figure out how to implement it...
>
> help ! thanks !





_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to