2 Replies Latest reply on Feb 13, 2010 12:07 AM by mileking

    problems with event handlers

    mileking Level 1

      Hi everybody. I have a problem with starting event handlers in InDesign CS3. The sample code I wrote from the tutorial book, won't work. The message I get when I open a new document is: "Error string: The requested action could not be completed because the object no longer exists." Here is the code I used:

      --------------------------------------

      main();
      function main() {
      var myEventListener = app.addEventListener("afterNew", myDisplayEventType, true);
      }

      function myDisplayEventType(myEvent) {
      alert("This event is the " + myEvent.eventType + " event.");
      }

      ------------------------------------

       

      what is wrong here? Thanks in advance,

       

      mileking