是否有一个很好的示例如何使颜色“淡出”演示效果,如下所示:
colorTransformer.redMultiplier = colorTransformer.redMultiplier -.2 ;
colorTransformer.greenMultiplier = colorTransformer.greenMultiplier -.2 ;
colorTransformer.blueMultiplier = colorTransformer.blueMultiplier -.2 ;
答案 0 :(得分:0)
我同意Daniel:gtween,tweener以及所有其他人使用轻松进行工作。
如果你想要优化它,你可以很好地使用getter和setter(这通常用于更复杂的情况,但可能很有趣):
private var _brightness:Number = 1;
public function set brightness(value:Number):void
{
_brightness = value
this.colorTransform = new ColorTransform(value,value,value);
}
public function get brightness():Number
{
return _brightness;
}
示例:
简单:
brightness = 0;
随机线性:
brightness -= Math.random() * .02;
互动和放松:
brightness += ((stage.mouseY / stage.stageHeight)-brightness) * .9;
等