這問題卡了一個禮拜,先概述一下我的功能,我有六大主功能所以有6個BTN 就叫做 BTN1 BTN2.....BTN6好了
在BTN2內,又有六個btn 就叫做BTN2_a BTN2_b......BTN2_f,這六個小btn按下去,都會出不同的影片片段
問題在這邊 這六個小btn按下 都會出現,也不會重複出現,但是!! 當我又按回BTN3或其他大按鈕 之前最後出現的影片片段(例如說最後按下BTN2_a出現的影片片段)並沒有不見
也就是說 現在變成在BTN1影格內出現BTN2的東西 怎麼消也消不掉
應該是 addChildAt 跟 removeChildAt 寫的不好 而且 addChild 跟 addChildAt 差別在後面接的是階級 但是我不懂這個意思
講的很複雜 但是我盡我最大的努力表達出來 真的很想求解答 困擾我很久了 書也一直翻
以下是在BTN2影格中寫的
var lowcase_mc:MovieClip;
var flag:Boolean;
flag=false;
a_btn.addEventListener(MouseEvent.CLICK,lowerCase);
b_btn.addEventListener(MouseEvent.CLICK,lowerCase);
c_btn.addEventListener(MouseEvent.CLICK,lowerCase);
d_btn.addEventListener(MouseEvent.CLICK,lowerCase);
e_btn.addEventListener(MouseEvent.CLICK,lowerCase);
f_btn.addEventListener(MouseEvent.CLICK,lowerCase);
function lowerCase(me:MouseEvent){
if(flag==true){
this.removeChildAt(1)
}
switch(me.target){
case a_btn:
lowcase_mc= new a();
flag=true;
break;
case b_btn:
lowcase_mc= new b();
flag=true;
break;
case c_btn:
lowcase_mc= new c();
flag=true;
break;
case d_btn:
lowcase_mc= new d();
flag=true;
break;
case e_btn:
lowcase_mc= new e();
flag=true;
break;
case f_btn:
lowcase_mc= new f();
flag=true;
break;
}
lowcase_mc.x=467;
lowcase_mc.y=232;
this.addChildAt(lowcase_mc,1);
};
以下是在第一個影格寫的
stop();
btn_cat.addEventListener(MouseEvent.CLICK,btn_cat1);
function btn_cat1(me:MouseEvent){
gotoAndStop('LowerCase')}
btn_penguin.addEventListener(MouseEvent.CLICK,btn_penguin1);
function btn_penguin1(me:MouseEvent){
gotoAndStop('TraChinese')}
btn_lion.addEventListener(MouseEvent.CLICK,btn_lion1);
function btn_lion1(me:MouseEvent){
gotoAndStop('stroke')}
btn_rabbit.addEventListener(MouseEvent.CLICK,btn_rabbit1);
function btn_rabbit1(me:MouseEvent){
gotoAndStop('game')}
btn_bear.addEventListener(MouseEvent.CLICK,btn_bear1);
function btn_bear1(me:MouseEvent){
gotoAndStop('aboutUs')}
btn_hippo.addEventListener(MouseEvent.CLICK,btn_hippo1);
function btn_hippo1(me:MouseEvent){
gotoAndStop('UpperCase')}
到底是哪邊出了問題 我知道是我自己卡住 感謝各位了
附上我的檔案 怕有興趣的人聽不懂 只有PLAY一次 按一按就知道問題在哪了 很明顯
謝謝了
http://ms.ntcb.edu.tw/~s9356080/%a5d%c3%f6%b0%dd%c3D/以下是我的即時通
a0926597554@yahoo.com.tw拜託了