Actionscript 3 Starling和cameraroll上传类型强制

Actionscript 3 Starling和cameraroll上传类型强制,actionscript-3,air,starling-framework,Actionscript 3,Air,Starling Framework,我正试图在这里实现摄像头 在我的starling项目中,允许用户选择图像并上载到服务器,但我遇到一个错误: Error #1034: Type coercion failed: cannot convert starling.events::Event@752c0d1 to flash.events.Event 看来是罪魁祸首: private function imageSelected( event:MediaEvent ):void { trace( "Medi

我正试图在这里实现摄像头

在我的starling项目中,允许用户选择图像并上载到服务器,但我遇到一个错误:

Error #1034: Type coercion failed: cannot convert starling.events::Event@752c0d1 to flash.events.Event
看来是罪魁祸首:

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();
        }
    }

我正在使用Starling使用Feathers UI。

是否同时导入flash事件和Starling事件?确保将starling事件传递给onMediaLoaded函数。 因此:

不是:

function onMediaLoaded(event:starling.events.Event){
   //do stuff
}
function onMediaLoaded(event:Event){
   //do stuff
}