Richard Richard - 11 months ago 100
ActionScript Question

Actionscript 3 movie clip size with float

I'm wondering why flash does not support exact value of box sizing.

When I try to set dimensions of a box with "850.54" of width and "1624.71" of height,
The real box size's set to "850.50" of width and "1624.70" of height by automatically.

I lost my decimal points(float) value in my box.

What happened to me?

Answer Source

Width and height are internally measures in 1/20ths of a pixel, so reading width will return a value that's a multiple of 0.05. The solution is not to use width to store values with precision.