Topic: Can you enumerate components in Actionscript
Hi,
can anyone advise on enumeration i actionscript. As an example - I have a widget with lots of components that are similar e.g. progress bars called day1, day2, day3 ... I spend a lot of time repeating the same statements (ugly code0 such as
day1.color =
day2.color =
etc.
In some languages that support object models with strong hierachies eg Delphi this could be replaced by something like
for i = 1 to form.components.componentcount
if form.component[i].name begins "day" then
form.component[i].color = ...
Is there any way this can be done or are there alternatvies e.g. it looks like actionscrio is compiled so could I build the component names as strings eg
for i = 1 to 7
name = "day" + string(i)
name.color = ...
cheers and thansk in advance.
Nigel