4 Replies Latest reply on Oct 20, 2009 12:40 AM by Marc Autret

    [JS CS3/4] Stop closing process problem (onEvent)

    Loic.Aigon Adobe Community Professional

      Hi,

       

      I try to stop a closing operation through an event listener.

       

      I used that :

       

      #targetengine session
      docEvt();
      function docEvt()
      {
          var myEventListener = app.eventListeners.add("beforeClose",myAddDocGlobalEvt, false);
      }
      function myAddDocGlobalEvt(myEvent)
      {
          
          myEvent.stopPropagation();
          myEvent.preventDefault();
          alert('stop');
      }
      

      However, when I close the document...it's closed :-(

      I get the 'stop' alert but the document window is no longer visible.

      I would like to really stop the closing process. What do I do wrong ?

       

      TIA Loic