+ -
当前位置:首页 → 问答吧 → 輸入文本光標的顯示問題?

輸入文本光標的顯示問題?

时间:2011-06-24

来源:互联网

复制内容到剪贴板
代码:
this.createTextField ("status_txt",this.getNextHighestDepth (),100,70,100,22);
this.createTextField ("username_txt",this.getNextHighestDepth (),100,100,100,22);
this.createTextField ("password_txt",this.getNextHighestDepth (),100,130,100,22);
this.createEmptyMovieClip ("submit_mc",this.getNextHighestDepth ());
submit_mc.createTextField ("submit_txt",this.getNextHighestDepth (),100,160,100,22);
submit_mc.submit_txt.autoSize = "center";
submit_mc.submit_txt.text = "Submit";
submit_mc.submit_txt.border = true;
submit_mc.onRelease = checkForm;
username_txt.border = true;
password_txt.border = true;
username_txt.type = "input";
password_txt.type = "input";
password_txt.password = true;
trace(Selection.setFocus ("username_txt"));
//trace false
//
function checkForm ():Boolean
{
    if (username_txt.text.length == 0)
    {
        status_txt.text = "fill in username";
        trace(Selection.setFocus ("username_txt"));
        //trace true;
        return false;
    }
    if (password_txt.text.length == 0)
    {
        status_txt.text = "fill in password";
        Selection.setFocus ("password_txt");
        return false;
    }
    status_txt.text = "success!";
    Selection.setFocus (null);
    return true;
}
爲什麽一進來的時候,是false呢?點擊按鈕后就是true。
我想一進來的時候就有光標的顯示了。有什麽好的方法沒有?

作者: QWEASZ   发布时间: 2011-06-24

做假个光标

作者: flash023   发布时间: 2011-06-24

呵呵,最坏的打算也是这样想的,只是想着用程序看能否实现了。

作者: QWEASZ   发布时间: 2011-06-24