AS3.0等待补间完成
当我单击按钮时,我希望其中一个 mc 完全消失(第一个 alpha 从 1 变为 0),然后删除Child。
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);
}
我决定使用事件,但它不起作用,有人可以帮助我吗?
When I click my button I wish one of mc's disapear completely(first alpha changes from 1 to 0) then 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);
}
I dicided to use events but it doesnt work, can anyone help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试按照这篇文章的建议将 aBlend 声明移到 ButtonClickHandler 之外:
http://www.actionscript.org/forums/showpost.php3?s=e4e6512ae627e7810c4e991691324b9f&p=735466&postcount=4
即
Try moving the aBlend declaration outside of the buttonClickHandler as suggested by this post:
http://www.actionscript.org/forums/showpost.php3?s=e4e6512ae627e7810c4e991691324b9f&p=735466&postcount=4
i.e.