I am trying to implement the cameraUI here
Upload Library or captured images on iOS with Flex Mobile 4.6
in my starling project to allow a user to select an image and upload to a server but I am getting an error:
Error #1034: Type coercion failed: cannot convert starling.events::Event@752c0d1 to flash.events.Event
Looks like is the culprit:
private function imageSelected( event:MediaEvent ):void
{
trace( "Media selected..." );
var imagePromise:MediaPromise = event.data;
dataSource = imagePromise.open();
if( imagePromise.isAsync )
{
trace("Asynchronous media promise.");
var eventSource:IEventDispatcher = dataSource as IEventDispatcher;
eventSource.addEventListener(starling.events.Event.COMPLETE, onMediaLoaded);
} else {
trace( "Synchronous media promise." );
readMediaData();
}
}
I am using Starling to utilise Feathers UI.