# Replace MC Instane names from variables AS2

**URL:** <https://forum.kirupa.com/t/replace-mc-instane-names-from-variables-as2/294040>\
**Category:** flash\
**Created:** [August 7, 2009, 11:23am UTC](https://forum.kirupa.com/t/replace-mc-instane-names-from-variables-as2/294040 "2009-08-07T11:23:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jotte](https://avatars.discourse-cdn.com/v4/letter/j/e36b37/32.png) [@jotte](https://forum.kirupa.com/u/jotte)\
**Post date:** [August 7, 2009, 11:23am UTC](https://forum.kirupa.com/t/replace-mc-instane-names-from-variables-as2/294040/1 "2009-08-07T11:23:54Z")

</div>

Hi!  
I am using AS 2.0 and Flash Player 9.  
I want to change MC Instance names and target paths, by using variables.

As an example, this is the traditional working code.

enter\_btn.onPress = function () {  
clip1\_mc.gotoAndPlay(“label1”);  
};

I want to do someting like this.  
This code does not work but it shows what I am trying to solve.

var clipname = “clip2\_mc”;  
enter\_btn.onPress = function () {  
clipname.gotoAndPlay(“label1”);  
};

Do you know the solution?  
Thanks from Jotte
