Stage autowiring - what am I doing wrong
I have not been able to get stage autowiring to work, please let me know what I am doing wrong.
Here are the steps that I have completed:
1. Added the compiler option (I am using a Mac so I tried both options with no success).
2. Included the Autowiring processor in the application context:
<object id="autowiringStageProcessor" class="org.springextensions.actionscript.stage.Def aultAutowiringStageProcessor"/>
3. Added the [Autowired] metadata to a public property in my "LoginPanel".
4. Wired the controller object in the application context.
I successfully load both the XML and FlexXML application contexts.
I have tried adding the login panel to the application programmatically and through mxml to no avail.
Do you have any tips or tricks that I am missing?
I think this was an easy one :)
in the sample that you sent me the wireApplication() method was never called, so the application context was never created and stuff.
When I added this to the s:Application tag:
the autowiring worked perfectly.
minWidth="1024" minHeight="768" xmlns:ns1="*"
I hope that solves your problem, but maybe you just forgot it in the sample app, let me know how you fare...
P.S. I noticed in Flex 4 apps that using the applicationComplete event is the safest moment to create the application context, when using creationComplete not everything that is on the stage by default will get wired properly. In Flex 3 this was't a problem, we'll look into this.