But in essence, going back to your example, there is no capacity to inject
'MyInjectClass' with a public setter?
Public class MyDownloadProgressBar extends SparkDownloadProgressBar
{
private var _injectedClass:MyInjectClass;
private var _preloaderModel:PreloaderModel;
public function set injectedClass(value:MyInjectClass):void
{
this._injectedClass = value;
}
public function set preloaderModel(value:PreloaderModel):void
{
this._preloaderModel = value;
}
}
Ideally we would like to have a generic custom preloader component with an MVC
structure that uses dependency injection.
To: [email protected]
From: [email protected]
Date: Tue, 9 Aug 2011 10:39:41 -0700
Subject: Re: [flexcoders] Inject dependency into Flex application preloader
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" <[email protected]> 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: [email protected]
From: [email protected]
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" <[email protected]
<http://[email protected]> > 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: [email protected] <http://[email protected]>
From: [email protected] <http://[email protected]>
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" <[email protected]
<http://[email protected]> <http://[email protected]
<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