Subscribe

  • Subscribe  

Reload Flex Application From Itself

Posted by Charles | October 16, 2008 .

Here is a nice little trick to allow a Flex application reload itself. This is very handy when you are dealing with server side logics that need refreshing the application for something new.

The idea of this reload is via Application.application.url.

var urlRequest:URLRequest = new URLRequest(Application.application.url);
navigateToURL(urlRequest,"_self");

The above code will do it. Nice and simple.

Leave a Comment

If you would like to make a comment, please fill out the form below.


Name

Email

Website

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Comments

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word


Related Posts

11 Comments so far
  1. Tom Van den Eynde  December 17, 2008 6:16 am

    I was looking for a solution and I tried the suggestion above but that resulted in the SWF being reloaded instead of the page containing the SWF. Therefore Javascript functions (eg. used for history management) and URL parameters were lost.

    Therefore I suggest the following:
    ExternalInterface.call(“window.location.reload”);

  2. Jin  January 26, 2009 5:45 pm

    Cool! Thanks alot !!

  3. Dave Morgan  March 8, 2009 12:04 am

    Does anyone know of a way to reload the app without IE blocking the reload with warnings?

  4. Dave Morgan  March 8, 2009 12:14 am

    OK, disregard my post.

    ExternalInterface(“window.location.reload) does fine.

    All I’m trying to do is reset all input and return to a login screen; a change watcher will be quicker and more seamless, I think.

  5. priya  April 19, 2009 11:46 pm

    thanks

  6. vikrant  June 28, 2009 6:58 pm

    Can we do reloading without refreshing the page?

  7. allyourbase  January 29, 2010 4:37 am

    Hi,

    Thanks for this quick and simple solution. I was searching for exactly this and found it here – simple and short. :)

  8. Anonymous  August 2, 2010 3:59 pm

    Avoid a warning with Flex 4 SDK:
    var urlRequest:URLRequest = new URLRequest( FlexGlobals.topLevelApplication.url );
    navigateToURL(urlRequest,”_self”);

  9. Anonymous  November 17, 2010 3:01 am

    Nice ! It’s just what i’m looking for.

  10. Ghalia  October 12, 2012 3:25 pm

    thanks for the trick ! i will try it !

  11. Hubert Czerpak  October 25, 2012 8:21 pm

    Or

    navigateToURL(new URLRequest(BrowserManager.getInstance().url), “_self”);

<

Error. Page cannot be displayed. Please contact your service provider for more details. (19)


Direct TV Offers - usdirect has the best directtv deals