1 Reply Latest reply on Nov 17, 2008 10:06 PM by andros

    create window from loaded swf

      I have an app I built in CS3.
      It starts with one window and a User clicks a button which opens another that loads a swf.
      All fine. The swf is loaded from a website. No sandbox issues.. all is good.
      But.. I need to be able to Open another window from that SWF.. which is where I get an error:
      SecurityError: window
      at runtime::SecurityManager$/checkPrivilegeForCaller()
      at flash.html::HTMLLoader$/createRootWindow()

      I am not writing anything to disk. I onkly want to open a window with HTML in it.
      I have tried doing it from the loaded swf itself:
      var initOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
      var bounds:Rectangle = new Rectangle(10, 10, 600, 400);
      var html2:HTMLLoader = HTMLLoader.createRootWindow(true, initOptions, true, bounds);
      var urlReq2:URLRequest = new URLRequest(" http://www.example.com");

      But no luck.
      I would be happy to call a Function in the Initial Window.. (the Root Window).. from the SWF.

      BTW.. I am able to open the html in a window when I do it from the Root Window of the AIR app.

      I would appreciate possible answers to Both of the above
        • 1. Re: create window from loaded swf
          andros Level 1
          I was able to access a function on the root window by creating a parentSandboxBridge to the loaded SWF.
          When declaring the parentSandboxBridge as an object in the SWF I was able to use loaderInfo["parentSandboxBridge"] instead of loaderInfo.parentSandboxBridge.
          This saved me from having to load in more classes into the loaded SWF. I was able to treat it like a normal file and not made for AIR.
          Not sure if necessary or not, but worked for me.