try it out this

parentApplication.closing.createChild(mx.containers.Grid,
undefined,{id = "grid"+i});

--Suresh

--- Jeremy Rottman <[EMAIL PROTECTED]> wrote:

> Well I tried what you said Suresh, and it is still a
> no go. Here is my
> updated code.
>
>                      for ( var
> i:Number=0;i<result.length;i++){
>
>                      var newGrid =
>
parentApplication.closing.createChild(mx.containers.Grid,
> undefined);
>                              newGrid.id = "grid" +
> i;
>                              newGrid.x = 10;
>                              newGrid.y =
> parentApplication.closing.mainGrid.y + 20;
>                              newGrid.width = '90%';
>                      var newGridRow =
>
parentApplication.closing.newGrid.createChild(mx.containers.GridRow,
> undefined);
>                              newGridRow.id =
> "gridRow" + i;
>                      var newGridItem =
>
parentApplication.closing.newGrid.newGridRow.createChild(mx.containers.G\
> ridItem, undefined);
>                              newGridItem.width =
> 445;
>                              newGridItem.id =
> "gridItem" + i;
>                      var newCanvas =
>
parentApplication.closing.newGrid.newGridRow.newGridItem.createChild(mx.\
> containers.Canvas);
>                              newCanvas.width
> ='100%';
>                              newCanvas.heigth
> ='100%';
>                              newCanvas.id = "canvas"
> + i;
>                      var newLabel
>
=parentApplication.closing.newGrid.newGridRow.newGridItem.newCanvas.crea\
> teChild(mx.controls.Label, undefined);
>                              newLabel.id = "name" +
> i;
>                              newLabel.text = "TEST";
>                      }
> --- In flexcoders@yahoogroups.com, Suresh Akula
> <[EMAIL PROTECTED]> wrote:
> >
> > Hello Rottman,
> >
> >     You already created the newGrid and assigned a
> > dynamic id to that. Why can't you use the same
> intance
> > variable name in the rest of the code.
> > i.e.
> > var newGridRow =
> >
>
parentApplication.closing.newGrid.createChild(mx.containers.GridRow,
> > undefined);
> >
> > --Suresh Akula.
> >
> >
> >
> > --- Jeremy Rottman [EMAIL PROTECTED] wrote:
> >
> > > I am still working on this. And I have run into
> an
> > > issue.  When I create
> > > a child, I need to give that child a unique id.
> I
> > > tried 'grid' & i to
> > > make it unique, but that doesnt work.
> > >
> > > Here is hte code I am trying
> > >
> > >
> > >      for ( var i:Number=0;i<result.length;i++){
> > >
> > >          var newGrid =
> > >
> >
>
parentApplication.closing.createChild(mx.containers.Grid,
> > > undefined);
> > >              newGrid.id = 'grid' & i;
> > >              newGrid.x = 10;
> > >              newGrid.y = mainGrid.y + 20;
> > >              newGrid.width = 90%;
> > >          var newGridRow =
> > > parentApplication.closing.'grid' &
> > > i.createChild(mx.containers.GridRow, undefined);
> > >              newGridRow = 'gridRow' & i;
> > >          var newGridItem =
> > > parentApplication.closing.'grid' & i.'gridRow'
> > > & i.createChild(mx.containers.GridItem,
> undefined);
> > >              newGridItem.width = 445;
> > >              newGridItem.id = 'gridItem' & i;
> > >          var newCanvas =
> > > parentApplication.closing.'grid' & i.'gridRow' &
> > > i.'gridItem' &
> i.createChild(mx.containers.Canvas);
> > >              newCanvas.width = 100%;
> > >              newCanvas.heigth = 100%;
> > >              newCanvas.id = 'canvas' & i;
> > >          var newLabel = var newLabel
> > > =parentApplication.closing.'grid' &
> > > i.'gridRow' & i.'gridItem' & i.'canvas'
> > > i.createChild(mx.controls.Label,
> > > undefined);
> > >              newLabel.id = 'name' i
> > >              newLabel.test = 'TEST'
> > >              }
> > >
> > >
> > >
> > > --- In flexcoders@yahoogroups.com, "Jeremy
> Rottman"
> > > rottmanj@
> > > wrote:
> > > >
> > > > That is exactly what I was talking about karl.
> > > >
> > > > --- In flexcoders@yahoogroups.com, "Karl
> Johnson"
> > > karl.johnson@
> > > > wrote:
> > > > >
> > > > > When you say loop over components, do you
> mean
> > > loop over existing UI
> > > > > objects? Or do you mean create UI objects?
> > > > >
> > > > > If you are creating, then do something like
> the
> > > following to create
> > > a
> > > > > label and/or textbox control for each index
> of
> > > the array returned:
> > > > >
> > > > > For loop
> > > > > {
> > > > >  var newLabel =
> > > myVBox.createChild(mx.controls.Label,
> undefined);
> > > > >  newLabel.text = myArray[i];
> > > > > }
> > > > >
> > > > > Are we on the right path here or is this not
> > > what you are looking
> > > for?
> > > > >
> > > > > |<
> > > > >
> > > > > Karl Johnson
> > > > > Cynergy Systems, Inc.
> > > > > http://www.cynergysystems.com
> > > > >
> > > > > -----Original Message-----
> > > > > From: flexcoders@yahoogroups.com
> > > [mailto:[EMAIL PROTECTED]
> > > On
> > > > > Behalf Of Jeremy Rottman
> > > > > Sent: Tuesday, April 25, 2006 3:43 AM
> > > > > To: flexcoders@yahoogroups.com
> > > > > Subject: [flexcoders] Re: Looping output
> > > > >
> > > > > I am trying to loop over components. Like
> Labels
> > > and text. So
> > > depending
> > > > > on how many records I return it outputs that
> > > many sets of labels and
> > > > > text components.
> > > > > --- In flexcoders@yahoogroups.com, "Tracy
> > > Spratt" <tspratt@> wrote:
> > > > > >
> > > > > > Jeremy, have you looked at the for loops?
> > > > > >
> > > > > > for (var i:Number=0;i<myArray.length;i++)
> {
> > > > > >   oElement = myArray[i];
> > > > > > }
> > > > > >
> > > > > > Or
> > > > > >
> > > > > > for (var key in myObject) {
> > > > > >   oTemp = myObject[key];
> > > > > > }
> > > > > >
> > > > > > Tracy
> > > > > >
> > > > > > -----Original Message-----
> > > > > > From: flexcoders@yahoogroups.com
> > > [mailto:[EMAIL PROTECTED]
> > > > > On
> > > > > > Behalf Of Jeremy Rottman
> > > > > > Sent: Monday, April 24, 2006 4:50 PM
> > > > > > To: flexcoders@yahoogroups.com
> > > > > > Subject: [flexcoders] Looping output
> > > > > >
>
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


--
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