Hi, basically I want my engine to display one out of three objects at random.
I thought I had figured it out but apparently not. A familiar error message appears, “A term is undefined and has no properties”. I’m sure it refers to the object I’m trying to spawn, however it rejects every object I refer to.
Is my approach reasonable or should I scarp what I’ve got?
var spawnObject:Array = new Array("Object1", "Object2", "Object3");
var randomNumber:Number = Math.round(Math.random() * (spawnObject.length - 1));
if(spawnObject[randomNumber] == "Object1")
{
var newMC:MovieClip = new Object1();
}
Thanks in advance