Is it possible to make an animation only with AS, where would be one box for example and it will change its color from one to another.
Thank you in advance.
simple animation with changing the color
Started by ribo6, Jan 20 2006 09:21 AM
2 replies to this topic
#1
Posted 20 January 2006 - 09:21 AM
#2
Posted 20 January 2006 - 09:58 AM
If using Flash MX2004 or lower you need to use this:
Since Flash 8, this command has been replaced in favour of the Flash.geom.ColorTransform class
var my_color:Color = new Color(my_mc); my_color.setRGB(0xff9933);
Since Flash 8, this command has been replaced in favour of the Flash.geom.ColorTransform class
import flash.geom.ColorTransform; var colorTrans_1:ColorTransform = new ColorTransform(1, 1, 1, 1, 0, 0, 0, 0); trace(colorTrans_1); //(redMultiplier=1, greenMultiplier=1, blueMultiplier=1, alphaMultiplier=1, redOffset=0, greenOffset=0, blueOffset=0, alphaOffset=0) var colorTrans_2:ColorTransform = new ColorTransform(); trace(colorTrans_2); //(redMultiplier=1, greenMultiplier=1, blueMultiplier=1, alphaMultiplier=1, redOffset=0, greenOffset=0, blueOffset=0, alphaOffset=0)
#3
Posted 20 January 2006 - 01:10 PM
funkysoul, on Jan 20 2006, 09:58 AM, said:
If using Flash MX2004 or lower you need to use this:
Since Flash 8, this command has been replaced in favour of the Flash.geom.ColorTransform class
var my_color:Color = new Color(my_mc); my_color.setRGB(0xff9933);
Since Flash 8, this command has been replaced in favour of the Flash.geom.ColorTransform class
import flash.geom.ColorTransform; var colorTrans_1:ColorTransform = new ColorTransform(1, 1, 1, 1, 0, 0, 0, 0); trace(colorTrans_1); //(redMultiplier=1, greenMultiplier=1, blueMultiplier=1, alphaMultiplier=1, redOffset=0, greenOffset=0, blueOffset=0, alphaOffset=0) var colorTrans_2:ColorTransform = new ColorTransform(); trace(colorTrans_2); //(redMultiplier=1, greenMultiplier=1, blueMultiplier=1, alphaMultiplier=1, redOffset=0, greenOffset=0, blueOffset=0, alphaOffset=0)
Maybe you can help me again
I've tried to get it to work, but with Tween it doesn't do anything.
On a stage there is only a box with instance name rect.
AS in the first frame:
import flash.geom.Transform;
import flash.geom.ColorTransform;
import mx.transitions.Tween;
import mx.transitions.easing.*;
var trans:Transform = new Transform(_root.rect);
var blueColorTransform:ColorTransform = new ColorTransform(0, 0, 0, 0, 166, 44, 44, 100);
trans.colorTransform = blueColorTransform;
var myTween1:Tween = new Tween(blueColorTransform, "greenOffset", Strong.easeOut, 44, 244, 1, true);
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
