下面是实现获取本机IP地址的方法:
并根据IP地址组装成一个URL,如下面所示:
//动态获取IP地址
var _loc_1:* =ExternalInterface.call("function getURL(){return window.location.href;}");//call("window.location.href.toString", 1);
var _loc_2:* = _loc_1.split(":");
var serverIP:String = _loc_2[1].toString().substring(2);
var url:String="http://"+serverIP+":8080/sems/login.do";
var request:URLRequest=new URLRequest(url);
navigateToURL(request,"_blank");