Section 1
//AI10_353 (Crashing_fla.AI10_353)
package Crashing_fla {
import flash.display.*;
public dynamic class AI10_353 extends MovieClip {
public var inside:MovieClip;
public function AI10_353(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Crashing_fla
Section 2
//AI113_567 (Crashing_fla.AI113_567)
package Crashing_fla {
import flash.display.*;
public dynamic class AI113_567 extends MovieClip {
public function AI113_567(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
if (myvar.enemy_hit){
myvar.enemy_hit = false;
if (MovieClip(this.parent)){
this.parent.removeChild(this);
};
};
myvar.enemy_hit = false;
}
}
}//package Crashing_fla
Section 3
//AI44_403 (Crashing_fla.AI44_403)
package Crashing_fla {
import flash.display.*;
public dynamic class AI44_403 extends MovieClip {
public function AI44_403(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
if (myvar.enemy_hit){
myvar.enemy_hit = false;
if (MovieClip(this.parent)){
MovieClip(this.parent).removeChild(this);
};
};
myvar.enemy_hit = false;
}
function frame1(){
stop();
}
}
}//package Crashing_fla
Section 4
//AI45_452 (Crashing_fla.AI45_452)
package Crashing_fla {
import flash.display.*;
public dynamic class AI45_452 extends MovieClip {
public function AI45_452(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
if (myvar.enemy_hit){
myvar.enemy_hit = false;
if (MovieClip(this.parent)){
MovieClip(this.parent).removeChild(this);
};
};
myvar.enemy_hit = false;
}
function frame1(){
stop();
}
}
}//package Crashing_fla
Section 5
//AI62_354 (Crashing_fla.AI62_354)
package Crashing_fla {
import flash.display.*;
public dynamic class AI62_354 extends MovieClip {
public function AI62_354(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
if (myvar.enemy_hit){
myvar.enemy_hit = false;
if (MovieClip(this.parent)){
MovieClip(this.parent).removeChild(this);
};
};
myvar.enemy_hit = false;
}
function frame1(){
stop();
}
}
}//package Crashing_fla
Section 6
//AI79_470 (Crashing_fla.AI79_470)
package Crashing_fla {
import flash.display.*;
public dynamic class AI79_470 extends MovieClip {
public function AI79_470(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
if (myvar.enemy_hit){
myvar.enemy_hit = false;
if (MovieClip(this.parent)){
this.parent.removeChild(this);
};
};
myvar.enemy_hit = false;
}
}
}//package Crashing_fla
Section 7
//AI96_519 (Crashing_fla.AI96_519)
package Crashing_fla {
import flash.display.*;
public dynamic class AI96_519 extends MovieClip {
public function AI96_519(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
if (myvar.enemy_hit){
myvar.enemy_hit = false;
if (MovieClip(this.parent)){
this.parent.removeChild(this);
};
};
myvar.enemy_hit = false;
}
}
}//package Crashing_fla
Section 8
//CAR14_323 (Crashing_fla.CAR14_323)
package Crashing_fla {
import flash.display.*;
public dynamic class CAR14_323 extends MovieClip {
public var tyres:MovieClip;
public function CAR14_323(){
addFrameScript(0, frame1, 6, frame7);
}
function frame7(){
stop();
}
function frame1(){
stop();
}
}
}//package Crashing_fla
Section 9
//CAR22_326 (Crashing_fla.CAR22_326)
package Crashing_fla {
import flash.display.*;
public dynamic class CAR22_326 extends MovieClip {
public var tyre1:MovieClip;
public var tyre2:MovieClip;
}
}//package Crashing_fla
Section 10
//CAR31_336 (Crashing_fla.CAR31_336)
package Crashing_fla {
import flash.display.*;
public dynamic class CAR31_336 extends MovieClip {
public var tyres:MovieClip;
public function CAR31_336(){
addFrameScript(0, frame1, 6, frame7);
}
function frame7(){
stop();
MovieClip(this.parent).gotoAndStop(1);
}
function frame1(){
stop();
}
}
}//package Crashing_fla
Section 11
//CAR7_328 (Crashing_fla.CAR7_328)
package Crashing_fla {
import flash.display.*;
public dynamic class CAR7_328 extends MovieClip {
public var r2_tyre:MovieClip;
public var r1_tyre:MovieClip;
}
}//package Crashing_fla
Section 12
//Distance_245 (Crashing_fla.Distance_245)
package Crashing_fla {
import flash.display.*;
public dynamic class Distance_245 extends MovieClip {
public var car:MovieClip;
}
}//package Crashing_fla
Section 13
//GAME_END5_302 (Crashing_fla.GAME_END5_302)
package Crashing_fla {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class GAME_END5_302 extends MovieClip {
public var moreGames:SimpleButton;
public function GAME_END5_302(){
addFrameScript(0, frame1, 1, frame2);
}
public function goto_chase(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.123chase.com"), "_blank");
}
function frame1(){
stop();
myvar.gamescore = 0;
myvar.levelscore = 0;
myvar.obs_hit = false;
myvar.levels = 1;
myvar.enemy_hit = false;
myvar.congrats = false;
myvar.damage = 50;
moreGames.addEventListener(MouseEvent.CLICK, gotopeppy);
}
function frame2(){
stop();
myvar.gamescore = 0;
myvar.levelscore = 0;
myvar.obs_hit = false;
myvar.levels = 1;
myvar.enemy_hit = false;
myvar.congrats = false;
myvar.damage = 50;
moreGames.addEventListener(MouseEvent.CLICK, goto_chase);
}
public function gotopeppy(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.123chase.com"), "_blank");
}
}
}//package Crashing_fla
Section 14
//Game_Page100_132 (Crashing_fla.Game_Page100_132)
package Crashing_fla {
import flash.display.*;
public dynamic class Game_Page100_132 extends MovieClip {
public var building:MovieClip;
public function Game_Page100_132(){
addFrameScript(1, frame2);
}
function frame2(){
stop();
}
}
}//package Crashing_fla
Section 15
//Game_Page130_311 (Crashing_fla.Game_Page130_311)
package Crashing_fla {
import flash.display.*;
public dynamic class Game_Page130_311 extends MovieClip {
public function Game_Page130_311(){
addFrameScript(0, frame1, 10, frame11);
}
function frame1(){
stop();
}
function frame11(){
stop();
}
}
}//package Crashing_fla
Section 16
//Game_Page15_196 (Crashing_fla.Game_Page15_196)
package Crashing_fla {
import flash.display.*;
public dynamic class Game_Page15_196 extends MovieClip {
public var inside1:MovieClip;
public function Game_Page15_196(){
addFrameScript(0, frame1, 11, frame12);
}
function frame12(){
stop();
}
function frame1(){
stop();
}
}
}//package Crashing_fla
Section 17
//Game_Page17_212 (Crashing_fla.Game_Page17_212)
package Crashing_fla {
import flash.display.*;
public dynamic class Game_Page17_212 extends MovieClip {
public var count:Count;
public function Game_Page17_212(){
addFrameScript(0, frame1, 3, frame4, 16, frame17, 31, frame32, 43, frame44, 53, frame54);
}
function frame1(){
stop();
}
function frame17(){
myvar.countsc = count.play();
}
function frame4(){
count = new Count();
myvar.countsc = count.play();
}
function frame44(){
myvar.countsc = count.play();
}
function frame32(){
myvar.countsc = count.play();
}
function frame54(){
stop();
}
}
}//package Crashing_fla
Section 18
//Game_Page22_197 (Crashing_fla.Game_Page22_197)
package Crashing_fla {
import flash.display.*;
public dynamic class Game_Page22_197 extends MovieClip {
public var countdown:MovieClip;
}
}//package Crashing_fla
Section 19
//Game_Page31_228 (Crashing_fla.Game_Page31_228)
package Crashing_fla {
import flash.display.*;
public dynamic class Game_Page31_228 extends MovieClip {
public function Game_Page31_228(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Crashing_fla
Section 20
//Game_Page35_240 (Crashing_fla.Game_Page35_240)
package Crashing_fla {
import flash.display.*;
public dynamic class Game_Page35_240 extends MovieClip {
public function Game_Page35_240(){
addFrameScript(49, frame50);
}
function frame50(){
stop();
}
}
}//package Crashing_fla
Section 21
//Game_Page49_226 (Crashing_fla.Game_Page49_226)
package Crashing_fla {
import flash.display.*;
public dynamic class Game_Page49_226 extends MovieClip {
public var inside:MovieClip;
}
}//package Crashing_fla
Section 22
//Game_Page7_215 (Crashing_fla.Game_Page7_215)
package Crashing_fla {
import flash.display.*;
public dynamic class Game_Page7_215 extends MovieClip {
public var speedometer:MovieClip;
public var signal:MovieClip;
public var damage_meter:MovieClip;
}
}//package Crashing_fla
Section 23
//Game_Page87_266 (Crashing_fla.Game_Page87_266)
package Crashing_fla {
import flash.display.*;
public dynamic class Game_Page87_266 extends MovieClip {
public var r2_tyre:MovieClip;
public var r1_tyre:MovieClip;
}
}//package Crashing_fla
Section 24
//game_score5_297 (Crashing_fla.game_score5_297)
package Crashing_fla {
import flash.display.*;
import flash.text.*;
public dynamic class game_score5_297 extends MovieClip {
public var game_score:TextField;
public var play_again:SimpleButton;
public var submit_score:SimpleButton;
}
}//package Crashing_fla
Section 25
//level_up6_256 (Crashing_fla.level_up6_256)
package Crashing_fla {
import flash.display.*;
import flash.text.*;
public dynamic class level_up6_256 extends MovieClip {
public var next_level:SimpleButton;
public var play_again:SimpleButton;
public var game_txt:TextField;
public var lvl_txt:TextField;
}
}//package Crashing_fla
Section 26
//MainTimeline (Crashing_fla.MainTimeline)
package Crashing_fla {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import mochi.as3.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var ref3:MovieClip;
public var ref4:MovieClip;
public var ref1:MovieClip;
public var levelcount:TextField;
public var pausemc:MovieClip;
public var levelmc:MovieClip;
public var right:Boolean;
public var game_score:TextField;
public var ref5:MovieClip;
public var left:Boolean;
public var start_hit:Boolean;
public var secs1:String;
public var bg:MovieClip;
public var frame_AI:Number;
public var speedArray:Array;
public var speed:Number;
public var score_mc:MovieClip;
public var enemy_hit:Boolean;
public var center:MovieClip;
public var screen:MovieClip;
public var palette:MovieClip;
public var o:Object;
public var posArray:Array;
public var enemy_container:MovieClip;
public var bg1:Bg;
public var boardID:String;
public var dx:Number;
public var dy:Number;
public var dis_meter:MovieClip;
public var score:Number;
public var contestMenu:ContextMenu;
public var left_angle:MovieClip;
public var percentage:Number;
public var rand_num:Number;
public var signal:MovieClip;
public var obs_speed_const:Number;
public var up:Boolean;
public var ref_mc:MovieClip;
public var lineArray:Array;
public var time:Number;
public var enemy_speed:Number;
public var played:Boolean;
public var obs_angle:Number;
public var angle:Number;
public var back:SimpleButton;
public var general:MovieClip;
public var instr:SimpleButton;
public var right_angle:MovieClip;
public var init_cond:Boolean;
public var total_txt:TextField;
public var play_but:SimpleButton;
public var start_count:Boolean;
public var lines:Lines;
public var obs:Obstacles;
public var line_count:Number;
public var sndon:SimpleButton;
public var carX:Number;
public var rspeed:Number;
public var obs_count:Number;
public var dis_timeArray:Array;
public var hit_line:MovieClip;
public var initPos:Number;
public var mytimer:Timer;
public var levelArray:Array;
public var obsArray:Array;
public var score_txt:TextField;
public var game_started:Boolean;
public var lspeed:Number;
public var enemy_angle:Number;
public var sndoff:SimpleButton;
public var enemy_speed_const:Number;
public var divideArray:Array;
public var lampArray:Array;
public var end_mc:MovieClip;
public var preloadMc:MovieClip;
public var skit:Skit;
public var enemy:Enemy;
public var load_txt:TextField;
public var enemy_count:Number;
public var timeArray:Array;
public var lamps:Lamps;
public var crash:Crash;
public var enemyArray:Array;
public var logo:SimpleButton;
public var hit:Hit;
public var contextmenuItem:ContextMenuItem;
public var start_line:Start_line;
public var obs_hit:Boolean;
public var car_container:MovieClip;
public var enemyspeedArray:Array;
public var temp:Number;
public var car:Car;
public var lamp_count:Number;
public var mins1:String;
public var line_container:MovieClip;
public var time_txt:TextField;
public var ref2:MovieClip;
public function MainTimeline(){
addFrameScript(0, frame1, 9, frame10, 18, frame19, 27, frame28, 36, frame37, 44, frame45, 53, frame54, 60, frame61);
}
public function runbg(_arg1:Event):void{
var delay:Number;
var fun:Function;
var tmp:Number;
var e = _arg1;
if ((((speed > 6)) && (!(init_cond)))){
create_enemy();
init_cond = true;
};
if (((!(game_started)) && (!(start_count)))){
fun = function (){
speed = 0;
clearInterval(delay);
start_count = true;
signal.inside1.countdown.gotoAndPlay(2);
};
delay = setInterval(fun, 1500);
};
if (signal.inside1.countdown.currentFrame == 30){
palette.signal.inside.gotoAndStop(2);
};
if (signal.inside1.countdown.currentFrame == 43){
palette.signal.inside.gotoAndStop(3);
};
if (signal.inside1.countdown.currentFrame == 54){
game_started = true;
if (!played){
if (myvar.soundtoggle){
myvar.sc1 = bg1.play(0, int.MAX_VALUE);
} else {
myvar.sc1.stop();
};
played = true;
};
};
if (game_started){
mytimer.start();
if (left){
rspeed = 0;
if (car.x >= 175){
lspeed = (lspeed + 3);
car.x = (car.x - lspeed);
};
} else {
if ((((left == false)) && (!((lspeed == 0))))){
if (car.x >= 175){
lspeed = (lspeed - 1.5);
car.x = (car.x - lspeed);
};
};
};
if (right){
lspeed = 0;
if (car.x <= 600){
rspeed = (rspeed + 3);
car.x = (car.x + rspeed);
};
} else {
if ((((right == false)) && (!((rspeed == 0))))){
if (car.x <= 600){
rspeed = (rspeed - 1.5);
car.x = (car.x + rspeed);
};
};
};
carX = car.x;
if (up){
if ((((speed > 0)) && ((dis_meter.car.x < levelArray[myvar.levels])))){
dis_meter.car.x = (dis_meter.car.x + (speed / divideArray[myvar.levels]));
};
if (speed > 0){
if (car.currentFrame == 1){
if (car.left_car.tyres){
car.left_car.tyres.tyre1.r1_tyre.play();
car.left_car.tyres.tyre1.r2_tyre.play();
car.left_car.tyres.tyre2.r1_tyre.play();
car.left_car.tyres.tyre2.r2_tyre.play();
};
} else {
if (car.currentFrame == 2){
if (car.right_car.tyres){
car.right_car.tyres.tyre1.r1_tyre.play();
car.right_car.tyres.tyre1.r2_tyre.play();
car.right_car.tyres.tyre2.r1_tyre.play();
car.right_car.tyres.tyre2.r2_tyre.play();
};
};
};
};
if (signal.currentFrame == 1){
signal.gotoAndPlay(2);
};
if (speed < speedArray[myvar.levels]){
palette.speedometer.rotation = (palette.speedometer.rotation + 7.3);
speed = (speed + 1);
};
if (start_line){
start_line.gotoAndPlay(2);
start_line.x = 3000;
};
};
if (!up){
if (speed > 0){
palette.speedometer.rotation = (palette.speedometer.rotation - 3.65);
speed = (speed - 0.5);
};
};
if (speed == 0){
stop_tyre();
};
if (((((((car.left_hit.hitTestObject(obs)) || (HitTest.complexHitTestObject(car.leftside_hit, obs, 1)))) && ((obs_hit == false)))) && ((speed > 0)))){
if (obs.currentFrame == 1){
obs_hit = true;
if (myvar.soundtoggle){
myvar.hitsc = hit.play();
} else {
myvar.hitsc.stop();
};
if (myvar.damage >= 5){
if (speed > 10){
speed = (speed - 10);
palette.speedometer.rotation = (palette.speedometer.rotation - 73);
};
myvar.damage = (myvar.damage - 5);
palette.damage_meter.gotoAndStop(myvar.damage);
};
car.right_car.visible = false;
car.left_car.gotoAndPlay(2);
obs_speed_const = 25;
} else {
if (obs.currentFrame == 2){
obs_hit = true;
if (myvar.soundtoggle){
myvar.skitsc = skit.play();
} else {
myvar.skitsc.stop();
};
if (myvar.damage >= 5){
if (speed > 10){
speed = (speed - 10);
palette.speedometer.rotation = (palette.speedometer.rotation - 73);
};
myvar.damage = (myvar.damage - 5);
palette.damage_meter.gotoAndStop(myvar.damage);
};
obs.cone.gotoAndPlay(2);
obs_speed_const = 25;
};
};
};
if (enemy){
if (((((car.left_hit.hitTestObject(enemy.left_AI)) || (car.leftside_hit.hitTestObject(enemy.left_AI)))) && ((myvar.enemy_hit == false)))){
if (enemy.currentFrame == 1){
if (myvar.damage < 50){
myvar.damage = (myvar.damage + 5);
palette.damage_meter.gotoAndStop(myvar.damage);
};
if (myvar.soundtoggle){
myvar.sc2 = crash.play();
} else {
myvar.sc2.stop();
};
enemy_hit = true;
myvar.enemy_hit = true;
score = (score + 50);
score_txt.text = score.toString();
enemy.left_AI.inside.gotoAndPlay(2);
};
} else {
if (((((car.right_hit.hitTestObject(enemy.left_AI)) || (car.rightside_hit.hitTestObject(enemy.left_AI)))) && ((myvar.enemy_hit == false)))){
if (enemy.currentFrame == 1){
if (myvar.damage < 50){
myvar.damage = (myvar.damage + 5);
palette.damage_meter.gotoAndStop(myvar.damage);
};
if (myvar.soundtoggle){
myvar.sc2 = crash.play();
} else {
myvar.sc2.stop();
};
enemy_hit = true;
myvar.enemy_hit = true;
score = (score + 50);
score_txt.text = score.toString();
tmp = (frame_AI + 1);
MovieClip(enemy.left_AI.parent).gotoAndStop(tmp);
};
} else {
if (((((((hit_line.hitTestObject(enemy)) && ((enemy_hit == false)))) && ((enemy.currentFrame == 1)))) && ((myvar.enemy_hit == false)))){
if (((enemy.visible) && (start_hit))){
enemy.visible = false;
if (myvar.damage >= 5){
myvar.damage = (myvar.damage - 5);
palette.damage_meter.gotoAndStop(myvar.damage);
};
};
};
};
};
};
if (((((((car.right_hit.hitTestObject(obs)) || (HitTest.complexHitTestObject(car.rightside_hit, obs, 1)))) && ((obs_hit == false)))) && ((speed > 0)))){
if (obs.currentFrame == 1){
obs_hit = true;
if (myvar.soundtoggle){
myvar.hitsc = hit.play();
} else {
myvar.hitsc.stop();
};
if (myvar.damage >= 5){
if (speed > 10){
speed = (speed - 10);
palette.speedometer.rotation = (palette.speedometer.rotation - 73);
};
myvar.damage = (myvar.damage - 5);
palette.damage_meter.gotoAndStop(myvar.damage);
};
car.gotoAndStop(2);
car.right_car.visible = true;
car.right_car.gotoAndPlay(2);
obs_speed_const = 25;
} else {
if (obs.currentFrame == 2){
obs_hit = true;
if (myvar.soundtoggle){
myvar.skitsc = skit.play();
} else {
myvar.skitsc.stop();
};
if (myvar.damage >= 5){
if (speed > 10){
speed = (speed - 10);
palette.speedometer.rotation = (palette.speedometer.rotation - 73);
};
myvar.damage = (myvar.damage - 5);
palette.damage_meter.gotoAndStop(myvar.damage);
};
obs.cone.gotoAndPlay(2);
obs_speed_const = 25;
};
};
};
if (obs_hit){
if (obs.currentFrame == 1){
if ((((car.currentFrame == 1)) && ((car.left_car.currentFrame == 7)))){
obs_hit = false;
car.left_car.gotoAndStop(1);
obs_speed_const = 50;
} else {
if ((((car.currentFrame == 2)) && ((car.right_car.currentFrame == 7)))){
obs_hit = false;
car.right_car.gotoAndStop(1);
car.gotoAndStop(1);
obs_speed_const = 50;
};
};
} else {
if (obs.currentFrame == 2){
if (obs.cone.currentFrame == 11){
obs_hit = false;
obs.visible = false;
obs.cone.gotoAndStop(1);
obs_speed_const = 50;
};
};
};
};
if ((((palette.damage_meter.currentFrame < 5)) || ((time <= 0)))){
myvar.congrats = false;
remove_all();
gotoAndStop("Submit_page");
} else {
if ((((((dis_meter.car.x >= levelArray[myvar.levels])) && ((time > 0)))) && ((palette.damage_meter.currentFrame > 5)))){
remove_all();
if (myvar.levels == 5){
myvar.congrats = true;
gotoAndStop("Submit_page");
} else {
myvar.levelscore = (myvar.levelscore + score);
gotoAndStop("Level_up");
};
};
};
};
}
public function remove_listener():void{
var _local1:Number;
var _local2:*;
var _local3:Number;
var _local4:*;
var _local5:Number;
var _local6:*;
var _local7:Number;
var _local8:*;
if (myvar.soundtoggle){
myvar.sc1.stop();
};
mytimer.stop();
stop_tyre();
_local1 = lampArray.length;
_local2 = 0;
while (_local2 < _local1) {
if (lampArray[_local2]){
lampArray[_local2].removeEventListener(Event.ENTER_FRAME, lamp_movement);
};
_local2++;
};
_local3 = lineArray.length;
_local4 = 0;
while (_local4 < _local3) {
if (lineArray[_local4]){
lineArray[_local4].removeEventListener(Event.ENTER_FRAME, line_movement);
};
_local4++;
};
_local5 = obsArray.length;
_local6 = 0;
while (_local6 < _local5) {
if (obsArray[_local6]){
obsArray[_local6].removeEventListener(Event.ENTER_FRAME, obs_movement);
};
_local6++;
};
_local7 = enemyArray.length;
_local8 = 0;
while (_local8 < _local7) {
if (enemyArray[_local8]){
enemyArray[_local8].removeEventListener(Event.ENTER_FRAME, enemy_movement);
};
_local8++;
};
stage.removeEventListener(Event.ENTER_FRAME, runbg);
initPos = 0;
}
public function create_car():void{
car = new Car();
car_container.addChild(car);
car.x = 394.5;
car.y = 457.7;
car.scaleX = (car.scaleY = 0.65);
}
function frame10(){
stop();
play_but.addEventListener(MouseEvent.CLICK, goto_game);
instr.addEventListener(MouseEvent.CLICK, goto_instr);
}
public function create_obstacles():void{
var _local1:Number;
var _local2:Number;
_local1 = Math.ceil((Math.random() * 5));
_local2 = Math.ceil((Math.random() * 2));
obs_count++;
obs = new Obstacles();
general.addChild(obs);
obs.gotoAndStop(_local2);
obs.scaleX = 0.05;
obs.scaleY = 0.05;
dx = (ref_mc.x - this[("ref" + _local1)].x);
dy = (ref_mc.y - this[("ref" + _local1)].y);
obs_angle = (Math.atan2(dy, dx) * (180 / Math.PI));
obs.lcos = Math.cos(((Math.PI / 180) * obs_angle));
obs.lsin = Math.sin(((Math.PI / 180) * obs_angle));
obs.x = ref_mc.x;
obs.y = ref_mc.y;
obsArray.push(obs);
obs.id = obs_count;
obs.scaleX = 0.005;
obs.scaleY = 0.005;
obs.xyscale = 0;
obs.addEventListener(Event.ENTER_FRAME, obs_movement);
}
public function goto_front(_arg1:MouseEvent):void{
gotoAndStop("Front_page");
}
function frame19(){
stop();
back.addEventListener(MouseEvent.CLICK, goto_front);
}
public function key_pressed(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 37){
left = true;
} else {
if (_arg1.keyCode == 39){
right = true;
};
};
if (_arg1.keyCode == 38){
up = true;
};
if (_arg1.keyCode == 80){
if (pausemc.visible == false){
pausemc.visible = true;
remove_listener();
} else {
pausemc.visible = false;
add_listener();
};
};
if (_arg1.keyCode == 77){
if (myvar.soundtoggle){
myvar.soundtoggle = false;
sndoff.visible = true;
sndon.visible = false;
SoundMixer.stopAll();
} else {
if (myvar.soundtoggle == false){
myvar.soundtoggle = true;
myvar.sc1 = bg1.play(0, int.MAX_VALUE);
sndoff.visible = false;
sndon.visible = true;
};
};
};
}
public function create_lamps():void{
var _local1:*;
_local1 = 0;
while (_local1 < 2) {
lamp_count++;
lamps = new Lamps();
general.addChild(lamps);
lampArray.push(lamps);
if ((_local1 % 2) == 0){
lamps.scaleX = 0.005;
lamps.scaleY = 0.005;
dx = (ref_mc.x - right_angle.x);
dy = (ref_mc.y - right_angle.y);
angle = (Math.atan2(dy, dx) * (180 / Math.PI));
} else {
lamps.scaleX = 0.005;
lamps.scaleY = 0.005;
dx = (ref_mc.x - left_angle.x);
dy = (ref_mc.y - left_angle.y);
angle = (Math.atan2(dy, dx) * (180 / Math.PI));
};
lamps.lcos = Math.cos(((Math.PI / 180) * angle));
lamps.lsin = Math.sin(((Math.PI / 180) * angle));
lamps.x = ref_mc.x;
lamps.y = ref_mc.y;
lamps.id = lamp_count;
lamps.xyscale = 0;
lamps.addEventListener(Event.ENTER_FRAME, lamp_movement);
_local1++;
};
}
public function line_movement(_arg1:Event):void{
var _local2:MovieClip;
var _local3:*;
if ((((initPos >= 1)) && ((speed > 0)))){
_local2 = MovieClip(_arg1.target);
_local2.y = (_local2.y + speed);
_local2.xyscale = ((((100 * (_local2.y - ref_mc.y)) / 368.2) + 5) / 200);
if (_local2.xyscale > 0.005){
_local2.scaleX = (_local2.scaleY = _local2.xyscale);
};
if ((((_local2.y > 350)) && ((_local2.id == line_count)))){
create_line();
};
if (_local2.y > 575){
_local3 = 0;
while (_local3 < lineArray.length) {
if (lineArray[_local3] == _local2){
lineArray.splice(_local3, 1);
_local2.removeEventListener(Event.ENTER_FRAME, line_movement);
line_container.removeChild(_local2);
break;
};
_local3++;
};
};
};
}
function frame45(){
stop();
SoundMixer.stopAll();
myvar.gamescore = (myvar.gamescore + score);
score_mc.game_score.text = myvar.gamescore;
score_mc.play_again.addEventListener(MouseEvent.CLICK, goto_game_page);
score_mc.submit_score.addEventListener(MouseEvent.CLICK, game_end);
}
function frame28(){
logo.addEventListener(MouseEvent.CLICK, gotochase123);
sndoff.addEventListener(MouseEvent.CLICK, sndop);
sndon.addEventListener(MouseEvent.CLICK, sndst);
stop();
left = false;
right = false;
up = false;
game_started = false;
obs_hit = false;
enemy_hit = false;
init_cond = false;
start_count = false;
played = false;
start_hit = false;
lspeed = 0;
rspeed = 0;
lamp_count = 0;
line_count = 0;
obs_count = 0;
enemy_count = 0;
enemy_speed = 25;
initPos = 1;
dx = 0;
dy = 0;
angle = 0;
obs_angle = 0;
score = 0;
obs_speed_const = 25;
enemy_angle = 0;
enemy_speed_const = 25;
carX = 0;
rand_num = 0;
temp = 0;
frame_AI = 1;
speed = 0;
lampArray = new Array();
lineArray = new Array();
obsArray = new Array();
enemyArray = new Array();
levelArray = new Array("", 268, 376, 484, 592, 700);
speedArray = new Array("", 21, 26, 31, 36, 41);
posArray = new Array("", 160, 268, 376, 484, 592);
enemyspeedArray = new Array("", 10, 10, 10, 10, 10);
dis_timeArray = new Array("", "01:00", "01:00", "00:55", "00:55", "00:55");
timeArray = new Array("", 60, 60, 55, 55, 55);
divideArray = new Array("", 150, 200, 250, 300, 350);
time = timeArray[myvar.levels];
bg1 = new Bg();
crash = new Crash();
hit = new Hit();
skit = new Skit();
myvar.levelscore = score;
mytimer = new Timer(1000, 0);
mytimer.addEventListener(TimerEvent.TIMER, time_fun);
init();
stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed);
stage.addEventListener(KeyboardEvent.KEY_UP, key_released);
stage.addEventListener(Event.ENTER_FRAME, runbg);
}
public function create_enemy():void{
var _local1:Number;
_local1 = Math.ceil((Math.random() * 5));
frame_AI = Math.ceil((Math.random() * 3));
enemy_count++;
enemy = new Enemy();
enemy_container.addChild(enemy);
enemy.left_AI.gotoAndStop(frame_AI);
enemy.scaleX = 0.05;
enemy.scaleY = 0.05;
dx = (ref_mc.x - this[("ref" + _local1)].x);
dy = (ref_mc.y - this[("ref" + _local1)].y);
enemy_angle = (Math.atan2(dy, dx) * (180 / Math.PI));
enemy.lcos = Math.cos(((Math.PI / 180) * enemy_angle));
enemy.lsin = Math.sin(((Math.PI / 180) * enemy_angle));
enemy.x = ref_mc.x;
enemy.y = ref_mc.y;
enemyArray.push(enemy);
enemy.id = enemy_count;
enemy.scaleX = 0.005;
enemy.scaleY = 0.005;
enemy.xyscale = 0;
rand_num = Math.round((Math.random() * 2));
temp = rand_num;
if (rand_num == 1){
temp = 1;
} else {
temp = 5;
};
start_hit = true;
enemy.addEventListener(Event.ENTER_FRAME, enemy_movement);
}
public function add_listener():void{
var _local1:Number;
var _local2:*;
var _local3:Number;
var _local4:*;
var _local5:Number;
var _local6:*;
var _local7:Number;
var _local8:*;
if (myvar.soundtoggle){
myvar.sc1 = bg1.play(0, int.MAX_VALUE);
};
mytimer.start();
_local1 = lampArray.length;
_local2 = 0;
while (_local2 < _local1) {
if (lampArray[_local2]){
lampArray[_local2].addEventListener(Event.ENTER_FRAME, lamp_movement);
};
_local2++;
};
_local3 = lineArray.length;
_local4 = 0;
while (_local4 < _local3) {
if (lineArray[_local4]){
lineArray[_local4].addEventListener(Event.ENTER_FRAME, line_movement);
};
_local4++;
};
_local5 = obsArray.length;
_local6 = 0;
while (_local6 < _local5) {
if (obsArray[_local6]){
obsArray[_local6].addEventListener(Event.ENTER_FRAME, obs_movement);
};
_local6++;
};
_local7 = enemyArray.length;
_local8 = 0;
while (_local8 < _local7) {
if (enemyArray[_local8]){
enemyArray[_local8].addEventListener(Event.ENTER_FRAME, enemy_movement);
};
_local8++;
};
stage.addEventListener(Event.ENTER_FRAME, runbg);
initPos = 1;
}
public function gochase123(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.123chase.com"), "_blank");
}
public function before_drive():void{
speed = 6;
}
function frame1(){
stop();
contestMenu = new ContextMenu();
contestMenu.hideBuiltInItems();
contextmenuItem = new ContextMenuItem("www.123chase.com");
contextmenuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Site);
contestMenu.customItems.push(contextmenuItem);
this.contextMenu = contestMenu;
percentage = 0;
total_txt.text = (String(100) + "%");
stage.addEventListener(Event.ENTER_FRAME, BeeMoving);
}
function frame54(){
stop();
SoundMixer.stopAll();
MochiServices.connect("4123198a15cc12f9", root);
o = {n:[2, 6, 2, 6, 6, 6, 10, 12, 0, 0, 6, 10, 14, 9, 12, 6], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
boardID = o.f(0, "");
MochiScores.showLeaderboard({boardID:boardID, score:myvar.gamescore});
game_score.text = myvar.gamescore.toString();
if (!myvar.congrats){
end_mc.gotoAndStop(2);
} else {
if (myvar.congrats){
end_mc.gotoAndStop(1);
};
};
}
public function goto_game_page(_arg1:MouseEvent):void{
if (myvar.congrats == false){
myvar.levelscore = (myvar.levelscore - score);
myvar.gamescore = (myvar.gamescore - score);
} else {
if (myvar.congrats){
myvar.levelscore = 0;
myvar.gamescore = 0;
};
};
myvar.enemy_hit = false;
myvar.obs_hit = false;
myvar.congrats = false;
myvar.damage = 50;
gotoAndStop("just");
}
function frame37(){
logo.addEventListener(MouseEvent.CLICK, gochase123);
stop();
SoundMixer.stopAll();
myvar.gamescore = (myvar.gamescore + myvar.levelscore);
levelmc.lvl_txt.text = myvar.levelscore.toString();
levelmc.game_txt.text = myvar.gamescore.toString();
levelmc.next_level.addEventListener(MouseEvent.CLICK, go_next);
levelmc.play_again.addEventListener(MouseEvent.CLICK, go_page);
}
function frame61(){
gotoAndStop("Game_page");
}
public function time_fun(_arg1:TimerEvent):void{
var _local2:Number;
var _local3:Number;
if (time > 0){
time--;
_local2 = Math.floor((time % 60));
_local3 = Math.floor((time / 60));
if (String(_local2).length == 1){
secs1 = ("0" + _local2);
} else {
secs1 = String(_local2);
};
if (String(_local3).length == 1){
mins1 = ("0" + _local3);
} else {
mins1 = String(_local3);
};
time_txt.text = ((mins1 + ":") + secs1);
};
}
public function obs_movement(_arg1:Event):void{
var _local2:MovieClip;
var _local3:*;
if ((((initPos >= 1)) && ((speed > 0)))){
_local2 = MovieClip(_arg1.target);
_local2.y = (_local2.y + (speed / 50));
_local2.xyscale = ((((100 * (_local2.y - ref_mc.y)) / 405.5) + 5) / 75);
if ((_local2.id % 2) == 0){
_local2.x = (_local2.x - ((((_local2.scaleX * 100) / 5) * _local2.lcos) * (speed / obs_speed_const)));
_local2.y = (_local2.y - ((((_local2.scaleX * 100) / 5) * _local2.lsin) * (speed / obs_speed_const)));
_local2.scaleX = (_local2.scaleY = _local2.xyscale);
} else {
if (_local2.xyscale > 0.005){
_local2.x = (_local2.x + ((((_local2.scaleX * 100) / 5) * _local2.lcos) * (speed / obs_speed_const)));
_local2.y = (_local2.y + ((((_local2.scaleX * 100) / 5) * _local2.lsin) * (speed / obs_speed_const)));
_local2.scaleX = -(_local2.xyscale);
_local2.scaleY = _local2.xyscale;
};
};
if ((((_local2.y > 570)) && ((_local2.id == obs_count)))){
obs_hit = false;
create_obstacles();
};
if (_local2.y > 575){
_local3 = 0;
while (_local3 < obsArray.length) {
if (obsArray[_local3] == _local2){
obsArray.splice(_local3, 1);
_local2.removeEventListener(Event.ENTER_FRAME, obs_movement);
general.removeChild(_local2);
break;
};
_local3++;
};
};
};
}
public function goto_instr(_arg1:MouseEvent):void{
gotoAndStop("Instructions");
}
public function sndop(_arg1:MouseEvent):void{
myvar.soundtoggle = true;
myvar.sc1 = bg1.play(0, int.MAX_VALUE);
sndoff.visible = false;
sndon.visible = true;
}
public function key_released(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 37){
left = false;
} else {
if (_arg1.keyCode == 39){
right = false;
};
};
if (_arg1.keyCode == 38){
up = false;
};
}
public function game_end(_arg1:MouseEvent):void{
gotoAndStop("Game_end");
}
public function init():void{
screen.gotoAndPlay(2);
palette.damage_meter.gotoAndStop(myvar.damage);
dis_meter.car.x = posArray[myvar.levels];
pausemc.visible = false;
score_txt.text = score.toString();
time_txt.text = dis_timeArray[myvar.levels];
levelcount.text = myvar.levels.toString();
create_car();
create_lamps();
create_line();
create_obstacles();
before_drive();
palette.speedometer.rotation = -153;
}
public function goto_game(_arg1:MouseEvent):void{
gotoAndStop("Game_page");
}
public function BeeMoving(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
_local2 = loaderInfo.bytesLoaded;
_local3 = loaderInfo.bytesTotal;
percentage = Math.round(((_local2 / _local3) * 100));
load_txt.text = (String(percentage) + "%");
preloadMc.preloadCar.gotoAndStop((percentage * 3));
if (_local2 == _local3){
gotoAndStop("Front_page");
stage.removeEventListener(Event.ENTER_FRAME, BeeMoving);
};
}
public function Site(_arg1:Event):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.123chase.com");
navigateToURL(_local2, "_blank");
}
public function remove_all():void{
var _local1:Number;
var _local2:*;
var _local3:Number;
var _local4:*;
var _local5:Number;
var _local6:*;
var _local7:Number;
var _local8:*;
mytimer.stop();
mytimer.removeEventListener(TimerEvent.TIMER, time_fun);
speed = 0;
stop_tyre();
_local1 = lampArray.length;
_local2 = 0;
while (_local2 < _local1) {
if (lampArray[_local2]){
lampArray[_local2].removeEventListener(Event.ENTER_FRAME, lamp_movement);
general.removeChild(lampArray[_local2]);
};
_local2++;
};
_local3 = lineArray.length;
_local4 = 0;
while (_local4 < _local3) {
if (lineArray[_local4]){
lineArray[_local4].removeEventListener(Event.ENTER_FRAME, line_movement);
line_container.removeChild(lineArray[_local4]);
};
_local4++;
};
_local5 = obsArray.length;
_local6 = 0;
while (_local6 < _local5) {
if (obsArray[_local6]){
obsArray[_local6].removeEventListener(Event.ENTER_FRAME, obs_movement);
general.removeChild(obsArray[_local6]);
};
_local6++;
};
_local7 = enemyArray.length;
_local8 = 0;
while (_local8 < _local7) {
if (enemyArray[_local8]){
enemyArray[_local8].removeEventListener(Event.ENTER_FRAME, enemy_movement);
enemy_container.removeChild(enemyArray[_local8]);
};
_local8++;
};
car_container.removeChild(car);
lampArray = new Array();
lineArray = new Array();
obsArray = new Array();
enemyArray = new Array();
stage.removeEventListener(Event.ENTER_FRAME, runbg);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed);
stage.removeEventListener(KeyboardEvent.KEY_UP, key_released);
initPos = 0;
}
public function create_line():void{
line_count++;
lines = new Lines();
line_container.addChild(lines);
lines.x = ref_mc.x;
lines.y = ref_mc.y;
lineArray.push(lines);
lines.id = line_count;
lines.scaleX = 0.005;
lines.scaleY = 0.005;
lines.xyscale = 0;
lines.addEventListener(Event.ENTER_FRAME, line_movement);
}
public function lamp_movement(_arg1:Event):void{
var _local2:MovieClip;
var _local3:*;
if ((((initPos >= 1)) && ((speed > 0)))){
_local2 = MovieClip(_arg1.target);
_local2.xyscale = ((((100 * (_local2.y - ref_mc.y)) / 179.2) + 5) / 150);
if ((_local2.id % 2) == 0){
_local2.x = (_local2.x - ((((_local2.scaleX * 100) / 5) * _local2.lcos) * speed));
_local2.y = (_local2.y - ((((_local2.scaleX * 100) / 5) * _local2.lsin) * speed));
_local2.scaleX = (_local2.scaleY = _local2.xyscale);
} else {
if (_local2.xyscale > 0.005){
_local2.x = (_local2.x + ((((_local2.scaleX * 100) / 5) * _local2.lcos) * speed));
_local2.y = (_local2.y + ((((_local2.scaleX * 100) / 5) * _local2.lsin) * speed));
_local2.scaleX = -(_local2.xyscale);
_local2.scaleY = _local2.xyscale;
};
};
if ((((_local2.y > 350)) && ((_local2.id == lamp_count)))){
create_lamps();
};
if (_local2.y > 500){
_local3 = 0;
while (_local3 < lampArray.length) {
if (lampArray[_local3] == _local2){
lampArray.splice(_local3, 1);
_local2.removeEventListener(Event.ENTER_FRAME, lamp_movement);
general.removeChild(_local2);
break;
};
_local3++;
};
};
};
}
public function sndst(_arg1:MouseEvent):void{
myvar.soundtoggle = false;
sndoff.visible = true;
sndon.visible = false;
SoundMixer.stopAll();
}
public function enemy_movement(_arg1:Event):void{
var _local2:MovieClip;
var _local3:Number;
var _local4:Number;
var _local5:*;
if (initPos >= 1){
_local2 = MovieClip(_arg1.target);
_local2.y = (_local2.y + (enemy_speed_const / 50));
if (ref_mc){
_local2.xyscale = ((((100 * (_local2.y - ref_mc.y)) / 405.5) + 5) / 75);
};
if ((_local2.id % 2) == 0){
_local2.x = (_local2.x - ((((_local2.scaleX * 100) / 5) * _local2.lcos) * (enemy_speed / enemy_speed_const)));
_local2.y = (_local2.y - ((((_local2.scaleX * 100) / 5) * _local2.lsin) * (enemy_speed / enemy_speed_const)));
_local2.scaleX = (_local2.scaleY = _local2.xyscale);
} else {
if (_local2.xyscale > 0.005){
_local2.x = (_local2.x + ((((_local2.scaleX * 100) / 5) * _local2.lcos) * (enemy_speed / enemy_speed_const)));
_local2.y = (_local2.y + ((((_local2.scaleX * 100) / 5) * _local2.lsin) * (enemy_speed / enemy_speed_const)));
_local2.scaleX = -(_local2.xyscale);
_local2.scaleY = _local2.xyscale;
};
};
if ((((_local2.y >= 350)) && ((_local2.id == enemy_count)))){
if (carX < 394.5){
_local3 = 5;
dx = (ref_mc.x - this[("ref" + _local3)].x);
dy = (ref_mc.y - this[("ref" + _local3)].y);
enemy_angle = (Math.atan2(dy, dx) * (180 / Math.PI));
_local2.lcos = Math.cos(((Math.PI / 180) * enemy_angle));
_local2.lsin = Math.sin(((Math.PI / 180) * enemy_angle));
enemy_speed_const = enemyspeedArray[myvar.levels];
} else {
if (carX == 394.5){
dx = (ref_mc.x - this[("ref" + temp)].x);
dy = (ref_mc.y - this[("ref" + temp)].y);
enemy_angle = (Math.atan2(dy, dx) * (180 / Math.PI));
_local2.lcos = Math.cos(((Math.PI / 180) * enemy_angle));
_local2.lsin = Math.sin(((Math.PI / 180) * enemy_angle));
enemy_speed_const = enemyspeedArray[myvar.levels];
} else {
if (carX > 394.5){
_local4 = 1;
dx = (ref_mc.x - this[("ref" + _local4)].x);
dy = (ref_mc.y - this[("ref" + _local4)].y);
enemy_angle = (Math.atan2(dy, dx) * (180 / Math.PI));
_local2.lcos = Math.cos(((Math.PI / 180) * enemy_angle));
_local2.lsin = Math.sin(((Math.PI / 180) * enemy_angle));
enemy_speed_const = enemyspeedArray[myvar.levels];
};
};
};
};
if ((((_local2.y > 550)) && ((_local2.id == enemy_count)))){
enemy_hit = false;
myvar.enemy_hit = false;
create_enemy();
};
if (_local2.y > 575){
_local5 = 0;
while (_local5 < enemyArray.length) {
if (enemyArray[_local5] == _local2){
enemyArray.splice(_local5, 1);
_local2.removeEventListener(Event.ENTER_FRAME, enemy_movement);
enemy_container.removeChild(_local2);
break;
};
_local5++;
};
};
};
}
public function stop_tyre():void{
if (car.currentFrame == 1){
if (car.left_car.tyres){
car.left_car.tyres.tyre1.r1_tyre.stop();
car.left_car.tyres.tyre1.r2_tyre.stop();
car.left_car.tyres.tyre2.r1_tyre.stop();
car.left_car.tyres.tyre2.r2_tyre.stop();
};
} else {
if (car.currentFrame == 2){
if (car.right_car.tyres){
car.right_car.tyres.tyre1.r1_tyre.stop();
car.right_car.tyres.tyre1.r2_tyre.stop();
car.right_car.tyres.tyre2.r1_tyre.stop();
car.right_car.tyres.tyre2.r2_tyre.stop();
};
};
};
}
public function go_page(_arg1:MouseEvent):void{
myvar.levelscore = (myvar.levelscore - score);
myvar.gamescore = (myvar.gamescore - score);
myvar.obs_hit = false;
myvar.enemy_hit = false;
myvar.congrats = false;
this.gotoAndStop("Game_page");
}
public function gotochase123(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.123chase.com"), "_blank");
}
public function go_next(_arg1:MouseEvent):void{
myvar.levels++;
this.gotoAndStop("Game_page");
}
}
}//package Crashing_fla
Section 27
//preload__23 (Crashing_fla.preload__23)
package Crashing_fla {
import flash.display.*;
public dynamic class preload__23 extends MovieClip {
public function preload__23(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Crashing_fla
Section 28
//preload_preloadMc_1 (Crashing_fla.preload_preloadMc_1)
package Crashing_fla {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class preload_preloadMc_1 extends MovieClip {
public var preloadCar:MovieClip;
public var loaderlogo:MovieClip;
public function preload_preloadMc_1(){
addFrameScript(0, frame1);
}
function frame1(){
loaderlogo.buttonMode = true;
loaderlogo.addEventListener(MouseEvent.CLICK, loaderlogofn);
}
public function loaderlogofn(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.123chase.com"), "_blank");
}
}
}//package Crashing_fla
Section 29
//screen1_254 (Crashing_fla.screen1_254)
package Crashing_fla {
import flash.display.*;
public dynamic class screen1_254 extends MovieClip {
public function screen1_254(){
addFrameScript(0, frame1, 49, frame50);
}
function frame1(){
stop();
}
function frame50(){
stop();
MovieClip(parent).removeChild(this);
}
}
}//package Crashing_fla
Section 30
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const NO_USER:String = "NoUser";
public static const IO_ERROR:String = "IOError";
public static const ITEM_NEW:String = "ItemNew";
public static const ITEM_OWNED:String = "ItemOwned";
public static const STORE_ITEMS:String = "StoreItems";
public static const ERROR:String = "Error";
public static const STORE_SHOW:String = "StoreShow";
public static var _inventory:MochiInventory;
public static function triggerEvent(_arg1:String, _arg2:Object):void{
MochiSocial.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
MochiSocial.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
MochiSocial.addEventListener(_arg1, _arg2);
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function get inventory():MochiInventory{
return (_inventory);
}
public static function showStore(_arg1:Object=null):void{
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_inventory = new MochiInventory();
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_inventory = null;
});
}
}//package mochi.as3
Section 31
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function reencode():void{
var _local1:uint;
_local1 = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function toString():String{
var _local1:String;
_local1 = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
public function get value():Number{
return (Number(this.toString()));
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String;
_local3 = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
}
}//package mochi.as3
Section 32
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
eventTable = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
return;
};
for (_local3 in eventTable[_arg1]) {
var _local6 = eventTable[_arg1];
_local6[_local3](_arg2);
};
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
eventTable[_arg1] = [];
return;
};
for (_local3 in eventTable[_arg1]) {
if (eventTable[_arg1][_local3] != _arg2){
} else {
eventTable[_arg1].splice(Number(_local3), 1);
};
};
}
public function addEventListener(_arg1:String, _arg2:Function):void{
removeEventListener(_arg1, _arg2);
eventTable[_arg1].push(_arg2);
}
}
}//package mochi.as3
Section 33
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function startSession(_arg1:String):void{
MochiServices.send("events_beginSession", {achievementID:_arg1}, null, null);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function setNotifications(_arg1:MovieClip, _arg2:Object):void{
var _local3:Object;
var _local4:Object;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
_local3.clip = _arg1;
MochiServices.send("events_setNotifications", _local3, null, null);
}
public static function endGame():void{
var _local1:Number;
_local1 = (new Date().time - gameStart);
trigger("end_game", {time:_local1});
}
public static function startGame():void{
gameStart = new Date().time;
trigger("start_game");
}
public static function trigger(_arg1:String, _arg2:Object=null):void{
if (_arg2 == null){
_arg2 = {};
} else {
if (_arg2["kind"] != undefined){
trace("WARNING: optional arguments package contains key 'id', it will be overwritten");
_arg2["kind"] = _arg1;
};
};
MochiServices.send("events_triggerEvent", {eventObject:_arg2}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startLevel():void{
levelStart = new Date().time;
trigger("start_level");
}
public static function endLevel():void{
var _local1:Number;
_local1 = (new Date().time - levelStart);
trigger("end_level", {time:_local1});
}
}
}//package mochi.as3
Section 34
//MochiInventory (mochi.as3.MochiInventory)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
public dynamic class MochiInventory extends Proxy {
private var _timer:Timer;
private var _names:Array;
private var _consumableProperties:Object;
private var _syncID:Number;
private var _storeSync:Object;
private var _outstandingID:Number;
private var _syncPending:Boolean;
public static const READY:String = "InvReady";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IoError";
private static const KEY_SALT:String = " syncMaint";
public static const WRITTEN:String = "InvWritten";
public static const NOT_READY:String = "InvNotReady";
public static const VALUE_ERROR:String = "InvValueError";
private static const CONSUMER_KEY:String = "MochiConsumables";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiInventory():void{
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned);
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut);
_storeSync = new Object();
_syncPending = false;
_outstandingID = 0;
_syncID = 0;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, sync);
_timer.start();
if (MochiSocial.loggedIn){
loggedIn();
} else {
loggedOut();
};
}
private function newItems(_arg1:Object):void{
if (!this[(_arg1.id + KEY_SALT)]){
this[(_arg1.id + KEY_SALT)] = 0;
};
if (!this[_arg1.id]){
this[_arg1.id] = 0;
};
this[(_arg1.id + KEY_SALT)] = (this[(_arg1.id + KEY_SALT)] + _arg1.count);
this[_arg1.id] = (this[_arg1.id] + _arg1.count);
if (_arg1.privateProperties.consumable){
if (!this[_arg1.privateProperties.tag]){
this[_arg1.privateProperties.tag] = 0;
};
this[_arg1.privateProperties.tag] = (this[_arg1.privateProperties.tag] + (_arg1.privateProperties.inc * _arg1.count));
};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (-1);
};
if (_consumableProperties[_arg1]){
return (MochiDigits(_consumableProperties[_arg1]).value);
};
return (undefined);
}
public function release():void{
MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(_arg1):Boolean{
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (false);
};
if (_consumableProperties[_arg1] == undefined){
return (false);
};
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(_arg1:int):int{
return (((_arg1)>=_names.length) ? 0 : (_arg1 + 1));
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:MochiDigits;
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return;
};
if (!(_arg2 is Number)){
triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:_arg2});
return;
};
if (_consumableProperties[_arg1]){
_local3 = MochiDigits(_consumableProperties[_arg1]);
if (_local3.value == _arg2){
return;
};
_local3.value = _arg2;
} else {
_names.push(_arg1);
_consumableProperties[_arg1] = new MochiDigits(_arg2);
};
_syncID++;
}
private function sync(_arg1:Event=null):void{
var _local2:Object;
var _local3:String;
if (((_syncPending) || ((_syncID == _outstandingID)))){
return;
};
_outstandingID = _syncID;
_local2 = {};
for (_local3 in _consumableProperties) {
_local2[_local3] = MochiDigits(_consumableProperties[_local3]).value;
};
MochiUserData.put(CONSUMER_KEY, _local2, putConsumableBag);
_syncPending = true;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(_arg1:int):String{
return (_names[(_arg1 - 1)]);
}
private function loggedIn(_arg1:Object=null):void{
MochiUserData.get(CONSUMER_KEY, getConsumableBag);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(_arg1):Boolean{
if (!_consumableProperties[_arg1]){
return (false);
};
_names.splice(_names.indexOf(_arg1), 1);
delete _consumableProperties[_arg1];
return (true);
}
private function itemOwned(_arg1:Object):void{
_storeSync[_arg1.id] = {properties:_arg1.properties, count:_arg1.count};
}
private function putConsumableBag(_arg1:MochiUserData):void{
_syncPending = false;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
_outstandingID = -1;
};
triggerEvent(WRITTEN, {});
}
private function getConsumableBag(_arg1:MochiUserData):void{
var _local2:String;
var _local3:Number;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
return;
};
_consumableProperties = {};
_names = new Array();
if (_arg1.data){
for (_local2 in _arg1.data) {
_names.push(_local2);
_consumableProperties[_local2] = new MochiDigits(_arg1.data[_local2]);
};
};
for (_local2 in _storeSync) {
_local3 = _storeSync[_local2].count;
if (_consumableProperties[(_local2 + KEY_SALT)]){
_local3 = (_local3 - _consumableProperties[_local2]);
};
if (_local3 == 0){
} else {
newItems({id:_local2, count:_local3, properties:_storeSync[_local2].properties});
};
};
triggerEvent(READY, {});
}
private function loggedOut(_arg1:Object=null):void{
_consumableProperties = null;
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
}
}//package mochi.as3
Section 35
//MochiScores (mochi.as3.MochiScores)
package mochi.as3 {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public static function showLeaderboard(_arg1:Object=null):void{
var n:Number;
var options = _arg1;
if (options != null){
delete options.clip;
MochiServices.setContainer();
MochiServices.bringToTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.gotoAndStop("Front_page");
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local2:Object;
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
_local2 = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
_arg1 = Number(_arg1);
if (isNaN(_arg1)){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(_arg1) != _arg1){
trace((("WARNING: Submitted score '" + String(_arg1)) + "' will be truncated"));
};
_arg1 = Number(_arg1);
};
};
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (((((_arg1) && ((_arg1.error == true)))) && (onErrorHandler))){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiServices.warnID(_arg1, true);
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi.as3
Section 36
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
public static var servicesSync:MochiSync = new MochiSync();
private static var _clip:MovieClip;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _loader:Loader;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(_arg1:Object):void{
var cb:String;
var cblst:Object;
var method:*;
var methodName:String;
var obj:Object;
var pkg = _arg1;
cb = pkg.callbackID;
cblst = _clip._callbacks[cb];
if (!cblst){
return;
};
method = cblst.callbackMethod;
methodName = "";
obj = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete _clip._callbacks[cb];
}
public static function get childClip():Object{
return (_clip);
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + _arg1));
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_clip._nextcallbackID++;
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local3:Array;
var _local4:int;
var _local5:Array;
var _local6:Array;
var _local7:MovieClip;
var _local8:LocalConnection;
var _local9:String;
var _local10:ByteArray;
var _local11:ByteArray;
var _local12:uint;
var _local13:uint;
var _local14:Loader;
_local3 = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
_local5 = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
_local6 = [0, 64, 0, 0, 0];
_local7 = new MovieClip();
_local8 = new LocalConnection();
_local9 = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
_local10 = new ByteArray();
_local11 = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
_local12 = ((_local3.length + _local11.length) + 4);
_local13 = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var vars:Object;
var avm1Click:DisplayObject;
var s:String;
var i:Number;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
vars = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
s = "?";
i = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
var _local2:Rectangle;
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
_local2 = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
var _local3:Number;
_arg1 = _arg1.toLowerCase();
if (_arg1.length != 16){
trace((("WARNING: " + (_arg2) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
_local3 = 0;
while (_local3 < _arg1.length) {
switch (_arg1.charAt(_local3)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + _arg1));
return;
};
_local3++;
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_mochiLocalConnection.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
};
return (_local2);
}
public static function getVersion():String{
return ("3.7 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (((_clip) && (_clip._queue))){
while (_clip._queue.length > 0) {
_local2 = _clip._queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _clip._callbacks[_local2.callbackID];
};
delete _clip._callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(_arg1:Object):void{
var _local2:String;
var _local3:String;
_local2 = _arg1.target;
_local3 = _arg1.event;
switch (_local2){
case "events":
MochiEvents.triggerEvent(_arg1.event, _arg1.args);
break;
case "coins":
MochiCoins.triggerEvent(_arg1.event, _arg1.args);
break;
case "sync":
servicesSync.triggerEvent(_arg1.event, _arg1.args);
break;
};
}
private static function urlOptions(_arg1:Object):Object{
var _local2:Object;
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:Array;
_local2 = {};
if (_arg1.stage){
_local3 = _arg1.stage.loaderInfo.parameters.mochiad_options;
} else {
_local3 = _arg1.loaderInfo.parameters.mochiad_options;
};
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_arg1 != null){
if ((_arg1 is Sprite)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
private static function loadError(_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_clip._queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function loadLCBridge(_arg1:Object):void{
var loader:Loader;
var mochiLCURL:String;
var req:URLRequest;
var complete:Function;
var clip = _arg1;
loader = new Loader();
mochiLCURL = (_servURL + _mochiLC);
req = new URLRequest(mochiLCURL);
complete = function (_arg1:Object):void{
_mochiLocalConnection = MovieClip(loader.content);
listen();
};
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var _local3:String;
var _local4:String;
var _local5:URLRequest;
var _local6:URLVariables;
_local3 = ("_mochiservices_com_" + _arg1);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(_arg2).servURL){
_servURL = urlOptions(_arg2).servURL;
};
_local4 = (_servURL + _services);
if (urlOptions(_arg2).servicesURL){
_local4 = urlOptions(_arg2).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(_local4);
_clip = createEmptyMovieClip(_arg2, _local3, 10336, false);
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
_local5 = new URLRequest(_local4);
_local6 = new URLVariables();
_local6.listenLC = _listenChannelName;
_local6.mochiad_options = _arg2.loaderInfo.parameters.mochiad_options;
_local6.api_version = getVersion();
if (widget){
_local6.widget = true;
};
_local5.data = _local6;
_loader.load(_local5);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_clip._nextcallbackID = 0;
_clip._callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
warnID(id, false);
if ((clip is DisplayObject)){
if (clip.stage == null){
trace("MochiServices connect requires the containing clip be attached to the stage");
};
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{
var mc:MovieClip;
var parent = _arg1;
var name = _arg2;
var depth = _arg3;
var doAdd = _arg4;
mc = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
try {
parent[name] = mc;
} catch(e:Error) {
throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
mc["_name"] = name;
return (mc);
}
public static function bringToTop(_arg1:Event=null):void{
var e = _arg1;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 37
//MochiSocial (mochi.as3.MochiSocial)
package mochi.as3 {
public class MochiSocial {
public static const LOGGED_IN:String = "LoggedIn";
public static const PROFILE_HIDE:String = "ProfileHide";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const IO_ERROR:String = "IOError";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const USER_INFO:String = "UserInfo";
public static const ERROR:String = "Error";
public static const LOGIN_SHOW:String = "LoginShow";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_SHOWN:String = "LoginShown";
public static const LOGIN_HIDE:String = "LoginHide";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static var _user_info:Object = null;
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("coins_saveUserProperties", _arg1);
}
public static function get loggedIn():Boolean{
return (!((_user_info == null)));
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function getUserInfo():void{
MochiServices.send("coins_getUserInfo");
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showLoginWidget", {options:_arg1});
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function requestLogin():void{
MochiServices.send("coins_requestLogin");
}
public static function getAPIURL():String{
if (!_user_info){
return (null);
};
return (_user_info.api_url);
}
public static function hideLoginWidget():void{
MochiServices.send("coins_hideLoginWidget");
}
public static function getAPIToken():String{
if (!_user_info){
return (null);
};
return (_user_info.api_token);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_user_info = _arg1;
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_user_info = null;
});
}
}//package mochi.as3
Section 38
//MochiSync (mochi.as3.MochiSync)
package mochi.as3 {
import flash.utils.*;
public dynamic class MochiSync extends Proxy {
private var _syncContainer:Object;
public static var SYNC_PROPERTY:String = "UpdateProperty";
public static var SYNC_REQUEST:String = "SyncRequest";
public function MochiSync():void{
_syncContainer = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
switch (_arg1){
case SYNC_REQUEST:
MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY:
_syncContainer[_arg2.name] = _arg2.value;
break;
};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
return (_syncContainer[_arg1]);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:String;
if (_syncContainer[_arg1] == _arg2){
return;
};
_local3 = _arg1.toString();
_syncContainer[_local3] = _arg2;
MochiServices.send("sync_propUpdate", {name:_local3, value:_arg2});
}
}
}//package mochi.as3
Section 39
//MochiUserData (mochi.as3.MochiUserData)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class MochiUserData extends EventDispatcher {
public var callback:Function;// = null
public var error:Event;// = null
public var key:String;// = null
public var operation:String;// = null
public var data;// = null
public var _loader:URLLoader;
public function MochiUserData(_arg1:String="", _arg2:Function=null){
key = null;
data = null;
error = null;
operation = null;
callback = null;
super();
this.key = _arg1;
this.callback = _arg2;
}
public function securityErrorHandler(_arg1:SecurityErrorEvent):void{
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _arg1.toString())));
}
public function putEvent(_arg1):void{
request("put", serialize(_arg1));
}
public function request(_arg1:String, _arg2:ByteArray):void{
var api_url:String;
var api_token:String;
var args:URLVariables;
var req:URLRequest;
var _operation = _arg1;
var _data = _arg2;
operation = _operation;
api_url = MochiSocial.getAPIURL();
api_token = MochiSocial.getAPIToken();
if ((((api_url == null)) || ((api_token == null)))){
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in"));
return;
};
_loader = new URLLoader();
args = new URLVariables();
args.op = _operation;
args.key = key;
req = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString()));
req.method = URLRequestMethod.POST;
req.contentType = "application/x-mochi-userdata";
req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)];
req.data = _data;
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.addEventListener(Event.COMPLETE, completeHandler);
_loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
try {
_loader.load(req);
} catch(e:SecurityError) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + e.toString())));
};
}
public function performCallback():void{
try {
callback(this);
} catch(e:Error) {
trace(("[MochiUserData] exception during callback: " + e));
};
}
public function serialize(_arg1):ByteArray{
var _local2:ByteArray;
_local2 = new ByteArray();
_local2.objectEncoding = ObjectEncoding.AMF3;
_local2.writeObject(_arg1);
_local2.compress();
return (_local2);
}
public function errorHandler(_arg1:IOErrorEvent):void{
data = null;
error = _arg1;
if (callback != null){
performCallback();
} else {
dispatchEvent(_arg1);
};
close();
}
public function completeHandler(_arg1:Event):void{
var event = _arg1;
try {
if (_loader.data.length){
data = deserialize(_loader.data);
} else {
data = null;
};
} catch(e:Error) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + e.toString())));
return;
};
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function getEvent():void{
request("get", serialize(null));
}
override public function toString():String{
return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]"));
}
public function close():void{
if (_loader){
_loader.removeEventListener(Event.COMPLETE, completeHandler);
_loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.close();
_loader = null;
};
error = null;
callback = null;
}
public function deserialize(_arg1:ByteArray){
_arg1.objectEncoding = ObjectEncoding.AMF3;
_arg1.uncompress();
return (_arg1.readObject());
}
public static function get(_arg1:String, _arg2:Function):void{
var _local3:MochiUserData;
_local3 = new MochiUserData(_arg1, _arg2);
_local3.getEvent();
}
public static function put(_arg1:String, _arg2, _arg3:Function):void{
var _local4:MochiUserData;
_local4 = new MochiUserData(_arg1, _arg3);
_local4.putEvent(_arg2);
}
}
}//package mochi.as3
Section 40
//Bg (Bg)
package {
import flash.media.*;
public dynamic class Bg extends Sound {
}
}//package
Section 41
//Car (Car)
package {
import flash.display.*;
public dynamic class Car extends MovieClip {
public var right_car:MovieClip;
public var left_hit:MovieClip;
public var leftside_hit:MovieClip;
public var left_car:MovieClip;
public var rightside_hit:MovieClip;
public var right_hit:MovieClip;
public function Car(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 42
//Count (Count)
package {
import flash.media.*;
public dynamic class Count extends Sound {
}
}//package
Section 43
//Crash (Crash)
package {
import flash.media.*;
public dynamic class Crash extends Sound {
}
}//package
Section 44
//Enemy (Enemy)
package {
import flash.display.*;
public dynamic class Enemy extends MovieClip {
public var left_AI:MovieClip;
public function Enemy(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 45
//finishMc (finishMc)
package {
import flash.display.*;
public dynamic class finishMc extends MovieClip {
}
}//package
Section 46
//Flag (Flag)
package {
import flash.display.*;
public dynamic class Flag extends MovieClip {
}
}//package
Section 47
//flag1 (flag1)
package {
import flash.display.*;
public dynamic class flag1 extends MovieClip {
}
}//package
Section 48
//flag2 (flag2)
package {
import flash.display.*;
public dynamic class flag2 extends MovieClip {
public function flag2(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 49
//Hit (Hit)
package {
import flash.media.*;
public dynamic class Hit extends Sound {
}
}//package
Section 50
//HitTest (HitTest)
package {
import flash.display.*;
import flash.geom.*;
public class HitTest {
protected static function getDrawMatrix(_arg1:DisplayObject, _arg2:Rectangle, _arg3:Number):Matrix{
var _local4:Point;
var _local5:Matrix;
var _local6:Matrix;
_local6 = _arg1.root.transform.concatenatedMatrix;
_local4 = _arg1.localToGlobal(new Point());
_local5 = _arg1.transform.concatenatedMatrix;
_local5.tx = (_local4.x - _arg2.x);
_local5.ty = (_local4.y - _arg2.y);
_local5.a = (_local5.a / _local6.a);
_local5.d = (_local5.d / _local6.d);
if (_arg3 != 1){
_local5.scale(_arg3, _arg3);
};
return (_local5);
}
public static function complexHitTestObject(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Number=1):Boolean{
return (!((complexIntersectionRectangle(_arg1, _arg2, _arg3).width == 0)));
}
public static function complexIntersectionRectangle(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Number=1):Rectangle{
var _local4:Rectangle;
var _local5:BitmapData;
var _local6:Rectangle;
if (_arg3 <= 0){
throw (new Error("ArgumentError: Error #5001: Invalid value for accurracy", 5001));
};
if (!_arg1.hitTestObject(_arg2)){
return (new Rectangle());
};
_local4 = intersectionRectangle(_arg1, _arg2);
if (((((_local4.width * _arg3) < 1)) || (((_local4.height * _arg3) < 1)))){
return (new Rectangle());
};
_local5 = new BitmapData((_local4.width * _arg3), (_local4.height * _arg3), false, 0);
_local5.draw(_arg1, HitTest.getDrawMatrix(_arg1, _local4, _arg3), new ColorTransform(1, 1, 1, 1, 0xFF, -255, -255, 0xFF));
_local5.draw(_arg2, HitTest.getDrawMatrix(_arg2, _local4, _arg3), new ColorTransform(1, 1, 1, 1, 0xFF, 0xFF, 0xFF, 0xFF), BlendMode.DIFFERENCE);
_local6 = _local5.getColorBoundsRect(4294967295, 4278255615);
_local5.dispose();
if (_arg3 != 1){
_local6.x = (_local6.x / _arg3);
_local6.y = (_local6.y / _arg3);
_local6.width = (_local6.width / _arg3);
_local6.height = (_local6.height / _arg3);
};
_local6.x = (_local6.x + _local4.x);
_local6.y = (_local6.y + _local4.y);
return (_local6);
}
public static function intersectionRectangle(_arg1:DisplayObject, _arg2:DisplayObject):Rectangle{
var _local3:Rectangle;
var _local4:Rectangle;
var _local5:Rectangle;
if (((((!(_arg1.root)) || (!(_arg2.root)))) || (!(_arg1.hitTestObject(_arg2))))){
return (new Rectangle());
};
_local3 = _arg1.getBounds(_arg1.root);
_local4 = _arg2.getBounds(_arg2.root);
_local5 = new Rectangle();
_local5.x = Math.max(_local3.x, _local4.x);
_local5.y = Math.max(_local3.y, _local4.y);
_local5.width = Math.min(((_local3.x + _local3.width) - _local5.x), ((_local4.x + _local4.width) - _local5.x));
_local5.height = Math.min(((_local3.y + _local3.height) - _local5.y), ((_local4.y + _local4.height) - _local5.y));
return (_local5);
}
}
}//package
Section 51
//Lamp (Lamp)
package {
import flash.display.*;
public dynamic class Lamp extends MovieClip {
public function Lamp(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 52
//Lamps (Lamps)
package {
import flash.display.*;
public dynamic class Lamps extends MovieClip {
}
}//package
Section 53
//lapFinishMsg (lapFinishMsg)
package {
import flash.display.*;
import flash.text.*;
public dynamic class lapFinishMsg extends MovieClip {
public var msg:TextField;
public var continueMc:MovieClip;
}
}//package
Section 54
//Lines (Lines)
package {
import flash.display.*;
public dynamic class Lines extends MovieClip {
}
}//package
Section 55
//myvar (myvar)
package {
import flash.media.*;
public class myvar {
public static var levelscore:Number = 0;
public static var congrats:Boolean = false;
public static var obs_hit:Boolean = false;
public static var skitsc:SoundChannel = new SoundChannel();
public static var countsc:SoundChannel = new SoundChannel();
public static var gamescore:Number = 0;
public static var sc1:SoundChannel = new SoundChannel();
public static var soundtoggle:Boolean = true;
public static var sc2:SoundChannel = new SoundChannel();
public static var hitsc:SoundChannel = new SoundChannel();
public static var enemy_hit:Boolean = false;
public static var levels:Number = 1;
public static var damage:Number = 50;
}
}//package
Section 56
//Obstacles (Obstacles)
package {
import flash.display.*;
public dynamic class Obstacles extends MovieClip {
public var cone:MovieClip;
public function Obstacles(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 57
//Skit (Skit)
package {
import flash.media.*;
public dynamic class Skit extends Sound {
}
}//package
Section 58
//Start_line (Start_line)
package {
import flash.display.*;
public dynamic class Start_line extends MovieClip {
public function Start_line(){
addFrameScript(0, frame1, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 59
//startFlag (startFlag)
package {
import flash.display.*;
public dynamic class startFlag extends MovieClip {
public function startFlag(){
addFrameScript(0, frame1, 59, frame60);
}
function frame1(){
stop();
}
function frame60(){
stop();
}
}
}//package