# MX: can variables be used in movieclip paths?

**URL:** https://forum.kirupa.com/t/mx-can-variables-be-used-in-movieclip-paths/9106
**Category:** Uncategorized
**Created:** [December 4, 2002, 11:04pm UTC](https://forum.kirupa.com/t/mx-can-variables-be-used-in-movieclip-paths/9106 "2002-12-04T23:04:24Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Greenlander](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@Greenlander](https://forum.kirupa.com/u/Greenlander)
#### Post date: [December 4, 2002, 11:04pm UTC](https://forum.kirupa.com/t/mx-can-variables-be-used-in-movieclip-paths/9106/1 "2002-12-04T23:04:24Z")

</div>

hi all,  
maybe it’s easy after all, but i can’t find any solution to this problem: i want to use VARIABLES in MC paths / for calling methods for a group of MCs.

example:

let’s say the movievlip “Level2\_mc” contained quite a large series of similar movieclips with “serial” instance names (like clip1, clip2, … clip 30) which i wanted to start/stop simultaneously without handwriting all the code… could i somehow use a counter AS PART OF the instance name IN THE MOVIECLIP PATH?

somewhat like this…

for (counter=1; counter\<31; counter++) {  
\_root.Level1\_mc.Level2\_mc.[COLOR=orangered]clip\*\*\<+counter\>\*\* [/COLOR].GotoAndPlay(“go”);  
}

any help is greatly appreciated! 🙂  
greenlander

---

<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: [December 4, 2002, 11:11pm UTC](https://forum.kirupa.com/t/mx-can-variables-be-used-in-movieclip-paths/9106/2 "2002-12-04T23:11:52Z")

</div>

```php

for (counter=1; counter<31; counter++) {
_root.Level1_mc.Level2_mc["clip" + counter].gotoAndPlay("go");
}

```

That’ll do it. I assume the clips are called clip1, clip2, clip3, etc.

-Al

---

<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: [December 5, 2002, 2:21am UTC](https://forum.kirupa.com/t/mx-can-variables-be-used-in-movieclip-paths/9106/3 "2002-12-05T02:21:47Z")

</div>

Thanks a lot Al,  
that was a lightening-fast reply. And it was easy enough-- _argh_. But sometimes I seem to be unable to come up with the most plausible solutions 😉 … Everythink works fine now, thanks again.

Cheers,  
Greenlander

---

<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: [December 5, 2002, 7:49am UTC](https://forum.kirupa.com/t/mx-can-variables-be-used-in-movieclip-paths/9106/4 "2002-12-05T07:49:29Z")

</div>

Hey no prob.

It took me a while to figure that out myself. Then I discovered these forums and the ones over at [www.werehere.com](http://www.werehere.com). Great resources when you’re in a jam.

-Al
