我创建了一个简单的视频,尝试将鼠标点击事件附加到它上面,但是事件并没有触发。这是我的代码:
var connection:NetConnection;
var stream:NetStream;
var video:Video;
connection = new NetConnection();
connection.connect(null);
stream = new NetStream(connection);
stream.client = this;
video = new Video(425, 320);
stage.addChild(video);
video.attachNetStream(stream);
stream.bufferTime = 1;
stream.receiveAudio(true);
stream.receiveVideo(true);
stream.play("freshprince.flv");
video.addEventListener(MouseEvent.CLICK, function() {
trace("Video Clicked");
});
这是什么问题,为什么鼠标事件无法工作?