Duplicate movieclip you dynamically made


gidday

 

i have class has above constructor...

 

public var mc:movieclip = new movieclip();

 

... , later fucntion gives graphics etc

 

in function later on, want make duplicates of 'mc' different names, getting error:

 

1046: type not found or not compile-time constant: mc.

 

var copies:int = 10;

                var y:int = 0;

               

                for(var i:int = 0; < copies; i++)

                {

                    var clone:mc = new mc(); //  <<<<   error occurs here

                    clone.name = 'clip' + i

                    clone.x = 0;

                    clone.y = y+10;

                    addchild(clone);

                }

 

why var clone not recognise mc?

 

i guess question - how make copies of dynamically created movieclip (as opposed 1 linked ide library in flash pro)?

 

cheers guys

to create jusat yiou did in first place... create moveclip instance , fill same content that  filled first 1 with.  

 

while trying treat "mc" class,  "mc" not class, movieclip instance.



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

Internal Server Errors - Joomla! Forum - community, help and support

CS6でファイルが開けません

Scrollability in divs or text boxes