PDA

View Full Version : Staggering tween events


M.Austin
03-08-2006, 02:05 PM
I'm just starting to experiment with tweening using AS. I can't seem to figure out a method for coding a timeline, though... for example, I have two tweens that both run for 30 frames. But, I don't want the second tween to start until the first tween reaches it's 10th frame. Any advice?

Here are my two tweens, if it helps...

var rotate:Tween = new Tween(_global.trackerout, "_rotation", Elastic.easeOut, 0, 41.4, 30, false);
var width:Tween = new Tween(_global.trackerout, "_width", regular.easeout, _global.trackerout._width, 65, 30, false);

Thanks in advance!

mcmcom
03-08-2006, 02:10 PM
use setInteval. Do something like this:


//first tween should start immediately
var rotate:Tween = new Tween(_global.trackerout, "_rotation", Elastic.easeOut, 0, 41.4, 30, false);
//second tween, wait 10 seconds
tID = setInterval(function () {
var width:Tween = new Tween(_global.trackerout, "_width", regular.easeout, _global.trackerout._width, 65, 30, false);
clearInterval(tID);},10);


hth,
mcm

M.Austin
03-08-2006, 02:16 PM
I hadn't thought about approaching it that way...thanks, I'll give it a try!