[問題] 求救~程式的組件BUG~
小弟最近寫了一個線上打字程式
大致上已經撰寫完成,但是昨天測試時發現一件事
在選好中打試題或英打試題後,在打字提示的訊息,要求使用者按下「空白」鍵
即可以開始進行,但是若按下的空白是「全形空白」
則組件的外框則會不見(例如:button、comboBox)
在Flash軟體下實際測試,按下全形空白,會出現下面的錯誤訊息
TypeError: Error #2007: 參數 child 不能是 Null。
at flash.display::DisplayObjectContainer/addChildAt()
at fl.controls::BaseButton/fl.controls:BaseButton::drawBackground()
at fl.controls::LabelButton/fl.controls:LabelButton::draw()
at fl.controls::Button/fl.controls:Button::draw()
at fl.core::UIComponent/::callLaterDispatcher()
小弟打字提示那個關鍵影格的程式碼如下:
stop();
//設定roo變數為根場景root
var roo=root;
var instruct="現在準備開始進行英文打字測驗\n";
instruct=instruct+"注意別打錯字,打錯一個字元\n倒扣"+roo.losePoint+"個打擊數
\n";
instruct+="\n請按下空白鍵,立即開始測驗";
var i=0;
var textTimer=new Timer(50,instruct.length);
instruction_txt.autoSize=TextFieldAutoSize.LEFT;
function setText(event) {
instruction_txt.appendText(instruct.charAt(i));
i++;
}
textTimer.addEventListener(TimerEvent.TIMER,setText);
textTimer.start();
function pressSpace(event) {
if (event.keyCode==Keyboard.SPACE) {
textTimer.stop();
play();
/*====================移除偵聽及元件====================*/
textTimer.removeEventListener(TimerEvent.TIMER,setText);
stage.removeEventListener(KeyboardEvent.KEY_DOWN,pressSpace);
/*======================================================*/
}
}
stage.addEventListener(KeyboardEvent.KEY_DOWN,pressSpace);
最後附上程式的網址: http://61.227.187.39/ 帳號:12345 密碼:abcde
麻煩高手解答,感謝~
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.227.187.39
推
10/24 03:59, , 1F
10/24 03:59, 1F
→
10/24 03:59, , 2F
10/24 03:59, 2F
→
10/24 03:59, , 3F
10/24 03:59, 3F
→
10/24 04:00, , 4F
10/24 04:00, 4F
→
10/24 04:00, , 5F
10/24 04:00, 5F
→
10/24 14:22, , 6F
10/24 14:22, 6F
→
10/24 14:22, , 7F
10/24 14:22, 7F
→
10/24 14:23, , 8F
10/24 14:23, 8F
→
10/24 14:23, , 9F
10/24 14:23, 9F
推
10/25 08:02, , 10F
10/25 08:02, 10F
→
10/25 08:42, , 11F
10/25 08:42, 11F
→
10/25 08:42, , 12F
10/25 08:42, 12F
討論串 (同標題文章)
完整討論串 (本文為第 1 之 3 篇):
問題
2
12