Section 1
//Strong (fl.transitions.easing.Strong)
package fl.transitions.easing {
public class Strong {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package fl.transitions.easing
Section 2
//Fade (fl.transitions.Fade)
package fl.transitions {
import flash.display.*;
public class Fade extends Transition {
protected var _alphaFinal:Number;
public function Fade(_arg1:MovieClip, _arg2:Object, _arg3:TransitionManager){
super(_arg1, _arg2, _arg3);
this._alphaFinal = this.manager.contentAppearance.alpha;
}
override protected function _render(_arg1:Number):void{
this._content.alpha = (this._alphaFinal * _arg1);
}
override public function get type():Class{
return (Fade);
}
}
}//package fl.transitions
Section 3
//Transition (fl.transitions.Transition)
package fl.transitions {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Transition extends EventDispatcher {
protected var _progress:Number;
public var ID:int;
protected var _twn:Tween;
protected var _direction:uint;// = 0
protected var _content:MovieClip;
protected var _height:Number;// = NAN
protected var _width:Number;// = NAN
protected var _outerBounds:Rectangle;
protected var _easing:Function;
protected var _innerBounds:Rectangle;
protected var _manager:TransitionManager;
protected var _duration:Number;// = 2
public static const IN:uint = 0;
public static const OUT:uint = 1;
public function Transition(_arg1:MovieClip, _arg2:Object, _arg3:TransitionManager){
_direction = 0;
_duration = 2;
_width = NaN;
_height = NaN;
super();
this.content = _arg1;
this.direction = _arg2.direction;
this.duration = _arg2.duration;
this.easing = _arg2.easing;
this.manager = _arg3;
this._innerBounds = this.manager._innerBounds;
this._outerBounds = this.manager._outerBounds;
this._width = this.manager._width;
this._height = this.manager._height;
this._resetTween();
}
public function stop():void{
this._twn.fforward();
this._twn.stop();
}
private function _resetTween():void{
if (this._twn){
this._twn.stop();
this._twn.removeEventListener(TweenEvent.MOTION_FINISH, this.onMotionFinished);
};
this._twn = new Tween(this, "", this.easing, 0, 1, this.duration, true);
this._twn.stop();
this._twn.prop = "progress";
this._twn.addEventListener(TweenEvent.MOTION_FINISH, this.onMotionFinished, false, 0, true);
}
public function onMotionFinished(_arg1:Object):void{
if (this.direction == Transition.OUT){
this.dispatchEvent(new Event("transitionOutDone"));
} else {
this.dispatchEvent(new Event("transitionInDone"));
};
}
public function get duration():Number{
return (this._duration);
}
public function set duration(_arg1:Number):void{
if (_arg1){
this._duration = _arg1;
if (this._twn){
this._twn.duration = _arg1;
};
};
}
public function get easing():Function{
return (this._easing);
}
public function get progress():Number{
return (this._progress);
}
public function get manager():TransitionManager{
return (this._manager);
}
protected function _render(_arg1:Number):void{
}
public function get type():Class{
return (Transition);
}
public function drawCircle(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Number):void{
_arg1.graphics.moveTo((_arg2 + _arg4), _arg3);
_arg1.graphics.curveTo((_arg4 + _arg2), ((Math.tan((Math.PI / 8)) * _arg4) + _arg3), ((Math.sin((Math.PI / 4)) * _arg4) + _arg2), ((Math.sin((Math.PI / 4)) * _arg4) + _arg3));
_arg1.graphics.curveTo(((Math.tan((Math.PI / 8)) * _arg4) + _arg2), (_arg4 + _arg3), _arg2, (_arg4 + _arg3));
_arg1.graphics.curveTo(((-(Math.tan((Math.PI / 8))) * _arg4) + _arg2), (_arg4 + _arg3), ((-(Math.sin((Math.PI / 4))) * _arg4) + _arg2), ((Math.sin((Math.PI / 4)) * _arg4) + _arg3));
_arg1.graphics.curveTo((-(_arg4) + _arg2), ((Math.tan((Math.PI / 8)) * _arg4) + _arg3), (-(_arg4) + _arg2), _arg3);
_arg1.graphics.curveTo((-(_arg4) + _arg2), ((-(Math.tan((Math.PI / 8))) * _arg4) + _arg3), ((-(Math.sin((Math.PI / 4))) * _arg4) + _arg2), ((-(Math.sin((Math.PI / 4))) * _arg4) + _arg3));
_arg1.graphics.curveTo(((-(Math.tan((Math.PI / 8))) * _arg4) + _arg2), (-(_arg4) + _arg3), _arg2, (-(_arg4) + _arg3));
_arg1.graphics.curveTo(((Math.tan((Math.PI / 8)) * _arg4) + _arg2), (-(_arg4) + _arg3), ((Math.sin((Math.PI / 4)) * _arg4) + _arg2), ((-(Math.sin((Math.PI / 4))) * _arg4) + _arg3));
_arg1.graphics.curveTo((_arg4 + _arg2), ((-(Math.tan((Math.PI / 8))) * _arg4) + _arg3), (_arg4 + _arg2), _arg3);
}
public function cleanUp():void{
this.removeEventListener("transitionInDone", this._manager.transitionInDone);
this.removeEventListener("transitionOutDone", this._manager.transitionOutDone);
this.stop();
}
public function set easing(_arg1:Function):void{
this._easing = _arg1;
if (this._twn){
this._twn.func = _arg1;
};
}
public function set manager(_arg1:TransitionManager):void{
if (this._manager){
this.removeEventListener("transitionInDone", this._manager.transitionInDone);
this.removeEventListener("transitionOutDone", this._manager.transitionOutDone);
};
this._manager = _arg1;
this.addEventListener("transitionInDone", this._manager.transitionInDone);
this.addEventListener("transitionOutDone", this._manager.transitionOutDone);
}
public function set progress(_arg1:Number):void{
if (this._progress == _arg1){
return;
};
this._progress = _arg1;
if (this._direction){
this._render((1 - _arg1));
} else {
this._render(_arg1);
};
this.dispatchEvent(new Event("transitionProgress"));
}
public function start():void{
this.content.visible = true;
this._twn.start();
}
public function drawBox(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):void{
_arg1.graphics.moveTo(_arg2, _arg3);
_arg1.graphics.lineTo((_arg2 + _arg4), _arg3);
_arg1.graphics.lineTo((_arg2 + _arg4), (_arg3 + _arg5));
_arg1.graphics.lineTo(_arg2, (_arg3 + _arg5));
_arg1.graphics.lineTo(_arg2, _arg3);
}
public function set content(_arg1:MovieClip):void{
if (_arg1){
this._content = _arg1;
if (this._twn){
this._twn.obj = _arg1;
};
};
}
private function _noEase(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public function get content():MovieClip{
return (this._content);
}
public function set direction(_arg1:Number):void{
this._direction = (_arg1) ? 1 : 0;
}
public function get direction():Number{
return (this._direction);
}
}
}//package fl.transitions
Section 4
//TransitionManager (fl.transitions.TransitionManager)
package fl.transitions {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class TransitionManager extends EventDispatcher {
public var _innerBounds:Rectangle;
private var _visualPropList:Object;
private var _triggerEvent:String;
public var className:String;// = "TransitionManager"
public var type:Object;
private var _contentAppearance:Object;
private var _content:MovieClip;
public var _width:Number;// = NAN
public var _height:Number;// = NAN
public var _outerBounds:Rectangle;
private var _transitions:Object;
private static var IDCount:int = 0;
public function TransitionManager(_arg1:MovieClip){
type = TransitionManager;
className = "TransitionManager";
_width = NaN;
_height = NaN;
_visualPropList = {x:null, y:null, scaleX:null, scaleY:null, alpha:null, rotation:null};
super();
this.content = _arg1;
this._transitions = {};
}
public function get content():MovieClip{
return (this._content);
}
public function removeAllTransitions():void{
var _local1:Transition;
for each (_local1 in this._transitions) {
_local1.cleanUp();
this.removeTransition(_local1);
};
}
function transitionInDone(_arg1:Object):void{
var _local2:Boolean;
this.removeTransition(_arg1.target);
if (this.numInTransitions == 0){
_local2 = this._content.visible;
if ((((this._triggerEvent == "hide")) || ((this._triggerEvent == "hideChild")))){
this._content.visible = false;
};
if (_local2){
this.dispatchEvent(new Event("allTransitionsInDone"));
};
};
}
public function get numOutTransitions():Number{
var _local1:Number;
var _local2:Object;
var _local3:Transition;
_local1 = 0;
_local2 = this._transitions;
for each (_local3 in _local2) {
if (_local3.direction){
_local1++;
};
};
return (_local1);
}
public function get contentAppearance():Object{
return (this._contentAppearance);
}
public function saveContentAppearance():void{
var _local1:MovieClip;
var _local2:Object;
var _local3:String;
_local1 = this._content;
if (!this._contentAppearance){
_local2 = (this._contentAppearance = {});
for (_local3 in this._visualPropList) {
_local2[_local3] = _local1[_local3];
};
_local2.colorTransform = _local1.transform.colorTransform;
};
this._innerBounds = _local1.getBounds(_local1);
this._outerBounds = _local1.getBounds(_local1.parent);
this._width = _local1.width;
this._height = _local1.height;
}
public function addTransition(_arg1:Transition):Transition{
_arg1.ID = ++TransitionManager.IDCount;
this._transitions[_arg1.ID] = _arg1;
return (_arg1);
}
public function startTransition(_arg1:Object):Transition{
var _local2:Class;
var _local3:Transition;
this.removeTransition(this.findTransition(_arg1));
_local2 = _arg1.type;
_local3 = new _local2(this._content, _arg1, this);
this.addTransition(_local3);
_local3.start();
return (_local3);
}
function transitionOutDone(_arg1:Object):void{
var _local2:Boolean;
this.removeTransition(_arg1.target);
if (this.numOutTransitions == 0){
this.restoreContentAppearance();
_local2 = this._content.visible;
if (((_local2) && ((((_triggerEvent == "hide")) || ((_triggerEvent == "hideChild")))))){
this._content.visible = false;
};
if (_local2){
this.dispatchEvent(new Event("allTransitionsOutDone"));
};
};
}
public function restoreContentAppearance():void{
var _local1:MovieClip;
var _local2:Object;
var _local3:String;
_local1 = this._content;
_local2 = this._contentAppearance;
for (_local3 in this._visualPropList) {
_local1[_local3] = _local2[_local3];
};
_local1.transform.colorTransform = _local2.colorTransform;
}
public function get numTransitions():Number{
var _local1:Number;
var _local2:Transition;
_local1 = 0;
for each (_local2 in this._transitions) {
_local1++;
};
return (_local1);
}
public function findTransition(_arg1:Object):Transition{
var _local2:Transition;
for each (_local2 in this._transitions) {
if (_local2.type == _arg1.type){
return (_local2);
};
};
return (null);
}
public function set content(_arg1:MovieClip):void{
this._content = _arg1;
this.saveContentAppearance();
}
public function get numInTransitions():Number{
var _local1:Number;
var _local2:Object;
var _local3:Transition;
_local1 = 0;
_local2 = this._transitions;
for each (_local3 in _local2) {
if (!_local3.direction){
_local1++;
};
};
return (_local1);
}
public function removeTransition(_arg1:Transition):Boolean{
if (((((!(_arg1)) || (!(this._transitions)))) || (!(this._transitions[_arg1.ID])))){
return (false);
};
_arg1.cleanUp();
return (delete this._transitions[_arg1.ID]);
}
public function get transitionsList():Object{
return (this._transitions);
}
public static function start(_arg1:MovieClip, _arg2:Object):Transition{
if (!_arg1.__transitionManager){
_arg1.__transitionManager = new TransitionManager(_arg1);
};
if (_arg2.direction == 1){
_arg1.__transitionManager._triggerEvent = "hide";
} else {
_arg1.__transitionManager._triggerEvent = "reveal";
};
return (_arg1.__transitionManager.startTransition(_arg2));
}
}
}//package fl.transitions
Section 5
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
public var begin:Number;// = NAN
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var change:Number;// = NAN
private var _finish:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
isPlaying = false;
obj = null;
prop = "";
func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
begin = NaN;
change = NaN;
useSeconds = false;
prevTime = NaN;
prevPos = NaN;
looping = false;
_duration = NaN;
_time = NaN;
_fps = NaN;
_position = NaN;
_startTime = NaN;
_intervalID = 0;
_finish = NaN;
_timer = null;
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean;
_local2 = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 6
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var time:Number;// = NAN
public var position:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
time = NaN;
position = NaN;
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 7
//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 8
//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 9
//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;
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);
addTween(this, "frame", _target.currentFrame, _arg2, "frame");
return (true);
}
}
}//package gs.plugins
Section 10
//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 11
//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 _target:DisplayObject;
public static const VERSION:Number = 1.01;
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{
updateTweens(_arg1);
_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);
};
if (((!((_arg3.exposedVars.alpha == undefined))) || (!((_arg3.exposedVars.autoAlpha == undefined))))){
_local4.alphaMultiplier = ((_arg3.exposedVars.alpha)!=undefined) ? _arg3.exposedVars.alpha : _arg3.exposedVars.autoAlpha;
_arg3.killVars({alpha:1, autoAlpha:1});
} else {
_local4.alphaMultiplier = _arg1.alpha;
};
init((_arg1 as DisplayObject), _local4);
return (true);
}
}
}//package gs.plugins
Section 12
//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 13
//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 14
//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;
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 (Boolean(!((_tweens.length == 0))));
}
}
}//package gs.plugins
Section 15
//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 16
//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 17
//TweenLite (gs.TweenLite)
package gs {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import gs.utils.tween.*;
import gs.plugins.*;
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.06;
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};
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;
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 18
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const NO_USER:String = "NoUser";
public static const IO_ERROR:String = "IOError";
public static const ITEM_NEW:String = "ItemNew";
public static const ITEM_OWNED:String = "ItemOwned";
public static const STORE_ITEMS:String = "StoreItems";
public static const ERROR:String = "Error";
public static const STORE_SHOW:String = "StoreShow";
public static var _inventory:MochiInventory;
public static function triggerEvent(_arg1:String, _arg2:Object):void{
MochiSocial.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
MochiSocial.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
MochiSocial.addEventListener(_arg1, _arg2);
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function get inventory():MochiInventory{
return (_inventory);
}
public static function showStore(_arg1:Object=null):void{
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_inventory = new MochiInventory();
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_inventory = null;
});
}
}//package mochi.as3
Section 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 endPlay():void{
MochiServices.send("events_clearRoundID", null, null, null);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function trackEvent(_arg1:String, _arg2=null):void{
MochiServices.send("events_trackEvent", {tag:_arg1, value:_arg2}, null, null);
}
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 getVersion():String{
return (MochiServices.getVersion());
}
public static function startPlay(_arg1:String="gameplay"):void{
MochiServices.send("events_setRoundID", {tag:String(_arg1)}, null, null);
}
}
}//package mochi.as3
Section 22
//MochiInventory (mochi.as3.MochiInventory)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
public dynamic class MochiInventory extends Proxy {
private var _timer:Timer;
private var _names:Array;
private var _consumableProperties:Object;
private var _syncID:Number;
private var _storeSync:Object;
private var _outstandingID:Number;
private var _syncPending:Boolean;
public static const READY:String = "InvReady";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IoError";
private static const KEY_SALT:String = " syncMaint";
public static const WRITTEN:String = "InvWritten";
public static const NOT_READY:String = "InvNotReady";
public static const VALUE_ERROR:String = "InvValueError";
private static const CONSUMER_KEY:String = "MochiConsumables";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiInventory():void{
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned);
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut);
_storeSync = new Object();
_syncPending = false;
_outstandingID = 0;
_syncID = 0;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, sync);
_timer.start();
if (MochiSocial.loggedIn){
loggedIn();
} else {
loggedOut();
};
}
private function newItems(_arg1:Object):void{
if (!this[(_arg1.id + KEY_SALT)]){
this[(_arg1.id + KEY_SALT)] = 0;
};
if (!this[_arg1.id]){
this[_arg1.id] = 0;
};
this[(_arg1.id + KEY_SALT)] = (this[(_arg1.id + KEY_SALT)] + _arg1.count);
this[_arg1.id] = (this[_arg1.id] + _arg1.count);
if (_arg1.privateProperties.consumable){
if (!this[_arg1.privateProperties.tag]){
this[_arg1.privateProperties.tag] = 0;
};
this[_arg1.privateProperties.tag] = (this[_arg1.privateProperties.tag] + (_arg1.privateProperties.inc * _arg1.count));
};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (-1);
};
if (_consumableProperties[_arg1]){
return (MochiDigits(_consumableProperties[_arg1]).value);
};
return (undefined);
}
public function release():void{
MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(_arg1):Boolean{
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (false);
};
if (_consumableProperties[_arg1] == undefined){
return (false);
};
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(_arg1:int):int{
return (((_arg1)>=_names.length) ? 0 : (_arg1 + 1));
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:MochiDigits;
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return;
};
if (!(_arg2 is Number)){
triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:_arg2});
return;
};
if (_consumableProperties[_arg1]){
_local3 = MochiDigits(_consumableProperties[_arg1]);
if (_local3.value == _arg2){
return;
};
_local3.value = _arg2;
} else {
_names.push(_arg1);
_consumableProperties[_arg1] = new MochiDigits(_arg2);
};
_syncID++;
}
private function sync(_arg1:Event=null):void{
var _local2:Object;
var _local3:String;
if (((_syncPending) || ((_syncID == _outstandingID)))){
return;
};
_outstandingID = _syncID;
_local2 = {};
for (_local3 in _consumableProperties) {
_local2[_local3] = MochiDigits(_consumableProperties[_local3]).value;
};
MochiUserData.put(CONSUMER_KEY, _local2, putConsumableBag);
_syncPending = true;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(_arg1:int):String{
return (_names[(_arg1 - 1)]);
}
private function loggedIn(_arg1:Object=null):void{
MochiUserData.get(CONSUMER_KEY, getConsumableBag);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(_arg1):Boolean{
if (!_consumableProperties[_arg1]){
return (false);
};
_names.splice(_names.indexOf(_arg1), 1);
delete _consumableProperties[_arg1];
return (true);
}
private function itemOwned(_arg1:Object):void{
_storeSync[_arg1.id] = {properties:_arg1.properties, count:_arg1.count};
}
private function putConsumableBag(_arg1:MochiUserData):void{
_syncPending = false;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
_outstandingID = -1;
};
triggerEvent(WRITTEN, {});
}
private function getConsumableBag(_arg1:MochiUserData):void{
var _local2:String;
var _local3:Number;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
return;
};
_consumableProperties = {};
_names = new Array();
if (_arg1.data){
for (_local2 in _arg1.data) {
_names.push(_local2);
_consumableProperties[_local2] = new MochiDigits(_arg1.data[_local2]);
};
};
for (_local2 in _storeSync) {
_local3 = _storeSync[_local2].count;
if (_consumableProperties[(_local2 + KEY_SALT)]){
_local3 = (_local3 - _consumableProperties[_local2]);
};
if (_local3 == 0){
} else {
newItems({id:_local2, count:_local3, properties:_storeSync[_local2].properties});
};
};
triggerEvent(READY, {});
}
private function loggedOut(_arg1:Object=null):void{
_consumableProperties = null;
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
}
}//package mochi.as3
Section 23
//MochiScores (mochi.as3.MochiScores)
package mochi.as3 {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public static function showLeaderboard(_arg1:Object=null):void{
var n:Number;
var options = _arg1;
if (options != null){
delete options.clip;
MochiServices.setContainer();
MochiServices.bringToTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local2:Object;
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
_local2 = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
_arg1 = Number(_arg1);
if (isNaN(_arg1)){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(_arg1) != _arg1){
trace((("WARNING: Submitted score '" + String(_arg1)) + "' will be truncated"));
};
_arg1 = Number(_arg1);
};
};
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (((((_arg1) && ((_arg1.error == true)))) && (onErrorHandler))){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiServices.warnID(_arg1, true);
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi.as3
Section 24
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _queue:Array;
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 _nextCallbackID:Number;
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 _callbacks:Object;
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 = _callbacks[cb];
if (!cblst){
return;
};
method = cblst.callbackMethod;
methodName = "";
obj = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete _callbacks[cb];
}
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:_nextCallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + _arg1));
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_queue.push({methodName:_arg1, args:_arg2, callbackID:_nextCallbackID});
};
if (_clip != null){
if (_callbacks != null){
_callbacks[_nextCallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_nextCallbackID++;
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
public static function get childClip():Object{
return (_clip);
}
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 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.8 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
var _local3:Number;
_arg1 = _arg1.toLowerCase();
if (_arg1.length != 16){
trace((("WARNING: " + (_arg2) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
_local3 = 0;
while (_local3 < _arg1.length) {
switch (_arg1.charAt(_local3)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + _arg1));
return;
};
_local3++;
};
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (((_clip) && (_queue))){
while (_queue.length > 0) {
_local2 = _queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _callbacks[_local2.callbackID];
};
delete _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 (_clip.parent){
_clip.parent.removeChild(_clip);
};
if (_arg1 != null){
if ((_arg1 is DisplayObjectContainer)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is DisplayObjectContainer)){
DisplayObjectContainer(_container).addChild(_clip);
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
private static function loadError(_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _queue.shift());
};
};
}
private static function loadLCBridge(_arg1:Object):void{
var loader:Loader;
var mochiLCURL:String;
var req:URLRequest;
var complete:Function;
var clip = _arg1;
loader = new Loader();
mochiLCURL = (_servURL + _mochiLC);
req = new URLRequest(mochiLCURL);
complete = function (_arg1:Object):void{
_mochiLocalConnection = MovieClip(loader.content);
listen();
};
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var _local3:String;
var _local4:URLRequest;
var _local5:URLVariables;
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(_arg2).servURL){
_servURL = urlOptions(_arg2).servURL;
};
_local3 = (_servURL + _services);
if (urlOptions(_arg2).servicesURL){
_local3 = urlOptions(_arg2).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(_local3);
_clip = new MovieClip();
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
_local4 = new URLRequest(_local3);
_local5 = new URLVariables();
_local5.listenLC = _listenChannelName;
_local5.mochiad_options = _arg2.loaderInfo.parameters.mochiad_options;
_local5.api_version = getVersion();
if (widget){
_local5.widget = true;
};
_local4.data = _local5;
_loader.load(_local4);
_clip.addChild(_loader);
_sendChannel = new LocalConnection();
_queue = [];
_nextCallbackID = 0;
_callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
warnID(id, false);
if ((clip is DisplayObject)){
if (clip.stage == null){
trace("MochiServices connect requires the containing clip be attached to the stage");
};
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function updateCopy(_arg1:Object):void{
MochiServices.send("coins_updateCopy", _arg1, null, null);
}
public static function bringToTop(_arg1:Event=null):void{
var e = _arg1;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 25
//MochiSocial (mochi.as3.MochiSocial)
package mochi.as3 {
public class MochiSocial {
public static const LOGGED_IN:String = "LoggedIn";
public static const PROFILE_HIDE:String = "ProfileHide";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const IO_ERROR:String = "IOError";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const USER_INFO:String = "UserInfo";
public static const ERROR:String = "Error";
public static const LOGIN_SHOW:String = "LoginShow";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_SHOWN:String = "LoginShown";
public static const LOGIN_HIDE:String = "LoginHide";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static var _user_info:Object = null;
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("coins_saveUserProperties", _arg1);
}
public static function get loggedIn():Boolean{
return (!((_user_info == null)));
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function getUserInfo():void{
MochiServices.send("coins_getUserInfo");
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showLoginWidget", {options:_arg1});
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function requestLogin():void{
MochiServices.send("coins_requestLogin");
}
public static function getAPIURL():String{
if (!_user_info){
return (null);
};
return (_user_info.api_url);
}
public static function hideLoginWidget():void{
MochiServices.send("coins_hideLoginWidget");
}
public static function getAPIToken():String{
if (!_user_info){
return (null);
};
return (_user_info.api_token);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_user_info = _arg1;
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_user_info = null;
});
}
}//package mochi.as3
Section 26
//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 27
//MochiUserData (mochi.as3.MochiUserData)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class MochiUserData extends EventDispatcher {
public var callback:Function;// = null
public var error:Event;// = null
public var key:String;// = null
public var operation:String;// = null
public var data;// = null
public var _loader:URLLoader;
public function MochiUserData(_arg1:String="", _arg2:Function=null){
key = null;
data = null;
error = null;
operation = null;
callback = null;
super();
this.key = _arg1;
this.callback = _arg2;
}
public function securityErrorHandler(_arg1:SecurityErrorEvent):void{
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _arg1.toString())));
}
public function putEvent(_arg1):void{
request("put", serialize(_arg1));
}
public function request(_arg1:String, _arg2:ByteArray):void{
var api_url:String;
var api_token:String;
var args:URLVariables;
var req:URLRequest;
var _operation = _arg1;
var _data = _arg2;
operation = _operation;
api_url = MochiSocial.getAPIURL();
api_token = MochiSocial.getAPIToken();
if ((((api_url == null)) || ((api_token == null)))){
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in"));
return;
};
_loader = new URLLoader();
args = new URLVariables();
args.op = _operation;
args.key = key;
req = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString()));
req.method = URLRequestMethod.POST;
req.contentType = "application/x-mochi-userdata";
req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)];
req.data = _data;
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.addEventListener(Event.COMPLETE, completeHandler);
_loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
try {
_loader.load(req);
} catch(e:SecurityError) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + e.toString())));
};
}
public function performCallback():void{
try {
callback(this);
} catch(e:Error) {
trace(("[MochiUserData] exception during callback: " + e));
};
}
public function serialize(_arg1):ByteArray{
var _local2:ByteArray;
_local2 = new ByteArray();
_local2.objectEncoding = ObjectEncoding.AMF3;
_local2.writeObject(_arg1);
_local2.compress();
return (_local2);
}
public function errorHandler(_arg1:IOErrorEvent):void{
data = null;
error = _arg1;
if (callback != null){
performCallback();
} else {
dispatchEvent(_arg1);
};
close();
}
public function completeHandler(_arg1:Event):void{
var event = _arg1;
try {
if (_loader.data.length){
data = deserialize(_loader.data);
} else {
data = null;
};
} catch(e:Error) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + e.toString())));
return;
};
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function getEvent():void{
request("get", serialize(null));
}
override public function toString():String{
return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]"));
}
public function close():void{
if (_loader){
_loader.removeEventListener(Event.COMPLETE, completeHandler);
_loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.close();
_loader = null;
};
error = null;
callback = null;
}
public function deserialize(_arg1:ByteArray){
_arg1.objectEncoding = ObjectEncoding.AMF3;
_arg1.uncompress();
return (_arg1.readObject());
}
public static function get(_arg1:String, _arg2:Function):void{
var _local3:MochiUserData;
_local3 = new MochiUserData(_arg1, _arg2);
_local3.getEvent();
}
public static function put(_arg1:String, _arg2, _arg3:Function):void{
var _local4:MochiUserData;
_local4 = new MochiUserData(_arg1, _arg3);
_local4.putEvent(_arg2);
}
}
}//package mochi.as3
Section 28
//_go (_go)
package {
import flash.media.*;
public dynamic class _go extends Sound {
}
}//package
Section 29
//Arw (Arw)
package {
import flash.display.*;
public dynamic class Arw extends MovieClip {
}
}//package
Section 30
//b_in (b_in)
package {
import flash.media.*;
public dynamic class b_in extends Sound {
}
}//package
Section 31
//b_out (b_out)
package {
import flash.media.*;
public dynamic class b_out extends Sound {
}
}//package
Section 32
//back_1 (back_1)
package {
import flash.display.*;
public dynamic class back_1 extends MovieClip {
}
}//package
Section 33
//back_3 (back_3)
package {
import flash.display.*;
public dynamic class back_3 extends MovieClip {
}
}//package
Section 34
//back_4 (back_4)
package {
import flash.display.*;
public dynamic class back_4 extends MovieClip {
}
}//package
Section 35
//Bar (Bar)
package {
import flash.display.*;
public dynamic class Bar extends MovieClip {
}
}//package
Section 36
//bb (bb)
package {
import flash.display.*;
public dynamic class bb extends BitmapData {
public function bb(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 37
//bGg (bGg)
package {
import flash.display.*;
public dynamic class bGg extends MovieClip {
}
}//package
Section 38
//combine (combine)
package {
import flash.events.*;
import flash.display.*;
import mochi.as3.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.net.*;
public dynamic class combine extends MovieClip {
public var soundON:Boolean;// = true
public var titicle:ParticleTitl;
public var Title:MovieClip;
public var splash_screen:splash;
public var BColor:int;
public var incr:int;// = 1499
public var game_over_screen:game_over;
public var gameComplete:int;
public var musVar:int;
public var score:int;
public var nua_G1:MovieClip;
public var nua_G2:MovieClip;
public var nua_G3:MovieClip;
public var backVar:int;
public var musicON:Boolean;// = true
public var pause_screen:pause_menu;
public var my_so:SharedObject;
public var play_screen:the_game;
public var Main:MovieClip;
public var how_to_play_screen:how_to_play;
public var back_G:MovieClip;
public function combine():void{
soundON = true;
musicON = true;
incr = 1499;
super();
Main = Init.instance;
show_splash();
}
public function show_splash():void{
splash_screen = new splash(this);
remove_game_over();
addChild(splash_screen);
titicle = new ParticleTitl();
addChild(titicle);
Title = new titl();
addChild(Title);
Title.x = 53;
Title.y = 23.8;
}
public function remove_game_over():void{
if (game_over_screen){
removeChild(game_over_screen);
game_over_screen = null;
};
}
public function remove_play():void{
if (play_screen){
if (play_screen.musChannel != null){
play_screen.musChannel.stop();
play_screen.musChannel = null;
};
play_screen.b_InChannel = null;
play_screen.S_goChannel = null;
play_screen.mdwnChannel = null;
play_screen.lvl_UpChannel = null;
play_screen.revEvt();
removeChild(play_screen);
play_screen = null;
removeChild(back_G);
back_G = null;
if (backVar == 2){
removeEventListener(Event.ENTER_FRAME, nuag);
};
};
}
public function nuag(_arg1:Event):void{
var _local2:int;
incr++;
if (incr == 1500){
_local2 = (Math.round((Math.random() * (3 - 1))) + 1);
if ((((_local2 == 1)) && ((nua_G1 == null)))){
nua_G1 = new nuage_1();
addChildAt(nua_G1, 1);
nua_G1.x = 400;
nua_G1.y = (Math.round((Math.random() * (280 - 130))) + 100);
};
if ((((_local2 == 2)) && ((nua_G2 == null)))){
nua_G2 = new nuage_2();
addChildAt(nua_G2, 1);
nua_G2.x = 400;
nua_G2.y = (Math.round((Math.random() * (280 - 130))) + 130);
};
if ((((_local2 == 3)) && ((nua_G3 == null)))){
nua_G3 = new nuage_3();
addChildAt(nua_G3, 1);
nua_G3.x = 400;
nua_G3.y = (Math.round((Math.random() * (280 - 130))) + 130);
};
incr = 0;
};
if ((incr / 10) == Math.round((incr / 10))){
if (nua_G1){
nua_G1.x = (nua_G1.x - 1);
if (nua_G1.x < 0){
removeChild(nua_G1);
nua_G1 = null;
};
};
if (nua_G2){
nua_G2.x = (nua_G2.x - 1);
if (nua_G2.x < 0){
removeChild(nua_G2);
nua_G2 = null;
};
};
if (nua_G3){
nua_G3.x = (nua_G3.x - 1);
if (nua_G3.x < 0){
removeChild(nua_G3);
nua_G3 = null;
};
};
};
}
public function remove_if_possible(_arg1):void{
if (_arg1){
removeChild(_arg1);
_arg1 = null;
};
}
public function show_pause(_arg1):void{
if (pause_screen == null){
pause_screen = new pause_menu(_arg1);
addChild(pause_screen);
pause_screen.x = 78;
stage.stageFocusRect = false;
stage.focus = pause_screen;
};
}
public function show_game_over():void{
game_over_screen = new game_over(this);
addChild(game_over_screen);
game_over_screen.alpha = 0;
addEventListener(Event.ENTER_FRAME, greyS, false, 0, true);
}
public function remove_how_to_play():void{
if (how_to_play_screen){
removeChild(how_to_play_screen);
how_to_play_screen = null;
};
}
public function show_how_to_play():void{
how_to_play_screen = new how_to_play(this);
addChild(how_to_play_screen);
TransitionManager.start(how_to_play_screen, {type:Fade, direction:Transition.IN, duration:1, easing:Strong.easeOut});
}
public function greyS(_arg1:Event):void{
if (game_over_screen.alpha < 0.7){
game_over_screen.alpha = (game_over_screen.alpha + 0.04);
} else {
removeEventListener(Event.ENTER_FRAME, greyS);
};
}
public function sScores():void{
var o:Object;
var boardID:String;
o = {n:[5, 2, 15, 5, 12, 7, 13, 4, 7, 10, 15, 7, 8, 0, 9, 7], 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});
}
public function remove_pause():void{
if (pause_screen != null){
foc();
removeChild(pause_screen);
pause_screen = null;
play_screen.pg = 0;
play_screen.pau = 0;
};
}
public function remove_splash():void{
if (splash_screen){
titicle.revev();
removeChild(splash_screen);
splash_screen = null;
removeChild(titicle);
titicle = null;
removeChild(Title);
Title = null;
};
}
public function play_the_game():void{
musVar = (Math.round((Math.random() * (2 - 1))) + 1);
backVar = (Math.round((Math.random() * (3 - 1))) + 1);
if (backVar == 1){
back_G = new back_1();
};
if (backVar == 2){
back_G = new back_4();
addEventListener(Event.ENTER_FRAME, nuag, false, 0, true);
};
if (backVar == 3){
back_G = new back_3();
};
addChild(back_G);
back_G.x = 15;
play_screen = new the_game(this);
remove_game_over();
remove_pause();
addChild(play_screen);
play_screen.x = 5;
foc();
TransitionManager.start(play_screen, {type:Fade, direction:Transition.IN, duration:2, easing:Strong.easeOut});
play_screen.pause_game = false;
play_screen.musi();
}
public function foc():void{
stage.focus = stage;
}
}
}//package
Section 39
//dwn (dwn)
package {
import flash.media.*;
public dynamic class dwn extends Sound {
}
}//package
Section 40
//ff (ff)
package {
import flash.display.*;
public dynamic class ff extends MovieClip {
}
}//package
Section 41
//game_over (game_over)
package {
import flash.events.*;
import flash.display.*;
import mochi.as3.*;
import flash.text.*;
public dynamic class game_over extends Sprite {
public var overtext:TextField;
public var play_again_button:SimpleButton;
public var level_select_button:SimpleButton;
public var go_score;
public var main_class:combine;
public var vnqruir:int;
public function game_over(_arg1:combine):void{
go_score = new Score();
super();
main_class = _arg1;
addChild(go_score);
go_score.x = 220;
go_score.y = 220;
go_score.updatescore(main_class.play_screen.m_score);
if (main_class.play_screen.scchk == main_class.play_screen.m_score){
vnqruir = main_class.play_screen.m_score;
} else {
vnqruir = 0;
};
MochiScores.showLeaderboard({boardID:"52f5c7d47af78097", score:vnqruir, onClose:mochiClose});
play_again_button.addEventListener(MouseEvent.CLICK, play_again_button_clicked);
level_select_button.addEventListener(MouseEvent.CLICK, level_select_button_clicked);
}
public function play_again_button_clicked(_arg1:MouseEvent):void{
main_class.removeEventListener(Event.ENTER_FRAME, main_class.greyS);
play_again_button.removeEventListener(MouseEvent.CLICK, play_again_button_clicked);
level_select_button.removeEventListener(MouseEvent.CLICK, level_select_button_clicked);
main_class.remove_game_over();
main_class.remove_play();
main_class.play_the_game();
removeChild(go_score);
go_score = null;
}
public function level_select_button_clicked(_arg1:MouseEvent):void{
main_class.removeEventListener(Event.ENTER_FRAME, main_class.greyS);
play_again_button.removeEventListener(MouseEvent.CLICK, play_again_button_clicked);
level_select_button.removeEventListener(MouseEvent.CLICK, level_select_button_clicked);
main_class.remove_game_over();
main_class.remove_play();
main_class.show_splash();
removeChild(go_score);
go_score = null;
}
public function mochiClose():void{
trace("mochiClosed");
}
public function replay():void{
main_class.removeEventListener(Event.ENTER_FRAME, main_class.greyS);
play_again_button.removeEventListener(MouseEvent.CLICK, play_again_button_clicked);
level_select_button.removeEventListener(MouseEvent.CLICK, level_select_button_clicked);
main_class.remove_game_over();
main_class.remove_play();
main_class.play_the_game();
removeChild(go_score);
go_score = null;
}
}
}//package
Section 42
//grey_screen (grey_screen)
package {
import flash.display.*;
public dynamic class grey_screen extends MovieClip {
}
}//package
Section 43
//Hotored (Hotored)
package {
import flash.display.*;
public dynamic class Hotored extends MovieClip {
}
}//package
Section 44
//how_to_play (how_to_play)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.text.*;
public dynamic class how_to_play extends MovieClip {
public var htred:MovieClip;
public var arrW;
public var frm:int;// = 0
public var ii:int;
public var httext:TextField;
public var p_bt:SimpleButton;
public var back_button:SimpleButton;
public var play_button:SimpleButton;
public var HtArr:Array;
public var main:combine;
public var n_bt:SimpleButton;
public var howtotxt:TextField;
public function how_to_play(_arg1:combine):void{
frm = 0;
arrW = new Arw();
HtArr = new Array();
super();
addChild(arrW);
arrW.x = 29;
arrW.y = 342;
main = _arg1;
play_button.addEventListener(MouseEvent.CLICK, on_play_button_clicked);
back_button.addEventListener(MouseEvent.CLICK, on_back_button_clicked);
n_bt.addEventListener(MouseEvent.CLICK, n_button_clicked);
p_bt.addEventListener(MouseEvent.CLICK, p_button_clicked);
Hoto();
}
public function n_button_clicked(_arg1:MouseEvent):void{
frm = (frm + 1);
Hoto();
}
public function on_back_button_clicked(_arg1:MouseEvent):void{
main.show_splash();
play_button.removeEventListener(MouseEvent.CLICK, on_play_button_clicked);
back_button.removeEventListener(MouseEvent.CLICK, on_back_button_clicked);
n_bt.removeEventListener(MouseEvent.CLICK, n_button_clicked);
p_bt.removeEventListener(MouseEvent.CLICK, p_button_clicked);
main.remove_how_to_play();
}
public function on_play_button_clicked(_arg1:MouseEvent):void{
main.play_the_game();
play_button.removeEventListener(MouseEvent.CLICK, on_play_button_clicked);
back_button.removeEventListener(MouseEvent.CLICK, on_back_button_clicked);
n_bt.removeEventListener(MouseEvent.CLICK, n_button_clicked);
p_bt.removeEventListener(MouseEvent.CLICK, p_button_clicked);
main.remove_how_to_play();
}
public function p_button_clicked(_arg1:MouseEvent):void{
if (frm > 0){
frm = (frm - 1);
};
Hoto();
}
public function cre(_arg1:int):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:BitmapData;
var _local6:Bitmap;
var _local7:BitmapData;
var _local8:Rectangle;
var _local9:Point;
var _local10:Bitmap;
_local3 = 0;
while (_local3 < 10) {
if (HtArr[_local3] != null){
removeChild(HtArr[_local3]);
HtArr[_local3] = null;
};
_local3++;
};
_local4 = 0;
while (_local4 < _arg1) {
if (_arg1 == 1){
_local2 = (2 * 46);
};
if (_arg1 == 2){
_local2 = (_local4 * 46);
};
if (_arg1 == 5){
if (_local4 < 3){
_local2 = 0;
} else {
_local2 = 46;
};
};
if (frm == 6){
_local2 = 46;
};
_local5 = new bb(0, 0);
_local6 = new Bitmap(_local5);
_local7 = new BitmapData(45, 46, true);
_local8 = new Rectangle(_local2, 0, 45, 46);
_local9 = new Point(0, 0);
_local7.copyPixels(_local5, _local8, _local9);
_local10 = new Bitmap(_local7);
HtArr[_local4] = _local10;
addChild(HtArr[_local4]);
if (_local4 < 2){
HtArr[_local4].y = 40;
HtArr[_local4].x = (78 + (45 * (2 + _local4)));
};
if (frm == 5){
if (_local4 == 0){
HtArr[_local4].y = 309;
HtArr[_local4].x = (78 + (45 * 2));
};
if (_local4 == 1){
HtArr[_local4].y = 309;
HtArr[_local4].x = (78 + (45 * 3));
};
};
if (frm == 6){
if (_local4 == 0){
HtArr[_local4].y = 354;
HtArr[_local4].x = (78 + (45 * 2));
};
if (_local4 == 1){
HtArr[_local4].y = 354;
HtArr[_local4].x = (78 + (45 * 3));
};
if (_local4 == 2){
HtArr[_local4].y = 354;
HtArr[_local4].x = (78 + (45 * 4));
};
};
if (frm == 7){
if (_local4 == 0){
HtArr[_local4].y = 354;
HtArr[_local4].x = (78 + (45 * 2));
};
};
if ((((frm == 5)) || ((frm == 4)))){
if (_local4 == 2){
HtArr[_local4].y = 354;
HtArr[_local4].x = (78 + (45 * 3));
};
if (_local4 == 3){
HtArr[_local4].y = 354;
HtArr[_local4].x = (78 + (45 * 4));
};
if (_local4 == 4){
HtArr[_local4].y = 354;
HtArr[_local4].x = (78 + (45 * 2));
};
};
_local4++;
};
}
public function Hoto():void{
if (frm == 0){
cre(2);
howtotxt.x = 89;
howtotxt.y = 3;
httext.x = 89;
httext.y = 282;
howtotxt.text = "";
httext.text = "Your goal is to combine three or more balls of the same type. \n You lose if one ball cross the red line";
};
if (frm == 1){
howtotxt.x = 89;
howtotxt.y = 3;
httext.x = 89;
httext.y = 282;
httext.text = "Only the Green and Yellow balls are available at the beginning, \n everytime you combine three or more balls of the same color you create a new ball of the next color.";
howtotxt.text = "";
};
if (frm == 2){
howtotxt.x = 89;
howtotxt.y = 3;
httext.x = 89;
httext.y = 282;
howtotxt.text = "";
httext.text = "The available type of balls are represented on the left by the arrow,\n you can see the progression of the type of balls and the order in which you need to combine them.";
};
if (frm == 3){
cre(2);
howtotxt.x = 89;
howtotxt.y = 3;
httext.x = 89;
httext.y = 282;
httext.text = "Use the Left and Right arrows to move them horizontally, press Up to swap their position, \n press Down to move them here.";
howtotxt.text = "Two balls of the available type appear here.";
};
if (frm == 4){
cre(5);
howtotxt.x = 89;
howtotxt.y = 3;
httext.x = 89;
httext.y = 282;
httext.text = "In this example a green ball is between two yellow balls,\n and you have two green";
howtotxt.text = "";
if (htred != null){
removeChild(htred);
htred = null;
};
};
if (frm == 5){
cre(5);
howtotxt.x = 89;
howtotxt.y = 3;
httext.x = 100;
httext.y = 200;
httext.text = "Putting the two green balls in this position will create a yellow ball.";
howtotxt.text = "";
htred = new Hotored();
addChild(htred);
htred.x = 213;
htred.y = 354;
};
if (frm == 6){
cre(3);
howtotxt.x = 89;
howtotxt.y = 3;
httext.x = 89;
httext.y = 200;
httext.text = "Combine three orange ball to make a red ball, and have the orange ball available. ";
howtotxt.text = "You now have three yellow balls, they will create a new ball of the next color: orange.";
if (htred != null){
removeChild(htred);
htred = null;
};
};
if (frm == 7){
cre(1);
howtotxt.x = 89;
howtotxt.y = 3;
httext.x = 89;
httext.y = 200;
httext;
howtotxt.text = "The created ball will always be in the position of the lowest ball or the one on the left \n if some are on the same level.";
httext.text = "The best way to understand is to play, press play when you are ready.";
if (htred != null){
removeChild(htred);
htred = null;
};
};
}
}
}//package
Section 45
//hs_bt (hs_bt)
package {
import flash.display.*;
public dynamic class hs_bt extends SimpleButton {
}
}//package
Section 46
//Init (Init)
package {
import flash.events.*;
import flash.display.*;
import mochi.as3.*;
import flash.utils.*;
import flash.net.*;
import flash.ui.*;
public dynamic class Init extends MovieClip {
public var compt:int;
private var bground:MovieClip;
public var plBt:MovieClip;
private var ATimer:Timer;
private var preLoader:preloader;
private var adsO:Boolean;// = false
private var alloUrl:String;// = "mindjolt.com"
public var sgbt:MovieClip;
private var onRightDomain:Boolean;// = true
private var timerOver:Boolean;// = false
private static var _instance:Init;
public function Init(){
adsO = false;
timerOver = false;
alloUrl = "mindjolt.com";
onRightDomain = true;
super();
addFrameScript(0, frame1, 2, frame3, 3, frame4);
addEventListener(Event.ADDED_TO_STAGE, go);
}
public function gtMenu(_arg1:MouseEvent):void{
sgbt.sgintro.removeEventListener(MouseEvent.CLICK, openUrl);
sgbt.iphone.removeEventListener(MouseEvent.CLICK, _openUrl);
sgbt.hand.removeEventListener(MouseEvent.CLICK, _openUrl);
sgbt.app.removeEventListener(MouseEvent.CLICK, _openUrl);
this.removeEventListener(MouseEvent.CLICK, load_);
plBt.playbt.removeEventListener(MouseEvent.CLICK, gtMenu);
if (sgbt != null){
removeChild(sgbt);
sgbt = null;
};
if (plBt != null){
removeChild(plBt);
plBt = null;
};
gotoAndStop(4);
}
protected function init():void{
var _local1:Class;
_local1 = (getDefinitionByName("combine") as Class);
addChild((new (_local1) as DisplayObject));
}
public function load_(_arg1:Event):void{
compt = (compt + 1);
if (compt == 150){
addChild(plBt);
plBt.x = 125;
plBt.y = 360;
plBt.playbt.addEventListener(MouseEvent.CLICK, gtMenu, false, 0, true);
};
}
function frame3(){
MochiBot.track(this, "9b2ef3f9");
stop();
sgbt = new SG_intro_bg();
addChild(sgbt);
sgbt.x = 200;
sgbt.y = 191;
sgbt.iphone.buttonMode = true;
sgbt.iphone.useHandCursor = true;
sgbt.hand.buttonMode = true;
sgbt.hand.useHandCursor = true;
sgbt.app.buttonMode = true;
sgbt.app.useHandCursor = true;
sgbt.sgintro.addEventListener(MouseEvent.CLICK, openUrl, false, 0, true);
sgbt.iphone.addEventListener(MouseEvent.CLICK, _openUrl, false, 0, true);
sgbt.hand.addEventListener(MouseEvent.CLICK, _openUrl, false, 0, true);
sgbt.app.addEventListener(MouseEvent.CLICK, _openUrl, false, 0, true);
this.addEventListener(Event.ENTER_FRAME, load_, false, 0, true);
compt = 0;
plBt = new play_mc();
}
private function preloaderOver(_arg1:Event):void{
remove_preloader();
gotoAndStop("intro");
}
function frame1(){
stop();
}
function frame4(){
stop();
init();
}
public function connectServices():void{
MochiServices.connect("db21aef0bf81b35b", root);
}
public function _openUrl(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.smileygamer.com/iphone/combine.php";
_local3 = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
public function remove_preloader():void{
if (preLoader){
preLoader.removeEventListener("preloaderOver", preloaderOver);
removeChild(preLoader);
preLoader = null;
};
}
public function openUrl(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.smileygamer.com/?gameref=2428";
_local3 = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
private function go(_arg1:Event):void{
var _local2:ContextMenu;
bground = new bGg();
addChild(bground);
bground.x = 0;
bground.y = 0;
preLoader = new preloader(this.loaderInfo);
addChild(preLoader);
preLoader.addEventListener("preloaderOver", preloaderOver);
_local2 = new ContextMenu();
_local2.hideBuiltInItems();
this.contextMenu = _local2;
_instance = this;
connectServices();
removeEventListener(Event.ADDED_TO_STAGE, go);
}
public static function get instance():Init{
return (_instance);
}
}
}//package
Section 47
//loadTxt (loadTxt)
package {
import flash.display.*;
import flash.text.*;
public dynamic class loadTxt extends MovieClip {
public var loader_txt:TextField;
}
}//package
Section 48
//lvlup (lvlup)
package {
import flash.media.*;
public dynamic class lvlup extends Sound {
}
}//package
Section 49
//m_2 (m_2)
package {
import flash.media.*;
public dynamic class m_2 extends Sound {
}
}//package
Section 50
//MochiBot (MochiBot)
package {
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
Section 51
//music (music)
package {
import flash.media.*;
public dynamic class music extends Sound {
}
}//package
Section 52
//nuage_1 (nuage_1)
package {
import flash.display.*;
public dynamic class nuage_1 extends MovieClip {
}
}//package
Section 53
//nuage_2 (nuage_2)
package {
import flash.display.*;
public dynamic class nuage_2 extends MovieClip {
}
}//package
Section 54
//nuage_3 (nuage_3)
package {
import flash.display.*;
public dynamic class nuage_3 extends MovieClip {
}
}//package
Section 55
//Outline (Outline)
package {
import flash.display.*;
public dynamic class Outline extends MovieClip {
}
}//package
Section 56
//Particle (Particle)
package {
import flash.display.*;
public dynamic class Particle extends MovieClip {
}
}//package
Section 57
//ParticleSystem (ParticleSystem)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
public class ParticleSystem extends MovieClip {
private var tmpI:Boolean;
public var ttp:int;
private var frm:int;
private var tmpP;
public var varx:int;
private var f:int;
private var DTimer:Timer;
private var b;
private var cx;
public var yyj:int;
public var bt;
private var a;
public var main_class:the_game;
private var dy;
public var xxj;
var angleDifference:Number;// = 7.2
private var particles:Array;
private var cnt:int;
private var ex;
public var soundBoon:Boolean;
private var particleMC:Sprite;
public var b_Out:b_out;
var angle:int;// = 0
public var xxj_t;
public var b_OutChannel:SoundChannel;
private var MTimer:Timer;
public function ParticleSystem(_arg1:the_game, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9):void{
angleDifference = 7.2;
angle = 0;
super();
main_class = _arg1;
soundBoon = main_class.main_class.soundON;
main_class.downOk = false;
xxj_t = _arg8;
particles = new Array();
a = _arg2;
b = _arg3;
ex = _arg4;
f = _arg5;
particleMC = new Sprite();
this.addChild(particleMC);
if (((!((a == ex))) && (!((b == f))))){
cx = 16;
dy = 16;
createParticle();
tmpP = true;
tmpI = false;
} else {
if ((((a == ex)) && ((b == f)))){
dy = _arg7;
cx = _arg6;
createImp();
tmpI = true;
tmpP = false;
frm = 0;
};
};
addEventListener(Event.ENTER_FRAME, moveParticles);
DTimer = new Timer(1050, 1);
DTimer.addEventListener(TimerEvent.TIMER_COMPLETE, rmv);
DTimer.start();
}
private function moveParticles(_arg1:Event):void{
var _local2:int;
var _local3:int;
if ((((tmpP == true)) && ((tmpI == false)))){
_local2 = (particles.length - 1);
while (_local2 >= 0) {
if (particles[_local2].alpha > 0.4){
particles[_local2].x = (particles[_local2].x + particles[_local2].dx);
particles[_local2].y = (particles[_local2].y + particles[_local2].dy);
particles[_local2].alpha = (particles[_local2].alpha - 0.01);
if (particles[_local2].life-- <= 0){
particleMC.removeChild(particles[_local2]);
particles.splice(_local2, 1);
};
};
_local2--;
};
} else {
if ((((tmpI == true)) && ((tmpP == false)))){
_local3 = (particles.length - 1);
while (_local3 >= 0) {
if (particles[_local3].alpha < 0.5){
particles[_local3].x = (particles[_local3].x - particles[_local3].dx);
particles[_local3].y = (particles[_local3].y - particles[_local3].dy);
particles[_local3].alpha = (particles[_local3].alpha + 0.01);
if (particles[_local3].life-- <= 0){
particleMC.removeChild(particles[_local3]);
particles.splice(_local3, 1);
};
};
_local3--;
};
};
};
}
private function createImp():void{
var _local1:Particle;
cnt = 0;
while (cnt < 50) {
_local1 = new Particle();
_local1.dx = (Math.sin(((angle * Math.PI) / 180)) * 3);
_local1.dy = (Math.cos(((angle * Math.PI) / 180)) * 3);
angle = (angle + angleDifference);
_local1.alpha = 0.2;
_local1.x = (a + (22 * _local1.dx));
_local1.y = (b + (22 * _local1.dy));
particleMC.addChild(_local1);
particles.push(_local1);
cnt++;
};
}
public function mv(_arg1:TimerEvent):void{
main_class.MvD();
frm = 0;
MTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, mv);
removeEventListener(Event.ENTER_FRAME, moveParticles);
}
private function createParticle():void{
var _local1:Particle;
cnt = 0;
while (cnt <= 51) {
if (cnt == 51){
angle = (360 - 3.5);
};
_local1 = new Particle();
_local1.dx = (Math.sin(((angle * Math.PI) / 180)) * 3);
_local1.dy = (Math.cos(((angle * Math.PI) / 180)) * 3);
angle = (angle + angleDifference);
_local1.alpha = 1;
_local1.x = a;
_local1.y = b;
particleMC.addChild(_local1);
particles.push(_local1);
cnt++;
};
}
public function rmv(_arg1:TimerEvent):void{
var _local2:int;
if ((((((a == ex)) && ((b == f)))) && ((frm == 0)))){
ttp = ((dy * 10) + cx);
bt = main_class.btype[ttp];
bt = (bt + 1);
if (bt != 10){
main_class.creup(dy, cx, bt);
};
if (soundBoon == true){
b_Out = new b_out();
b_OutChannel = b_Out.play();
};
frm = 1;
};
tmpI = false;
tmpP = false;
_local2 = (particles.length - 1);
while (_local2 >= 0) {
if (particles[_local2] != null){
particleMC.removeChild(particles[_local2]);
particles.splice(_local2, 1);
};
_local2--;
};
MTimer = new Timer(500, 1);
MTimer.addEventListener(TimerEvent.TIMER_COMPLETE, mv);
MTimer.start();
DTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, rmv);
}
}
}//package
Section 58
//ParticleTitl (ParticleTitl)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public dynamic class ParticleTitl extends MovieClip {
private var tmpI:Boolean;
private var frm:int;
private var tmpP:Boolean;
public var varx:int;
private var titicleMC:Sprite;
public var colorTransform:ColorTransform;
private var cnt:int;
public var xxj:int;
public var yyj:int;
public var bt:int;
public var main_class:the_game;
private var titicles:Array;
public var xxj_t:int;
public var ttp:int;
public function ParticleTitl():void{
colorTransform = new ColorTransform();
super();
titicles = new Array();
titicleMC = new Sprite();
this.addChild(titicleMC);
createParticle();
addEventListener(Event.ENTER_FRAME, moveTitParticles);
}
private function moveTitParticles(_arg1:Event):void{
var _local2:int;
createParticle();
_local2 = (titicles.length - 1);
while (_local2 >= 0) {
titicles[_local2].x = (titicles[_local2].x - titicles[_local2].dx);
if ((((titicles[_local2].x <= 332)) && ((titicles[_local2].x > 310)))){
colorTransform.color = 0xFF0000;
titicles[_local2].transform.colorTransform = colorTransform;
};
if ((((titicles[_local2].x <= 310)) && ((titicles[_local2].x > 300)))){
colorTransform.color = 16344838;
titicles[_local2].transform.colorTransform = colorTransform;
};
if ((((titicles[_local2].x <= 300)) && ((titicles[_local2].x > 280)))){
colorTransform.color = 0xFF7F00;
titicles[_local2].transform.colorTransform = colorTransform;
};
if ((((titicles[_local2].x <= 280)) && ((titicles[_local2].x > 270)))){
colorTransform.color = 0xCC9900;
titicles[_local2].transform.colorTransform = colorTransform;
};
if ((((titicles[_local2].x <= 270)) && ((titicles[_local2].x > 230)))){
colorTransform.color = 0xFFFF00;
titicles[_local2].transform.colorTransform = colorTransform;
};
if ((((titicles[_local2].x <= 230)) && ((titicles[_local2].x > 240)))){
colorTransform.color = 0x99FF00;
titicles[_local2].transform.colorTransform = colorTransform;
};
if ((((titicles[_local2].x <= 240)) && ((titicles[_local2].x > 220)))){
colorTransform.color = 0xFF00;
titicles[_local2].transform.colorTransform = colorTransform;
};
if ((((titicles[_local2].x <= 220)) && ((titicles[_local2].x > 210)))){
colorTransform.color = 0x9999;
titicles[_local2].transform.colorTransform = colorTransform;
};
if ((((titicles[_local2].x <= 210)) && ((titicles[_local2].x > 180)))){
colorTransform.color = 0xFF;
titicles[_local2].transform.colorTransform = colorTransform;
};
if ((((titicles[_local2].x <= 180)) && ((titicles[_local2].x > 160)))){
colorTransform.color = 61695;
titicles[_local2].transform.colorTransform = colorTransform;
};
if ((((titicles[_local2].x <= 160)) && ((titicles[_local2].x > 140)))){
colorTransform.color = 0x6600FF;
titicles[_local2].transform.colorTransform = colorTransform;
};
if ((((titicles[_local2].x <= 140)) && ((titicles[_local2].x > 110)))){
colorTransform.color = 0x8B00FF;
titicles[_local2].transform.colorTransform = colorTransform;
};
if (titicles[_local2].x <= 110){
colorTransform.color = 0xFFFFFF;
titicles[_local2].transform.colorTransform = colorTransform;
};
if (titicles[_local2].y <= 24){
titicles[_local2].dir = 1;
};
if (titicles[_local2].y >= 100){
titicles[_local2].dir = 0;
};
if (titicles[_local2].dir == 0){
titicles[_local2].y = (titicles[_local2].y - titicles[_local2].dy);
};
if (titicles[_local2].dir == 1){
titicles[_local2].y = (titicles[_local2].y + titicles[_local2].dy);
};
if (titicles[_local2].x <= 0){
titicleMC.removeChild(titicles[_local2]);
titicles.splice(_local2, 1);
};
_local2--;
};
}
private function createParticle():void{
var _local1:int;
var _local2:Particle;
var _local3:int;
var _local4:int;
_local1 = (Math.round((Math.random() * (100 - 1))) + 1);
if (_local1 <= 15){
_local2 = new Particle();
_local2.dx = (Math.round((Math.random() * (1 - 0.7))) + 0.7);
_local2.dy = (Math.round((Math.random() * (2 - 1))) + 1);
_local2.dir = 1;
_local2.alpha = 1;
_local2.x = 400;
_local2.y = (Math.round((Math.random() * (100 - 24))) + 24);
titicleMC.addChild(_local2);
titicles.push(_local2);
};
}
public function revev():void{
removeEventListener(Event.ENTER_FRAME, moveTitParticles);
}
}
}//package
Section 59
//pause_menu (pause_menu)
package {
import flash.events.*;
import flash.display.*;
public class pause_menu extends Sprite {
public var ps:Particle;
public var m_2bt:SimpleButton;
public var soundBoo:Boolean;
public var tmpboo_1:Boolean;
public var tmpvar_1:int;
public var tmpvar_2:int;
public var m_1bt:SimpleButton;
public var musicBoo:Boolean;
public var restart_bt:SimpleButton;
public var resume_bt:SimpleButton;
public var ms:Particle;
public var musOn_bt:SimpleButton;
public var escp:Boolean;// = false
public var sndOn_bt:SimpleButton;
public var musOff_bt:SimpleButton;
public var sndOff_bt:SimpleButton;
public var game:the_game;
public function pause_menu(_arg1:the_game):void{
escp = false;
super();
game = _arg1;
tmpvar_1 = game.pau;
tmpvar_2 = game.pg;
tmpboo_1 = game.pause_game;
soundBoo = game.main_class.soundON;
musicBoo = game.main_class.musicON;
if ((((((tmpvar_1 == 0)) && ((tmpvar_2 == 0)))) && ((tmpboo_1 == true)))){
ps = new Particle();
ms = new Particle();
addChild(ps);
addChild(ms);
ps.y = 248;
ms.y = 196;
m_1bt.addEventListener(MouseEvent.CLICK, m_1);
m_2bt.addEventListener(MouseEvent.CLICK, m_2);
sndOn_bt.addEventListener(MouseEvent.CLICK, sndOn);
sndOff_bt.addEventListener(MouseEvent.CLICK, sndOff);
musOn_bt.addEventListener(MouseEvent.CLICK, musOn);
musOff_bt.addEventListener(MouseEvent.CLICK, musOff);
resume_bt.addEventListener(MouseEvent.CLICK, resumeG);
restart_bt.addEventListener(MouseEvent.CLICK, restartG);
if (musicBoo == true){
ms.x = 106;
} else {
ms.x = 188;
};
if (soundBoo == true){
ps.x = 106;
} else {
ps.x = 188;
};
};
}
public function musOn(_arg1:MouseEvent):void{
game.main_class.musicON = true;
ms.x = 106;
game.musi();
}
public function sndOn(_arg1:MouseEvent):void{
game.main_class.soundON = true;
ps.x = 106;
}
public function restartG(_arg1:MouseEvent):void{
game.pause_game = false;
if (game.musChannel != null){
game.musChannel.stop();
};
game.b_InChannel = null;
game.S_goChannel = null;
game.mdwnChannel = null;
game.lvl_UpChannel = null;
game.pg = 0;
removeChild(ps);
removeChild(ms);
ps = null;
ms = null;
removevents();
game.main_class.remove_pause();
game.main_class.remove_play();
game.main_class.removeEventListener(Event.ENTER_FRAME, game.main_class.greyS);
game.main_class.play_the_game();
}
public function removevents():void{
sndOn_bt.removeEventListener(MouseEvent.CLICK, sndOn);
sndOff_bt.removeEventListener(MouseEvent.CLICK, sndOff);
musOn_bt.removeEventListener(MouseEvent.CLICK, musOn);
musOff_bt.removeEventListener(MouseEvent.CLICK, musOff);
resume_bt.removeEventListener(MouseEvent.CLICK, resumeG);
restart_bt.removeEventListener(MouseEvent.CLICK, restartG);
m_1bt.removeEventListener(MouseEvent.CLICK, m_1);
m_2bt.removeEventListener(MouseEvent.CLICK, m_2);
}
public function sndOff(_arg1:MouseEvent):void{
game.main_class.soundON = false;
ps.x = 188;
}
public function resumeG(_arg1:MouseEvent):void{
game.pause_game = false;
game.pg = 0;
removeChild(ps);
removeChild(ms);
ps = null;
ms = null;
game.main_class.foc();
removevents();
game.main_class.remove_pause();
}
public function musOff(_arg1:MouseEvent):void{
game.main_class.musicON = false;
ms.x = 188;
game.musi();
}
public function m_2(_arg1:MouseEvent):void{
game.main_class.musVar = 2;
game.musi();
}
public function m_1(_arg1:MouseEvent):void{
game.main_class.musVar = 1;
game.musi();
}
}
}//package
Section 60
//play_mc (play_mc)
package {
import flash.display.*;
public dynamic class play_mc extends MovieClip {
public var playbt:SimpleButton;
}
}//package
Section 61
//preloader (preloader)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public dynamic class preloader extends MovieClip {
private var comp:int;// = 0
private var ij:int;// = 0
private var ii:int;// = 0
private var txtBox:MovieClip;
private var ctad:Boolean;// = false
private var i:int;// = 0
public var preloaderOver:Boolean;// = false
private var k;
private var m:int;
private var angleDifference:Number;// = 18
private var ff_mc:MovieClip;
private var l;
private var URLallowed:Array;
private var onRightDomain:Boolean;// = true
private var con:int;// = 0
private var partic:Array;
private var outL:MovieClip;
private var partMC:Sprite;
public var ldrInfo:LoaderInfo;
private var angle:int;// = 0
private var bar_mc:MovieClip;
public function preloader(_arg1:LoaderInfo=null):void{
var _local2:Timer;
var _local3:Particle;
URLallowed = ["smileygamer.com"];
onRightDomain = true;
angleDifference = (360 / 20);
angle = 0;
i = 0;
ij = 0;
ii = 0;
comp = 0;
con = 0;
ctad = false;
preloaderOver = false;
super();
this.ldrInfo = _arg1;
_local2 = new Timer(1000, 1);
_local2.addEventListener(TimerEvent.TIMER_COMPLETE, adD);
_local2.start();
partic = new Array();
partMC = new Sprite();
this.addChild(partMC);
bar_mc = new Bar();
this.addChild(bar_mc);
bar_mc.x = (200.4 - (bar_mc.width / 2));
bar_mc.y = 221.9;
outL = new Outline();
this.addChild(outL);
outL.x = 200.4;
outL.y = 221.9;
txtBox = new loadTxt();
this.addChild(txtBox);
txtBox.x = 169.4;
txtBox.y = 245.9;
ff_mc = new ff();
this.addChild(ff_mc);
ff_mc.x = 201.4;
ff_mc.y = 219.9;
ff_mc.alpha = 0;
ii = 0;
while (ii < 20) {
_local3 = new Particle();
_local3.dx = (Math.sin(((angle * Math.PI) / 180)) * 3);
_local3.dy = (Math.cos(((angle * Math.PI) / 180)) * 3);
partic[ii] = _local3;
partMC.addChild(partic[ii]);
partic[ii].x = (202 + (10 * _local3.dx));
partic[ii].y = (180 + (10 * _local3.dy));
angle = (angle + angleDifference);
ii++;
};
this.addEventListener(Event.ENTER_FRAME, loading, false, 0, true);
}
private function checkDomain():void{
var _local1:*;
var _local2:int;
_local1 = this.ldrInfo.url;
_local1 = _local1.split("://");
_local1 = _local1[1].split("/");
_local1 = _local1[0];
if (_local1.substr(0, 4) == "www."){
_local1 = _local1.substring(4);
};
_local2 = 0;
while (_local2 < URLallowed.length) {
if (_local1 == URLallowed[_local2]){
onRightDomain = true;
break;
};
_local2++;
};
}
private function timerListener(_arg1:TimerEvent):void{
}
private function loading(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:int;
_local2 = ldrInfo.bytesTotal;
_local3 = ldrInfo.bytesLoaded;
bar_mc.scaleX = (_local3 / _local2);
_local4 = Math.floor(((ldrInfo.bytesLoaded * 100) / ldrInfo.bytesTotal));
_local5 = Math.floor(((_local3 / _local2) * 100));
txtBox.loader_txt.text = (Math.floor(((_local3 / _local2) * 100)) + "%");
ff_mc.alpha = (_local5 / 100);
ij = (i - 1);
if (i == 0){
ij = 19;
k = (ij - 1);
l = (k - 1);
((m - l) - 1);
};
k = (ij - 1);
if (ij == 0){
k = 19;
l = (k - 1);
((m - l) - 1);
};
l = (k - 1);
if (k == 0){
l = 19;
ij = (i - 1);
((m - l) - 1);
};
m = (l - 1);
if (l == 0){
m = 19;
ij = (i - 1);
k = (ij - 1);
};
partic[i].alpha = 0;
if (partic[ij] != null){
partic[ij].alpha = 0.25;
};
if (partic[ij] != null){
partic[k].alpha = 0.5;
};
if (partic[ij] != null){
partic[l].alpha = 0.75;
};
if (partic[ij] != null){
partic[m].alpha = 1;
};
i++;
if (i > 19){
i = 0;
};
if ((((_local4 == 100)) && ((ctad == true)))){
preloaderOver = true;
};
if ((((_local2 == _local3)) && ((ctad == true)))){
preloaderOver = true;
};
if (preloaderOver == true){
this.removeEventListener(Event.ENTER_FRAME, loading);
_local6 = 0;
while (_local6 < 20) {
if (partic[_local6] != null){
partMC.removeChild(partic[_local6]);
partic[_local6] = null;
};
_local6++;
};
if (partMC != null){
this.removeChild(partMC);
partMC = null;
};
dispatchEvent(new Event("preloaderOver"));
};
}
public function progressHandler(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, progressHandler);
dispatchEvent(new Event("preloaderOver"));
}
private function adD(_arg1:TimerEvent):void{
ctad = true;
}
}
}//package
Section 62
//Score (Score)
package {
import flash.display.*;
import flash.text.*;
public class Score extends Sprite {
public var scoretext:TextField;
public function Score():void{
this.scoretext.text = String(0);
}
public function updatescore(_arg1):void{
this.scoretext.text = String(_arg1);
}
}
}//package
Section 63
//SG_intro_bg (SG_intro_bg)
package {
import flash.display.*;
public dynamic class SG_intro_bg extends MovieClip {
public var app:MovieClip;
public var hand:MovieClip;
public var sgintro:MovieClip;
public var iphone:MovieClip;
}
}//package
Section 64
//splash (splash)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class splash extends Sprite {
public var how_to_button:SimpleButton;
public var main_class:combine;
public var h_bt:hs_bt;
public var play_button:SimpleButton;
public var miph:MovieClip;
public var addg:SimpleButton;
public var mnlg:MovieClip;
public var plm:SimpleButton;
public function splash(_arg1:combine){
main_class = _arg1;
play_button.addEventListener(MouseEvent.CLICK, on_play_button_clicked);
how_to_button.addEventListener(MouseEvent.CLICK, on_how_to_button_clicked);
h_bt.addEventListener(MouseEvent.CLICK, showScores);
mnlg.addEventListener(MouseEvent.CLICK, showURL);
plm.addEventListener(MouseEvent.CLICK, showURL);
miph.buttonMode = true;
miph.useHandCursor = true;
miph.addEventListener(MouseEvent.CLICK, _showURL);
addg.addEventListener(MouseEvent.CLICK, addG);
}
public function on_play_button_clicked(_arg1:MouseEvent):void{
play_button.removeEventListener(MouseEvent.CLICK, on_play_button_clicked);
how_to_button.removeEventListener(MouseEvent.CLICK, on_how_to_button_clicked);
h_bt.removeEventListener(MouseEvent.CLICK, showScores);
mnlg.removeEventListener(MouseEvent.CLICK, showURL);
plm.removeEventListener(MouseEvent.CLICK, showURL);
addg.removeEventListener(MouseEvent.CLICK, addG);
miph.removeEventListener(MouseEvent.CLICK, _showURL);
main_class.play_the_game();
main_class.remove_splash();
}
public function showURL(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.smileygamer.com/?gameref=2428";
_local3 = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
public function showScores(_arg1:MouseEvent):void{
main_class.sScores();
}
public function addG(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.smileygamer.com/freecontent.html?gameref=2428";
_local3 = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
public function on_how_to_button_clicked(_arg1:MouseEvent):void{
play_button.removeEventListener(MouseEvent.CLICK, on_play_button_clicked);
how_to_button.removeEventListener(MouseEvent.CLICK, on_how_to_button_clicked);
h_bt.removeEventListener(MouseEvent.CLICK, showScores);
mnlg.removeEventListener(MouseEvent.CLICK, showURL);
plm.removeEventListener(MouseEvent.CLICK, showURL);
addg.removeEventListener(MouseEvent.CLICK, addG);
miph.removeEventListener(MouseEvent.CLICK, _showURL);
main_class.show_how_to_play();
main_class.remove_splash();
}
public function _showURL(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.smileygamer.com/iphone/combine.php";
_local3 = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
}
}//package
Section 65
//the_game (the_game)
package {
import gs.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
public dynamic class the_game extends MovieClip {
public var tmp1:int;
public var tmp3:int;
public var Rect:Rectangle;
public var bbmp:BitmapData;
public var left:Boolean;// = false
public var tmp2:int;
public var okg:int;
public var S_goChannel:SoundChannel;
public var ball1:Boolean;// = false
public var ball2:Boolean;// = false
public var okp:int;
public var right:Boolean;// = false
public var tm_up:Boolean;// = false
public var Pt:Point;
public var downOk:Boolean;// = true
public var ctp:int;// = 0
public var myTween:TweenLite;
public var varx:int;
public var tmpi:int;
public var arrw:Arw;
public var tmp4:int;
public var scox:int;
public var b_In:b_in;
public var S_go:_go;
public var scchk:int;// = 0
public var b_InChannel:SoundChannel;
public var tmp_16:int;
public var gridSize:int;// = 9
public var btup:int;
public var mdwnChannel:SoundChannel;
public var tj:int;
public var tmpii:int;
public var larx:int;// = 2
public var ti:int;
public var tk:int;
public var tGo:int;// = 0
public var particle:ParticleSystem;
public var m_score:int;// = 0
public var g_o:Boolean;// = false
public var pause_game:Boolean;// = false
public var chb:int;
public var btype:Array;
public var pau:int;// = 0
public var prevx:int;
public var prevy:int;
public var down:Boolean;// = false
public var locy_1:int;
public var mdwn:dwn;
public var up:Boolean;// = false
public var musChannel:SoundChannel;
public var g_score;
public var mus_2:m_2;
public var cha:int;
public var XArr:Array;
public var locx_1:int;
public var arxy:Array;
public var xx;
public var xj:int;
public var space:Boolean;// = false
public var xi:int;
public var xk:int;
public var tmp_5:int;
public var tmp_4:int;
public var yy:int;
public var mdwnOk:Boolean;// = true
public var ii:int;
public var locy:int;
public var locx:int;
public var jj:int;
public var YArr:Array;
public var main_class:combine;
private var dTimer:Timer;
public var fup:int;// = 0
private var delayTimer:Timer;
public var escp:Boolean;// = false
public var xip:int;
public var spt:Boolean;// = false
public var xjp:int;
public var dsp:Array;
public var finy:int;
public var mus:music;
public var addd:int;// = 0
public var finx:int;
public var mainArr:Array;
public var lvl_UpChannel:SoundChannel;
public var game:MovieClip;
public var pg:int;// = 0
public var lvl_Up:lvlup;
public var myTween2:TweenLite;
public function the_game(_arg1:combine):void{
var _local2:int;
var _local3:int;
var _local4:int;
mdwnOk = true;
XArr = new Array();
YArr = new Array();
btype = new Array();
dsp = new Array();
arxy = new Array();
arrw = new Arw();
addd = 0;
larx = 2;
fup = 0;
g_o = false;
tm_up = false;
pau = 0;
spt = false;
ctp = 0;
pause_game = false;
pg = 0;
downOk = true;
up = false;
escp = false;
down = false;
left = false;
right = false;
space = false;
gridSize = 9;
mainArr = new Array(gridSize);
g_score = new Score();
m_score = 0;
scchk = 0;
bbmp = new bb(0, 0);
Pt = new Point(0, 0);
ball1 = false;
ball2 = false;
tGo = 0;
super();
pau = 0;
main_class = _arg1;
g_o = false;
btype = new Array();
XArr = new Array();
YArr = new Array();
dsp = new Array();
arxy = new Array();
_local4 = 0;
while (_local4 < 100) {
btype[_local4] = null;
_local4++;
};
_local2 = 0;
while (_local2 <= gridSize) {
mainArr[_local2] = new Array(gridSize);
_local3 = 0;
while (_local3 < 7) {
mainArr[_local2][_local3] = new Array(7);
if (_local2 <= 8){
mainArr[_local2][_local3] = null;
};
_local3++;
};
_local2++;
};
mainArr[9][2] = null;
mainArr[9][3] = null;
addChild(g_score);
addChild(arrw);
arrw.x = 29;
arrw.y = 342;
g_score.x = 1;
g_score.y = 10;
if (pause_game == false){
main_class.remove_pause();
};
create_b();
main_class.stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed, false, 0, true);
main_class.stage.addEventListener(KeyboardEvent.KEY_UP, key_released, false, 0, true);
this.addEventListener(Event.ENTER_FRAME, Mvb, false, 0, true);
}
public function Tm_up(_arg1:Event):void{
var _local2:int;
var _local3:int;
tmp_16 = (tmp_16 + 1);
downOk = false;
if (tmp_16 == 10){
downOk = true;
_local2 = 0;
while (_local2 < 9) {
_local3 = 0;
while (_local3 < 7) {
Chk(_local2, null, _local3, null);
_local3++;
};
_local2++;
};
tmp_16 = 0;
removeEventListener(Event.ENTER_FRAME, Tm_up);
};
}
public function create_b():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:Rectangle;
var _local5:Point;
_local1 = 0;
while (_local1 < 9) {
_local3 = 0;
while (_local3 < 7) {
Chk(_local1, null, _local3, null);
_local3++;
};
_local1++;
};
tm_up = true;
_local2 = 2;
while (_local2 < 4) {
varx = Math.round((Math.random() * (larx - 1)));
varx = (varx * 46);
_local4 = new Rectangle(varx, 0, 45, 46);
_local5 = new Point(0, 0);
if (mainArr[9][_local2] == null){
mainArr[9][_local2] = new BitmapData(45, 46, true);
mainArr[9][_local2].copyPixels(bbmp, _local4, _local5);
mainArr[9][_local2] = new Bitmap(mainArr[9][_local2]);
addChild(mainArr[9][_local2]);
mainArr[9][_local2].y = 40;
mainArr[9][_local2].x = (78 + (45 * (1 + _local2)));
btype[(90 + _local2)] = (varx / 46);
};
_local2++;
};
}
public function onFinishTween(_arg1:int, _arg2:int, _arg3:int):void{
if (_arg3 == 2){
pg = (pg + 1);
tmp1 = _arg1;
tmp2 = _arg2;
};
if (_arg3 == 3){
pg = (pg + 1);
tmp3 = _arg1;
tmp4 = _arg2;
};
if (pg == 2){
if (main_class.soundON == true){
mdwnOk = false;
if (mdwnChannel == null){
mdwn = new dwn();
mdwnChannel = mdwn.play();
mdwnChannel = null;
};
};
if ((((tmp3 == 8)) && ((tmp1 == 7)))){
Chk(tmp3, tmp1, tmp4, tmp2);
} else {
Chk(tmp1, tmp3, tmp2, tmp4);
};
create_b();
fup = 0;
tm_up = false;
mdwnOk = true;
pg = 0;
};
}
public function Chk(_arg1, _arg2, _arg3, _arg4):void{
var _local5:int;
var _local6:*;
var _local7:int;
var _local8:*;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:int;
var _local18:int;
var _local19:int;
var _local20:int;
var _local21:int;
tm_up = false;
_local14 = 0;
while (_local14 <= 1) {
if (_local14 == 0){
ii = _arg1;
jj = _arg3;
} else {
if (_local14 == 1){
ii = _arg2;
jj = _arg4;
};
};
if (mainArr[ii][jj] != null){
_local15 = 0;
_local16 = 0;
_local17 = 0;
cha = ((ii * 10) + jj);
_local10 = 0;
_local18 = 0;
while (_local18 <= 87) {
dsp[_local18] = 99;
XArr[_local18] = 99;
YArr[_local18] = 99;
_local18++;
};
_local19 = 0;
_local20 = 0;
okp = 0;
plumun(ii, jj);
if (okp > 2){
_local6 = 0;
_local7 = 0;
_local21 = 0;
while (_local21 <= 87) {
if (dsp[_local21] == 1){
if (_local6 == 0){
_local8 = XArr[_local21];
_local9 = YArr[_local21];
};
if (YArr[_local21] < _local9){
_local8 = XArr[_local21];
_local9 = YArr[_local21];
};
if ((((XArr[_local21] <= _local8)) && ((YArr[_local21] <= _local9)))){
_local8 = XArr[_local21];
_local9 = YArr[_local21];
};
_local6 = (_local6 + 1);
};
_local21++;
};
_local17 = (_local6 - 1);
_local6 = _local17;
while (_local6 > 0) {
_local21 = 87;
while (_local21 >= 0) {
tj = XArr[_local21];
ti = YArr[_local21];
if (((!((dsp[_local21] == 99))) && (!((tj == 99))))){
if (mainArr[ti][tj] != null){
removeChild(mainArr[ti][tj]);
mainArr[ti][tj] = null;
_local16 = (_local16 + 1);
if ((((YArr[_local21] == _local9)) && ((XArr[_local21] == _local8)))){
_local15 = ((_local9 * 10) + _local8);
if (btype[_local15] == larx){
if (larx < 9){
larx = (larx + 1);
};
arrw.y = (arrw.y - 25);
if (main_class.soundON == true){
lvl_Up = new lvlup();
lvl_UpChannel = lvl_Up.play();
};
};
Floc(ti, tj);
finx = locx;
finy = locy;
locy_1 = ti;
locx_1 = tj;
if (main_class.soundON == true){
b_In = new b_in();
b_InChannel = b_In.play();
};
particle = new ParticleSystem(this, locx, locy, finx, finy, locx_1, locy_1, tj, ti);
this.addChild(particle);
} else {
Floc(ti, tj);
particle = new ParticleSystem(this, locx, locy, (finx = 0), (finy = 0), (locx_1 = 15), (locy_1 = 15), tj, ti);
this.addChild(particle);
chb = ((ti * 10) + tj);
btype[chb] = null;
};
XArr[_local21] = 99;
YArr[_local21] = 99;
dsp[chb] = 99;
_local15 = ((_local9 * 10) + _local8);
scox = 0;
while (scox <= 9) {
if (btype[_local15] == scox){
if (scox >= 3){
scox = (scox * 2);
};
if (scox >= 7){
scox = (scox + 50);
};
scox = ((scox * 5) + 5);
add_score(scox);
};
scox++;
};
};
};
_local21--;
};
_local6--;
};
if ((_local17 + 1) != _local16){
_local21 = 0;
while (_local21 <= 87) {
if ((((dsp[_local21] == 1)) && (!((tj == 99))))){
tj = XArr[_local21];
ti = YArr[_local21];
if (mainArr[ti][tj] != null){
removeChild(mainArr[ti][tj]);
mainArr[ti][tj] = null;
};
};
_local21++;
};
};
};
};
_local14++;
};
}
private function key_pressed(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case Keyboard.UP:
up = true;
break;
case Keyboard.DOWN:
down = true;
break;
case Keyboard.LEFT:
left = true;
break;
case Keyboard.RIGHT:
right = true;
break;
case Keyboard.SPACE:
escp = true;
break;
case 80:
escp = true;
break;
case 65:
left = true;
break;
case 68:
right = true;
break;
case 83:
down = true;
break;
case 87:
up = true;
break;
};
}
function revEvt():void{
var _local1:int;
var _local2:*;
var _local3:*;
_local1 = 0;
while (_local1 < 100) {
btype[_local1] = null;
_local1++;
};
_local2 = 0;
while (_local2 <= gridSize) {
_local3 = 0;
while (_local3 < 7) {
if (mainArr[_local2][_local3] != null){
if ((mainArr[_local2][_local3] is DisplayObject)){
removeChild(mainArr[_local2][_local3]);
};
mainArr[_local2][_local3] = null;
};
_local3++;
};
_local2++;
};
main_class.stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed);
main_class.stage.removeEventListener(KeyboardEvent.KEY_UP, key_released);
removeEventListener(Event.ENTER_FRAME, Mvb);
removeEventListener(Event.ENTER_FRAME, Tm_up);
}
public function creup(_arg1, _arg2, _arg3):void{
if (addd > 10){
addd = 0;
};
arxy[addd] = _arg3;
arxy[addd] = (arxy[addd] * 46);
Rect = new Rectangle(arxy[addd], 0, 45, 46);
if (mainArr[_arg1][_arg2] == null){
mainArr[_arg1][_arg2] = new BitmapData(45, 46, true);
mainArr[_arg1][_arg2].copyPixels(bbmp, Rect, Pt);
mainArr[_arg1][_arg2] = new Bitmap(mainArr[_arg1][_arg2]);
addChild(mainArr[_arg1][_arg2]);
mainArr[_arg1][_arg2].y = (354 - (_arg1 * 45));
mainArr[_arg1][_arg2].x = (78 + (45 * _arg2));
btype[((_arg1 * 10) + _arg2)] = _arg3;
tmp_4 = _arg1;
tmp_5 = _arg2;
tm_up = true;
addd = (addd + 1);
};
}
private function key_released(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case Keyboard.UP:
up = false;
break;
case Keyboard.DOWN:
down = false;
break;
case Keyboard.LEFT:
left = false;
break;
case Keyboard.RIGHT:
right = false;
break;
case Keyboard.SPACE:
escp = false;
break;
case 80:
escp = false;
break;
case 65:
left = false;
break;
case 68:
right = false;
break;
case 83:
down = false;
break;
case 87:
up = false;
break;
};
}
public function plumun(_arg1:int, _arg2:int):int{
var _local3:int;
var _local4:int;
_local3 = (_arg1 - 1);
_local4 = _arg2;
cha = ((_arg1 * 10) + _arg2);
if (dsp[cha] != 1){
dsp[cha] = 1;
XArr[cha] = _arg2;
YArr[cha] = _arg1;
okp = (okp + 1);
};
chb = ((_local3 * 10) + _local4);
if ((((_local3 >= 0)) && (!((dsp[chb] == 1))))){
if (btype[chb] == btype[cha]){
dsp[chb] = 1;
XArr[chb] = _local4;
YArr[chb] = _local3;
okp = (okp + 1);
plumun(_local3, _local4);
} else {
dsp[chb] = 99;
};
};
_local3 = (_arg1 + 1);
_local4 = _arg2;
chb = ((_local3 * 10) + _local4);
if ((((_local3 < 7)) && (!((dsp[chb] == 1))))){
if (btype[chb] == btype[cha]){
dsp[chb] = 1;
XArr[chb] = _local4;
YArr[chb] = _local3;
okp = (okp + 1);
plumun(_local3, _local4);
} else {
dsp[chb] = 99;
};
};
_local3 = _arg1;
_local4 = (_arg2 + 1);
chb = ((_local3 * 10) + _local4);
if ((((_local4 < 7)) && (!((dsp[chb] == 1))))){
if (btype[chb] == btype[cha]){
dsp[chb] = 1;
XArr[chb] = _local4;
YArr[chb] = _local3;
okp = (okp + 1);
plumun(_local3, _local4);
} else {
dsp[chb] = 99;
};
};
_local3 = _arg1;
_local4 = (_arg2 - 1);
chb = ((_local3 * 10) + _local4);
if ((((_local4 >= 0)) && (!((dsp[chb] == 1))))){
if (btype[chb] == btype[cha]){
dsp[chb] = 1;
XArr[chb] = _local4;
YArr[chb] = _local3;
okp = (okp + 1);
plumun(_local3, _local4);
} else {
dsp[chb] = 99;
};
};
return (okp);
}
public function game_O():void{
var _local1:int;
var _local2:int;
_local1 = 7;
while (_local1 <= 8) {
_local2 = 0;
while (_local2 < 7) {
if (mainArr[_local1][_local2] != null){
MvD();
spt = false;
if (mainArr[_local1][_local2] != null){
if (main_class.soundON == true){
S_go = new _go();
S_goChannel = S_go.play();
};
main_class.stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed);
main_class.stage.removeEventListener(KeyboardEvent.KEY_UP, key_released);
removeEventListener(Event.ENTER_FRAME, Mvb);
main_class.show_game_over();
g_o = true;
};
};
_local2++;
};
_local1++;
};
}
public function Floc(_arg1:int, _arg2:int):int{
locy = ((354 - (_arg1 * 45)) + 22.5);
locx = ((78 + (_arg2 * 45)) + 22.5);
locy;
return (locx);
}
public function add_score(_arg1):void{
m_score = (m_score + _arg1);
scchk = (scchk + _arg1);
g_score.updatescore(m_score);
}
public function MvD():void{
var _local1:int;
var _local2:int;
var _local3:int;
if (g_o == false){
_local1 = 0;
while (_local1 <= 8) {
_local2 = 0;
while (_local2 < 7) {
tmpi = -1;
if (mainArr[_local1][_local2] != null){
_local3 = 1;
while (_local3 < 9) {
tmpi = (_local1 - _local3);
if (tmpi >= 0){
if ((((mainArr[tmpi][_local2] == null)) && (!((mainArr[_local1][_local2] == null))))){
mainArr[_local1][_local2].y = (mainArr[_local1][_local2].y + 45);
mainArr[tmpi][_local2] = mainArr[_local1][_local2];
btype[((tmpi * 10) + _local2)] = btype[((_local1 * 10) + _local2)];
btype[((_local1 * 10) + _local2)] = null;
mainArr[_local1][_local2] = null;
if ((((mdwnOk == true)) && ((main_class.soundON == true)))){
mdwnOk = false;
if (mdwnChannel == null){
mdwn = new dwn();
mdwnChannel = mdwn.play();
mdwnChannel = null;
};
};
break;
};
};
_local3++;
};
};
_local2++;
};
_local1++;
};
addEventListener(Event.ENTER_FRAME, Tm_up, false, 0, true);
};
mdwnOk = true;
}
private function Mvb(_arg1:Event):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
if (escp){
if (pause_game == true){
pause_game = false;
main_class.remove_pause();
main_class.foc();
} else {
if (pause_game == false){
pause_game = true;
main_class.show_pause(this);
};
};
escp = false;
};
if ((((((pause_game == false)) && ((downOk == true)))) && (((!((mainArr[9][2] == null))) && (!((mainArr[9][3] == null))))))){
if (up){
if ((((fup == 0)) && ((mainArr[9][2].x > 78)))){
mainArr[9][2].x = (mainArr[9][2].x + 45);
mainArr[9][2].y = (mainArr[9][2].y - 46);
fup = 1;
} else {
if ((((fup == 0)) && ((mainArr[9][2].x == 78)))){
mainArr[9][2].y = (mainArr[9][2].y - 46);
mainArr[9][3].x = (mainArr[9][3].x - 45);
fup = 1;
} else {
if ((((fup == 1)) && ((mainArr[9][3].x > 78)))){
mainArr[9][3].x = (mainArr[9][3].x - 45);
mainArr[9][2].y = (mainArr[9][2].y + 46);
fup = 2;
} else {
if ((((fup == 1)) && ((mainArr[9][3].x == 78)))){
mainArr[9][2].y = (mainArr[9][2].y + 46);
mainArr[9][2].x = (mainArr[9][2].x + 45);
fup = 2;
} else {
if ((((fup == 2)) && ((mainArr[9][3].x > 78)))){
mainArr[9][3].x = (mainArr[9][3].x + 45);
mainArr[9][3].y = (mainArr[9][3].y - 46);
fup = 3;
} else {
if ((((fup == 2)) && ((mainArr[9][3].x == 78)))){
mainArr[9][2].x = (mainArr[9][2].x - 45);
mainArr[9][3].y = (mainArr[9][3].y - 46);
fup = 3;
} else {
if ((((fup == 3)) && ((mainArr[9][2].x > 78)))){
mainArr[9][2].x = (mainArr[9][2].x - 45);
mainArr[9][3].y = (mainArr[9][3].y + 46);
fup = 0;
} else {
if ((((fup == 3)) && ((mainArr[9][2].x == 78)))){
mainArr[9][3].x = (mainArr[9][3].x + 45);
mainArr[9][3].y = (mainArr[9][3].y + 46);
fup = 0;
};
};
};
};
};
};
};
};
up = false;
};
if (left){
if ((((((((mainArr[9][2].x < mainArr[9][3].x)) && ((mainArr[9][2].x > 78)))) || ((((mainArr[9][3].x < mainArr[9][2].x)) && ((mainArr[9][3].x > 78)))))) || ((((mainArr[9][3].x == mainArr[9][2].x)) && ((mainArr[9][3].x > 78)))))){
mainArr[9][2].x = (mainArr[9][2].x - 45);
mainArr[9][3].x = (mainArr[9][3].x - 45);
};
left = false;
};
if (right){
if ((((((((mainArr[9][2].x < mainArr[9][3].x)) && ((mainArr[9][3].x < 345)))) || ((((mainArr[9][3].x < mainArr[9][2].x)) && ((mainArr[9][2].x < 345)))))) || ((((mainArr[9][3].x == mainArr[9][2].x)) && ((mainArr[9][3].x < 345)))))){
mainArr[9][2].x = (mainArr[9][2].x + 45);
mainArr[9][3].x = (mainArr[9][3].x + 45);
right = false;
};
};
if (down){
ball1 = false;
ball2 = false;
if ((((downOk == true)) && ((g_o == false)))){
prevx = ((mainArr[9][2].x - 78) / 45);
prevy = ((mainArr[9][3].x - 78) / 45);
if (mainArr[9][2].y >= mainArr[9][3].y){
_local2 = 0;
while (_local2 <= 8) {
if ((((mainArr[_local2][prevx] == null)) && ((ball1 == false)))){
mainArr[_local2][prevx] = mainArr[9][2];
myTween = TweenLite.to(mainArr[_local2][prevx], ((8 - _local2) * 0.05), {y:(354 - (_local2 * 45)), onComplete:onFinishTween, onCompleteParams:[_local2, prevx, 2]});
ball1 = true;
btype[((_local2 * 10) + prevx)] = btype[92];
mainArr[9][2] = null;
break;
};
_local2++;
};
_local3 = 0;
while (_local3 <= 8) {
if ((((mainArr[_local3][prevy] == null)) && ((ball2 == false)))){
mainArr[_local3][prevy] = mainArr[9][3];
myTween2 = TweenLite.to(mainArr[_local3][prevy], ((8 - _local3) * 0.05), {y:(354 - (_local3 * 45)), onComplete:onFinishTween, onCompleteParams:[_local3, prevy, 3]});
ball2 = true;
btype[((_local3 * 10) + prevy)] = btype[93];
mainArr[9][3] = null;
break;
};
_local3++;
};
} else {
if (mainArr[9][3].y > mainArr[9][2].y){
_local3 = 0;
while (_local3 <= 8) {
if ((((mainArr[_local3][prevy] == null)) && ((ball1 == false)))){
mainArr[_local3][prevy] = mainArr[9][3];
myTween2 = TweenLite.to(mainArr[_local3][prevy], ((8 - _local3) * 0.05), {y:(354 - (_local3 * 45)), onComplete:onFinishTween, onCompleteParams:[_local3, prevy, 3]});
ball1 = true;
btype[((_local3 * 10) + prevy)] = btype[93];
mainArr[9][3] = null;
break;
};
_local3++;
};
_local2 = 0;
while (_local2 <= 8) {
if ((((mainArr[_local2][prevx] == null)) && ((ball2 == false)))){
mainArr[_local2][prevx] = mainArr[9][2];
myTween = TweenLite.to(mainArr[_local2][prevx], ((8 - _local2) * 0.05), {y:(354 - (_local2 * 45)), onComplete:onFinishTween, onCompleteParams:[_local2, prevx, 2]});
ball2 = true;
btype[((_local2 * 10) + prevx)] = btype[92];
mainArr[9][2] = null;
break;
};
_local2++;
};
};
};
if (g_o == false){
down = false;
};
};
};
if (g_o == false){
_local4 = 8;
while (_local4 >= 7) {
_local5 = 0;
while (_local5 < 7) {
if (mainArr[_local4][_local5] != null){
if (mainArr[_local4][_local5].y < 80){
if (tGo == 0){
Chk(_local4, null, _local5, null);
};
tGo = (tGo + 1);
if (tGo == 20){
tGo = 0;
game_O();
};
};
};
_local5++;
};
_local4--;
};
};
};
}
public function musi():void{
if (musChannel != null){
musChannel.stop();
musChannel = null;
};
if (main_class.musicON == true){
if (musChannel == null){
if (main_class.musVar == 1){
mus = new music();
musChannel = mus.play(0, int.MAX_VALUE);
};
if (main_class.musVar == 2){
mus_2 = new m_2();
musChannel = mus_2.play(0, int.MAX_VALUE);
};
};
} else {
if (musChannel != null){
musChannel.stop();
musChannel = null;
};
};
}
}
}//package
Section 66
//titl (titl)
package {
import flash.display.*;
public dynamic class titl extends MovieClip {
}
}//package