事件目标是可访问的(将在事件处理程序参数对象中传递),如下所示:
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);
}
干杯迈克