1 person found this helpful
It seems to have something to do with your line that is performing the Math.floor function on the calculation. When I comment that line out the increment works as expected. If I change it to Math.ceil it works as expected. However if you code it like this with Math.floor
var num:Number = 0;
this.onEnterFrame = function()
num += .01;
trace("before floor:" + num);
num = num*100;
trace("after multiply:" + num);
num = num/100;
trace("after floor:" + num);
It works as expected. Apparently there is something sneaky going on in the call to Math.foor(num*100) that proper mathematics does not like. It's interesting because I am sure I have done this in code before, but maybe I haven't.
Anyway just perform the floor command on a number after you have the final number you need floored.
It may just be a case of the imprecision in calculation, which isn't abnormal in Flash. Sometimes you need to round values to get better results...
num = Math.floor(Math.round(num*100))/100;