# Class name to string

**URL:** <https://forum.kirupa.com/t/class-name-to-string/283822>\
**Category:** flash\
**Created:** [March 11, 2009, 2:57pm UTC](https://forum.kirupa.com/t/class-name-to-string/283822 "2009-03-11T14:57:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alber\_Kidd](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@Alber\_Kidd](https://forum.kirupa.com/u/Alber_Kidd)\
**Post date:** [March 11, 2009, 2:57pm UTC](https://forum.kirupa.com/t/class-name-to-string/283822/1 "2009-03-11T14:57:06Z")

</div>

I have a loop which add my button to the stage. However I want to assign a name to the buttons which is the same as the class. I am trying to use the AS keyword with no luck.

Any ideas?

var movieList:Array = [AboutBut, WhatBut, OurWork, News, ContactUs];  
var tempClip:MovieClip;  
var tempClip:String;  
var yPos:int = 0;  
for (var i:uint=0;i\<movieList.length;i++) {  
yPos =yPos+ 55;  
tempClip = new movieList\*();  
_tempClip.name = movieList as String;_\*

```
    tempClip.y = yPos;
       menuHolder.addChild(tempClip);
```
