Link to home
Create AccountLog in
Avatar of xanabobana
xanabobanaFlag for United States of America

asked on

Flash / Javascript popup window

Hello -

I'm trying to figure out the best way to have a pop-up window from my flash movie.  I want the window to contain data from a database, and I already have a php file with that information.  so right now in the flash file I have a button with the following actions:

on(release) { getURL ("javascript:popitup('registry.php')"); }

Then, in my html file I have defined popitup the following way:

<script language="javascript" type="text/javascript">
function popitup(url) {,'registry', 'height=200,width=450');
if (window.focus) {newwindow.focus()}

      return false;
// -->

In this solution, the parent window navigates away from the flash movie.  Is there a javascript  solution that will keep the flash movie at the same frame in the parent window?  

I tried to make a movie clip and change the visibility, but my actionscript wasn't good enough to figure out displaying info from the database (I'm much more comfortable with php). maybe that's the better solution?  Help with that would be appreciated if you think that's the way to go.

This site is:  I want the pop-up under Gift Registry->Give a Gift.  which will display all of the current registrations for people to give money to.

thanks for the help!
Avatar of dgofman
Flag of United States of America image

Try to avod calling javascript from Flex your customers may blocked by popup blocker.

You can call your PHP from getURL

Avatar of xanabobana


I'd like to have the php as a small "pop-up" like window, rather than a whole page.  you can have hidden layers in flash that act like a popup, right?   I'm just not sure how to display my database information within the flash movie...
How big your data? I will recommend to create popup window in ActionScript and attach DataGrid.
In this case you can modify you PHP file to provide array of columns/data
thank you, that looks like exactly what I was looking for!
I check your website looks like you have experience working on AS3.
In this case shouldn't be problem for you improving that implementation.
Honestly I don't like this example, I am sure you can do better.

If you will decide to use JavaScript popup better to use showModalDialog instead with 3 reasons:

1) Popup blockers cannot block a new window
2) You can very easily set by center
3) Its module window user will prevent to use browser until closing that window

I tested its working on IE, FF, Chrome.

Good luck!

  <SCRIPT LANGUAGE="JavaScript">
	function openWindow(url, argsVariable){
		var answer = window.showModalDialog(url, argsVariable, "dialogWidth:800px; dialogHeight:500px; center:yes");
	openWindow("", null)

Open in new window

Avatar of dgofman
Flag of United States of America image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account