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);