• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 173
  • Last Modified:

Need URL of current page of browser

I need to get the URL string from the page which contains the current SWF.
0
Donelson
Asked:
Donelson
  • 3
1 Solution
 
wings_gauravCommented:
Have added this comment to your other posts too

getURL("javascript:window.document.testSWF.SetVariable('strURL', document.location.href);");

where testSWF is your movie name and strURL is the variable in which you would get the value.

getURL function is asynchronous so you might want to loop frames with a check for strURL != undefined.

-wings

0
 
DonelsonAuthor Commented:
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 !
0
 
DonelsonAuthor Commented:
----------- 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
      }
}
0
 
DonelsonAuthor Commented:

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
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now