Hi guys,
I´m new to these forums and I could use a little help with the following problem:
I have got a number of movieclips in my library named cover0, cover1, … , cover10.
Now I want to instance them dynamically via actionscript.
Coverflow.as:
var coverNumber:int=11;
for (var i:int = 0; i < coverNumber; i++) {
coverArray* = new Cover(i);
coverBG.addChild(coverArray*);
}
Cover.as:
public function Cover(coverNumber:int):void {
var coverMC:MovieClip = new MovieClip();
var mcName:String = "cover" + coverNumber;
coverMC = new [mcName]();
addChild(coverMC);
}
if I try to compile I get
TypeError: Error #1007: Instantiation attempted on a non-constructor
at Cover()
at Coverflow()
please help
kind regards,
noctophiler