The preloader is instantiated long before the application.  The app’s preloader 
property isn’t used at runtime, the compiler generates special code for it.

A preloader can certainly examine its environment and do different things.  
There are a few custom preloaders on my blogs.


On 8/9/11 10:21 AM, "Philip Smith" <loudj...@hotmail.com> wrote:






We'd like to inject some values into the application preloader instance:

<s:Application preloader="com.storefront.editorhost.app.CustomPreloader">

Is it possible to do something like this hypothetical example:

(application.preloader as CustomPreloader).preloaderModel = new 
PreloaderModel();

Or pass in properties, similar to how it's done with item renderers and 
'ClassFactory' properties?



________________________________
To: flexcoders@yahoogroups.com
From: aha...@adobe.com
Date: Tue, 9 Aug 2011 10:05:04 -0700
Subject: Re: [flexcoders] Inject dependency into Flex application preloader




   Public class MyDownloadProgressBar extends SparkDownloadProgressBar
{
    private var injectedClass:MyInjectClass;
}


On 8/9/11 9:35 AM, "Philip Smith" <loudj...@hotmail.com 
<http://loudj...@hotmail.com> > wrote:







> You can inject certain kinds of dependencies as long as they don’t drag in 
> UIComponent.

Can you provide an example of this, Alex?

________________________________
To: flexcoders@yahoogroups.com <http://flexcoders@yahoogroups.com>
From: aha...@adobe.com <http://aha...@adobe.com>
Date: Mon, 8 Aug 2011 22:13:34 -0700
Subject: Re: [flexcoders] Inject dependency into Flex application preloader




   You can inject certain kinds of dependencies as long as they don’t drag in 
UIComponent.


On 8/8/11 4:29 PM, "method_air" <loudj...@hotmail.com 
<http://loudj...@hotmail.com>  <http://loudj...@hotmail.com 
<http://hotmail.com> > > wrote:







Is it possible?

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
   xmlns:s="library://ns.adobe.com/flex/spark"
   xmlns:mx="library://ns.adobe.com/flex/mx"
   preloader="com.storefront.editorhost.app.ProgressPreloader"
   >

Cheers,

Philip






--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui

Reply via email to