I asked this before on the Mochi forums: https://www.mochimedia.com/community/forum/topic/reliably-find-the-page-url
Long story short, there's no 100% reliable way unless you have some sort of control over where the SWF is placed - loaderInfo.url gives you the swf url, not the page one, and some of the time this can be the address of the preloader SWF (e.g if you make a game that goes onto game sites). You could try JavaScript, but that only works if it's enabled and sometimes you'll get the address of an iFrame, rather than the main page URL. Ditto for calling a PHP file.
Your best best is JS, but keep in mind that it's not perfect
var url:String = ExternalInterface.call("window.location.href.toString");
Note, you can do the same when you're embedding the SWF and pass the value in as a Flashvar