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" <[EMAIL PROTECTED]>
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
> > >
> > > In my application, I have a section where I need to output text
that
> > > is returned from my cfc. The cfc returns an array, is there away
to
> > > loop output text.
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > 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
> > >
> >
> >
> >
> >
> >
> >
> >
> > --
> > 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
> >
>






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