@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