[Tweener] using count

Joseph Curtin jbcurtinnews at gmail.com
Sun Mar 8 14:08:16 PDT 2009


Extend the box, and add a property that includes count. set count to the
iteration and then on the on complete function, you can check it there. This
may however be less efficient. However easier. (or use the name property
that comes with sprite).

there is also 2 other variants of the if statement for shorthand:

 if(true)
 play();
else stop();

(true) ? play(); : stop();

On Sun, Mar 8, 2009 at 10:11 AM, Ross Hulford <ross at welovethedesign.com>wrote:

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



-- 
-Joe Curtin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.caurinauebi.com/pipermail/tweener-caurinauebi.com/attachments/20090308/f06fae8e/attachment.htm>


More information about the Tweener mailing list