close popup AS3
- Started
- Last post
- 5 Responses
- ukit
Say you have a site that opens a Flash movie in a popup and then you want to close the popup from Flash. What would be the way to do that in AS3. Do I need to use External Interface?
- cuke4260
if you want to communicate with something outside of flash(ie the browser = not flash) then you need externalInterface
- ifeltdave0
I think this will do it, make sure to import the ExternalInterface class.
var result:Boolean = Boolean(ExternalInterface.call... ));
where "yourFunction" is a simple JS command to close the window. At least I *think* this will work.
- ukit0
OK, I'm getting External Interface to work, thanks.
- ukit0
Hmmm, just curious, does the SWF need to be in the same directory as the HTML file in order for External Interface to work correctly? It seems to stop working when I move my SWF into a separate folder.