AS3 引用没有名称的列表项
AS3 referencing a list item which has no name
list.addItem({label:"a"});
当你像这样将一个对象添加到列表中时,你如何在不使用列表的侦听器然后再去
的情况下引用它
list.selectedItem
列表项是否没有像数组一样编入索引?我想做这样的事情
trace(list.item[0].label);
并拥有它 return "a" 这对列表来说是不可能的吗?
list.dataProvider.length // gets total number of items
list.dataProvider.getItemAt(0) // gets first item
list.dataProvider.getItemAt(0).label // gets the first item label
在这里查看所有方法..
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fl/data/DataProvider.html
list.addItem({label:"a"});
当你像这样将一个对象添加到列表中时,你如何在不使用列表的侦听器然后再去
的情况下引用它list.selectedItem
列表项是否没有像数组一样编入索引?我想做这样的事情
trace(list.item[0].label);
并拥有它 return "a" 这对列表来说是不可能的吗?
list.dataProvider.length // gets total number of items
list.dataProvider.getItemAt(0) // gets first item
list.dataProvider.getItemAt(0).label // gets the first item label
在这里查看所有方法.. http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fl/data/DataProvider.html