Hi Sindhu,

What Imtiyaz means is.. in your code, both of your for loops says this:

for(var count:int=0;count<deptControlArray.length;count++)

which means that the loop will run until count exceeds the length of
deptControlArray. And within the loop you are doing:

deptControlArray.addItem(tempObj)

This would increase the length of deptControlArray by one. So every time you
increase the length of the arrayCollection, and "count" variable will never
be able to reach a position where it is more that the length
deptControlArray. And hence your code goes into infinite loop.

This is a very basic logic error!

Here what you can do is, before the loop, assign the length of
deptControlArray to a variable and put a check for that variable in the for
loop. Like this:

var len:int = deptControlArray.length;
for(var count:int=0;count<len;count++)

Hope you got where you were wrong.

Regards,
Venkat
www.venkatv.com
On Thu, Oct 16, 2008 at 8:38 PM, sindhu <[EMAIL PROTECTED]> wrote:

>
> So...can u explain it in detail?
> Or wats the alternate way?
>
> On Oct 7, 1:58 pm, imtiyaz <[EMAIL PROTECTED]> wrote:
> > You are adding a item in deptControlArray (in the loop) where the loop
> > depends on the deptControlArray's length.
> >
> > Regards,
> > Imtiyaz Basha M S
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to