A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Can Flash Tell What URL?

  1. #1
    Senior Member
    Join Date
    Jun 2001
    Posts
    343

    Can Flash Tell What URL?

    I haven't been successful in finding this answer. I'm trying to have a swf recognize what url the swf is embedded in. For example, if the swf is embedded in html on a page with the url http://myurl.com/example.html could the swf put that url in a text container? If so, how?

  2. #2
    Junior Member
    Join Date
    May 2010
    Posts
    11
    This is from the Flex manual:

    Code:
         import flash.external.*;
      
         public function callWrapper():void {
            var s:String;
            if (ExternalInterface.available) {
               var wrapperFunction:String = "changeDocumentTitle";
               s = ExternalInterface.call(wrapperFunction,ti1.text);
            } else {
               s = "Wrapper not available";
            }
            trace(s); 
         }
    In the html file, you make a func that returns window.url.

  3. #3
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    You can actually embed that javascript function in the swf itself.
    http://board.flashkit.com/board/show...ight=embedding

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center