# \[FMX\]Controlling mc's

**URL:** <https://forum.kirupa.com/t/fmx-controlling-mcs/107926>\
**Category:** Uncategorized\
**Created:** [April 20, 2004, 8:20am UTC](https://forum.kirupa.com/t/fmx-controlling-mcs/107926 "2004-04-20T08:20:12Z")\
**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:** [April 20, 2004, 8:20am UTC](https://forum.kirupa.com/t/fmx-controlling-mcs/107926/1 "2004-04-20T08:20:12Z")

</div>

I have the following code to control the rollOver, rollOut and release states from my buttons (btn\_company, btn\_products, btn\_services and btn\_enquiry):

```auto
for (var i in this) {
 if (this*._name.substr(0, 4) == "btn_") {
  setKnop(this*._name);
 }
}
function setKnop(clip) {
 var clip = eval(clip);
 clip.onRollOver = function() {
  new Color(clip).setRGB(0xA10000);
 };
 clip.onRollOut = function() {
  if (!this.pushed) {
   new Color(clip).setRGB(0xFFFFFF);
  } else {
   new Color(clip).setRGB(0xA10000);
  }
 };
 clip.onRelease = function() {
  _root.resetKnop();
  this.pushed = true;
  // delete clip.onRollOver;
  new Color(clip).setRGB(0xA10000);
  showHeader(this._name.substr(4));
 };
}
function resetKnop() {
 for (var i in this) {
  if (this*._name.substr(0, 4) == "btn_") {
   var clip = eval(this*._name);
   clip.pushed = false;
   new Color(clip).setRGB(0xFFFFFF);
  }
 }
}  

```

I also have 4 movieclips (title\_company, title\_products, title\_services and title\_enquiry) which I also want to control with those buttons. When btn\_company is pressed, title\_company should go to frame 2, When after that btn\_products is pressed title-products should go to frame 2 and title-company should go back to frame one. Is there anybody who can help me?
