Dynamic class names are neat
Attaching movieclips to the stage in AS3 is easy. But what if we need to attach a movieclip with dynamically created name?
var page:MovieClip = new ["page"+i]; // won't work :)
But this will:
[ftf w=”490″ h=”130″]
var dynamicClass:String = “page” + i;
var classRef:Class = getDefinitionByName(dynamicClass) as Class;
var page:MovieClip = new classRef();