0
var menu_open:Boolean = true;
MenuContainer1.MenuContainer2.logo.nav_button.addEventListener(MouseEvent.CLICK,onNav2);
function onNav2(event:MouseEvent):void{
if (menu_open) {
trace (menu_open);
MenuContainer1.gotoAndPlay(1);
menu_open = false;
trace ("open");
trace (menu_open);
} else {
trace (menu_open);
MenuContainer1.gotoAndPlay(2);
menu_open = true;
trace ("close");
trace (menu_open);
}
}
stop();
爲什麼這不起作用它不跟蹤其他時,當我點擊,但如果之前我編譯我交換「var menu_open:Boolean = true;」到「var menu_open:Boolean = false;」它確實跟蹤其他!如果裏面的按鈕不起作用
在發佈之前,您是否真的閱讀過您的代碼? 你最初設置menu_open爲true,所以點擊你會進入if(menu_open)部分,不是? – schellmax 2011-03-09 14:20:27