|
首页 | 名片设计 CorelDRAW Illustrator AuotoCAD Painter 其他软件 Photoshop Fireworks Flash |
|
放在第1帧即可。enjoy! 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; } 返回类别: Flash教程 上一教程: Flash使用技巧--用Flash制作落地有声的瓶子 下一教程: Flash MX 2004 数据绑定(1) 您可以阅读与"Flash AS:即拷即用的loading代码"相关的教程: · Flash用按钮来使影片递加滚动的action代码 · 网页中设置flash透明代码 · Flash loading 精确百分比下载 · 制作简朴实用的FLASH导航菜单 · Flash播放器显示LRC歌词代码 |
快精灵印艺坊 版权所有 | 首页会员中心在线印刷在线编辑付款方式索取样品设计指南连锁门店 |