# Sprite appearing in wrong position for 1 frame

**URL:** <https://forum.kirupa.com/t/sprite-appearing-in-wrong-position-for-1-frame/248706>\
**Category:** flash\
**Created:** [January 10, 2008, 11:37pm UTC](https://forum.kirupa.com/t/sprite-appearing-in-wrong-position-for-1-frame/248706 "2008-01-10T23:37:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sargeonline](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@sargeonline](https://forum.kirupa.com/u/sargeonline)\
**Post date:** [January 10, 2008, 11:37pm UTC](https://forum.kirupa.com/t/sprite-appearing-in-wrong-position-for-1-frame/248706/1 "2008-01-10T23:37:44Z")

</div>

Hey I’m just going through the Friends of Ed book, Actionscript 3.0 Animation and just noticed in some of their examples that the ball sprite is appearing the wrong spot, at position 0,0 on the stage for a second, probably 1 frame. I’m just wondering if there was a way to make it go to the position specified straight away, instead of after 1 frame or so.

Here’s a sample 2 classes of what I’m using.

Ball Class:

```auto
package {
    
    import flash.display.Sprite;
    
    public class Ball extends Sprite {
        
        private var radius:Number;
        private var color:uint;
        
        public function Ball(radius:Number=40,color:uint=0xff0000) {
            this.radius=radius;
            this.color=color;
            init();
        }
        
        public function init():void {
            graphics.beginFill(color);
            graphics.drawCircle(0,0,radius);
            graphics.endFill();
        }
        
    }
}

```

Circle Class:

```auto
package {
    
    import flash.display.Sprite;
    import flash.events.Event;
    
    public class Circle extends Sprite {
        
        private var ball:Ball;
        private var angle:Number=0;
        private var centerX:Number=200;
        private var centerY:Number=200;
        private var radius:Number=50;
        private var speed:Number=.1;
        
        public function Circle() {
            init();
        }
        
        private function init():void {
            ball = new Ball();
            addChild(ball);
            ball.x=0;
            addEventListener(Event.ENTER_FRAME,onEnterFrame);
        }
        
        public function onEnterFrame(event:Event):void {
            ball.x=centerX+Math.sin(angle)*radius;
            ball.y=centerY+Math.cos(angle)*radius;
            angle+=speed;
        }
        
    }
}

```

Thanks in advance!

Edit: Sorry realised I’ve posted this on the wrong forum. Meant to be in actionscript 3.0.
