3 Replies Latest reply on Jun 16, 2009 9:51 AM by Joe ... Ward

    Passing focus to swf loaded by html component


      Recently we developed an interactive tour presentation for our 50" touch screens. The presentation is built in adobe air and set to be made full screen. There are no keyboards setup for these units, instead an on screen keyboard was developed inside the presentation to facilitate keyboard input. Each time a key is pressed it sends the keycode to a java server which was designed to inject a synthetic keyboard event into the OS que. This architecture works in all cases interacting with controls in the presentation and HTML component controls. Unforunatly if an html component loads a swf file it will only work part of the time. The time it does not work is one of the more important topics of discussion unforunatly... a BI platform were building in flex (brunnercricket.com). When the html control is navigated to this portal im unable to keep focus on the controls in the flex app. Each time a key button is pressed keyboard focus returns to the last control that had focus in the air presentation. Does anyone have any thoughts for making the focus 'stick' to the loaded flex app?

        • 1. Re: Passing focus to swf loaded by html component
          Joe ... Ward Level 4

          Are you currently doing anything to manage the focus, or just relying on the built-in Flex behavior?


          You say it works some of the time. Any pattern here? (I.e. Flex apps don't work, Flash apps do?)

          • 2. Re: Passing focus to swf loaded by html component
            lolboxen Level 1

            I did try to manage the focus at first but the framework does not have a reference to which field was activated in the HTML component. I even tried switching focus to the HTML component hoping it would internaly defer focus to the proper control.


            From my experiments it does not work for any flex app. It does work for some flash apps though.

            • 3. Re: Passing focus to swf loaded by html component
              Joe ... Ward Level 4

              The only thing I can think of is that you will need to manage the focus at each level. This is may only be possible if you have control of the html and embedded Flex app (which it sounds like you do for your most important case). So when you set focus back to the HTML component, it, in turn must set focus to the Flex app (or the last other thing that had focus). You will have to use HTML/JS events and properties to save and restore the focused object. The flex app might also need to set the focus back to the correct, last-focused control (Flex might do this automatically for you, I'm not sure).