PDA

View Full Version : Enemy[num] = new Object; and attaching MC to that?


Hofmann
05-14-2004, 08:30 AM
Hi, im trying to attach a MC to a OBJECT in an ARRAY ive created like this:

Enemies = new Array(NumEnemies);

For (i=0;i<NumEnemies;i++){

Enemies[i] = new Object;


Enemies[i].obj = ????? <----attach the "ship" MC from the library

The .obj is what i WANT and HOPE to be the MC of the enemy, but im
running into problems with the INSTANCE... I dont care what the instance name is as long as I can referre to the enemy ship image by Enemies[num].obj... Is this even possible or how can I work around it?

Its important to me to keep my setup of arrays and stuff cause of a little flash game...

Hofmann
05-14-2004, 08:57 AM
Never mind, it was just me being stupid....

Enemies[i].obj = _root.ship.duplicateMovieClip("obj"+i, i)


worked :)



So far ;)