Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript 1.0/2.0 (http://www.flasher.ru/forum/forumdisplay.php?f=93)
-   -   setFocus? (http://www.flasher.ru/forum/showthread.php?t=79903)

STILL.05 18.05.2006 14:43

setFocus?
 
подскажите пожалуйста как програмно удалить фокус с текстового поля?

MyXus 18.05.2006 15:09

в хелпе есть код
Код:

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;
Selection.setFocus("username_txt");
//
function checkForm():Boolean {
    if (username_txt.text.length == 0) {
    status_txt.text = "fill in username";
    Selection.setFocus("username_txt");
    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;
}

однако он у меня почему то не работает.
Однако, если бы он работал, в нём можно было бы найти необходимое решение: Selection.setFocus(null);

MyXus 18.05.2006 15:13

а. нет. вру. всё работает.
просто сетФокус на текстфилд почему то не выводит текстового курсора.

STILL.05 18.05.2006 16:07

спасибо


Часовой пояс GMT +4, время: 03:44.

Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.