# Tint on rollOver

**URL:** <https://forum.kirupa.com/t/tint-on-rollover/57471>\
**Category:** Uncategorized\
**Created:** [July 13, 2004, 4:20pm UTC](https://forum.kirupa.com/t/tint-on-rollover/57471 "2004-07-13T16:20:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![abraxas](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@abraxas](https://forum.kirupa.com/u/abraxas)\
**Post date:** [July 13, 2004, 4:20pm UTC](https://forum.kirupa.com/t/tint-on-rollover/57471/1 "2004-07-13T16:20:52Z")

</div>

hello… i wonder if i can do a button that on rollOver do math.random so it automatic change the tint on a movieclip???

[color=darkred][color=#000000]

```auto
[/color]on(rollOver){[/color]
[color=darkred]	tellTarget("text_effect")[/color]
	[color=olive]//and something here [/color]
[color=olive] (change tint with math.random) arent good at as :(
[/color][color=black]

```

[/color]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 13, 2004, 5:20pm UTC](https://forum.kirupa.com/t/tint-on-rollover/57471/2 "2004-07-13T17:20:02Z")

</div>

```auto
//tested on Flash MX
on (rollOver) {
	new Color(this).setRGB(random(256) | random(256) << 8 | random(256) << 16);
}

```

replace this (from the code) to the name of your movieclip.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 13, 2004, 6:34pm UTC](https://forum.kirupa.com/t/tint-on-rollover/57471/3 "2004-07-13T18:34:22Z")

</div>

Thanks man! its working perfect!! i wonder if i can set a max to the color? so it doesnt get so white likeing. like the RGB is max 190

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 13, 2004, 6:54pm UTC](https://forum.kirupa.com/t/tint-on-rollover/57471/4 "2004-07-13T18:54:44Z")

</div>

> [@abraxas](#):
>
> Thanks man! its working perfect!! i wonder if i can set a max to the color? so it doesnt get so white likeing. like the RGB is max 190

yeah, just change 256 to whatever max you want.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 13, 2004, 8:35pm UTC](https://forum.kirupa.com/t/tint-on-rollover/57471/5 "2004-07-13T20:35:31Z")

</div>

> [@thoriphes](#):
>
> yeah, just change 256 to whatever max you want.

ok thanks
