猿问

麻烦大佬帮忙看看,关于flash as 按钮的on(release)事件的问题!

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上,想要改变自身的发光滤镜
但测试时单击按钮始终未能执行,望指点...

呼啦一阵风
浏览 234回答 1
1回答

紫衣仙女

//抱歉你写的代码我无法修改.既然你要按钮点击有发光滤镜变化,下面的代码是我帮你重写的...复制到帧上就行了.按钮名rectimport 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;};
随时随地看视频慕课网APP
我要回答