I think one of the only main benefits (some may see it as code 
bloat) is encapsulation and binding.  if you pass the vaiables 
through to the child, your child components don't reference the 
parent's model directly, they have their own model. plus binding 
works more consistently when the model you are binding to is in the 
same scope.

--- In [email protected], "Mehdi, Agha" <[EMAIL PROTECTED]> wrote:
> Well, I guess you're right. Just passing a pointer doesn't affect 
the
> performance but I'd still think twice before passing reference of 
a parent
> to its immediate child when the child already has its reference. 
May be, I'm
> missing some big picture or the reasons why would you want to do 
it. Any
> thoughts or ideas will be appreciated.
> 
> Thanks 
> 
> -----Original Message-----
> From: Tracy Spratt [mailto:[EMAIL PROTECTED] 
> Sent: Friday, March 18, 2005 4:43 PM
> To: [email protected]
> Subject: RE: [flexcoders] ViewStack beheviour
> 
> 
> How you reference something depends on how you want to use it.
> 
> If you are programmatically getting data or executing methods or 
setting
> properties, reaching up through the component chain is fine, even 
using
> mx.core.Application.application.
> 
> But beware if you are binding.  For binding to work correctly, you 
need a
> declared, TYPED variable or property in the component itself.
> 
> Text="{mx.core.Application.application.myArray}" will not work 
reliably
> 
> If you are binding, pass a reference to the parent into the child 
component,
> being sure to declare the type for the property.  If you pass in a 
reference
> to the Application, the type should be the application name.
> 
> By the way, I do not believe passing references is going to have 
any
> performance impact.  Before I learned how to pass a reference to 
the
> application, I was routinely passing 30+ references into 
components.
> Changing that has not resulted in any noticeable performance 
increase.
> You are just passing a "pointer" after all.
> 
> Tracy
> 
> -----Original Message-----
> From: Mehdi, Agha [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 18, 2005 3:34 PM
> To: '[email protected]'
> Subject: RE: [flexcoders] ViewStack beheviour
> 
> 
> There's a property called "parent"  of mx.core.UIObject. All the
> containers,
> controls etc extend this Object. This property represents the 
parent
> container of the current control. For eg
> 
> <mx:ViewStack id="myVS">
>       <test:child1/>
>       <test:child2/>
> </mx:ViewStack>
> 
> In both of these children, you can get to the stack by:
> 
> parentStack = this.parent;
> 
> 
> 
> -----Original Message-----
> From: Krzysztof Szlapinski [mailto:[EMAIL PROTECTED] 
> Sent: Friday, March 18, 2005 11:32 AM
> To: [email protected]
> Subject: Re: [flexcoders] ViewStack beheviour
> 
> 
> 
> > Couldn't you just get to the parent, which is the ViewStack, of 
those 
> > children from within those children instead of passing the 
parent into
> 
> > each of them?
> 
> what do you mean by this?
> i did it the way the docs says it shoul be done. at least I think 
so:)
> if
> there is a better solution I would be pleased to learn it.
> 
> one thing to add - these components use some external actionscript
> functions
> which operates on the "vs" object
> 
> krzysiek
> 
> 
> 
> > -----Original Message-----
> > From: Krzysztof Szlapinski [mailto:[EMAIL PROTECTED]
> > Sent: Friday, March 18, 2005 10:01 AM
> > To: [email protected]
> > Subject: Re: [flexcoders] ViewStack beheviour
> >
> >
> >
> > Yeah, these components have functions that handle this "vs" and 
its 
> > children.
> > btw
> > creationPolicy set to "all" made the problem go away but 
unfortunately
> 
> > all the controls which were invisible became visible :( is it 
normal 
> > behaviour that creationPolicy = "all" makes all controls visible 
even 
> > if they have visible property set to "false"?
> >
> > krzysiek
> >
> >
> >>
> >> One more thing that I noticed is that you're passing "vs" to 
every 
> >> child of the stack? That might also be the cause. Any reason 
behind 
> >> that?
> >>
> >> -----Original Message-----
> >> From: Steven Webster [mailto:[EMAIL PROTECTED]
> >> Sent: Friday, March 18, 2005 8:24 AM
> >> To: [email protected]
> >> Subject: RE: [flexcoders] ViewStack beheviour
> >>
> >>
> >>
> >>>
> >>> The nextButton navigates to the next viewstack element. My 
problem 
> >>> is that each component is displayed very slowly.
> >>> It takes about 5 sec. to generate about 20 objects in each
> component.
> >>>
> >>> How can I reduce this time?
> >>>
> >>
> >> Do a search for creationPolicy in the livedocs; you should be 
able to
> 
> >> defer or queue the instantiation of your non-visible views in 
the 
> >> ViewStack, and spread the performance hit over time.
> >>
> >> Steven
> >>
> >> --
> >> Steven Webster
> >> Technical Director
> >> iteration::two
> >>
> >> This e-mail and any associated attachments transmitted with it 
may 
> >> contain confidential information and must not be copied, or 
> >> disclosed, or used by anyone other than the intended recipient
(s). If
> 
> >> you are not the intended
> >> recipient(s) please destroy this e-mail, and any copies of it, 
> >> immediately.
> >>
> >> Please also note that while software systems have been used to 
try to
> 
> >> ensure that this e-mail has been swept for viruses, 
iteration::two do
> 
> >> not accept responsibility for any damage or loss caused in 
respect of
> 
> >> any viruses transmitted by the e-mail. Please ensure your own 
checks 
> >> are carried out before any attachments are opened.
> >>
> >> --
> >> No virus found in this outgoing message.
> >> Checked by AVG Anti-Virus.
> >> Version: 7.0.308 / Virus Database: 266.7.3 - Release Date: 
15/03/2005
> >>
> >>
> >>
> >>
> >>
> >> Yahoo! Groups Links
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> ----
> >> This email may contain confidential and privileged material for 
the 
> >> sole use of the intended recipient(s). Any review, use, 
distribution 
> >> or disclosure by others is strictly prohibited. If you are not 
the 
> >> intended recipient (or authorized to receive for the 
recipient), 
> >> please contact the sender by reply email and delete all copies 
of 
> >> this
> > message.
> >>
> >> To reply to our email administrator directly, send an email to 
> >> [EMAIL PROTECTED]
> >>
> >> Littler Mendelson, P.C.
> >> http://www.littler.com
> >>
> >>
> >>
> >>
> >>
> >>
> >> Yahoo! Groups Links
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
> > ----
> > This email may contain confidential and privileged material for 
the 
> > sole use of the intended recipient(s). Any review, use, 
distribution 
> > or disclosure by others is strictly prohibited. If you are not 
the 
> > intended recipient (or authorized to receive for the recipient), 
> > please contact the sender by reply email and delete all copies 
of this
> message.
> >
> > To reply to our email administrator directly, send an email to 
> > [EMAIL PROTECTED]
> >
> > Littler Mendelson, P.C.
> > http://www.littler.com
> >
> >
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
> > 
> 
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
> 
> ----
> This email may contain confidential and privileged material for 
the sole
> use of the intended recipient(s). Any review, use, distribution or
> disclosure by others is strictly prohibited. If you are not the 
intended
> recipient (or authorized to receive for the recipient), please 
contact
> the sender by reply email and delete all copies of this message.
> 
> To reply to our email administrator directly, send an email to
> [EMAIL PROTECTED]
> 
> Littler Mendelson, P.C.
> http://www.littler.com
> 
> 
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
> 
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
> 
> ----
> This email may contain confidential and privileged material for 
the sole use of the intended recipient(s). Any review, use, 
distribution or disclosure by others is strictly prohibited. If you 
are not the intended recipient (or authorized to receive for the 
recipient), please contact the sender by reply email and delete all 
copies of this message.
> 
> To reply to our email administrator directly, send an email to
> [EMAIL PROTECTED]
> 
> Littler Mendelson, P.C.
> http://www.littler.com





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to