Try this: <mx:TextInput id="username" creationComplete="Selection.setFocus(username);" />
You need to use the Selection class to do what you want. Only thing is, if you're expecting the caret to be blinking in the field when loaded in the browser, you're not guaranteed that behavior every time...the field definitely has focus every time, the caret isn't always blinking in it though...it happens intermittently...so the way I got around this is I use the JSP taglib tag and embed my entire flex app in a JSP page and in the body element of the HTML in my JSP, I force forcus on the Flex movie which has an ID, so I use Javascript to force the focus of the Flex app, which in turn guarantees a blinking caret in my focuses field without fail every time. Rob Robert L. Brueckmann Senior Web Developer Merlin Securities, LLC 595 Madison Avenue New York, NY 10022 p: 212.822.4821 f: 212.822.4820 -----Original Message----- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of heybluez Sent: Monday, May 09, 2005 11:56 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] setFocus() on a TextInput So..i want a textinput to show focus..on other words it should selected for editing, etc. I try: feedURLText.setFocus(); with feedURLText as the ID of the TextInput component. This does not seem to work. Any ideas? Thanks, Michael Yahoo! Groups Links -------------------------------------------------------- This message contains information from Merlin Securities, LLC, or from one of its affiliates, that may be confidential and privileged. If you are not an intended recipient, please refrain from any disclosure, copying, distribution or use of this information and note that such actions are prohibited. If you have received this transmission in error, please notify the sender immediately by telephone or by replying to this transmission. Merlin Securities, LLC is a registered broker-dealer. Services offered through Merlin Securities, LLC are not insured by the FDIC or any other Federal Government Agency, are not deposits of or guaranteed by Merlin Securities, LLC and may lose value. Nothing in this communication shall constitute a solicitation or recommendation to buy or sell a particular security. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/