Oki. I’ve found something I haven’t noticed before but it seems like sometimes Flash totally screws up the decimals when assigning calculated numbers with decimals to the movieclips position properties. Well at least it goeas for the _y property.
Amongst others I got this function that moves the movieclip about:
function setAnimState(current:Object, changes:Object)
{
this._x = current._x;
trace("before:" + this._y)
trace("current:" + current._y);
trace("changes:" + changes._y);
this._y = current._y;
trace("after:" + this._y)
}
Now theese traces reaveals something quite interesting.
Here take a look at one of the traces:
before:100
current:100.081721378015
changes:0.0817213780150468
after:100.05
Notice the value “after”? It’s 100.05(!!) but it should at least be 100.08 or rounded to 100.1. Nowhere near 100.05. Oki I’m not a mathwizard but I do know as much as that the rounding is way of base.
If I hardcode the current._y value (100.081721378015) i get 100.1 as the position of the movieclip.
So my question is: How can Flash round my calculated values so incorrect? Is there some inner workings on the positioning of movieclips that I should know about? And, most importantly, what do I do to fix it?
/Mirandir