Search code examples
iphoneiosflex-mobile

how to retrieve an image from path in iOS ( for iPhone) with Flex


How can I retrieve the path of an image stored in my album in an iPhone using Flex mobile? same with an image being taken with the camera on the iPhone.

for Android I use this function and it works, but for the iPhone, it doesn't any ideas?

  protected function onMediaSelect(event:MediaEvent):void
            {
                var mp:MediaPromise = event.data;
                image.source = mp.file.url;
            }

and this I use for when I'm taking th picture ont he spot

protected function onComplete(evt:MediaEvent):void
            {
                img.source = evt.data.file.url;
            }

if you can show me in the right direction I greatly appreciate it. thanks!

~Myy


Solution

  • I ad to use the cameraroll class

    //if we get the image
    trace( "Asynchronous media promise." );
                        var eventSource:IEventDispatcher = dataSource as IEventDispatcher;            
                        eventSource.addEventListener( Event.COMPLETE, onMediaLoaded );