Defeat deferred instantiation judiciously, if at all.  It is an easy
fix, but has consequences.  Better practice is to use binding or your
own event system to reference data at the right time.

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of per.olesen
Sent: Thursday, November 22, 2007 4:03 PM
To: [email protected]
Subject: [flexcoders] Re: HttpService not called the first time

 

Hi,

Maybe you should try setting creationPolicy="all" on your TabBar. By
default, it first creates the child components when someone tabs into
it. If you set it to "all", all child controls will be created
up-front (which can be expensive, if you have many that are complex).

See:
http://livedocs.adobe.com/flex/201/langref/mx/core/Container.html#creati
onPolicy
<http://livedocs.adobe.com/flex/201/langref/mx/core/Container.html#creat
ionPolicy> 

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "gers32" <[EMAIL PROTECTED]> wrote:
>
> Hi,
> 
> Components A and B are inside Panels of a ViewStack; they're accessed
> via a TabBar.
> 
> I define an HttpService within component A.
> I call A.HttpService from an action in component B.
> 
> When I perform the action in component B, A.HttpService will only get
> called if I have PREVIOUSLY visited A... And to top it all off,
> A.creationComplete() doesn't get fired either when I visit it, unless
> I have PREVIOUSLY performed the action in B !
> 
> My problem seems to stem from the order in which these components get
> initialized, but this behavior doesn't make sense to me.
> 
> Thanks for your help,
> 
> Chris.
>

 

Reply via email to