![]() ![]() | |
Flash Player 6.0.79。
Flash MX 2004。
myComboBox.selectedItem
属性;下拉列表中所选项目的值。
如果组合框是可编辑的,在文本框中输入任何文本时,selectedItem 都将返回未定义。如果您从下拉列表中选择一项,或者通过动作脚本设置该值,那么它将只有一个值。如果组合框是静态的,则 selectedItem 的值始终有效。
如果数据提供程序包含了原始类型,则以下范例会显示 selectedItem:
var item = myComboBox.selectedItem;
trace("You selected the item " + item);
如果数据提供程序包含了具有 label 和 data 属性的对象,则以下范例会显示 selectedItem:
var obj = myComboBox.selectedItem;
trace("You have selected the color named:" + obj.label);
trace("The hex value of this color is:" + obj.data);
ComboBox.dataProvider, ComboBox.selectedIndex
![]() ![]() | |