2013-06-28 156 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); 
} 

這樣一來,對拍攝的每一張照片,你可以將它添加到你有這麼遠的照片的列表。

相關問題