Popup window from flash, making everything load in just 1 popup

I have a simple thumbnail gallery in flash.
When a user clicks a thumbnail, I want a popup to appear. I got this far… now for my problem.

Without closing the window that has popped up, if you click another thumbnail, ANOTHER window pops up so I decided to keep the name of the windows the same to prevent this.

Now… when you click on the thumbnails, everything loads in just the one window without popping up a new window everytime you click a thumbnail but… the popup window stays minimized or “behind the main window”…

any help would be appreciated, thank you!