简体   繁体   中英

actionscript 3.0 create color animation

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);
animation.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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM