It's not bad per se, depending on the use case. But, the navigator containers only instantiate the first child, and then the other children as needed (deferred instantiation); to cut down on the application load time. If your TabNavigator only has two children, you're not going to see much of a difference. And really, if you know that all of the forms will be needed it's just a matter of preference; make the user wait at the beginning or when a new child is needed. However, deferred instantiation is beneficial, if there are children that may never be needed.
-TH --- In flexcoders@yahoogroups.com, "timgerr" <[EMAIL PROTECTED]> wrote: > > Thanks for the comment, if creationPolicy is bad, what do other people > do and why is it bad? > > Thanks, > timgerr > > --- In flexcoders@yahoogroups.com, "Tim Hoff" TimHoff@ wrote: > > > > > > Hi Tim, > > > > The problem is that only the first child of a TabNavigator is > > instantiated initially. Not best practice, but you can set > > creationPolicy="All" for the TabNavigator; in order to reference the > > other children on init. > > > > -TH > > > > --- In flexcoders@yahoogroups.com, "timgerr" <tgallagher@> wrote: > > > > > > Hello all, I have a TabNavigator that contains 2 forms: > > > <mx:TabNavigator x="196" y="160" width="200" height="200" id="TopTab"> > > > <mx:Form id="FormOne" label="User"> > > > <mx:FormItem label="First Name"> > > > <mx:TextInput id="fname"/> > > > </mx:FormItem> > > > <mx:FormItem label="Last Name"> > > > <mx:TextInput id="lname"/> > > > </mx:FormItem> > > > </mx:Form> > > > > > > <mx:Form id="FormTwo" label="Address"> > > > <mx:FormItem label="Address"> > > > <mx:TextInput id="address"/> > > > </mx:FormItem> > > > <mx:FormItem label="Zip Code"> > > > <mx:TextInput id="zip"/> > > > </mx:FormItem> > > > </mx:Form> > > > </mx:TabNavigator> > > > > > > and I wrote this script to traverse a Form: > > > public function Frm(f:Form):void > > > { > > > var a:Array = f.getChildren(); > > > for(var i:int = 0; i < a.length; i++){ > > > this.FrmI(a[i]); > > > } > > > } > > > > > > public function FrmI(f:FormItem):void > > > { > > > var a:Array = f.getChildren(); > > > for(var i:int = 0; i < a.length; i++){ > > > trace(a[i].id); > > > } > > > } > > > > > > so the script will take a form object, then see how many childreen it > > > has then it will send the formitems to FrmI. Frmi will get me the name > > > of the child objects and that is all. So the problem is when I run > > init() > > > public function init():void > > > { > > > Frm(FormOne); > > > Frm(FormTwo); > > > } > > > I get this in return: > > > fname > > > lname > > > > > > If I just run the 2nd form like this: > > > public function init():void > > > { > > > Frm(FormTwo); > > > } > > > > > > Nothing is displayed. I think this has to do with TabNavigator. It > > > looks to only get information from the tab that is on the top. Is > > > that correct, and what do I have to do in order to get all the > > > information ? > > > > > > Thanks, > > > timgerr > > > > > >