Skip to main content
Participant
June 24, 2011
Question

Tour de Flex Mobile 4.5.1 Camera Roll problem

  • June 24, 2011
  • 2 replies
  • 3369 views

I am trying the camera roll example from mobile tour de flex found at 
http://www.adobe.com/devnet-archive/flex/tourdeflex/web/#illustIndex=0;sampleId=70036;docIndex=0

http://www.adobe.com/devnet-archive/flex/tourdeflex/web/#illustIndex=0;sampleId=70036;docIndex=0


protected function onMediaSelect(event:MediaEvent):void
{
     var mp:MediaPromise = event.data;
     lblFile.text = mp.file.name + "\n" + mp.file.url;
     lblFile.visible = true;
     image.source = mp.file.url;
}

Everything works until after I select an image from my camera roll. The image is never displayed on the screen. The above function is called but dies on the 2nd line. I am trying this on my iPad and iPhone.

Anyone have any ideas or had similar results?

This topic has been closed for replies.

2 replies

June 28, 2011

Hi,

On iOS MediaPromise.file is null so you wont be able to get the url and name through it.

You will have to load the mediaPromise object you get through Loader object and get the image data in loader object's Event.Complete Handler.

For sample code see this : http://blogs.adobe.com/cantrell/archives/2011/02/how-to-use-cameraui-in-a-cross-platform-way.html

Same applies to CameraRoll also. Let me know if it worked or not.

Thanks,

Meet

Participant
June 28, 2011

Thanks!

Look promising. I will change my code asap.

- QuadWord

Participant
June 27, 2011

just to let you know: i did use the same code (cameraRoll and cameraUI) in my android app (target: motorola xoom) and it is working fine.

the same code does run on my ipad2. i get pretty much the same behaviour like you.

cameraUI: u can take a photo but it is not saved.

cameraRoll: you can choose a image but you dont get anything if the "roll" closes.

however i did not look deeper into this issue.

- quadword