Flash Pop-up AD Over Html?

Hi,
I’m struggling try to figure out how to successfully create one of those Flash “pop-ups” that appear over the Html. We have all seen them on MSN, Yahoo, MySpace ect… where a transparent swf is floating above the HTML content, and can be closed or it closes it self.

So far I have used css z-index to “float and position” the div containing my flash pop-up over the HTML page. Now I need to find away to “close” the pop-up. I read that the way to do it is to have a javascript command in flash to tell the div to be hidden. That way I can time when it closes or have a “X” button to close it.
Unfortunately, I haven’t been able to make that work.

If someone has an idea how to accomplish this your help will be greatly appreciated.
I’ve been trying to search the forum, but the search function is not working for me.

Thanks.