[Tweener] onComplete problem

Zeh Fernando zeh at zehfernando.com
Thu Sep 25 11:57:32 PDT 2008


Your code should work and properly remove it once the animation is done. 
I've used similar code in the past, although I usually create an inline 
function. Here's an example:

var blackBox:BlackBox = new BlackBox();
AppInfo.stage.addChild(blackBox);

(...)

Tweener.addTween(blackBox, {alpha:0, time:0.7, delay:delay, 
transition:"easeinquad", onComplete:function() {
	AppInfo.stage.removeChild(this);
}});

The references on my example are absolute, but regardless, it should 
work on your case too.

Zeh

charlie Montagut wrote:
> Uh infact i ommited it just in my mail. In my original code time is set 
> to 1:
> 
> Tweener.addTween(nomProduit,{scaleX:0.1,rotation :2,y:50, 
> alpha:0,time:1,delay:0.2, transition:"easeOutCubic", onComplete:Next});   
>                
>                
>                 function Next(){
>                    
>                     removeChild(nomProduit);
>                 }
> 
> 
>            
> 
> 2008/9/25 Makc <makc.the.great at gmail.com <mailto:makc.the.great at gmail.com>>
> 
>     you have ommited time parameter so it probably tweens instantly.
> 
>     On Thu, Sep 25, 2008 at 5:37 PM, charlie Montagut
>     <charlie.montagut at gmail.com <mailto:charlie.montagut at gmail.com>> wrote:
>      > Hi everyone,
>      >
>      > Can I remove a child after tweening this child?:
>      > The idea is to have a motion when myClip is added to stage (
>     tweening is
>      > done in the constructor of this myClip), and the another just
>     before it's
>      > removed from the stage.
>      >
>      > For example this code:
>      >
>      > tweener.addTween(myClip,{alpha:0, transition:"linear",
>      > onComplete:removeMyClip})
>      >
>      > function removeMyClip() {
>      >
>      > removeChild(myClip);
>      >
>      > }
>      >
>      > Because i tried to do something similar, and the child is removed
>     during the
>      > tweening motion. I don't understand where i failed.
>      >
>      > if anybody knows a method to do this or have an answer...
>      >
>      > Thanks you all.
>      >
>      > Charlie
>      >
>      >
>      >
>      > _______________________________________________
>      > Tweener mailing list
>      > Tweener at lists.caurinauebi.com <mailto:Tweener at lists.caurinauebi.com>
>      > http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com
>      >
>      >
>     _______________________________________________
>     Tweener mailing list
>     Tweener at lists.caurinauebi.com <mailto:Tweener at lists.caurinauebi.com>
>     http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com
> 
> 
> 
> 
> -- 
> ______________________________________
> 
> Charlie Montagut - Etudiant 2eme Année SRC
> 
>    tel : 0683332559 -
>    skype: charlie montagut
>    web: www.charlie-montagut.com <http://www.charlie-montagut.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