4 Replies Latest reply on Aug 31, 2009 1:59 AM by scholarpack

    SWF in new window

    scholarpack Level 1

      I have an air application that loads a website into a html control. The html opens a new window with window.open and should display some Flash content but nothing appears. The same content displays perfectly if opened in the original window. Can anyone point me in the correct direction, is it to do with window transparency in the new window?

        • 1. Re: SWF in new window
          Jeff Swartz Level 3

          Can you post the HTML code (the call to window.open()).

           

          There are some security restrictions on using window.open() (but these may be unrelated to your issue):

           

          • Content in non-application security sandboxes (such as content loaded from the web) can only successfully call the window.open() method in response to an event triggered by a user mouse or keyboard interaction. This prevents non-application content from creating windows that might be used deceptively (for example, for phishing attacks). Also, the event handler for the mouse or keyboard event cannot set the window.open() method to execute after a delay (for example by calling the setTimeout() function).

           

          • Content in remote (network) sandboxes can only use the window.open() method to open content in remote network sandboxes. It cannot use the window.open() method to open content from the application or local sandboxes.
          • 2. Re: SWF in new window
            __antonio__ Level 3

            In the 1.5.1 and earlier sdk, swfs in windows with transparency don't show. If you havent updated to the 1.5.2 sdk you can find it here:

            http://www.adobe.com/products/air/tools/sdk/

             

            You can find release notes here:

            http://www.adobe.com/support/documentation/en/air/1_5_2/releasenotes_developers.html

             

            Click on "Version Info" for the bug fixes, Click on "Adobe AIR SDK Mac and WIndows"' for how to overlay


            • 3. Re: SWF in new window
              Dan McAdam Level 1

              I just posted a thread on a similar issue:

               

              getting a javascript window.open command to work in AIR HTML component

               

              the whole sandbox thing is pretty confusing for me... and i see that Mr. Swartz quoted the AIR 1.5 documentation... but maybe a specific example would be better...

               

              I'm loading an HTML document into an HTML Component as a string from a database call ... the HTML doc has a reference to the tinyMCE javascript editor in the head section plus the required init() function to start it up..

               

              Both the HTML and the tinyMCE editor appear in the HTML Component window.. and the tinyMCE functions that DO NOT require popup dialogs work fine... but the calls that DO require popup dialogs trigger an error from tinyMCE that my popup blocker software needs to be disabled.

               

              I tried putting the tinyMCE libraries inside the application directory and referenced them in the HTML from there... but that didn't work at all (no tinyMCE editor)

               

              I'm about ready to take the string containing my HTML document and write it to disk and then open it in the AIR HTML Component from there... but that seems like a huge cludge... and I think that i'd end up having to read the HTML document back in and hold it as a string anyway... just in order to assign it to the htmlText property of the HTML Component (which is where i need it to be for export after editing)

               

              Can you give us an example of how to set up reading an HTML doc (that includes a javascript that opens new popup windows) from a database, please...

               

              thanks

              Dan McAdam

              Salem, Oregon

              • 4. Re: SWF in new window
                scholarpack Level 1

                Here's how I open the windows:

                 

                <a href="#" onClick="window.open('Attendance/all','','top=100,left=200,scrollbars=1')"/>Attendance by house for this academic year</a>