forceSmoothing
强迫光滑属性
在FLASH里进行伸缩和旋转是很容易的,只要使用_rotation,_xscale,成员。除非你发布一个FB8或者更新的SWF媒体内容,你伸缩或者旋转的每一张图片都会被锯齿化,非常讨厌。为了消除这一点你必须将媒体内容发布为FLASH7获得使用复杂的loadBitmapSmoothed 函数。
当FLASH8.5播放器发布时,他引入一个forceSmoothing 属性,该属性在AS2中也存在,现在我们所做的就是当装载图片的时侯将此属性设置为TRUE,当然不要忘记在FLASH播放器8.5以前的版本中该做法是没有任何效果。
这样做得到的效果很好,下面有一个例子展示这种做法。
Rotating and scaling pictures in flash is easy. Just use _rotation, _xscale and _yscale. Except when you publish an swf for Flash Player 8 or newer. Every image you rotate or scale will become jagged. Very anoying. To remedy this you can either publish for Flash 7 or use a complicated loadBitmapSmoothed function that uses BitmapData.
When Flash Player 8.5 came out it introduced the forceSmoothing property. This property is also available in as2. Now all we need to do is set it to true when we load images. Don’t forget that this will have no effect in Flash players older than version 8.5!
It works quite well. In the example below you can clearly see the left picture is more jagged than the right one.
var so = new SWFObject("http://www.crydust.be/blog/wp-content/uploads/forcesmoothing.swf", "forcesmoothing_swf", "400", "200", "9", "#FFFFFF");
so.addParam("base", ".");
so.write("forcesmoothing");
outer_mc createEmptyMovieClip
inner_mc outer_mccreateEmptyMovieClip
outer_mc_rotation
outer_mc_xscale
outer_mc_yscale
mcl
mcladdListener
onLoadInit target
targetforceSmoothing
mclloadClip inner_mc
本文转自
http://www.crydust.be/blog/2008/02/15/forcesmoothing/
1604

被折叠的 条评论
为什么被折叠?



