# Weird movement that is supposed to be the same

**URL:** <https://forum.kirupa.com/t/weird-movement-that-is-supposed-to-be-the-same/311657>\
**Category:** flash\
**Created:** [July 13, 2010, 4:25pm UTC](https://forum.kirupa.com/t/weird-movement-that-is-supposed-to-be-the-same/311657 "2010-07-13T16:25:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kreender](https://avatars.discourse-cdn.com/v4/letter/k/f19dbf/32.png) [@Kreender](https://forum.kirupa.com/u/Kreender)\
**Post date:** [July 13, 2010, 4:25pm UTC](https://forum.kirupa.com/t/weird-movement-that-is-supposed-to-be-the-same/311657/1 "2010-07-13T16:25:08Z")

</div>

Hi all

I have this perfect ball (50 radius) and I was using a Sprite for collision detection, the thing is that I realized that even when I try to move them equally the ball and the sprite for collisions move differently, but, it should be the same movement and I have no idea why, here is the code:

```auto

package  
{
    import flash.display.MovieClip;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.display.Bitmap;

    public class Pruebas extends Sprite{
        
        [Embed(source = "data/BBall.png")]
        public var BBall:Class;
        
        public var Wheel:Sprite;
        public var collisionShadow:Sprite = new Sprite();        
        public var movX:Number = 0.5735764363510465;
        public var movY:Number = -0.8191520442889915;
        
        public function Pruebas():void{
            if (stage) init();
            else addEventListener(Event.ADDED_TO_STAGE, init)
        }        
        
        private function init(e:Event = null):void {
            removeEventListener(Event.ADDED_TO_STAGE, init);
            trace("program start");
            Wheel = new Sprite();
            Wheel.addChild(new BBall as Bitmap);
            (Wheel.getChildAt(0) as Bitmap).x = -50;
            (Wheel.getChildAt(0) as Bitmap).y = -50;
            Wheel.x = 200;
            Wheel.y = 400;
            
            collisionShadow.graphics.lineStyle(1, 0x0000FF, 1);
            collisionShadow.graphics.beginFill(0x0000FF, 0.01);
            collisionShadow.graphics.drawCircle(Wheel.x, Wheel.y, 50);
            collisionShadow.graphics.endFill();                        
            
            addChild(Wheel);
            addChild(collisionShadow);
            
            stage.addEventListener(Event.ENTER_FRAME, mainLoop)
        }
        
        public function mainLoop(event:Event):void {            
            Wheel.x += movX;
            Wheel.y += movY;
            
            collisionShadow.x += movX;
            collisionShadow.y += movY;
        }        
    }
}

```

In the attachment is the Flashdevelop Project. Thanks for reading, I hope somebody can help.
