So I'm having a problem with variables.
I have two classes, lets call them Enemy and Enemy_Basic. Enemy_Basic extends Enemy.
Now, in the class Enemy there are two variables:
protected var Health:int;
protected var Speed:Number;
Simple enough. Now, if I go to Enemy_Basic's constructor:
Health = 100;
Speed = 5;
trace (Health);
trace (Speed);
They both trace correctly, 100 and 5 respectively. The problem comes in on another function (a function inside Enemy_Basic that overrides one of Enemy's functions):
public override function Update():void {
trace (Health);
trace (Speed);
}
Here I, Health is traced correctly while Speed comes out as NaN. Thing is, if I make Speed an int rather than a number it all works perfectly.
I have no idea.. why would the variable type mess this up? Help?