# Randomness

**URL:** <https://forum.kirupa.com/t/randomness/6530>\
**Category:** random\
**Created:** [October 9, 2002, 7:39pm UTC](https://forum.kirupa.com/t/randomness/6530 "2002-10-09T19:39:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tgfx](https://avatars.discourse-cdn.com/v4/letter/t/7c8e57/32.png) [@tgfx](https://forum.kirupa.com/u/tgfx)\
**Post date:** [October 9, 2002, 7:39pm UTC](https://forum.kirupa.com/t/randomness/6530/1 "2002-10-09T19:39:06Z")

</div>

here’s a question. Is it possible to randomly change the “tint” of an object that’s tweened on rollOver? I’m not thinking so.

---

<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:** [October 9, 2002, 7:52pm UTC](https://forum.kirupa.com/t/randomness/6530/2 "2002-10-09T19:52:17Z")

</div>

you want to change it during the tween? after the tween? you want to tween the tint or change it with A/S?

---

<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:** [October 9, 2002, 11:25pm UTC](https://forum.kirupa.com/t/randomness/6530/3 "2002-10-09T23:25:18Z")

</div>

I want the tint to be different on each rollOver.

---

<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:** [October 10, 2002, 1:10am UTC](https://forum.kirupa.com/t/randomness/6530/4 "2002-10-10T01:10:12Z")

</div>

I think this is what you want. Don’t forget to give your button an instance name. In my code its myButton.

on(rollOver){  
differentColor = Math.round(Math.random() \* 0xFFFFFF);  
myColor = new Color(myButton);  
myColor.setRGB(differentColor);  
}

Hope this helps.

Kyle
