嗨,此代码在移动符号(传统补间)
上运行良好var frequency = 3;
stage.enableMouseOver(frequency);
this.movieClip_1.addEventListener("mouseover", fl_MouseOverHandler_9);
function fl_MouseOverHandler_9()
{
alert("Moused over");
// this.gotoAndStop(41);
}
但如果我替换为this.gotoAndStop(41);它不起作用
答案 0 :(得分:0)
可以访问事件目标(将在event-handler-parameter-object中传递),如下所示:
this.movieClip_1.addEventListener("mouseover", fl_MouseOverHandler_9);
然后在处理函数中:
function fl_MouseOverHandler_9(evt)
{
// "evt.currentTarget" represents the event-trigger
evt.currentTarget.gotoAndStop(41);
}
或者您可以将所需MC的范围传递给事件处理程序:
this.movieClip_1.addEventListener(“mouseover”,fl_MouseOverHandler_9.bind(this.movieClip_1));
然后在处理函数中:
function fl_MouseOverHandler_9(evt)
{
// "evt.currentTarget" still represents the event-trigger
// evt.currentTarget.gotoAndStop(41);
//but now you can access the referenced scope with "this"
this.gotoAndStop(41);
}
欢呼声 麦克