谁能提供一个FLASH8版本的烟花特效,不要互动的
发布网友
发布时间:2022-04-28 15:47
我来回答
共2个回答
热心网友
时间:2022-05-18 14:37
动作代码如下:(代码来自flash8,现学现用,HOHO~~)
Stage.scaleMode = "noScale";
import flash.display.BitmapData;
import flash.filters.ConvolutionFilter;
import flash.geom.Rectangle;
var con = new ConvolutionFilter(3, 3, [1, 1, 1, 1, 30, 1, 1, 1, 1], 38);
var rect:Rectangle = new Rectangle(0, 0, Stage.width, 200);
var bitmap1 = new BitmapData(rect.width, rect.height, false,0x00000000);
var bitmap2 = new BitmapData(rect.width, rect.height, true,0x00000000);
var bitmapShow1 = createEmptyMovieClip("bitmapShow1", 1).attachBitmap(bitmap1,
1);
//粒子的显示画布
var bitmapShow2 = createEmptyMovieClip("bitmapShow2", 2).attachBitmap(bitmap2,
2);
//白色闪光点的显示画布
var m_mouseX;
//鼠标x坐标
var m_mouseY;
//鼠标y坐标
var sound1 = new Sound();
//上升过程的声音
var sound2 = new Sound();
//爆炸声音
var bit_px = new Array(bits);
//爆炸过程的x坐标
var bit_py = new Array(bits);
//爆炸过程的y坐标
var bit_vx = new Array(bits);
//爆炸过程的x速度
var bit_vy = new Array(bits);
//爆炸过程的y速度
var bit_sx = new Array(bits);
//上升过程的x坐标
var bit_sy = new Array(bits);
//上升过程的y坐标
var bit_l = new Array(bits);
//粒子的生命时间
var bit_f = new Array(bits);
//是上升还是爆炸的标志
var bit_p = new Array(bits);
//随机出现白色闪光点的标志
var bit_c = new Array(bits);
//粒子颜色
init();
function init() {
sound1.attachSound("sound1");
sound2.attachSound("sound2");
bits = 500;
//总的最大粒子数
bit_max = 50;
//一次出现的粒子数
bit_sound = 2;
for (var j = 0; j<bits; j++) {
bit_f[j] = 0;
}
}
onEnterFrame = function () {
bitmap2.fillRect(new Rectangle(0, 0, rect.width, rect.height),
0x00000000);
//白色闪光点清除
//bitmap2.applyFilter(bitmap, bitmap.rectangle, new Point(0, 0), con);
rend();
bitmap1.applyFilter(bitmap1, bitmap1.rectangle, new Point(0, 0), con);
//模糊滤镜
};
onMouseDown = function () {
m_mouseX = _root._xmouse;
m_mouseY = _root._ymouse;
if (rect.contains(m_mouseX, m_mouseY)) {
var k = int(Math.random()*256);
var l = int(Math.random()*256);
var i1 = int(Math.random()*256);
var j1 = k << 16 | l << 8 | i1;
var k1 = 0;
for (var l1 = 0; l1<bits; l1++) {
if (bit_f[l1] != 0) {
continue;
}
bit_px[l1] = m_mouseX;
热心网友
时间:2022-05-18 15:55
http://www.gougou.com/search?search=flash8%E7%83%9F%E8%8A%B1%E7%89%B9%E6%95%88&id=0
去看看吧