1 Reply Latest reply on Apr 14, 2008 11:03 AM by Admiral_Brodnack

    window.open events

    wellmoon
      I am creating a popup window using window.open, but this does not seem to be able to use the air.Event.CLOSE event? Is this right?

      Calling a function in the main window from the popup using window.opener.myfunction() does not work either, I get a message in the CLI advising that the result of the expression is not an object, why is this?

        • 1. Re: window.open events
          Admiral_Brodnack Level 1
          Is your pop-up window importing the AIRAliases.js script (which defines the air.Event alias)? Try using the string version of the event name (i.e. "close").

          window.opener.myfunction() should work as long as the html page loaded into the pop-up is in the same domain and sandbox as the opening window. (I would expect a different, security, error if this were not the case, though. If you are loading your own page, then things should work). A more likely possibility is that myfunction() itself (or some other JavaScript statement in the same file) is malformed in some way.