PDA

View Full Version : Javascript & Flash MX Issue


lejusman
01-08-2003, 01:53 PM
I'm using variations of the following code on buttons in a Flash movie to open pop-up windows:

getURL("javascript:window.open('lessons.html','lessons','width=459,height=594,top=0,left=0,resizeable=no'); void(0);");

My flash movie contains 30 buttons. If you press any number of buttons, that many pop-up windows will open; press all 30 and you'll have 30 windows open.

I want only one pop-up window open at any given time--the pop-up window that corresponds to the most recent button pressed.

Is there anything I can add to my code that will close an open pop-up window when another button is pressed?

Thanks very much.

bloodless_1999
01-08-2003, 09:11 PM
Just use the same window. You don't need to close the windows to have the new material open in the same window. Just give the window a name when you open it so that you can reference it:

newWindow = window.open('URL', 'WindowName' . . .)