Here’s a tip if you want to use runtime styles in your Flex apps
December 17th, 2007
We recently launched a skinned version of our Flex chat widget for the movie Juno.  Since we obviously don’t want to recompile the SWF every time we change the skin, we loaded our styles at runtime using StyleManager.loadStyleDeclarations( "http://path-to-my-styles/styles.swf", true );  However, since the widget depends on runtime styles, I had a problem where the Flex default styles would appear briefly before the runtime styles were loaded.  I came up with a solution on my own using a custom preloader but then I received a much better answer from Deepa Subramaniam, an Adobe Engineer.
She suggested that I view the source on the FlexStore sample application. If you do that, you’ll notice the following:Â
override public function set initialized(value:Boolean):void{Â // Hold off until the Runtime CSS SWF is done loading.}This prevents the preloader from disappearing until you manually set super.initialized = true.This is a great way to preload any content you need, not just styles. For example, you could download a big XML document and populate a DataGrid before you dismiss the preloader.

