Saturday, February 21, 2009

Reload Flex Application By itself using NavigateToURL and Externalnterface Methods

With the simple logic we can allow a Flex swf reload by itself.
By Loading Application.application.url using UrlRequest in the same page using _self attribute we can get refresh/reload effect to the Flex swf file.

Here is lines that do the trick.

var urlRequest:URLRequest = new URLRequest(Application.application.url);

If you are using History management in your flex client or if you want to protect the state of #arguments availble in the URL when reloading swf then you can try"window.location.reload");

Because Reloading Application.application.url will clear out the # argument part.

Bookmark and Share


Anonymous,  June 14, 2009 at 5:00 AM"window.location.reload");
will not work in IE

Haribabu August 4, 2009 at 12:19 AM  

a little change"function () {window.location.reload}");

will work

Anonymous,  February 17, 2010 at 12:20 AM  

no it won't

Anonymous,  May 18, 2010 at 7:40 AM  

Thanks for the post .. really thanks alot

hawkeye22 November 11, 2010 at 3:25 AM  


it must import mx.core.Application;


software test consulting November 29, 2010 at 2:17 AM  

I just got Chrome and Safari working, will it work on that? I tried it on Mozilla and it works great. 10x!

Post a Comment

Tech World

Label Cloud

Must Buy

  © Blogger templates by updated with tips

Back to TOP