2013-06-28 159 views
0

我使用flex 4.6开发移动应用程序,并且需要拍照并且做到了,但某些表格需要多张照片。如何在手机上拍摄多张照片?我的代码是;Flex手机拍摄多张照片

protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void 
     { 
      if (CameraUI.isSupported){ 
       myCam = new CameraUI(); 
       myCam.addEventListener(MediaEvent.COMPLETE, onComplete); 
      } 

     } 

......

protected function button5_clickHandler(event:MouseEvent):void 
     { 
      theImage.filters = []; 
      theImage1.filters = []; 
      theImage2.filters = []; 
      theImage3.filters = []; 
      if (CameraUI.isSupported){ 
       myCam.launch(MediaType.IMAGE); 
      } 
     } 
     private function onComplete(evt:MediaEvent):void{ 
      theImage.source = evt.data.file.url; 
      theImage1.source= evt.data.file.url; 
      theImage2.source=evt.data.file.url; 
      theImage3.source=evt.data.file.url; 
     } 
+0

做你做了什么拍一张照片并再次执行该代码? – JeffryHouser

回答

0

看起来好像你是存储多个变量相同的数据。如果您需要的照片动态数字,尝试将其添加到这样一个ArrayCollection:

private function onComplete(evt:MediaEvent):void{ 
    myPhotos.add(evt.data.file.url); 
} 

这样一来,对拍摄的每一张照片,你可以将它添加到你有这么远的照片的列表。

相关问题