[Tweener] onComplete doesn't fire (AS3)

Yvan Touzeau (Intl Vendor) v-yvtouz at microsoft.com
Thu Sep 11 00:32:24 PDT 2008


onComplete is not listening to an event (in the way as far as I know) furthermore, it can handle parameters but then, you pass it as an array called onCompleteParams in the tween object

Tweener.addTween(b, {alpha: 0, delay: 0.6, time: 0.4, transition:"easeOutCubic",onComplete: onTweenComplete, onCompleteParams:[b]});

public function onTweenComplete(b:Bitmap):void {
        trace("Removing: " + b);
}


I don't remember exactly but the scope of the onTweenComplete function could be the tween target (must be tested)
If so, no params are needed

public function onTweenComplete():void {
        trace("Removing: " + this);
}

-----Message d'origine-----
De : tweener-bounces at lists.caurinauebi.com [mailto:tweener-bounces at lists.caurinauebi.com] De la part de Sascha
Envoyé : jeudi 11 septembre 2008 08:35
À : tweener at lists.caurinauebi.com
Objet : [Tweener] onComplete doesn't fire (AS3)

I got this code:

----

var b:Bitmap = p.tweenImage;
Tweener.addTween(b, {x: xPos, time: 0.8, transition: "easeOutCubic"});
Tweener.addTween(b, {y: yPos, time: 0.8, transition: "easeOutCubic"});
Tweener.addTween(b, {scaleX: 0.96, time: 0.8, transition: "easeOutCubic"});
Tweener.addTween(b, {scaleY: 0.96, time: 0.8, transition: "easeOutCubic"});
Tweener.addTween(b, {rotation: r, time: 0.8, transition: "easeOutCubic"});
Tweener.addTween(b, {alpha: 0, delay: 0.6, time: 0.4, transition:
"easeOutCubic",
                                onComplete: onTweenComplete});

public function onTweenComplete(e:Event = null):void
{
        trace("Removing: " + e.target);
}

----


However the onComplete is never fired? I've also tried adding
'onCompleteScope: this' which as I understand it points to the class where
the code is in but the onTweenComplete method is still not called? What am I
doing wrong here?


Sascha


_______________________________________________
Tweener mailing list
Tweener at lists.caurinauebi.com
http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com



More information about the Tweener mailing list