代码方法:
新建一文档.建一个影片剪辑,命名为“h2o”。进入编辑区以后,利用绘图工具,渐变填充绘制一个水泡。回到主场景,库中把“h2o”影片剪辑拖放到场景的下方,在下面的属性面板中命名它的分身名为“h2o”。主场景中新建一个图层,命名为“as”。在第1帧添加AS:
i=1
while(i<=50){
duplicateMovieClip("h2o","h2o"+i,i);
setProperty("h2o"+i,_x,random(500));
setProperty("h2o"+i,_y,random(100)+300);
setProperty("h2o"+i,_xscale,random(60)+60);
setProperty("h2o"+i,_yscale,getProperty(eval("h2o"+i),_xscale));
setProperty("h2o"+i,_alpha,random(30)+100);
i++
}
_root.h2o._visible=0
选中影片剪辑“H2O”,添加AS:
onClipEvent (load) {
speed = random(5)+3;
}
onClipEvent (enterFrame) {
this._y -= speed;
this._x += random(3)-random(3);
if (this._y<-15) {
this._y = random(100)+315;
}
}
[
本帖最后由 ynssxs 于 2008-5-7 20:34 编辑 ]