SWFAddress HASH rewrite


/ Published in: ActionScript 3
Save to your folder(s)

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


Copy this code and paste it in your HTML
  1. var baseURL:String = stage.loaderInfo.url;
  2. if(baseURL.search("#") == -1)
  3. {
  4. var withoutHttp:String = baseURL.substring(7,baseURL.length);
  5. var indexOfSlash:Number = withoutHttp.indexOf("/", 0);
  6. var baseDomain:String = withoutHttp.substring(0, indexOfSlash);
  7. var fullDomain:String = "http://"+baseDomain+"/";
  8. var rest:String = baseURL.substring(fullDomain.length, baseURL.length);
  9. var rewrited:String = fullDomain + "#/" + rest;
  10. //var URL:URLRequest = new URLRequest(rewrited)
  11. //navigateToURL(URL, "_self" )
  12. }

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.