Selection.setFocus not working as expected

kleigh
kleigh used Ask the Experts™
on
I would like to use Flash for a logon page. I have two fields. Name1 and Password1

the Page movie does some amimation then displays the two logon fields.

I have an action script as follows

Selection.setFocus("_root.name1");

This produces the blinking I-beam as expected BUT WHEN YOU START TYPING NOTHING HAPPENS, you have to click on the field to activate.

I am using Flash MX, Win XP Pro, Explorer 6 with latest Flash Player

Thanks In Advance
KBL
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
If you're using flash in a html page, you have to click on the swf to focus it before you can do anything else.

Commented:
Might seem basic, but can be overlooked sometimes. Did you set the text variable's to their corresponding fields? (eg. does the Name1 field have the variable name1 attached to it?)

Author

Commented:
Is there any way to make the to make the whole swf in focus so the script would work??
Commented:
Hello Kleigh,
You cannot make the whole swf file in a internet explorer window have the main focus unless you incorporate javascript into your page, however I am not firmiliar with javascript so I cannot help you out in that field.
You will find that when you export your flash document to a swf and open it, your set focus will be working perfectly, so there is nothing wrong with your coding.
If you have any more points left, ask an expert from the javascript section and see if anyone there can help you out.

Good luck :)

-OBCT

Commented:
kleigh,

Please post a comment back or close this question.

Cheers

-OBCT

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial