# When things go unexpectedly

**URL:** <https://forum.kirupa.com/t/when-things-go-unexpectedly/325760>\
**Category:** Uncategorized\
**Created:** [November 3, 2011, 5:22am UTC](https://forum.kirupa.com/t/when-things-go-unexpectedly/325760 "2011-11-03T05:22:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GarFonz](https://avatars.discourse-cdn.com/v4/letter/g/f04885/32.png) [@GarFonz](https://forum.kirupa.com/u/GarFonz)\
**Post date:** [November 3, 2011, 5:22am UTC](https://forum.kirupa.com/t/when-things-go-unexpectedly/325760/1 "2011-11-03T05:22:18Z")

</div>

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\>&nbsp; For example, I have a variable that works as a speed(distance over time). &nbsp;The variable is set when the class is instantiated. &nbsp;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. &nbsp; 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. &nbsp;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. &nbsp;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. &nbsp;\<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. &nbsp;If it isn’t, find the new difference, and substract the difference from speed, and then that will equal out. &nbsp;This work around is seemingly \_\_\_\_\_\_\_\_\_, &nbsp; I don’t understand it. &nbsp;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. &nbsp;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. &nbsp;\<br\>\<br\>Are there any suggestions/questions that could help me understand the best practices in order to proceed? &nbsp;
