actionscript 3 - How to get the final URL from a redirect in AS3? -


i need final url link gets redirected. (e.g. if using url shortener)

bit.ly/foobar ->redirect-> http://example.com 

what fastest way in as3? you

since using air, can listen httpstatusevent.http_response_status event:

var urlloader:urlloader = new urlloader(new urlrequest("http://bit.ly/1bddlxc")); urlloader.addeventlistener(httpstatusevent.http_response_status, urlloader_httpresponsestatus);  function urlloader_httpresponsestatus(e:httpstatusevent):void  {         trace(e.redirected, e.responseurl); } 

the result of above trace true http://www.google.com/

this event gives information whether url redirected , new url is.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -