我想知道是否有人可以揭示我的代碼?它似乎正常工作沒有任何錯誤,但某些按鈕不起作用。 (即打算投資菜單,然後進入「查看公文包」,「投資」和「‘OK’按鈕將無法使用。)按鈕無法正常工作
這裏是整個代碼。
import flash.events.MouseEvent;
bg.stop();//Buttons
bg.ok.addEventListener(MouseEvent.CLICK, menu);
function menu(m:MouseEvent):void
{
trace(m.target.name);
trace(bg.currentFrame);
if (bg.currentFrame == 1)
{
bg.ok.removeEventListener(MouseEvent.CLICK, menu);
bg.gotoAndStop(2);
bg.menubtn.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame == 2 || bg.currentFrame == 4 && m.target.name == "Menubtn4" || bg.currentFrame == 5 && m.target.name == "Menubtn5" || bg.currentFrame == 6 && m.target.name == "backtomain" || bg.currentFrame == 7 && m.target.name == "Menubtn7" || bg.currentFrame == 9 && m.target.name == "Menubtn9" || bg.currentFrame == 13 && m.target.name == "Menubtn13" || bg.currentFrame == 20 && m.target.name == "backtomenu20" || bg.currentFrame == 24 && m.target.name == "Menubtn24" || bg.currentFrame == 27 && m.target.name == "backtomenu27")
{
if (m.target.name == "menubtn")
{
bg.menubtn.removeEventListener(MouseEvent.CLICK, menu);
}
else if (m.target.name == "Menubtn4")
{
bg.Menubtn4.removeEventListener(MouseEvent.CLICK, menu);
}
else if (m.target.name == "Menubtn5")
{
bg.Menubtn5.removeEventListener(MouseEvent.CLICK, menu);
}
else if (m.target.name == "backtomain")
{
bg.backtomain.removeEventListener(MouseEvent.CLICK, menu);
}
else if (m.target.name == "Menubtn7")
{
bg.Menubtn7.removeEventListener(MouseEvent.CLICK, menu);
}
else if (m.target.name == "Menubtn9")
{
bg.Menubtn9.removeEventListener(MouseEvent.CLICK, menu);
}
else if (m.target.name == "Menubtn13")
{
bg.Menubtn13.removeEventListener(MouseEvent.CLICK, menu);
}
else if (m.target.name == "backtomenu20")
{
bg.backtomenu20.removeEventListener(MouseEvent.CLICK, menu);
}
else if (m.target.name == "Menubtn24")
{
bg.Menubtn24.removeEventListener(MouseEvent.CLICK, menu);
}
else if (m.target.name == "backtomenu27")
{
bg.backtomenu27.removeEventListener(MouseEvent.CLICK, menu);
}
bg.gotoAndStop(3);
bg.Balinq.addEventListener(MouseEvent.CLICK, menu);
bg.Transinq.addEventListener(MouseEvent.CLICK, menu);
bg.Fintrxns.addEventListener(MouseEvent.CLICK, menu);
bg.invest.addEventListener(MouseEvent.CLICK, menu);
bg.others.addEventListener(MouseEvent.CLICK, menu);
bg.passchange.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame==3)
{
bg.Balinq.removeEventListener(MouseEvent.CLICK, menu);
bg.Transinq.removeEventListener(MouseEvent.CLICK, menu);
bg.Fintrxns.removeEventListener(MouseEvent.CLICK, menu);
bg.invest.removeEventListener(MouseEvent.CLICK, menu);
bg.others.removeEventListener(MouseEvent.CLICK, menu);
bg.passchange.removeEventListener(MouseEvent.CLICK, menu);
if (m.target.name == "Balinq")
{
bg.gotoAndStop(2);
bg.menubtn.addEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "Transinq")
{
bg.gotoAndStop(4);
bg.Menubtn4.addEventListener(MouseEvent.CLICK, menu);
bg.okbtn4.addEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "Fintrxns")
{
bg.gotoAndStop(6);
bg.backtomain.addEventListener(MouseEvent.CLICK, menu);
bg.transown.addEventListener(MouseEvent.CLICK, menu);
bg.transthird.addEventListener(MouseEvent.CLICK, menu);
bg.transanyone.addEventListener(MouseEvent.CLICK, menu);
bg.billsdeposit.addEventListener(MouseEvent.CLICK, menu);
bg.billscredit.addEventListener(MouseEvent.CLICK, menu);
bg.reloadphone.addEventListener(MouseEvent.CLICK, menu);
bg.reloadwallet.addEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "others")
{
bg.gotoAndStop(20);
bg.backtomenu20.addEventListener(MouseEvent.CLICK, menu);
bg.checkbook.addEventListener(MouseEvent.CLICK, menu);
bg.stoppay.addEventListener(MouseEvent.CLICK, menu);
bg.enrollacct.addEventListener(MouseEvent.CLICK, menu);
bg.enrollthird.addEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "passchange")
{
bg.gotoAndStop(24);
bg.Menubtn24.addEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "invest")
{
bg.gotoAndStop(27);
bg.backtomenu27.addEventListener(MouseEvent.CLICK, menu);
bg.viewport.addEventListener(MouseEvent.CLICK, menu);
bg.viewhist.addEventListener(MouseEvent.CLICK, menu);
bg.subscribe.addEventListener(MouseEvent.CLICK, menu);
bg.redeem.addEventListener(MouseEvent.CLICK, menu);
}
}
else if (bg.currentFrame==4)
{
bg.Menubtn4.removeEventListener(MouseEvent.CLICK, menu);
bg.okbtn4.removeEventListener(MouseEvent.CLICK, menu);
bg.gotoAndStop(5);
bg.Menubtn5.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame==6)
{
bg.backtomain.removeEventListener(MouseEvent.CLICK, menu);
bg.transown.removeEventListener(MouseEvent.CLICK, menu);
bg.transthird.removeEventListener(MouseEvent.CLICK, menu);
bg.transanyone.removeEventListener(MouseEvent.CLICK, menu);
bg.reloadphone.removeEventListener(MouseEvent.CLICK, menu);
if (m.target.name == "transown")
{
bg.gotoAndStop(7);
bg.Menubtn7.addEventListener(MouseEvent.CLICK, menu);
bg.okbtn7.addEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "transthird")
{
bg.gotoAndStop(9);
bg.Menubtn9.addEventListener(MouseEvent.CLICK, menu);
bg.okbtn9.addEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "transanyone")
{
bg.gotoAndStop(13);
bg.Menubtn13.addEventListener(MouseEvent.CLICK, menu);
bg.okbtn13.addEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "billsdeposit")
{
bg.gotoAndStop(15);
bg.finbtn15.addEventListener(MouseEvent.CLICK, menu);
bg.okbtn15.addEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "billscredit")
{
bg.gotoAndStop(28);
bg.finbtn28.addEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "reloadphone")
{
bg.gotoAndStop(17);
bg.finbtn17.addEventListener(MouseEvent.CLICK, menu);
bg.okbtn17.addEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "reloadwallet")
{
bg.gotoAndStop(18);
bg.finbtn18.addEventListener(MouseEvent.CLICK, menu);
}
}
else if (bg.currentFrame==7)
{
bg.Menubtn7.removeEventListener(MouseEvent.CLICK, menu);
bg.okbtn7.removeEventListener(MouseEvent.CLICK, menu);
if (m.target.name == "okbtn7")
{
bg.gotoAndStop(8);
bg.finbtn8.addEventListener(MouseEvent.CLICK, menu);
}
} ;/*current frame 8*/
}
else if (m.target.name=="finbtn8" || m.target.name=="finbtn10" || m.target.name=="finbtn11" || m.target.name=="finbtn12" || m.target.name=="finbtn14" || m.target.name=="finbtn15" || m.target.name=="finbtn16" || m.target.name=="finbtn17" || m.target.name=="finbtn18" ||m.target.name=="finbtn26" ||m.target.name=="finbtn28")
{
if (m.target.name == "finbtn8")
{
bg.finbtn8.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "finbtn10")
{
bg.finbtn10.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "finbtn11")
{
bg.finbtn11.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "finbtn12")
{
bg.finbtn12.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "finbtn14")
{
bg.finbtn14.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "finbtn15")
{
bg.finbtn15.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "finbtn16")
{
bg.finbtn16.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "finbtn17")
{
bg.finbtn17.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "finbtn18")
{
bg.finbtn18.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "finbtn26")
{
bg.finbtn26.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "finbtn28")
{
bg.finbtn28.removeEventListener(MouseEvent.CLICK, menu);
}
bg.gotoAndStop(6);
bg.backtomain.addEventListener(MouseEvent.CLICK, menu);
bg.transown.addEventListener(MouseEvent.CLICK, menu);
bg.transthird.addEventListener(MouseEvent.CLICK, menu);
bg.transanyone.addEventListener(MouseEvent.CLICK, menu);
bg.billsdeposit.addEventListener(MouseEvent.CLICK, menu);
bg.billscredit.addEventListener(MouseEvent.CLICK, menu);
bg.reloadphone.addEventListener(MouseEvent.CLICK, menu);
bg.reloadwallet.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame==9 || m.target.name=="backbtn11")
{
if (bg.currentFrame == 9)
{
bg.Menubtn9.removeEventListener(MouseEvent.CLICK, menu);
bg.okbtn9.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "backbtn11")
{
bg.finbtn11.removeEventListener(MouseEvent.CLICK, menu);
bg.okbtn11.removeEventListener(MouseEvent.CLICK, menu);
bg.backbtn11.removeEventListener(MouseEvent.CLICK, menu);
}
bg.gotoAndStop(10);
bg.finbtn10.addEventListener(MouseEvent.CLICK, menu);
bg.okbtn10.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame==10)
{
bg.finbtn10.removeEventListener(MouseEvent.CLICK, menu);
bg.okbtn10.removeEventListener(MouseEvent.CLICK, menu);
bg.gotoAndStop(11);
bg.finbtn11.addEventListener(MouseEvent.CLICK, menu);
bg.okbtn11.addEventListener(MouseEvent.CLICK, menu);
bg.backbtn11.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame==11)
{
bg.finbtn11.removeEventListener(MouseEvent.CLICK, menu);
bg.okbtn11.removeEventListener(MouseEvent.CLICK, menu);
bg.backbtn11.removeEventListener(MouseEvent.CLICK, menu);
bg.gotoAndStop(12);
bg.finbtn12.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame==13)
{
bg.Menubtn13.removeEventListener(MouseEvent.CLICK, menu);
bg.okbtn13.removeEventListener(MouseEvent.CLICK, menu);
bg.gotoAndStop(14);
bg.finbtn14.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame==15)
{
bg.finbtn15.removeEventListener(MouseEvent.CLICK, menu);
bg.okbtn15.removeEventListener(MouseEvent.CLICK, menu);
bg.gotoAndStop(16);
bg.finbtn16.addEventListener(MouseEvent.CLICK, menu);
bg.backbtn16.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame==16)
{
bg.gotoAndStop(15);
bg.finbtn15.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame==17)
{
bg.finbtn17.removeEventListener(MouseEvent.CLICK, menu);
bg.okbtn17.removeEventListener(MouseEvent.CLICK, menu);
bg.gotoAndStop(26);
bg.finbtn26.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame==20)
{
bg.backtomenu20.removeEventListener(MouseEvent.CLICK, menu);
bg.checkbook.removeEventListener(MouseEvent.CLICK, menu);
bg.stoppay.removeEventListener(MouseEvent.CLICK, menu);
bg.enrollacct.removeEventListener(MouseEvent.CLICK, menu);
bg.enrollthird.removeEventListener(MouseEvent.CLICK, menu);
if (m.target.name == "checkbook")
{
bg.gotoAndStop(21);
bg.otherbtn21.addEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "stoppay")
{
bg.gotoAndStop(22);
bg.otherbtn22.addEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "enrollacct")
{
bg.gotoAndStop(23);
bg.otherbtn23.addEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "enrollthird")
{
bg.gotoAndStop(25);
bg.otherbtn25.addEventListener(MouseEvent.CLICK, menu);
}
}
else if (m.target.name=="otherbtn21" || m.target.name=="otherbtn22" || m.target.name=="otherbtn23" || m.target.name=="otherbtn25")
{
if (m.target.name == "otherbtn21")
{
bg.otherbtn21.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "otherbtn22")
{
bg.otherbtn22.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "otherbtn23")
{
bg.otherbtn23.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "otherbtn25")
{
bg.otherbtn25.removeEventListener(MouseEvent.CLICK, menu);
}
bg.gotoAndStop(20);
bg.backtomenu20.addEventListener(MouseEvent.CLICK, menu);
bg.checkbook.addEventListener(MouseEvent.CLICK, menu);
bg.stoppay.addEventListener(MouseEvent.CLICK, menu);
bg.enrollacct.addEventListener(MouseEvent.CLICK, menu);
bg.enrollthird.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame==27)
{
bg.backtomenu27.removeEventListener(MouseEvent.CLICK, menu);
bg.viewport.removeEventListener(MouseEvent.CLICK, menu);
bg.viewhist.removeEventListener(MouseEvent.CLICK, menu);
bg.subscribe.removeEventListener(MouseEvent.CLICK, menu);
bg.redeem.removeEventListener(MouseEvent.CLICK, menu);
if (m.target.name == "viewport")
{
bg.gotoAndStop(29);
bg.backtoinvest29.addEventListener(MouseEvent.CLICK, menu);
bg.okinvest1.addEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "viewhist")
{
bg.gotoAndStop(32);
bg.backtoinvest32.addEventListener(MouseEvent.CLICK, menu);
bg.donebtn32.addEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "subscribe")
{
bg.gotoAndStop(35);
bg.backtoinvest35.addEventListener(MouseEvent.CLICK, menu);
bg.donebtn35.addEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "redeem")
{
bg.gotoAndStop(42);
bg.backtoinvest42.addEventListener(MouseEvent.CLICK, menu);
bg.okinvest4.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame==29)
{
bg.backtoinvest29.removeEventListener(MouseEvent.CLICK, menu);
bg.okinvest1.removeEventListener(MouseEvent.CLICK, menu);
if (m.target.name == "okinvest1")
{
bg.gotoAndStop(30);
bg.backtoinvest30.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame ==30)
{
bg.backtoinvest30.removeEventListener(MouseEvent.CLICK, menu);
bg.donebtn30.addEventListener(MouseEvent.CLICK, menu);
if (m.target.name == "donebtn30")
{
bg.gotoAndStop(31);
bg.backtoinvest31.addEventListener(MouseEvent.CLICK, menu);
}
}
else if (m.target.name=="backtoinvest29" || m.target.name=="backtoinvest30" || m.target.name=="backtoinvest31" || m.target.name=="backtoinvest32" || m.target.name=="backtoinvest33" || m.target.name=="backtoinvest34" || m.target.name=="backtoinvest35" || m.target.name=="backtoinvest36" || m.target.name=="backtoinvest37" || m.target.name=="backtoinvest38" ||m.target.name=="backtoinvest39" || m.target.name=="backtoinvest41" || m.target.name=="backtoinvest42" || m.target.name=="backtoinvest43" || m.target.name=="backtoinvest44" || m.target.name=="backtoinvest45" || m.target.name=="backtoinvest46" || m.target.name=="backtoinvest47" || m.target.name=="backtoinvest48")
{
if (m.target.name == "backtoinvest29")
{
bg.backtoinvest29.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "backtoinvest30")
{
bg.backtoinvest30.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "backtoinvest31")
{
bg.backtoinvest31.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "backtoinvest32")
{
bg.backtoinvest32.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "backtoinvest33")
{
bg.backtoinvest33.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "backtoinvest34")
{
bg.backtoinvest34.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "backtoinvest35")
{
bg.backtoinvest35.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "backtoinvest36")
{
bg.backtoinvest36.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "backtoinvest37")
{
bg.backtoinvest37.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "backtoinvest38")
{
bg.backtoinvest38.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "backtoinvest39")
{
bg.backtoinvest39.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "backtoinvest41")
{
bg.backtoinvest41.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "backtoinvest42")
{
bg.backtoinvest42.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "backtoinvest43")
{
bg.backtoinvest43.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "backtoinvest44")
{
bg.backtoinvest44.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "backtoinvest45")
{
bg.backtoinvest45.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "backtoinvest46")
{
bg.backtoinvest46.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "backtoinvest46")
{
bg.backtoinvest46.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "backtoinvest47")
{
bg.backtoinvest47.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "backtoinvest48")
{
bg.backtoinvest48.removeEventListener(MouseEvent.CLICK, menu);
}
bg.gotoAndStop(27);
bg.backtomenu27.addEventListener(MouseEvent.CLICK, menu);
bg.viewport.addEventListener(MouseEvent.CLICK, menu);
bg.viewhist.addEventListener(MouseEvent.CLICK, menu);
bg.subscribe.addEventListener(MouseEvent.CLICK, menu);
bg.redeem.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame==32)
{
if (bg.currentFrame == 32)
{
bg.backtoinvest32.removeEventListener(MouseEvent.CLICK, menu);
bg.donebtn32.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "donebtn32")
{
bg.gotoAndStop(33);
bg.backtoinvest33.addEventListener(MouseEvent.CLICK, menu);
bg.okinvest2.addEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "okinvest2")
{
bg.gotoAndStop(34);
bg.backtoinvest33.removeEventListener(MouseEvent.CLICK, menu);
bg.okinvest2.removeEventListener(MouseEvent.CLICK, menu);
bg.backtoinvest34.addEventListener(MouseEvent.CLICK, menu);
}
}
else if (bg.currentFrame==35)
{
bg.backtoinvest35.removeEventListener(MouseEvent.CLICK, menu);
bg.donebtn35.removeEventListener(MouseEvent.CLICK, menu);
if (m.target.name == "donebtn35")
{
bg.gotoAndStop(36);
bg.backtoinvest36.addEventListener(MouseEvent.CLICK, menu);
bg.okinvest3.addEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "okinvest3")
{
bg.gotoAndStop(37);
bg.backtoinvest37.addEventListener(MouseEvent.CLICK, menu);
bg.donebtn37.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame==37)
{
bg.backtoinvest36.removeEventListener(MouseEvent.CLICK, menu);
bg.okinvest3.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "donebtn37")
{
bg.gotoAndStop(38);
bg.backtoinvest38.addEventListener(MouseEvent.CLICK, menu);
bg.okbtn38.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame==38)
{
bg.backtoinvest37.removeEventListener(MouseEvent.CLICK, menu);
bg.donebtn37.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "okbtn38")
{
bg.gotoAndStop(39);
bg.backtoinvest39.addEventListener(MouseEvent.CLICK, menu);
bg.okbtn39.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame==39)
{
bg.backtoinvest38.removeEventListener(MouseEvent.CLICK, menu);
bg.okbtn38.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "okbtn39")
{
bg.gotoAndStop(40);
bg.backtoinvest39.removeEventListener(MouseEvent.CLICK, menu);
bg.okbtn39.removeEventListener(MouseEvent.CLICK, menu);
bg.backtoinvest39.removeEventListener(MouseEvent.CLICK, menu);
bg.okbtn40.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame==40)
{
bg.okbtn40.removeEventListener(MouseEvent.CLICK, menu);
bg.backtoinvest40.addEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "okbtn40")
{
bg.gotoAndStop(41);
bg.backtoinvest41.addEventListener(MouseEvent.CLICK, menu);
}
}
else if (bg.currentFrame==42)
{
bg.backtoinvest42.removeEventListener(MouseEvent.CLICK, menu);
bg.okinvest4.removeEventListener(MouseEvent.CLICK, menu);
if (m.target.name == "okinvest4")
{
bg.gotoAndStop(42);
bg.backtoinvest43.addEventListener(MouseEvent.CLICK, menu);
bg.donebtn43.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame==43)
{
bg.backtoinvest43.removeEventListener(MouseEvent.CLICK, menu);
bg.donebtn43.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "donebtn43")
{
bg.gotoAndStop(44);
bg.backtoinvest44.addEventListener(MouseEvent.CLICK, menu);
bg.donebtn44.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame==44)
{
bg.backtoinvest44.removeEventListener(MouseEvent.CLICK, menu);
bg.donebtn44.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "donebtn44")
{
bg.gotoAndStop(45);
bg.backtoinvest45.addEventListener(MouseEvent.CLICK, menu);
bg.okbtn45.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame==45)
{
bg.backtoinvest45.removeEventListener(MouseEvent.CLICK, menu);
bg.okbtn45.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "okbtn45")
{
bg.gotoAndStop(46);
bg.backtoinvest46.addEventListener(MouseEvent.CLICK, menu);
bg.okbtn46.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame==46)
{
bg.backtoinvest46.removeEventListener(MouseEvent.CLICK, menu);
bg.okbtn46.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "okbtn46")
{
bg.gotoAndStop(47);
bg.okbtn47.addEventListener(MouseEvent.CLICK, menu);
}
else if (bg.currentFrame==47)
{
bg.okbtn47.removeEventListener(MouseEvent.CLICK, menu);
}
if (m.target.name == "okbtn47")
{
bg.gotoAndStop(48);
bg.backtoinvest48.addEventListener(MouseEvent.CLICK, menu);
}
}
}
}
}
你能用較少的代碼重現問題嗎?這總能幫助我對破碎的代碼進行更小的再現。有時我甚至通過這樣做來解決問題。 – Coops 2013-03-26 17:29:16