[Tweener] using count

Graeme Blackwood grayhammy at hotmail.com
Sun Mar 8 07:39:11 PDT 2009


Surely you can just do an if statement to check the count variable i, and if 
it is 10, write the tweener out with the onComplete, otherwise just write it 
out without it?

i.e.

if (i==10) {
     Tweener.addTween(square, {width:930, time:1, transition:"easeOutBack", 
delay:delayNum, onComplete:Function });
} else {
     Tweener.addTween(square, {width:930, time:1, transition:"easeOutBack", 
delay:delayNum});
}

any help?

--------------------------------------------------
From: "Ross Hulford" <ross at welovethedesign.com>
Sent: Sunday, March 08, 2009 2:11 PM
To: <tweener at lists.caurinauebi.com>
Subject: [Tweener] using count

> Hi,
>
> I am using tweener with the code below the problem is I do not know  when 
> the last square is tweened. Can someone suggest a way to  determine when 
> box 10 has finished so I can use onComplete.
>
> I could use a if i=10 at the bottom but thought there may be a better  way 
> with Tweener's in-built features like count.
>
>
> thanks.
>
>
>
> function createWhiteBox():void {
>
>
> for (var i:uint=0; i<10; i++) {
>
>
>                 var square:Sprite = new Sprite();
>
>                 square.graphics.beginFill(0xffffff, 0.9);
>                 square.graphics.drawRect(0,0,0.1,60);
>                 square.graphics.endFill();
>
>  square.y = i * 60;
>
>
>                 whiteBox.addChild(square);
>
>    var delayNum = i/4;
>                 Tweener.addTween(square, {width:930, time:1, 
> transition:"easeOutBack", delay:delayNum });
>
>
>
>
>
>
> }
>
> }
> _______________________________________________
> Tweener mailing list
> Tweener at lists.caurinauebi.com
> http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com
> 


More information about the Tweener mailing list