怎么用Flash让图片渐渐变大 变小
6个回答
展开全部
1、利用舞台直接操作:插入影片剪辑元件,第一帧做一个小图,第二帧经过,将此图适当放大,第三帧点击,可以画一个点击后认为合适的图形。软件最下面可以添代码和网站。第四帧松开,就可以画个大图。然后将元件方到舞台导出。(此处无法上图,flash软件这几天出问题了)。
2、编写函数代码:
//图片总数:
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 = pre(www.111cn.net)vPic;
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;
}
}from:http://www.111cn.net/flash_a/113/0931af7ab9c04c897b0ac3b917647ca4.htm
2、编写函数代码:
//图片总数:
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 = pre(www.111cn.net)vPic;
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;
}
}from:http://www.111cn.net/flash_a/113/0931af7ab9c04c897b0ac3b917647ca4.htm
展开全部
就五分好少噢!其实你去网上找点教学视频你就可以做了!我就好人做到底教你一点吧!打开flash,上面会有一个时间帧,默认是12帧一秒,如果你想做2秒就要用24帧!首先在第一帧,插入你的图片,把它调节到你要初始的大小!然后将时间轴调到24秒,右击插入关键帧,你会看到一个和刚才一模一样的图,然后拖放使它放到到你要的大小!然后在时间轴的最前面右击(第一帧前,好像是),点创建补间动画,如果看到第一帧到24帧成直线你就成功了,如果不行建议你多看教程,成功了就可以在文件-导出,就可以导出.SWF格式了!好累哦,手机打字…
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2015-06-26
展开全部
就五分好少噢,其实你去网上找点教学视频你就可以做了,我就好人做到底教你一点吧,打开flash,上面会有一个时间帧,默认是12帧一秒,如果你想做2秒就要用24帧,首先在第一帧,插入你的图片,把它调节到你要初始的大小,然后将时间轴调到24秒,右击插入关键帧,你会看到一个和刚才一模一样的图,然后拖放使它放到到你要的大小,然后在时间轴的最前面右击(第一帧前,好像是),点创建补间动画,如果看到第一帧到24帧成直线你就成功了,如果不行建议你多看教程,成功了就可以在文件-导出,就可以导出.SWF格式了,好累哦,手机打字。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
使用补间动画可以实现,在时间轴上右击——补间,即可,具体操作你要自已熟悉,说多了你会乱的
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
最重要的是吧图片打散,第一针和最后一珍,然后创建“补件形状”
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询