Help!! Setting "body" for enemy in shooter!!
I tried some code for my enemyShooter's hitTest and it worked.
if (_root.enemyShooter.body.hitTest(_root.ship.body)) {...}
(enemyShooter is the instance name of movieclip)
However, this doesn't work.
var name = _name
if (_root.name.body.hitTest(_root.ship.body)) {...}
The reason I am doing this is because there are many enemies like enemyShip1, enemyShip2, enemyShip3.
The name if it is set by
"EnemyShip" + _root.getNextHighestDepth()
because I use
_root.attachMovie("EnemyShip", "EnemyShip" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
I cannot find the instance name unless using _name
How can I make it work?
