Actionscript 3 中的手风琴列表,如何修复封闭列表的初始数量

发布于 2024-10-12 01:53:08 字数 592 浏览 3 评论 0原文

我有一个五部分的手风琴列表,如 http://www.battletech-live.net 所示,它从 xml 文件中提取列表内容。手风琴还能够调整其宽度。初始加载时,手风琴的第一部分将被公开,并填充其中的列表。从技术上讲,SelectedIndex 为 null,因为它尚未被选择或更改,并且其他手风琴部分内的列表从技术上讲并不存在,因为在第一次需要它们之前它不会实例化它们。当我从一个部分移动到另一个部分时,我的代码会查看选定的索引并加载 xml 文件以填充该列表中找到的元素,但当首次公开新列表时它们不会出现。我必须切换到别的东西然后再回来。如何设置才能在第一次需要查看时正确填充列表?我尝试将所有手风琴画布更改为 AS 而不是 MXML,但是虽然结构显示正确,但我无法填充任何列表。我现在正在安装调试 Flash 播放器,以便我可以更好地了解发生了什么。

完整的代码示例可以在此处查看:http://www.battletech-live.net/codeSample。文本

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.txt

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜宝宝 2024-10-19 01:53:08

阅读您的评论后,我想将手风琴的creationPolicy属性设置为“all”可以解决您的问题。这意味着 Flex 框架将在创建视图时创建所有手风琴子项

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文