# Instance name from variable

**URL:** <https://forum.kirupa.com/t/instance-name-from-variable/316640>\
**Category:** Uncategorized\
**Created:** [November 28, 2010, 6:46am UTC](https://forum.kirupa.com/t/instance-name-from-variable/316640 "2010-11-28T06:46:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![radi](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@radi](https://forum.kirupa.com/u/radi)\
**Post date:** [November 28, 2010, 6:46am UTC](https://forum.kirupa.com/t/instance-name-from-variable/316640/1 "2010-11-28T06:46:31Z")

</div>

i want to use a variable(text) to refrence a movieclips instance name

```auto
[SIZE=1]function InventoryShow(event:Event):void
{
[/SIZE][COLOR=Navy][SIZE=1] var SC:URLVariables = new URLVariables(event.target.data);
    for (var s in SC)
    {
        if (s != "<script language" && s != "bat ****")
        {
            trace(s +" = "+ SC[s]);
            if (s == "backpack1")
            {[/SIZE]
[/COLOR][COLOR=Navy][SIZE=3][COLOR=DarkRed] //Inventory.backpack1.text = SC[s]; **<--- This works**
 Inventory.s.text = SC[s]; // **<--- This Doesn't works** [/COLOR][/SIZE]
       [SIZE=1] }
        }
    }[/SIZE]
}[/COLOR]

```
