Whats the code to focus on a textbox?

I’ve been wondering, if an input box with a variable of name and is inside an MC with instance name of contact_form, what the code I can put on a frame so that as the frame loads, the focus of the blinker is automatically set onto that input?

Ive used this:


And it’s completely not working. I traced selection.getFocus(); and it returns as undefined…

Any clues? Thanks.


Two problems:
[]Selection should be capitalized.
]Don’t use a string for the parameter.[/LIST]



Kyo, i’m not sure how your code sets the focus on the input box inside the MC. I actually figured it out. It needs to target the instance name of the text box not the variable of it - lol -.

Sorry for the waste of time.

yes, that’s what i mean.