我有两个带有 as3 代码的框架:
// frame1:
gotoAndPlay("show controls");
// frame2 - have movieclip with name slide0
// create menu items click listeners
for (var i:int = 0; i < slides.items.length; i++) // slides.items.length = 1
this["menu_item"+i].addEventListener(MouseEvent.CLICK, menu_item_click);
// click on the first menu item
this["menu_item0"].dispatchEvent(new MouseEvent(MouseEvent.CLICK));
// menu item click handler
function menu_item_click(e:MouseEvent):void {
this["slide0"].gotoAndPlay("show");
}
// in movieclip slide0 on frame with label "show"
trace("slide0 show begin");
我收到 2 条消息“slide0 show begin”。但是,当我单击 menu_item0 时,我收到一条消息。
请帮忙 - 哪里出错了?