# How to dynamically load different classes?

**URL:** <https://forum.kirupa.com/t/how-to-dynamically-load-different-classes/313364>\
**Category:** flash\
**Created:** [August 27, 2010, 3:57am UTC](https://forum.kirupa.com/t/how-to-dynamically-load-different-classes/313364 "2010-08-27T03:57:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Comrade\_227](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@Comrade\_227](https://forum.kirupa.com/u/Comrade_227)\
**Post date:** [August 27, 2010, 3:57am UTC](https://forum.kirupa.com/t/how-to-dynamically-load-different-classes/313364/1 "2010-08-27T03:57:09Z")

</div>

I want to do something like this:

```auto
eval("var "+ class_iname +" = new"+class_name+"();");

```

But since this is not possible, how would I dynamically load different classes?

Should I use the loader class?  
This example does, but it requires pre compiling of the class in question + I am using AIR.: [http://wahlers.com.br/claus/blog/as3-loading-class-libraries-at-runtime/](http://wahlers.com.br/claus/blog/as3-loading-class-libraries-at-runtime/)

What are the alternatives?

Thanks for youe help.
