actionscript 3 - AS3 Menu not detecting clicks -
i've got buttons navigate around timeline. trying make switch statement save me time writing code. i've come with, doesn't work. buttons each have rollover function works fine. traces in there debugging.
for (var a=0; a<mainbuttons.length; a++){ mainbuttons[a].buttonmode = true; mainbuttons[a].addeventlistener(rolled, hidedbases); mainbuttons[a].addeventlistener(clicked, switchview); } function switchview(e:event):void { switch (e.target.name) { case "count_btn": gotoandplay(4); trace("count"); break; case "order_btn": gotoandplay(5); trace("order"); break; case "admin_btn": gotoandplay(6); trace("admin"); break; case "serve_btn": gotoandplay(7); trace("service"); break; case "video_btn": gotoandplay(8); trace("video"); break; } }
turns out needed give graphic in same instance name main movieclip. button made gradient, text box , icon. 3 elements movieclips , made 1 main movieclip. if parent's instance called count_btn had call gradient background's instance count_btn. don't know why problem solved.
Comments
Post a Comment