- 声望
- 1154 点
- 西工币
- 5333 枚
- 贡献值
- 37 点
- 好评度
- 14 点
- 最后登录
- 2011-6-4
- 注册时间
- 2006-9-3
- 帖子
- 685
- 精华
- 0
- 积分
- 1387
- 阅读权限
- 100
- UID
- 2794
  
该用户从未签到 - 西工币
- 5333 枚
- 好评度
- 14 点
- 声望
- 1154 点
- 注册时间
- 2006-9-3
- 帖子
- 685
- 积分
- 1387
- UID
- 2794
|
今天乱跑的时候,看到了一个场景,感觉作的不错,就试着一把,还真能做成
演示地址:http://cbbestdone.googlepages.com/loading2.swf
如果想要源码的可以下载下面的fla
下载fla]
制作过程
第一步:将LOADING分离,每个字母转换成一个元件。。。
第二步:分别起实例名为——m1b1~m7b1(注意,一定按照倒序排列,就是字母G对应的是m7b1)
第三步:加上以下脚本即可。。。。- t = 0;
- // The number of characters
- n = 7;
- // The number of character copies
- b = 4;
- // Create three additional copies of each character
- depth = 100;
- for (i=1; i<=n; i++) {
- for (j=2; j<=b; j++) {
- eval("m"+i+"b1").duplicateMovieClip("m"+i+"b"+j, depth);
- depth++;
- }
- }
- this.onEnterFrame = function() {
- // increment the position along the path
- t += .0582;
- // Keep values in the range 0 to 2*pi
- if (t>6.283) {
- t -= 6.283;
- }
- // Iterate over all n (7) characters
- for (i=1; i<=n; i++) {
- // offset each character by .2617 radians or 15 degrees
- u = (t+i*.2617);
- // v is used for scale as it corresponds to when u is
- // farthest from the viewer.
- v = Math.abs(Math.cos(u/2));
- c = Math.cos(u);
- // dx, dy is the position of the character
- dx = 50*c+35;
- dy = 100*Math.sin(u)+150;
- // Iterate over each copy of a particular character
- for (j=1; j<=4; j++) {
- // Reference a particular character copy
- m = eval("m"+i+"b"+j);
- // We offset each copy of the character and adjust
- // the scale and alpha appropriately
- offset = (1-v)*4;
- m._yscale = c*100+100*v;
- m._xscale = 200*v;
- m._alpha = 10+90*v;
- m._x = dx+offset*Math.cos(j*1.57)+50*(n+1-i);
- m._y = dy+offset*Math.sin(j*1.57);
- }
- }
- };
复制代码 |
|