Hi Alex, I have tried to write a JavaScript method using ExternalInterface to set the focus of browser window first (As it is suggested in this forum - http://forums.adobe.com/thread/452365), then I set the focus of textInput control in Flex.
After this, I don't need to click manually on textInput control, but it's only working in IE, not in firefox & chrome. Any solution, please suggest ? -----Original Message----- From: Alex Harui [mailto:aha...@adobe.com] Sent: 19 November 2013 12:31 To: us...@flex.apache.org Subject: Re: Issue with setFocus method of UIComponent Generally, you have to click somewhere in the SWF once to activate it. SWFObject claims it can set your SWF to the active state programmatically on all browsers, but I've only seen it work on IE. On 11/18/13 10:03 PM, "Devesh Mishra" <devesh.mis...@mastek.com> wrote: >Hi, > >I am facing one issue related to setFocus() method of UIComponent. I have >one textinput and I have written textInput.setFocus() on creationComplete >of application i.e. > >private function onCreationComplete():void >{ > textInput.setFocus(); // 1st approach > > textInput.focusManager.setFocus(textInput); // 2nd >approach > textInput.focusManager.showFocus(); >} > >While using both the approach, I can see that my text input has got a >cursor which shows that it has got focus. But issue is that it doesn't >get any input from keyboard until or unless I click on text input >manually. > >Is this behaviour normal in Flex or is there any issue with Flash Player >which I am using or any issue with browser ? > >Flex SDK: 4.1 >Browser & Flash Player Version > >1. IE 9 with Flash Player debugger version 11.3.300.257... > >2. Chrome 15.0.874.121 with Flash Player 11.1.102.55... > >3. Firefox 20.0.1 with Flash Player 11.9.900.117... > > >-- >Devesh >MASTEK LTD. >In the US, we're called MAJESCOMASTEK > >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >Opinions expressed in this e-mail are those of the individual and not >that of Mastek Limited, unless specifically indicated to that effect. >Mastek Limited does not accept any responsibility or liability for it. >This e-mail and attachments (if any) transmitted with it are confidential >and/or privileged and solely for the use of the intended person or entity >to which it is addressed. Any review, re-transmission, dissemination or >other use of or taking of any action in reliance upon this information by >persons or entities other than the intended recipient is prohibited. This >e-mail and its attachments have been scanned for the presence of computer >viruses. It is the responsibility of the recipient to run the virus check >on e-mails and attachments before opening them. If you have received this >e-mail in error, kindly delete this e-mail from desktop and server. >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MASTEK LTD. In the US, we're called MAJESCOMASTEK ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~