我有一個函數需要找到並檢索dep嵌套對象,並想知道是否有一些優化的函數來做到這一點。 在E4X/XML中,我們有像包含或後代的函數。我無法找到任何本地AS3對象。對象的AS3遍歷/找到深嵌套對象的最佳方式
一個例子是這樣的:
[56] (Object)#2262
ID = "Story_u1cac"
Story = (Array)#2263
[0] (Object)#2264
AppliedNamedGrid = "n"
AppliedTOCStyle = "n"
InCopyExportOption = (Array)#2265
[0] (Object)#2266
IncludeAllResources = false
IncludeGraphicProxies = true
Self = "u1cac"
StoryPreference = (Array)#2267
[0] (Object)#2268
FrameType = "TextFrameType"
OpticalMarginAlignment = true
OpticalMarginSize = 12
StoryDirection = "LeftToRightDirection"
StoryOrientation = "Horizontal"
StoryTitle = "$ID/"
TrackChanges = false
XMLElement = (Array)#2269
[0] (Object)#2270
MarkupTag = "XMLTag/mehr_1_story"
ParagraphStyleRange = (Array)#2271
[0] (Object)#2272
AppliedParagraphStyle = "ParagraphStyle/Lauftexte%3ainterview"
CharacterStyleRange = (Array)#2273
[0] (Object)#2274
AppliedCharacterStyle = "CharacterStyle/$ID/[No character style]"
BaselineShift = 4
Content = (Array)#2275
[0] (Object)#2276
nodeValue = "p"
什麼想法?
任何幫助是超過apreciated!
嘿馬克!謝謝你的片段!我想從主對象中提取對象,如果它們符合某些標準的話......我稍微改變了你的函數並做了一個過濾器。我不能發表評論,所以我會作爲答覆發佈......順便說一句,我是你的工作和你的博客的粉絲!感謝發電機;) – Drala