Actionscript 3 AS3 VideoEvent侦听器-Event.Ready
我正在努力捕捉FLV视频播放器的就绪事件。我不太清楚这些代码是怎么回事。FLV播放器是由Adobe Flash导入的,我需要在视频准备播放时启动readyHandler,该功能将删除加载文本的视频。我完美地使用了video_oynattir对象。但是,这些代码会阻止动画Actionscript 3 AS3 VideoEvent侦听器-Event.Ready,actionscript-3,flash,event-handling,flvplayer,Actionscript 3,Flash,Event Handling,Flvplayer,我正在努力捕捉FLV视频播放器的就绪事件。我不太清楚这些代码是怎么回事。FLV播放器是由Adobe Flash导入的,我需要在视频准备播放时启动readyHandler,该功能将删除加载文本的视频。我完美地使用了video_oynattir对象。但是,这些代码会阻止动画 video_oynattir.addEventListener(Event.READY, readyHandler); function readyHandler(event:VideoEvent):void { tr
video_oynattir.addEventListener(Event.READY, readyHandler);
function readyHandler(event:VideoEvent):void
{
trace("hurray");
}
并产生以下错误:
通过具有静态类型类的引用访问可能未定义的属性*
如果我注释掉代码段。它执行得非常完美
阶段的完整代码如下:
import flash.events.MouseEvent;
import flash.external.ExternalInterface;
import flash.net.URLRequest;
import flash.net.navigateToURL;
var clickTAG:String = loaderInfo.parameters.clickTAG;
var displayType:String = loaderInfo.parameters.displayType;
video_oynattir.autoPlay = false;
if(displayType == "collapse") {
gotoAndStop("kapali");
}else{
openButton.visible = false;
gotoAndStop("acik");
}
video_button.addEventListener(MouseEvent.CLICK, videodurdur);
function videodurdur(e:MouseEvent):void {
if(video_oynattir.state == "playing") {
video_oynattir.stop();
}else{
video_oynattir.play();
}
}
video_oynattir.addEventListener(Event.READY, readyHandler);
function readyHandler(e:VideoEvent):void {
trace("at");
}
//Accesss of possibly undefined property READY through a refferance with static type class
closeButton.addEventListener(MouseEvent.CLICK, closeRichMedia);
function closeRichMedia(e:MouseEvent):void {
video_oynattir.stop();
ExternalInterface.call("dopushunlock");
gotoAndPlay(3);
openButton.visible = true;
}
openButton.addEventListener(MouseEvent.CLICK, openRichMedia);
function openRichMedia(e:MouseEvent):void {
ExternalInterface.call("dopushlock");
gotoAndStop(2);
openButton.visible = false;
}
clickButton.addEventListener(MouseEvent.CLICK, gotoLink);
function gotoLink(e:MouseEvent):void {
navigateToURL(new URLRequest(clickTAG), "_blank");
}
stop();
请尝试更改EventListener侦听VideoEvent的事件类型: 确保导入fl.video.VideoEvent
video_oynattir.addEventListener(VideoEvent.READY, readyHandler);