Let's say I have an enemy MC attached.
Let's say I have a health bar MC attached.
I need the health bar to be able to follow the enemy MC. The solution I thought of is to "pass" the enemy MC to the health bar. How do I do that? I've thought of something like:
var mcEnemy = _root.attachMovie("enemyMC", blah....);
var mcHealthBar = _root.attachMovie("healthBarMC", blah....);
mcHealthBar.targetMC = mcEnemy;
There'd be a "targetMC" MovieClip variable inside HealthBar, and it'll just keep on retrieving the _x and _y values from it every frame. I traced targetMC._x from inside, but it's just undefined, so this didn't work.
How's the good, simple working way?