嗨,我只是在学习动作脚本,并且一直在尝试在填写文本字段后获得一个按钮来运行功能。phoneNum 是文本字段 ID。
//function with var testing the textfield content.
function sendInfoBtn()
{
var lengthOf = phoneNum.text.length;
if (lengthOf == 10){
sendInfo.addEventListener(MouseEvent.CLICK, doThisThing, false, 0, true);
}
}
//I'd really like to just add the lengthOf variable to this changelistener somehow
phoneNum.addEventListener(Event.CHANGE, sendInfoBtn, false, 0, true);
function realFunction(){
//things to do
}