开发者

actionscript 3.0 create color animation

开发者 https://www.devze.com 2023-04-11 06:12 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消