Get URL of current page from Flex 3?

前端 未结 7 799
死守一世寂寞
死守一世寂寞 2021-01-12 17:58

How do I determine the URL of the current page from within Flex?

7条回答
  •  再見小時候
    2021-01-12 18:05

    I searched and came up with this url. I've honestly never used Flex, but it looks like the important part of that document is this:

    private function showURLDetails(e:BrowserChangeEvent):void {
      var url:String = browserManager.url;
      baseURL = browserManager.base;
      fragment = browserManager.fragment;                
      previousURL = e.lastURL;                
    
      fullURL = mx.utils.URLUtil.getFullURL(url, url);
      port = mx.utils.URLUtil.getPort(url);
      protocol = mx.utils.URLUtil.getProtocol(url);
      serverName = mx.utils.URLUtil.getServerName(url);
      isSecure = mx.utils.URLUtil.isHttpsURL(url);        
    }
    

    Either way, good luck! :)

提交回复
热议问题