# \[FMX\]What is wrong with my code

**URL:** <https://forum.kirupa.com/t/fmx-what-is-wrong-with-my-code/69818>\
**Category:** Uncategorized\
**Created:** [November 8, 2004, 12:59pm UTC](https://forum.kirupa.com/t/fmx-what-is-wrong-with-my-code/69818 "2004-11-08T12:59:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dboers](https://avatars.discourse-cdn.com/v4/letter/d/bbe5ce/32.png) [@dboers](https://forum.kirupa.com/u/dboers)\
**Post date:** [November 8, 2004, 12:59pm UTC](https://forum.kirupa.com/t/fmx-what-is-wrong-with-my-code/69818/1 "2004-11-08T12:59:51Z")

</div>

Hi I have a few buttons on the stage and a simalar quantity of mc’s with the same suffix as the buttons I would like to change the color of the movieclips at rollOver and restore the color again at rollOut. To do so I came up with the following function:

```auto
function buttons() {
 for (var i in this) {
  if (this*._name.substr(0, 4) == "btn_") {
   clip = this*;
   clip.myOver = _root["rollOver_"+clip._name.substr(4, clip._name.length)];
   clip.onRollOver = function() {
	this.myOver.setRGB(0xD86C01);
   };
   clip.onRollOut = function() {
	new Color(myOver).setRGB(0xCC6600);
   };
  }
 }
}
buttons();
 

```

But that isn’t working. What am I doing wrong?

Thanks in advance
