Why not check the number of children in the container before trying 
to access them?
  And/or if you already have a variable pointed to the child, check 
to see that it isn't null before accessing it.

  If you were to provide some code it might be easier to suggest options.

At 09:58 AM 5/18/2007, Matt wrote:

>I have been using Flex for quite a while now and I've found quite a
>few moderate to serious bugs, but the one that keeps slapping my face
>when I approach something close to stability is this error:
>
>RangeError: Error #2006: The supplied index is out of bounds.
>
>This seems to occur due to ActionScript 3's lack of concurrency
>support. It would seem that if I quickly remove and add several
>components to a container this shows its ugly head. What makes this
>particularly scary is that the error message appears once and then any
>time I try to do anything at all to the container after that it throws
>the same message over and over.
>
>I originally saw this appear in reference to popups on the
>SystemManager container and created a work-around to pre-instantiate
>windows and just keep them hidden until needed. It was specifically a
>problem when I would use the popup manager to display a menu and the
>selection of a menu option would then display a window. What ended up
>happening was that the window would be created and popped up at the
>same time the popup was being removed and it would get its internal
>indexing off it would seem and never could you do anything to the
>SystemManager container again.
>
>Is there a way to add and remove items "safely" or is this a known bug
>and one I just have to live with until Adobe gets around to fixing it?



--
Jeffry Houser, Technical Entrepreneur, Software Developer, Author, 
Recording Engineer
AIM: Reboog711  | Phone: 1-203-379-0773
--
My Company: <http://www.dot-com-it.com>
My Podcast: <http://www.theflexshow.com>
My Blog: <http://www.jeffryhouser.com>  

Reply via email to