Creating 'Floating Ads' and closing them

I know many of you will have seen the floating flash adverts that some websites incorporate on to their homepages, I am trying to create one as more of a warning popup instead of an advert. I have created the SWF, placed it into a layer on my page in Dreamweaver, so far so good. But here’s the problem.

How do I close it? I have my close button, but everything I have tried does not properly close this popup. Does anyone have any suggestions or know what to do to solve this?

Many thanks in advance :ub: