那弹性的还真难做,试了一个下午没做出来.............你看看这样行不:
//图片总数:
total = 7;
//间距:
d = 25;
//图片宽:
w = 100;
//总长:
W = total*(w+d);
//图片变大变小的速度:
dScale = 10;
//在场景中加入图片:
for (i=1; i<=total; i++) {
this.attachMovie("pic", "pic"+i, i, {_x:i*(w+d)-W/2});
pic = this["pic"+i];
pic.gotoAndStop(i);
//鼠标放在图片上:
pic.onRollOver = function() {
this.onEnterFrame = function() {
//变大:
this._xscale = this._yscale += dScale;
//以该图片为基准调整距离:
pic0 = this;
distance(pic0);
//如果大到一定程度就停止变大:
if (this._xscale>200) {
this._xscale = this._yscale=200;
delete this.onEnterFrame;
pic0 = head;
}
};
};
//鼠标离开图片:
pic.onRollOut = function() {
this.onEnterFrame = function() {
//变小:
this._xscale = this._yscale -= dScale;
//以该图片为基准调整距离:
pic0 = this;
distance(pic0);
//如果小到一定程度就停止变小:
if (this._xscale<100) {
this._xscale = this._yscale=100;
delete this.onEnterFrame;
pic0 = head;
}
};
};
//用来建个类似双向链表的东东:
pic.prevPic = prevPic;
prevPic.nextPic = pic;
prevPic = pic;
}
//形成环链:
this.pic1.prevPic = this["pic"+total];
this["pic"+total].nextPic = this.pic1;
//
head = this.pic1;
tail = this["pic"+total];
//以链头为基准(用来调整距离):
pic0 = head;
//
function onEnterFrame() {
if (head._x<-W/2) {
head._x = tail._x+(tail._width+head._width)/2+d;
tail = head;
head = head.nextPic;
pic0 = head;
} else if (tail._x>W/2) {
tail._x = head._x-(tail._width+head._width)/2-d;
head = tail;
tail = tail.prevPic;
pic0 = head;
}
head._x += -_xmouse/20;
distance(pic0);
}
//--------------------------------------------------------------------------------------------
//以pic0为基准调整各幅画间距离的函数:
function distance(pic0) {
var pic = pic0;
while (pic != head) {
pic.prevPic._x = pic._x-(pic._width+pic.prevPic._width)/2-d;
pic = pic.prevPic;
}
pic = pic0;
while (pic != tail) {
pic.nextPic._x = pic._x+(pic._width+pic.nextPic._width)/2+d;
pic = pic.nextPic;
}
}
我最强舞者 (I, Best Dancer)安卓版v8
我最强舞者(I, Best Dancer)是一款休闲放置类手
迷你世界国服版本2024 v1.43.0
迷你世界国服版本2024是一款自由度非常高的沙盒游戏,玩法和
烹饪乐园 安卓版v1.23.6
烹饪乐园(Cooking Town)是一款非常好玩的餐厅模拟
迷你世界小米服 最新安卓版v1.43.0
迷你世界小米版是由迷你玩科技开发的休闲模拟经营类游戏。此版本
布娃娃Sprunki沙盒 安卓版v0.0.1
布娃娃Sprunki沙盒是一个非常有趣的沙盒游戏,复古简约的