how about
_root.hp -= 20; it will take off the specific amount (say 20) and everything there. If you want it to take off a rage try something like so:
CODE
onClipEvent(enterFrame){
if(_root.char.hitTest(this)){
var max_damamge:Number = 20;
var min_damage:Number = 15;
var damage:Number = (Math.rand()*(max_damage-min_damage))+min_damage;
_root.hp -= damage;
}
}
Where max damage is a number of the max amount of damage the enemy can do, and min damage is the min amount of damage that an account can do.
REALIZE - at this point this range includes decimals down quite far. As such your character can have a fraction of a hit pioint remaining.
If you want to make this whole numbers you could wrap the damage alculations in a
Math.floor or
Math.ciel to round up or down to the nearest integer.
Hope that helps.