2 Replies Latest reply on May 10, 2007 8:13 PM by natiupiru

    Functions calls from loaded SWF files

    natiupiru
      I have a Flex application that uses the SWFLoader object to load an external SWF file (which was also developed in Flex) into a section of the page. The parent SWF file defines several global functions and variables in ActionScript that I would like to use from any SWF files that are loaded into the SWFLoader. Is there a way in ActionScript to access functions and variables that are defined in the parent SWF file from the loaded/child SWF file? Both SWF files are on the same domain, so there shouldn't be any security problems.
        • 1. Re: Functions calls from loaded SWF files
          peterent Level 2
          Even though you say the SWFs are from the same domain, they are being loaded into different ApplicationDomains. Check the Flex docs for more information about them and there's an example showing how to load a SWF into the same ApplicationDomain as its parent.
          • 2. Functions calls from loaded SWF files
            natiupiru Level 1
            Thank you Peter for your response. I tried loading into the same ApplicationDomain but it did not do what I expected it to. I did, however, find the solution to my problem. I needed to understand how to cross-script from a loaded SWF file to the SWF file that loaded it. I found out how and posted a description of my findings on another thread that was more relevant to my question. The solution described allowed me to do what I needed without touching the ApplicationDomain.