1 Reply Latest reply on May 5, 2006 9:17 AM by Newsgroup_User

    Get URL of current browser page (incl. ?args) containing current SWF

    William_Donelson Level 1
      Get URL of current browser page (incl. ?args) containing current SWF
      ---------------------------------

      I looked for 11 hours over two days for a solution to the problem, then today ----


      Wings Gauray said:

      >>>>>>> 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

      ------ Comment from Donelson
      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 hail to the Expert Extraordinaire !
        • 1. Re: Get URL of current browser page (incl. ?args) containing   current   SWF
          Level 7
          William_Donelson wrote:

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

          you could pass it in as a FlashVar via javascript rather than trying to
          pull it into flash using getURL and setVariable as above.

          --
          MOLOKO
          Macromedia Certified Flash MX 2004 Developer
          Macromedia Certified Flash MX Developer
          ------------------------------------------------
          ::remove _underwear_ to reply::
          'There ain't no devil - it's just God when he's drunk' Tom Waits
          ------------------------------------------------
          GCM/CS/IT/MC d-- S++:- a- C++ U--- P+ L++ !E W+++$ N++ O? K+ w+++$ !O M+
          VMS? PS+++ PE- Y PGP+ t+ 5-- X-- R* tv++ b++++ DI++++ D+ G e h-- r+ y++