Thread: tint effect
View Single Post
  #2 (permalink)  
Old 02-26-2008, 10:05 PM
aramesh aramesh is offline
D-Web Programmer
 
Join Date: Mar 2007
Posts: 72
aramesh is on a distinguished road
Default Re: tint effect

Hi,

We can apply a tint color for an movieclip using the function below.

var colorful=new Color("MovieClip Name");
colorful.setTint(200,100,200,100); // (red val, green val, blue val, alpha val)

Color.prototype.setTint = function(r, g, b, amount) {
var percent = 100-amount;
var trans = new Object();
trans.ra = trans.ga=trans.ba=percent;
var ratio = amount/100;
trans.rb = r*ratio;
trans.gb = g*ratio;
trans.bb = b*ratio;
this.setTransform(trans);
};


Regards
A.Ramesh
Reply With Quote