Frame 1
function AddStar() {
var _loc1 = universe_mc.attachMovie("star", "star_" + i, i);
i++;
_loc1._x = Math.random() * Stage.width;
_loc1._y = Math.random() * Stage.height;
_loc1._alpha = 0;
var _loc3 = (_loc1._x - (Stage.width / 2));
var _loc2 = (_loc1._y - (Stage.height / 2));
var _loc4 = Math.sqrt((_loc3 * _loc3) + (_loc2 * _loc2));
var _loc5 = Math.atan2(_loc2, _loc3);
_loc1._xVel = initVel * Math.cos(_loc5);
_loc1._yVel = initVel * Math.sin(_loc5);
_loc1._xscale = (maxOffset - _loc4) / 7;
_loc1._yscale = (maxOffset - _loc4) / 7;
_loc1.onEnterFrame = FlyingStar;
}
function FlyingStar() {
this._x = this._x + this._xVel;
this._y = this._y + this._yVel;
this._xVel = this._xVel * accel;
this._yVel = this._yVel * accel;
if (this._alpha >= 100) {
this._alpha = 100;
} else {
this._alpha = this._alpha + alphaChange;
}
if ((((this._x < (-this._width)) || (this._x > (Stage.width + this._width))) || (this._y < (-this._height))) || (this._y > (Stage.height + this._height))) {
this.removeMovieClip();
}
}
this.createEmptyMovieClip("universe_mc", 10);
var initVel = 7;
var accel = 1.10000002384186;
var alphaChange = 10;
var myInterval = setInterval(AddStar, 10);
var maxOffset = Math.sqrt(Math.pow(Stage.width / 2, 2) + Math.pow(Stage.height / 2, 2));
var i = 0;