Is this the line you're referring to?

callLabel[item..callLocation_id] = new formField();

If so.... I see a few issues. when you instantiate callLabel you're
missing parentheses. Should look like this: callLabel = new Array();
You should also use push() to add items to an array, not the []
notation. Here is the approach I would recommend.

Rename callLabel to something that conveys its a collection and make
it of type ArrayCollection. Instantiate and set the properties on your
formField components before adding them to the collection. Then use
ArrayCollection's methods to retrieve the object later. The code for
all that might look something like this:

var callLabelCollection:ArrayCollection = new ArrayCollection();

// inside your loop (classes should really start with a capital letter)
var ff:FormField = new FormField()
ff.labelText = item..callLocation_DisplayName;
ff..callLocationId = item..callLocation_id;
ff.allowableDataFlag = item..deptCategory;

callLabelCollection.addItem(ff);

// then to retrieve an item later you can do this
var someFF:FormField =
callLabelCollection.getItemAt(callLabelCollection.getItemIndex(ffToFind));

HTH,
Ben


--- In [email protected], "donvoltz" <[EMAIL PROTECTED]> wrote:
>
> I have another very long post on the list, however, think I have been 
> able to focus my question some. I am adding a custom component to my 
> application that contains a label, text input and an image. This 
> component is added many times to a panal container. I need to be able 
> to access the properties of each of these custom components and 
> wonder what the best method to do so is. 
> 
> I need to have a un unique id for each instantiated custom component 
> that I can keep until I remove it from the panal. I am looking for 
> suggestions on the best way to dynamically add or remove custom 
> components to the panal while at the same time keeping track of the 
> current components so I can access their properties.
> 
> Currently I am using an array for each component I add to the panal, 
> however, as I run the application, I am no longer able to access the 
> parameters of the components in the panal, the array continues to 
> become null.
> 
> Any help on this would be greatly appreciated
> 
> Thanks
> 
> Don
>


Reply via email to