@Stein Gauslaa Strindhaug
这是相当粗糙,但它应该做的伎俩!
private function traceAllChildren(rootContainer:DisplayObjectContainer):void {
for(var i=0; i < rootContainer.numChildren; i++) {
var item:* = rootContainer.getChildAt(i);
try {
traceAllChildren(item);
} catch (e:Error) {
trace(e.toString());
}
trace(item.toString());
// This is the block where you can affect
// an 'item' depending on it's type, name, etc..
// eg:
// if (item.toString() == '[object TextField]') {
// item.text = "The text I want to insert";
// }
// or
// if (item.name == myTextFieldNameVar) {
// item.text = "The text I want to insert";
// }
}
}
然后调用它像这样:traceAllChildren(本)或traceAllChildren(myParentMovieClip)。
我希望这会有所帮助,祝你好运!
我仍然无法找到任何东西,至少这个问题现在是谷歌搜索“获取所有实例闪存”的最高结果等。 – 2008-11-18 14:45:10