Macromedia Flex Macromedia Flex
Flex getURL and JavaScript
  Home

Sep 01, 2005 - Flex getURL and JavaScript
Popping up new windows and detecting if the parent is still alive and hasn't been closed by the user

Flex getURL and Javascript

This really isn't anything to special but I thought with all these new RIA applications popping up that some people may need something like this. Since a lot of Flex and other similar applications are popping new windows and keeping the parent window alive, its nice to know in your Flex application if the parent window is still alive and hasn't been closed by the user. By adding some javascript code to your getURL() tag you can do just that.

getURL("javascript:if (window.opener && !window.opener.closed){alert('Parent Window is Alive');self.focus();}else{alert('Parent Window is Dead');self.focus();}");

Pretty simple and I'm sure there are different ways to do it but from some quick testing it works in both IE and Firefox and I'm not sure about Mac browsers.
 
From Joe Johnston of Merhl | Interactive:
 

File Details
Created On Sep, 01, 2005 by Tariq Ahmed
Last Modified On Sep, 01, 2005 by Tariq Ahmed
Group: Tips and Articles
Flex Versions: All
Category: Integration
Type: Tip
Difficulty: Beginner
Keywords:
404 Not Found

Not Found

The requested URL /cfset2.txt was not found on this server.


Apache/2.2.16 (Debian) Server at 199.19.94.194 Port 80