ActionScript 3 动态创建/加载FLV

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ActionScript 3 动态创建/加载FLV相关的知识,希望对你有一定的参考价值。

var vc:NetConnection = new NetConnection();
vc.connect(null);
var vs:NetStream = new NetStream(vc);
vs.addEventListener(NetStatusEvent.NET_STATUS ,onStatusEvent);

function onStatusEvent(stat:Object):void {
	
	trace(stat.info.code);
	
}

var meta:Object = new Object();
meta.onMetaData = function(meta:Object){
	
	trace(meta.duration);
	
};

vs.client = meta;

var video:Video = new Video(stage.stageWidth, stage.stageHeight);

addChild(video);

video.attachNetStream(vs);

vs.play("flv/myFLV.flv");

//pauseButton is a movieclip in the library that is exported for actionscript with the class name pauseButton
var PauseButton:pauseButton = new pauseButton();

PauseButton.y = stage.stageHeight - PauseButton.height/2;
PauseButton.x = PauseButton.width/2;

PauseButton.addEventListener(MouseEvent.CLICK , PausePlayback);
PauseButton.useHandCursor = true;

function CreatePlay() {
	this.addChild(PauseButton);
}

function PausePlayback(e:Event):void {
	
	vs.pause();

}

CreatePlay();

以上是关于ActionScript 3 动态创建/加载FLV的主要内容,如果未能解决你的问题,请参考以下文章

使用ActionScript生成FLV视频文件

ActionScript 3 AIR — 视频使眨眼跳跃

ActionScript 3 flash中FLV视频的actionscript cuepoint监听器

ActionScript 3 调整FLV视频的音量

ActionScript 3 as3 flv声音

ActionScript 3 actionscript3 - 跟踪动作以获取有关FLV视频中提示点的信息