/ Published in: ActionScript 3
This is for as3 websites with html background, it simply rewrites address with #/
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var baseURL:String = stage.loaderInfo.url; if(baseURL.search("#") == -1) { var withoutHttp:String = baseURL.substring(7,baseURL.length); var indexOfSlash:Number = withoutHttp.indexOf("/", 0); var baseDomain:String = withoutHttp.substring(0, indexOfSlash); var fullDomain:String = "http://"+baseDomain+"/"; var rest:String = baseURL.substring(fullDomain.length, baseURL.length); var rewrited:String = fullDomain + "#/" + rest; //var URL:URLRequest = new URLRequest(rewrited) //navigateToURL(URL, "_self" ) }
URL: http://onemanstudio.eu/snipplr/swfaddress-hash-rewrite.as