4 Replies Latest reply on Apr 30, 2009 1:30 AM by omniteo790

    Problem with ajax and adobe air

    omniteo790

      Hello...

      I'm using aptana for do a air application with ajax.

       

      But I have problem with window.parent (in Non-application sandbox). What is the same in air?

        • 1. Re: Problem with ajax and adobe air
          Joe ... Ward Level 4

          It depends on how the window was created and whether both the parent and the child are in the same sandbox.

           

          If you create a window with the normal JavaScript window.open() method, and the window loads content that is in the same sandbox as the parent, then the parent property of the new window should be set normally.

           

          If you create a window using the AIR createRootWindow() function, then the parent property is not set (one of the reasons the function is called create *ROOT* window). If both the creating window and the child window are in the same sandbox, you can set the parent property yourself.

           

          If you create a window with the AIR NativeWindow constructor (new NativeWindow()), then there is no parent property. The window object create really has no relationship to the JavaScript window object. (If you put an HTMLLoader object in the native window -- the HTMLLoader will create a JavaScript environment that does whave a window, and a window.parent property. Again, you would have to set the parent property yourself in this case, it is not done automatically.)

           

          A child loading content from a domain different than it's parent cannot access the parent window.

          • 2. Re: Problem with ajax and adobe air
            omniteo790 Level 1

            And I my page (loaded in Non-application sandbox) there is another page loaded inside an IFrame?

            • 3. Re: Problem with ajax and adobe air
              Joe ... Ward Level 4

              As long as the pages are in the same domain, then the parent property of the iframe should be set to the outer page (at least as I understand it).