如果我超过4或100或任何其他数量的屏幕,如何获取屏幕数量?除了设置dataprovider:Arraycollection并使用s:dropdownlist之外,还有其他方法吗?谢谢你,如果有人能帮助我,我感激不尽。 (抱歉我的英语不好)。
在main.mxml
中 private var _dataProvider:ArrayCollection = new ArrayCollection(
[{label:"One", data:1}, {label:"Two", data:2},
{label:"Three", data:3}, {label:"Four", data:4}]);
private function openWin(event:MouseEvent):void
{
for(var num:int = 0; num< screenNumber.selectedItem.data; num++)
{
win["native"+num]= new Windows(); //NativeWindow(native);
win["native"+num].width = 320;
win["native"+num].height = 200;
//win["native"+num].open();
win["native"+num].open();
win["native"+num].title="window" + num;
}
}
<s:Group left="10" top="10" bottom="10" width="556">
<s:Label x="54" y="13" fontSize="17" text="Number of screen:"/>
<s:DropDownList id="screenNumber" x="250" y="10" dataProvider="{_dataProvider}"
prompt="--select one--" />
<s:Button x="0" y="85" label="Launch {screenNumber.selectedItem.data} window" click="openWin(event)"/>
</s:Group>