AS3视频COMPELETE事件处理程序不工作?的addEventListener(引发Event.COMPLETE事件、程序、工作、视频

2023-09-08 12:47:20 作者:滥情通缉.

您好,我是用FLVPlayback2.5组件和收到此错误,请大家帮忙! - 不能转换fl.video:以flash.events.VideoEvent

使用AS3 code -

  comp.addEventListener(引发Event.COMPLETE,videoComplete);

            功能videoComplete(事件:VideoEvent):无效{
                跟踪(videoComplete);
            }
 

完整的错误 -

类型错误:错误#1034:类型强制失败:不能转换fl.video::VideoEvent@6e974dd1到flash.events.VideoEvent。     在flash.events::EventDispatcher/dispatchEventFunction()     在flash.events::EventDispatcher/dispatchEvent()     在fl.video::FLVPlayback/http://www.adobe.com/2007/flash/flvplayback/internal::handleVideoEvent()     在flash.events::EventDispatcher/dispatchEventFunction()     在flash.events::EventDispatcher/dispatchEvent()     在fl.video::VideoPlayer/http://www.adobe.com/2007/flash/flvplayback/internal::httpDoStopAtEnd()     在fl.video::VideoPlayer/http://www.adobe.com/2007/flash/flvplayback/internal::httpNetStatus()

修复感谢罗尼!欢呼的人。这对我的作品。

 进口fl.video.VideoEvent;

            comp.addEventListener(引发Event.COMPLETE,videoComplete);

            功能videoComplete(事件:事件):无效{
                跟踪(videoComplete);
            }
 

解决方案

lostPixels是正确的大部分在解释什么是错误的手段,但它不是 VideoEvent ,其简单的事件

  comp.addEventListener(引发Event.COMPLETE,videoComplete);

 功能videoComplete(事件:事件):无效//事件:事件没有事件:VideoEvent
 {
     跟踪(videoComplete);
 }
 
图文 视频 C4D野教程 OC渲染炸毛小人 不用XP粒子版

hi i am using FLVPlayback 2.5 component and getting this error, please help! - cannot convert fl.video: to flash.events.VideoEvent.

as3 code using -

            comp.addEventListener(Event.COMPLETE, videoComplete);

            function videoComplete(event:VideoEvent):void {
                trace("videoComplete");
            }

full error -

TypeError: Error #1034: Type Coercion failed: cannot convert fl.video::VideoEvent@6e974dd1 to flash.events.VideoEvent. at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at fl.video::FLVPlayback/http://www.adobe.com/2007/flash/flvplayback/internal::handleVideoEvent() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at fl.video::VideoPlayer/http://www.adobe.com/2007/flash/flvplayback/internal::httpDoStopAtEnd() at fl.video::VideoPlayer/http://www.adobe.com/2007/flash/flvplayback/internal::httpNetStatus()

fix thanks to ronnie! cheers man. this works for me..

            import fl.video.VideoEvent;

            comp.addEventListener(Event.COMPLETE, videoComplete);

            function videoComplete(event:Event):void {
                trace("videoComplete");
            }

解决方案

lostPixels was right for the most part in explaining what the error means but it isn't VideoEvent, its simply Event

 comp.addEventListener(Event.COMPLETE, videoComplete);

 function videoComplete(event:Event):void //event:Event not event:VideoEvent
 {
     trace("videoComplete");
 }