Finally to perform our animation for the tint. As we developped for each of the red, green and blue properties in there setter to update the color of the attached movie clip then all we have to do is to tween the value of each of this properties and the update will be done automaticlly, the key is the Tween Class. The code below show how we tween a property of an object.







Script

import com.core.*;
//declare an rgbColor object for the movieclip backgroun
var rgbColor:RGBColor = new RGBColor();
//and another one for the text
var textRGBColor:RGBColor = new RGBColor();
//attach it to the mc
rgbColor.attachTo(my_mc);
//and this to the text mc
textRGBColor.attachTo(tintText);
//function to perform the tweening of a property of an object
//--------function used to all effects-------------
function tween(_mc, easeType, type, begin, end, time, bool, mcf, functionToCall, param) {
 var myTween;
 myTween = new mx.transitions.Tween(_mc, type, easeType, begin, end, time, bool);
 myTween.functionToCall = functionToCall;
 myTween.param = param;
 myTween.mcf = mcf;
 myTween.onMotionFinished = function() {
  this.mcf[functionToCall](this.param);
 };
 return myTween;
}
//Animate the tint
function randomTint() {
 var max = 255;
 var time = 1.2;
 //change the red green blue values of the textRGBColoer
 tween(textRGBColor, mx.transitions.easing.Regular.easeOut, 'red', textRGBColor.red, random(max), time, true);
 tween(textRGBColor, mx.transitions.easing.Regular.easeOut, 'green', textRGBColor.green, random(max), time, true);
 tween(textRGBColor, mx.transitions.easing.Regular.easeOut, 'blue', textRGBColor.blue, random(max), time, true);
 
 tween(rgbColor, mx.transitions.easing.Regular.easeOut, 'red', rgbColor.red, random(max), time, true);
 tween(rgbColor, mx.transitions.easing.Regular.easeOut, 'green', rgbColor.green, random(max), time, true);
 tween(rgbColor, mx.transitions.easing.Regular.easeOut, 'blue', rgbColor.blue, random(max), time, true,this,'randomTint');
}
randomTint();


And thats it after last tween is done we recall the randomTint function to animate to some new Values.

Thanks for reading, and if you have any questions the forums is always opened for you ;)

Amen.