In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

code on 2009-1-7

Get Adobe Flash player
by kermit71 08 Jan 2009
    Embed
package {
	import flash.display.Sprite;
	import flash.events.Event;
	
	public class FirstAnimation extends Sprite {
		private var ball:Sprite;

		public function FirstAnimation() {
			init();
		}
		private function init():void {
			ball = new Sprite();
			addChild(ball);
			ball.graphics.beginFill(0xff6000);
			ball.graphics.drawCircle(0, 0, 40);
			ball.x = 20;
			ball.y = stage.stageHeight / 2;
			ball.addEventListener(Event.ENTER_FRAME, onEnterFrame);          
		}
		private function onEnterFrame(event:Event):void {
			move(2);
		}

		private function move(speed:Number):void {
			this.x += speed
		}
	}
}