hello,
In short:
How can I remove all children that are instances of a given class?
I've tried the following:
if i do that i get this error:Code:for each (var obj:InfoBox in infoPanel) { infoPanel.removeChild(obj); }
however, if i use MovieClip instead of InfoBox (for each (var obj:MovieClip in infoPanel), it works well and it removes all movieclips.Code:TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@4304f821 to InfoBox
and if i trace infoPanel.getChildAt(i) (in a loop), i get all the objects [object InfoBox] as well as the objects MovieClips.
Why?
thanks in advance!




Reply With Quote
