Hi there,

 

I could nail down the issue a bit more. It’s somewhat difficult to put it in words but I’ll give it a try:

 

Here’s the EXACT scenario in quick words:

 

1. Main app creates an instance of a custom class on applications initialize event. (My first mistake was to create it on creationComplete. Obviously that one is fired once all components have already been created, so my MXML Component did never receive the instance because it simply was not instantiated at that time.)

 

2. With the change from creationComplete event to initialize event my MXML component now successfully receives the instance.

 

But things get more complicated:

 

The MXML Component – let’s name it A – contains a state…

 

<mx:State name="loginDataVisible">

<mx:AddChild target="{this}" position="firstChild">

            <rottmann:LoginDialog u="{this.userObject}"/>

      </mx:AddChild>

 

… which brings up yet another MXML Component, a login form – let’s name it B. And again I want B to receive the instance reference from the main application. So here’s the idea:

 

Main App passes instance to MXML Component A. Once A switches to a specific state, MXML Component B get visible an A passes the instance to B.

However, you might already guess, B never receives the instance reference but remains null.

 

I sense this could have anything to do with userObject not being available in A once Flex “creates” the objects in the various states but how should I then pass main application objects down to MXML Components?

 

 

Ralf Rottmann

 

 

 



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to