Regarding pop up's from flash

Hey all,

  I have a quick question:  in flash, I want to have a button, when clicked, pop's up a new browser window, and when I click another button it can tell that the second browser window is already open and so it loads the content into that second browser window.

 I know how to spawn a new window using prototype in flash, but I was wondering if someone could help me with the second part.

Thanks.