# Changing tint on button event

**URL:** https://forum.kirupa.com/t/changing-tint-on-button-event/138938
**Category:** Uncategorized
**Created:** [February 26, 2005, 9:32pm UTC](https://forum.kirupa.com/t/changing-tint-on-button-event/138938 "2005-02-26T21:32:38Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Patriotxcountry](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/patriotxcountry/32/1110_2.png) [@Patriotxcountry](https://forum.kirupa.com/u/Patriotxcountry)
#### Post date: [February 26, 2005, 9:32pm UTC](https://forum.kirupa.com/t/changing-tint-on-button-event/138938/1 "2005-02-26T21:32:38Z")

</div>

I want to change a movie clip’s tint once a button event occurs, and I can’t seem to figure it out. I have looked at Kirupa’s color changing tutorial but it does not apply to tinting.

I found this through a google search but I’m not entirely sure how to use it.

```auto
//tint an object with a color just like Effect panel
//r, g, b between 0 and 255; amount between 0 and 100
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);
}//Robert Penner June 2001 - www.robertpenner.com

```
