Section 1
//MainTimeline (space_fly_fla.MainTimeline)
package space_fly_fla {
import flash.display.*;
import src.*;
import flash.net.*;
public dynamic class MainTimeline extends MovieClip {
public var game_mc:SpaceRider;
public var background_mc:MovieClip;
public var myIngameAd:MovieClip;
public var myLoader:Loader;
public var url:URLRequest;
public function MainTimeline(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
myLoader = new Loader();
url = new URLRequest("http://cdn.ad4game.com/300x250.swf?zoneid=46514");
myLoader.load(url);
myIngameAd.addChild(myLoader);
}
}
}//package space_fly_fla
Section 2
//plays_11 (space_fly_fla.plays_11)
package space_fly_fla {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public dynamic class plays_11 extends MovieClip {
public var btn:MovieClip;
public function plays_11(){
addFrameScript(24, frame25);
}
public function start_game(_arg1:MouseEvent){
MovieClip(root).gotoAndStop(2);
}
public function openUrl(_arg1:MouseEvent){
var _local2:URLRequest = new URLRequest("http://kids.quicksave.su/");
navigateToURL(_local2, "_blank");
}
public function btnOver(_arg1:MouseEvent){
btn.x = -10;
btn.y = -5;
btn.scaleX = 1.1;
btn.scaleY = 1.1;
}
public function btnOut(_arg1:MouseEvent){
btn.x = 0;
btn.y = 0;
btn.scaleX = 1;
btn.scaleY = 1;
}
function frame25(){
stop();
btn.addEventListener(MouseEvent.ROLL_OVER, btnOver);
btn.addEventListener(MouseEvent.ROLL_OUT, btnOut);
btn.addEventListener(MouseEvent.CLICK, start_game);
}
}
}//package space_fly_fla
Section 3
//prev_6 (space_fly_fla.prev_6)
package space_fly_fla {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class prev_6 extends MovieClip {
public var loads:MovieClip;
public function prev_6(){
addFrameScript(0, frame1);
}
public function loading(){
loads.bar.mask.x = (loads.bar.mask.x + 1);
if (loads.bar.mask.x < 0){
setTimeout(loading, 10);
} else {
gotoAndStop(2);
};
}
public function randRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number = (Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1);
return (_local3);
}
function frame1(){
stop();
loading();
}
}
}//package space_fly_fla
Section 4
//rocket_22 (space_fly_fla.rocket_22)
package space_fly_fla {
import flash.display.*;
public dynamic class rocket_22 extends MovieClip {
public var point19_mc:MovieClip;
public var point3_mc:MovieClip;
public var point0_mc:MovieClip;
public var point18_mc:MovieClip;
public var point1_mc:MovieClip;
public var point6_mc:MovieClip;
public var point7_mc:MovieClip;
public var point15_mc:MovieClip;
public var point4_mc:MovieClip;
public var point5_mc:MovieClip;
public var point14_mc:MovieClip;
public var point17_mc:MovieClip;
public var point16_mc:MovieClip;
public var point11_mc:MovieClip;
public var point8_mc:MovieClip;
public var point10_mc:MovieClip;
public var point9_mc:MovieClip;
public var point20_mc:MovieClip;
public var point13_mc:MovieClip;
public var point12_mc:MovieClip;
public var point2_mc:MovieClip;
public function rocket_22(){
addFrameScript(0, frame1, 9, frame10);
}
function frame1(){
stop();
}
function frame10(){
stop();
}
}
}//package space_fly_fla
Section 5
//Symbol1_32 (space_fly_fla.Symbol1_32)
package space_fly_fla {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public dynamic class Symbol1_32 extends MovieClip {
public function Symbol1_32(){
addFrameScript(0, frame1);
}
public function pressed(_arg1:MouseEvent):void{
var _local2 = "http://www.gamezastar.com";
var _local3:URLRequest = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
function frame1(){
addEventListener(MouseEvent.CLICK, pressed);
}
}
}//package space_fly_fla
Section 6
//Timeline_66 (Spacerover_fla.Timeline_66)
package Spacerover_fla {
import flash.display.*;
public dynamic class Timeline_66 extends MovieClip {
public var gaxfire:MovieClip;
}
}//package Spacerover_fla
Section 7
//Timeline_68 (Spacerover_fla.Timeline_68)
package Spacerover_fla {
import flash.display.*;
public dynamic class Timeline_68 extends MovieClip {
}
}//package Spacerover_fla
Section 8
//Timeline_69 (Spacerover_fla.Timeline_69)
package Spacerover_fla {
import flash.display.*;
public dynamic class Timeline_69 extends MovieClip {
}
}//package Spacerover_fla
Section 9
//SpaceRider (src.SpaceRider)
package src {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.geom.*;
public class SpaceRider extends MovieClip {
public var background_mc:MovieClip;
public var score_txt:TextField;
public var rocket_mc:MovieClip;
public var gameOver_mc:MovieClip;
public var level_mc:MovieClip;
public var starfield_mc:MovieClip;
public var splash_mc:MovieClip;
private var localHighScore:SharedObject;
private var gameWidth:Number;
private var gameHeight:Number;
private var acceleration:Number;// = 0
private var power:Number;// = 0
private var gravity:Number;// = 1
private var scrollSpeed:Number;// = 12
private var smokeTotal:int;// = 0
private var highscore:Number;// = 0
private var bestScore:Number;
private var i:uint;
private var isPower:Boolean;// = false
private var sChannel:SoundChannel;
private var powerSound;
public function SpaceRider():void{
powerSound = new PowerSound();
super();
localHighScore = SharedObject.getLocal("SpaceRiderGame");
if (localHighScore.data.bestScore){
bestScore = localHighScore.data.bestScore;
} else {
bestScore = 0;
};
gameWidth = background_mc.width;
gameHeight = background_mc.height;
sChannel = new SoundChannel();
stage.addEventListener(KeyboardEvent.KEY_DOWN, startGame);
initStarfield();
}
private function startGame(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 32){
splash_mc.alpha = 0;
stage.removeEventListener(KeyboardEvent.KEY_DOWN, startGame);
stage.addEventListener(KeyboardEvent.KEY_DOWN, powerOn);
stage.addEventListener(KeyboardEvent.KEY_UP, powerOff);
stage.addEventListener(Event.ENTER_FRAME, loop);
initLevel();
};
}
private function loop(_arg1:Event):void{
physics();
renderLevel();
highscore++;
score_txt.text = (highscore + " m");
renderSmoke();
renderStarfield();
}
private function powerOn(_arg1:KeyboardEvent):void{
if ((((_arg1.keyCode == 32)) && (!(isPower)))){
isPower = true;
sChannel = powerSound.play(0, 999, null);
power = -2;
};
}
private function powerOff(_arg1:KeyboardEvent):void{
isPower = false;
sChannel.stop();
power = 0;
}
private function initLevel():void{
var _local1:*;
var _local2:*;
i = 0;
while (i < 3) {
_local1 = new Tile();
_local2 = _local1.totalFrames;
if (i != 0){
_local1.gotoAndStop(Math.floor(((Math.random() * (_local2 - 1)) + 2)));
};
_local1.x = (i * gameWidth);
_local1.name = (("tile" + i) + "_mc");
level_mc.addChild(_local1);
i++;
};
}
private function renderLevel():void{
var _local1:*;
var _local2:*;
i = 0;
while (i < 3) {
_local1 = level_mc.getChildByName((("tile" + i) + "_mc"));
_local2 = _local1.totalFrames;
if (_local1.x > -(gameWidth)){
_local1.x = (_local1.x - scrollSpeed);
} else {
_local1.gotoAndStop(Math.floor(((Math.random() * (_local2 - 1)) + 2)));
if (i == 0){
_local1.x = (((level_mc.getChildByName("tile2_mc").x + gameWidth) - 1) - scrollSpeed);
} else {
if (i == 1){
_local1.x = (((level_mc.getChildByName("tile0_mc").x + gameWidth) - 1) - scrollSpeed);
} else {
_local1.x = (((level_mc.getChildByName("tile1_mc").x + gameWidth) - 1) - scrollSpeed);
};
};
};
i++;
};
}
private function physics(){
var _local1:*;
var _local2:*;
acceleration = ((acceleration + gravity) + power);
rocket_mc.y = (rocket_mc.y + acceleration);
rocket_mc.rotation = (((180 * Math.atan((acceleration / scrollSpeed))) / Math.PI) / 2);
i = 0;
while (i < 20) {
_local1 = rocket_mc.getChildByName((("point" + i) + "_mc"));
_local2 = new Point(_local1.x, _local1.y);
_local2 = rocket_mc.localToGlobal(_local2);
if (level_mc.hitTestPoint(_local2.x, _local2.y, true)){
gameOver();
};
i++;
};
}
private function renderSmoke():void{
var _local1:*;
if (smokeTotal < 10){
_local1 = new Smoke();
_local1.y = (rocket_mc.y - (50 * Math.sin(((rocket_mc.rotation / 360) * (2 * Math.PI)))));
_local1.x = (rocket_mc.x - (50 * Math.cos(((rocket_mc.rotation / 360) * (2 * Math.PI)))));
_local1.alpha = ((Math.random() * 0.2) + 0.5);
_local1.scaleY = (_local1.scaleY = ((Math.random() * 0.5) + 0.5));
_local1.rotation = (Math.random() * 360);
_local1.name = (("smoke" + smokeTotal) + "_mc");
level_mc.addChild(_local1);
smokeTotal++;
};
i = 0;
while (i < smokeTotal) {
_local1 = level_mc.getChildByName((("smoke" + i) + "_mc"));
if (_local1.x > -20){
_local1.x = (_local1.x - scrollSpeed);
_local1.alpha = (_local1.alpha * 0.75);
} else {
_local1.y = (rocket_mc.y - (50 * Math.sin(((rocket_mc.rotation / 360) * (2 * Math.PI)))));
_local1.x = (rocket_mc.x - (50 * Math.cos(((rocket_mc.rotation / 360) * (2 * Math.PI)))));
_local1.alpha = ((Math.random() * 0.2) + 0.5);
_local1.scaleX = (_local1.scaleY = ((Math.random() * 0.5) + 0.5));
_local1.rotation = (Math.random() * 360);
};
i++;
};
}
private function initStarfield():void{
var _local1:*;
var _local2:*;
i = 0;
while (i < 50) {
_local1 = new Star();
_local2 = ((Math.random() * 0.5) + 0.5);
_local1.y = (Math.random() * gameHeight);
_local1.x = (Math.random() * gameWidth);
_local1.alpha = _local2;
_local1.scaleY = (_local1.scaleX = _local2);
_local1.name = (("star" + i) + "_mc");
starfield_mc.addChild(_local1);
i++;
};
}
private function renderStarfield():void{
var _local1:*;
i = 0;
while (i < 50) {
_local1 = starfield_mc.getChildByName((("star" + i) + "_mc"));
if (_local1.x > -5){
_local1.x = (_local1.x - (scrollSpeed * _local1.scaleX));
} else {
_local1.y = (Math.random() * gameHeight);
_local1.x = (gameWidth + 10);
};
i++;
};
}
private function gameOver():void{
stage.removeEventListener(KeyboardEvent.KEY_DOWN, powerOn);
stage.removeEventListener(KeyboardEvent.KEY_UP, powerOff);
stage.removeEventListener(Event.ENTER_FRAME, loop);
rocket_mc.play();
sChannel.stop();
score_txt.alpha = 0;
level_mc.alpha = 0;
gameOver_mc.alpha = 1;
gameOver_mc.neu_btn.addEventListener(MouseEvent.CLICK, restartGame);
if (bestScore < highscore){
gameOver_mc.message_txt.htmlText = (("You beat the record: " + highscore) + " m");
bestScore = highscore;
localHighScore.data.bestScore = highscore;
localHighScore.flush();
} else {
gameOver_mc.message_txt.htmlText = (((("No new record only " + highscore) + " m <br> Best: ") + bestScore) + " m");
};
}
private function restartGame(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
rocket_mc.gotoAndStop(1);
rocket_mc.y = 120;
rocket_mc.rotation = 0;
score_txt.alpha = 1;
highscore = 0;
level_mc.x = 0;
level_mc.alpha = 1;
gameOver_mc.alpha = 0;
i = 0;
while (i < 3) {
_local2 = level_mc.getChildByName((("tile" + i) + "_mc"));
level_mc.removeChild(_local2);
i++;
};
initLevel();
i = 0;
while (i < 10) {
_local3 = level_mc.getChildByName((("smoke" + i) + "_mc"));
level_mc.removeChild(_local3);
i++;
};
power = 0;
acceleration = 0;
isPower = false;
smokeTotal = 0;
gameOver_mc.neu_btn.removeEventListener(MouseEvent.CLICK, restartGame);
stage.addEventListener(Event.ENTER_FRAME, loop);
stage.addEventListener(KeyboardEvent.KEY_DOWN, powerOn);
stage.addEventListener(KeyboardEvent.KEY_UP, powerOff);
}
}
}//package src
Section 10
//CrateBmp (CrateBmp)
package {
import flash.display.*;
public dynamic class CrateBmp extends BitmapData {
public function CrateBmp(_arg1:int=127, _arg2:int=121){
super(_arg1, _arg2);
}
}
}//package
Section 11
//fang (fang)
package {
import flash.display.*;
public dynamic class fang extends MovieClip {
}
}//package
Section 12
//PowerSound (PowerSound)
package {
import flash.media.*;
public dynamic class PowerSound extends Sound {
}
}//package
Section 13
//RockBoxSprite40x40 (RockBoxSprite40x40)
package {
import flash.display.*;
public dynamic class RockBoxSprite40x40 extends MovieClip {
}
}//package
Section 14
//Smoke (Smoke)
package {
import flash.display.*;
public dynamic class Smoke extends MovieClip {
}
}//package
Section 15
//Star (Star)
package {
import flash.display.*;
public dynamic class Star extends MovieClip {
}
}//package
Section 16
//Tile (Tile)
package {
import flash.display.*;
public dynamic class Tile extends MovieClip {
public function Tile(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 17
//w1_icon (w1_icon)
package {
import flash.display.*;
public dynamic class w1_icon extends MovieClip {
}
}//package