在flash里怎么制作随机闪烁 的飞星

来源:百度知道 编辑:UC知道 时间:2024/06/06 16:03:04
在flash8中制作

事先声明这是个FLASH8或者说AS2的范例!

首先画个星星,变成元件类型MC,在库里面右键属性,选上为AS导出名字叫STAR

在第一帧扔进去个脚本

var n:Number = 0;
onMouseMove = function () {
p = _root.attachMovie("Star", "Star"+n, n);
p._x = random(800);
p._y = random(250);
//p._x = _xmouse;
//p._y = _ymouse;
p.onEnterFrame = function() {
//this._x = random(800);
//this._y = random(250);
this._rotation += 6
this._rotation += 6;
this._xscale += 5;
this._yscale += 5
this._alpha -= 2;
if (this._alpha<0) {
this.removeMovieClip();
delete this.onEnterFrame;
}
};
n++;
};

CTRL+回车执行。打完收工。