Section 1
//instructionsPage_anim_47 (45_fla.instructionsPage_anim_47)
package 45_fla {
import flash.display.*;
import src.*;
public dynamic class instructionsPage_anim_47 extends MovieClip {
public var maskBar:FonWhite;
}
}//package 45_fla
Section 2
//star_anim_12 (45_fla.star_anim_12)
package 45_fla {
import flash.display.*;
import src.Levels.LevelGrafObject.Star.*;
public dynamic class star_anim_12 extends MovieClip {
public function star_anim_12(){
addFrameScript(354, frame355);
}
function frame355(){
(this.parent as Star).toDeath();
}
}
}//package 45_fla
Section 3
//Back (gs.easing.Back)
package gs.easing {
public class Back {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5))) + _arg2));
};
_arg1 = (_arg1 - 2);
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 2)) + _arg2));
}
}
}//package gs.easing
Section 4
//Circ (gs.easing.Circ)
package gs.easing {
public class Circ {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2));
}
}
}//package gs.easing
Section 5
//Linear (gs.easing.Linear)
package gs.easing {
public class Linear {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package gs.easing
Section 6
//AutoAlphaPlugin (gs.plugins.AutoAlphaPlugin)
package gs.plugins {
import gs.*;
import flash.display.*;
public class AutoAlphaPlugin extends TweenPlugin {
protected var _tweenVisible:Boolean;
protected var _tween:TweenLite;
protected var _visible:Boolean;
protected var _target:Object;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function AutoAlphaPlugin(){
this.propName = "autoAlpha";
this.overwriteProps = ["alpha", "visible"];
this.onComplete = onCompleteTween;
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
if (((!((_target.visible == true))) && (_tweenVisible))){
_target.visible = true;
};
}
public function onCompleteTween():void{
if (((((_tweenVisible) && (!((_tween.vars.runBackwards == true))))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_visible = Boolean(!((_arg2 == 0)));
_tweenVisible = true;
addTween(_arg1, "alpha", _arg1.alpha, _arg2, "alpha");
return (true);
}
override public function killProps(_arg1:Object):void{
super.killProps(_arg1);
_tweenVisible = !(Boolean(("visible" in _arg1)));
}
}
}//package gs.plugins
Section 7
//EndArrayPlugin (gs.plugins.EndArrayPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class EndArrayPlugin extends TweenPlugin {
protected var _info:Array;
protected var _a:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function EndArrayPlugin(){
_info = [];
super();
this.propName = "endArray";
this.overwriteProps = ["endArray"];
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:ArrayTweenInfo;
var _local4:Number;
var _local5:int;
if (this.round){
_local2 = (_info.length - 1);
while (_local2 > -1) {
_local3 = _info[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local5 = ((_local4)<0) ? -1 : 1;
_a[_local3.index] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4);
_local2--;
};
} else {
_local2 = (_info.length - 1);
while (_local2 > -1) {
_local3 = _info[_local2];
_a[_local3.index] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
};
}
public function init(_arg1:Array, _arg2:Array):void{
var _local3:int;
_a = _arg1;
_local3 = (_arg2.length - 1);
while (_local3 > -1) {
if (((!((_arg1[_local3] == _arg2[_local3]))) && (!((_arg1[_local3] == null))))){
_info[_info.length] = new ArrayTweenInfo(_local3, _a[_local3], (_arg2[_local3] - _a[_local3]));
};
_local3--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (false);
};
init((_arg1 as Array), _arg2);
return (true);
}
}
}//package gs.plugins
Section 8
//FramePlugin (gs.plugins.FramePlugin)
package gs.plugins {
import gs.*;
import flash.display.*;
public class FramePlugin extends TweenPlugin {
public var frame:int;
protected var _target:MovieClip;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function FramePlugin(){
this.propName = "frame";
this.overwriteProps = ["frame"];
this.round = true;
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.gotoAndStop(this.frame);
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is MovieClip))) || (isNaN(_arg2)))){
return (false);
};
_target = (_arg1 as MovieClip);
this.frame = _target.currentFrame;
addTween(this, "frame", this.frame, _arg2, "frame");
return (true);
}
}
}//package gs.plugins
Section 9
//RemoveTintPlugin (gs.plugins.RemoveTintPlugin)
package gs.plugins {
public class RemoveTintPlugin extends TintPlugin {
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function RemoveTintPlugin(){
this.propName = "removeTint";
}
}
}//package gs.plugins
Section 10
//TintPlugin (gs.plugins.TintPlugin)
package gs.plugins {
import gs.*;
import flash.display.*;
import flash.geom.*;
import gs.utils.tween.*;
public class TintPlugin extends TweenPlugin {
protected var _ct:ColorTransform;
protected var _ignoreAlpha:Boolean;
protected var _target:DisplayObject;
public static const VERSION:Number = 1.1;
public static const API:Number = 1;
protected static var _props:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset"];
public function TintPlugin(){
this.propName = "tint";
this.overwriteProps = ["tint"];
}
override public function set changeFactor(_arg1:Number):void{
var _local2:ColorTransform;
updateTweens(_arg1);
if (_ignoreAlpha){
_local2 = _target.transform.colorTransform;
_ct.alphaMultiplier = _local2.alphaMultiplier;
_ct.alphaOffset = _local2.alphaOffset;
};
_target.transform.colorTransform = _ct;
}
public function init(_arg1:DisplayObject, _arg2:ColorTransform):void{
var _local3:int;
var _local4:String;
_target = _arg1;
_ct = _target.transform.colorTransform;
_local3 = (_props.length - 1);
while (_local3 > -1) {
_local4 = _props[_local3];
if (_ct[_local4] != _arg2[_local4]){
_tweens[_tweens.length] = new TweenInfo(_ct, _local4, _ct[_local4], (_arg2[_local4] - _ct[_local4]), "tint", false);
};
_local3--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:ColorTransform;
if (!(_arg1 is DisplayObject)){
return (false);
};
_local4 = new ColorTransform();
if (((!((_arg2 == null))) && (!((_arg3.exposedVars.removeTint == true))))){
_local4.color = uint(_arg2);
};
_ignoreAlpha = true;
init((_arg1 as DisplayObject), _local4);
return (true);
}
}
}//package gs.plugins
Section 11
//TweenPlugin (gs.plugins.TweenPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class TweenPlugin {
public var overwriteProps:Array;
protected var _tweens:Array;
public var round:Boolean;
public var onComplete:Function;
public var propName:String;
protected var _changeFactor:Number;// = 0
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function TweenPlugin(){
_tweens = [];
_changeFactor = 0;
super();
}
protected function updateTweens(_arg1:Number):void{
var _local2:int;
var _local3:TweenInfo;
var _local4:Number;
var _local5:int;
if (this.round){
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local5 = ((_local4)<0) ? -1 : 1;
_local3.target[_local3.property] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4);
_local2--;
};
} else {
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
};
}
public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_changeFactor = _arg1;
}
protected function addTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4, _arg5:String=null):void{
var _local6:Number;
if (_arg4 != null){
_local6 = ((typeof(_arg4))=="number") ? (_arg4 - _arg3) : Number(_arg4);
if (_local6 != 0){
_tweens[_tweens.length] = new TweenInfo(_arg1, _arg2, _arg3, _local6, ((_arg5) || (_arg2)), false);
};
};
}
public function killProps(_arg1:Object):void{
var _local2:int;
_local2 = (this.overwriteProps.length - 1);
while (_local2 > -1) {
if ((this.overwriteProps[_local2] in _arg1)){
this.overwriteProps.splice(_local2, 1);
};
_local2--;
};
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
if ((_tweens[_local2].name in _arg1)){
_tweens.splice(_local2, 1);
};
_local2--;
};
}
public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
addTween(_arg1, this.propName, _arg1[this.propName], _arg2, this.propName);
return (true);
}
public function get changeFactor():Number{
return (_changeFactor);
}
public static function activate(_arg1:Array):Boolean{
var _local2:int;
var _local3:Object;
_local2 = (_arg1.length - 1);
while (_local2 > -1) {
_local3 = new (_arg1[_local2]);
TweenLite.plugins[_local3.propName] = _arg1[_local2];
_local2--;
};
return (true);
}
}
}//package gs.plugins
Section 12
//VisiblePlugin (gs.plugins.VisiblePlugin)
package gs.plugins {
import gs.*;
import flash.display.*;
public class VisiblePlugin extends TweenPlugin {
protected var _tween:TweenLite;
protected var _visible:Boolean;
protected var _target:Object;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function VisiblePlugin(){
this.propName = "visible";
this.overwriteProps = ["visible"];
this.onComplete = onCompleteTween;
}
override public function set changeFactor(_arg1:Number):void{
if (_target.visible != true){
_target.visible = true;
};
}
public function onCompleteTween():void{
if (((!((_tween.vars.runBackwards == true))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_visible = Boolean(_arg2);
return (true);
}
}
}//package gs.plugins
Section 13
//VolumePlugin (gs.plugins.VolumePlugin)
package gs.plugins {
import gs.*;
import flash.display.*;
import flash.media.*;
public class VolumePlugin extends TweenPlugin {
protected var _st:SoundTransform;
protected var _target:Object;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function VolumePlugin(){
this.propName = "volume";
this.overwriteProps = ["volume"];
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.soundTransform = _st;
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((isNaN(_arg2)) || (!(_arg1.hasOwnProperty("soundTransform"))))){
return (false);
};
_target = _arg1;
_st = _target.soundTransform;
addTween(_st, "volume", _st.volume, _arg2, "volume");
return (true);
}
}
}//package gs.plugins
Section 14
//ArrayTweenInfo (gs.utils.tween.ArrayTweenInfo)
package gs.utils.tween {
public class ArrayTweenInfo {
public var change:Number;
public var index:uint;
public var start:Number;
public function ArrayTweenInfo(_arg1:uint, _arg2:Number, _arg3:Number){
this.index = _arg1;
this.start = _arg2;
this.change = _arg3;
}
}
}//package gs.utils.tween
Section 15
//TweenInfo (gs.utils.tween.TweenInfo)
package gs.utils.tween {
public class TweenInfo {
public var start:Number;
public var name:String;
public var change:Number;
public var target:Object;
public var property:String;
public var isPlugin:Boolean;
public function TweenInfo(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean){
this.target = _arg1;
this.property = _arg2;
this.start = _arg3;
this.change = _arg4;
this.name = _arg5;
this.isPlugin = _arg6;
}
}
}//package gs.utils.tween
Section 16
//TweenLite (gs.TweenLite)
package gs {
import flash.events.*;
import flash.display.*;
import gs.utils.tween.*;
import gs.plugins.*;
import flash.utils.*;
public class TweenLite {
public var delay:Number;
protected var _hasUpdate:Boolean;
protected var _hasPlugins:Boolean;
public var started:Boolean;
public var initted:Boolean;
public var active:Boolean;
public var startTime:Number;
public var target:Object;
public var duration:Number;
public var gc:Boolean;
public var vars:Object;
public var ease:Function;
public var tweens:Array;
public var exposedVars:Object;
public var combinedTimeScale:Number;
public var initTime:Number;
public static const version:Number = 10.09;
private static var _timer:Timer = new Timer(2000);
public static var defaultEase:Function = TweenLite.easeOut;
public static var plugins:Object = {};
public static var currentTime:uint;
public static var masterList:Dictionary = new Dictionary(false);
protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, persist:1, renderOnStart:1, proxiedEase:1, easeParams:1, yoyo:1, loop:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, orientToBezier:1, timeScale:1};
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var timingSprite:Sprite = new Sprite();
public static var overwriteManager:Object;
private static var _tlInitted:Boolean;
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
var _local4:int;
super();
if (_arg1 == null){
return;
};
if (!_tlInitted){
TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin]);
currentTime = getTimer();
timingSprite.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_timer.addEventListener("timer", killGarbage, false, 0, true);
_timer.start();
_tlInitted = true;
};
this.vars = _arg3;
this.duration = ((_arg2) || (0.001));
this.delay = ((_arg3.delay) || (0));
this.combinedTimeScale = ((_arg3.timeScale) || (1));
this.active = Boolean((((_arg2 == 0)) && ((this.delay == 0))));
this.target = _arg1;
if (typeof(this.vars.ease) != "function"){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
this.ease = this.vars.ease;
this.exposedVars = ((this.vars.isTV)==true) ? this.vars.exposedVars : this.vars;
this.tweens = [];
this.initTime = currentTime;
this.startTime = (this.initTime + (this.delay * 1000));
_local4 = ((((_arg3.overwrite == undefined)) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
if (((!((_arg1 in masterList))) || ((_local4 == 1)))){
masterList[_arg1] = [this];
} else {
masterList[_arg1].push(this);
};
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (this.active))){
initTweenVals();
if (this.active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
if (((((!((this.exposedVars.visible == null))) && ((this.vars.runBackwards == true)))) && ((this.target is DisplayObject)))){
this.target.visible = this.exposedVars.visible;
};
};
}
public function set enabled(_arg1:Boolean):void{
var _local2:Array;
var _local3:Boolean;
var _local4:int;
if (_arg1){
if (!(this.target in masterList)){
masterList[this.target] = [this];
} else {
_local2 = masterList[this.target];
_local4 = (_local2.length - 1);
while (_local4 > -1) {
if (_local2[_local4] == this){
_local3 = true;
break;
};
_local4--;
};
if (!_local3){
_local2[_local2.length] = this;
};
};
};
this.gc = (_arg1) ? false : true;
if (this.gc){
this.active = false;
} else {
this.active = this.started;
};
}
public function clear():void{
this.tweens = [];
this.vars = (this.exposedVars = {ease:this.vars.ease});
_hasUpdate = false;
}
public function render(_arg1:uint):void{
var _local2:Number;
var _local3:Number;
var _local4:TweenInfo;
var _local5:int;
_local2 = ((_arg1 - this.startTime) * 0.001);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4.target[_local4.property] = (_local4.start + (_local3 * _local4.change));
_local5--;
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
public function activate():void{
this.started = (this.active = true);
if (!this.initted){
initTweenVals();
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
}
public function get enabled():Boolean{
return ((this.gc) ? false : true);
}
public function initTweenVals():void{
var _local1:String;
var _local2:int;
var _local3:*;
var _local4:TweenInfo;
if (((!((this.exposedVars.timeScale == undefined))) && ((this.target is TweenLite)))){
this.tweens[this.tweens.length] = new TweenInfo(this.target, "timeScale", this.target.timeScale, (this.exposedVars.timeScale - this.target.timeScale), "timeScale", false);
};
for (_local1 in this.exposedVars) {
if ((_local1 in _reservedProps)){
} else {
if ((_local1 in plugins)){
_local3 = new (plugins[_local1]);
if (_local3.onInitTween(this.target, this.exposedVars[_local1], this) == false){
this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false);
} else {
this.tweens[this.tweens.length] = new TweenInfo(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true);
_hasPlugins = true;
};
} else {
this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false);
};
};
};
if (this.vars.runBackwards == true){
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
_local4 = this.tweens[_local2];
this.tweens[_local2].start = (_local4.start + _local4.change);
_local4.change = -(_local4.change);
_local2--;
};
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
if (((TweenLite.overwriteManager.enabled) && ((this.target in masterList)))){
overwriteManager.manageOverwrites(this, masterList[this.target]);
};
this.initted = true;
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function killVars(_arg1:Object):void{
if (overwriteManager.enabled){
overwriteManager.killVars(_arg1, this.exposedVars, this.tweens);
};
}
public function complete(_arg1:Boolean=false):void{
var _local2:int;
if (!_arg1){
if (!this.initted){
initTweenVals();
};
this.startTime = (currentTime - ((this.duration * 1000) / this.combinedTimeScale));
render(currentTime);
return;
};
if (_hasPlugins){
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
if (((this.tweens[_local2].isPlugin) && (!((this.tweens[_local2].target.onComplete == null))))){
this.tweens[_local2].target.onComplete();
};
_local2--;
};
};
if (this.vars.persist != true){
this.enabled = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public static function updateAll(_arg1:Event=null):void{
var _local2:uint;
var _local3:Dictionary;
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
_local2 = (currentTime = getTimer());
_local3 = masterList;
for each (_local4 in _local3) {
_local5 = (_local4.length - 1);
while (_local5 > -1) {
_local6 = _local4[_local5];
if (_local6.active){
_local6.render(_local2);
} else {
if (_local6.gc){
_local4.splice(_local5, 1);
} else {
if (_local2 >= _local6.startTime){
_local6.activate();
_local6.render(_local2);
};
};
};
_local5--;
};
};
}
public static function removeTween(_arg1:TweenLite, _arg2:Boolean=true):void{
if (_arg1 != null){
if (_arg2){
_arg1.clear();
};
_arg1.enabled = false;
};
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
if (((!((_arg1 == null))) && ((_arg1 in masterList)))){
_local3 = masterList[_arg1];
_local4 = (_local3.length - 1);
while (_local4 > -1) {
_local5 = _local3[_local4];
if (((_arg2) && (!(_local5.gc)))){
_local5.complete(false);
};
_local5.clear();
_local4--;
};
delete masterList[_arg1];
};
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
protected static function killGarbage(_arg1:TimerEvent):void{
var _local2:Dictionary;
var _local3:Object;
_local2 = masterList;
for (_local3 in _local2) {
if (_local2[_local3].length == 0){
delete _local2[_local3];
};
};
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, overwrite:0}));
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 17
//MochiAd (mochi.as3.MochiAd)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showClickAwayAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_timeout:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var sendHostProgress:Boolean;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
sendHostProgress = false;
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
_local3 = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.root == null){
_local3 = true;
};
if (_local3){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType == "application"){
return (_local2);
};
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (_arg1.origFrameRate != undefined){
_arg1.stage.frameRate = _arg1.origFrameRate;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad._containerLCName != undefined){
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"});
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
};
return (_local3);
}
public static function _cleanup(_arg1:Object):void{
var idx:Number;
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
idx = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
//unresolved jump
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest(((server + ".swf?cacheBust=") + new Date().getTime()));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (_arg1:IOErrorEvent):void{
});
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
if (typeof(_arg1[_local4[_local5]]) == "function"){
return (_arg1[_local4[_local5]].apply(_arg1, _arg3));
};
return (undefined);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function adShowing(_arg1:Object):void{
_arg1.origFrameRate = _arg1.stage.frameRate;
_arg1.stage.frameRate = 30;
}
public static function getValue(_arg1:Object, _arg2:String):Object{
var _local3:Array;
var _local4:Number;
_local3 = _arg2.split(".");
_local4 = 0;
while (_local4 < (_local3.length - 1)) {
if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local3[_local4]];
_local4++;
};
return (_arg1[_local3[_local4]]);
}
public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{
var _local4:Object;
var _local5:Object;
switch (_arg3.id){
case "setValue":
MochiAd.setValue(_arg1, _arg3.objectName, _arg3.value);
break;
case "getValue":
_local4 = MochiAd.getValue(_arg1, _arg3.objectName);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(_arg1, _arg3.method, _arg3.args);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5);
break;
};
}
public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return;
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
_arg1[_local4[_local5]] = _arg3;
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_w:Number;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var progress:Number;
var f:Function;
var sendHostProgress:Boolean;
var fn:Function;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
}, ad_skipped:function ():void{
}, ad_progress:function (_arg1:Number):void{
}, progress_override:function (_arg1:Object):Number{
return (NaN);
}, bar_offset:0};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
return;
};
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
MochiAd._cleanup(mc);
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = (10 + options.bar_offset);
bar.y = (h - 20);
};
bar_w = ((w - bar.x) - 10);
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo(bar_w, 0);
backing.lineTo(bar_w, 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo(bar_w, 0);
inside.lineTo(bar_w, 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo(bar_w, 0);
outline.lineTo(bar_w, 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
progress = Math.min(1, options.progress_override(clip));
f = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
if (!isNaN(progress)){
complete = (progress == 1);
} else {
if (clip.loaderInfo.bytesLoaded == clip.loaderInfo.bytesTotal){
complete = true;
} else {
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
mc.rpcTestFn = function (_arg1:String):Object{
return (_arg1);
};
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (_arg1:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Object;
var _local11:Number;
var _local12:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
_local7 = Math.min(1, options.progress_override(_local1));
if (_local7 == 1){
complete = true;
};
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
_local8 = ((100 * _local6) / _local5);
if (!isNaN(_local7)){
_local8 = (100 * _local7);
};
_local9 = ((100 * _local3) / chk.ad_msec);
_local10 = this._mochiad_bar._inside;
_local11 = Math.min(100, Math.min(((_local8) || (0)), _local9));
_local11 = Math.max(this.last_pcnt, _local11);
this.last_pcnt = _local11;
_local10.scaleX = (_local11 * 0.01);
options.ad_progress(_local11);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local8});
if (_local8 >= 100){
sendHostProgress = false;
};
};
if (!chk.showing){
_local12 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local12 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((_local3 > chk.ad_timeout)) && ((_local8 == 100)))){
options.ad_failed();
_local4 = true;
};
};
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (unloaded){
MochiAd.unload(_local1);
} else {
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
MochiAd.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
MochiAd.showInterLevelAd(_arg1);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package mochi.as3
Section 18
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const LOGGED_IN:String = "LoggedIn";
public static const STORE_ITEMS:String = "StoreItems";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const ITEM_NEW:String = "ItemNew";
public static const USER_INFO:String = "UserInfo";
public static const IO_ERROR:String = "IOError";
public static const ITEM_OWNED:String = "ItemOwned";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const ERROR:String = "Error";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_HIDE:String = "LoginHide";
public static const LOGIN_SHOW:String = "LoginShow";
public static const STORE_SHOW:String = "StoreShow";
public static const PROFILE_HIDE:String = "ProfileHide";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("coins_saveUserProperties", _arg1);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showLoginWidget", {options:_arg1});
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showStore(_arg1:Object=null):void{
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
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 hideLoginWidget():void{
MochiServices.send("coins_hideLoginWidget");
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
}
}//package mochi.as3
Section 19
//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 20
//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 21
//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){
_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 22
//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)){
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
} else {
if (Math.floor(n) != n){
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
//unresolved jump
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
//unresolved jump
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
//unresolved jump
};
};
};
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);
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)){
} else {
if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){
} else {
if (Math.floor(_arg1) != _arg1){
};
_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 23
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
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];
//unresolved jump
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
};
};
};
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)))){
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){
return;
};
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
//unresolved jump
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
//unresolved jump
};
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:
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.3 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;
MochiServices.disconnect();
MochiServices.onError("IOError");
}
private static function initComChannels():void{
if (!_connected){
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, clip:_container, 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;
};
}
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 (((!(_connected)) && ((_clip == null)))){
_connecting = true;
init(id, clip);
};
//unresolved jump
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
};
};
};
}
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) {
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 24
//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 25
//LevelData1_1 (src.Levels.LevelDataObj.LevelData1_1)
package src.Levels.LevelDataObj {
public class LevelData1_1 extends LevelDataObj {
public function LevelData1_1(){
this.hGridCount = 12;
this.vGridCount = 12;
}
}
}//package src.Levels.LevelDataObj
Section 26
//LevelDataObj (src.Levels.LevelDataObj.LevelDataObj)
package src.Levels.LevelDataObj {
public class LevelDataObj {
public var hGridCount:Number;
public var vGridCount:Number;
public static const HOUSE:Number = 1000;
public static const EMPTY:Number = 0;
public static const BALLOON:Number = 1;
public static const BOOM_ANIMATION:Number = 4;
public static const COIN:Number = 5;
public static const MINE:Number = 3;
public static const CLOUD:Number = 2;
}
}//package src.Levels.LevelDataObj
Section 27
//Balloon (src.Levels.LevelGrafObject.Balloon.Balloon)
package src.Levels.LevelGrafObject.Balloon {
import flash.events.*;
import flash.display.*;
import src.*;
import src.Levels.LevelGrafObject.Mine.*;
import src.Levels.LevelGrafObject.House.*;
import src.SoundTools.*;
import src.Levels.LevelDataObj.*;
import src.Levels.LevelGrafObject.RewritePositionObject.MovebleObject.*;
public class Balloon extends MovebleObject {
public var balloon_anim:MovieClip;
private var isRemoveAfterCome:Boolean;// = false
private var bombs_array:Array;
private var house:House;// = null
private var balloonDefense:Number;
private var cord:Sprite;// = null
private var isBlowUp:Boolean;// = false
public var upPowerPlus:Number;// = 0
private var plusX:Number;
private var plusY:Number;
public static const MAX_HEIGHT_DELTA:Number = -90;
public static const MIN_HEIGHT_DELTA:Number = -50;
public static const WIDTH_DELTA:Number = 65;
public function Balloon(_arg1:Number=-2, _arg2:Number=-1){
var _local3:Number;
house = null;
upPowerPlus = 0;
cord = null;
bombs_array = [];
isBlowUp = false;
isRemoveAfterCome = false;
super();
this.setItemNumber(LevelDataObj.BALLOON);
this.balloonDefense = Main.root.savesProgress.getBalloonDefense();
this.setAccelY(_arg1);
this.setSpeedY(_arg2);
this.upPowerPlus = Main.root.savesProgress.getBalloonUpPower();
_local3 = Math.round((Math.random() * this.balloon_anim.totalFrames));
this.balloon_anim.gotoAndPlay(_local3);
this.setListeners();
}
override public function moveByOtherPower(){
var _local1:Number;
var _local2:Number;
_local1 = (((this.house.x + this.plusX) - this.x) / 5);
_local2 = (((this.house.y + this.plusY) - this.y) / 5);
if ((((((((_local1 > -0.2)) && ((_local1 < 0.2)))) && ((_local2 > -0.2)))) && ((_local2 < 0.2)))){
if (this.isRemoveAfterCome){
this.toDeath();
};
} else {
this.x = (this.x + _local1);
this.y = (this.y + _local2);
this.cord.x = (this.house.x + (this.house.width / 2));
this.cord.y = (this.house.y + 5);
this.cord.graphics.clear();
this.cord.graphics.lineStyle(2, 0xFFFFFF, 1);
this.cord.graphics.curveTo(0, (-(_local2) * 3), ((this.x + (this.width / 2)) - this.cord.x), (((this.y + this.height) - 5) - this.cord.y));
};
}
override public function removeListeners(){
this.removeOnRollOver();
super.removeListeners();
}
public function setUpPowerPlus(_arg1:Number){
this.upPowerPlus = _arg1;
}
public function removeCord(){
if ((((this.cord == null)) || ((this.cord.parent == null)))){
return;
};
this.cord.parent.removeChild(this.cord);
}
public function onMineCollision(_arg1:Mine){
if (!this.checkIsMineInArray(_arg1)){
this.addMine(_arg1);
this.balloonDefense--;
if (this.balloonDefense <= 0){
if (((((!((this.house == null))) && (!(this.isRemoveAfterCome)))) && ((this.house.realBalloonsCount >= House.MAX_DISPLAY_BALLOONS)))){
this.house.plusRealBalloonsCount(-1);
this.house.plusUpPower(-(this.upPowerPlus));
this.levelCont.createBoomAnimation((this.x + (this.width / 2)), (this.y + (this.height / 2)), 0.35);
} else {
this.blowUp();
};
};
};
}
public function addMine(_arg1:Mine){
this.bombs_array[this.bombs_array.length] = _arg1;
}
public function checkIsMineInArray(_arg1:Mine):Boolean{
var _local2:Mine;
var _local3:Number;
var _local4:Number;
_local3 = this.bombs_array.length;
if (_local3 == 0){
return (false);
};
_local4 = 0;
while (_local4 < _local3) {
_local2 = this.bombs_array[_local4];
if (_local2 == _arg1){
return (true);
};
_local4++;
};
return (false);
}
override public function toDeath(){
if (this.cord != null){
this.removeCord();
};
super.toDeath();
}
public function createCord(){
var _local1:Number;
var _local2:Number;
this.cord = new Sprite();
this.parent.addChild(this.cord);
_local1 = (((this.house.x + this.plusX) - this.x) / 5);
_local2 = (((this.house.y + this.plusY) - this.y) / 5);
this.cord.x = (this.house.x + (this.house.width / 2));
this.cord.y = (this.house.y + 5);
this.cord.graphics.clear();
this.cord.graphics.lineStyle(2, 0xFFFFFF, 1);
this.cord.graphics.curveTo(0, (-(_local2) * 3), ((this.x + (this.width / 2)) - this.cord.x), (((this.y + this.height) - 5) - this.cord.y));
}
public function removeOnRollOver(){
this.removeEventListener(MouseEvent.ROLL_OVER, this.onRollOver);
}
public function setHouse(_arg1:House, _arg2:Boolean=false){
var _local3:Number;
var _local4:Balloon;
this.house = _arg1;
this.setIsMovebleBySpeed(false);
this.house.plusRealBalloonsCount(1);
if (this.house.realBalloonsCount >= House.MAX_DISPLAY_BALLOONS){
this.isRemoveAfterCome = true;
_local3 = Math.floor((Math.random() * this.house.balloons_array.length));
_local4 = this.house.balloons_array[_local3];
this.plusX = _local4.plusX;
this.plusY = _local4.plusY;
} else {
this.house.addBalloon(this);
this.plusX = ((-(Balloon.WIDTH_DELTA) - (this.width / 2)) + (Math.random() * (this.house.width + (Balloon.WIDTH_DELTA * 2))));
this.plusY = (MIN_HEIGHT_DELTA + (Math.random() * MAX_HEIGHT_DELTA));
};
if (_arg2){
this.x = (this.house.x + this.plusX);
this.y = (this.house.y + this.plusY);
};
this.createCord();
}
public function blowUp(){
if (this.isBlowUp){
return;
};
this.isBlowUp = true;
this.levelCont.createBoomAnimation((this.x + (this.width / 2)), (this.y + (this.height / 2)), 0.35);
if (this.house != null){
this.house.plusUpPower(-(this.upPowerPlus));
this.house.plusRealBalloonsCount(-1);
if (!this.isRemoveAfterCome){
this.house.removeBalloon(this);
};
};
this.toDeath();
}
public function onRollOver(_arg1:MouseEvent){
this.setHouse(this.levelCont.house);
this.levelCont.playPage.onBalloonCath();
this.house.plusUpPower(this.upPowerPlus);
Main.root.soundTools.playSoundByNumber(SoundTools.BALLOON_SOUND);
this.removeOnRollOver();
}
public function setOnRollOver(){
this.addEventListener(MouseEvent.ROLL_OVER, this.onRollOver, false, 0, true);
}
override public function setListeners(){
if (this.isBlowUp){
return;
};
if (this.house == null){
this.setOnRollOver();
};
super.setListeners();
}
}
}//package src.Levels.LevelGrafObject.Balloon
Section 28
//BoomAnimation (src.Levels.LevelGrafObject.BoomAnimation.BoomAnimation)
package src.Levels.LevelGrafObject.BoomAnimation {
import flash.display.*;
public class BoomAnimation extends MovieClip {
public function BoomAnimation(){
addFrameScript(26, frame27);
this.mouseEnabled = false;
this.mouseChildren = false;
this.rotation = Math.round((Math.random() * 360));
}
function frame27(){
(this as BoomAnimation).toRemove();
}
public function toRemove(){
if (((!(this)) || (!(this.parent)))){
return;
};
this.stop();
this.parent.removeChild(this);
}
}
}//package src.Levels.LevelGrafObject.BoomAnimation
Section 29
//Cloud (src.Levels.LevelGrafObject.Cloud.Cloud)
package src.Levels.LevelGrafObject.Cloud {
import flash.events.*;
import src.Levels.LevelGrafObject.RewritePositionObject.MovebleObject.*;
public class Cloud extends MovebleObject {
public static const BASE_X_SPEED:Number = -4;
public static const MIN_SCALE:Number = 0.25;
public function Cloud(_arg1:Number=-2, _arg2:Number=0){
var _local3:Number;
var _local4:Number;
super();
this.mouseEnabled = false;
this.mouseChildren = false;
this.setAccelY(_arg1);
this.setSpeedY(_arg2);
_local3 = (Cloud.MIN_SCALE + (Math.random() * (1 - Cloud.MIN_SCALE)));
this.scaleX = (this.scaleY = _local3);
_local4 = (Cloud.BASE_X_SPEED * this.scaleX);
this.setSpeedX(_local4);
this.setListeners();
}
override public function moveBySpeedObject(){
if (this.isPause){
return;
};
this.speedX = (this.speedX + this.accelX);
this.checkMinMaxSpeed();
this.x = (this.x + this.speedX);
this.y = (this.y + this.levelCont.levelFon.deltaY);
}
override public function onEnterFrame(_arg1:Event){
this.moveBySpeedObject();
this.checkOverDisplay();
}
}
}//package src.Levels.LevelGrafObject.Cloud
Section 30
//Coin (src.Levels.LevelGrafObject.Coin.Coin)
package src.Levels.LevelGrafObject.Coin {
import gs.*;
import flash.events.*;
import src.*;
import src.SoundTools.*;
import src.Levels.LevelDataObj.*;
import src.Levels.LevelGrafObject.RewritePositionObject.MovebleObject.*;
public class Coin extends MovebleObject {
private var isRollOverWas:Boolean;// = false
public function Coin(){
var _local1:Number;
var _local2:Number;
isRollOverWas = false;
super();
this.setItemNumber(LevelDataObj.COIN);
this.useHandCursor = true;
this.buttonMode = true;
this.mouseChildren = false;
_local1 = (-2 + (Math.random() * 4));
this.setSpeedX(_local1);
this.x = (this.x + (this.speedX * 2));
this.setAccelY(-1);
_local2 = (-2 - (Math.random() * 5));
this.setSpeedY(_local2);
this.setListeners();
}
override public function removeListeners(){
this.removeOnRollOver();
super.removeListeners();
}
override public function setListeners(){
if (!this.isRollOverWas){
this.setOnRollOver();
};
super.setListeners();
}
public function setOnRollOver(){
this.addEventListener(MouseEvent.ROLL_OVER, this.onRollOver, false, 0, true);
}
public function onEndTween(_arg1:Coin){
this.toDeath();
}
public function plusMoney(){
var _local1:Number;
_local1 = Main.root.savesProgress.getMoneyPerCoin();
this.levelCont.playPage.plusMoney(_local1);
}
public function startEndMove(){
var _local1:Number;
var _local2:Number;
if (((!(this)) || (!(this.parent)))){
return;
};
_local1 = this.levelCont.playPage.moneyCont.x;
_local2 = (this.levelCont.playPage.moneyCont.y + this.levelCont.playPage.moneyCont.height);
TweenLite.to(this, 0.5, {x:_local1, y:_local2, onComplete:this.onEndTween, onCompleteParams:[this]});
}
override public function onEnterFrame(_arg1:Event){
this.moveBySpeedObject();
this.checkOverDisplay();
}
public function removeOnRollOver(){
this.removeEventListener(MouseEvent.ROLL_OVER, this.onRollOver);
}
public function onRollOver(_arg1:MouseEvent){
this.isRollOverWas = true;
this.plusMoney();
this.levelCont.playPage.onCoinCollect();
Main.root.soundTools.playSoundByNumber(SoundTools.COIN_SOUND);
this.removeListeners();
this.startEndMove();
}
}
}//package src.Levels.LevelGrafObject.Coin
Section 31
//House (src.Levels.LevelGrafObject.House.House)
package src.Levels.LevelGrafObject.House {
import gs.*;
import flash.events.*;
import src.Page.PlayPage.LevelCont.*;
import src.*;
import src.Levels.LevelGrafObject.Balloon.*;
import src.Levels.LevelDataObj.*;
import src.Levels.LevelGrafObject.RewritePositionObject.MovebleObject.*;
import flash.ui.*;
public class House extends MovebleObject {
public var realBalloonsCount:Number;// = 0
public var balloons_array:Array;
var isLeftPressed:Boolean;// = false
private var accelYPlusValue:Number;// = 2
var isRightPressed:Boolean;// = false
var isUpPressed:Boolean;// = false
private var upPower:Number;// = 0
private var accelXPlusValue:Number;// = 2
private var prevUpPower:Number;// = 0
var isDownPressed:Boolean;// = false
public static const MAX_UP_POWER:Number = 100;
public static const MAX_DISPLAY_BALLOONS:Number = 20;
public static const UP_Y:Number = 440;
public static const DOWN_X:Number = 258;
public static const DOWN_Y:Number = 510;
public function House(){
upPower = 0;
prevUpPower = 0;
accelXPlusValue = 2;
accelYPlusValue = 2;
isRightPressed = false;
isLeftPressed = false;
isUpPressed = false;
isDownPressed = false;
balloons_array = [];
realBalloonsCount = 0;
super();
this.setItemNumber(LevelDataObj.HOUSE);
this.setListeners();
}
public function setRealBalloonsCount(_arg1:Number){
this.realBalloonsCount = _arg1;
Main.root.savesProgress.setBalloonsCount(this.realBalloonsCount);
}
override public function removeListeners(){
this.removeOnKeyDownListener();
this.removeOnKeyUpListener();
super.removeListeners();
}
public function plusUpPower(_arg1:Number){
this.prevUpPower = this.upPower;
this.upPower = (this.upPower + _arg1);
if (_arg1 > 0){
this.levelCont.playPage.upBarCont.plusBarUpPower(1);
} else {
if (_arg1 < 0){
this.levelCont.playPage.upBarCont.plusBarUpPower(-1);
};
};
this.checkUpPowerToUpDown();
}
public function getRandomBalloon(){
var _local1:Number;
_local1 = Math.round((Math.random() * this.balloons_array.length));
return (this.balloons_array[_local1]);
}
public function setIsDownPressed(_arg1:Boolean){
this.isDownPressed = _arg1;
}
public function addBalloon(_arg1:Balloon){
this.balloons_array[this.balloons_array.length] = _arg1;
}
public function setUpPower(_arg1:Number){
this.prevUpPower = this.upPower;
this.upPower = _arg1;
this.levelCont.playPage.upBarCont.setBarUpPower(_arg1);
this.checkUpPowerToUpDown();
}
override public function onEnterFrame(_arg1:Event){
this.checkIsKeys();
this.moveBySpeedObject();
this.checkOverDisplay();
}
public function onKeyDown(_arg1:KeyboardEvent){
if (this.upPower <= 0){
return;
};
if ((((_arg1.keyCode == Keyboard.LEFT)) || ((_arg1.keyCode == 65)))){
this.setIsLeftPressed(true);
} else {
if ((((_arg1.keyCode == Keyboard.RIGHT)) || ((_arg1.keyCode == 68)))){
this.setIsRightPressed(true);
};
};
if ((((_arg1.keyCode == Keyboard.UP)) || ((_arg1.keyCode == 87)))){
this.setIsUpPressed(true);
} else {
if ((((_arg1.keyCode == Keyboard.DOWN)) || ((_arg1.keyCode == 83)))){
this.setIsDownPressed(true);
};
};
}
public function onKeyUp(_arg1:KeyboardEvent){
if ((((_arg1.keyCode == Keyboard.LEFT)) || ((_arg1.keyCode == 65)))){
this.setIsLeftPressed(false);
this.setAccelX(0);
} else {
if ((((_arg1.keyCode == Keyboard.RIGHT)) || ((_arg1.keyCode == 68)))){
this.setIsRightPressed(false);
this.setAccelX(0);
};
};
if ((((_arg1.keyCode == Keyboard.UP)) || ((_arg1.keyCode == 87)))){
this.setIsUpPressed(false);
this.setAccelY(0);
} else {
if ((((_arg1.keyCode == Keyboard.DOWN)) || ((_arg1.keyCode == 83)))){
this.setIsDownPressed(false);
this.setAccelY(0);
};
};
}
override public function onPageEnd(){
}
public function removeBalloon(_arg1:Balloon){
var _local2:Number;
var _local3:Balloon;
var _local4:Number;
_local2 = this.balloons_array.length;
_local4 = 0;
while (_local4 < _local2) {
_local3 = this.balloons_array[_local4];
if (_local3 == _arg1){
this.balloons_array.splice(_local4, 1);
break;
};
_local4++;
};
}
override public function checkOverDisplay(){
if (this.x < 0){
this.x = 0;
} else {
if (this.x > (Main.DISPLAY_WIDTH - this.width)){
this.x = (Main.DISPLAY_WIDTH - this.width);
};
};
if (this.y < 150){
this.y = 150;
} else {
if (this.y > (Main.DISPLAY_HEIGHT - this.height)){
this.y = (Main.DISPLAY_HEIGHT - this.height);
};
};
}
public function getUpPower():Number{
return (this.upPower);
}
public function setIsUpPressed(_arg1:Boolean){
this.isUpPressed = _arg1;
}
override public function moveBySpeedObject(){
if (this.isPause){
return;
};
this.speedX = (this.speedX + this.accelX);
if ((((this.speedX > -0.5)) && ((this.speedX < 0.5)))){
this.speedX = 0;
} else {
this.speedX = (this.speedX * LevelCont.FRICTION);
};
this.speedY = (this.speedY + this.accelY);
if ((((this.speedY > -0.5)) && ((this.speedY < 0.5)))){
this.speedY = 0;
} else {
this.speedY = (this.speedY * LevelCont.FRICTION);
};
this.checkMinMaxSpeed();
this.x = (this.x + this.speedX);
this.y = (this.y + this.speedY);
}
public function setIsLeftPressed(_arg1:Boolean){
this.isLeftPressed = _arg1;
}
public function setOnKeyDownListener(){
Main.stage.addEventListener(KeyboardEvent.KEY_DOWN, this.onKeyDown);
}
public function checkUpPowerToUpDown(){
if ((((this.prevUpPower <= 0)) && ((this.upPower > 0)))){
this.houseUp();
} else {
if ((((this.prevUpPower > 0)) && ((this.upPower <= 0)))){
this.houseDown();
};
};
}
public function checkIsKeys(){
if (this.isLeftPressed){
this.setAccelX(-(this.accelXPlusValue));
};
if (this.isRightPressed){
this.setAccelX(this.accelXPlusValue);
};
if (this.isUpPressed){
this.setAccelY(-(this.accelYPlusValue));
};
if (this.isDownPressed){
this.setAccelY(this.accelYPlusValue);
};
}
public function removeOnKeyUpListener(){
Main.stage.removeEventListener(KeyboardEvent.KEY_UP, this.onKeyUp);
}
public function removeOnKeyDownListener(){
Main.stage.removeEventListener(KeyboardEvent.KEY_DOWN, this.onKeyDown);
}
public function setIsRightPressed(_arg1:Boolean){
this.isRightPressed = _arg1;
}
public function setOnKeyUpListener(){
Main.stage.addEventListener(KeyboardEvent.KEY_UP, this.onKeyUp);
}
public function plusRealBalloonsCount(_arg1:Number){
this.realBalloonsCount = (this.realBalloonsCount + _arg1);
Main.root.savesProgress.setBalloonsCount(this.realBalloonsCount);
if (_arg1 < 0){
if (this.realBalloonsCount > 0){
this.levelCont.playPage.restartTimer();
} else {
this.levelCont.playPage.removeNotLostTimer();
};
} else {
if (_arg1 > 0){
if (this.realBalloonsCount == 1){
this.levelCont.playPage.createNotLostTimer();
};
};
};
}
public function houseUp(){
TweenLite.to(this, 2, {y:House.UP_Y});
}
public function plusUpPowerWithoutUpBar(_arg1:Number){
this.prevUpPower = this.upPower;
this.upPower = (this.upPower + _arg1);
this.checkUpPowerToUpDown();
}
public function houseDown(){
TweenLite.to(this, 2, {y:House.DOWN_Y, x:House.DOWN_X});
}
override public function setListeners(){
this.setOnKeyDownListener();
this.setOnKeyUpListener();
super.setListeners();
}
}
}//package src.Levels.LevelGrafObject.House
Section 32
//Meteor (src.Levels.LevelGrafObject.Meteor.Meteor)
package src.Levels.LevelGrafObject.Meteor {
import flash.events.*;
import flash.display.*;
import src.Levels.LevelGrafObject.RewritePositionObject.MovebleObject.*;
public class Meteor extends MovebleObject {
public var anim:MovieClip;
public static const BASE_X_SPEED:Number = -4;
public static const PLUS_X_SPEED:Number = -4;
public function Meteor(_arg1:Number=-2, _arg2:Number=0){
var _local3:Number;
super();
this.mouseEnabled = false;
this.mouseChildren = false;
this.setAccelY(_arg1);
this.setSpeedY(_arg2);
_local3 = (Meteor.BASE_X_SPEED + (Math.random() * Meteor.PLUS_X_SPEED));
this.setSpeedX(_local3);
this.setListeners();
}
override public function moveBySpeedObject(){
if (this.isPause){
return;
};
this.speedX = (this.speedX + this.accelX);
this.checkMinMaxSpeed();
this.x = (this.x + this.speedX);
this.y = (this.y + this.levelCont.levelFon.deltaY);
}
override public function onEnterFrame(_arg1:Event){
this.moveBySpeedObject();
this.checkOverDisplay();
}
}
}//package src.Levels.LevelGrafObject.Meteor
Section 33
//Mine (src.Levels.LevelGrafObject.Mine.Mine)
package src.Levels.LevelGrafObject.Mine {
import flash.events.*;
import src.Page.PlayPage.LevelFon.*;
import src.*;
import src.Levels.LevelGrafObject.Balloon.*;
import src.Levels.LevelGrafObject.RewritePositionObject.CheckCollisionObject.*;
import src.SoundTools.*;
import src.Levels.LevelDataObj.*;
import flash.utils.*;
import flash.text.*;
public class Mine extends CheckCollisionObject {
public var text_txt:TextField;
private var boomTimer:Timer;
private var prevDragX:Number;// = 0
private var prevDragY:Number;// = 0
private var curDragX:Number;// = 0
private var curDragY:Number;// = 0
private var isBlowUp:Boolean;// = false
private var currentTime:Number;// = 5
public function Mine(_arg1:LevelFon){
var _local2:Number;
var _local3:Number;
currentTime = 5;
isBlowUp = false;
prevDragX = 0;
prevDragY = 0;
curDragX = 0;
curDragY = 0;
super();
this.setItemNumber(LevelDataObj.MINE);
this.useHandCursor = true;
this.buttonMode = true;
this.mouseChildren = false;
this.setAccelY(-2);
if (_arg1.y < 0){
_local2 = (_arg1.y / _arg1.minFonY);
_local2 = ((_local2)<0) ? -(_local2) : _local2;
} else {
_local2 = 0;
};
_local3 = ((9 - (6 * _local2)) - (Math.random() * 1));
if (_local3 < 3){
_local3 = 3;
} else {
if (_local3 > 10){
_local3 = 10;
};
};
this.setSpeedY(_local3);
this.setListeners();
}
public function onBoomTimer(_arg1:TimerEvent){
this.currentTime--;
if (this.currentTime > 0){
this.updateText();
} else {
this.blowUp();
};
}
public function setOnMouseDown(){
this.addEventListener(MouseEvent.MOUSE_DOWN, this.onMouseDown, false, 0, true);
}
override public function setListeners(){
if (this.isBlowUp){
return;
};
this.setBoomTimer();
this.setOnMouseDown();
super.setListeners();
}
override public function removeListeners(){
this.removeBoomTimer();
this.removeOnMouseMove();
this.removeOnMouseDown();
this.removeOnMouseUp();
super.removeListeners();
}
public function setCurrentTime(_arg1:Number){
this.currentTime = _arg1;
this.updateText();
}
override public function onMineCollision(_arg1:Mine){
_arg1.blowUp(true);
this.blowUp(true);
}
override public function onPauseOff(){
this.removeBoomTimer();
this.setBoomTimer();
super.onPauseOff();
}
public function removeOnMouseDown(){
this.removeEventListener(MouseEvent.MOUSE_DOWN, this.onMouseDown);
}
public function getCurrentTime():Number{
return (this.currentTime);
}
public function setBoomTimer(){
this.boomTimer = new Timer(1000);
this.boomTimer.addEventListener(TimerEvent.TIMER, this.onBoomTimer, false, 0, true);
this.boomTimer.start();
}
public function removeBoomTimer(){
this.boomTimer.removeEventListener(TimerEvent.TIMER, this.onBoomTimer);
this.boomTimer.stop();
}
public function onMouseMove(_arg1:MouseEvent){
this.prevDragX = this.curDragX;
this.prevDragY = this.curDragY;
this.x = (this.parent.mouseX - (this.width / 2));
this.y = (this.parent.mouseY - (this.height / 2));
this.curDragX = this.x;
this.curDragY = this.y;
}
public function setOnMouseUp(){
Main.stage.addEventListener(MouseEvent.MOUSE_UP, this.onMouseUp, false, 0, true);
}
public function removeOnMouseUp(){
Main.stage.removeEventListener(MouseEvent.MOUSE_UP, this.onMouseUp);
}
public function setOnMouseMove(){
Main.stage.addEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMove, false, 0, true);
}
public function onMouseUp(_arg1:MouseEvent){
var _local2:Number;
var _local3:Number;
_local2 = (this.curDragX - this.prevX);
_local3 = (this.curDragY - this.prevY);
this.plusSpeedX(_local2);
this.plusSpeedY(_local3);
this.setIsMovebleBySpeed(true);
this.removeOnMouseMove();
this.setOnMouseDown();
this.removeOnMouseUp();
}
override public function onPauseOn(){
this.removeBoomTimer();
super.onPauseOn();
}
public function updateText(){
this.text_txt.text = ("" + this.currentTime);
}
override public function onBalloonCollision(_arg1:Balloon){
_arg1.onMineCollision(this);
this.blowUp();
}
public function onMouseDown(_arg1:MouseEvent){
this.setIsMovebleBySpeed(false);
this.setOnMouseMove();
this.removeOnMouseDown();
this.setOnMouseUp();
}
public function removeOnMouseMove(){
Main.stage.removeEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMove);
}
public function blowUp(_arg1:Boolean=false){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
if ((((this == null)) || ((this.parent == null)))){
return;
};
if (this.isBlowUp){
return;
};
if (_arg1){
this.levelCont.playPage.onMineBlowUp();
};
this.isBlowUp = true;
_local2 = (this.x + (this.width / 2));
_local3 = (this.y + (this.height / 2));
this.width = (this.height = 120);
this.x = (_local2 - (this.width / 2));
this.y = (_local3 - (this.height / 2));
this.removeItselfFromGrids();
this.checkGrids();
this.addItselfToEnemyGrid();
this.checkCollisions();
this.removeItselfFromGrids();
this.levelCont.createBoomAnimation(_local2, _local3);
Main.root.soundTools.playSoundByNumber(SoundTools.BOMB_SOUND);
_local4 = Main.root.savesProgress.getCoinPerBomb();
_local5 = 0;
while (_local5 < _local4) {
this.levelCont.createCoin(_local2, _local3);
_local5++;
};
this.removeBoomTimer();
this.toDeath();
}
}
}//package src.Levels.LevelGrafObject.Mine
Section 34
//CheckCollisionObject (src.Levels.LevelGrafObject.RewritePositionObject.CheckCollisionObject.CheckCollisionObject)
package src.Levels.LevelGrafObject.RewritePositionObject.CheckCollisionObject {
import src.Levels.LevelGrid.*;
import src.Levels.LevelGrafObject.*;
import flash.events.*;
import flash.display.*;
import src.Levels.LevelGrafObject.Balloon.*;
import src.Levels.LevelGrafObject.Mine.*;
import src.Levels.LevelDataObj.*;
import src.Levels.LevelGrafObject.RewritePositionObject.MovebleObject.*;
public class CheckCollisionObject extends MovebleObject {
public var collisionHeight:Number;
public var collisionWidth:Number;
public var collisionPlusY:Number;
public var collisionPlusX:Number;
private var colliseble_array:Array;
private var yPlusHeight:Number;
private var xPlusWidth:Number;
public function checkCollisions(){
var _local1:Array;
var _local2:LevelGrafObject;
var _local3:LevelGridObject;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
this.setIsGround(false);
this.findXPlusWidth();
this.findYPlusHeight();
this.colliseble_array = [];
_local1 = [];
_local4 = this.notEnemyGrid_array.length;
_local5 = 0;
while (_local5 < _local4) {
_local3 = this.notEnemyGrid_array[int(_local5)];
if (_local3 != null){
_local1 = _local1.concat(_local3.objects_array);
};
_local5++;
};
_local4 = this.enemyGrid_array.length;
_local5 = 0;
while (_local5 < _local4) {
_local3 = this.enemyGrid_array[int(_local5)];
if (_local3 != null){
_local1 = _local1.concat(_local3.objects_array);
};
_local5++;
};
_local6 = _local1.length;
_local7 = 0;
while (_local7 < _local6) {
_local2 = _local1[int(_local7)];
if (_local2 != this){
if (this.checkIsCollisionWithObj(_local2)){
if (!this.checkIsColissionBefore(_local2)){
this.onCollision(_local2);
};
};
};
_local7++;
};
}
public function onCollision(_arg1:LevelGrafObject){
var _local2:Number;
this.colliseble_array.push(_arg1);
_local2 = _arg1.getItemNumber();
if (_arg1.getItemNumber() == LevelDataObj.BALLOON){
this.onBalloonCollision((_arg1 as Balloon));
} else {
if (_arg1.getItemNumber() == LevelDataObj.MINE){
this.onMineCollision((_arg1 as Mine));
};
};
}
private function checkIsColissionBefore(_arg1:DisplayObject):Boolean{
var _local2:Number;
var _local3:DisplayObject;
var _local4:Number;
_local2 = this.colliseble_array.length;
if (_local2 > 0){
_local4 = 0;
while (_local4 < _local2) {
_local3 = this.colliseble_array[int(_local4)];
if (_arg1 == _local3){
return (true);
};
_local4++;
};
};
return (false);
}
public function checkIsCollisionWithObj(_arg1:DisplayObject):Boolean{
if ((((((((this.xPlusWidth > _arg1.x)) && ((this.x < (_arg1.x + _arg1.width))))) && ((this.yPlusHeight > _arg1.y)))) && ((this.y < (_arg1.y + _arg1.height))))){
return (true);
};
return (false);
}
public function findYPlusHeight(){
this.yPlusHeight = (this.y + this.height);
}
public function checkCollisionSide(_arg1:DisplayObject):CollisionSideObject{
var _local2:CollisionSideObject;
var _local3:Number;
var _local4:Number;
_local2 = new CollisionSideObject();
if ((((this.yPlusHeight > _arg1.y)) && (((this.prevY + this.height) <= _arg1.y)))){
_local2.vSide = CollisionSideObject.TOP;
} else {
if ((((this.y < (_arg1.y + _arg1.height))) && ((this.prevY >= (_arg1.y + _arg1.height))))){
_local2.vSide = CollisionSideObject.BOTTOM;
} else {
if ((((this.xPlusWidth > _arg1.x)) && (((this.prevX + this.width) <= _arg1.x)))){
_local2.hSide = CollisionSideObject.LEFT;
} else {
if ((((this.x < (_arg1.x + _arg1.width))) && ((this.prevX >= (_arg1.x + _arg1.width))))){
_local2.hSide = CollisionSideObject.RIGHT;
};
};
};
};
if ((((_local2.hSide == "")) && ((_local2.vSide == "")))){
_local3 = ((this.x + (this.width / 2)) - (_arg1.x + (_arg1.width / 2)));
_local4 = ((this.y + (this.height / 2)) - (_arg1.y + (_arg1.height / 2)));
if (Math.abs(_local3) > Math.abs(_local4)){
if (_local3 < 0){
_local2.hSide = CollisionSideObject.LEFT;
} else {
_local2.hSide = CollisionSideObject.RIGHT;
};
} else {
if (_local4 < 0){
_local2.vSide = CollisionSideObject.TOP;
} else {
_local2.vSide = CollisionSideObject.BOTTOM;
};
};
};
return (_local2);
}
public function findXPlusWidth(){
this.xPlusWidth = (this.x + this.width);
}
public function onMineCollision(_arg1:Mine){
}
override public function onEnterFrame(_arg1:Event){
super.onEnterFrame(_arg1);
this.checkCollisions();
}
public function onBalloonCollision(_arg1:Balloon){
}
}
}//package src.Levels.LevelGrafObject.RewritePositionObject.CheckCollisionObject
Section 35
//CollisionSideObject (src.Levels.LevelGrafObject.RewritePositionObject.CheckCollisionObject.CollisionSideObject)
package src.Levels.LevelGrafObject.RewritePositionObject.CheckCollisionObject {
public class CollisionSideObject {
public var vSide:String;// = ""
public var hSide:String;// = ""
public static const TOP:String = "top";
public static const LEFT:String = "left";
public static const BOTTOM:String = "bottom";
public static const RIGHT:String = "right";
public function CollisionSideObject(){
hSide = "";
vSide = "";
super();
}
}
}//package src.Levels.LevelGrafObject.RewritePositionObject.CheckCollisionObject
Section 36
//MovebleObject (src.Levels.LevelGrafObject.RewritePositionObject.MovebleObject.MovebleObject)
package src.Levels.LevelGrafObject.RewritePositionObject.MovebleObject {
import flash.events.*;
import src.Page.PlayPage.LevelCont.*;
import src.*;
import src.Levels.LevelGrafObject.RewritePositionObject.*;
public class MovebleObject extends RewritePositionObject {
public var speedX:Number;// = 0
public var isGround:Boolean;// = false
public var accelX:Number;// = 0
public var accelY:Number;// = 0
public var prevY:Number;// = 0
public var prevX:Number;// = 0
public var isMovebleBySpeed:Boolean;// = true
public var nextX:Number;// = 0
public var nextY:Number;// = 0
public var speedY:Number;// = 0
public static const RIGHT_MORE_TO_REMOVE:Number = 200;
public static const UP_MORE_TO_REMOVE:Number = -200;
public static const LEFT_MORE_TO_REMOVE:Number = -200;
public static const DOWN_MORE_TO_REMOVE:Number = 200;
public function MovebleObject(){
speedX = 0;
speedY = 0;
accelX = 0;
accelY = 0;
prevX = 0;
prevY = 0;
nextX = 0;
nextY = 0;
isMovebleBySpeed = true;
isGround = false;
super();
}
public function setSpeedX(_arg1:Number){
this.speedX = _arg1;
}
public function checkOverDisplay(){
if (this.y < (0 + MovebleObject.UP_MORE_TO_REMOVE)){
this.toDeath();
} else {
if ((this.y + this.height) > (Main.DISPLAY_HEIGHT + MovebleObject.DOWN_MORE_TO_REMOVE)){
this.toDeath();
} else {
if ((((this.speedX <= 0)) && (((this.x + this.width) < (0 + MovebleObject.LEFT_MORE_TO_REMOVE))))){
this.toDeath();
} else {
if ((((this.speedX >= 0)) && ((this.x > (Main.DISPLAY_WIDTH + MovebleObject.RIGHT_MORE_TO_REMOVE))))){
this.toDeath();
};
};
};
};
}
public function plusSpeedX(_arg1:Number){
this.speedX = (this.speedX + _arg1);
}
public function plusSpeedY(_arg1:Number){
this.speedY = (this.speedY + _arg1);
}
public function setSpeedY(_arg1:Number){
this.speedY = _arg1;
}
public function moveByOtherPower(){
}
public function setIsMovebleBySpeed(_arg1:Boolean){
this.isMovebleBySpeed = _arg1;
}
public function moveBySpeedObject(){
if (this.isPause){
return;
};
this.speedX = (this.speedX + this.accelX);
this.speedY = (this.speedY + this.accelY);
this.speedY = (this.speedY + LevelCont.GRAVITY);
this.checkMinMaxSpeed();
this.x = (this.x + this.speedX);
this.y = (this.y + this.speedY);
this.y = (this.y + this.levelCont.levelFon.deltaY);
}
public function setAccelY(_arg1:Number){
this.accelY = _arg1;
}
public function savePrevCoordinates(){
this.prevX = this.x;
this.prevY = this.y;
}
public function setAccelX(_arg1:Number){
this.accelX = _arg1;
}
public function checkMinMaxSpeed(){
if (this.speedX > LevelCont.MAX_SPEED_X){
this.speedX = LevelCont.MAX_SPEED_Y;
} else {
if (this.speedX < LevelCont.MIN_SPEED_X){
this.speedX = LevelCont.MIN_SPEED_X;
};
};
if (this.speedY > LevelCont.MAX_SPEED_Y){
this.speedY = LevelCont.MAX_SPEED_Y;
} else {
if (this.speedY < LevelCont.MIN_SPEED_Y){
this.speedY = LevelCont.MIN_SPEED_Y;
};
};
}
public function plusAccelX(_arg1:Number){
this.accelX = (this.accelX + _arg1);
}
override public function onEnterFrame(_arg1:Event){
this.savePrevCoordinates();
if (this.isMovebleBySpeed){
this.moveBySpeedObject();
this.checkOverDisplay();
} else {
this.moveByOtherPower();
};
super.onEnterFrame(_arg1);
}
public function plusAccelY(_arg1:Number){
this.accelY = (this.accelY + _arg1);
}
public function setIsGround(_arg1:Boolean){
this.isGround = _arg1;
}
}
}//package src.Levels.LevelGrafObject.RewritePositionObject.MovebleObject
Section 37
//RewritePositionObject (src.Levels.LevelGrafObject.RewritePositionObject.RewritePositionObject)
package src.Levels.LevelGrafObject.RewritePositionObject {
import src.Levels.LevelGrid.*;
import src.Levels.LevelGrafObject.*;
import flash.events.*;
public class RewritePositionObject extends CheckGridsPosition {
public function removeItselfFromGrids(){
var _local1:Number;
var _local2:LevelGridObject;
var _local3:Number;
_local1 = this.enemyGrid_array.length;
_local3 = 0;
while (_local3 < _local1) {
_local2 = this.enemyGrid_array[_local3];
if (!!(_local2)){
_local2.removeObjectFromGrid(this);
};
_local3++;
};
}
override public function onPageEnd(){
this.removeItselfFromGrids();
super.onPageEnd();
}
public function addItselfToEnemyGrid(){
var _local1:Number;
var _local2:LevelGridObject;
var _local3:Number;
if ((((this == null)) || ((this.parent == null)))){
return;
};
_local1 = this.enemyGrid_array.length;
_local3 = 0;
while (_local3 < _local1) {
_local2 = this.enemyGrid_array[_local3];
if (!!(_local2)){
_local2.addObjectToGrid(this);
};
_local3++;
};
}
override public function onEnterFrame(_arg1:Event){
this.removeItselfFromGrids();
super.onEnterFrame(_arg1);
this.addItselfToEnemyGrid();
}
}
}//package src.Levels.LevelGrafObject.RewritePositionObject
Section 38
//Star (src.Levels.LevelGrafObject.Star.Star)
package src.Levels.LevelGrafObject.Star {
import gs.*;
import flash.events.*;
import flash.display.*;
import src.Levels.LevelGrafObject.RewritePositionObject.MovebleObject.*;
public class Star extends MovebleObject {
public var anim:MovieClip;
public static const MAX_RANDOM_FRAME:Number = 200;
public function Star(){
this.mouseEnabled = false;
this.mouseChildren = false;
this.anim.gotoAndPlay((1 + Math.round((Math.random() * Star.MAX_RANDOM_FRAME))));
this.alpha = 0;
TweenLite.to(this, 0.5, {alpha:1});
this.setListeners();
}
override public function moveBySpeedObject(){
this.y = (this.y + this.levelCont.levelFon.deltaY);
}
override public function onEnterFrame(_arg1:Event){
this.moveBySpeedObject();
this.checkOverDisplay();
}
}
}//package src.Levels.LevelGrafObject.Star
Section 39
//CheckGridsPosition (src.Levels.LevelGrafObject.CheckGridsPosition)
package src.Levels.LevelGrafObject {
import flash.events.*;
import src.*;
public class CheckGridsPosition extends LevelGrafObject {
public var prevJGrid:Number;// = -100
public var notEnemyGrid_array:Array;
public var enemyGrid_array:Array;
public var prevIGrid:Number;// = -100
public function CheckGridsPosition(){
enemyGrid_array = [];
notEnemyGrid_array = [];
prevIGrid = -100;
prevJGrid = -100;
super();
}
public function removeEnterFrameListener(){
this.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
}
override public function removeListeners(){
this.removeEnterFrameListener();
super.removeListeners();
}
public function setEnterFrameListener(){
this.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
}
public function onEnterFrame(_arg1:Event){
this.checkGrids();
}
public function checkGrids(){
var _local1:Number;
var _local2:Number;
_local1 = Math.floor((this.x / Main.GRID_SIZE));
_local2 = Math.floor((this.y / Main.GRID_SIZE));
if ((((this.prevIGrid == _local1)) && ((this.prevJGrid == _local2)))){
return;
};
this.prevIGrid = _local1;
this.prevJGrid = _local2;
this.enemyGrid_array = [];
this.notEnemyGrid_array = [];
this.enemyGrid_array[this.enemyGrid_array.length] = this.levelCont.enemyGrid.getGridObjectByIndex(_local1, _local2);
this.enemyGrid_array[this.enemyGrid_array.length] = this.levelCont.enemyGrid.getGridObjectByIndex((_local1 + 1), _local2);
this.enemyGrid_array[this.enemyGrid_array.length] = this.levelCont.enemyGrid.getGridObjectByIndex((_local1 + 1), (_local2 + 1));
this.enemyGrid_array[this.enemyGrid_array.length] = this.levelCont.enemyGrid.getGridObjectByIndex(_local1, (_local2 + 1));
}
override public function setListeners(){
this.setEnterFrameListener();
super.setListeners();
}
}
}//package src.Levels.LevelGrafObject
Section 40
//LevelGrafObject (src.Levels.LevelGrafObject.LevelGrafObject)
package src.Levels.LevelGrafObject {
import flash.display.*;
import src.Page.PlayPage.LevelCont.*;
import src.Page.*;
public class LevelGrafObject extends Sprite implements IPageListenerObject {
public var isPause:Boolean;// = false
private var itemNumber:Number;
public var levelCont:LevelCont;
public function LevelGrafObject(){
isPause = false;
super();
}
public function removeListeners(){
}
public function getItemNumber():Number{
return (this.itemNumber);
}
public function setItemNumber(_arg1:Number){
this.itemNumber = _arg1;
}
public function onPauseOn(){
this.isPause = true;
}
public function onPauseOff(){
this.isPause = false;
}
public function toDeath(){
if (((!(this)) || (!(this.parent)))){
return;
};
this.levelCont.removeListObject(this);
this.levelCont.removePauseObject(this);
this.onPageEnd();
this.parent.removeChild(this);
}
public function setLevelCont(_arg1:LevelCont){
this.levelCont = _arg1;
}
public function removeItselfFromPageList(){
this.levelCont.removeListObject(this);
}
public function onPageEnd(){
this.removeListeners();
}
public function setListeners(){
}
}
}//package src.Levels.LevelGrafObject
Section 41
//LevelGrid (src.Levels.LevelGrid.LevelGrid)
package src.Levels.LevelGrid {
public class LevelGrid {
public var grid_array:Array;
public var vGridCount:Number;
public var hGridCount:Number;
public function LevelGrid(_arg1:Number, _arg2:Number){
this.hGridCount = _arg1;
this.vGridCount = _arg2;
this.createGridArray();
}
public function createGridArray(){
var _local1:Number;
var _local2:Number;
this.grid_array = [];
_local1 = 0;
while (_local1 < this.vGridCount) {
this.grid_array[_local1] = [];
_local2 = 0;
while (_local2 < this.hGridCount) {
this.grid_array[_local1][_local2] = new LevelGridObject(_local1, _local2);
_local2++;
};
_local1++;
};
}
public function getGridObjectByIndex(_arg1:Number, _arg2:Number):LevelGridObject{
var _local3:LevelGridObject;
if ((((((((_arg1 < 0)) || ((_arg1 >= vGridCount)))) || ((_arg2 < 0)))) || ((_arg2 > this.hGridCount)))){
return (null);
};
_local3 = this.grid_array[_arg1][_arg2];
return (_local3);
}
}
}//package src.Levels.LevelGrid
Section 42
//LevelGridObject (src.Levels.LevelGrid.LevelGridObject)
package src.Levels.LevelGrid {
import src.Levels.LevelGrafObject.*;
import flash.display.*;
public class LevelGridObject {
public var i:Number;
public var j:Number;
public var objects_array:Array;
private var objectsLength:Number;// = 0
public function LevelGridObject(_arg1:Number, _arg2:Number){
objects_array = [];
objectsLength = 0;
super();
this.i = _arg1;
this.j = _arg2;
}
public function getObjectsArray():Array{
return (this.objects_array);
}
public function addObjectToGrid(_arg1:LevelGrafObject){
this.objects_array[this.objects_array.length] = _arg1;
this.objectsLength++;
}
public function removeObjectFromGrid(_arg1:LevelGrafObject){
var _local2:DisplayObject;
var _local3:Number;
_local3 = 0;
while (_local3 < this.objectsLength) {
_local2 = this.objects_array[_local3];
if (_local2 == _arg1){
this.objects_array.splice(_local3, 1);
this.objectsLength--;
break;
};
_local3++;
};
}
}
}//package src.Levels.LevelGrid
Section 43
//Levels (src.Levels.Levels)
package src.Levels {
import src.Levels.LevelGrid.*;
import flash.display.*;
import src.Page.*;
import src.*;
import src.Levels.LevelDataObj.*;
public class Levels extends PageListenerConteiner implements IPageListenerObject {
public var gridObjectCont:Sprite;
public var notEnemyGrid:LevelGrid;
public var levelDataObj:LevelDataObj;
public var plantPlaces_array:Array;
public var enemyGrid:LevelGrid;
public function Levels(){
this.levelDataObj = new LevelData1_1();
this.createLevel();
this.tabEnabled = false;
Main.stage.focus = this;
}
public function createEnemyGrid(){
this.enemyGrid = new LevelGrid(this.levelDataObj.hGridCount, this.levelDataObj.vGridCount);
}
public function removeLevel(){
this.toEnd();
this.removeChild(this.gridObjectCont);
}
public function createNotEnemyGrid(){
this.notEnemyGrid = new LevelGrid(this.levelDataObj.hGridCount, this.levelDataObj.vGridCount);
}
public function createLevel(){
this.gridObjectCont = new Sprite();
this.addChild(this.gridObjectCont);
this.createEnemyGrid();
this.createNotEnemyGrid();
}
public function onPageEnd(){
this.toEnd();
}
}
}//package src.Levels
Section 44
//MochiBot (src.MochiBot.MochiBot)
package src.MochiBot {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package src.MochiBot
Section 45
//AchievItem (src.Page.AchievPage.AchievItem.AchievItem)
package src.Page.AchievPage.AchievItem {
import flash.events.*;
import src.*;
import src.SoundTools.*;
import flash.text.*;
import src.SimpleBtn.*;
public class AchievItem extends SimpleBtn {
public var insideTextAfter:String;
public var popUpText:String;
public var insideTextBefore:String;
public var text_txt:TextField;
private var popUp:AchievPopUp;
public function setBestResult(_arg1:Number){
this.text_txt.autoSize = TextFieldAutoSize.LEFT;
this.text_txt.text = ((this.insideTextBefore + _arg1) + this.insideTextAfter);
}
public function createPopUp(){
this.removePopUp();
this.popUp = new AchievPopUp(this, this.popUpText);
this.parent.addChild(this.popUp);
this.popUp.alpha = 0;
this.popUp.toStart();
this.popUp.onMouseMove(new MouseEvent(MouseEvent.MOUSE_MOVE));
}
public function alphaOff(){
this.alpha = 0.3;
}
override public function onOver(_arg1:MouseEvent){
this.createPopUp();
Main.root.soundTools.playSoundByNumber(SoundTools.MENU_SOUND);
}
override public function toStart(){
}
public function removePopUp(){
if (((!(this.popUp)) || (!(this.popUp.parent)))){
return;
};
this.popUp.toEnd();
}
override public function onOut(_arg1:MouseEvent){
this.removePopUp();
}
override public function onPageEnd(){
this.removePopUp();
super.onPageEnd();
}
}
}//package src.Page.AchievPage.AchievItem
Section 46
//AchievItem0 (src.Page.AchievPage.AchievItem.AchievItem0)
package src.Page.AchievPage.AchievItem {
public class AchievItem0 extends AchievItem {
public static const TO_PRIZE_VALUE:Number = -7200;
public static const PRIZE_MONEY:Number = 500;
public static const CONGRATS_TEXT:String = "Achievement complete!
You reach stratosphere!
You earn 500 $";
public function AchievItem0(){
this.popUpText = "Prize: 500 $";
}
}
}//package src.Page.AchievPage.AchievItem
Section 47
//AchievItem1 (src.Page.AchievPage.AchievItem.AchievItem1)
package src.Page.AchievPage.AchievItem {
public class AchievItem1 extends AchievItem {
public static const TO_PRIZE_VALUE:Number = -4800;
public static const PRIZE_MONEY:Number = 1000;
public static const CONGRATS_TEXT:String = "Achievement complete!
You reach mesosphere!
You earn 1000 $";
public function AchievItem1(){
this.popUpText = "Prize: 1000 $";
}
}
}//package src.Page.AchievPage.AchievItem
Section 48
//AchievItem2 (src.Page.AchievPage.AchievItem.AchievItem2)
package src.Page.AchievPage.AchievItem {
public class AchievItem2 extends AchievItem {
public static const TO_PRIZE_VALUE:Number = -2400;
public static const PRIZE_MONEY:Number = 2000;
public static const CONGRATS_TEXT:String = "Achievement complete!
You reach ionosphere!
You earn 2000 $";
public function AchievItem2(){
this.popUpText = "Prize: 2000 $";
}
}
}//package src.Page.AchievPage.AchievItem
Section 49
//AchievItem3 (src.Page.AchievPage.AchievItem.AchievItem3)
package src.Page.AchievPage.AchievItem {
public class AchievItem3 extends AchievItem {
public static const TO_PRIZE_VALUE:Number = 0;
public static const PRIZE_MONEY:Number = 3000;
public static const CONGRATS_TEXT:String = "Achievement complete!
You reach deep space!
You earn 3000 $";
public function AchievItem3(){
this.popUpText = "Prize: 3000 $";
}
}
}//package src.Page.AchievPage.AchievItem
Section 50
//AchievItem4 (src.Page.AchievPage.AchievItem.AchievItem4)
package src.Page.AchievPage.AchievItem {
public class AchievItem4 extends AchievItem {
public static const TO_PRIZE_VALUE:Number = 1000;
public static const PRIZE_MONEY:Number = 1000;
public static const CONGRATS_TEXT:String = "Achievement complete!
You collected 1000 balloons!
You earn 1000 $";
public function AchievItem4(){
this.popUpText = "Prize: 1000 $";
this.insideTextBefore = "Collect 1000 balloons\nBest result: ";
this.insideTextAfter = " balloons";
}
}
}//package src.Page.AchievPage.AchievItem
Section 51
//AchievItem5 (src.Page.AchievPage.AchievItem.AchievItem5)
package src.Page.AchievPage.AchievItem {
public class AchievItem5 extends AchievItem {
public static const TO_PRIZE_VALUE:Number = 1000;
public static const PRIZE_MONEY:Number = 1000;
public static const CONGRATS_TEXT:String = "Achievement complete!
You collected 1000 coins!
You earn 1000 $";
public function AchievItem5(){
this.popUpText = "Prize: 1000 $";
this.insideTextBefore = "Collect 1000 coins\nBest result: ";
this.insideTextAfter = " coins";
}
}
}//package src.Page.AchievPage.AchievItem
Section 52
//AchievItem6 (src.Page.AchievPage.AchievItem.AchievItem6)
package src.Page.AchievPage.AchievItem {
public class AchievItem6 extends AchievItem {
public static const TO_PRIZE_VALUE:Number = 1000;
public static const PRIZE_MONEY:Number = 1000;
public static const CONGRATS_TEXT:String = "Achievement complete!
You blow up 1000 bombs!
You earn 1000 $";
public function AchievItem6(){
this.popUpText = "Prize: 1000 $";
this.insideTextBefore = "Blow up 1000 bombs\nBest result: ";
this.insideTextAfter = " bombs";
}
}
}//package src.Page.AchievPage.AchievItem
Section 53
//AchievItem7 (src.Page.AchievPage.AchievItem.AchievItem7)
package src.Page.AchievPage.AchievItem {
public class AchievItem7 extends AchievItem {
public static const TO_PRIZE_VALUE:Number = 120000;
public static const PRIZE_MONEY:Number = 2000;
public static const CONGRATS_TEXT:String = "Achievement complete!
You did not lost balloons
during 2 minute. You earn 2000 $";
public function AchievItem7(){
this.popUpText = "Prize: 2000 $";
}
}
}//package src.Page.AchievPage.AchievItem
Section 54
//AchievPopUp (src.Page.AchievPage.AchievItem.AchievPopUp)
package src.Page.AchievPage.AchievItem {
import gs.*;
import flash.events.*;
import flash.display.*;
import src.*;
import flash.text.*;
public class AchievPopUp extends Sprite {
public var parentClip:Sprite;
public var text_txt:TextField;
public var fon:Sprite;
public function AchievPopUp(_arg1:Sprite, _arg2:String){
this.text_txt.autoSize = TextFieldAutoSize.LEFT;
this.parentClip = _arg1;
this.setText(_arg2);
this.setListeners();
}
public function removeListeners(){
Main.stage.removeEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMove);
}
public function toEnd(){
if (((!(this)) || (!(this.parent)))){
return;
};
this.removeListeners();
TweenLite.to(this, 0.2, {alpha:0, onComplete:this.onEndTweenComplete, onCompleteParams:[this]});
}
public function toStart(){
TweenLite.to(this, 0.2, {alpha:1});
}
public function onEndTweenComplete(_arg1:AchievPopUp){
if (((!(_arg1)) || (!(_arg1.parent)))){
return;
};
_arg1.parent.removeChild(_arg1);
}
public function setText(_arg1:String){
this.text_txt.text = _arg1;
this.fon.width = ((this.text_txt.x + this.text_txt.width) + 1);
}
public function onMouseMove(_arg1:MouseEvent){
this.x = (this.parent.mouseX + 17);
this.y = (this.parent.mouseY + 21);
}
public function setListeners(){
Main.stage.addEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMove);
}
}
}//package src.Page.AchievPage.AchievItem
Section 55
//AchievPage (src.Page.AchievPage.AchievPage)
package src.Page.AchievPage {
import src.Page.AchievPage.AchievItem.*;
import src.Page.*;
import src.*;
import src.SimpleBtn.MenuButtons.*;
public class AchievPage extends Page {
public var achiev0:AchievItem;
public var achiev2:AchievItem;
public var achiev4:AchievItem;
public var achiev6:AchievItem;
public var achiev7:AchievItem;
public var achiev1:AchievItem;
public var achiev3:AchievItem;
public var upgradesBtn:UpgradesBtn;
public var achiev5:AchievItem;
public var clearSavesBtn:ClearSavesBtn;
public var instructionsBtn:InstructionsBtn;
public var startPlayBtn:StartPlayBtn;
public var sponsorBtn:SponsorBtn;
public var highScoresBtn:HighScoresBtn;
public static const REACH_TROPOSPHERE_ACHIEV:Number = 0;
public static const REACH_MESOSPHERE_ACHIEV:Number = 2;
public static const FLY_WITHOUT_LOOSING_ACHIEV:Number = 7;
public static const ACHIEV_COUNT:Number = 8;
public static const REACH_STRATOSPHERE_ACHIEV:Number = 1;
public static const REACH_IONOSPHERE_ACHIEV:Number = 3;
public static const COLLECT_COINS_ACHIEV:Number = 5;
public static const BLOW_UP_BOMBS_ACHIEV:Number = 6;
public static const COLLECT_BALLOONS_ACHIEV:Number = 4;
public function AchievPage(){
var _local1:AchievItem;
var _local2:Object;
var _local3:Boolean;
var _local4:Number;
super();
this.clearSavesBtn.setPageType(ClearSavesBtn.ACHIEVEMENTS_PAGE_TYPE);
this.addListObject(this.startPlayBtn);
this.addListObject(this.upgradesBtn);
this.addListObject(this.instructionsBtn);
this.addListObject(this.clearSavesBtn);
this.addListObject(this.highScoresBtn);
this.addListObject(this.sponsorBtn);
_local4 = 0;
while (_local4 < AchievPage.ACHIEV_COUNT) {
_local1 = this[("achiev" + _local4)];
this.addListObject(_local1);
_local2 = Main.root.savesProgress.getAchievedObjByNum(_local4);
_local3 = Main.root.savesProgress.getIsAchieved(_local2);
if (!_local3){
_local1.alphaOff();
};
_local4++;
};
this.achiev4.setBestResult(Main.root.savesProgress.getAllCollectedBalloons());
this.achiev5.setBestResult(Main.root.savesProgress.getAllCollectedCoins());
this.achiev6.setBestResult(Main.root.savesProgress.getAllBlowUpBombs());
}
}
}//package src.Page.AchievPage
Section 56
//InstructionsPage (src.Page.InstructionsPage.InstructionsPage)
package src.Page.InstructionsPage {
import flash.events.*;
import flash.display.*;
import src.Page.*;
import src.SimpleBtn.MenuButtons.*;
public class InstructionsPage extends Page {
public var anim:MovieClip;
public var upgradesBtn:UpgradesBtn;
public var clearSavesBtn:ClearSavesBtn;
public var controlFrames_array:Array;
public var achievementsBtn:AchievementsBtn;
public var startPlayBtn:StartPlayBtn;
public var sponsorBtn:SponsorBtn;
public var highScoresBtn:HighScoresBtn;
public function InstructionsPage(){
controlFrames_array = [1, 70, 200, 360, 490, 620, 795, 910, 1035, 1190, 1320];
super();
this.clearSavesBtn.setPageType(ClearSavesBtn.INSTRCUTIONS_PAGE_TYPE);
this.addListObject(this.startPlayBtn);
this.addListObject(this.upgradesBtn);
this.addListObject(this.achievementsBtn);
this.addListObject(this.clearSavesBtn);
this.addListObject(this.highScoresBtn);
this.addListObject(this.sponsorBtn);
this.setListeners();
}
public function onClick(_arg1:MouseEvent){
this.nextInstruction();
}
public function removeListeners(){
this.removeEventListener(MouseEvent.CLICK, this.onClick);
}
override public function toEnd(){
this.removeListeners();
super.toEnd();
}
public function nextInstruction(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = this.anim.currentFrame;
_local4 = this.controlFrames_array.length;
_local5 = 0;
while (_local5 < _local4) {
_local1 = this.controlFrames_array[_local5];
if (_local3 > _local1){
if (_local5 < (_local4 - 1)){
_local2 = this.controlFrames_array[(_local5 + 1)];
if (_local3 < _local2){
this.anim.gotoAndPlay(this.controlFrames_array[(_local5 + 1)]);
};
} else {
this.anim.gotoAndPlay(1);
};
};
_local5++;
};
}
public function setListeners(){
this.addEventListener(MouseEvent.CLICK, this.onClick);
}
}
}//package src.Page.InstructionsPage
Section 57
//AchievementCompleteMessage (src.Page.PlayPage.AchievementCompleteMessage.AchievementCompleteMessage)
package src.Page.PlayPage.AchievementCompleteMessage {
import src.Page.PlayPage.LevelCont.*;
import flash.text.*;
public class AchievementCompleteMessage extends GameMessage {
public var text_txt:TextField;
public function AchievementCompleteMessage(){
this.text_txt.autoSize = TextFieldAutoSize.CENTER;
}
public function setText(_arg1:String){
this.text_txt.text = _arg1;
this.text_txt.x = 0;
}
}
}//package src.Page.PlayPage.AchievementCompleteMessage
Section 58
//BestHeightCont (src.Page.PlayPage.BestHeightCont.BestHeightCont)
package src.Page.PlayPage.BestHeightCont {
import gs.*;
import flash.display.*;
import src.Page.PlayPage.LevelFon.*;
import flash.text.*;
public class BestHeightCont extends Sprite {
public var targetTextNumber:Number;// = 0
public var text_txt:TextField;
public var levelFon:LevelFon;
public static const NEW_Y_PLUS:Number = 95;
public function BestHeightCont(){
targetTextNumber = 0;
super();
this.mouseEnabled = false;
this.mouseChildren = false;
this.text_txt.autoSize = TextFieldAutoSize.CENTER;
}
public function moveToNewY(_arg1:Number, _arg2:Number){
_arg1 = (_arg1 + BestHeightCont.NEW_Y_PLUS);
TweenLite.to(this, 1, {y:_arg1, targetTextNumber:_arg2, onUpdate:this.onTweenUpdate, onUpdateParams:[this]});
}
public function setLevelFon(_arg1:LevelFon){
this.levelFon = _arg1;
}
public function setNewY(_arg1){
this.y = (_arg1 + BestHeightCont.NEW_Y_PLUS);
}
public function setText(_arg1:String){
this.text_txt.text = (_arg1 + " m");
}
public function onTweenUpdate(_arg1:BestHeightCont){
var _local2:String;
_local2 = String(Math.round(this.targetTextNumber));
_arg1.text_txt.text = (_local2 + " m");
}
}
}//package src.Page.PlayPage.BestHeightCont
Section 59
//CurrentHeightCont (src.Page.PlayPage.CurrentHeightCont.CurrentHeightCont)
package src.Page.PlayPage.CurrentHeightCont {
import gs.*;
import flash.display.*;
import flash.text.*;
public class CurrentHeightCont extends Sprite {
public var text_txt:TextField;
public static const BASE_TEXT_1 = "Your best height is ";
public static const BASE_TEXT_2 = "Current height is ";
public function CurrentHeightCont(){
this.mouseEnabled = false;
this.mouseChildren = false;
this.text_txt.autoSize = TextFieldAutoSize.CENTER;
}
public function changeToNewText(_arg1:Number, _arg2:Number){
var _local3:String;
_local3 = ((CurrentHeightCont.BASE_TEXT_1 + String(Math.round(_arg2))) + " m\n");
_local3 = (_local3 + ((CurrentHeightCont.BASE_TEXT_2 + String(Math.round(_arg1))) + " m"));
this.text_txt.text = _local3;
}
public function toShow(){
TweenLite.to(this, 0.5, {alpha:0.5, overwrite:2});
}
public function toHide(){
TweenLite.to(this, 0.5, {alpha:0, overwrite:2});
}
}
}//package src.Page.PlayPage.CurrentHeightCont
Section 60
//CurrentMissionCont (src.Page.PlayPage.CurrentMissionCont.CurrentMissionCont)
package src.Page.PlayPage.CurrentMissionCont {
import flash.display.*;
import src.Page.PlayPage.*;
import src.Page.*;
import src.*;
import flash.text.*;
public class CurrentMissionCont extends Sprite implements IPageListenerObject {
private var missionCollect:Number;
public var title_txt:TextField;
public var playPage:PlayPage;
public var mission_txt:TextField;
public var iconCont:MovieClip;
public var curMissionType:Number;
private var curMissionNum:Number;
public static const TYPE_MISSIONS_COUNT:Number = 3;
public static const BASE_MONEY_PER_MISSION:Number = 100;
public static const TYPE_MISSION_MINES:Number = 3;
public static const BASE_TEXT_MINES:String = "Blow up ";
public static const TYPE_MISSION_COINS:Number = 2;
public static const BASE_TEXT_BALLOONS:String = "Collect ";
public static const BASE_TEXT_TITLE:String = "Mission #";
public static const TYPE_MISSION_BALLOONS:Number = 1;
public static const BASE_COUNTS_PER_MISSION:Number = 5;
public static const BASE_TEXT_COINS:String = "Collect ";
public function CurrentMissionCont(){
this.mouseEnabled = false;
this.mouseChildren = false;
this.iconCont.gotoAndStop(1);
this.title_txt.autoSize = TextFieldAutoSize.LEFT;
this.mission_txt.autoSize = TextFieldAutoSize.LEFT;
}
public function setMissionCollect(_arg1:Number){
this.missionCollect = _arg1;
this.updateMissionText();
this.checkMissionComplete();
}
public function savePausedMission(){
Main.root.savesProgress.setPausedMissionInfo(this.curMissionType, this.missionCollect);
}
public function onMissionComplete(){
var _local1:Number;
var _local2:Number;
this.playPage.restartSplash();
_local1 = (this.curMissionNum * CurrentMissionCont.BASE_MONEY_PER_MISSION);
this.playPage.levelCont.onMissionComplete(_local1);
_local2 = Main.root.savesProgress.plusCurrentMissionNum(1);
this.setNewMission(_local2);
}
public function plusMissionCollect(_arg1:Number){
this.missionCollect = (this.missionCollect + _arg1);
this.updateMissionText();
this.checkMissionComplete();
}
public function updateMissionText(){
var _local1:String;
_local1 = "";
if (this.curMissionType == CurrentMissionCont.TYPE_MISSION_BALLOONS){
_local1 = (_local1 + CurrentMissionCont.BASE_TEXT_BALLOONS);
} else {
if (this.curMissionType == CurrentMissionCont.TYPE_MISSION_COINS){
_local1 = (_local1 + CurrentMissionCont.BASE_TEXT_COINS);
};
};
if (this.curMissionType == CurrentMissionCont.TYPE_MISSION_MINES){
_local1 = (_local1 + CurrentMissionCont.BASE_TEXT_MINES);
};
_local1 = (_local1 + (String(this.missionCollect) + " ×"));
this.mission_txt.text = _local1;
this.iconCont.x = ((this.mission_txt.x + this.mission_txt.width) + 5);
}
public function setPlayPage(_arg1:PlayPage){
this.playPage = _arg1;
}
public function checkMissionComplete(){
if (this.missionCollect <= 0){
this.onMissionComplete();
};
}
public function setNewMission(_arg1:Number){
var _local2:Object;
this.curMissionNum = _arg1;
_local2 = Main.root.savesProgress.getPausedMissionInfo();
if (_local2.missionType == null){
this.curMissionType = (1 + Math.floor((Math.random() * CurrentMissionCont.TYPE_MISSIONS_COUNT)));
this.setMissionCollect((this.curMissionNum * CurrentMissionCont.BASE_COUNTS_PER_MISSION));
} else {
this.curMissionType = _local2.missionType;
this.setMissionCollect(_local2.missionCollect);
Main.root.savesProgress.clearPausedMissionInfo();
};
this.iconCont.gotoAndStop(this.curMissionType);
this.title_txt.text = ((CurrentMissionCont.BASE_TEXT_TITLE + this.curMissionNum) + ":");
}
public function onPageEnd(){
}
}
}//package src.Page.PlayPage.CurrentMissionCont
Section 61
//GameMessage (src.Page.PlayPage.LevelCont.GameMessage)
package src.Page.PlayPage.LevelCont {
import src.Levels.LevelGrafObject.*;
import gs.*;
import flash.events.*;
import src.*;
import gs.easing.*;
import flash.utils.*;
public class GameMessage extends LevelGrafObject {
private var endTimer:Timer;
public function GameMessage(){
this.mouseEnabled = false;
this.mouseChildren = false;
}
override public function removeListeners(){
if (!this.endTimer){
return;
};
this.endTimer.stop();
this.endTimer.removeEventListener(TimerEvent.TIMER, this.onEndTimer);
}
public function startTween(){
var _local1:Number;
_local1 = 200;
TweenLite.to(this, 0.5, {y:_local1, ease:Back.easeOut, overwrite:0});
}
public function onEndTimer(_arg1:TimerEvent){
this.endTween();
}
public function endTween(){
if (((!(this)) || (!(this.parent)))){
return;
};
this.removeListeners();
TweenLite.to(this, 0.5, {y:Main.DISPLAY_HEIGHT, overwrite:0, onComplete:this.onEndTween, onCompleteParams:[this]});
}
public function onEndTween(_arg1:GameMessage){
if (((!(_arg1)) || (!(_arg1.parent)))){
return;
};
_arg1.toDeath();
}
override public function onPageEnd(){
this.removeListeners();
super.onPageEnd();
}
override public function setListeners(){
this.endTimer = new Timer(4000);
this.endTimer.addEventListener(TimerEvent.TIMER, this.onEndTimer);
this.endTimer.start();
}
}
}//package src.Page.PlayPage.LevelCont
Section 62
//LevelCont (src.Page.PlayPage.LevelCont.LevelCont)
package src.Page.PlayPage.LevelCont {
import src.Levels.LevelGrafObject.*;
import gs.*;
import flash.events.*;
import src.Page.PlayPage.LevelFon.*;
import src.Page.PlayPage.*;
import src.*;
import src.Levels.LevelGrafObject.Balloon.*;
import src.Levels.LevelGrafObject.Mine.*;
import src.Levels.LevelGrafObject.Coin.*;
import src.Page.PlayPage.PauseScreen.*;
import src.Levels.LevelGrafObject.House.*;
import src.SoundTools.*;
import src.Levels.LevelDataObj.*;
import gs.easing.*;
import flash.utils.*;
import src.Page.PlayPage.CurrentHeightCont.*;
import src.Levels.LevelGrafObject.BoomAnimation.*;
import src.Levels.*;
import src.Page.PlayPage.AchievementCompleteMessage.*;
import src.Page.PlayPage.MissionCompleteTextCont.*;
import src.Page.PlayPage.SurpriseTextCont.*;
import src.Levels.LevelGrafObject.RewritePositionObject.MovebleObject.*;
import src.Levels.LevelGrafObject.Cloud.*;
import src.Levels.LevelGrafObject.Meteor.*;
import src.Levels.LevelGrafObject.Star.*;
import flash.ui.*;
public class LevelCont extends Levels {
private var pauseScreen:PauseScreen;
public var nextPartNum:Number;// = 1
public var curPartNum:Number;// = 0
private var cloudCreateTimer:Timer;
public var parts_array:Array;
public var levelFon:LevelFon;
public var isPause:Boolean;// = false
public var house:House;
private var mineCreateTimer:Timer;
public var currentHeightCont:CurrentHeightCont;
public var nextPartObj:PartsObj;
public var curPartObj:PartsObj;
public var curMessage:GameMessage;// = null
public var playPage:PlayPage;
private var balloonCreateTimer:Timer;
public static const FRICTION:Number = 0.9;
public static const MAX_SPEED_X:Number = 20;
public static const MAX_SPEED_Y:Number = 20;
public static const CLOUDS_CREATE_INTERVAL:Number = 2000;
public static const BALLOONS_CREATE_INTERVAL:Number = 4000;
public static const SURPRISE_COINS_RAIN_COUNT:Number = 10;
public static const FON_PART_HEIGHT:Number = 1200;
public static const HOUSE_START_Y:Number = 510;
public static const HOUSE_START_X:Number = 258;
public static const MIN_SPEED_X:Number = -20;
public static const MIN_SPEED_Y:Number = -20;
public static const GRAVITY:Number = 2;
public static const MINE_CREATE_INTERVAL:Number = 1000;
public function LevelCont(){
curPartNum = 0;
nextPartNum = 1;
curMessage = null;
isPause = false;
super();
this.setListeners();
this.addListObject(this.levelFon);
this.levelFon.setLevelCont(this);
this.levelFon.setListeners();
this.house.setLevelCont(this);
this.addListObject(this.house);
this.createTimers();
this.addPauseObject(this.house);
this.addPauseObject(this.levelFon);
this.setAddToStageListener();
}
public function createSurprise(){
var _local1:Number;
this.playPage.restartSplash();
_local1 = ((Math.random())<0.5) ? SurpriseTextCont.COINS_RAIN : SurpriseTextCont.MINES_RAIN;
this.createSurpriseMessage(_local1);
if (_local1 == SurpriseTextCont.COINS_RAIN){
this.surpriseCoinsRain();
} else {
if (_local1 == SurpriseTextCont.MINES_RAIN){
this.surpriseMinesRain();
};
};
}
public function removeListeners(){
Main.stage.removeEventListener(KeyboardEvent.KEY_DOWN, this.onKeyDown);
this.removeAddToStageListener();
}
public function changePause(){
if (this.isPause){
this.pauseOff();
} else {
this.pauseOn();
};
}
public function removeMineCreateTimer(){
this.mineCreateTimer.removeEventListener(TimerEvent.TIMER, this.onMineCreateTimer);
this.mineCreateTimer.stop();
}
public function setAddToStageListener(){
this.addEventListener(Event.ADDED_TO_STAGE, this.onAddToStage);
}
public function onBalloonCreateTimer(_arg1:TimerEvent){
this.createBalloon(true);
}
public function createSurpriseMessage(_arg1:Number){
var _local2:SurpriseTextCont;
_local2 = new SurpriseTextCont();
_local2.x = ((Main.DISPLAY_WIDTH - _local2.width) / 2);
_local2.y = -(_local2.height);
_local2.setLevelCont(this);
this.addListObject(_local2);
this.addChild(_local2);
_local2.setTypeOfSurprise(_arg1);
_local2.startTween();
_local2.setListeners();
this.removeCurMessage();
this.addCurMessage(_local2);
}
public function setPlayPage(_arg1:PlayPage){
this.playPage = _arg1;
}
public function pauseOn(){
var _local1:Number;
var _local2:LevelGrafObject;
var _local3:Array;
var _local4:Number;
var _local5:Object;
var _local6:Number;
this.isPause = true;
this.removeTimers();
this.playPage.removeNotLostTimer();
this.createPauseScreen();
_local1 = this.pause_array.length;
_local3 = [];
_local6 = 0;
while (_local6 < this.pause_array.length) {
_local2 = this.pause_array[_local6];
if (_local2){
_local2.onPauseOn();
};
_local4 = _local2.getItemNumber();
if ((((_local4 == LevelDataObj.COIN)) || ((_local4 == LevelDataObj.MINE)))){
_local5 = {};
_local5.itemNumber = _local4;
_local5.x = _local2.x;
_local5.y = _local2.y;
_local5.speedX = MovebleObject(_local2).speedX;
_local5.speedY = MovebleObject(_local2).speedY;
_local5.accelX = MovebleObject(_local2).accelX;
_local5.accelY = MovebleObject(_local2).accelY;
if (_local4 == LevelDataObj.MINE){
_local5.currentTime = Mine(_local2).getCurrentTime();
};
_local3.push(_local5);
};
Main.root.savesProgress.createPauseInformation(_local3);
_local6++;
};
this.playPage.currentMissionCont.savePausedMission();
}
public function onCloudCreateTimer(_arg1:TimerEvent){
this.createCloud();
}
public function createPartArray(){
this.parts_array = [new PartsObj(-7200, 0), new PartsObj(-4800, 25), new PartsObj(-2400, 50), new PartsObj(0, 75)];
this.curPartObj = this.parts_array[0];
this.nextPartObj = this.parts_array[1];
}
public function setMineCreateTimer(){
this.mineCreateTimer = new Timer(LevelCont.MINE_CREATE_INTERVAL);
this.mineCreateTimer.addEventListener(TimerEvent.TIMER, this.onMineCreateTimer);
this.mineCreateTimer.start();
}
public function createCloud(){
var _local1:Number;
var _local2:Number;
var _local3:Cloud;
_local1 = (-200 + (Math.random() * (Main.DISPLAY_HEIGHT + 245)));
_local2 = (_local1 - this.levelFon.y);
if (_local2 < 2400){
this.createStar(_local1);
this.createStar((_local1 + 50));
this.createStar((_local1 + 150));
this.createStar((_local1 - 100));
return;
};
if (_local2 > 9400){
_local1 = (9400 + this.levelFon);
};
_local3 = new Cloud();
if (((((_local1 + _local3.height) < 0)) || ((_local1 > Main.DISPLAY_HEIGHT)))){
_local3.x = (100 + (Math.random() * Main.DISPLAY_WIDTH));
} else {
_local3.x = Main.DISPLAY_WIDTH;
};
_local3.y = _local1;
_local3.setLevelCont(this);
this.addPauseObject(_local3);
this.addListObject(_local3);
this.gridObjectCont.addChild(_local3);
}
public function onAddToStage(_arg1:Event){
this.startInit();
}
public function startInit(){
var _local1:Number;
var _local2:Number;
var _local3:Balloon;
var _local4:Number;
_local1 = Main.root.savesProgress.getBestHeight();
if (_local1 > 0){
this.currentHeightCont.changeToNewText(0, _local1);
} else {
this.currentHeightCont.toHide();
};
_local2 = Main.root.savesProgress.getBalloonsCount();
_local4 = 0;
while (_local4 < _local2) {
this.house.plusUpPowerWithoutUpBar(Main.root.savesProgress.getBalloonUpPower());
if (_local4 < House.MAX_DISPLAY_BALLOONS){
_local3 = this.createBalloon();
_local3.setHouse(this.house, true);
_local3.removeOnRollOver();
};
_local4++;
};
this.house.setRealBalloonsCount(_local2);
this.levelFon.moveToLastY();
if (_local2 > 0){
this.playPage.createNotLostTimer();
};
this.createPauseObjects();
this.removeAddToStageListener();
}
public function onKeyDown(_arg1:KeyboardEvent){
if ((((((((_arg1.keyCode == Keyboard.ESCAPE)) || ((_arg1.keyCode == Keyboard.SPACE)))) || ((_arg1.keyCode == 80)))) || ((_arg1.keyCode == 81)))){
this.changePause();
};
}
public function setCloudCreateTimer(){
this.cloudCreateTimer = new Timer(LevelCont.CLOUDS_CREATE_INTERVAL);
this.cloudCreateTimer.addEventListener(TimerEvent.TIMER, this.onCloudCreateTimer);
this.cloudCreateTimer.start();
}
public function onCompleteEndPuaseScreen(_arg1:PauseScreen){
if (((!(_arg1)) || (!(_arg1.parent)))){
return;
};
_arg1.onPageEnd();
_arg1.parent.removeChild(_arg1);
}
public function removeCloudCreateTimer(){
this.cloudCreateTimer.removeEventListener(TimerEvent.TIMER, this.onCloudCreateTimer);
this.cloudCreateTimer.stop();
}
public function removePauseScreen(){
if (((!(this.pauseScreen)) || (!(this.pauseScreen.parent)))){
return;
};
TweenLite.to(this.pauseScreen, 0.1, {alpha:0, ease:Linear.easeIn, onComplete:this.onCompleteEndPuaseScreen, onCompleteParams:[this.pauseScreen]});
}
override public function onPageEnd(){
this.removeListeners();
this.removeTimers();
this.toEnd();
super.onPageEnd();
}
public function onMissionComplete(_arg1:Number){
this.playPage.plusMoney(_arg1);
Main.root.soundTools.playSoundByNumber(SoundTools.MISSION_COMPLETE_SOUND);
this.createMissionCompleteMessage(_arg1);
}
public function addCurMessage(_arg1:GameMessage){
this.curMessage = _arg1;
}
public function createBoomAnimation(_arg1:Number, _arg2:Number, _arg3:Number=1){
var _local4:BoomAnimation;
_local4 = new BoomAnimation();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.scaleX = (_local4.scaleY = _arg3);
this.gridObjectCont.addChild(_local4);
}
public function surpriseMinesRain(){
Main.root.soundTools.playSoundByNumber(SoundTools.SURPRISE_BOMBS_SOUND);
this.createMine(false, 65, -150);
this.createMine(false, 115, -50);
this.createMine(false, 165, -150);
this.createMine(false, 215, -50);
this.createMine(false, 265, -150);
this.createMine(false, 315, -50);
this.createMine(false, 365, -150);
this.createMine(false, 415, -50);
this.createMine(false, 465, -150);
this.createMine(false, 515, -50);
}
public function removeCurMessage(){
if (this.curMessage != null){
this.curMessage.endTween();
};
}
public function createPauseScreen(){
this.removePauseScreen();
this.pauseScreen = new PauseScreen();
this.pauseScreen.alpha = 0;
this.addChild(this.pauseScreen);
TweenLite.to(this.pauseScreen, 0.1, {alpha:1, ease:Linear.easeIn});
}
public function createPauseObjects(){
var _local1:Array;
var _local2:Number;
var _local3:Object;
var _local4:Number;
var _local5:MovebleObject;
var _local6:Number;
_local1 = Main.root.savesProgress.getPauseInformation();
_local2 = _local1.length;
if (_local2 > 0){
_local6 = 0;
while (_local6 < _local2) {
_local3 = _local1[_local6];
_local4 = _local3.itemNumber;
if (_local4 == LevelDataObj.COIN){
_local5 = this.createCoin(_local3.x, _local3.y);
} else {
if (_local4 == LevelDataObj.MINE){
_local5 = this.createMine(false, _local3.x, _local3.y);
Mine(_local5).setCurrentTime(_local3.currentTime);
};
};
_local5.setSpeedX(_local3.speedX);
_local5.setSpeedY(_local3.speedY);
_local5.setAccelX(_local3.accelX);
_local5.setAccelY(_local3.accelY);
_local6++;
};
};
Main.root.savesProgress.clearPauseInformation();
}
public function createStar(_arg1:Number){
var _local2:Star;
_local2 = new Star();
_local2.y = Math.round(_arg1);
_local2.x = Math.round((Math.random() * Main.DISPLAY_WIDTH));
_local2.setLevelCont(this);
this.addListObject(_local2);
this.gridObjectCont.addChild(_local2);
}
public function createMine(_arg1:Boolean=true, _arg2:Number=0, _arg3:Number=0):Mine{
var _local4:Mine;
_local4 = new Mine(this.levelFon);
if (_arg1){
_local4.x = (Math.random() * (Main.DISPLAY_WIDTH - _local4.width));
_local4.y = (-(_local4.height) - (Math.random() * 100));
} else {
_local4.x = _arg2;
_local4.y = _arg3;
};
_local4.setLevelCont(this);
this.addPauseObject(_local4);
this.addListObject(_local4);
this.gridObjectCont.addChild(_local4);
return (_local4);
}
public function removeTimers(){
this.removeBalloonCreateTimer();
this.removeCloudCreateTimer();
this.removeMineCreateTimer();
}
public function onMineCreateTimer(_arg1:TimerEvent){
this.createMine();
}
public function createAchievementCompleteMessage(_arg1:String){
var _local2:AchievementCompleteMessage;
_local2 = new AchievementCompleteMessage();
_local2.setText(_arg1);
_local2.x = ((Main.DISPLAY_WIDTH - _local2.width) / 2);
_local2.y = -(_local2.height);
_local2.setLevelCont(this);
this.addListObject(_local2);
this.addChild(_local2);
_local2.startTween();
_local2.setListeners();
Main.root.soundTools.playSoundByNumber(SoundTools.MISSION_COMPLETE_SOUND);
this.removeCurMessage();
this.addCurMessage(_local2);
}
public function createMissionCompleteMessage(_arg1:Number){
var _local2:MissionCompleteTextCont;
_local2 = new MissionCompleteTextCont();
_local2.setMoney(_arg1);
_local2.x = ((Main.DISPLAY_WIDTH - _local2.width) / 2);
_local2.y = -(_local2.height);
_local2.setLevelCont(this);
this.addListObject(_local2);
this.addChild(_local2);
_local2.startTween();
_local2.setListeners();
this.removeCurMessage();
this.addCurMessage(_local2);
}
public function pauseOff(){
var _local1:Number;
var _local2:LevelGrafObject;
var _local3:Number;
this.isPause = false;
this.createTimers();
if (this.house.realBalloonsCount > 0){
this.playPage.createNotLostTimer();
};
this.removePauseScreen();
_local1 = this.pause_array.length;
_local3 = 0;
while (_local3 < this.pause_array.length) {
_local2 = this.pause_array[_local3];
if (_local2){
_local2.onPauseOff();
};
_local3++;
};
}
public function createBalloon(_arg1:Boolean=false, _arg2:Number=0, _arg3:Number=0):Balloon{
var _local4:Balloon;
var _local5:Number;
_local4 = new Balloon();
if (_arg1){
_arg2 = (Math.random() * (Main.DISPLAY_WIDTH - _local4.width));
_arg3 = (Main.DISPLAY_HEIGHT + 20);
_local5 = (-2 - (Math.random() * 3));
_local4.setSpeedY(_local5);
};
_local4.x = _arg2;
_local4.y = _arg3;
_local4.setLevelCont(this);
this.addPauseObject(_local4);
this.addListObject(_local4);
this.gridObjectCont.addChild(_local4);
return (_local4);
}
public function removeBalloonCreateTimer(){
this.balloonCreateTimer.removeEventListener(TimerEvent.TIMER, this.onBalloonCreateTimer);
this.balloonCreateTimer.stop();
}
public function createCoin(_arg1:Number, _arg2:Number):Coin{
var _local3:Coin;
_local3 = new Coin();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.setLevelCont(this);
this.addPauseObject(_local3);
this.addListObject(_local3);
this.gridObjectCont.addChild(_local3);
return (_local3);
}
public function createMeteor(_arg1:Number){
var _local2:Meteor;
_local2 = new Meteor();
_local2.y = Math.round(_arg1);
_local2.x = Main.DISPLAY_WIDTH;
_local2.setLevelCont(this);
this.addListObject(_local2);
this.gridObjectCont.addChild(_local2);
}
public function surpriseCoinsRain(){
var _local1:Number;
Main.root.soundTools.playSoundByNumber(SoundTools.SURPRISE_COINS_SOUND);
_local1 = 0;
while (_local1 < LevelCont.SURPRISE_COINS_RAIN_COUNT) {
this.createCoin((40 + (Math.random() * (Main.DISPLAY_WIDTH - 80))), -40);
_local1++;
};
}
public function removeAddToStageListener(){
this.removeEventListener(Event.ADDED_TO_STAGE, this.onAddToStage);
}
public function createTimers(){
this.setBalloonCreateTimer();
this.setCloudCreateTimer();
this.setMineCreateTimer();
}
public function setBalloonCreateTimer(){
this.balloonCreateTimer = new Timer(LevelCont.BALLOONS_CREATE_INTERVAL);
this.balloonCreateTimer.addEventListener(TimerEvent.TIMER, this.onBalloonCreateTimer);
this.balloonCreateTimer.start();
}
public function setListeners(){
Main.stage.addEventListener(KeyboardEvent.KEY_DOWN, this.onKeyDown);
}
}
}//package src.Page.PlayPage.LevelCont
Section 63
//PartsObj (src.Page.PlayPage.LevelCont.PartsObj)
package src.Page.PlayPage.LevelCont {
public class PartsObj {
public var partY:Number;
public var baseUpPower:Number;
public function PartsObj(_arg1:Number, _arg2:Number){
this.partY = _arg1;
this.baseUpPower = _arg2;
}
}
}//package src.Page.PlayPage.LevelCont
Section 64
//LevelFon (src.Page.PlayPage.LevelFon.LevelFon)
package src.Page.PlayPage.LevelFon {
import src.Levels.LevelGrafObject.*;
import flash.events.*;
import src.Page.PlayPage.BestHeightCont.*;
import src.Page.*;
import src.*;
import src.Levels.LevelGrafObject.House.*;
import src.SimpleBtn.MenuButtons.*;
public class LevelFon extends LevelGrafObject implements IPageListenerObject {
public var highScoresBtn:HighScoresBtn;
public var upgradesBtn:UpgradesBtn;
private var bestHeight:Number;
private var prevTargetY:Number;
public var bestHeightCont:BestHeightCont;
private var fonScrollRatio:Number;
public var clearSavesBtn:ClearSavesBtn;
private var accelY:Number;// = 0
public var instructionsBtn:InstructionsBtn;
public var prevY:Number;// = 0
public var prevX:Number;// = 0
public var achievementsBtn:AchievementsBtn;
public var deltaY:Number;// = 0
public var minFonY:Number;
public var deltaX:Number;// = 0
public var curShag:Number;// = 0
private var targetY:Number;
public var sponsorBtn:SponsorBtn;
private var speedY:Number;// = 0
public static const MIN_FON_SPEED:Number = -15;
public static const MAX_FON_SPEED:Number = 5;
public static const SHAG_HEIGHT:Number = 200;
public function LevelFon(){
var _local1:Number;
var _local2:*;
curShag = 0;
accelY = 0;
speedY = 0;
prevX = 0;
prevY = 0;
deltaX = 0;
deltaY = 0;
super();
this.clearSavesBtn.setPageType(ClearSavesBtn.PLAY_PAGE_TYPE);
this.findNeedValues();
this.bestHeightCont.setLevelFon(this);
_local1 = Main.root.savesProgress.getBestHeight();
_local2 = (_local1 + this.minFonY);
this.updateBestHeight(_local2);
}
private function findNeedValues(){
this.minFonY = (Main.DISPLAY_HEIGHT - this.height);
this.fonScrollRatio = (this.minFonY / House.MAX_UP_POWER);
}
override public function removeListeners(){
this.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
}
public function moveFon(){
var _local1:Number;
var _local2:Number;
_local1 = this.levelCont.house.getUpPower();
this.prevTargetY = this.targetY;
this.targetY = (this.minFonY - ((this.minFonY * _local1) / House.MAX_UP_POWER));
if (this.targetY == this.y){
return;
};
if (this.bestHeight <= this.targetY){
if (this.prevTargetY < this.bestHeight){
this.levelCont.currentHeightCont.toHide();
};
this.updateBestHeight(this.targetY);
this.levelCont.playPage.checkHeighAchiev(this.y);
} else {
if (this.prevTargetY >= this.bestHeight){
this.levelCont.currentHeightCont.toShow();
};
this.levelCont.currentHeightCont.changeToNewText((this.y - this.minFonY), (this.bestHeight - this.minFonY));
};
this.speedY = ((this.targetY - this.y) / 10);
this.checkFonSpeedYRight();
_local2 = (this.y + this.speedY);
if (_local2 < this.minFonY){
_local2 = this.minFonY;
};
this.y = _local2;
Main.root.savesProgress.setFonY(this.y);
}
public function checkFonSpeedYRight(){
if (this.speedY < LevelFon.MIN_FON_SPEED){
this.speedY = LevelFon.MIN_FON_SPEED;
} else {
if (this.speedY > LevelFon.MAX_FON_SPEED){
this.speedY = LevelFon.MAX_FON_SPEED;
};
};
}
public function savePrevCoordinates(){
this.prevX = this.x;
this.prevY = this.y;
}
public function moveToLastY(){
this.targetY = Main.root.savesProgress.getFonY();
if (this.bestHeight <= this.targetY){
this.levelCont.currentHeightCont.toHide();
this.updateBestHeight(this.targetY);
this.levelCont.playPage.checkHeighAchiev(this.y);
} else {
this.levelCont.currentHeightCont.changeToNewText((this.targetY - this.minFonY), (this.bestHeight - this.minFonY));
};
this.y = this.targetY;
}
public function onEnterFrame(_arg1:Event){
this.savePrevCoordinates();
this.moveFon();
this.findDeltas();
}
public function findShag(){
var _local1:Number;
_local1 = Math.floor(((this.y + this.minFonY) / LevelFon.SHAG_HEIGHT));
if (this.curShag != _local1){
this.curShag = _local1;
};
}
public function updateBestHeight(_arg1:Number){
var _local2:Number;
var _local3:Number;
this.bestHeight = _arg1;
_local2 = (_arg1 * -1);
_local3 = (_arg1 - this.minFonY);
this.bestHeightCont.moveToNewY(_local2, _local3);
Main.root.savesProgress.setBestHeight(_local3);
}
public function findDeltas(){
this.deltaX = (this.x - this.prevX);
this.deltaY = (this.y - this.prevY);
}
public function getSpeedY():Number{
return (this.speedY);
}
override public function onPageEnd(){
this.instructionsBtn.onPageEnd();
this.upgradesBtn.onPageEnd();
this.achievementsBtn.onPageEnd();
this.clearSavesBtn.onPageEnd();
this.highScoresBtn.onPageEnd();
this.sponsorBtn.onPageEnd();
this.removeListeners();
}
override public function setListeners(){
this.addEventListener(Event.ENTER_FRAME, this.onEnterFrame);
}
}
}//package src.Page.PlayPage.LevelFon
Section 65
//MissionCompleteTextCont (src.Page.PlayPage.MissionCompleteTextCont.MissionCompleteTextCont)
package src.Page.PlayPage.MissionCompleteTextCont {
import src.Page.PlayPage.LevelCont.*;
import flash.text.*;
public class MissionCompleteTextCont extends GameMessage {
public var text_txt:TextField;
public static const TEXT_BASE:String = "Congratulations! Mission complete!
You earn ";
public function MissionCompleteTextCont(){
this.text_txt.autoSize = TextFieldAutoSize.CENTER;
}
public function setMoney(_arg1:Number){
var _local2:Number;
this.text_txt.text = ((MissionCompleteTextCont.TEXT_BASE + _arg1) + " $");
_local2 = 200;
}
}
}//package src.Page.PlayPage.MissionCompleteTextCont
Section 66
//MoneyCont (src.Page.PlayPage.MoneyCont.MoneyCont)
package src.Page.PlayPage.MoneyCont {
import flash.display.*;
import src.Page.*;
import flash.text.*;
public class MoneyCont extends Sprite implements IPageListenerObject {
public var text_txt:TextField;
public function MoneyCont(){
this.mouseEnabled = false;
this.mouseChildren = false;
this.text_txt.autoSize = TextFieldAutoSize.RIGHT;
}
public function setMoney(_arg1:Number){
this.text_txt.text = (_arg1 + " $");
}
public function onPageEnd(){
}
}
}//package src.Page.PlayPage.MoneyCont
Section 67
//CreditsBtn (src.Page.PlayPage.PauseScreen.CreditsBtn.CreditsBtn)
package src.Page.PlayPage.PauseScreen.CreditsBtn {
import flash.events.*;
import src.*;
import src.SoundTools.*;
import src.SimpleBtn.*;
public class CreditsBtn extends SimpleBtn {
override public function onOver(_arg1:MouseEvent){
Main.root.soundTools.playSoundByNumber(SoundTools.MENU_SOUND);
super.onOver(_arg1);
}
override public function onClick(_arg1:MouseEvent){
Main.root.gotoCreditsLink();
super.onClick(_arg1);
}
}
}//package src.Page.PlayPage.PauseScreen.CreditsBtn
Section 68
//PlayMoreGamesBtn (src.Page.PlayPage.PauseScreen.PlayMoreGamesBtn.PlayMoreGamesBtn)
package src.Page.PlayPage.PauseScreen.PlayMoreGamesBtn {
import flash.events.*;
import src.*;
import src.SoundTools.*;
import src.SimpleBtn.*;
public class PlayMoreGamesBtn extends SimpleBtn {
override public function onOver(_arg1:MouseEvent){
Main.root.soundTools.playSoundByNumber(SoundTools.MENU_SOUND);
super.onOver(_arg1);
}
override public function onClick(_arg1:MouseEvent){
Main.root.gotoSponsorMoreLink();
super.onClick(_arg1);
}
}
}//package src.Page.PlayPage.PauseScreen.PlayMoreGamesBtn
Section 69
//SoundBtn (src.Page.PlayPage.PauseScreen.SoundBtn.SoundBtn)
package src.Page.PlayPage.PauseScreen.SoundBtn {
import flash.events.*;
import src.*;
import src.SoundTools.*;
import src.SimpleBtn.*;
public class SoundBtn extends SimpleBtn {
override public function onOver(_arg1:MouseEvent){
Main.root.soundTools.playSoundByNumber(SoundTools.MENU_SOUND);
super.onOver(_arg1);
}
override public function onClick(_arg1:MouseEvent){
Main.root.soundTools.changeIsSounOn();
super.onClick(_arg1);
}
}
}//package src.Page.PlayPage.PauseScreen.SoundBtn
Section 70
//PauseScreen (src.Page.PlayPage.PauseScreen.PauseScreen)
package src.Page.PlayPage.PauseScreen {
import flash.display.*;
import src.Page.*;
import src.SimpleBtn.MenuButtons.*;
import src.Page.PlayPage.PauseScreen.CreditsBtn.*;
import src.Page.PlayPage.PauseScreen.PlayMoreGamesBtn.*;
import src.Page.PlayPage.PauseScreen.SoundBtn.*;
public class PauseScreen extends Sprite implements IPageListenerObject {
public var upgradesBtn:UpgradesBtn;
public var clearSavesBtn:ClearSavesBtn;
public var creditsBtn:CreditsBtn;
public var instructionsBtn:InstructionsBtn;
public var achievementsBtn:AchievementsBtn;
public var playMoreGamesBtn:PlayMoreGamesBtn;
public var fon:Sprite;
public var soundBtn:SoundBtn;
public var sponsorBtn:SponsorBtn;
public var highScoresBtn:HighScoresBtn;
public var textCont:Sprite;
public function PauseScreen(){
this.clearSavesBtn.setPageType(ClearSavesBtn.PLAY_PAGE_TYPE);
}
public function onPageEnd(){
this.instructionsBtn.onPageEnd();
this.upgradesBtn.onPageEnd();
this.achievementsBtn.onPageEnd();
this.clearSavesBtn.onPageEnd();
this.highScoresBtn.onPageEnd();
this.sponsorBtn.onPageEnd();
this.creditsBtn.onPageEnd();
this.playMoreGamesBtn.onPageEnd();
this.soundBtn.onPageEnd;
}
}
}//package src.Page.PlayPage.PauseScreen
Section 71
//SurpriseTextCont (src.Page.PlayPage.SurpriseTextCont.SurpriseTextCont)
package src.Page.PlayPage.SurpriseTextCont {
import src.Page.PlayPage.LevelCont.*;
import flash.text.*;
public class SurpriseTextCont extends GameMessage {
public var text_txt:TextField;
public static const MINES_RAIN_TEXT:String = "Surprise!
Bombs rain";
public static const COINS_RAIN:Number = 1;
public static const MINES_RAIN:Number = 2;
public static const COINS_RAIN_TEXT:String = "Surprise!
Coins rain";
public function SurpriseTextCont(){
this.text_txt.autoSize = TextFieldAutoSize.CENTER;
}
public function setTypeOfSurprise(_arg1:Number){
if (_arg1 == SurpriseTextCont.COINS_RAIN){
this.text_txt.text = SurpriseTextCont.COINS_RAIN_TEXT;
} else {
if (_arg1 == SurpriseTextCont.MINES_RAIN){
this.text_txt.text = SurpriseTextCont.MINES_RAIN_TEXT;
};
};
}
}
}//package src.Page.PlayPage.SurpriseTextCont
Section 72
//UpBarCont (src.Page.PlayPage.UpBarCont.UpBarCont)
package src.Page.PlayPage.UpBarCont {
import gs.*;
import flash.display.*;
import src.Page.PlayPage.*;
import src.Page.*;
import gs.easing.*;
public class UpBarCont extends Sprite implements IPageListenerObject {
public var playPage:PlayPage;
public var bar:Sprite;
public var maskBar:Sprite;
private var curBarUpPower:Number;// = 0
public static const MAX_BAR_UP_POWER:Number = 7;
public static const MAX_WIDTH:Number = 160;
public function UpBarCont(){
curBarUpPower = 0;
super();
this.mouseEnabled = false;
this.mouseChildren = false;
this.bar.mask = this.maskBar;
}
public function toEmptyBar(){
this.setBarUpPower(0);
}
public function setPlayPage(_arg1:PlayPage){
this.playPage = _arg1;
}
public function moveBar(){
var _local1:Number;
_local1 = Math.round(((UpBarCont.MAX_WIDTH * this.curBarUpPower) / UpBarCont.MAX_BAR_UP_POWER));
TweenLite.to(this.bar, 0.5, {x:_local1, ease:Circ.easeOut});
}
public function setBarUpPower(_arg1:Number){
this.curBarUpPower = _arg1;
this.checkRightBarUpPower();
this.moveBar();
}
public function checkRightBarUpPower(){
if (this.curBarUpPower < 0){
this.curBarUpPower = 0;
} else {
if (this.curBarUpPower >= UpBarCont.MAX_BAR_UP_POWER){
this.playPage.levelCont.createSurprise();
this.toEmptyBar();
};
};
}
public function plusBarUpPower(_arg1:Number){
this.curBarUpPower = (this.curBarUpPower + _arg1);
this.checkRightBarUpPower();
this.moveBar();
}
public function onPageEnd(){
}
}
}//package src.Page.PlayPage.UpBarCont
Section 73
//PlayPage (src.Page.PlayPage.PlayPage)
package src.Page.PlayPage {
import gs.*;
import flash.events.*;
import src.Page.AchievPage.AchievItem.*;
import src.Page.PlayPage.LevelCont.*;
import src.Page.*;
import src.*;
import gs.easing.*;
import flash.utils.*;
import src.Page.PlayPage.CurrentMissionCont.*;
import src.Page.PlayPage.MoneyCont.*;
import src.Page.PlayPage.UpBarCont.*;
public class PlayPage extends Page {
private var isStratosphereAchieved:Boolean;
public var moneyCont:MoneyCont;
private var isIonosphereAchieved:Boolean;
private var isCoinsAchieved:Boolean;
private var isBombsAchieved:Boolean;
private var isNotLostAchieved:Boolean;
public var currentMissionCont:CurrentMissionCont;
private var isBalloonsAchieved:Boolean;
public var upBarCont:UpBarCont;
private var isDeepSpaceAchieved:Boolean;
public var levelCont:LevelCont;
private var isMesosphereAchieved:Boolean;
private var notLostTimer:Timer;
public function PlayPage(){
var _local1:Number;
super();
this.isStratosphereAchieved = Main.root.savesProgress.getIsAchieved(Main.root.savesProgress.getAchievedObjByNum(0));
this.isMesosphereAchieved = Main.root.savesProgress.getIsAchieved(Main.root.savesProgress.getAchievedObjByNum(1));
this.isIonosphereAchieved = Main.root.savesProgress.getIsAchieved(Main.root.savesProgress.getAchievedObjByNum(2));
this.isDeepSpaceAchieved = Main.root.savesProgress.getIsAchieved(Main.root.savesProgress.getAchievedObjByNum(3));
this.isBalloonsAchieved = Main.root.savesProgress.getIsAchieved(Main.root.savesProgress.getAchievedObjByNum(4));
this.isCoinsAchieved = Main.root.savesProgress.getIsAchieved(Main.root.savesProgress.getAchievedObjByNum(5));
this.isBombsAchieved = Main.root.savesProgress.getIsAchieved(Main.root.savesProgress.getAchievedObjByNum(6));
this.isNotLostAchieved = Main.root.savesProgress.getIsAchieved(Main.root.savesProgress.getAchievedObjByNum(7));
this.levelCont = new LevelCont();
this.levelCont.setPlayPage(this);
this.addListObject(this.levelCont);
this.addChild(this.levelCont);
this.upBarCont = new UpBarCont();
this.upBarCont.x = 10;
this.upBarCont.y = 25;
this.upBarCont.setPlayPage(this);
this.addListObject(this.upBarCont);
this.addChild(this.upBarCont);
this.currentMissionCont = new CurrentMissionCont();
this.currentMissionCont.x = 10;
this.currentMissionCont.y = 95;
this.currentMissionCont.setPlayPage(this);
_local1 = Main.root.savesProgress.getCurrentMissionNum();
this.currentMissionCont.setNewMission(_local1);
this.addListObject(this.currentMissionCont);
this.addChild(this.currentMissionCont);
this.moneyCont = new MoneyCont();
this.moneyCont.x = ((Main.DISPLAY_WIDTH - this.moneyCont.width) - 10);
this.moneyCont.y = 25;
this.moneyCont.setMoney(Main.root.savesProgress.getMoney());
this.addListObject(this.moneyCont);
this.addChild(this.moneyCont);
}
public function onCompleteRestartSplash(_arg1:FonWhite){
if (((!(_arg1)) || (!(_arg1.parent)))){
return;
};
_arg1.parent.removeChild(_arg1);
}
public function createNotLostTimer(){
if (!this.isNotLostAchieved){
this.removeNotLostTimer();
this.notLostTimer = new Timer(AchievItem7.TO_PRIZE_VALUE);
this.notLostTimer.addEventListener(TimerEvent.TIMER, this.onNotLostTimer);
this.notLostTimer.start();
};
}
public function restartSplash(){
var _local1:FonWhite;
_local1 = new FonWhite();
_local1.mouseEnabled = false;
_local1.alpha = 0.75;
_local1.width = Main.DISPLAY_WIDTH;
_local1.height = Main.DISPLAY_HEIGHT;
this.addChild(_local1);
TweenLite.to(_local1, 0.5, {alpha:0, ease:Linear.easeIn, onComplete:this.onCompleteRestartSplash, onCompleteParams:[_local1]});
}
public function onMineBlowUp(){
var _local1:Number;
if (this.currentMissionCont.curMissionType == CurrentMissionCont.TYPE_MISSION_MINES){
this.currentMissionCont.plusMissionCollect(-1);
};
_local1 = Main.root.savesProgress.plusAllBlowUpBombs(1);
if (!this.isBombsAchieved){
if (_local1 >= AchievItem6.TO_PRIZE_VALUE){
this.plusMoney(AchievItem6.PRIZE_MONEY);
this.isBombsAchieved = true;
Main.root.savesProgress.setIsAchieved(Main.root.savesProgress.getAchievedObjByNum(6), true);
this.levelCont.createAchievementCompleteMessage(AchievItem6.CONGRATS_TEXT);
this.restartSplash();
};
};
}
override public function toEnd(){
this.removeNotLostTimer();
super.toEnd();
}
public function restartTimer(){
if (this.notLostTimer){
this.notLostTimer.reset();
};
}
public function onNotLostTimer(_arg1:TimerEvent){
this.plusMoney(AchievItem7.PRIZE_MONEY);
this.isNotLostAchieved = true;
Main.root.savesProgress.setIsAchieved(Main.root.savesProgress.getAchievedObjByNum(7), true);
this.levelCont.createAchievementCompleteMessage(AchievItem7.CONGRATS_TEXT);
this.restartSplash();
this.removeNotLostTimer();
}
public function plusMoney(_arg1:Number){
var _local2:Number;
_local2 = Main.root.savesProgress.plusMoney(_arg1);
this.moneyCont.setMoney(_local2);
}
public function removeNotLostTimer(){
if (this.notLostTimer){
this.notLostTimer.removeEventListener(TimerEvent.TIMER, this.onNotLostTimer);
this.notLostTimer.stop();
};
}
public function checkHeighAchiev(_arg1:Number){
if (((!(this.isStratosphereAchieved)) && ((_arg1 > AchievItem0.TO_PRIZE_VALUE)))){
this.plusMoney(AchievItem0.PRIZE_MONEY);
this.isStratosphereAchieved = true;
Main.root.savesProgress.setIsAchieved(Main.root.savesProgress.getAchievedObjByNum(0), true);
this.levelCont.createAchievementCompleteMessage(AchievItem0.CONGRATS_TEXT);
this.restartSplash();
Main.root.sendKongregateHighScore();
} else {
if (((!(this.isMesosphereAchieved)) && ((_arg1 > AchievItem1.TO_PRIZE_VALUE)))){
this.plusMoney(AchievItem1.PRIZE_MONEY);
this.isMesosphereAchieved = true;
Main.root.savesProgress.setIsAchieved(Main.root.savesProgress.getAchievedObjByNum(1), true);
this.levelCont.createAchievementCompleteMessage(AchievItem1.CONGRATS_TEXT);
this.restartSplash();
Main.root.sendKongregateHighScore();
} else {
if (((!(this.isIonosphereAchieved)) && ((_arg1 > AchievItem2.TO_PRIZE_VALUE)))){
this.plusMoney(AchievItem2.PRIZE_MONEY);
this.isIonosphereAchieved = true;
Main.root.savesProgress.setIsAchieved(Main.root.savesProgress.getAchievedObjByNum(2), true);
this.levelCont.createAchievementCompleteMessage(AchievItem2.CONGRATS_TEXT);
this.restartSplash();
Main.root.sendKongregateHighScore();
} else {
if (((!(this.isDeepSpaceAchieved)) && ((_arg1 > AchievItem3.TO_PRIZE_VALUE)))){
this.plusMoney(AchievItem3.PRIZE_MONEY);
this.isDeepSpaceAchieved = true;
Main.root.savesProgress.setIsAchieved(Main.root.savesProgress.getAchievedObjByNum(3), true);
this.levelCont.createAchievementCompleteMessage(AchievItem3.CONGRATS_TEXT);
this.restartSplash();
Main.root.sendKongregateHighScore();
};
};
};
};
}
public function onBalloonCath(){
var _local1:Number;
if (this.currentMissionCont.curMissionType == CurrentMissionCont.TYPE_MISSION_BALLOONS){
this.currentMissionCont.plusMissionCollect(-1);
};
_local1 = Main.root.savesProgress.plusAllCollectedBalloons(1);
if (!this.isBalloonsAchieved){
if (_local1 >= AchievItem4.TO_PRIZE_VALUE){
this.plusMoney(AchievItem4.PRIZE_MONEY);
this.isBalloonsAchieved = true;
Main.root.savesProgress.setIsAchieved(Main.root.savesProgress.getAchievedObjByNum(4), true);
this.levelCont.createAchievementCompleteMessage(AchievItem4.CONGRATS_TEXT);
this.restartSplash();
};
};
}
public function onCoinCollect(){
var _local1:Number;
if (this.currentMissionCont.curMissionType == CurrentMissionCont.TYPE_MISSION_COINS){
this.currentMissionCont.plusMissionCollect(-1);
};
_local1 = Main.root.savesProgress.plusAllCollectedCoins(1);
if (!this.isCoinsAchieved){
if (_local1 >= AchievItem5.TO_PRIZE_VALUE){
this.plusMoney(AchievItem5.PRIZE_MONEY);
this.isCoinsAchieved = true;
Main.root.savesProgress.setIsAchieved(Main.root.savesProgress.getAchievedObjByNum(5), true);
this.levelCont.createAchievementCompleteMessage(AchievItem5.CONGRATS_TEXT);
this.restartSplash();
};
};
}
}
}//package src.Page.PlayPage
Section 74
//UpgradeBtn (src.Page.UpgradePage.UpgradeItem.UpgradeBtn)
package src.Page.UpgradePage.UpgradeItem {
import flash.events.*;
import src.*;
import src.SoundTools.*;
import src.SimpleBtn.*;
public class UpgradeBtn extends SimpleBtn {
private var upgradeItem:UpgradeItem;
override public function onOver(_arg1:MouseEvent){
Main.root.soundTools.playSoundByNumber(SoundTools.MENU_SOUND);
super.onOver(_arg1);
}
public function setUpgradeItem(_arg1:UpgradeItem){
this.upgradeItem = _arg1;
}
override public function onClick(_arg1:MouseEvent){
this.upgradeItem.onUpgradeBtnClick();
super.onClick(_arg1);
}
}
}//package src.Page.UpgradePage.UpgradeItem
Section 75
//UpgradeItem (src.Page.UpgradePage.UpgradeItem.UpgradeItem)
package src.Page.UpgradePage.UpgradeItem {
import flash.display.*;
import src.Page.UpgradePage.*;
import src.Page.*;
import src.*;
import src.SoundTools.*;
import flash.text.*;
public class UpgradeItem extends Sprite implements IPageListenerObject {
public var cost_txt:TextField;
public var title_txt:TextField;
public var baseValue:Number;
public var notEnough:Sprite;
public var next_txt:TextField;
public var currentUpgradeNum:Number;
public var nextValue:Number;
public var valuePlusPerUpgrade:Number;
public var currentValue:Number;
public var baseUpgradeCost:Number;
public var upgradeBtn:UpgradeBtn;
public var textAfter:String;
private var upgradePage:UpgradePage;
public var cur_txt:TextField;
public function UpgradeItem(){
this.cur_txt.autoSize = TextFieldAutoSize.CENTER;
this.next_txt.autoSize = TextFieldAutoSize.CENTER;
this.cost_txt.autoSize = TextFieldAutoSize.CENTER;
this.notEnough.visible = false;
this.upgradeBtn.setUpgradeItem(this);
}
public function onUpgradeBtnClick(){
if (this.checkIsEnoughMoney()){
this.makeUpgrade();
} else {
Main.root.soundTools.playSoundByNumber(SoundTools.UPGRADE_ERROR_SOUND);
};
}
public function setUpgradePage(_arg1:UpgradePage){
this.upgradePage = _arg1;
}
public function minusMoney(){
Main.root.savesProgress.plusMoney(-(this.getUpgradeCost()));
}
public function makeUpgrade(){
this.upgradePage.restartSplash();
this.upgradePage.allUpgradesCheckIsEnoughMoney();
this.updateTexts();
Main.root.soundTools.playSoundByNumber(SoundTools.MISSION_COMPLETE_SOUND);
this.upgradePage.updateTotalMoneyText();
}
public function updateTexts(){
this.cur_txt.text = (("current: " + this.currentValue) + this.textAfter);
this.next_txt.text = (("next: " + this.nextValue) + this.textAfter);
this.cost_txt.text = (("cost: " + this.getUpgradeCost()) + " $");
}
public function checkIsEnoughMoney():Boolean{
var _local1:Number;
var _local2:Number;
_local1 = Main.root.savesProgress.getMoney();
_local2 = this.getUpgradeCost();
if (_local1 < _local2){
this.notEnough.visible = true;
this.upgradeBtn.visible = false;
return (false);
};
return (true);
}
public function getUpgradeCost():Number{
var _local1:Number;
_local1 = (this.baseUpgradeCost * Math.pow(2, (this.currentUpgradeNum - 1)));
return (_local1);
}
public function onPageEnd(){
this.upgradeBtn.onPageEnd();
}
}
}//package src.Page.UpgradePage.UpgradeItem
Section 76
//UpgradeItem0 (src.Page.UpgradePage.UpgradeItem.UpgradeItem0)
package src.Page.UpgradePage.UpgradeItem {
import src.*;
public class UpgradeItem0 extends UpgradeItem {
public function UpgradeItem0(){
var _local1:Object;
super();
_local1 = Main.root.savesProgress.getUpgradeObjByNum(0);
this.baseValue = 1;
this.baseUpgradeCost = 3000;
this.valuePlusPerUpgrade = 1;
this.textAfter = " collisions";
this.currentUpgradeNum = Main.root.savesProgress.getCurUpgradeNum(_local1);
this.currentValue = Main.root.savesProgress.getBalloonDefense();
this.nextValue = (this.currentValue + this.valuePlusPerUpgrade);
}
override public function makeUpgrade(){
var _local1:Object;
this.minusMoney();
_local1 = Main.root.savesProgress.getUpgradeObjByNum(0);
this.currentUpgradeNum = Main.root.savesProgress.plusCurUpgradeNum(_local1, 1);
this.currentValue = Main.root.savesProgress.plusBalloonDefense(this.valuePlusPerUpgrade);
this.nextValue = (this.currentValue + this.valuePlusPerUpgrade);
super.makeUpgrade();
}
}
}//package src.Page.UpgradePage.UpgradeItem
Section 77
//UpgradeItem1 (src.Page.UpgradePage.UpgradeItem.UpgradeItem1)
package src.Page.UpgradePage.UpgradeItem {
import src.*;
public class UpgradeItem1 extends UpgradeItem {
private var meterMultiplier:Number;// = 90
public function UpgradeItem1(){
var _local1:Object;
meterMultiplier = 90;
super();
_local1 = Main.root.savesProgress.getUpgradeObjByNum(1);
this.baseValue = 1;
this.baseUpgradeCost = 1000;
this.valuePlusPerUpgrade = 0.5;
this.textAfter = " m";
this.currentUpgradeNum = Main.root.savesProgress.getCurUpgradeNum(_local1);
this.currentValue = (Main.root.savesProgress.getBalloonUpPower() * this.meterMultiplier);
this.nextValue = (this.currentValue + (this.valuePlusPerUpgrade * this.meterMultiplier));
}
override public function makeUpgrade(){
var _local1:Object;
this.minusMoney();
_local1 = Main.root.savesProgress.getUpgradeObjByNum(1);
this.currentUpgradeNum = Main.root.savesProgress.plusCurUpgradeNum(_local1, 1);
this.currentValue = Main.root.savesProgress.plusBalloonUpPower(this.valuePlusPerUpgrade);
this.currentValue = (this.currentValue * this.meterMultiplier);
this.nextValue = (this.currentValue + (this.valuePlusPerUpgrade * this.meterMultiplier));
super.makeUpgrade();
}
}
}//package src.Page.UpgradePage.UpgradeItem
Section 78
//UpgradeItem2 (src.Page.UpgradePage.UpgradeItem.UpgradeItem2)
package src.Page.UpgradePage.UpgradeItem {
import src.*;
public class UpgradeItem2 extends UpgradeItem {
public function UpgradeItem2(){
var _local1:Object;
super();
_local1 = Main.root.savesProgress.getUpgradeObjByNum(2);
this.baseValue = 5;
this.baseUpgradeCost = 1000;
this.valuePlusPerUpgrade = 5;
this.textAfter = " $";
this.currentUpgradeNum = Main.root.savesProgress.getCurUpgradeNum(_local1);
this.currentValue = Main.root.savesProgress.getMoneyPerCoin();
this.nextValue = (this.currentValue + this.valuePlusPerUpgrade);
}
override public function makeUpgrade(){
var _local1:Object;
this.minusMoney();
_local1 = Main.root.savesProgress.getUpgradeObjByNum(2);
this.currentUpgradeNum = Main.root.savesProgress.plusCurUpgradeNum(_local1, 1);
this.currentValue = Main.root.savesProgress.plusMoneyPerCoin(this.valuePlusPerUpgrade);
this.nextValue = (this.currentValue + this.valuePlusPerUpgrade);
super.makeUpgrade();
}
}
}//package src.Page.UpgradePage.UpgradeItem
Section 79
//UpgradeItem3 (src.Page.UpgradePage.UpgradeItem.UpgradeItem3)
package src.Page.UpgradePage.UpgradeItem {
import src.*;
public class UpgradeItem3 extends UpgradeItem {
public function UpgradeItem3(){
var _local1:Object;
super();
_local1 = Main.root.savesProgress.getUpgradeObjByNum(3);
this.baseValue = 1;
this.baseUpgradeCost = 1500;
this.valuePlusPerUpgrade = 1;
this.textAfter = "";
this.currentUpgradeNum = Main.root.savesProgress.getCurUpgradeNum(_local1);
this.currentValue = Main.root.savesProgress.getCoinPerBomb();
this.nextValue = (this.currentValue + this.valuePlusPerUpgrade);
}
override public function makeUpgrade(){
var _local1:Object;
this.minusMoney();
_local1 = Main.root.savesProgress.getUpgradeObjByNum(3);
this.currentUpgradeNum = Main.root.savesProgress.plusCurUpgradeNum(_local1, 1);
this.currentValue = Main.root.savesProgress.plusCoinPerBomb(this.valuePlusPerUpgrade);
this.nextValue = (this.currentValue + this.valuePlusPerUpgrade);
super.makeUpgrade();
}
}
}//package src.Page.UpgradePage.UpgradeItem
Section 80
//UpgradePage (src.Page.UpgradePage.UpgradePage)
package src.Page.UpgradePage {
import gs.*;
import src.Page.*;
import src.*;
import src.Page.UpgradePage.UpgradeItem.*;
import gs.easing.*;
import flash.text.*;
import src.SimpleBtn.MenuButtons.*;
public class UpgradePage extends Page {
public var clearSavesBtn:ClearSavesBtn;
public var instructionsBtn:InstructionsBtn;
public var upgrade1:UpgradeItem;
public var upgrade2:UpgradeItem;
public var upgrade3:UpgradeItem;
public var achievementsBtn:AchievementsBtn;
public var totalMoney_txt:TextField;
public var upgrade0:UpgradeItem;
public var startPlayBtn:StartPlayBtn;
public var sponsorBtn:SponsorBtn;
public var highScoresBtn:HighScoresBtn;
public static const UPGRADES_COUNT:Number = 4;
public function UpgradePage(){
var _local1:UpgradeItem;
var _local2:Number;
super();
this.clearSavesBtn.setPageType(ClearSavesBtn.UPGRADES_PAGE_TYPE);
this.addListObject(this.startPlayBtn);
this.addListObject(this.instructionsBtn);
this.addListObject(this.achievementsBtn);
this.addListObject(this.clearSavesBtn);
this.addListObject(this.highScoresBtn);
this.addListObject(this.sponsorBtn);
_local2 = 0;
while (_local2 < UpgradePage.UPGRADES_COUNT) {
_local1 = this[("upgrade" + _local2)];
this.addListObject(_local1);
_local1.setUpgradePage(this);
_local1.updateTexts();
_local2++;
};
this.allUpgradesCheckIsEnoughMoney();
this.totalMoney_txt.autoSize = TextFieldAutoSize.CENTER;
this.updateTotalMoneyText();
}
public function onCompleteRestartSplash(_arg1:FonWhite){
if (((!(_arg1)) || (!(_arg1.parent)))){
return;
};
_arg1.parent.removeChild(_arg1);
}
public function allUpgradesCheckIsEnoughMoney(){
var _local1:UpgradeItem;
var _local2:Number;
_local2 = 0;
while (_local2 < UpgradePage.UPGRADES_COUNT) {
_local1 = this[("upgrade" + _local2)];
_local1.checkIsEnoughMoney();
_local2++;
};
}
public function updateTotalMoneyText(){
var _local1:Number;
_local1 = Main.root.savesProgress.getMoney();
this.totalMoney_txt.text = (("Total money: " + _local1) + " $");
}
public function restartSplash(){
var _local1:FonWhite;
_local1 = new FonWhite();
_local1.mouseEnabled = false;
_local1.alpha = 0.75;
_local1.width = Main.DISPLAY_WIDTH;
_local1.height = Main.DISPLAY_HEIGHT;
this.addChild(_local1);
TweenLite.to(_local1, 0.5, {alpha:0, ease:Linear.easeIn, onComplete:this.onCompleteRestartSplash, onCompleteParams:[_local1]});
}
}
}//package src.Page.UpgradePage
Section 81
//IPageListenerObject (src.Page.IPageListenerObject)
package src.Page {
public interface IPageListenerObject {
function onPageEnd();
}
}//package src.Page
Section 82
//Page (src.Page.Page)
package src.Page {
public class Page extends PageListenerConteiner {
public function Page(){
this.mouseChildren = true;
}
public function toStart(){
}
}
}//package src.Page
Section 83
//PageListenerConteiner (src.Page.PageListenerConteiner)
package src.Page {
import src.Levels.LevelGrafObject.*;
import flash.display.*;
public class PageListenerConteiner extends Sprite {
public var listObjects_array:Array;
public var pause_array:Array;
public function PageListenerConteiner(){
listObjects_array = [];
pause_array = [];
super();
}
public function addListObject(_arg1:IPageListenerObject){
this.listObjects_array.push(_arg1);
}
public function removeListObject(_arg1:IPageListenerObject){
var _local2:Number;
var _local3:IPageListenerObject;
var _local4:Number;
_local2 = this.listObjects_array.length;
_local4 = 0;
while (_local4 < _local2) {
_local3 = this.listObjects_array[_local4];
if (_local3 == _arg1){
this.listObjects_array.splice(_local4, 1);
break;
};
_local4++;
};
}
public function toEnd(){
this.listObjectsOnPageEnd();
}
public function addPauseObject(_arg1:LevelGrafObject){
this.pause_array[this.pause_array.length] = _arg1;
}
private function createEmptyPauseArray(){
this.pause_array = [];
}
public function removePauseObject(_arg1:LevelGrafObject){
var _local2:Number;
var _local3:LevelGrafObject;
var _local4:Number;
_local2 = this.pause_array.length;
_local4 = 0;
while (_local4 < _local2) {
_local3 = this.pause_array[_local4];
if (_local3 == _arg1){
this.pause_array.splice(_local4, 1);
break;
};
_local4++;
};
}
public function getListArray():Array{
return (this.listObjects_array);
}
public function createNewList(){
this.listObjects_array.length = 0;
}
public function listObjectsOnPageEnd(){
var _local1:Number;
var _local2:IPageListenerObject;
var _local3:Number;
_local1 = this.listObjects_array.length;
_local3 = 0;
while (_local3 < _local1) {
_local2 = this.listObjects_array[_local3];
if (_local2){
_local2.onPageEnd();
};
_local3++;
};
}
}
}//package src.Page
Section 84
//SavesProgress (src.SavesProgress.SavesProgress)
package src.SavesProgress {
import src.Page.UpgradePage.*;
import flash.net.*;
import src.Page.AchievPage.*;
public class SavesProgress {
private var saves:SharedObject;
public function SavesProgress(){
this.createSaves();
}
public function setCurrentMissionNum(_arg1:Number){
this.saves.data.currentMissionNum = _arg1;
this.flushSaveData();
return (this.saves.data.currentMissionNum);
}
public function setIsSoundOn(_arg1:Boolean){
this.saves.data.isSoundOn = _arg1;
this.flushSaveData();
}
public function setBalloonUpPower(_arg1:Number):Number{
this.saves.data.balloonUpPower = _arg1;
this.flushSaveData();
return (this.saves.data.balloonUpPower);
}
public function setMoney(_arg1:Number):Number{
this.saves.data.money = _arg1;
return (this.saves.data.money);
}
public function setIsAchieved(_arg1:Object, _arg2:Boolean){
_arg1.isAchieved = _arg2;
this.flushSaveData();
}
public function setBalloonsCount(_arg1:Number){
this.saves.data.balloonsCount = _arg1;
return (this.saves.data.balloonsCount);
}
public function getMoney():Number{
return (this.saves.data.money);
}
public function getAllCollectedCoins():Number{
return (this.saves.data.allCollectedCoins);
}
public function createUpgradeInformation(){
var _local1:Number;
this.saves.data.upgrade_array = [];
_local1 = 0;
while (_local1 < UpgradePage.UPGRADES_COUNT) {
this.saves.data.upgrade_array[_local1] = {curUpgradeNum:1};
_local1++;
};
}
public function getBalloonDefense():Number{
return (this.saves.data.balloonDefense);
}
public function setPausedMissionInfo(_arg1:Number, _arg2:Number){
this.saves.data.pausedMissionInfo = {missionType:_arg1, missionCollect:_arg2};
this.flushSaveData();
}
public function setBalloonDefense(_arg1:Number):Number{
this.saves.data.balloonDefense = _arg1;
this.flushSaveData();
return (this.saves.data.balloonDefense);
}
public function plusCoinPerBomb(_arg1:Number):Number{
this.saves.data.coinPerBomb = (this.saves.data.coinPerBomb + _arg1);
this.flushSaveData();
return (this.saves.data.coinPerBomb);
}
public function plusAllBlowUpBombs(_arg1:Number){
this.saves.data.allBlowUpBombs = (this.saves.data.allBlowUpBombs + _arg1);
return (this.saves.data.allBlowUpBombs);
}
public function getBalloonsCount():Number{
return (this.saves.data.balloonsCount);
}
public function getPausedMissionInfo():Object{
return (this.saves.data.pausedMissionInfo);
}
public function getBestHeight():Number{
return (this.saves.data.bestHeight);
}
public function plusAllCollectedBalloons(_arg1:Number){
this.saves.data.allCollectedBalloons = (this.saves.data.allCollectedBalloons + _arg1);
return (this.saves.data.allCollectedBalloons);
}
public function plusMoneyPerCoin(_arg1:Number):Number{
this.saves.data.moneyPerCoin = (this.saves.data.moneyPerCoin + _arg1);
this.flushSaveData();
return (this.saves.data.moneyPerCoin);
}
public function getFonY():Number{
return (this.saves.data.fonY);
}
public function setBestHeight(_arg1:Number){
this.saves.data.bestHeight = _arg1;
return (this.saves.data.bestHeight);
}
public function plusCurUpgradeNum(_arg1:Object, _arg2:Number):Number{
_arg1.curUpgradeNum = (_arg1.curUpgradeNum + _arg2);
this.flushSaveData();
return (_arg1.curUpgradeNum);
}
public function clearSaveData(){
this.saves.clear();
this.flushSaveData();
}
public function plusBalloonUpPower(_arg1:Number):Number{
this.saves.data.balloonUpPower = (this.saves.data.balloonUpPower + _arg1);
this.flushSaveData();
return (this.saves.data.balloonUpPower);
}
public function setFonY(_arg1:Number){
this.saves.data.fonY = _arg1;
return (this.saves.data.fonY);
}
public function plusCurrentMissionNum(_arg1:Number){
this.saves.data.currentMissionNum = (this.saves.data.currentMissionNum + _arg1);
this.flushSaveData();
return (this.saves.data.currentMissionNum);
}
public function getIsSoundOn():Boolean{
return (this.saves.data.isSoundOn);
}
public function plusAllCollectedCoins(_arg1:Number){
this.saves.data.allCollectedCoins = (this.saves.data.allCollectedCoins + _arg1);
return (this.saves.data.allCollectedCoins);
}
public function getAchievedObjByNum(_arg1:Number):Object{
return (this.saves.data.achiev_array[_arg1]);
}
public function clearPauseInformation(){
this.saves.data.pauseInfo_array = [];
this.flushSaveData();
}
public function setAllBlowUpBombs(_arg1:Number){
this.saves.data.allBlowUpBombs = _arg1;
return (this.saves.data.allBlowUpBombs);
}
public function plusMoney(_arg1:Number){
this.saves.data.money = (this.saves.data.money + _arg1);
return (this.saves.data.money);
}
public function getAllBlowUpBombs():Number{
return (this.saves.data.allBlowUpBombs);
}
public function plusBalloonDefense(_arg1:Number):Number{
this.saves.data.balloonDefense = (this.saves.data.balloonDefense + _arg1);
this.flushSaveData();
return (this.saves.data.balloonDefense);
}
public function getPauseInformation():Array{
return (this.saves.data.pauseInfo_array);
}
public function plusBalloonsCount(_arg1:Number){
this.saves.data.balloonsCount = (this.saves.data.balloonsCount + _arg1);
return (this.saves.data.balloonsCount);
}
private function createSavesInformation(){
this.saves.data.money = 0;
this.saves.data.balloonsCount = 0;
this.saves.data.fonY = -9000;
this.saves.data.balloonDefense = 1;
this.saves.data.balloonUpPower = 1;
this.saves.data.moneyPerCoin = 5;
this.saves.data.coinPerBomb = 1;
this.saves.data.bestHeight = 0;
this.saves.data.currentMissionNum = 1;
this.saves.data.isSoundOn = true;
this.saves.data.isCreate = true;
this.createAchievInformation();
this.createUpgradeInformation();
this.clearPauseInformation();
this.clearPausedMissionInfo();
this.saves.data.allCollectedBalloons = 0;
this.saves.data.allCollectedCoins = 0;
this.saves.data.allBlowUpBombs = 0;
this.flushSaveData();
}
public function setCoinPerBomb(_arg1:Number):Number{
this.saves.data.coinPerBomb = _arg1;
this.flushSaveData();
return (this.saves.data.coinPerBomb);
}
public function getCoinPerBomb():Number{
return (this.saves.data.coinPerBomb);
}
public function createAchievInformation(){
var _local1:Number;
this.saves.data.achiev_array = [];
_local1 = 0;
while (_local1 < AchievPage.ACHIEV_COUNT) {
this.saves.data.achiev_array[_local1] = {isAchieved:false};
_local1++;
};
}
public function getAllCollectedBalloons():Number{
return (this.saves.data.allCollectedBalloons);
}
public function getMoneyPerCoin():Number{
return (this.saves.data.moneyPerCoin);
}
public function plusBestHeight(_arg1:Number){
this.saves.data.bestHeight = (this.saves.data.bestHeight + _arg1);
return (this.saves.data.bestHeight);
}
public function setCurUpgradeNum(_arg1:Object, _arg2:Number):Number{
_arg1.curUpgradeNum = _arg2;
this.flushSaveData();
return (_arg1.curUpgradeNum);
}
private function flushSaveData(){
try {
this.saves.flush();
} catch(e:Error) {
};
}
public function setAllCollectedBalloons(_arg1:Number){
this.saves.data.allCollectedBalloons = _arg1;
return (this.saves.data.allCollectedBalloons);
}
public function setMoneyPerCoin(_arg1:Number):Number{
this.saves.data.moneyPerCoin = _arg1;
this.flushSaveData();
return (this.saves.data.moneyPerCoin);
}
public function getBalloonUpPower():Number{
return (this.saves.data.balloonUpPower);
}
public function createPauseInformation(_arg1:Array){
this.saves.data.pauseInfo_array = _arg1;
this.flushSaveData();
}
public function getIsAchieved(_arg1:Object):Object{
return (_arg1.isAchieved);
}
public function getCurUpgradeNum(_arg1:Object):Number{
return (_arg1.curUpgradeNum);
}
public function plusFonY(_arg1:Number){
this.saves.data.fonY = (this.saves.data.fonY + _arg1);
return (this.saves.data.fonY);
}
public function setAllCollectedCoins(_arg1:Number){
this.saves.data.allCollectedCoins = _arg1;
return (this.saves.data.allCollectedCoins);
}
public function createSaves(){
this.saves = SharedObject.getLocal("up_beta_110");
if (this.saves.data.isCreate != true){
this.createSavesInformation();
};
}
public function getCurrentMissionNum():Number{
return (this.saves.data.currentMissionNum);
}
public function getUpgradeObjByNum(_arg1:Number):Object{
return (this.saves.data.upgrade_array[_arg1]);
}
public function clearPausedMissionInfo(){
this.saves.data.pausedMissionInfo = {missionType:null, missionCollect:null};
this.flushSaveData();
}
}
}//package src.SavesProgress
Section 85
//AchievementsBtn (src.SimpleBtn.MenuButtons.AchievementsBtn)
package src.SimpleBtn.MenuButtons {
import flash.events.*;
import src.*;
import src.SoundTools.*;
import src.SimpleBtn.*;
public class AchievementsBtn extends SimpleBtn {
override public function onOver(_arg1:MouseEvent){
Main.root.soundTools.playSoundByNumber(SoundTools.MENU_SOUND);
super.onOver(_arg1);
}
override public function onClick(_arg1:MouseEvent){
Main.root.addAchievPage();
super.onClick(_arg1);
}
}
}//package src.SimpleBtn.MenuButtons
Section 86
//ClearSavesBtn (src.SimpleBtn.MenuButtons.ClearSavesBtn)
package src.SimpleBtn.MenuButtons {
import flash.events.*;
import src.*;
import src.SoundTools.*;
import src.SimpleBtn.*;
public class ClearSavesBtn extends SimpleBtn {
private var pageType:Number;
public static const UPGRADES_PAGE_TYPE:Number = 3;
public static const ACHIEVEMENTS_PAGE_TYPE:Number = 4;
public static const INSTRCUTIONS_PAGE_TYPE:Number = 2;
public static const PLAY_PAGE_TYPE:Number = 1;
override public function onOver(_arg1:MouseEvent){
Main.root.soundTools.playSoundByNumber(SoundTools.MENU_SOUND);
super.onOver(_arg1);
}
override public function onClick(_arg1:MouseEvent){
Main.root.resetSaves();
Main.root.soundTools.playSoundByNumber(SoundTools.CLEAR_SAVES_SOUND);
if (this.pageType == ClearSavesBtn.PLAY_PAGE_TYPE){
Main.root.addPlayPage();
} else {
if (this.pageType == ClearSavesBtn.INSTRCUTIONS_PAGE_TYPE){
Main.root.addInstructionsPage();
} else {
if (this.pageType == ClearSavesBtn.UPGRADES_PAGE_TYPE){
Main.root.addUpgradePage();
} else {
if (this.pageType == ClearSavesBtn.ACHIEVEMENTS_PAGE_TYPE){
Main.root.addAchievPage();
};
};
};
};
super.onClick(_arg1);
}
public function setPageType(_arg1:Number){
this.pageType = _arg1;
}
}
}//package src.SimpleBtn.MenuButtons
Section 87
//HighScoresBtn (src.SimpleBtn.MenuButtons.HighScoresBtn)
package src.SimpleBtn.MenuButtons {
import flash.events.*;
import src.*;
import src.SoundTools.*;
import src.SimpleBtn.*;
public class HighScoresBtn extends SimpleBtn {
public function setAddToStageListener(){
this.addEventListener(Event.ADDED_TO_STAGE, this.onAddToStage);
}
override public function onOver(_arg1:MouseEvent){
Main.root.soundTools.playSoundByNumber(SoundTools.MENU_SOUND);
super.onOver(_arg1);
}
public function checkIsErrorToMochi(){
if (Main.root.isConnectToMochiError){
this.toEnabledOff();
};
}
public function onAddToStage(_arg1:Event){
this.checkIsErrorToMochi();
}
public function removeAddToStageListener(){
this.removeEventListener(Event.ADDED_TO_STAGE, this.onAddToStage);
}
override public function onClick(_arg1:MouseEvent){
Main.root.createLeaderboard();
super.onClick(_arg1);
}
}
}//package src.SimpleBtn.MenuButtons
Section 88
//InstructionsBtn (src.SimpleBtn.MenuButtons.InstructionsBtn)
package src.SimpleBtn.MenuButtons {
import flash.events.*;
import src.*;
import src.SoundTools.*;
import src.SimpleBtn.*;
public class InstructionsBtn extends SimpleBtn {
override public function onOver(_arg1:MouseEvent){
Main.root.soundTools.playSoundByNumber(SoundTools.MENU_SOUND);
super.onOver(_arg1);
}
override public function onClick(_arg1:MouseEvent){
Main.root.addInstructionsPage();
super.onClick(_arg1);
}
}
}//package src.SimpleBtn.MenuButtons
Section 89
//MoreGamesBtn (src.SimpleBtn.MenuButtons.MoreGamesBtn)
package src.SimpleBtn.MenuButtons {
import src.SimpleBtn.*;
public class MoreGamesBtn extends SimpleBtn {
}
}//package src.SimpleBtn.MenuButtons
Section 90
//SponsorBtn (src.SimpleBtn.MenuButtons.SponsorBtn)
package src.SimpleBtn.MenuButtons {
import flash.events.*;
import src.*;
import src.SoundTools.*;
import src.SimpleBtn.*;
public class SponsorBtn extends SimpleBtn {
override public function onOver(_arg1:MouseEvent){
Main.root.soundTools.playSoundByNumber(SoundTools.MENU_SOUND);
super.onOver(_arg1);
}
override public function onClick(_arg1:MouseEvent){
Main.root.gotoSponsorLogoLink();
super.onClick(_arg1);
}
}
}//package src.SimpleBtn.MenuButtons
Section 91
//StartPlayBtn (src.SimpleBtn.MenuButtons.StartPlayBtn)
package src.SimpleBtn.MenuButtons {
import flash.events.*;
import src.*;
import src.SoundTools.*;
import src.SimpleBtn.*;
public class StartPlayBtn extends SimpleBtn {
override public function onOver(_arg1:MouseEvent){
Main.root.soundTools.playSoundByNumber(SoundTools.MENU_SOUND);
super.onOver(_arg1);
}
override public function onClick(_arg1:MouseEvent){
Main.root.addPlayPage();
super.onClick(_arg1);
}
}
}//package src.SimpleBtn.MenuButtons
Section 92
//UpgradesBtn (src.SimpleBtn.MenuButtons.UpgradesBtn)
package src.SimpleBtn.MenuButtons {
import flash.events.*;
import src.*;
import src.SoundTools.*;
import src.SimpleBtn.*;
public class UpgradesBtn extends SimpleBtn {
override public function onOver(_arg1:MouseEvent){
Main.root.soundTools.playSoundByNumber(SoundTools.MENU_SOUND);
super.onOver(_arg1);
}
override public function onClick(_arg1:MouseEvent){
Main.root.addUpgradePage();
super.onClick(_arg1);
}
}
}//package src.SimpleBtn.MenuButtons
Section 93
//SimpleBtn (src.SimpleBtn.SimpleBtn)
package src.SimpleBtn {
import gs.*;
import flash.events.*;
import flash.display.*;
import src.Page.*;
import src.*;
import flash.ui.*;
public class SimpleBtn extends Sprite implements IPageListenerObject {
public var over_mc:Sprite;
public function SimpleBtn(){
this.toStart();
this.setAddedToStageListener();
}
public function toOverOff(){
TweenLite.to(this.over_mc, 0.2, {alpha:0, overwrite:2});
}
public function removeListeners(){
this.removeEventListener(MouseEvent.CLICK, this.onClick);
this.removeEventListener(MouseEvent.ROLL_OVER, this.onOver);
this.removeEventListener(MouseEvent.ROLL_OUT, this.onOut);
this.removeOnKeyDownListener();
this.removeAddedToStageListener();
}
public function changeAlphaToNum(_arg1:Number, _arg2:Number=0.2){
TweenLite.to(this, _arg2, {alpha:_arg1});
}
public function toOverOn(){
TweenLite.to(this.over_mc, 0.1, {alpha:1, overwrite:2});
}
public function toEnabledOff(){
this.toOverOff();
TweenLite.to(this, 0.2, {alpha:0.25});
this.removeListeners();
this.buttonMode = false;
this.useHandCursor = false;
}
public function setOnKeyDownListener(){
Main.stage.addEventListener(KeyboardEvent.KEY_DOWN, this.onKeyDown);
}
public function onOver(_arg1:MouseEvent){
this.toOverOn();
}
public function removeOnKeyDownListener(){
Main.stage.removeEventListener(KeyboardEvent.KEY_DOWN, this.onKeyDown);
}
private function setAddedToStageListener(){
this.addEventListener(Event.ADDED_TO_STAGE, this.onAddedToStage);
}
public function toStart(){
this.over_mc.alpha = 0;
this.buttonMode = true;
this.useHandCursor = true;
}
private function onAddedToStage(_arg1:Event){
this.setListeners();
this.removeAddedToStageListener();
}
private function removeAddedToStageListener(){
this.removeEventListener(Event.ADDED_TO_STAGE, this.onAddedToStage);
}
public function toEnabledOn(){
TweenLite.to(this, 0.2, {alpha:1});
this.setListeners();
this.buttonMode = true;
this.useHandCursor = true;
}
public function onKeyDown(_arg1:KeyboardEvent){
if ((((_arg1.keyCode == Keyboard.SPACE)) || ((_arg1.keyCode == Keyboard.ENTER)))){
this.onClick(new MouseEvent(MouseEvent.CLICK));
};
}
public function toEnableByFlag(_arg1:Boolean){
if (_arg1){
this.toEnabledOn();
} else {
this.toEnabledOff();
};
}
public function onClick(_arg1:MouseEvent){
}
public function onPageEnd(){
this.removeListeners();
}
public function onOut(_arg1:MouseEvent){
this.toOverOff();
}
public function setListeners(){
this.addEventListener(MouseEvent.CLICK, this.onClick);
this.addEventListener(MouseEvent.ROLL_OVER, this.onOver);
this.addEventListener(MouseEvent.ROLL_OUT, this.onOut);
}
}
}//package src.SimpleBtn
Section 94
//Balloon1Sound (src.SoundTools.Balloon1Sound)
package src.SoundTools {
import flash.media.*;
public class Balloon1Sound extends Sound {
}
}//package src.SoundTools
Section 95
//Balloon2Sound (src.SoundTools.Balloon2Sound)
package src.SoundTools {
import flash.media.*;
public class Balloon2Sound extends Sound {
}
}//package src.SoundTools
Section 96
//Balloon3Sound (src.SoundTools.Balloon3Sound)
package src.SoundTools {
import flash.media.*;
public class Balloon3Sound extends Sound {
}
}//package src.SoundTools
Section 97
//Bomb1Sound (src.SoundTools.Bomb1Sound)
package src.SoundTools {
import flash.media.*;
public class Bomb1Sound extends Sound {
}
}//package src.SoundTools
Section 98
//Bomb2Sound (src.SoundTools.Bomb2Sound)
package src.SoundTools {
import flash.media.*;
public class Bomb2Sound extends Sound {
}
}//package src.SoundTools
Section 99
//Bomb3Sound (src.SoundTools.Bomb3Sound)
package src.SoundTools {
import flash.media.*;
public class Bomb3Sound extends Sound {
}
}//package src.SoundTools
Section 100
//ClearSavesSound (src.SoundTools.ClearSavesSound)
package src.SoundTools {
import flash.media.*;
public class ClearSavesSound extends Sound {
}
}//package src.SoundTools
Section 101
//Coin1Sound (src.SoundTools.Coin1Sound)
package src.SoundTools {
import flash.media.*;
public class Coin1Sound extends Sound {
}
}//package src.SoundTools
Section 102
//Coin2Sound (src.SoundTools.Coin2Sound)
package src.SoundTools {
import flash.media.*;
public class Coin2Sound extends Sound {
}
}//package src.SoundTools
Section 103
//Coin3Sound (src.SoundTools.Coin3Sound)
package src.SoundTools {
import flash.media.*;
public class Coin3Sound extends Sound {
}
}//package src.SoundTools
Section 104
//MainSound (src.SoundTools.MainSound)
package src.SoundTools {
import flash.media.*;
public class MainSound extends Sound {
}
}//package src.SoundTools
Section 105
//Menu1Sound (src.SoundTools.Menu1Sound)
package src.SoundTools {
import flash.media.*;
public class Menu1Sound extends Sound {
}
}//package src.SoundTools
Section 106
//Menu2Sound (src.SoundTools.Menu2Sound)
package src.SoundTools {
import flash.media.*;
public class Menu2Sound extends Sound {
}
}//package src.SoundTools
Section 107
//Menu3Sound (src.SoundTools.Menu3Sound)
package src.SoundTools {
import flash.media.*;
public class Menu3Sound extends Sound {
}
}//package src.SoundTools
Section 108
//MissionCompleteSound (src.SoundTools.MissionCompleteSound)
package src.SoundTools {
import flash.media.*;
public class MissionCompleteSound extends Sound {
}
}//package src.SoundTools
Section 109
//SoundTools (src.SoundTools.SoundTools)
package src.SoundTools {
import src.*;
import flash.media.*;
public class SoundTools {
public var bomb1Sound:Bomb1Sound;
public var isSoundOn:Boolean;
public var bomb3Sound:Bomb3Sound;
public var clearSavesSound:ClearSavesSound;
public var surpriseCoinsSound:SurpriseCoinsSound;
public var balloon3Sound:Balloon3Sound;
public var balloon1Sound:Balloon1Sound;
public var coin2Sound:Coin2Sound;
public var mainSound:MainSound;
public var bomb2Sound:Bomb2Sound;
public var menu2Sound:Menu2Sound;
public var surpriseBombsSound:SurpriseBombsSound;
public var upgradeErrorSound:UpgradeErrorSound;
public var coin3Sound:Coin3Sound;
public var coin1Sound:Coin1Sound;
public var missionCompleteSound:MissionCompleteSound;
public var balloon2Sound:Balloon2Sound;
public var menu3Sound:Menu3Sound;
public var menu1Sound:Menu1Sound;
public static const COIN_SOUND:Number = 1;
public static const MISSION_COMPLETE_SOUND:Number = 9;
public static const SURPRISE_BOMBS_SOUND:Number = 7;
public static const MENU_SOUND:Number = 4;
public static const MAIN_SOUND:Number = 0;
public static const CLEAR_SAVES_SOUND:Number = 5;
public static const UPGRADE_ERROR_SOUND:Number = 8;
public static const BOMB_SOUND:Number = 3;
public static const SURPRISE_COINS_SOUND:Number = 6;
public static const BALLOON_SOUND:Number = 2;
public function SoundTools(_arg1:Boolean){
this.isSoundOn = _arg1;
this.mainSound = new MainSound();
this.coin1Sound = new Coin1Sound();
this.coin2Sound = new Coin2Sound();
this.coin3Sound = new Coin3Sound();
this.balloon1Sound = new Balloon1Sound();
this.balloon2Sound = new Balloon2Sound();
this.balloon3Sound = new Balloon3Sound();
this.bomb1Sound = new Bomb1Sound();
this.bomb2Sound = new Bomb2Sound();
this.bomb3Sound = new Bomb3Sound();
this.menu1Sound = new Menu1Sound();
this.menu2Sound = new Menu2Sound();
this.menu3Sound = new Menu3Sound();
this.clearSavesSound = new ClearSavesSound();
this.surpriseCoinsSound = new SurpriseCoinsSound();
this.surpriseBombsSound = new SurpriseBombsSound();
this.upgradeErrorSound = new UpgradeErrorSound();
this.missionCompleteSound = new MissionCompleteSound();
this.stopOrPlaySounds();
}
public function stopOrPlaySounds(){
SoundMixer.stopAll();
if (this.isSoundOn){
this.mainSound.play(0, int.MAX_VALUE);
};
}
public function playSoundByNumber(_arg1:Number){
var _local2:Number;
if (!this.isSoundOn){
return;
};
if (_arg1 == SoundTools.COIN_SOUND){
_local2 = Math.random();
if (_local2 < 0.33){
this.coin1Sound.play();
} else {
if (_local2 < 0.66){
this.coin2Sound.play();
} else {
this.coin3Sound.play();
};
};
} else {
if (_arg1 == SoundTools.BALLOON_SOUND){
_local2 = Math.random();
if (_local2 < 0.33){
this.balloon1Sound.play();
} else {
if (_local2 < 0.66){
this.balloon2Sound.play();
} else {
this.balloon3Sound.play();
};
};
} else {
if (_arg1 == SoundTools.BOMB_SOUND){
_local2 = Math.random();
if (_local2 < 0.33){
this.bomb1Sound.play();
} else {
if (_local2 < 0.66){
this.bomb2Sound.play();
} else {
this.bomb3Sound.play();
};
};
} else {
if (_arg1 == SoundTools.MENU_SOUND){
_local2 = Math.random();
if (_local2 < 0.33){
this.menu1Sound.play();
} else {
if (_local2 < 0.66){
this.menu2Sound.play();
} else {
this.menu3Sound.play();
};
};
} else {
if (_arg1 == SoundTools.CLEAR_SAVES_SOUND){
this.clearSavesSound.play();
} else {
if (_arg1 == SoundTools.SURPRISE_COINS_SOUND){
this.surpriseCoinsSound.play();
} else {
if (_arg1 == SoundTools.SURPRISE_BOMBS_SOUND){
this.surpriseBombsSound.play();
} else {
if (_arg1 == SoundTools.UPGRADE_ERROR_SOUND){
this.upgradeErrorSound.play();
} else {
if (_arg1 == SoundTools.MISSION_COMPLETE_SOUND){
this.missionCompleteSound.play();
};
};
};
};
};
};
};
};
};
}
public function changeIsSounOn(){
this.isSoundOn = !(this.isSoundOn);
Main.root.savesProgress.setIsSoundOn(this.isSoundOn);
this.stopOrPlaySounds();
}
}
}//package src.SoundTools
Section 110
//SurpriseBombsSound (src.SoundTools.SurpriseBombsSound)
package src.SoundTools {
import flash.media.*;
public class SurpriseBombsSound extends Sound {
}
}//package src.SoundTools
Section 111
//SurpriseCoinsSound (src.SoundTools.SurpriseCoinsSound)
package src.SoundTools {
import flash.media.*;
public class SurpriseCoinsSound extends Sound {
}
}//package src.SoundTools
Section 112
//UpgradeErrorSound (src.SoundTools.UpgradeErrorSound)
package src.SoundTools {
import flash.media.*;
public class UpgradeErrorSound extends Sound {
}
}//package src.SoundTools
Section 113
//FonWhite (src.FonWhite)
package src {
import flash.display.*;
public class FonWhite extends Sprite {
}
}//package src
Section 114
//Main (src.Main)
package src {
import gs.*;
import flash.events.*;
import flash.display.*;
import src.Page.PlayPage.*;
import src.Page.UpgradePage.*;
import src.Page.*;
import src.MochiBot.*;
import src.SavesProgress.*;
import flash.net.*;
import src.SoundTools.*;
import gs.easing.*;
import mochi.as3.*;
import flash.utils.*;
import flash.text.*;
import src.Page.AchievPage.*;
import src.Page.InstructionsPage.*;
public dynamic class Main extends MovieClip {
public var savesProgress:SavesProgress;
public var soundTools:SoundTools;
public var embed_txt:TextField;
private var checkURLTimer:Timer;
public var _mochiads_game_id:String;// = "b8f51583f0c284e6"
public var pagesCont_mc:Sprite;
public var preGameAdOptions:Object;
public var currentPage:Page;
public var isConnectToMochiError:Boolean;// = false
public var fon:Sprite;
public static const SPONSOR_LOGO_URL:String = "http://jayisgames.com/?ref=higher-sp";
public static const SPONSOR_MORE_URL:String = "http://jayisgames.com/?ref=higher-more";
public static const DISPLAY_HEIGHT:Number = 600;
public static const DISPLAY_WIDTH:Number = 600;
public static const CREDITS_URL:String = "http://www.arcadebra.com";
public static const SITE_LOCK_URL:String = "http://jayisgames.com/games/higher";
public static const GRID_SIZE:Number = 50;
public static var root:Main;
public static var stage:Stage;
public function Main(){
_mochiads_game_id = "b8f51583f0c284e6";
isConnectToMochiError = false;
super();
addFrameScript(0, frame1, 2, frame3, 49, frame50);
}
public function onCompleteRestartSplash(_arg1:FonWhite){
if (((!(_arg1)) || (!(_arg1.parent)))){
return;
};
_arg1.parent.removeChild(_arg1);
}
public function startCheckURL(){
this.checkURLTimer = new Timer(1000, 1);
this.checkURLTimer.addEventListener(TimerEvent.TIMER, this.onCheckURL);
this.checkURLTimer.start();
}
public function gotoJayIsGamesSiteLock(){
var _local1:URLRequest;
_local1 = new URLRequest(Main.SITE_LOCK_URL);
navigateToURL(_local1, "_blank");
}
public function setAddToStageListener(){
this.addEventListener(Event.ADDED_TO_STAGE, this.onAddToStage);
}
function frame3(){
this.connectToMochi();
}
public function gotoCreditsLink(){
var _local1:URLRequest;
_local1 = new URLRequest(Main.CREDITS_URL);
navigateToURL(_local1, "_blank");
}
public function addUpgradePage(){
var _local1:UpgradePage;
_local1 = new UpgradePage();
this.addPage(_local1);
}
function frame1(){
stop();
preGameAdOptions = {id:"b8f51583f0c284e6", res:"600x600", clip:root, color:5158130, background:0xFFFFFF, outline:0xFFFFFF, no_bg:true};
MochiAd.showPreGameAd(preGameAdOptions);
}
public function stopCheckURL(){
this.checkURLTimer.stop();
}
public function restartSplash(){
var _local1:FonWhite;
_local1 = new FonWhite();
_local1.mouseEnabled = false;
_local1.alpha = 0.75;
_local1.width = Main.DISPLAY_WIDTH;
_local1.height = Main.DISPLAY_HEIGHT;
this.addChild(_local1);
TweenLite.to(_local1, 0.5, {alpha:0, ease:Linear.easeIn, onComplete:this.onCompleteRestartSplash, onCompleteParams:[_local1]});
}
public function removeCurrentPage(){
if ((((this.currentPage == null)) || ((this.currentPage.parent == null)))){
return;
};
this.currentPage.toEnd();
this.pagesCont_mc.removeChild(this.currentPage);
}
public function resetSaves(){
this.savesProgress.clearSaveData();
this.savesProgress.createSaves();
}
public function addInstructionsPage(){
var _local1:InstructionsPage;
_local1 = new InstructionsPage();
this.addPage(_local1);
}
public function startInit(){
this.removeAddToStageListener();
Main.stage = this.stage;
Main.root = this;
Main.stage.tabChildren = false;
Main.root.tabEnabled = false;
Main.root.tabChildren = false;
Main.stage.scaleMode = StageScaleMode.NO_SCALE;
Main.stage.quality = StageQuality.BEST;
Main.stage.align = StageAlign.TOP_LEFT;
MochiBot.track(this, "d3293f85");
this.fon.visible = false;
this.savesProgress = new SavesProgress();
if (!this.soundTools){
this.soundTools = new SoundTools(this.savesProgress.getIsSoundOn());
};
this.pagesCont_mc = new Sprite();
this.addChild(pagesCont_mc);
this.addPlayPage();
}
public function gotoSponsorMoreLink(){
var _local1:URLRequest;
_local1 = new URLRequest(Main.SPONSOR_MORE_URL);
navigateToURL(_local1, "_blank");
}
public function onSiteLockMessageClick(_arg1:MouseEvent){
this.gotoJayIsGamesSiteLock();
}
public function onAddToStage(_arg1:Event){
this.startInit();
}
public function onCheckURL(_arg1:Event){
var _local2:Number;
var _local3:SiteLockMessage;
_local2 = Main.root.loaderInfo.url.indexOf("jayisgames.com");
if (_local2 < 0){
_local2 = Main.root.loaderInfo.url.indexOf("casualgameplay.com");
};
if (_local2 < 0){
_local2 = Main.root.loaderInfo.url.indexOf("fizzlebot.com");
};
if (_local2 < 0){
Main.root.x = 50000;
Main.root.y = 40000;
_local3 = new SiteLockMessage();
this.addChild(_local3);
_local3.buttonMode = true;
_local3.x = -(Main.root.x);
_local3.y = -(Main.root.y);
_local3.addEventListener(MouseEvent.CLICK, this.onSiteLockMessageClick);
};
}
public function addPlayPage(){
var _local1:PlayPage;
_local1 = new PlayPage();
this.addPage(_local1);
}
public function connectToMochi(){
MochiServices.connect("b8f51583f0c284e6", root);
}
public function gotoSponsorLogoLink(){
var _local1:URLRequest;
_local1 = new URLRequest(Main.SPONSOR_LOGO_URL);
navigateToURL(_local1, "_blank");
}
public function onConnectError(_arg1:String):void{
this.isConnectToMochiError = true;
this.connectToMochi();
}
function frame50(){
this.stop();
this.startInit();
}
public function addPage(_arg1:Page){
this.restartSplash();
this.removeCurrentPage();
this.pagesCont_mc.addChild(_arg1);
_arg1.toStart();
this.currentPage = _arg1;
}
public function addAchievPage(){
var _local1:AchievPage;
_local1 = new AchievPage();
this.addPage(_local1);
}
public function removeAddToStageListener(){
this.removeEventListener(Event.ADDED_TO_STAGE, this.onAddToStage);
}
public function createLeaderboard(){
var totalScore:int;
var o:Object;
var boardID:String;
this.fon.visible = true;
this.removeCurrentPage();
this.restartSplash();
totalScore = this.savesProgress.getBestHeight();
o = {n:[14, 3, 9, 7, 12, 4, 15, 0, 14, 10, 13, 8, 10, 13, 8, 0], 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:totalScore});
}
}
}//package src
Section 115
//SiteLockMessage (src.SiteLockMessage)
package src {
import flash.display.*;
public class SiteLockMessage extends Sprite {
}
}//package src