# Dynamically mc instancing?

**URL:** <https://forum.kirupa.com/t/dynamically-mc-instancing/277135>\
**Category:** Uncategorized\
**Created:** [December 8, 2008, 12:22pm UTC](https://forum.kirupa.com/t/dynamically-mc-instancing/277135 "2008-12-08T12:22:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Noctophiler](https://avatars.discourse-cdn.com/v4/letter/n/4af34b/32.png) [@Noctophiler](https://forum.kirupa.com/u/Noctophiler)\
**Post date:** [December 8, 2008, 12:22pm UTC](https://forum.kirupa.com/t/dynamically-mc-instancing/277135/1 "2008-12-08T12:22:43Z")

</div>

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 &lt; 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
