# Want to use variable in between " "

**URL:** <https://forum.kirupa.com/t/want-to-use-variable-in-between/307698>\
**Category:** Uncategorized\
**Created:** [April 8, 2010, 4:07pm UTC](https://forum.kirupa.com/t/want-to-use-variable-in-between/307698 "2010-04-08T16:07:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![morn](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@morn](https://forum.kirupa.com/u/morn)\
**Post date:** [April 8, 2010, 4:07pm UTC](https://forum.kirupa.com/t/want-to-use-variable-in-between/307698/1 "2010-04-08T16:07:25Z")

</div>

Hi,  
I am pretty new to AS 2 and I got a fundamental problem with the usage of variables between " "

I code AS 2 in Flash CS4

Basically I want to build a function witch creates a new MC in \_root  
so this is the way it works:

```auto

MC_create("fore1_btn_mc");

function MC_create(MCname){
    _root.layer ++;                   
    _root.createEmptyMovieClip(MCname,layer);
    trace("new layer number :"+this.layer);
    trace("new layer name :" +this.MCname);
                            }

```

but i need it to be like that :

```auto
MC_create(fore1_btn_mc);

```

so I tried several stuff like :

```auto

function MC_create(MCname){
    _root.layer ++;
    this._parent.createEmptyMovieClip(String(MCname),layer);
    trace("new layer number :"+this.layer);
    trace("new layer name :" +this.String(MCname));
                            }

```

bassicly I want to know how to do thing s like this

var\_nme -\> function(""+var\_nme+"")

so make it “var\_nme”  
I hope you know now where my problem is 🙂

thx for your time
