网页播放flash的进度条代码?
我的做一个网站可以播放flash!但是在播放flash的时候无法调整播放进度!谁能给一段flash播放的进度条代码!谢谢这段代码加到网页里不好使啊!怎么回事?谢谢!...
我的做一个网站可以播放flash!但是在播放flash的时候无法调整播放进度!谁能给一段flash播放的进度条代码!谢谢
这段代码加到网页里不好使啊!怎么回事?谢谢! 展开
这段代码加到网页里不好使啊!怎么回事?谢谢! 展开
展开全部
var myLoading:MovieClip;
var loadInfo:MovieClip;
var _lineBgcolor = "0x666666";
var _lineColor = "0x0000FF";
var _lineLen:Number = 200;
var _lineH:Number = 3;
var _txtColor; var _txtAlign:String = "center";
var tb:Number;
var txtFormat:TextFormat = new TextFormat
("Arial", null, 0xffffff, true); myLoading = _root.createEmptyMovieClip("myLoading",10); //进度条
loadInfo = myLoading.createEmptyMovieClip("line", 10);
loadInfo.lineStyle(1, _lineColor, 20);
loadInfo.moveTo(0, 0);
loadInfo.lineTo(_lineLen, 0);
loadInfo.lineTo(_lineLen, _lineH);
loadInfo.lineTo(0, _lineH);
loadInfo.lineTo(0, 0); //进度显示文本
loadInfo.createTextField("txt", 30, 0, 0, _lineLen, 22);
loadInfo.txt.autoSize = _txtAlign; //设置进度条的位置(居中于主场景)
loadInfo._x = (Stage.width - _lineLen)/2;
loadInfo._y = Stage.height/2; //获得影片大小并stop,再onEnterFrame
tb = _root.getBytesTotal();
_root.stop();
myLoading.onEnterFrame = function(){
var lb:Number = _root.getBytesLoaded();
var percent:Number = Math.round(lb/tb*100);
loadInfo.txt.text = percent+"%";
loadInfo.txt.setTextFormat(txtFormat);
loadInfo.lineStyle(_lineH, _lineBgcolor, 10);
loadInfo.moveTo(0, _lineH/2);
loadInfo.lineTo(percent*_lineLen/100, _lineH/2);
if (percent == 100) {
_root.play();
delete this.onEnterFrame;
loadInfo.clear();
loadInfo.txt.text = "";
}
}
********
以上代码放在场景中的第一桢内!
var loadInfo:MovieClip;
var _lineBgcolor = "0x666666";
var _lineColor = "0x0000FF";
var _lineLen:Number = 200;
var _lineH:Number = 3;
var _txtColor; var _txtAlign:String = "center";
var tb:Number;
var txtFormat:TextFormat = new TextFormat
("Arial", null, 0xffffff, true); myLoading = _root.createEmptyMovieClip("myLoading",10); //进度条
loadInfo = myLoading.createEmptyMovieClip("line", 10);
loadInfo.lineStyle(1, _lineColor, 20);
loadInfo.moveTo(0, 0);
loadInfo.lineTo(_lineLen, 0);
loadInfo.lineTo(_lineLen, _lineH);
loadInfo.lineTo(0, _lineH);
loadInfo.lineTo(0, 0); //进度显示文本
loadInfo.createTextField("txt", 30, 0, 0, _lineLen, 22);
loadInfo.txt.autoSize = _txtAlign; //设置进度条的位置(居中于主场景)
loadInfo._x = (Stage.width - _lineLen)/2;
loadInfo._y = Stage.height/2; //获得影片大小并stop,再onEnterFrame
tb = _root.getBytesTotal();
_root.stop();
myLoading.onEnterFrame = function(){
var lb:Number = _root.getBytesLoaded();
var percent:Number = Math.round(lb/tb*100);
loadInfo.txt.text = percent+"%";
loadInfo.txt.setTextFormat(txtFormat);
loadInfo.lineStyle(_lineH, _lineBgcolor, 10);
loadInfo.moveTo(0, _lineH/2);
loadInfo.lineTo(percent*_lineLen/100, _lineH/2);
if (percent == 100) {
_root.play();
delete this.onEnterFrame;
loadInfo.clear();
loadInfo.txt.text = "";
}
}
********
以上代码放在场景中的第一桢内!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询