以下是取自https://www.youtube.com/watch?v=GQnoOcPbgx0的AS3代码。目前有5个按钮。我想 -
您可以在此处观看演示(翻转左侧橙色按钮以观看视频)http://pages.areadevelopment.com/advertisers/MDA/index.html
如果有人可以提供帮助,我们将不胜感激。 谢谢! CE
import flash.display.Loader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.ui.MouseCursor;
Security.allowDomain("www.youtube.com");
var player:Object;
var loader:Loader = new Loader();
loader.load(new URLRequest("http://www.youtube.com/apiplayer?version=3"));
loader.contentLoaderInfo.addEventListener(Event.INIT, onInit);
loader.x = 344;
loader.y = 34;
function onInit(e:Event):void{
addChild(loader);
player = loader.content;
player.addEventListener("onReady",onPlayerReady);
}
function onPlayerReady(e:Event):void{
player.setSize(330,225);
player.loadVideoById("nHnXVBNizDQ",0);
}
btnPlay.addEventListener(MouseEvent.CLICK, playVid);
function playVid(e:MouseEvent):void{
player.playVideo();
}
btnPause.addEventListener(MouseEvent.CLICK, pauseVid);
function pauseVid(e:MouseEvent):void{
player.pauseVideo();
}
btnStop.addEventListener(MouseEvent.CLICK, stopVid);
function stopVid(e:MouseEvent):void{
player.stopVideo();
}
btnMute.addEventListener(MouseEvent.CLICK, muteVid);
function muteVid(e:MouseEvent):void{
player.mute();
}
btnUnmute.addEventListener(MouseEvent.CLICK, UnmuteVid);
function UnmuteVid(e:MouseEvent):void{
player.unMute();
}