PDA

View Full Version : Textfield focus and keyPress event


Tangent12
05-13-2005, 06:47 PM
Hi,

What I'm tring to create is a simple login section with a single Username textfield. The user types a name and hits enter (no button click) moves to the next keyframe where there is a password field, they enter a password and hit enter again and the playhead moves to a frame that checks the database.

I need it to be fluid for speed so its just:

username
enter
password
enter

I don't want the user to have to click a button because the environment this will be in may be keyboard only.

I have the problem firstly of how to create a keyPress event for a textfield, can this be done?

I have managed to partly achieve this by turning the textfield into a button and using the on keyPress event on the button. This works well but I need the cursor to be flashing in the textfield when the movie starts and then when they move to the password frame, the passWord field must have the flashing cursor.

So my questions are:

1. Is there a way to force the flashing cursor to the textfield which is within a button MC?

2. Is there another way of achieveing my goal as listed at the top?

Any help would be much appreciated.

Thanks in advance.

T12

Navarone
05-14-2005, 01:29 AM
have you looked through any of the tutorials on this forum? I think I remember seeing a couple tutorials about passwords.