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.
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;
}
 
        	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: 0
Ranga: Administrator serwisu Punktów: 0
Komentarze użytkowników
:: Losowe artykuły 

:: Wymiana linków 
    
	Modowe inspiracje |
        Android Gry i Aplikacje |
        ZaplanujTransport.pl: Przeprowadzki, transport, aukcje |
        Logo dla firmy |
        Change Tires - Car Weather Forecast Reminder |
        Laminas: MVC Framework for PHP |
        IT Books Reviews and Programming: JS, JAVA, PHP, ANDROID, CSS | 
        Katalog roślin |
        Programming articles: JAVA, PHP, C++, Python, JavaScript |
        Kancelaria Adwokacka Łukasz Huszno
        
    

 
  
				

 
                             
 


 
                        
 
		 
	