我试图在文本框中捕获 1 个字母,但是当我输入多个字母时,flash 只会注册,所以如果我输入“G”它不起作用,但如果我输入“GH”那么它会注册。到目前为止,我正在像这样捕捉它。(部分代码)
function goToFrame8(event:MouseEvent):void
{
addChild(answerInput);
answerInput.x = 350;
answerInput.y = 350;
//next 'frame' button
addChild(next8);
next8.x = 650;
next8.y = 520;
next8.addEventListener(MouseEvent.CLICK, goToFrame9);
answerInput.randomText.addEventListener(TextEvent.TEXT_INPUT, inputEventCapture);
}
function inputEventCapture(event:TextEvent):void
{
text1 = answerInput.randomText.text;
}
function goToFrame9(event:MouseEvent):void
{
trace(text1);
removeChild(answerInput);
}