3 Replies Latest reply on Sep 12, 2009 8:09 PM by CoderRoberts

    setFocus question


      Probably a newbie questions but I notice that when I set my onCreationComplete


      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
          backgroundGradientColors="[0xFFFFFF, 0xAAAAAA]"
          horizontalGap="15" creationComplete="searchTerms.setFocus()" >


      I don't actually get cursor focus until I click somewhere inside the flash player instance.  The control obviously has focus but no blinking cursor in the text area until I click within the player.  Is this by design? A browser thing?  Has anyone over come this?  How?


      Once I am inside the player, all focus events work just fine.  Its somewhat of a hassle because if the user clicks on another control it has focus.

        • 1. Re: setFocus question

          what is the component searchTerms? if it is a container, try to change your focus to a component inside the containe(an input or something like that) i don't know why, but this should solve the problem.

          Hope that helps!



          Salem Ben Afia


          • 2. Re: setFocus question
            Ansury Level 3

            Common problem, it's a known issue. I don't know if it's fixed in a later version but I doubt it, I haven't heard it was resolved yet.  It's a Flash Player/Browser issue.


            On the plus side, they should be able to click anywhere other than a component (i.e. a container) in the app and it should give your Flash app focus IIRC. (but still leave the component you want focused by default)

            • 3. Re: setFocus question
              CoderRoberts Level 1

              Thanks for your quick reply, thought it was something of that sort.  FYI, you answer matches other research I did on the matter.