How to implement the design await onComplete

24 views
Skip to first unread message

Василий Корягин

unread,
Jan 10, 2020, 9:49:23 AM1/10/20
to StageXL
Hi, I'm sorry for the possibly stupid question.

I have it now
hide(){
 
Tween tweenPic = juggler.addTween(this, 3, Transition.linear);
  tweenPic
.animate.y.to(heightScreen-middlePanel.height);
  tweenPic
.onComplete = (){
   
this.removeFromParent();
 
};
}

I want something like that(That the procedure would be completed after 3 seconds along with the completion of the animation)
hide() async{
 
Tween tweenPic = juggler.addTween(this, 3, Transition.linear);
  tweenPic
.animate.y.to(heightScreen-middlePanel.height);
 
await (tweenPic.onComplete = (){
   
this.removeFromParent();
 
});
}

But the desired design does not work, can this be made workable, thanks.

Reply all
Reply to author
Forward
0 new messages