# Dynamic class selection \["classname"\]

**URL:** https://forum.kirupa.com/t/dynamic-class-selection-classname/161516
**Category:** Uncategorized
**Created:** [September 4, 2005, 7:37pm UTC](https://forum.kirupa.com/t/dynamic-class-selection-classname/161516 "2005-09-04T19:37:17Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ShinFu](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@ShinFu](https://forum.kirupa.com/u/ShinFu)
#### Post date: [September 4, 2005, 7:37pm UTC](https://forum.kirupa.com/t/dynamic-class-selection-classname/161516/1 "2005-09-04T19:37:17Z")

</div>

hi

Is there a way of selecting a class with a string like in this code?

```auto

...
var newMc:String = userSelection + counter.toString();
_parent.attachMovieClip(userSelection, newMc, newDepth);
_parent[newMc]._x = _root.stamp._x;
...
trackingArray[newDepth] = new [userSelection](arguments);
...

```

It is possible to select objects with [string] but why not with classes?  
Of course i could make a switch statement but that would be tedious  
and not very effective if the provided string already has the right information.
