in Technology

Automatically focussing on the text field with Flash

One of the important usability lessons is to set the cursor focus on an appropriate control when the webpage is loaded. So you would set the focus to the username textfield on the login page by default. This is very easy to do in JavaScript. Not so cleanly in Flash.

We wanted to do this about two years ago. We used the Selection.setFocus() method to set focus on the input textfield. This worked only if the focus was on the Flash movie. So it wouldn’t work when the user loaded the page for the first time.

Found a solution to it today! Focus the Flash movie when the page loads!

Macromedia LiveDocs have a nice comment thread on this. And there is another interesting tutorial on Free Flash Tutorials.

Note that this trick works only in IE.

Write a Comment

Comment