on(release) {var filter = (new flash.filters.GlowFilter());filter["color"] = random(16000000);yuanjian.filters = [filter];var i = 1;var j = 0.1;filter.blurX = filter.blurX+i;filter.blurY = filter.blurY+i;filter["color"] = random(16000000);filter.alpha = filter.alpha+j;yuanjian.filters = [filter];}这段代码写在按钮元件yuanjian上,想要改变自身的发光滤镜但测试时单击按钮始终未能执行,望指点...
1 回答
紫衣仙女
TA贡献1839条经验 获得超15个赞
//抱歉你写的代码我无法修改.既然你要按钮点击有发光滤镜变化,下面的代码是我帮你重写的...复制到帧上就行了.按钮名rect
import flash.filters.GlowFilter;
var color:Number = 0x33CCFF;
var alpha:Number = 0.8;
var blurX:Number = 35;
var blurY:Number = 35;
var strength:Number = 2;
var quality:Number = 3;
var inner:Boolean = false;
var knockout:Boolean = false;
var qw;
rect.onPress = function() {
qw = random(5);
//下面变量的算法你如果有兴趣可自己改着玩下
var filter:GlowFilter = new GlowFilter(color*qw, alpha*qw+50, blurX*qw, blurY*qw, strength*qw, quality, inner, knockout);
var filterArray:Array = new Array();
filterArray.push(filter);
this.filters = filterArray;
};
- 1 回答
- 0 关注
- 233 浏览
添加回答
举报
0/150
提交
取消