mercredi 28 septembre 2016

AS3 MediaPromise for CameraUI doesn't get back to me on iOS

I need to capture an image using CameraUI on AS3/Air/Starling framework. I get the CameraUI, it opens, the image gets selected and I receive a MediaPromise object.

The samples in the documentation mentions the following code to capture the Image from an async media promise on iOS but I do not hear any callbacks in neither onMediaLoaded function nor the ioError function.

BTW the log line "Asynchronous Mode Media Promise." is displayed when I choose a photo.

private function imageSelected(evt:MediaEvent):void
    this.feedbackText.text = "Image Selected\n";

    // Create a new imagePromise
    var imagePromise:MediaPromise =;

    // Open our data source
    dataSource =;

        this.feedbackText.text += "Asynchronous Mode Media Promise.\n";

        var eventSource:IEventDispatcher = dataSource as IEventDispatcher;

        eventSource.addEventListener( Event.COMPLETE, onMediaLoaded );
        eventSource.addEventListener( IOErrorEvent.IO_ERROR, ioError );
        this.feedbackText.text += "Synchronous Mode Media Promise.\n";

Aucun commentaire:

Enregistrer un commentaire