var n: Number = container.numChildren;
while ( n-- ) {
  container.removeChildAt(n);
}

sounds better ;) less problems when you start from the bottom is my experience.
You have a class with a public DOC (DisplayObjectContainer).

This DOC contains all the visual assets of your class.

In you refresh/reset/constructor method, do you use either:

container = null;

or a loop to manually remove all display objects within the container, eg:

if (container != null)
{
    if (container.numChildren > 0)
    {
        for (var i = 0; i < container.numChildren; i++)
        {
            container.removeChildAt(i);
        }
    }
}

Um ... that's it.
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to