var videoConnection:NetConnection = new NetConnection();
videoConnection.connect(null);
var videoStream:NetStream = new NetStream (videoConnection);
videoStream.play("video/Action Squirrel!!! [from www.metacafe.com].flv");
videoStream.pause();
videoStream.seek(0);
var metaListener:Object = new Object();
metaListener.onMetaData=onMetaData;
videoStream.client=metaListener;
var video:Video = new Video();
video.attachNetStream(videoStream);
//addChild(video);
function onMetaData(data:Object):void
{
playvideo_btn.addEventListener(MouseEvent.CLICK, mulai2);
stopvideo_btn.addEventListener(MouseEvent.CLICK, henti);
pausevideo_btn.addEventListener(MouseEvent.CLICK, puse);
showvideo_btn.addEventListener(MouseEvent.CLICK, tampilkanlah);
resumevideo_btn.addEventListener(MouseEvent.CLICK, teruskan);
}
function mulai2(event:MouseEvent):void
{
addChild(video);
videoStream.play("video/Action Squirrel!!! [from www.metacafe.com].flv");
}
function henti(event:MouseEvent):void
{
videoStream.pause();
videoStream.seek(0);
//removeChild(video);
}
function puse(event:MouseEvent):void
{
videoStream.pause();
}
function tampilkanlah(event:MouseEvent):void
{
addChild(video);
//video.x = 100
//video.y = 10
}
function teruskan(event:Event):void
{
videoStream.resume();
}
0 Response to "Cara Memutar / Memanggil Video pada Flash AS3"
Post a Comment