帮我看看这段代码哪里不合理
onClipEvent (load) {max_h = 80;
min_h = 67;
de_h = 70;
num_of_menu = 11;
system_on = false;
for (i=1; i<=num_of_menu+1; i++) {
this.attachMovie("line", "line"+i, (100*i));
this["line"+i]._x = (i-1)*de_h;
this["line"+i]._y = 20;
this["line"+i].active = false;
}
this.line1._visible = false;
this.line13._visible = false;
for (i=1; i<=num_of_menu; i++) {
this.attachMovie("menu", "menu"+i, i);
this["menu"+i]._x = (i-1)*de_h;
this["menu"+i]._y = 0;
this["menu"+i]._xscale = (this["line"+(i+1)]._x-this["line"+i]._x)/0.79;
this["menu"+i]._xscale = (this["line"+(i+1)]._x-this["line"+i]._x)/0.79;
// this["menu"+i].attachMovie("fade","fade",2);
this["menu"+i].attachMovie("image"+i, "image", 1);
}
function targetCheck() {
if (this._xmouse>=0 && this._xmouse<=760 && this._ymouse>=0 && this._ymouse<=70) {
system_on = true;
for (i=1; i<=num_of_menu; i++) {
if (this._xmouse>this["line"+i]._x && this._xmouse<this["line"+(i+1)]._x) {
this["line"+(i+1)].active = true;
} else {
this["line"+(i+1)].active = false;
}
}
} else {
system_on = false;
}
}
function lineMove() {
if (system_on) {
for (i=2; i<=num_of_menu; i++) {
if (this["line"+i].active) {
this["line"+i].targetPos = this["line"+(i-1)].targetPos+max_h;
} else {
this["line"+i].targetPos = this["line"+(i-1)].targetPos+min_h;
}
this["line"+i]._x += (this["line"+i].targetPos-this["line"+i]._x)/13;
}
} else {
for (i=2; i<=num_of_menu; i++) {
this.line1.targetPos = 0;
this["line"+i].targetPos = this["line"+(i-1)].targetPos+de_h;
this["line"+i]._x += (this["line"+i].targetPos-this["line"+i]._x)/13;
}
}
}
function menuMove() {
for (i=1; i<=num_of_menu; i++) {
if (system_on && this["line"+(i+1)].active) {
}
this["menu"+i]._x = this["line"+i]._x;
this["menu"+i]._xscale = (this["line"+(i+1)]._x-this["line"+i]._x)/0.79;
this["menu"+i]._yscale = (this["line"+(i+1)]._x-this["line"+i]._x)/0.79;
}
}
}
onClipEvent (enterFrame) {
targetCheck();
lineMove();
menuMove();
} 现在人多拉 晕忽忽
那么多
不懂 FLASH 脚本
循环有问题 楼下的答。。。 都不知道啊 帮顶~ 都不知道? 有什么错?语法上没问题,不过不知道你这是在干什么... CPU占用78%
页:
[1]
2