|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
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();
} |
|