Link to home
Start Free TrialLog in
Avatar of Donelson
Donelson

asked on

Need URL of current page of browser

I need to get the URL string from the page which contains the current SWF.
ASKER CERTIFIED SOLUTION
Avatar of wings_gaurav
wings_gaurav

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Donelson
Donelson

ASKER

Wings --

Absolutely Brilliant !  Elegant, succinct, reliable!  Five-Stars for this perfect solution!

After spending 11 hours searching, begging, trying weird and sometimes awful solutions, this is truly EXCELLENT.

All points to the Expert Extraordinaire !
----------- TYPICAL USAGE ---------

stop();

getURL("javascript:window.document.myMovieSwf.SetVariable('pageURL', document.location.href);");

intID = setInterval(this, "check_url", 250);

function check_url() {
      if (pageURL == undefined) return;
      clearInterval(intID);      // Be sure to stop this when we've got an answer
      theArgs = pageURL.split("?")[1];      // get second part of URL
      if (theArgs.length > 0) {
            // do whatever you want with the args
      }
}

WIngs --

I very much appreciate the test page -

     http://www.permadi.com/tutorial/flashGetObject/

I use Macintosh extensively and have found this information for you to add to the TEST table

Macintosh OSX 10.4.x --

     Safari 2.0.3 - Movie plays once then stops for methods (1, 2, 3, and 5). No play for (4 & 6).

     FireFox 1.5.0.3 - Movie plays once then stops for methods (1, 2, 4 and 6).
     No play for 3, which gives dialog "movie object not found. No play for 5.

     Internet Explorer 5.2.3 (no longer supported by MicroSoft on Mac)
     No play for any test.

Regards,
William Donelson