A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: how to get the url of the domain

  1. #1
    Senior Member
    Join Date
    Apr 2009
    Posts
    117

    how to get the url of the domain

    how to get the url of the domain where the swf islocated when i use

    _root._url i get the path as

    http://domain.com/main.swf

    i want only http://domain.com

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Try something like
    PHP Code:
    var lc:LocalConnection = new LocalConnection();
    web.text lc.domain(); 
    or perhaps something like
    PHP Code:
    var lc:LocalConnection = new LocalConnection();
    TheUrl lc.domain();
    if (
    TheUrl.indexOf("http://") == -1)
    {
        
    web.text "http://" TheUrl;
    }
    else
    {
        
    web.text TheUrl;

    if it is not bringing in the http://
    Last edited by fruitbeard; 01-29-2013 at 11:58 AM.

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