星期四, 5月 05, 2011

Set focus on textfield in Flex3

In Action Script:
login.setFocus();

In HTML:






< body onload="setFlexAppFocus();">


2. detect press Enter
   

/**
* Handle login when user press enter on password
*/
private function enterListener(e:KeyboardEvent):void {
if(e.keyCode == Keyboard.ENTER) {
enter(); // check login function
}
}

沒有留言: