# AS2 Solar System

**URL:** <https://forum.kirupa.com/t/as2-solar-system/212932>\
**Category:** open source\
**Created:** [January 15, 2007, 8:55pm UTC](https://forum.kirupa.com/t/as2-solar-system/212932 "2007-01-15T20:55:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sammo](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/sammo/32/779_2.png) [@Sammo](https://forum.kirupa.com/u/Sammo)\
**Post date:** [January 15, 2007, 8:55pm UTC](https://forum.kirupa.com/t/as2-solar-system/212932/1 "2007-01-15T20:55:01Z")

</div>

It’s been done before, but what the hell.

> **[systemhy7.swf - Click to see more photos](http://imageshack.com/f/4vsystemhy7s)**
>
> Store and share all of your images @ IMAGESHACK.com

So we can’t upload .swf or .as now? What going on?!

The class is SolarNode.as:

```auto
class SolarNode extends MovieClip {
	var parent:MovieClip;
	var angle:Number;
	var from:Number;
	var speed:Number;
	
	function SolarNode() {
		angle = Math.round(Math.random()*360);
		parent = _root.sun;
	}
	
	function set options(opt:Object):Void {
		if (opt.parent) parent = opt.parent;
		from = opt.from / 2.5;
		speed = 1 / opt.speed * 10;
		_xscale = _yscale = opt.scale / 2;
	}
	function onEnterFrame():Void {
		_x = Math.cos(angle * Math.PI / 180) * from + parent._x;
		_y = Math.sin(angle * Math.PI / 180) * from + parent._y;
		angle += speed;
		if (angle > 359) angle -= 360;
	}
	
	function onRollOver():Void {
		_root.planet_txt.text = _name;
	}
	
	function prepSun(scale:Number):Void {
		_x = Stage.width / 2;
		_y = Stage.height / 2;
		_xscale = _yscale = scale;
	}
}

```

You need a big screen to fit some of the outer planets in. And yeah, the Sun is a tad small. 🙂
