myname = ["闪吧论坛","闪吧源码","闪吧教程","闪吧动画","闪吧游戏","闪吧音效","闪吧图库",闪吧字库"]//在每个MC(zjs1-zjs8)的动态文本中要显示的内容 zjs_y = [];//为0,以后赋值
for (var i = 0; i<myname.length; i++) {
zjs_y[i] = (i+1)*30+20;
_root["zjs"+(i+1)]._y = zjs_y[i];
}
//给每个MC(zjs1-zjs8)的纵坐标赋值
for (var i = 0; i<myname.length; i++) {
this["zjs"+(i+1)].zjs = myname[i];
}
//写入每个MC内文本的内容
MovieClip.prototype.move = function(click, speed, start_x, start_y, end_x, end_y) {//speed 为缓冲系数
if (click) {
this._x += (end_x-this._x)/speed;
this._y += (end_y-this._y)/speed;
//缓冲效果
if (-this._x+end_x<1) {
this.enabled = 1;
} else {
this.enabled = 0;
}
//运动过程中按钮失效
zjs_name = this.zjs;
} else {
this._x += (start_x-this._x)/speed;
this._y += (start_y-this._y)/speed;
if (this._x-start_x<1) {
this.enabled = 1;
} else {
this.enabled = 0;
}
}
};
MovieClip.prototype.myclick = function(n) {
for (var i = 1; i<=myname.length; i++) {
if (i == n) {
_root["click"+i] = true;
} else {
_root["click"+i] = false;
}
}
};
onEnterFrame = function () {
for (var i = 0; i<myname.length; i++) {
this["zjs"+(i+1)].move(eval("click"+(i+1)), 4, 50, zjs_y[i], 275, 200);
}
};
zjs1.onRollOver = function() {
myclick(1);
};
zjs2.onRollOver = function() {
myclick(2);
};
zjs3.onRollOver = function() {
myclick(3);
};
zjs4.onRollOver = function() {
myclick(4);
};
zjs5.onRollOver = function() {
myclick(5);
};
zjs6.onRollOver = function() {
myclick(6);
};
zjs7.onRollOver = function() {
myclick(7);
};
zjs8.onRollOver = function() {
myclick(8);
};
for (var i = 1; i<=myname.length; i++) {
this["zjs"+i].onRelease = function() {
getURL("
http://www.flash8.net");
};
}