It’s been done before, but what the hell.
So we can’t upload .swf or .as now? What going on?!
The class is SolarNode.as:
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.