Is there a simple way to animate the color of an object using actionscript in Flash? I found a simple way in Flex,it uses the spark.effects.AnimateColor class. I try to find something similar to Flash,is there a way or a library that i can use, or can i somehow use the Flex libraries? Here is the code that i found:
import spark.effects.AnimateColor;
var animation:AnimateColor = new AnimateColor(this);
animatio开发者_Python百科n.duration = 400; // milliseconds
animation.colorFrom = 0xFFCC00;
animation.colorTo = 0xaaff00;
animation.colorPropertyName = "color";
animation.stop();
animation.play();
I'm pretty sure you can do this using the free GreenSock Tween libraries. You'll have to look at the docs for sure. I've only used it for X and Y tweens, but I thought colors and/or alphas were possible too.
精彩评论