现在让我们来放飞手里五颜六色的汽球吧!
制作步骤:
1、新建一文档,适当修改其属性(尺寸、背景色)
2、新建一MC(电影剪辑)命名为“汽球”(图1)

3、并进入“汽球”MC中进行编辑,先将第一层重命名为“汽球”,再在场景中画一个无线椭圆,与场景中心对齐。并用调色板将其调为‘放射性渐变填充’(图2)

4、将这个椭圆选中,按F8转为MC(影片剪辑)命名为“变色的汽球”。
5、进入“变色的汽球中”,再次选中这个椭圆,按F8转换为“图符”。(图3)

6、回到“变色的汽球”符号中,在2-6帧中插入要害帧,并改变汽球的颜色,使1-6帧中的汽球的颜色不同。(在属性面板里的‘颜色’栏中选‘高级’,点击后面的‘设置’按钮就行)。改好后新建一图层,命名为“AS”,在第一帧中输入语句:“stop()”(注:没有引号的)。(图4)

7、回到“汽球”中,将“变色的汽球”在属性栏中的名称设为:“color_ball”(图5)

8、新建一图层,重命名为“汽球尾巴”。新建一MC(电影剪辑)命名为“尾巴”。(图6)

9、在“尾巴”中画一条线,让其做一下变形动画。
10、回到“汽球”影片剪辑中,将“尾巴”拖入到‘汽球尾巴’层中。(图7)

11、返回主场景,将‘图层1’改名为“汽球”。并将“汽球”拖入到主场景中来。新建一层,命名为“AS”用来编写程序。(图8)

12、将主场景中的“汽球”在属性栏中的名称设为:“qq”(汽球的拼音缩写),在“AS”层中加入如下语句:
aiyi = 1;
while (aiyi<=25) {//25是汽球的个数
duplicateMovieClip("qq", "qq"+aiyi, aiyi);
setProperty("qq"+aiyi, _x, random(550));
setProperty("qq"+aiyi, _y, random(300)+400);
setProperty("qq"+aiyi, _xscale, random(50)+50);
setProperty("qq"+aiyi, _yscale, getProperty("qq"+aiyi, _xscale));
setProperty("qq"+aiyi, _alpha, eval("qq"+aiyi)._xscale+30);
aiyi++;
}
_root.qq._visible=0//隐藏原始的汽球。
在“汽球”MC中输入如下的AS:
onClipEvent (load) {
n = random(6)+1;
this.color_ball.gotoAndStop(n);//汽球的颜色
}
onClipEvent (enterFrame) {
this._x -= random(3)-random(3);
this._y -= 7-random(3);
if (this._y<-50) {
this._x=random(550)
this._y = random(300)+400;
}
}
13、假如又好一点的背景图片可以导入一幅当背景,假如没有就将背景色设为浅蓝色。这时按Ctrl+回车测试吧:)
点击浏览该文件源文件下载:
点击浏览该文件