2 Replies Latest reply on Jun 17, 2010 8:20 AM by Florincugir

    TextInput focus

    Florincugir

      Hello everyone,

       

      I have a Flex app with an entry screen where the user enters a value in a TextInput field, chooses a value from a ComboBox and hit a Submit button. Very simple.

      When the value entered in TI field is wrong, an Alert will pop-up telling the user what is wrong. As soon as the user hit OK on the Alert box, the control is returned to the Entry screen being focused on the TextInput field (where the wrong value is still showed but in reverse mode). I did that by using FieldName.setFocus() method.

      So far, so good...

      Now, I call this application from another FLEX application (using SWFLoader module); using the above scenario, I have this problem: the focus is NOT returned to the TextInput field; even worse, I cannot use the mouse to click on that field to give it focus, nothing happens, I cannot type anything in that field.

      Even more confusing, if I click on the ComboBox and I click back to the TextInput, everything is fine; and after that, doesn't matter how many errors I have, the focus is always returned to the Text field. So the problem is only for the first time, when the first error appears!

       

      Any help and/or ideas are more than welcomed.

       

      Thank you,

       

      Florin

        • 1. Re: TextInput focus
          Flex harUI Adobe Employee

          Add the following code to the main app:

           

          systemManager.addEventListener(MouseEvent.MOUSE_DOWN, function (e:Event) {

          trace(e.target) });

           

          And see who is getting the mouse events.

          1 person found this helpful
          • 2. Re: TextInput focus
            Florincugir Level 1

            Thank you for your answer...

             

            I added the suggested code in the main app and, when I try to see what is going on (in debug mode) I noticed I have a Security Sandbox Violation. Probably this was the reason for that strange Focus behavior, because, as soon as I solved the Security issue, the Focus problem disappeared.

             

            Best regards,

             

            Florin