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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -