Return to Snippet

Revision: 37030
at December 2, 2010 21:14 by onemanstudio


Initial Code
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" ) 
}

Initial URL
http://onemanstudio.eu/snipplr/swfaddress-hash-rewrite.as

Initial Description
This is for as3 websites with html background, it simply rewrites address with #/

Initial Title
SWFAddress HASH rewrite

Initial Tags

                                

Initial Language
ActionScript 3