# Class constructors

**URL:** <https://forum.kirupa.com/t/class-constructors/251627>\
**Category:** Uncategorized\
**Created:** [February 11, 2008, 9:22am UTC](https://forum.kirupa.com/t/class-constructors/251627 "2008-02-11T09:22:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbuda](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jbuda/32/3723_2.png) [@jbuda](https://forum.kirupa.com/u/jbuda)\
**Post date:** [February 11, 2008, 9:22am UTC](https://forum.kirupa.com/t/class-constructors/251627/1 "2008-02-11T09:22:50Z")

</div>

Hi all

Not sure if this is possible but it has been annoying me for the least few days.

Basically im aware i can do this to instantiate a class

var CONSTRUCTOR:Function = SOME\_VARIABLE  
var t:CLASS\_NAME = new CONSTRCUTOR();

However, if i pass in a string for the SOME\_VARIABLE , is there anyway i can get the above to work? If i pass a string in i either get no error, or the fact that the datatype is incorrect.

Im using an xml file to build up an interface. but the value of SOME\_VARIABLE is passed in from the xml file as a string . I want to be able to detrmine which class to create from this string.

Hope that makes sense, and someone can help me out.

Thanks
