[Tweener] reset and loop a tween
Yvan Touzeau (Intl Vendor)
v-yvtouz at microsoft.com
Wed May 28 01:16:08 PDT 2008
Hello,
Tweener.addTween(ref, {x:ref.x + 450, time:1, delay:5, onComplete:myOnComplete, transition:"easeinoutexpo"});
myOnComplete being a function that will be triggered when the tween is complete.
Scope of the function is the ref itself.
private function myOnComplete():void {
ref.x = refOriginX
Tweener.addTween(ref, {x:ref.x + 450, time:1, delay:10, onComplete:myOnComplete, transition:"easeinoutexpo"});
}
Tweener.addTween(ref, {x:ref.x + 450, time:1, delay:5, onComplete:myOnComplete, transition:"easeinoutexpo"});
This will loop the tween.
De : tweener-bounces at lists.caurinauebi.com [mailto:tweener-bounces at lists.caurinauebi.com] De la part de Jarryd (hotmail)
Envoyé : mercredi 28 mai 2008 09:27
À : tweener at lists.caurinauebi.com
Objet : [Tweener] reset and loop a tween
Is there a way to easily loop a tween? For example I have text that I want a 'shine' to continuously run across the text at set intervals.
Code (AS3):
Tweener.addTween(ref, {x:ref.x + 450, time:1, delay:5, transition:"easeinoutexpo"});
The delay is there for the tweens in front of it to finish. So now all I need to do is reset it back to 'ref.x' (let's say 0), and then repeat it at say every 10 seconds.
I know this is easy to do via the timeline, but I'm curious as to if this is possible with Tweener.
Thanks for any help =).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.caurinauebi.com/pipermail/tweener-caurinauebi.com/attachments/20080528/b416854a/attachment.htm>
More information about the Tweener
mailing list