2006/02/15 | import flash.filters.BlurFilter
类别(Flash&AS2) | 评论(0) | 阅读(272) | 发表于 10:02
今天研究了一下Flash8的BlurFilter类,原来这么爽,代码如下,大家看效果 <BR /> <BR />
import flash.filters.BlurFilter; <BR /> <BR />
var pic = this.attachMovie("mc_pic","mc_pic",0); <BR /> <BR />
pic._visible = false; <BR /> <BR />
//导入BlurFilter 的package <BR /> <BR />
var blurX =100; <BR /> <BR />
var blurY =100; <BR /> <BR />
pic.onEnterFrame = function() <BR /> <BR />
{ <BR /> <BR />
  this._visible = true; <BR /> <BR />
  blurXdiff = blurX / 3; <BR /> <BR />
  blurX -= blurXdiff; <BR /> <BR />
  blurYdiff = blurY / 3; <BR /> <BR />
  blurY -= blurYdiff; <BR /> <BR />
  //trace("blurY="+blurY); <BR /> <BR />
  var myBlurfilter:BlurFilter = new BlurFilter(blurX, blurY, 10); <BR /> <BR />
  /* <BR /> <BR />
  建立flash.filters.BlurFilter的实例,使用方法为 <BR /> <BR />
  var myInstanceName: BlurFilter= new BlurFilter(blurX:Number,blurY:Number, quality:Number); <BR /> <BR />
  blurX和blurY模糊值分别指的是画面横向和纵向的模糊强度,范围从1~100;quality指的是模糊渲染的质量,范围从1~15,默认值为1质量较低,2质量居中,当为3时质量接近Photoshop中的高斯模糊(Gaussian blur); <BR /> <BR />
  */ <BR /> <BR />
  var filterArray:Array = new Array(); <BR /> <BR />
  filterArray.push(myBlurfilter); <BR /> <BR />
  //向filterArray数组新增一个滤镜对象 <BR /> <BR />
  this.filters = filterArray; <BR /> <BR />
}; <BR /> <BR />
<BR /> <BR />


Flash 动画
0

评论Comments

日志分类
首页[116]
Flash&AS2[56]
FMS[3]
Flex&AS3[5]
Asp[5]
My Works[13]
My Life[34]