Just cleaned up my development folder as stumbling upon that little script to trace every children
(and it's children) in a specific DisplayObject:
Actionscript:
-
traceDisplayList(allCon, "=>");
-
-
function traceDisplayList(container:DisplayObjectContainer, indentString:String = ""):void {
-
var child:DisplayObject;
-
-
for (var i:uint=0; i <container.numChildren; i++) {
-
child = container.getChildAt(i);
-
trace(indentString, child.parent.name + " " + indentString + " " + child.name);
-
-
if (container.getChildAt(i) is DisplayObjectContainer) {
-
traceDisplayList(DisplayObjectContainer(child), indentString + "");
-
}
-
}
-
}
-
-
// => allCon => container00
-
// => container00 => clipA
-
// => container00 => clipB
-
// => container00 => clipC
-
// => ClipC => ClipC1
-
// => ClipC => ClipC2
-
// ...
Tough miniscript to get a whole detailed trace of every children's children in the passed DisplayObject. Used that once for debugging but was surprised now it's still working :)



April 28th, 2010
Marvin Blase
Posted in
It's funny, I made a similar code snippet a long time ago. I'm sure a lot of people did, but with IDE's like FDT these are redundant.
I cleaned out my lib the other day as well, just got rid of all this stuff. I also dropped FP9 support out of my lib, no use in maintaining it any more. It's all about new stuff!
Thx for the post! :)
Its like you learn my mind! You seem to know a lot about this, like you wrote the guide in it or something. I feel that you just could do with a few p.c. to drive the message house a little bit, however instead of that, this is great blog. An excellent read. I will definitely be back.