我在我的移动应用程序中使用相机类,我使用 Camera.names 来填充我的列表,我尝试将选定的值传递给 getcamera() 方法,但它不起作用。这是我的代码
private function init():void
{
if (Camera.names.length == 0) {
lab.text = "No camera attached";
list.enabled = false;
textArea.enabled = false;
}
}
protected function list_changeHandler(event:IndexChangeEvent):void
{
var tList:List = evt.currentTarget as List;
var cameraName:String = tList.selectedIndex.toString();
camera = Camera.getCamera(cameraName);
vid=new Video();
vid.attachCamera(camera);
UIc.addElement(vid as IVisualElement);
textArea.text = ObjectUtil.toString(camera);
}
<s:List id="list"
dataProvider="{Camera.names as ArrayCollection}"
width="200"
change="list_change(event);" />
<s:Group id="UIc" x="68" y="253" width="368" height="281">
</s:Group>