davelk
September 26th, 2008, 09:38 AM
Hi, I have a movieclip and I would like to give it a smooth color animation from dark grey to blue when it is being hovered over and the reverse when you move the mouse out, like what you would expect from making a shape tween in the timeline and then use
nextFrame() and prevFrame() to make it smooth and responsive.
So far I can sharply change the color but I'm pretty stuck.
Any suggestions would be really appreciated
import fl.motion.Color;
var colorInfo:ColorTransform = item.transform.colorTransform;
item.addEventListener(MouseEvent.MOUSE_OVER, tweenToBlue);
function tweenToBlue(e:MouseEvent):void
{
colorInfo.color = Color.interpolateColor(0x333333, 0x0033CC, 1);
item.transform.colorTransform = colorInfo;
}
nextFrame() and prevFrame() to make it smooth and responsive.
So far I can sharply change the color but I'm pretty stuck.
Any suggestions would be really appreciated
import fl.motion.Color;
var colorInfo:ColorTransform = item.transform.colorTransform;
item.addEventListener(MouseEvent.MOUSE_OVER, tweenToBlue);
function tweenToBlue(e:MouseEvent):void
{
colorInfo.color = Color.interpolateColor(0x333333, 0x0033CC, 1);
item.transform.colorTransform = colorInfo;
}