# Can't get window.location.href from Javascript

**URL:** <https://forum.kirupa.com/t/cant-get-window-location-href-from-javascript/172948>\
**Category:** flash\
**Created:** [December 19, 2005, 8:51pm UTC](https://forum.kirupa.com/t/cant-get-window-location-href-from-javascript/172948 "2005-12-19T20:51:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kemoslobby](https://avatars.discourse-cdn.com/v4/letter/k/7c8e57/32.png) [@Kemoslobby](https://forum.kirupa.com/u/Kemoslobby)\
**Post date:** [December 19, 2005, 8:51pm UTC](https://forum.kirupa.com/t/cant-get-window-location-href-from-javascript/172948/1 "2005-12-19T20:51:09Z")

</div>

Hi,

Thanks for taking the time to read this, and hopefully help me out.

In actionscript I am trying to get the location of the host html doc that has the .swf embedded (ie: [www.mydomain.com/about/index.htm](http://www.mydomain.com/about/index.htm)).

I have tried the \_url method in actionscript, but it returns the path of the .swf doc relative to the website (ie: [www.mydomain.com/assets/flash/myswf.swf](http://www.mydomain.com/assets/flash/myswf.swf))

Is there a way to achieve this in Actionscript? I looked into fscommand but I need this to work with Safari for Mac OS.

Thank you for all and any help.
