此页面上的内容需要较新版本的 Adobe Flash Player。

获取 Adobe Flash Player

魔快网络 - 建高品质的网站!
电话:(0)15011022561 苏玮
QQ:476289485
MSN:[email protected]
魔快网络:建最优品质的网站 公司建网站,网页设计、制作 技术支持电话:15011022561

首页->超简单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, 0x000000, 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 = "";
}
}

 

  魔快分站|信诚威|青风荷韵|泛亚西亚|北京隆腾展具制作|祥威胜|优仕配音|诚灵纺织|国顺广告材料|中国设计名站|北京朝阳做网站|北京建网站|北京做网站
©2002-2010  电话:010-69440493  QQ:476289485 手机:15011022561(苏先生)  Email:[email protected]
地址:北京市建国门外大街17号28号楼 华星擘达商务楼6层2602 做网站找魔快,建站快、优化好!MoKuai.Net