PDA

View Full Version : Reinitialize Application


KhaledK
05-23-2007, 09:58 PM
Hi all,

Is there any way to reload / reinitialize the whole flex application
from actionscript? :confused:


Something like:

Application.application = new MyApplication()

but obviously Application.application is read only property.

How else it can be done?

dr_zeus
05-24-2007, 05:22 PM
Find a way to completely reload the SWF.

I'm serious. I wouldn't want to even try figuring out a way to refresh all the bootstrapping code to get the Flex framework up and running.

Crunchy Cat
05-24-2007, 08:39 PM
Assuming the application is run in a javascript enabled browser, a reload command at the javascript level can be issued from Flex:

import flash.external.*;

ExternalInterface.call( "location.reload", "" );

If memory serves me correctly, doing it this way will also alleviate the user from hearing a browser navigation 'click' sound upon reload.

KhaledK
05-25-2007, 04:47 AM
Thanks friends for your useful posts.