flash as3.0怎么用代码显示FLVPlayback组件
importfl.video.*varo:FLVPlayback=newFLVPlayback()o.x=100o.y=50addChild(o)为何显示不了FLVPla...
import fl.video.*
var o:FLVPlayback = new FLVPlayback()
o.x = 100
o.y = 50
addChild(o)
为何显示不了FLVPlayback的实例捏?
应该怎么写才能用as 创建一个FLVPlayback的实例?
求教~~~ 展开
var o:FLVPlayback = new FLVPlayback()
o.x = 100
o.y = 50
addChild(o)
为何显示不了FLVPlayback的实例捏?
应该怎么写才能用as 创建一个FLVPlayback的实例?
求教~~~ 展开
2个回答
展开全部
import fl.video.FLVPlayback;
var urls:Array=[];
for(var j:int=1;j<=46;j++)
{
var str:String=j.toString();
if(str.length==1)
{
str="0"+str;
}
urls[j-1]=str+".flv";
}
var mov:FLVPlayback=new FLVPlayback;
var url:String=urls[0];
mov.width=stage.stageWidth;
mov.height=stage.stageHeight;
mov.autoPlay=true;
mov.isLive=true;
mov.bufferTime=10;
mov.load(url);
mov.play();
//mov.addEventListener("ready",playMovie);
//mov.addEventListener("complete",loop);
addChild(mov);
var y0:Number=0;
for(var i:int=0;i<46;i++)
{
var bt:MovieClip=new mbutton;
bt.msg.text="影片"+i;
bt.buttonMode=true;
bt.mouseChildren=false;
bt.addEventListener(MouseEvent.CLICK,changeMov);
bt.ID=i;
bt.y=y0;
y0+=25;
addChild(bt);
}
function changeMov(e:Event):void
{
var mc:MovieClip=e.target as MovieClip;
var id:int=mc.ID;
var url:String=urls[id];
mov.load(url);
mov.play();
}
function playMovie(e:Event):void
{
mov.play();
}
这是我们老师前几天刚交我写的你看看是不是这么用
var urls:Array=[];
for(var j:int=1;j<=46;j++)
{
var str:String=j.toString();
if(str.length==1)
{
str="0"+str;
}
urls[j-1]=str+".flv";
}
var mov:FLVPlayback=new FLVPlayback;
var url:String=urls[0];
mov.width=stage.stageWidth;
mov.height=stage.stageHeight;
mov.autoPlay=true;
mov.isLive=true;
mov.bufferTime=10;
mov.load(url);
mov.play();
//mov.addEventListener("ready",playMovie);
//mov.addEventListener("complete",loop);
addChild(mov);
var y0:Number=0;
for(var i:int=0;i<46;i++)
{
var bt:MovieClip=new mbutton;
bt.msg.text="影片"+i;
bt.buttonMode=true;
bt.mouseChildren=false;
bt.addEventListener(MouseEvent.CLICK,changeMov);
bt.ID=i;
bt.y=y0;
y0+=25;
addChild(bt);
}
function changeMov(e:Event):void
{
var mc:MovieClip=e.target as MovieClip;
var id:int=mc.ID;
var url:String=urls[id];
mov.load(url);
mov.play();
}
function playMovie(e:Event):void
{
mov.play();
}
这是我们老师前几天刚交我写的你看看是不是这么用
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询