I found the bug. I was addChilding a DisplayObject that already had a
parent. I had to release it from it's previous parent first.
Is there a cleaner way of doing it than:
if( newThing.parent ){
CWRoom( newThing.parent )._numKids--;
}
this.addChild(newThing);
--- In [email protected], "pinkmongrel" <[EMAIL PROTECTED]>
wrote:
>
>
>
> Here is a bug that's been biting me for a couple weeks. Here's a
> screenshot of Flex when it errors out:
>
> getChildAt_RangeError
> <http://web7.ehost-
services.com/justice/flushyourbrain/getChildAt_RangeE\
> rror.gif>
>
>
> The program croaks when measureContentArea (in package
> mx.containers.utilityClasses, file CanvasLayout.as ) loops through
the
> target's children from 0 to target.numChildren. When the program
errors:
> n == 112, i == 111, and target.numChildren is now 111, when it was
112
> before the loop. target.numChildren has changed while the loop is
> running. It's as if a child was removed by some side effect of
calls in
> the loop.
>
> This baffles me because I don't see how I can debug it. I do add and
> remove and insert children in my game code, but unless ActionScript
is
> threaded I don't see how my code can reach into a loop in
> CanvasLayout.as .
>
> The bug is consistent, but I am baffled.
>
> HELP!
>
> D
>
--
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/