Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamic tinting help

Status
Not open for further replies.

iostream71

Programmer
Mar 13, 2002
229
US
i was wondering if there's a way to change the tint and alpha of that tint for a clip....like when you click on color in properties, you can select a color and alpha that color up or down at the same time
 
Under Help->ActionScript Dictionary->
A-C > Color.setTransform



Regards,

cubalibre2.gif
 
You can create a color object to hold colour information for any clip:

//create a color object for your mc
newColourObject = new Color("yourClip");
//create an object which holds your tint values
colourTransform = new Object();
//change the red component (could be anything between -255 and 255)
colourTransform.rb = Math.random()*255;
//green
colourTransform.gb = Math.random()*255;
//blue
colourTransform.bb = Math.random()*255;
//feed these new values into your color object
newColourObject.setTransform(colourTransform);




 
are you making a 3d kind of motion for the object.. i mean to say,for what exact purpose you are using the tint for??
 
well guess this will help u..a bit for tinting the object dynamically:
onClipEvent(load){
<function name>=newcolor(this);
}
onClipEvent(enterFrame){
s=Math.sin(x);
colval=s*25+75;
<function name>.setTransform({ra:colval,ga:colval,ba:colval});
}
where ra=red,ga=green,ba=blue
 
There's a well explained and complete example, if you check the AS dictionary under Color.setTransform.

Regards,

cubalibre2.gif
 
thanx. i was using it to tint the gradient of walls. just wanted to make one wall clip and change the hue and alpha of the color at the same time
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top