4 Replies Latest reply on Aug 13, 2014 11:18 PM by rixter123

    [AI-CS5] Unable to capture panel closed/Hide event .

    INeedSol Level 1

      Hi All,


      I am using  flex for  my illustrator plug-in panel. I want to show a msg if panel is closed.

      I registered  StateChangeEvent.WINDOW_CLOSE /StateChangeEvent.WINDOW_HIDE in PanelInit() but I am unable to get the call.


      here is the code that i am using to register.


      CSXSInterface.getInstance().addEventListener(StateChangeEvent.WINDOW_CLOSE , PanelClose);

      CSXSInterface.getInstance().addEventListener(StateChangeEvent.WINDOW_HIDE , PanelHide);


      however in case of StateChangeEvent.WINDOW_CLOSE I am getting call only if illustrator is being closed and panel is opened.


      plz suggest how to overcome?





        • 1. Re: [AI-CS5] Unable to capture panel closed/Hide event .
          david_a_clark Adobe Employee

          I believe this is a bug in Illustrator CS5. Because panels are only hidden (rather than truly closed) when the user clicks to close them, the close event does not fire. I think this is unique to Illustrator and it should be fixed for CS6.


          In the meantime there is this slightly ugly workaround, where you can set up a timer to intermittently poll the visible property of a window, which accurately reflects whether the panel window is visible (unlike the closed property, which as you have noted remains 'false' until Illustrator itself is closing).



                         protected function onCreationComplete():void
                              var t:Timer = new Timer(3000);
                              t.addEventListener(TimerEvent.TIMER, onTimerEvent);
                         protected function onTimerEvent(event:TimerEvent):void
                              trace("visible: " + visible);
                              trace("closed: " + closed);
          • 3. Re: [AI-CS5] Unable to capture panel closed/Hide event .
            Michael Peters Level 1

            It seems unbelievable that two versions on in CS6 this was still not fixed and that the visible property was also not updating. Does anyone know if this is now working in CC?

            • 4. Re: [AI-CS5] Unable to capture panel closed/Hide event .
              rixter123 Level 1

              Looks like the bug is in CC as well. This is really frustrating. (Tested in the original Photoshop CC. Not sure about CC 2014).