[Tweener] using count
Ross Hulford
ross at welovethedesign.com
Sun Mar 8 07:55:56 PDT 2009
Thanks,
I think that way is an option I was (as always) looking to reduce the
number of lines of code.
Cheers,
Ross
On 8 Mar 2009, at 14:53, Graeme Blackwood wrote:
> Oh sorry, might have helped if I had read your email fully. My bad!
> I confess I haven't used the count tweens stuff, so I am as
> interested as you are for a slightly more helpful response than mine
> hehe.
>
> --------------------------------------------------
> From: "Graeme Blackwood" <grayhammy at hotmail.com>
> Sent: Sunday, March 08, 2009 2:39 PM
> To: <tweener at lists.caurinauebi.com>
> Subject: Re: [Tweener] using count
>
>> 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
>>>
>> _______________________________________________
>> Tweener mailing list
>> Tweener at lists.caurinauebi.com
>> http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com
> _______________________________________________
> Tweener mailing list
> Tweener at lists.caurinauebi.com
> http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com
More information about the Tweener
mailing list