package {
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.events.Event;
	public class Group extends Sprite {
		public function Group() {
			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;
			circle.graphics.beginFill(0xFFFF00,100);
			circle.graphics.drawCircle(0,0,10);
			circle.graphics.endFill();
			circle.x = 0;
			circle.y = 0;
			addChild(circle);
			circle.x=150;
			circle.y=150;
			rect.graphics.beginFill(0x008000,100);
			rect.graphics.drawRect(0,0,50,20);
			rect.graphics.endFill();
			rect.x = 0;
			rect.y = 0;
			addChild(rect);
			rect.x=400;
			rect.y=400;
			addChild(circlesquare);
			circlesquare.addChild(circle);
			for (var k:int = 1;
			k < 23;
			k++){
				var s:Sprite = new Sprite();
				s.graphics.beginFill(0xA9A9A9,100);
				s.graphics.drawRect(0,0,7,7);
				s.graphics.endFill();
				s.x = 0;
				s.y = 0;
				addChild(s);
				var s2:Sprite = new Sprite();
				s2.graphics.beginFill(0xADD8E6,100);
				s2.graphics.drawRect(0,0,7,7);
				s2.graphics.endFill();
				s2.x = 0;
				s2.y = 0;
				addChild(s2);
				var a:Number = 0;
				a=k*.3;
				var cx:Number = 0;
				cx=Math.cos(a);
				var sy:Number = 0;
				sy=Math.sin(a);
				cx=cx*80;
				cx=cx+200;
				sy=sy*80;
				sy=sy+125;
				s.x=cx;
				s.y=sy;
				cx=cx-2;
				sy=sy-2;
				s2.x=cx;
				s2.y=sy;
				circlesquare.addChild(s);
				circlesquare.addChild(s2);
			}
			addEventListener(Event.ENTER_FRAME, animate);
		}
		public function animate(event:Event):void {
			inc=5;
			var x:Number = 0;
			x=circlesquare.x;
			var y:Number = 0;
			y=circlesquare.y;
			angle=angle+.1;
			var cx:Number = 0;
			cx=Math.cos(angle);
			cx=cx*100;
			var sy:Number = 0;
			sy=Math.sin(angle);
			sy=sy*100;
			circlesquare.x=cx;
			circlesquare.y=sy;
			x=rect.x;
			y=rect.y;
			angle2=angle2-.2;
			cx=Math.cos(angle2);
			cx=cx*50;
			cx=cx+200;
			sy=Math.sin(angle2);
			sy=sy*50;
			sy=sy+200;
			rect.x=cx;
			rect.y=sy;
			y=square.y;
			if (y>500) {
				y=-175;
			}
			y=y+inc;
			square.y=y;
		}
		public var square:Sprite = new Sprite();
		public var angle2:Number = 0;
		public var angle:Number = 0;
		public var inc:Number = 0;
		public var circle:Sprite = new Sprite();
		public var rect:Sprite = new Sprite();
		public var circlesquare:Sprite = new Sprite();
	}
}
