# Functions and variable syntax

**URL:** https://forum.kirupa.com/t/functions-and-variable-syntax/153932
**Category:** flash
**Created:** [July 5, 2005, 8:32pm UTC](https://forum.kirupa.com/t/functions-and-variable-syntax/153932 "2005-07-05T20:32:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![darley](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@darley](https://forum.kirupa.com/u/darley)
#### Post date: [July 5, 2005, 8:32pm UTC](https://forum.kirupa.com/t/functions-and-variable-syntax/153932/1 "2005-07-05T20:32:26Z")

</div>

This is a quick one…

I am looping to find the name of 1 of my 12 movieClips.

```auto
for (x=1; x<=12; x++) {
		_root["mc"+x].alphaTo(100, x*.10, "linear", x*.10);
		_root["mc"+x].onEnterFrame = function() {
			this.onRollOver = function() {
					this.i += 2;
					this.swapDepths(this.i);
					this.scaleTo(154, .75, 'easeOutElastic', 0);
					this.gotoAndStop("sub");
HERE IS WHERE I WANT TO ADD CODE: ["mc"+x]Move();
			};
			this.onRollOut = function() {
				this.scaleTo(100, .25, 'easeOutBack', 0);
				this.gotoAndStop("main");
			};
		};
	}

function mc1Move() {
     something for the funtion
}

function mc2Move() {
     something for the funtion
}

```

I want to add a function call based on the name of the clip that is “this” at the time. And I want it to call its variable named function.

Does this make sense?
