# How to set variable for className

**URL:** <https://forum.kirupa.com/t/how-to-set-variable-for-classname/314301>\
**Category:** Uncategorized\
**Created:** [September 24, 2010, 6:10am UTC](https://forum.kirupa.com/t/how-to-set-variable-for-classname/314301 "2010-09-24T06:10:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![soha\_20088](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@soha\_20088](https://forum.kirupa.com/u/soha_20088)\
**Post date:** [September 24, 2010, 6:10am UTC](https://forum.kirupa.com/t/how-to-set-variable-for-classname/314301/1 "2010-09-24T06:10:54Z")

</div>

Hi all,

I want to set a variable(string) classname,  
i.e. var \_className:String= “level” +2;

So i wrote,  
var \_class:Class = getDefinitionByName(\_className) as Class;  
trace(\_class);

This code is written in .as file (as3).  
What can i do to call the class… ?  
Is this a right code i have written …?  
Please help me …  
:diss:  
-soha
