3 Replies Latest reply on Jun 7, 2013 7:30 AM by fivan

    Indesign Script Opening Flex App / Tab Handling

    smitty265

      Hi,

       

      I am working on a  FlashBuilder 4 application that is opened from, and interacts with, an  Indesign CS4 .jsx script. I have added a TitleWindow that  provides for login processing (there is a backend database) to the Flex application. The login  window is opened from the method that is registered as the  initialization method for the Flex application. The flow works nicely.  The application, with its presentation of a TabNavigator holding the  core panels, visually appears then the login TitleWindow opens modally.  The id / password is entered, then the web service is called that  handles verifying login. The event handlers that receive the callback  from this then populate the controls on the application if the user is  verified.

       

      The problem I am having is with tabbing on the  TitleWindow. No matter what I do (tabEnabled / tabIndex settings, etc.) within Flex,  the TitleWindow will not receive tab presses and react to them. Tabbing  seems to cycle through the Indesign application in the background.

       

      From a  ScriptUI perspective the Flex application is opened as a Window (I've  tried Palette with similar results. I need it to be non-modal). Not only does the first tabbable  field not get focus, even when explicitly coded to do so, if you try to  tab off of it, which doesn't work, then click on the  second field on the TitleWindow to force focus, the first keystroke you type into the text field is ignored.

       

      If  I test the application from FlashBuilder directly, without being invoked  as a ScriptUI Window / FlashPlayer, the first field gets focus, tabbing  works, etc.

      Can anyone tell me how to make the login window behave such that I can set focus on field 1 and have it respond to tab  presses to cycle to the second field? Is there something I should do in the FlashBuilder application's invocation within the .jsx?

       

      Here are the operative lines from the script:

       

      var res =
      "window {        \
          fp: FlashPlayer { preferredSize: [1100,650], minimumSize:[800,450], maximumSize:[1200, 850] },    \
      }";


      var importFlashWindow = new Window (res,"Import Stories", undefined, {resizeable:true, independent:true});


      importFlashWindow.onShow = function(){

       

          var movieToPlay = new File (mySWFFile);
         
          try {

       

              //This function must be declared before the swf file is loaded as the flex panel calls it
              //from its init method.
              this.fp.getBaseUrl = getBaseUrl;

              this.fp.loadMovie(mySWFFile);


              //etc.

       

      I have posted the same basic question in the Flex / FlashBuilder forum with no response. I'm hoping someone here might know what I need to do to get the FlashBuilder application to receive the tab presses instead of the Indesign application behind it.

       

      Any help appreciated.

       

      Thanks,

       

      David