Loading:


Selection setFocus [AS 2]

Klasa: Selection

Kompatybilność: ActionScript 1.0, Flash 5+

 

setFocus(noweSkupienie:Object) : Boolean

 

Nadaje skupienie dla danego pola tekstowego, lub klipu filmowego określonego przez parametr.

 

Jeśli wartości null lub undefined są przekazywane, wtedy aktualne skupienie jest usuwane.

 

 



Napisz Artyku³

Listing

this.createTextField("status_txt", this.getNextHighestDepth(), 100, 70, 100, 22);
this.createTextField("nazwa_txt", this.getNextHighestDepth(), 100, 100, 100, 22);
this.createTextField("haslo_txt", this.getNextHighestDepth(), 100, 130, 100, 22);
this.createEmptyMovieClip("wyslij_mc", this.getNextHighestDepth());
wyslij_mc.createTextField("wyslij_txt", this.getNextHighestDepth(), 100, 160, 100, 22);
wyslij_mc.wyslij_txt.autoSize = "center";
wyslij_mc.wyslij_txt.text = "Submit";
wyslij_mc.wyslij_txt.border = true;
wyslij_mc.onRelease = checkForm;
nazwa_txt.border = true;
haslo_txt.border = true;
nazwa_txt.type = "input";
haslo_txt.type = "input";
haslo_txt.haslo = true;
Selection.setFocus("nazwa_txt");
//
function checkForm():Boolean {
    if (nazwa_txt.text.length == 0) {
    status_txt.text = "wypełnił nazwa";
    Selection.setFocus("nazwa_txt");
    return false;
    }
    if (haslo_txt.text.length == 0) {
    status_txt.text = "wypełnił haslo";
    Selection.setFocus("haslo_txt");
    return false;
    }
    status_txt.text = "sukces!";
    Selection.setFocus(null);
    return true;
}
 




Dodano przez: divix
Ranga: Administrator serwisu Punktów: 38523
Komentarze użytkowników
    • Tre¶æ komentarza
      Kod do komentarza (opcjonalnie)
      PHP JavaScript MySQL Smarty SQL HTML CSS ActionScript
      Autor
      Token
      token

       

       








funkcje.net
Wszelkie prawa zastrzeżone©. | Funkcje.net 2008-2024 v.1.5 | design: diviXdesign & rainbowcolors