# Problems w/ Selection.setFocus in Web Page

**URL:** <https://forum.kirupa.com/t/problems-w-selection-setfocus-in-web-page/183770>\
**Category:** flash\
**Created:** [March 29, 2006, 10:33pm UTC](https://forum.kirupa.com/t/problems-w-selection-setfocus-in-web-page/183770 "2006-03-29T22:33:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![clem\_c\_rock](https://avatars.discourse-cdn.com/v4/letter/c/c6cbf5/32.png) [@clem\_c\_rock](https://forum.kirupa.com/u/clem_c_rock)\
**Post date:** [March 29, 2006, 10:33pm UTC](https://forum.kirupa.com/t/problems-w-selection-setfocus-in-web-page/183770/1 "2006-03-29T22:33:59Z")

</div>

Hello, It’s me again.

I’m trying to set the curser focus in a text field when a movie clip loads in a webpage.

The following code works great in the authoring environment but, when you view it in a webpage, it does not show the cursor in the text field.

Current Code I’m using:  
Code:

\_root.focusEnabled = true; Selection.setFocus(“username\_txt”);

Also, I’ve also had some success only in Windows IE by using the above code in conjunction w/ the following javascript in the webpage:

\<body onLoad=“window.document.theMovie.focus();”\>

\<object classid=“clsid27CDB6E-AE6D-11cf-96B8-444553540000” codebase=“[http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0](http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0)” width=“900” height=“540” name=“theMovie”\>  
\<param name=“movie” value=“main\_program\_v1.swf”\>  
\<param name=“quality” value=“high”\>  
\<embed src=“main\_program\_v1.swf” quality=“high” pluginspage=“[http://www.macromedia.com/go/getflashplayer](http://www.macromedia.com/go/getflashplayer)” type=“application/x-shockwave-flash” width=“900” height=“540” name=“theMovie”\>\</embed\>  
\</object\>

Thanks for your time,  
Clem C
