removeChild after Tweenlite does not really work
I'd like to remove objects via removeChild after Tweenlite has finished tweening. But it doesn't really work because my objects are still in the DisplayList. I can't figure out the problem so I would be very happy if someone could help me out with this problem. Thanks in advance.:)
//TweenLite.to(sndText, .5, {alpha:0, onComplete:removeChild, onCompleteParams:[sndText]});//does not really work; still in DisplayList
TweenLite.to(sndText, .5, {alpha:0});
TweenLite.to(musicText, .5, {alpha:0});
TweenLite.to(sndSlider, .5, {alpha:0});
TweenLite.to(musicSlider, .5, {alpha:0});
TweenLite.to(okBtn, .5, {alpha:0});
TweenLite.to(sndMinus, .5, {alpha:0});
TweenLite.to(sndPlus, .5, {alpha:0});
TweenLite.to(musicMinus, .5,开发者_Python百科 {alpha:0});
TweenLite.to(musicPlus, .5, {alpha:0, onComplete:removeSettings});
//removeChild(sndText); //this works but I don't know why
override public function removeSettings():void {
//removeChild doesn't really work (still in DisplayList)
removeChild(sndText);
removeChild(musicText);
removeChild(sndSlider);
removeChild(musicSlider);
removeChild(okBtn);
removeChild(sndMinus);
removeChild(sndPlus);
removeChild(musicMinus);
removeChild(musicPlus);
}
You should call TweenLite.killTweensOf
before removing the clip:
TweenLite.killTweensOf(sndText);
removeChild(sndText);
精彩评论