# \[FMX\] Control function for MC's

**URL:** <https://forum.kirupa.com/t/fmx-control-function-for-mcs/106474>\
**Category:** Uncategorized\
**Created:** [April 6, 2004, 6:21am UTC](https://forum.kirupa.com/t/fmx-control-function-for-mcs/106474 "2004-04-06T06:21:22Z")\
**Posts on this page:** 6\
**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 6, 2004, 6:21am UTC](https://forum.kirupa.com/t/fmx-control-function-for-mcs/106474/1 "2004-04-06T06:21:22Z")

</div>

I have 120 MC’s (little squares, names square\_01, square\_02, etc) around my stage like a frame around a painting. I would like to create an onRollOver/Out effect for these mc’s, but it seems a bit much to me to place them all in an array.

The effect have to be that when you roll over the alpha is going to 0 and that on roll out the alpha will be restored to 100. I also would like the effect to be easing. I know how make a function to control the alpha. But I don’t know how to continiue from there. I think it has something to do with a (for in) loop witch I tried, without any results. Is there somebody who can help me?

---

<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:** [April 6, 2004, 7:54am UTC](https://forum.kirupa.com/t/fmx-control-function-for-mcs/106474/2 "2004-04-06T07:54:41Z")

</div>

> [@dboers](#):
>
> …but it seems a bit much to me to place them all in an array.

Who ever said you have to place them manually into the array?!  
You can use a [font=courier new]for[/font] statement to do the dirty job for you. 😉

```auto
var squares = [];
for (var i=1; i<=120; i++) {
	squares.push(this["square_"+(i<10 ? "0"+i : i)]);
}

```

…You now have a nice array containing a reference to all of the squares. 😛

---

<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:** [April 6, 2004, 8:01am UTC](https://forum.kirupa.com/t/fmx-control-function-for-mcs/106474/3 "2004-04-06T08:01:27Z")

</div>

Is this working with the code given by Scotty, because up till now that one isn’t working at all. As said the onRollOver an Out are not even working. And i’m looking already for over half an hour, but I don’t see what I do wrong sofar

---

<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:** [April 6, 2004, 8:57am UTC](https://forum.kirupa.com/t/fmx-control-function-for-mcs/106474/4 "2004-04-06T08:57:10Z")

</div>

This works;)

scotty(-:

---

<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:** [April 6, 2004, 9:05am UTC](https://forum.kirupa.com/t/fmx-control-function-for-mcs/106474/5 "2004-04-06T09:05:32Z")

</div>

Hi Scotty.

To be honnest, I’m a little embarassed 😊 I did’t look very good. In your movie you used square\_1, square\_2 etc Where I had square\_01, square\_02 etc. I’m realy sorry for the stuppidness 🙂

It’s working very well thank you 😉

---

<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:** [April 6, 2004, 9:08am UTC](https://forum.kirupa.com/t/fmx-control-function-for-mcs/106474/6 "2004-04-06T09:08:45Z")

</div>

No problem:)  
And you can allways use the handy thing kode gave you if you want to stay with square\_01:  
this[“square\_”+(i\<10 ? “0”+i : i)].onRollOver etc…

scotty(-:
