You cannot deep-clone a vector of DisplayObject
s of any kind, unless the objects' classes implement IExternalizable
. This is because deeply cloning a DisplayObject
requires cloning all its references including the entire children list and stage, and you cannot make another stage. Thus, you'd better create your "deep clone" by creating more instances of SlotClass
in the cycle and stuffing them into corresponding vectors.
for (var i:int = 1; i < typeAmount + 1; i++) {
SlotClass = Main.queue.getLoader('main_uiMC').getClass('slot0' + i) as Class;
slotMC = new SlotClass();
// slotMC.name = "slot" + i;
// drop name setting, you'd better use position in vector to refer to the clip
//push to vector before randomly add to stage
slotV1.push(slotMC);
slotMC = new SlotClass();
slotV2.push(slotMC);
slotMC = new SlotClass();
slotV3.push(slotMC);
}
Don't forget to initialize the vectors prior to running the cycle.
As a side point, yes it might be better to use a multidimensional vector, considering why do you need these several vectors.