1 Reply Latest reply: Apr 26, 2012 2:08 AM by iware RSS

    Indesign Events handling in my AIR CS Extension for Indesign

    iware

      Hello,

       

      I wanted to be able, from my indesign extension developped with CS Extension Builder in Actionscript/AIR, to catch the events defined in com.adobe.indesign.Event.* and handle them in this. same extension

       

      How Am i supposed to do that ? I can't find a way.

       

      And in the same idea, is it possible to catch an event of the type "when user double click on a frame in an opened indesin document" or anything like that ?

       

      Here is what i tryed in my actionscript code for a simple AFTER_OPEN event i tried to catch :

       

      -----------

      this.app.eventListeners.add(com.adobe.indesign.Event.AFTER_OPEN, afterOpenHandler);

      -----------

       

      (where this.app = InDesign.app;)

      and

       

      -----------

      private function afterOpenHandler(e:Event):void {

      //handling event code here

      }

      -----------

       

      But it was not a real surprise when it drops an error : the add() function doesnt take a simple function name as second parameters like you do in actionscript, but an "Object" or a "javascript function". How Im supposed to handle this event in my actionscript now ? is this only possible ?

      Any thoughts ?

       

      Thanks in advance for your time !

       

      Lionel

       

      PS: I also tried a dozen unsuccessful attempt like Casting my function as an Object Type in the eventListeners.add() arguments and so on....