Board logo

标题: 你会做FLASH的loading吗?不会的话 近来see see [打印本页]

作者: lopo1983    时间: 2006-8-14 00:02     标题: 你会做FLASH的loading吗?不会的话 近来see see

放在第一贞就OK了
:12:
stop();
var rect1:MovieClip = createRectangle1(150, 3, 0x000000);
var rect2:MovieClip = createRectangle2(152, 5, 0x000000);
rect1._x = (Stage.width - rect1._width) / 2;
rect1._y = (Stage.height - rect1._height) / 2;
rect2._x = (Stage.width - rect2._width) / 2;
rect2._y = (Stage.height - rect2._height) / 2;
onEnterFrame = function () {
rect1._width = _root.getBytesLoaded() / _root.getBytesTotal() * 150;
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
rect1.removeMovieClip();
rect2.removeMovieClip();
delete rect1;
delete rect2;
delete createRectangle1;
delete createRectangle2;
delete onEnterFrame;
play();
}
};
function createRectangle1(width:Number, height:Number, color:Number, scope:MovieClip):MovieClip {
scope = (scope == undefined) ? this : scope;
var depth:Number = scope.getNextHighestDepth();
var mc:MovieClip = scope.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
function createRectangle2(width:Number, height:Number, color:Number, scope:MovieClip):MovieClip {
scope = (scope == undefined) ? this : scope;
var depth:Number = scope.getNextHighestDepth();
var mc:MovieClip = scope.createEmptyMovieClip("mc_" + depth, depth);
mc.lineStyle(color);
mc.moveTo(0, 0);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
有详细%载入的AS
建议在制作FLASH时 6个AS层
AS层1贞
loaded = _root.getBytesLoaded();
total = _root.getBytesTotal();
percent = int((loaded/total)*100);
load_mc.gotoAndStop(percent);
loadtext = "wait loading"+percent+"%";
//MB lopo1983
AS层2贞
if(loaded == total){gotoAndPlay(3);}
else{gotoAndPlay(1);}
//MB lopo1983
load_mc 和 loadtxt需要另外制作
loadtxt为动态文本
load_mc最好是形状渐变 load_mc需要在头 尾加入AS stop();

资料来源 www.aimail.cn
作者: 风灵风之子    时间: 2006-8-14 22:44     标题: 你会做FLASH的loading吗?不会的话 近来see see

给你加个精吧。。
作者: blackghost    时间: 2006-9-2 06:36     标题: 你会做FLASH的loading吗?不会的话 近来see see

这跟os有啥联系?建议移到开发版面上
作者: 孤独追雪    时间: 2006-9-2 13:36     标题: 你会做FLASH的loading吗?不会的话 近来see see

偶真的不会FLASH
但是收下了




欢迎光临 黑色海岸线论坛 (http://bbs.thysea.com/) Powered by Discuz! 7.2