Flash制作特酷的图片遮照特效动画(3)
中华网科技 http://tech.china.com
2005-06-15 10:10:38
|
|
|
10.回到场景中来,新建两个图层,分别把图层1改名为bg,图层2改名为:movie,图层3改名为action。选中bg层的第1帧,打开库面板把bg影片剪辑拖入到里面,并设置其实例名字为img,如下图:
选中movie层的第1帧,把movie影片剪辑拖到里面来,设置其实例名为mov。如图:
选中action层的第1帧,打开动作面板,我们添加如下代码:(在这里代码我就不解释了,希望您能看懂):
znum = 0; _root.img.setMask(_root.mov) allz = new Array(); allz[0] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; allz[1] = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; allz[2] = [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]; allz[3] = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]; allz[4] = [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]; allz[5] = [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]; allz[6] = [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21]; allz[7] = [8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]; allz[8] = [9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]; allz[9] = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]; allz[10] = [11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]; allz[11] = [12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]; allz[12] = [13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27]; allz[13] = [14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28]; allz[14] = [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]; for (i=0; i<15; i++) { for (j=0; j<15; j++) { _root.mov.nemo.duplicateMovieClip("m"+(i-1)*15+j, (i-1)*15+j); _root.mov["m"+(i-1)*15+j].xnum = i; _root.mov["m"+(i-1)*15+j].ynum = j; _root.mov["m"+(i-1)*15+j]._x = i*20+20; _root.mov["m"+(i-1)*15+j]._y = j*20+20; _root.mov["m"+(i-1)*15+j].onEnterFrame = function() { if (_root.allz[this.ynum][this.xnum] == _root.znum) { this.play(); } }; } } _root.onEnterFrame = function() { if (znum<30) { _root.znum++; } }; 按CTRL+回车键观看效果吧!祝你好运!
首页 上页 | 1 | 2 | 3 | 下页 尾页 共 3 页
|