I've added it to the stage however it's not following it and it needs to be added at the x and y position of the zombie. (using math.random)
Anyway I can set the x and y to that of the zombie and make it follow it?
public function iceZombieSpawn(e:TimerEvent) {
var health:Number = 100; // set zombies health to 100
iceZombie = new IceZombie(Math.random()*stage.stageWidth, -100); // Create new ice zombie at random x position (width, height, health, hitCount)
IceZombie.spawnCount += 1; // increment count by 1 for each spawn using global variable (IceZombie refering to class)
iceZombie.name = "iceZombie"+IceZombie.spawnCount; // assign name to zombie
iceZombieContainer.addChild(iceZombie); // Add zombie to container
trace(iceZombie.name); // trace name of zombie
trace(" Health: " + iceZombie.health); // trace current health
zombieHealth = new ZombieHealth(iceZombie.x, iceZombie.y); // create new health bar
iceZombieContainer.addChild(zombieHealth); // add health bar to container
}That's the spawning but the health bar won't appear, it works if I put in fixed coordinates.
Help

















