[Flash 8] Centered Pop-Up Window

I had great success with the tutorial on this site about Centered Pop-Up Windows

Now my question is how do I get this to work when my button is in a swf that is being loaded into an html page. Basically the button swf is on the server but there is no html document for it on the server. Where do I put the javascript that goes above the body tag? Do I put it in the html document that the button swf is being externally loaded into??

Hope this question made sense. Any help would be greatly appreciated.

Thanx
Taylor Tay