package {
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.events.Event;
	public class Test4 extends Sprite {
		public function Test4() {
			square.graphics.beginFill(0xFF0000,100);
			square.graphics.drawRect(0,0,50,50);
			square.graphics.endFill();
			square.x = 0;
			square.y = 0;
			addChild(square);
			square.x=350;
			square.y=250;
			addEventListener(Event.ENTER_FRAME, animate);
		}
		public function animate(event:Event):void {
			var inc:Number = 0;
			inc=5;
			var y:Number = 0;
			y=square.y;
			if (y>500) {
				y=-175;
			}
			y=y+inc;
			square.y=y;
		}
		public var square:Sprite = new Sprite();
	}
}
