开发者

Accordion lists in actionscript 3, how to fix initial population of enclosed lists

I have a five section accordion list, as seen at http://www.battletech-live.net, which draws it's list contents from xml files. The accordion also has the ability to adjust it's width. Upon initial load, the first section of the accordion is exposed and a list within it is populated. SelectedIndex is technically null because it hasn't bee selected or changed and the lists inside the other accordion sections technically don't exist because it doesn't instantiate them until they're needed for the first time. As I move from section to section, my code looks at selected index and loads an xml file to populate the elements found in that list, but they do not appear when a new list is first exposed. I have to switch to something else and back again. How do I set it up so that lists are correctly populated the first time they need to be viewed? I tried changing all of the accordion canvases to AS instead of MXML, but while the structure would appear correctly, I couldn't get any of the lists to populate. I'm installing the debug flash player now so that I can better see what's going on.

A full code sample can be seen here: http://www.battletech-live.net/codeSample.tx开发者_Go百科t


After reading your comment, I suppose setting the creationPolicy property of the Accordion to "all" would fix your problem. That means the Flex framework will create all your accordion children when your view is created

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜