我想要触发一个位于Movie Clip中的函数
my_mc.addEventListener(MouseEvent.CLICK,myfuntion);
function myfuntion(myEvent:MouseEvent):void
{
MovieClip(this.root).gotoAndStop(44);
tvscreen_mc.function("byby");
}
byby功能位于tvscreen_mc
内function byby(myEvent:MouseEvent):void {
my_player.destroy();
}
答案 0 :(得分:1)
替换
my_mc.addEventListener(MouseEvent.CLICK,myfuntion);
function myfuntion(myEvent:MouseEvent):void
{
MovieClip(this.root).gotoAndStop(44);
tvscreen_mc.function("byby");
}
与
MovieClip(root).my_mc.addEventListener(MouseEvent.CLICK, MovieClip(root).tvscreen_mc.byby);
如果你处于根级别(我假设你是这样,但是你把它放在其他地方),这也会有效:
my_mc.addEventListener(MouseEvent.CLICK, tvscreen_mc.byby);