When things go unexpectedly

I have been working with Actionscript 3.0 on and off since 2008, and during those times, I have found that there are quirks/bugs/unexpected things that happen in Flash Professional that require a more complex/unexpected script-bandage/-“duct tape”.<br><br>  For example, I have a variable that works as a speed(distance over time).  The variable is set when the class is instantiated.  The speed is set to an .x value of the child of a Sprite, increasing and decreasing the .x value dependent on whether the mouse is moving mostly to the right or left.   Consistently, when I move the mouse to the right, and then to the left, the difference between the previous container.x and the current container.x increases by ~0.05.  tracing out the speed variable doesn’t show a change in the variable’s value, but the difference between the previous container.x and the current contain.x is not equal to the speed.  This reminds me of the alpha property math, where choosing the range of numbers to cycle/iterate through becomes a tasks involving changing to the values that the Flash Player/AIR file require in order to move efficiently/precisely in the changes of displaying a symbol on the stage.  <br><br>For the fix above, I added a conditional that checks to see whether or not the difference from the container.x value from its previous value is equal to speed.  If it isn’t, find the new difference, and substract the difference from speed, and then that will equal out.  This work around is seemingly _________,   I don’t understand it.  When the only variable that is used as a number to add/subtract the value of container.x stays the same, yet the results are not showing as such, its seems that the file is corrupted.  Granted, starting over with a new file that requires 7-10 classes totaling ~2,000 lines of code or more, I’m not excited about that.  <br><br>Are there any suggestions/questions that could help me understand the best practices in order to proceed?