1 Reply Latest reply on Dec 4, 2008 1:41 PM by kstephens2

    Login window

      I created a initial login-window to define the user group for the application. Each user group has specific rights and sees a different menu - because some functions aren´t for user group 1 and so on.
      I´ve created the window via
      var login = window.open('login.html', null, 'width = 350, height = 280'); and then give the user group back via
      Everythings alright - the menu is switching depending on the user group. But when I close the login window (via window.close or clicking the X) and when I want to "reopen" it or other windows from the menu the following error is displayed:

      Error: The application attempted to reference a JavaScript object in an HTML page that is no longer loaded.
      at __HTMLScriptFunction/throwJSObjectDead()

      When I start the app without the initial login window no error is displayed when opening and closing other windows. But when I now click "Login" and close the window - the same error again.
      I don´t know what´s happening. Maybe someone can help me out.

      Thanks in advance.
        • 1. Re: Login window
          kstephens2 Level 1
          When you close login window you are loosing the reference back to the javascript contained in it. I assume the code for the menu was in that window?

          Every window is its own namespace so when you close the window you have removed all the javascript in it and that error gets tossed when you reference the javascript that has gone away.

          This has been a nightmare for us on our app. We ran into this a lot when we would call to the server for some information and the user closed the window before the server call returned. When the event fired to tell us the URLRequest had returned it wouldn't be able to find it's callback method for that event because the window was gone and it would throw that error.

          We had to work around it by hiding windows not closing them. We catch the close event on a window, prevent the default and make them visible = false and minimize them. That way any code we reference in them stays around but the user thinks the window has closed. This unfortunately means more memory usage for the window lingering in the background.

          Any one from Adobe have better advice on this one?