I'm in a situation where I need to create a number of components at
runtime, at different time intervals. A user presses a button and I
create a set of components. They press the button again, and another
set of the same components is created.
My problem is that one of the components created is a checkbox, which
needs to be used later. I can store component information in an array
so I can reference it later, but the problem is that the information
in the array will only hold the initial value of the checkbox, and not
the current value.
Currently I have a function like the following that creates the
required controls when the button is pressed:
private function createStuff():void
{
if (index < maxLimit)
{
var chkCheckbox:CheckBox = new CheckBox;
var txtInput:TextInput = new TextInput;
myArray[index] = [txtInput, chkCheckbox];
index++;
}
}
This is a simplified version, but it works as intended. I have a
function that does stuff with these components, but only the selected
ones. How can I tell what checkbox is selected? They are all called
chkCheckbox! I need to have a unique name for each one, so I can loop
through them and use this["chkCheckbox"+i].selected to see which ones
I perform the 2nd function on.
What's the best way to achieve this? I've tried using a repeater, but
since the dataprovider is empty at the start of the app, it doesn't
seem to update the repeater. Unless I'm using the repeater wrong...
Any help would be greatly appreciated!!!!
Thanks,
K.
--
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
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> 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/