当我点击我的按钮时,我希望其中一个mc完全消失(第一个alpha从1变为0)然后removeChild。
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
main.btn.addEventListener(MouseEvent.CLICK, buttonClickHandler);
function buttonClickHandler(event:MouseEvent):void
{
var aBlend = new Tween(main, "alpha", Strong.easeOut, 1, 0, 3, true);
aBlend.addEventListener(TweenEvent.MOTION_FINISH, end); //doesnt work
}
function end()
{
this.removeChild(mc);
}
我决定使用活动,但它不起作用,任何人都可以帮助我吗?
答案 0 :(得分:2)
尝试按照此帖子的建议在buttonClickHandler之外移动aBlend声明:
即
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
main.btn.addEventListener(MouseEvent.CLICK, buttonClickHandler);
var aBlend;
function buttonClickHandler(event:MouseEvent):void
{
aBlend = new Tween(main, "alpha", Strong.easeOut, 1, 0, 3, true);
aBlend.addEventListener(TweenEvent.MOTION_FINISH, end); //doesnt work
}
function end(event:TweenEvent)
{
this.removeChild(mc);
}