# Strange behavior with small X increments

**URL:** <https://forum.kirupa.com/t/strange-behavior-with-small-x-increments/310807>\
**Category:** flash\
**Created:** [June 19, 2010, 10:38pm UTC](https://forum.kirupa.com/t/strange-behavior-with-small-x-increments/310807 "2010-06-19T22:38:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicolea](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@Nicolea](https://forum.kirupa.com/u/Nicolea)\
**Post date:** [June 19, 2010, 10:38pm UTC](https://forum.kirupa.com/t/strange-behavior-with-small-x-increments/310807/1 "2010-06-19T22:38:20Z")

</div>

Hi, i’m currently working on the GUI for a tower defense and i’ve created a list of sliding “tablets” that represent the incoming waves (like gem td, desktop tower defense etc) and i’ve encountered some seemingly erratic behavior. I created a small example that successfully displays this odd behavior.

Copy and paste this code into a new flash document

```auto

var array:Array = new Array();
array = [];
grr();
addEventListener(Event.ENTER_FRAME, update);

function grr(){
for(var i:int = 0; i < 10; i++){
    var box:MovieClip = new MovieClip();
    box.graphics.beginFill(0x000099);
    box.graphics.drawRect(0,0,35,10);
    box.graphics.endFill();
    if(i > 0){
        box.x = (100 + (box.width * i)) + 2 * i;
        box.y = 200;
    } else {
        box.x = 100;
        box.y = 200;
    }
    stage.addChild(box)
    array.push(box);
}
}

function update(e:Event) {
    for(var i:int = 0; i<array.length;i++){
        array*.x -= 0.05 // this number causes strange behavior... as do some others
    }
}

```

The squares seem to move at different speeds at different times, depending on what number you use to increment the X value of the squares, and it only seems to be for very small decimals. I am at a loss as to why this would happen, if someone could please explain it to me, and possibly a way to fix it. thanks 😏
