flash代码问题,请求帮忙解释,急!!!!!!!
发布网友
发布时间:2023-10-16 06:44
我来回答
共2个回答
热心网友
时间:2024-11-22 19:09
定义变量
znum = 0;
遮罩代码
_root.img.setMask(_root.mov);
建立数组并且 添加 树组 的内容
allz = new Array();
allz[0] = [1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3];
allz[1] = [12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 4];
allz[2] = [11, 21, 21, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 14, 4];
allz[3] = [11, 21, 29, 29, 30, 30, 30, 30, 30, 31, 31, 31, 24, 15, 4];
allz[4] = [11, 21, 29, 36, 36, 36, 36, 36, 37, 37, 37, 31, 24, 15, 4];
allz[5] = [11, 21, 29, 35, 40, 41, 41, 41, 41, 41, 37, 31, 24, 15, 4];
allz[6] = [11, 20, 29, 35, 40, 44, 44, 44, 44, 42, 37, 32, 24, 15, 5];
allz[7] = [10, 20, 28, 35, 40, 43, 45, 45, 44, 42, 38, 32, 24, 15, 5];
allz[8] = [10, 20, 28, 35, 40, 43, 45, 45, 45, 42, 38, 32, 25, 16, 5];
allz[9] = [10, 20, 28, 35, 40, 43, 43, 43, 42, 42, 38, 32, 25, 16, 5];
allz[10] = [10, 20, 28, 34, 39, 39, 39, 39, 39, 38, 38, 32, 25, 16, 5];
allz[11] = [10, 19, 28, 34, 34, 34, 34, 33, 33, 33, 33, 33, 25, 16, 6];
allz[12] = [9, 19, 27, 27, 27, 27, 27, 26, 26, 26, 26, 26, 25, 16, 6];
allz[13] = [9, 19, 19, 19, 18, 18, 18, 18, 18, 17, 17, 17, 17, 17, 6];
allz[14] = [9, 9, 9, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 6, 6];
双循环
for (i=0; i<15; i++) {
for (j=0; j<15; j++) {
复制mov.nemo这个MC
_root.mov.nemo.plicateMovieClip("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;
在MOV["m"+(i-1)*15+j]这个MC
_root.mov["m"+(i-1)*15+j].onEnterFrame = function() {
如果数组里的数字为ZNUM MC 播放
if (_root.allz[this.ynum][this.xnum] == _root.znum) {
this.play();
}
};
}
}
热心网友
时间:2024-11-22 19:09
前边是创建*数组
_root.mov.nemo.plicateMovieClip("m"+(i-1)*15+j, (i-1)*15+j);
复制_root.mov.nemo并重新命名为("m"+(i-1)*15+j,深度为(i-1)*15+j)