Section 1
//Bounce (fl.transitions.easing.Bounce)
package fl.transitions.easing {
public class Bounce {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 - easeOut((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeIn((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOut(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
}
}//package fl.transitions.easing
Section 2
//None (fl.transitions.easing.None)
package fl.transitions.easing {
public class None {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package fl.transitions.easing
Section 3
//Regular (fl.transitions.easing.Regular)
package fl.transitions.easing {
public class Regular {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _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) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
}
}//package fl.transitions.easing
Section 4
//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 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
//TweenFilterLite (gs.TweenFilterLite)
package gs {
import flash.display.*;
import flash.filters.*;
import flash.utils.*;
public class TweenFilterLite extends TweenLite {
private var _mc:DisplayObject;
private var _clrsa:Array;
private var _fType:Class;
private var _clrMtxTw:TweenLite;
public var _matrix:Array;
private var _f:BitmapFilter;
private var _endMatrix:Array;
public static var version:Number = 5.87;
private static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
public static var killTweensOf:Function = TweenLite.killTweensOf;
public static var delayedCall:Function = TweenLite.delayedCall;
private static var _lumB:Number = 0.072169;
private static var _lumG:Number = 0.71516;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _lumR:Number = 0.212671;
public function TweenFilterLite(_arg1:DisplayObject, _arg2:Number, _arg3:Object){
_fType = TweenFilterLite;
super(_arg1, _arg2, _arg3);
if (_arg1 == null){
return;
};
_mc = _arg1;
_clrsa = [];
if (this.vars.runBackwards == true){
initTweenVals();
};
if ((((TweenLite.version < 5.87)) || (isNaN(TweenLite.version)))){
trace("ERROR! Please update your TweenLite class. TweenFilterLite requires a more recent version. Download updates at http://www.TweenLite.com.");
};
}
private function setFilter(_arg1:Class, _arg2:Array, _arg3:BitmapFilter):void{
var _local4:Array;
var _local5:int;
var _local6:Number;
var _local7:String;
var _local8:Object;
var _local9:Object;
var _local10:Object;
_fType = _arg1;
_local4 = _mc.filters;
_local5 = 0;
while (_local5 < _local4.length) {
if ((_local4[_local5] is _arg1)){
_f = _local4[_local5];
break;
};
_local5++;
};
if (_f == null){
_local4.push(_arg3);
_mc.filters = _local4;
_f = _arg3;
};
_local5 = 0;
while (_local5 < _arg2.length) {
_local7 = _arg2[_local5];
if (this.tweens[_local7] != undefined){
_local8 = this.tweens[_local7];
delete this.tweens[_local7];
} else {
if (this.extraTweens[_local7] != undefined){
_local8 = this.extraTweens[_local7];
} else {
_local8 = null;
};
};
if (_local8 != null){
if ((((((((((((((_local7 == "brightness")) || ((_local7 == "colorize")))) || ((_local7 == "amount")))) || ((_local7 == "saturation")))) || ((_local7 == "contrast")))) || ((_local7 == "hue")))) || ((_local7 == "threshold")))){
} else {
if ((((((_local7 == "color")) || ((_local7 == "highlightColor")))) || ((_local7 == "shadowColor")))){
_local9 = HEXtoRGB(_f[_local7]);
_local10 = HEXtoRGB(this.vars[_local7]);
_clrsa.push({p:_local7, e:this.vars.ease, sr:_local9.rb, cr:(_local10.rb - _local9.rb), sg:_local9.gb, cg:(_local10.gb - _local9.gb), sb:_local9.bb, cb:(_local10.bb - _local9.bb)});
} else {
if ((((((((_local7 == "quality")) || ((_local7 == "inner")))) || ((_local7 == "knockout")))) || ((_local7 == "hideObject")))){
_f[_local7] = this.vars[_local7];
} else {
if (typeof(this.vars[_local7]) == "number"){
_local6 = (this.vars[_local7] - _f[_local7]);
} else {
_local6 = Number(this.vars[_local7]);
};
this.tweens[_local7] = {o:_f, p:_local7, s:_f[_local7], c:_local6, e:this.vars.ease};
};
};
};
};
_local5++;
};
}
override public function render(_arg1:uint):void{
var _local2:Number;
var _local3:Number;
var _local4:Object;
var _local5:String;
var _local6:int;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Array;
_local2 = ((_arg1 - this.startTime) / 1000);
if (_local2 > this.duration){
_local2 = this.duration;
};
_local3 = this.vars.ease(_local2, 0, 1, this.duration);
for (_local5 in this.tweens) {
_local4 = this.tweens[_local5];
_local4.o[_local5] = (_local4.s + (_local3 * _local4.c));
};
if (_mc.parent != null){
_local6 = 0;
while (_local6 < _clrsa.length) {
_local4 = _clrsa[_local6];
_local7 = (_local4.sr + (_local3 * _local4.cr));
_local8 = (_local4.sg + (_local3 * _local4.cg));
_local9 = (_local4.sb + (_local3 * _local4.cb));
_f[_local4.p] = (((_local7 << 16) | (_local8 << 8)) | _local9);
_local6++;
};
if (_endMatrix != null){
ColorMatrixFilter(_f).matrix = _matrix;
};
_local10 = _mc.filters.slice();
_local6 = (_local10.length - 1);
while (_local6 > -1) {
if ((_local10[_local6] is _fType)){
_local10[_local6] = _f;
break;
};
_local6--;
};
_mc.filters = _local10;
};
if (this.vars.onUpdate != null){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
super.complete(true);
};
}
public function HEXtoRGB(_arg1:Number):Object{
return ({rb:(_arg1 >> 16), gb:((_arg1 >> 8) & 0xFF), bb:(_arg1 & 0xFF)});
}
override public function initTweenVals():void{
var _local1:String;
var _local2:Number;
if (_mc != null){
super.initTweenVals();
if (this.vars.type != null){
_clrsa = [];
_matrix = _idMatrix.slice();
if ((((this.vars.quality == undefined)) || (isNaN(this.vars.quality)))){
this.vars.quality = 2;
};
if (this.vars.runBackwards == true){
for (_local1 in this.tweens) {
this.tweens[_local1].flipped = true;
};
};
switch (this.vars.type.toLowerCase()){
case "blur":
setFilter(BlurFilter, ["blurX", "blurY", "quality"], new BlurFilter(0, 0, this.vars.quality));
break;
case "glow":
setFilter(GlowFilter, ["alpha", "blurX", "blurY", "color", "quality", "strength", "inner", "knockout"], new GlowFilter(0xFFFFFF, 0, 0, 0, ((this.vars.strength) || (1)), this.vars.quality, this.vars.inner, this.vars.knockout));
break;
case "colormatrix":
case "color":
case "colormatrixfilter":
case "colorize":
setFilter(ColorMatrixFilter, [], new ColorMatrixFilter(_matrix));
_matrix = ColorMatrixFilter(_f).matrix;
if (this.vars.relative == true){
_endMatrix = _matrix.slice();
} else {
_endMatrix = _idMatrix.slice();
};
_endMatrix = setBrightness(_endMatrix, this.vars.brightness);
_endMatrix = setContrast(_endMatrix, this.vars.contrast);
_endMatrix = setHue(_endMatrix, this.vars.hue);
_endMatrix = setSaturation(_endMatrix, this.vars.saturation);
_endMatrix = setThreshold(_endMatrix, this.vars.threshold);
if (!isNaN(this.vars.colorize)){
_endMatrix = colorize(_endMatrix, this.vars.colorize, this.vars.amount);
} else {
if (!isNaN(this.vars.color)){
_endMatrix = colorize(_endMatrix, this.vars.color, this.vars.amount);
};
};
_local2 = (this.delay - ((getTimer() - this.initTime) / 1000));
_clrMtxTw = new TweenLite(_matrix, this.duration, {endArray:_endMatrix, ease:this.vars.ease, delay:_local2, overwrite:false, runBackwards:this.vars.runBackwards});
_clrMtxTw.endTarget = _mc;
break;
case "shadow":
case "dropshadow":
setFilter(DropShadowFilter, ["alpha", "angle", "blurX", "blurY", "color", "distance", "quality", "strength", "inner", "knockout", "hideObject"], new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, this.vars.quality, this.vars.inner, this.vars.knockout, this.vars.hideObject));
break;
case "bevel":
setFilter(BevelFilter, ["angle", "blurX", "blurY", "distance", "highlightAlpha", "highlightColor", "quality", "shadowAlpha", "shadowColor", "strength"], new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, this.vars.quality));
break;
};
if (this.vars.runBackwards == true){
flipFilterVals();
};
};
};
}
private function flipFilterVals():void{
var _local1:Boolean;
var _local2:int;
var _local3:Object;
var _local4:String;
var _local5:Array;
_local1 = this.active;
for (_local4 in this.tweens) {
if (this.tweens[_local4].flipped != true){
_local3 = this.tweens[_local4];
_local3.s = (_local3.s + _local3.c);
_local3.c = (_local3.c * -1);
_local3.o[_local4] = _local3.s;
_local3.flipped = true;
};
};
_local2 = 0;
while (_local2 < _clrsa.length) {
_local3 = _clrsa[_local2];
_local3.sr = (_local3.sr + _local3.cr);
_local3.cr = (_local3.cr * -1);
_local3.sg = (_local3.sg + _local3.cg);
_local3.cg = (_local3.cg * -1);
_local3.sb = (_local3.sb + _local3.cb);
_local3.cb = (_local3.cb * -1);
if (!_local1){
_f[_local3.p] = (((_local3.sr << 16) | (_local3.sg << 8)) | _local3.sb);
};
_local2++;
};
if (((_local1) && (!((this.duration == 0.001))))){
render(getTimer());
} else {
if (((!((_mc.parent == null))) && (!((_fType == null))))){
if (_endMatrix != null){
ColorMatrixFilter(_f).matrix = _matrix;
};
_local5 = _mc.filters.slice();
_local2 = (_local5.length - 1);
while (_local2 > -1) {
if ((_local5[_local2] is _fType)){
_local5[_local2] = _f;
break;
};
_local2--;
};
_mc.filters = _local5;
};
};
if (this.vars.onUpdate != null){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
}
public static function setContrast(_arg1:Array, _arg2:Number):Array{
var _local3:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 + 0.01);
_local3 = [_arg2, 0, 0, 0, (128 * (1 - _arg2)), 0, _arg2, 0, 0, (128 * (1 - _arg2)), 0, 0, _arg2, 0, (128 * (1 - _arg2)), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function applyMatrix(_arg1:Array, _arg2:Array):Array{
var _local3:Array;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (_arg2);
};
_local3 = [];
_local4 = 0;
_local5 = 0;
_local6 = 0;
while (_local6 < 4) {
_local7 = 0;
while (_local7 < 5) {
if (_local7 == 4){
_local5 = _arg1[(_local4 + 4)];
} else {
_local5 = 0;
};
_local3[(_local4 + _local7)] = (((((_arg1[_local4] * _arg2[_local7]) + (_arg1[(_local4 + 1)] * _arg2[(_local7 + 5)])) + (_arg1[(_local4 + 2)] * _arg2[(_local7 + 10)])) + (_arg1[(_local4 + 3)] * _arg2[(_local7 + 15)])) + _local5);
_local7++;
};
_local4 = (_local4 + 5);
_local6++;
};
return (_local3);
}
public static function colorize(_arg1:Array, _arg2:Number, _arg3:Number=100):Array{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Array;
if (isNaN(_arg2)){
return (_arg1);
};
if (isNaN(_arg3)){
_arg3 = 1;
};
_local4 = (((_arg2 >> 16) & 0xFF) / 0xFF);
_local5 = (((_arg2 >> 8) & 0xFF) / 0xFF);
_local6 = ((_arg2 & 0xFF) / 0xFF);
_local7 = (1 - _arg3);
_local8 = [(_local7 + ((_arg3 * _local4) * _lumR)), ((_arg3 * _local4) * _lumG), ((_arg3 * _local4) * _lumB), 0, 0, ((_arg3 * _local5) * _lumR), (_local7 + ((_arg3 * _local5) * _lumG)), ((_arg3 * _local5) * _lumB), 0, 0, ((_arg3 * _local6) * _lumR), ((_arg3 * _local6) * _lumG), (_local7 + ((_arg3 * _local6) * _lumB)), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local8, _arg1));
}
public static function setBrightness(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = ((_arg2 * 100) - 100);
return (applyMatrix([1, 0, 0, 0, _arg2, 0, 1, 0, 0, _arg2, 0, 0, 1, 0, _arg2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], _arg1));
}
public static function setSaturation(_arg1:Array, _arg2:Number):Array{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_local3 = (1 - _arg2);
_local4 = (_local3 * _lumR);
_local5 = (_local3 * _lumG);
_local6 = (_local3 * _lumB);
_local7 = [(_local4 + _arg2), _local5, _local6, 0, 0, _local4, (_local5 + _arg2), _local6, 0, 0, _local4, _local5, (_local6 + _arg2), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local7, _arg1));
}
public static function from(_arg1:DisplayObject, _arg2:Number, _arg3:Object):TweenFilterLite{
_arg3.runBackwards = true;
return (new TweenFilterLite(_arg1, _arg2, _arg3));
}
public static function setThreshold(_arg1:Array, _arg2:Number):Array{
var _local3:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_local3 = [(_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function setHue(_arg1:Array, _arg2:Number):Array{
var _local3:Number;
var _local4:Number;
var _local5:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 * (Math.PI / 180));
_local3 = Math.cos(_arg2);
_local4 = Math.sin(_arg2);
_local5 = [((_lumR + (_local3 * (1 - _lumR))) + (_local4 * -(_lumR))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * -(_lumG))), ((_lumB + (_local3 * -(_lumB))) + (_local4 * (1 - _lumB))), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * 0.143)), ((_lumG + (_local3 * (1 - _lumG))) + (_local4 * 0.14)), ((_lumB + (_local3 * -(_lumB))) + (_local4 * -0.283)), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * -((1 - _lumR)))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * _lumG)), ((_lumB + (_local3 * (1 - _lumB))) + (_local4 * _lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return (applyMatrix(_local5, _arg1));
}
public static function to(_arg1:DisplayObject, _arg2:Number, _arg3:Object):TweenFilterLite{
return (new TweenFilterLite(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 8
//TweenLite (gs.TweenLite)
package gs {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.geom.*;
import flash.utils.*;
public class TweenLite {
public var delay:Number;
protected var _endTarget:Object;
private var _sound:SoundTransform;
public var target:Object;
public var duration:Number;
public var startTime:uint;
public var extraTweens:Object;
protected var _color:ColorTransform;
protected var _active:Boolean;
protected var _endColor:ColorTransform;
public var vars:Object;
public var tweens:Object;
public var initTime:uint;
private static var _sprite:Sprite = new Sprite();
private static var _timer:Timer = new Timer(2000);
protected static var _all:Dictionary = new Dictionary();
public static var killDelayedCallsTo:Function = killTweensOf;
public static var version:Number = 5.87;
private static var _listening:Boolean;
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
if (_arg1 == null){
return;
};
if (((((!((_arg3.overwrite == false))) && (!((_arg1 == null))))) || ((_all[_arg1] == undefined)))){
delete _all[_arg1];
_all[_arg1] = new Dictionary();
};
_all[_arg1][this] = this;
this.vars = _arg3;
this.duration = _arg2;
this.delay = ((_arg3.delay) || (0));
if (_arg2 == 0){
this.duration = 0.001;
if (this.delay == 0){
this.vars.runBackwards = true;
};
};
this.target = (_endTarget = _arg1);
if (!(this.vars.ease is Function)){
this.vars.ease = easeOut;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
if (this.vars.mcColor != null){
this.vars.tint = this.vars.mcColor;
};
if (!isNaN(Number(this.vars.autoAlpha))){
this.vars.alpha = Number(this.vars.autoAlpha);
};
this.tweens = {};
this.extraTweens = {};
this.initTime = getTimer();
if (this.vars.runBackwards == true){
initTweenVals();
};
_active = false;
if ((((_arg2 == 0)) && ((this.delay == 0)))){
complete(true);
} else {
if (!_listening){
_sprite.addEventListener(Event.ENTER_FRAME, executeAll);
_timer.addEventListener("timer", killGarbage);
_timer.start();
_listening = true;
};
};
}
public function set endTarget(_arg1:Object):void{
if ((((this.duration == 0.001)) && ((this.delay <= 0)))){
removeTween(this);
} else {
delete _all[_endTarget][this];
_endTarget = _arg1;
if (_all[_arg1] == undefined){
_all[_arg1] = new Dictionary();
};
_all[_arg1][this] = this;
};
}
public function get colorProxy():Number{
return (0);
}
public function get endTarget():Object{
return (_endTarget);
}
public function get active():Boolean{
if (_active){
return (true);
};
if (((getTimer() - this.initTime) / 1000) > this.delay){
_active = true;
this.startTime = (this.initTime + (this.delay * 1000));
if (this.vars.runBackwards != true){
initTweenVals();
} else {
if (typeof(this.vars.autoAlpha) == "number"){
this.target.visible = true;
};
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
return (true);
//unresolved jump
};
return (false);
}
public function initTweenVals():void{
var _local1:Number;
var _local2:String;
var _local3:Number;
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
var _local7:TweenLite;
var _local8:Object;
_local1 = (this.delay - ((getTimer() - this.initTime) / 1000));
if ((this.target is Array)){
_local4 = ((this.vars.endArray) || ([]));
_local5 = 0;
while (_local5 < _local4.length) {
if (((!((this.target[_local5] == _local4[_local5]))) && (!((this.target[_local5] == undefined))))){
this.tweens[_local5.toString()] = {o:this.target, s:this.target[_local5], c:(_local4[_local5] - this.target[_local5])};
};
_local5++;
};
} else {
for (_local2 in this.vars) {
if ((((((((((((((((((((((((((((_local2 == "delay")) || ((_local2 == "ease")))) || ((_local2 == "overwrite")))) || ((_local2 == "onComplete")))) || ((_local2 == "onCompleteParams")))) || ((_local2 == "runBackwards")))) || ((_local2 == "onUpdate")))) || ((_local2 == "onUpdateParams")))) || ((_local2 == "autoAlpha")))) || ((_local2 == "onStart")))) || ((_local2 == "onStartParams")))) || ((_local2 == "easeParams")))) || ((_local2 == "mcColor")))) || ((_local2 == "type")))){
} else {
if ((((_local2 == "tint")) && ((this.target is DisplayObject)))){
_color = this.target.transform.colorTransform;
_endColor = new ColorTransform();
if (this.vars.alpha != undefined){
_endColor.alphaMultiplier = this.vars.alpha;
delete this.vars.alpha;
delete this.tweens.alpha;
} else {
_endColor.alphaMultiplier = this.target.alpha;
};
if (((!((this.vars[_local2] == null))) && (!((this.vars[_local2] == ""))))){
_endColor.color = this.vars[_local2];
};
_local6 = new TweenLite(this, this.duration, {colorProxy:1, delay:_local1, overwrite:false, ease:this.vars.ease, runBackwards:this.vars.runBackwards});
_local6.endTarget = this.target;
} else {
if ((((_local2 == "volume")) && ((this.target is MovieClip)))){
_sound = this.target.soundTransform;
_local7 = new TweenLite(this, this.duration, {volumeProxy:this.vars[_local2], ease:easeOut, delay:_local1, overwrite:false, runBackwards:this.vars.runBackwards});
_local7.endTarget = this.target;
} else {
if (this.target.hasOwnProperty(_local2)){
if (typeof(this.vars[_local2]) == "number"){
_local3 = (this.vars[_local2] - this.target[_local2]);
} else {
_local3 = Number(this.vars[_local2]);
};
this.tweens[_local2] = {o:this.target, s:this.target[_local2], c:_local3};
} else {
this.extraTweens[_local2] = {o:this.target, s:0, c:0, v:this.vars[_local2]};
};
};
};
};
};
};
if (this.vars.runBackwards == true){
for (_local2 in this.tweens) {
_local8 = this.tweens[_local2];
this.tweens[_local2].s = (_local8.s + _local8.c);
_local8.c = (_local8.c * -1);
_local8.o[_local2] = _local8.s;
};
if (this.vars.onUpdate != null){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
};
if (typeof(this.vars.autoAlpha) == "number"){
this.target.visible = !((((this.vars.runBackwards == true)) && ((this.target.alpha == 0))));
};
}
public function render(_arg1:uint):void{
var _local2:Number;
var _local3:Number;
var _local4:Object;
var _local5:String;
_local2 = ((_arg1 - this.startTime) / 1000);
if (_local2 > this.duration){
_local2 = this.duration;
};
_local3 = this.vars.ease(_local2, 0, 1, this.duration);
for (_local5 in this.tweens) {
_local4 = this.tweens[_local5];
_local4.o[_local5] = (_local4.s + (_local3 * _local4.c));
};
if (this.vars.onUpdate != null){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
public function set colorProxy(_arg1:Number):void{
var _local2:Number;
_local2 = (1 - _arg1);
this.target.transform.colorTransform = new ColorTransform(((_color.redMultiplier * _local2) + (_endColor.redMultiplier * _arg1)), ((_color.greenMultiplier * _local2) + (_endColor.greenMultiplier * _arg1)), ((_color.blueMultiplier * _local2) + (_endColor.blueMultiplier * _arg1)), ((_color.alphaMultiplier * _local2) + (_endColor.alphaMultiplier * _arg1)), ((_color.redOffset * _local2) + (_endColor.redOffset * _arg1)), ((_color.greenOffset * _local2) + (_endColor.greenOffset * _arg1)), ((_color.blueOffset * _local2) + (_endColor.blueOffset * _arg1)), ((_color.alphaOffset * _local2) + (_endColor.alphaOffset * _arg1)));
}
public function get volumeProxy():Number{
return (_sound.volume);
}
public function set volumeProxy(_arg1:Number):void{
_sound.volume = _arg1;
this.target.soundTransform = _sound;
}
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 complete(_arg1:Boolean=false):void{
if (!_arg1){
this.startTime = 0;
render((this.duration * 1000));
return;
};
if ((((typeof(this.vars.autoAlpha) == "number")) && ((this.target.alpha == 0)))){
this.target.visible = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
removeTween(this);
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, overwrite:false}));
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function removeTween(_arg1:TweenLite=null):void{
if (((!((_arg1 == null))) && (!((_all[_arg1.endTarget] == undefined))))){
delete _all[_arg1.endTarget][_arg1];
};
}
protected static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function killGarbage(_arg1:TimerEvent):void{
var _local2:Object;
var _local3:uint;
var _local4:Boolean;
var _local5:Object;
var _local6:Object;
var _local7:Object;
_local2 = _all;
_local3 = 0;
for (_local5 in _local2) {
_local4 = false;
for (_local6 in _local2[_local5]) {
_local4 = true;
break;
};
if (!_local4){
delete _local2[_local5];
} else {
_local3++;
};
};
if (_local3 == 0){
_sprite.removeEventListener(Event.ENTER_FRAME, executeAll);
_timer.removeEventListener("timer", killGarbage);
_timer.stop();
_listening = false;
};
}
public static function executeAll(_arg1:Event):void{
var _local2:Object;
var _local3:uint;
var _local4:Object;
var _local5:Object;
_local2 = _all;
_local3 = getTimer();
for (_local4 in _local2) {
for (_local5 in _local2[_local4]) {
if (((!((_local2[_local4][_local5] == undefined))) && (_local2[_local4][_local5].active))){
_local2[_local4][_local5].render(_local3);
if (_local2[_local4] == undefined){
break;
};
};
};
};
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Object;
var _local4:*;
if (((!((_arg1 == null))) && (!((_all[_arg1] == undefined))))){
if (_arg2){
_local3 = _all[_arg1];
for (_local4 in _local3) {
_local3[_local4].complete(false);
};
};
delete _all[_arg1];
};
}
}
}//package gs
Section 9
//MochiScores (mochi.MochiScores)
package mochi {
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 options = _arg1;
if (options != null){
if (options.clip != null){
if ((options.clip is Sprite)){
MochiServices.setContainer(options.clip);
};
delete options.clip;
} else {
MochiServices.setContainer();
};
MochiServices.stayOnTop();
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;
};
};
};
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.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{
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (_arg1 != null){
if (_arg1.error != null){
if (_arg1.error == true){
if (onErrorHandler != null){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
};
};
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi
Section 10
//MochiServices (mochi.MochiServices)
package mochi {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
private static var _sendChannel:LocalConnection;
private static var _rcvChannelName:String;
private static var _gatewayURL:String = "http://www.mochiads.com/static/lib/services/services.swf";
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _id:String;
private static var _listenChannel:LocalConnection;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _startTime:Number;
private static var _connecting:Boolean = false;
public static var onError:Object;
private static var _listenChannelName:String = "__mochiservices";
private static var _rcvChannel:LocalConnection;
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_sendChannel.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
onError("NotConnected");
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_clip._nextcallbackID++;
};
};
}
public static function get connected():Boolean{
return (_connected);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (_clip != null){
if (_clip._queue != null){
while (_clip._queue.length > 0) {
_local2 = _clip._queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _clip._callbacks[_local2.callbackID];
};
delete _clip._callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
};
}
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);
}
public static function get id():String{
return (_id);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function getVersion():String{
return ("1.31");
}
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 {
_listenChannel.close();
_rcvChannel.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
Security.allowDomain("*");
Security.allowInsecureDomain("*");
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
return (_local2);
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
if (_clip.parent != null){
Sprite(_clip.parent).removeChild(_clip);
};
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_arg1 != null){
if ((_arg1 is Sprite)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function onStatus(_arg1:StatusEvent):void{
switch (_arg1.level){
case "error":
_connected = false;
_listenChannel.connect(_listenChannelName);
break;
};
}
private static function initComChannels():void{
if (!_connected){
_sendChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_container, version:getVersion()});
_rcvChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_clip.onReceive = function (_arg1:Object):void{
var cb:String;
var cblst:Object;
var method:*;
var methodName:String;
var obj:Object;
var pkg = _arg1;
cb = pkg.callbackID;
cblst = this.client._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 this.client._callbacks[cb];
};
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
_rcvChannel.connect(_rcvChannelName);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
while (_clip._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function listen():void{
_listenChannel = new LocalConnection();
_listenChannel.client = _clip;
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
_listenChannel.allowDomain("*", "localhost");
_listenChannel.allowInsecureDomain("*", "localhost");
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
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 (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) {
};
};
};
};
}
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");
_rcvChannelName = _arg1;
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var clipname:String;
var f:Function;
var req:URLRequest;
var id = _arg1;
var clip = _arg2;
clipname = ("_mochiservices_com_" + id);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
MochiServices.allowDomains(_gatewayURL);
_clip = createEmptyMovieClip(clip, clipname, 10336, false);
_loader = new Loader();
_timer = new Timer(1000, 0);
_startTime = getTimer();
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
f = function (_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
req = new URLRequest(_gatewayURL);
_loader.load(req);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain("*", "localhost");
_rcvChannel.allowInsecureDomain("*", "localhost");
_rcvChannel.client = _clip;
_clip._nextcallbackID = 0;
_clip._callbacks = {};
listen();
return (_clip);
}
public static function bringToTop(_arg1:Event):void{
var e = _arg1;
if (MochiServices.clip != null){
if (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 connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
if ((clip is DisplayObject)){
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{
var mc:MovieClip;
var parent = _arg1;
var name = _arg2;
var depth = _arg3;
var doAdd = _arg4;
mc = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
try {
parent[name] = mc;
} catch(e:Error) {
throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
mc["_name"] = name;
return (mc);
}
public static function connectWait(_arg1:TimerEvent):void{
if ((getTimer() - _startTime) > 10000){
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_timer.stop();
};
}
}
}//package mochi
Section 11
//GameModeSelection_11 (Snaketastic_fla.GameModeSelection_11)
package Snaketastic_fla {
import flash.display.*;
public dynamic class GameModeSelection_11 extends MovieClip {
public var Keys:MovieClip;
public var BG:MovieClip;
public var Texts:MovieClip;
}
}//package Snaketastic_fla
Section 12
//GameModeSelection_22 (Snaketastic_fla.GameModeSelection_22)
package Snaketastic_fla {
import flash.display.*;
public dynamic class GameModeSelection_22 extends MovieClip {
public var Keys:MovieClip;
public var BG:MovieClip;
public var Texts:MovieClip;
}
}//package Snaketastic_fla
Section 13
//ScoreBox_63 (Snaketastic_fla.ScoreBox_63)
package Snaketastic_fla {
import flash.display.*;
import flash.text.*;
public dynamic class ScoreBox_63 extends MovieClip {
public var BG:MovieClip;
public var TXTText:TextField;
}
}//package Snaketastic_fla
Section 14
//Snake_48 (Snaketastic_fla.Snake_48)
package Snaketastic_fla {
import flash.display.*;
public dynamic class Snake_48 extends MovieClip {
public function Snake_48(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Snaketastic_fla
Section 15
//AchievementAwardedText (AchievementAwardedText)
package {
import flash.display.*;
import flash.text.*;
public dynamic class AchievementAwardedText extends MovieClip {
public var txtTitle:TextField;
}
}//package
Section 16
//Banana (Banana)
package {
import flash.display.*;
public class Banana extends Fruit {
public var Gfx:MovieClip;
public function Banana(){
BasePoints = 30000;
}
}
}//package
Section 17
//BGImage (BGImage)
package {
import flash.display.*;
public dynamic class BGImage extends BitmapData {
public function BGImage(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 18
//Cherries (Cherries)
package {
import flash.display.*;
public class Cherries extends Fruit {
public var Gfx:MovieClip;
public function Cherries(){
BasePoints = 10000;
}
}
}//package
Section 19
//CInfoBar (CInfoBar)
package {
import flash.events.*;
import flash.display.*;
import fl.transitions.easing.*;
public class CInfoBar extends Sprite {
private var PixelNumbers:Array;
var Digits:Sprite;
public function CInfoBar(){
PixelNumbers = new Array(["111", "101", "101", "101", "111"], ["010", "110", "010", "010", "111"], ["110", "001", "010", "100", "111"], ["111", "001", "011", "001", "111"], ["001", "011", "101", "111", "001"], ["111", "100", "110", "001", "110"], ["111", "100", "111", "101", "111"], ["111", "001", "010", "010", "010"], ["111", "101", "111", "101", "111"], ["111", "101", "111", "001", "111"]);
super();
}
public function elScoreUpdated(_arg1:Event=null){
var _local2:String;
var _local3:uint;
var _local4:Sprite;
var _local5:uint;
var _local6:*;
var _local7:*;
if (_arg1 == null){
_local2 = "00000000";
} else {
_local2 = _arg1.target.Score.toString();
_local3 = _local2.length;
while (_local3 < 8) {
_local2 = ("0" + _local2);
_local3++;
};
};
if (((Digits) && (contains(Digits)))){
removeChild(Digits);
};
Digits = new Sprite();
_local3 = 0;
while (_local3 < _local2.length) {
_local4 = new Sprite();
_local5 = uint(_local2.charAt(_local3));
_local4.x = (_local3 * 40);
_local4.graphics.beginFill(0, 0.1);
_local6 = 0;
while (_local6 < PixelNumbers[_local5].length) {
_local7 = 0;
while (_local7 < PixelNumbers[_local5].length) {
if (PixelNumbers[_local5][_local6].charAt(_local7) == "1"){
_local4.graphics.drawRect((_local7 * 10), (_local6 * 10), 10, 10);
};
_local7++;
};
_local6++;
};
_local4.graphics.endFill();
Digits.addChild(_local4);
_local3++;
};
Digits.x = (7 * 10);
Digits.y = (19 * 10);
addChild(Digits);
}
public function elGameStarted(_arg1:Event){
elScoreUpdated();
}
}
}//package
Section 20
//CLeaderboardHeader (CLeaderboardHeader)
package {
import flash.display.*;
public dynamic class CLeaderboardHeader extends MovieClip {
}
}//package
Section 21
//CMainMenuItemText (CMainMenuItemText)
package {
import flash.display.*;
import flash.text.*;
public dynamic class CMainMenuItemText extends MovieClip {
public var TXTText:TextField;
}
}//package
Section 22
//CPellet (CPellet)
package {
import flash.events.*;
import flash.display.*;
public class CPellet extends Food {
var Gfx:Sprite;
public function CPellet(){
BasePoints = 100;
Gfx = new Sprite();
Gfx.graphics.lineStyle(1, 0x555555);
Gfx.graphics.beginFill(0);
Gfx.graphics.drawCircle(0, 0, 4);
Gfx.graphics.endFill();
addChild(Gfx);
addEventListener(Event.ADDED_TO_STAGE, elAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, elRemovedFromStage);
}
private function elAddedToStage(_arg1:Event){
addEventListener(Event.ENTER_FRAME, elEnterFrame);
}
private function elEnterFrame(_arg1:Event){
}
private function elRemovedFromStage(_arg1:Event){
}
}
}//package
Section 23
//CSnake (CSnake)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.ui.*;
public class CSnake extends Sprite {
public var Length:int;
private var MovementDelay:uint;
private var Direction:Number;
public var Gfx:Sprite;
private var MovementTimer:Timer;
public var Parts:Array;
public var Movement:Array;
private var DirectionQueue:Array;
public function CSnake(){
Key.initialize(stage);
Length = 5;
Direction = 0;
MovementDelay = 60;
Movement = new Array();
Parts = new Array();
addEventListener(Event.ADDED_TO_STAGE, elAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, elRemovedFromStage);
Gfx = new Sprite();
Gfx.graphics.beginFill(0);
Gfx.graphics.drawRect(-4.5, -4.5, 9, 9);
Gfx.graphics.endFill();
addChild(Gfx);
addEventListener("SnakeHitWall", elHitWall);
}
public function SetMovementDelay(_arg1:uint){
MovementDelay = _arg1;
MovementTimer.removeEventListener(TimerEvent.TIMER, Move);
MovementTimer = new Timer(MovementDelay);
MovementTimer.addEventListener(TimerEvent.TIMER, Move);
MovementTimer.start();
}
public function elFoodWasEaten(_arg1:Event){
var _local2:*;
_local2 = _arg1.target;
if ((_local2 is CPellet)){
Length = (Length + 3);
};
}
private function elAddedToStage(_arg1:Event){
stage.addEventListener(KeyboardEvent.KEY_DOWN, elKeyDown);
DirectionQueue = new Array();
MovementTimer = new Timer(MovementDelay);
MovementTimer.addEventListener(TimerEvent.TIMER, Move);
MovementTimer.start();
}
public function elHitWall(_arg1:Event){
Immobilize();
}
public function Immobilize(_arg1:Event=null){
if (stage){
stage.removeEventListener(KeyboardEvent.KEY_DOWN, elKeyDown);
};
if (MovementTimer){
MovementTimer.removeEventListener(TimerEvent.TIMER, Move);
};
}
public function Mobilize(_arg1:Event=null){
stage.addEventListener(KeyboardEvent.KEY_DOWN, elKeyDown);
if (MovementTimer){
MovementTimer.addEventListener(TimerEvent.TIMER, Move);
};
}
private function elRemovedFromStage(_arg1:Event){
MovementTimer.removeEventListener(TimerEvent.TIMER, Move);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, elKeyDown);
}
private function Move(_arg1:TimerEvent){
var _local2:CSnakePart;
if (DirectionQueue.length > 0){
Direction = DirectionQueue[0];
DirectionQueue.shift();
};
x = (x + (int(Math.cos(((Direction / 180) * Math.PI))) * 10));
y = (y + (int(Math.sin(((Direction / 180) * Math.PI))) * 10));
Movement.push({X:x, Y:y});
if (Movement.length > 1){
_local2 = new CSnakePart();
_local2.x = Movement[(Movement.length - 2)].X;
_local2.y = Movement[(Movement.length - 2)].Y;
Parts.push(_local2);
GameMode(Snaketastic.CurrentGameHolder).SnakePartsHolder.addChild(_local2);
if (Movement.length > Length){
Parts[0].Remove();
Parts.shift();
Movement.shift();
};
if ((((((((x > 440)) || ((x < 10)))) || ((y < 10)))) || ((y > 440)))){
dispatchEvent(new Event("SnakeHitWall"));
};
};
}
private function elKeyDown(_arg1:KeyboardEvent){
if (_arg1.keyCode == Keyboard.LEFT){
DirectionQueue.push(180);
} else {
if (_arg1.keyCode == Keyboard.RIGHT){
DirectionQueue.push(0);
} else {
if (_arg1.keyCode == Keyboard.UP){
DirectionQueue.push(270);
} else {
if (_arg1.keyCode == Keyboard.DOWN){
DirectionQueue.push(90);
};
};
};
};
}
}
}//package
Section 24
//CSnakePart (CSnakePart)
package {
import flash.events.*;
import flash.display.*;
import fl.transitions.*;
public class CSnakePart extends MovieClip {
var XSTween:Tween;
var YSTween:Tween;
var Gfx:Sprite;
public function CSnakePart(){
Gfx = new Sprite();
Gfx.graphics.beginFill(0);
Gfx.graphics.drawRect(-4.5, -4.5, 9, 9);
Gfx.graphics.endFill();
addChild(Gfx);
addEventListener(Event.ADDED_TO_STAGE, elAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, elRemovedFromStage);
}
private function RemoveFromStage(){
parent.removeChild(this);
}
private function elAddedToStage(_arg1:Event){
addEventListener(Event.ENTER_FRAME, elEnterFrame);
}
private function elEnterFrame(_arg1:Event){
}
public function Remove(){
RemoveFromStage();
}
private function elRemovedFromStage(_arg1:Event){
removeEventListener(Event.ADDED_TO_STAGE, elAddedToStage);
removeEventListener(Event.REMOVED_FROM_STAGE, elRemovedFromStage);
removeEventListener(Event.ENTER_FRAME, elEnterFrame);
}
}
}//package
Section 25
//DialogBox (DialogBox)
package {
import gs.*;
import flash.events.*;
import flash.display.*;
import flash.filters.*;
import fl.transitions.easing.*;
import flash.text.*;
import flash.ui.*;
public class DialogBox extends Sprite {
var Responses:Array;
var Title:String;
var BG:Sprite;
var HighlightedButton:DialogBoxButton;
var Buttons:Sprite;
var Content:Sprite;
var OnCancel:Function;
var HighlightedButtonIndex:uint;
var ButtonSprites:Array;
public function DialogBox(_arg1:String, _arg2:Array, _arg3:Function=null){
var _local4:uint;
var _local5:DialogBoxTitle;
var _local6:DialogBoxButton;
var _local7:Sprite;
var _local8:Sprite;
super();
Title = _arg1;
Responses = _arg2;
OnCancel = _arg3;
addEventListener(Event.ADDED_TO_STAGE, elAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, elRemovedFromStage);
Content = new Sprite();
Buttons = new Sprite();
ButtonSprites = new Array();
_local4 = 0;
while (_local4 < Responses.length) {
_local6 = new DialogBoxButton();
_local6.TXTText.text = Responses[_local4].Text;
_local6.TXTText.autoSize = TextFieldAutoSize.LEFT;
_local7 = new Sprite();
_local7.graphics.beginFill(0);
_local7.graphics.drawRoundRect(-8, -5, (_local6.TXTText.width + 16), (_local6.TXTText.height + 10), 0);
_local7.graphics.endFill();
_local6.OnSelect = Responses[_local4].OnSelect;
_local6.OnSelectParams = Responses[_local4].OnSelectParams;
_local6.addChildAt(_local7, 0);
_local8 = ButtonSprites[(ButtonSprites.length - 1)];
if (_local4 > 0){
_local6.x = ((_local8.x + _local8.width) + 10);
};
ButtonSprites.push(_local6);
Buttons.addChild(_local6);
TweenFilterLite.to(_local6, 0, {colorMatrixFilter:{brightness:0.05}});
_local4++;
};
_local5 = new DialogBoxTitle();
_local5.TXTText.text = Title;
_local5.TXTText.autoSize = TextFieldAutoSize.LEFT;
Content.addChild(_local5);
Buttons.x = ((_local5.x + _local5.width) + 20);
Content.addChild(Buttons);
BG = new Sprite();
BG.graphics.beginFill(0, 0.8);
BG.graphics.drawRect(-10, -15, (Content.width + 20), (Content.height + 20));
BG.graphics.endFill();
addChild(BG);
HighlightedButtonIndex = 0;
HighlightedButton = ButtonSprites[HighlightedButtonIndex];
TweenFilterLite.to(HighlightedButton, 0, {colorMatrixFilter:{brightness:1}});
addChild(Content);
}
private function RemoveFromStage(){
parent.removeChild(this);
}
private function elAddedToStage(_arg1:Event){
stage.addEventListener(KeyboardEvent.KEY_DOWN, elKeyDown);
}
private function elRemovedFromStage(_arg1:Event){
removeEventListener(Event.ADDED_TO_STAGE, elAddedToStage);
removeEventListener(Event.REMOVED_FROM_STAGE, elRemovedFromStage);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, elKeyDown);
}
private function elKeyDown(_arg1:KeyboardEvent){
var _local2:GlowFilter;
if (_arg1.keyCode == Keyboard.LEFT){
if (HighlightedButtonIndex > 0){
TweenFilterLite.to(HighlightedButton, 0, {colorMatrixFilter:{brightness:0.05}});
HighlightedButtonIndex--;
HighlightedButton = ButtonSprites[HighlightedButtonIndex];
TweenFilterLite.to(HighlightedButton, 0, {colorMatrixFilter:{brightness:1}});
};
} else {
if (_arg1.keyCode == Keyboard.RIGHT){
if (HighlightedButtonIndex < (ButtonSprites.length - 1)){
TweenFilterLite.to(HighlightedButton, 0, {colorMatrixFilter:{brightness:0.05}});
HighlightedButtonIndex++;
HighlightedButton = ButtonSprites[HighlightedButtonIndex];
TweenFilterLite.to(HighlightedButton, 0, {colorMatrixFilter:{brightness:1}});
};
} else {
if (_arg1.keyCode == Keyboard.ENTER){
RemoveFromStage();
if (HighlightedButton.OnSelect){
if (HighlightedButton.OnSelectParams != null){
HighlightedButton.OnSelect(HighlightedButton.OnSelectParams);
} else {
HighlightedButton.OnSelect();
};
};
} else {
if (_arg1.keyCode == Keyboard.ESCAPE){
if (OnCancel != null){
RemoveFromStage();
OnCancel();
};
};
};
};
};
}
}
}//package
Section 26
//DialogBoxButton (DialogBoxButton)
package {
import flash.display.*;
import flash.text.*;
public dynamic class DialogBoxButton extends MovieClip {
public var TXTText:TextField;
}
}//package
Section 27
//DialogBoxTitle (DialogBoxTitle)
package {
import flash.display.*;
import flash.text.*;
public dynamic class DialogBoxTitle extends MovieClip {
public var TXTText:TextField;
}
}//package
Section 28
//Food (Food)
package {
import flash.events.*;
import flash.display.*;
public class Food extends Sprite {
var BasePoints:int;
public function Food(){
addEventListener(Event.ADDED_TO_STAGE, elAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, elRemovedFromStage);
}
private function elAddedToStage(_arg1:Event){
Mobilize();
}
public function Mobilize(){
addEventListener(Event.ENTER_FRAME, elEnterFrame);
}
private function elEnterFrame(_arg1:Event){
if ((((((((x < -100)) || ((x > (stage.stageWidth + 100))))) || ((y < -100)))) || ((y > (stage.stageHeight + 100))))){
dispatchEvent(new Event("FoodLeftStage"));
parent.removeChild(this);
};
}
public function Immobilize(){
removeEventListener(Event.ENTER_FRAME, elEnterFrame);
}
public function Remove(){
this.dispatchEvent(new Event("FoodWasEaten"));
parent.removeChild(this);
}
private function elRemovedFromStage(_arg1:Event){
removeEventListener(Event.ADDED_TO_STAGE, elAddedToStage);
removeEventListener(Event.REMOVED_FROM_STAGE, elRemovedFromStage);
removeEventListener(Event.ENTER_FRAME, elEnterFrame);
}
}
}//package
Section 29
//Fruit (Fruit)
package {
import flash.events.*;
public class Fruit extends Food {
var RotationIterator:Number;
var Speed:int;
var Direction:int;
public function Fruit(){
RotationIterator = 0;
Speed = 2;
addEventListener(Event.ADDED_TO_STAGE, elAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, elRemovedFromStage);
}
private function elAddedToStage(_arg1:Event){
var _local2:uint;
_local2 = Math.floor((Math.random() * 4));
switch (_local2){
case 0:
x = stage.stageWidth;
y = ((Math.random() * (stage.stageHeight - 60)) + 30);
Direction = 180;
break;
case 1:
x = ((Math.random() * (stage.stageWidth - 60)) + 30);
y = stage.stageHeight;
Direction = 270;
break;
case 2:
x = 0;
y = ((Math.random() * (stage.stageHeight - 60)) + 30);
Direction = 0;
break;
case 3:
x = ((Math.random() * (stage.stageWidth - 60)) + 30);
y = 0;
Direction = 90;
break;
};
addEventListener(Event.ENTER_FRAME, elEnterFrame);
}
override public function Mobilize(){
addEventListener(Event.ENTER_FRAME, elEnterFrame);
}
private function elEnterFrame(_arg1:Event){
RotationIterator = (RotationIterator + 0.5);
rotation = (Math.sin(RotationIterator) * 10);
x = (x + (Math.cos(((Direction / 180) * Math.PI)) * Speed));
y = (y + (Math.sin(((Direction / 180) * Math.PI)) * Speed));
}
override public function Immobilize(){
removeEventListener(Event.ENTER_FRAME, elEnterFrame);
}
private function elRemovedFromStage(_arg1:Event){
}
}
}//package
Section 30
//GameMode (GameMode)
package {
import flash.display.*;
public class GameMode extends Sprite {
public var BG:Sprite;
public var Content:Sprite;
public var SnakePartsHolder:Sprite;
public var FoodHolder:Sprite;
public var Multiplier:uint;
}
}//package
Section 31
//GameModeAdvanced (GameModeAdvanced)
package {
import gs.*;
import flash.events.*;
import flash.display.*;
import flash.filters.*;
import fl.transitions.easing.*;
import mochi.*;
import flash.utils.*;
import flash.ui.*;
public class GameModeAdvanced extends GameMode {
private var FruitLevel:uint;
private var Fruits:Array;
var DropIndex;
public var Snake1:Snake;
private var SG1:ShatteringGlass;
private var GameTimer:Timer;
private var LeaderboardHolder:MovieClip;
var DropTimer:Timer;
var achievementAwardedText:AchievementAwardedText;
private var InfoBar1:InfoBar;
public var Score:uint;
var FruitMultiplierInterval:uint;
public var GameTime:uint;
public function GameModeAdvanced(){
Fruits = new Array("Cherries", "Grapes", "Banana", "Lemon", "Strawberry", "Watermelon");
addEventListener(Event.ADDED_TO_STAGE, elAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, elRemovedFromStage);
}
private function elKeyDown(_arg1:KeyboardEvent){
var _local2:DialogBox;
switch (_arg1.keyCode){
case Keyboard.ESCAPE:
Deactivate();
_local2 = new DialogBox("ABORT GAME?", new Array({Text:"NO", OnSelect:Activate}, {Text:"YES", OnSelect:Stop}), Activate);
_local2.x = (((stage.stageWidth / 2) - (_local2.width / 2)) + 10);
_local2.y = ((stage.stageHeight / 2) - (_local2.height / 2));
addChild(_local2);
break;
};
}
private function AddFruit(){
var _local1:uint;
var _local2:Class;
var _local3:*;
_local1 = FruitLevel;
if (_local1 > (Fruits.length - 1)){
_local1 = (Fruits.length - 1);
};
_local2 = (getDefinitionByName(Fruits[_local1]) as Class);
_local3 = new (_local2);
_local3.addEventListener("FoodWasEaten", elFoodWasEaten);
_local3.addEventListener("FoodWasEaten", Snake1.elFoodWasEaten);
_local3.addEventListener("FoodWasEaten", InfoBar1.elFoodWasEaten);
_local3.addEventListener("FoodLeftStage", elFoodLeftStage);
FoodHolder.addChild(_local3);
}
private function elFoodLeftStage(_arg1:Event){
var _local2:*;
_local2 = _arg1.target;
}
public function Activate(){
var _local1:*;
Snake1.Mobilize();
stage.focus = this;
InfoBar1.addEventListener("MultiplierReset", elMultiplierReset);
addEventListener("GameStarted", InfoBar1.elGameStarted);
addEventListener("GameTimeUpdated", InfoBar1.elGameTimeUpdated);
addEventListener("ScoreUpdated", InfoBar1.elScoreUpdated);
addEventListener("SnakeAteItself", Snake1.Immobilize);
addEventListener(Event.ENTER_FRAME, elEnterFrame);
stage.addEventListener(KeyboardEvent.KEY_DOWN, elKeyDown);
if (GameTimer){
GameTimer.addEventListener(TimerEvent.TIMER, UpdateGameTime);
GameTimer.start();
};
_local1 = 0;
while (_local1 < FoodHolder.numChildren) {
Food(FoodHolder.getChildAt(_local1)).Mobilize();
_local1++;
};
if (InfoBar1.BarWTween){
InfoBar1.BarWTween.resume();
};
}
private function Stop(){
if (LeaderboardHolder){
};
Deactivate();
dispatchEvent(new Event("ScreenCancelled"));
}
private function elResize(_arg1:Event=null){
var _local2:Sprite;
_local2 = new Sprite();
_local2.graphics.beginBitmapFill(new BGImage(0, 0));
_local2.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
_local2.graphics.endFill();
BG.addChild(_local2);
}
public function Start(){
BG = new Sprite();
FoodHolder = new Sprite();
SnakePartsHolder = new Sprite();
Content = new Sprite();
InfoBar1 = new InfoBar();
InfoBar1.y = (stage.stageHeight - 25);
trace(InfoBar1.y);
InfoBar1.x = 30;
Snake1 = new Snake();
Snake1.x = (stage.stageWidth / 2);
Snake1.y = (stage.stageHeight / 2);
Content.addChild(BG);
Content.addChild(InfoBar1);
Content.addChild(FoodHolder);
Content.addChild(SnakePartsHolder);
Content.addChild(Snake1);
GameTimer = new Timer(1000);
addChild(Content);
Multiplier = 1;
FruitMultiplierInterval = 10;
FruitLevel = 0;
AddPellet();
Activate();
GameTimer.start();
dispatchEvent(new Event("GameStarted"));
elResize();
}
private function ShatterGame(_arg1:MouseEvent=null){
var _local2:Sprite;
var _local3:*;
var _local4:LeaderboardHeader;
var _local5:GlowFilter;
var _local6:GlowFilter;
_local2 = new Sprite();
_local2.graphics.beginFill(0xFFFFFF);
_local2.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
_local2.graphics.endFill();
TweenLite.to(_local2, 2, {autoAlpha:0, ease:Strong.easeOut});
SG1 = new ShatteringGlass();
SG1.Shatter(Content, {CenterX:(Snake1.x + (Math.cos(((Snake1.rotation / 180) * Math.PI)) * 20)), CenterY:(Snake1.y + (Math.sin(((Snake1.rotation / 180) * Math.PI)) * 20))});
SG1.DropShards({InitialDelay:1, Interval:0.2});
addChild(_local2);
_local3 = 0;
while (_local3 < SG1.ShardHolders.length) {
_local5 = new GlowFilter(0xFFFFFF, 1, 5, 5, 5, 2);
_local6 = new GlowFilter(0, 0.3, 2, 2, 3, 1);
SG1.ShardHolders[_local3].filters = [_local6, _local5];
_local3++;
};
SoundManager.PlaySound("Glass2");
LeaderboardHolder = new MovieClip();
_local4 = new LeaderboardHeader();
LeaderboardHolder.addChild(_local4);
addChildAt(LeaderboardHolder, 0);
MochiScores.showLeaderboard({boardID:"35cf964bc9355425", score:Score, clip:LeaderboardHolder, onClose:Stop});
GamestatsManager.saveScore(Snaketastic.GAME_MODE_IDS.ADVANCED, Score);
}
private function elMultiplierReset(_arg1:Event){
Multiplier = 1;
FruitLevel = 0;
}
private function elAddedToStage(_arg1:Event){
}
private function elFoodWasEaten(_arg1:Event){
var _local2:ScoreBox;
var _local3:uint;
SoundManager.PlaySound("Gulp");
_local2 = new ScoreBox();
if ((_arg1.target is Pellet)){
_local3 = (_arg1.target.BasePoints * Multiplier);
} else {
if ((_arg1.target is Fruit)){
_local3 = _arg1.target.BasePoints;
};
};
_local2.Text.TXTText.text = _local3.toString();
_local2.x = _arg1.target.x;
_local2.y = _arg1.target.y;
_local2.scaleX = 0.85;
_local2.scaleY = 0.85;
_local2.rotation = ((Math.random() * 20) - 10);
Content.addChild(_local2);
Score = (Score + _local3);
Multiplier++;
if ((_arg1.target is Pellet)){
AddPellet();
if ((Multiplier % FruitMultiplierInterval) == 0){
AddFruit();
FruitLevel++;
};
};
dispatchEvent(new Event("ScoreUpdated"));
}
private function elEnterFrame(_arg1:Event){
var _local2:*;
var _local3:Boolean;
var _local4:*;
var _local5:*;
_local2 = 0;
while (_local2 < FoodHolder.numChildren) {
_local4 = FoodHolder.getChildAt(_local2);
if (_local4.hitTestObject(Snake1.CollisionArea)){
_local4.Remove();
};
_local2++;
};
_local3 = false;
_local2 = 0;
while (_local2 < SnakePartsHolder.numChildren) {
_local5 = SnakePartsHolder.getChildAt(_local2);
if (_local5.hitTestPoint((Snake1.x + (Math.cos(((Snake1.rotation / 180) * Math.PI)) * 20)), (Snake1.y + (Math.sin(((Snake1.rotation / 180) * Math.PI)) * 20)))){
_local3 = true;
};
_local2++;
};
if (_local3){
removeEventListener(Event.ENTER_FRAME, elEnterFrame);
dispatchEvent(new Event("SnakeAteItself"));
Deactivate();
ShatterGame();
};
}
private function AddPellet(){
var _local1:Pellet;
_local1 = new Pellet();
_local1.x = ((Math.random() * (stage.stageWidth - 80)) + 40);
_local1.y = ((Math.random() * (stage.stageHeight - 80)) + 40);
_local1.addEventListener("FoodWasEaten", elFoodWasEaten, false, 0, true);
_local1.addEventListener("FoodWasEaten", Snake1.elFoodWasEaten, false, 0, true);
_local1.addEventListener("FoodWasEaten", InfoBar1.elFoodWasEaten, false, 0, true);
FoodHolder.addChild(_local1);
}
public function Deactivate(){
var _local1:*;
Snake1.Immobilize();
removeEventListener("GameStarted", InfoBar1.elGameStarted);
removeEventListener("GameTimeUpdated", InfoBar1.elGameTimeUpdated);
removeEventListener("ScoreUpdated", InfoBar1.elScoreUpdated);
removeEventListener("SnakeAteItself", Snake1.Immobilize);
InfoBar1.removeEventListener("MultiplierReset", elMultiplierReset);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, elKeyDown);
removeEventListener(Event.ENTER_FRAME, elEnterFrame);
if (GameTimer){
GameTimer.removeEventListener(TimerEvent.TIMER, UpdateGameTime);
GameTimer.stop();
};
_local1 = 0;
while (_local1 < FoodHolder.numChildren) {
Food(FoodHolder.getChildAt(_local1)).Immobilize();
_local1++;
};
if (InfoBar1.BarWTween){
InfoBar1.BarWTween.stop();
};
}
private function elRemovedFromStage(_arg1:Event){
}
private function UpdateGameTime(_arg1:TimerEvent){
GameTime++;
dispatchEvent(new Event("GameTimeUpdated"));
}
}
}//package
Section 32
//GameModeClassic (GameModeClassic)
package {
import gs.*;
import flash.events.*;
import flash.display.*;
import flash.filters.*;
import fl.transitions.easing.*;
import mochi.*;
import flash.utils.*;
import flash.ui.*;
public class GameModeClassic extends GameMode {
var DropIndex;
public var Snake1:CSnake;
var Speed:String;
private var SG1:ShatteringGlass;
private var LeaderboardHolder:MovieClip;
var DropTimer:Timer;
private var InfoBar1:CInfoBar;
public var Score:uint;
public function GameModeClassic(){
addEventListener(Event.ADDED_TO_STAGE, elAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, elRemovedFromStage);
}
private function elKeyDown(_arg1:KeyboardEvent){
var _local2:DialogBox;
switch (_arg1.keyCode){
case Keyboard.ESCAPE:
Deactivate();
_local2 = new DialogBox("ABORT GAME?", new Array({Text:"NO", OnSelect:Activate}, {Text:"YES", OnSelect:Stop}), Activate);
_local2.x = (((stage.stageWidth / 2) - (_local2.width / 2)) + 10);
_local2.y = ((stage.stageHeight / 2) - (_local2.height / 2));
addChild(_local2);
break;
};
}
public function PreparePlayingField(){
BG = new Sprite();
FoodHolder = new Sprite();
SnakePartsHolder = new Sprite();
Content = new Sprite();
InfoBar1 = new CInfoBar();
Snake1 = new CSnake();
Snake1.x = ((10 * 10) + 5);
Snake1.y = ((21 * 10) + 5);
Content.addChild(BG);
Content.addChild(SnakePartsHolder);
Content.addChild(FoodHolder);
Content.addChild(Snake1);
addChild(Content);
Multiplier = 1;
elResize();
Deactivate();
}
public function Activate(){
Snake1.Mobilize();
stage.focus = this;
addEventListener("GameStarted", InfoBar1.elGameStarted);
stage.addEventListener(KeyboardEvent.KEY_DOWN, this.elKeyDown);
addEventListener("ScoreUpdated", InfoBar1.elScoreUpdated);
addEventListener("SnakeAteItself", Snake1.Immobilize);
addEventListener(Event.ENTER_FRAME, elEnterFrame);
}
private function Stop(){
if (LeaderboardHolder){
};
Deactivate();
dispatchEvent(new Event("ScreenCancelled"));
}
private function elSnakeHitWall(_arg1:Event){
removeEventListener(Event.ENTER_FRAME, elEnterFrame);
ShatterGame();
}
private function elResize(_arg1:Event=null){
var _local2:Sprite;
var _local3:Sprite;
var _local4:uint;
var _local5:Sprite;
var _local6:Sprite;
_local2 = new Sprite();
_local2.graphics.beginFill(0);
_local2.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
_local2.graphics.endFill();
BG.addChild(_local2);
_local3 = new Sprite();
_local3.graphics.lineStyle(1, 0xFFFFFF, 0.6);
_local4 = 0;
while (_local4 < 450) {
_local3.graphics.moveTo(_local4, 0);
_local3.graphics.lineTo(_local4, 450);
_local4 = (_local4 + 10);
};
_local4 = 0;
while (_local4 < 450) {
_local3.graphics.moveTo(0, _local4);
_local3.graphics.lineTo(450, _local4);
_local4 = (_local4 + 10);
};
BG.addChild(_local3);
_local5 = new Sprite();
_local5.graphics.beginFill(0xFFFFFF);
_local5.graphics.drawRect(10, 10, 430, 430);
_local5.graphics.endFill();
BG.addChild(_local5);
BG.addChild(InfoBar1);
_local6 = new Sprite();
_local6.graphics.lineStyle(1, 0, 0.1);
_local4 = 0;
while (_local4 < 450) {
_local6.graphics.moveTo(_local4, 0);
_local6.graphics.lineTo(_local4, 450);
_local4 = (_local4 + 10);
};
_local4 = 0;
while (_local4 < 450) {
_local6.graphics.moveTo(0, _local4);
_local6.graphics.lineTo(450, _local4);
_local4 = (_local4 + 10);
};
BG.addChild(_local6);
}
public function Start(_arg1:Object=null){
var _local2:Object;
if (_arg1 != null){
_local2 = _arg1;
if (_local2.Speed){
Speed = _local2.Speed;
if (_local2.Speed == "Slow"){
Snake1.SetMovementDelay(100);
} else {
if (_local2.Speed == "Medium"){
Snake1.SetMovementDelay(70);
} else {
if (_local2.Speed == "Fast"){
Snake1.SetMovementDelay(42);
};
};
};
};
};
addEventListener("GameStarted", InfoBar1.elGameStarted);
Snake1.addEventListener("SnakeHitWall", elSnakeHitWall);
AddPellet();
Activate();
dispatchEvent(new Event("GameStarted"));
}
private function ShatterGame(_arg1:MouseEvent=null){
var _local2:Sprite;
var _local3:*;
var _local4:CLeaderboardHeader;
var _local5:String;
var _local6:GlowFilter;
var _local7:GlowFilter;
_local2 = new Sprite();
_local2.graphics.beginFill(0xFFFFFF);
_local2.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
_local2.graphics.endFill();
TweenLite.to(_local2, 2, {autoAlpha:0, ease:Strong.easeOut});
SG1 = new ShatteringGlass();
SG1.Shatter(Content, {CenterX:Snake1.x, CenterY:Snake1.y});
SG1.DropShards({InitialDelay:1, Interval:0.2});
addChild(_local2);
_local3 = 0;
while (_local3 < SG1.ShardHolders.length) {
_local6 = new GlowFilter(0xFFFFFF, 1, 5, 5, 5, 2);
_local7 = new GlowFilter(0, 0.3, 2, 2, 3, 1);
SG1.ShardHolders[_local3].filters = [_local7, _local6];
_local3++;
};
SoundManager.PlaySound("Glass2");
LeaderboardHolder = new MovieClip();
_local4 = new CLeaderboardHeader();
LeaderboardHolder.addChild(_local4);
addChildAt(LeaderboardHolder, 0);
if (Speed == "Slow"){
_local5 = "a97d79f3ae2b4d78";
GamestatsManager.saveScore(Snaketastic.GAME_MODE_IDS.CLASSIC_SLOW, Score);
} else {
if (Speed == "Medium"){
_local5 = "5d6a8d89e412cc14";
GamestatsManager.saveScore(Snaketastic.GAME_MODE_IDS.CLASSIC_MED, Score);
} else {
if (Speed == "Fast"){
_local5 = "bafd4129ffbdcc75";
GamestatsManager.saveScore(Snaketastic.GAME_MODE_IDS.CLASSIC_FAST, Score);
};
};
};
MochiScores.showLeaderboard({boardID:_local5, score:Score, clip:LeaderboardHolder, onClose:Stop});
}
private function elAddedToStage(_arg1:Event){
addEventListener(Event.RESIZE, elResize);
}
private function elFoodWasEaten(_arg1:Event){
var _local2:*;
SoundManager.PlaySound("CGulp2");
_local2 = (_arg1.target.BasePoints * Multiplier);
Score = (Score + _local2);
if ((_arg1.target is CPellet)){
AddPellet();
};
dispatchEvent(new Event("ScoreUpdated"));
}
private function elEnterFrame(_arg1:Event){
var _local2:*;
var _local3:Boolean;
var _local4:*;
var _local5:*;
_local2 = 0;
while (_local2 < FoodHolder.numChildren) {
_local4 = FoodHolder.getChildAt(_local2);
if (_local4.hitTestObject(Snake1.Gfx)){
_local4.Remove();
};
_local2++;
};
_local3 = false;
_local2 = 0;
while (_local2 < SnakePartsHolder.numChildren) {
_local5 = SnakePartsHolder.getChildAt(_local2);
if (_local5.hitTestObject(Snake1)){
_local3 = true;
};
_local2++;
};
if (_local3){
removeEventListener(Event.ENTER_FRAME, elEnterFrame);
dispatchEvent(new Event("SnakeAteItself"));
ShatterGame();
};
}
private function AddPellet(_arg1:int=-1, _arg2:int=-1){
var _local3:CPellet;
var _local4:uint;
var _local5:uint;
var _local6:Boolean;
var _local7:*;
_local3 = new CPellet();
_local4 = 0;
_local5 = 0;
do {
_local6 = false;
if (_arg1 == -1){
_local4 = ((uint(((Math.random() * 43) + 1)) * 10) + 5);
} else {
_local4 = ((_arg1 * 10) + 5);
};
if (_arg1 == -1){
_local5 = ((uint(((Math.random() * 43) + 1)) * 10) + 5);
} else {
_local5 = ((_arg2 * 10) + 5);
};
_local7 = 0;
while ((((_local7 < Snake1.Movement.length)) && ((_local6 == false)))) {
if ((((_local4 == Snake1.Movement[_local7].X)) && ((_local5 == Snake1.Movement[_local7].Y)))){
_local6 = true;
};
_local7++;
};
_arg1 = -1;
_arg2 = -1;
} while (_local6);
_local3.x = _local4;
_local3.y = _local5;
_local3.addEventListener("FoodWasEaten", elFoodWasEaten, false, 0, true);
_local3.addEventListener("FoodWasEaten", Snake1.elFoodWasEaten, false, 0, true);
FoodHolder.addChild(_local3);
}
public function Deactivate(){
Snake1.Immobilize();
removeEventListener("GameStarted", InfoBar1.elGameStarted);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, this.elKeyDown);
removeEventListener("ScoreUpdated", InfoBar1.elScoreUpdated);
removeEventListener("SnakeAteItself", Snake1.Immobilize);
removeEventListener(Event.ENTER_FRAME, elEnterFrame);
}
private function elRemovedFromStage(_arg1:Event){
}
}
}//package
Section 33
//GameModeSelection (GameModeSelection)
package {
import flash.events.*;
import flash.display.*;
import flash.ui.*;
public class GameModeSelection extends Sprite {
var ActivatedMode:String;
public var Advanced:GameModeSelectionAdvanced;
public var Classic:GameModeSelectionClassic;
public function GameModeSelection(){
addEventListener(Event.ADDED_TO_STAGE, elAddedToStage);
}
public function Show(){
Advanced.Activate();
Advanced.Show();
Classic.Deactivate();
Classic.Show();
ActivatedMode = "Advanced";
stage.focus = this;
stage.addEventListener(KeyboardEvent.KEY_DOWN, elKeyDown);
addEventListener("ModeSelected", elModeSelected);
addEventListener("ModeSelected", Advanced.elModeSelected);
addEventListener("ModeSelected", Classic.elModeSelected);
}
private function elAddedToStage(_arg1:Event){
Show();
}
private function Remove(){
SoundManager.StopMusic();
Advanced.Remove();
Classic.Remove();
stage.removeEventListener(KeyboardEvent.KEY_DOWN, elKeyDown);
removeEventListener("ModeSelected", elModeSelected);
removeEventListener("ModeSelected", Advanced.elModeSelected);
removeEventListener("ModeSelected", Classic.elModeSelected);
dispatchEvent(new Event("ScreenRemoved"));
}
private function elModeSelected(_arg1:Event){
Remove();
}
public function elKeyDown(_arg1:KeyboardEvent){
switch (_arg1.keyCode){
case Keyboard.UP:
if (ActivatedMode != "Advanced"){
ActivatedMode = "Advanced";
Advanced.Activate();
Classic.Deactivate();
SoundManager.PlaySound("GameModeHighlight3");
};
break;
case Keyboard.DOWN:
if (ActivatedMode != "Classic"){
ActivatedMode = "Classic";
Classic.Activate();
Advanced.Deactivate();
SoundManager.PlaySound("GameModeHighlight3");
};
break;
case Keyboard.ENTER:
dispatchEvent(new Event("ModeSelected"));
break;
case Keyboard.ESCAPE:
dispatchEvent(new Event("ScreenCancelled"));
Remove();
break;
};
}
}
}//package
Section 34
//GameModeSelectionAdvanced (GameModeSelectionAdvanced)
package {
import gs.*;
import flash.events.*;
import flash.display.*;
import fl.transitions.easing.*;
import flash.utils.*;
public class GameModeSelectionAdvanced extends Sprite {
var CircleTimer:Timer;
public var Content:MovieClip;
var Circles:Sprite;
public var ContentMask:MovieClip;
public function GameModeSelectionAdvanced(){
Circles = new Sprite();
}
public function Activate(){
var _local1:*;
var _local2:*;
TweenFilterLite.to(Content, 0.5, {alpha:1});
_local1 = 0;
while (_local1 < Content.Texts.numChildren) {
_local2 = Content.Texts.getChildAt(_local1);
TweenLite.to(_local2, 0.4, {y:(10 + (_local1 * 28)), delay:(_local1 * 0.1), ease:Regular.easeOut});
_local1++;
};
_local1 = 0;
while (_local1 < Content.Keys.numChildren) {
_local2 = Content.Keys.getChildAt(_local1);
TweenLite.to(_local2, 0.4, {y:(23 + (_local1 * 27.5)), delay:(_local1 * 0.1), ease:Regular.easeOut});
_local1++;
};
Content.addChildAt(Circles, 0);
Content.addChildAt(Content.BG, 0);
CircleTimer = new Timer(400);
CircleTimer.addEventListener(TimerEvent.TIMER, AddCircle);
CircleTimer.start();
}
public function Show(){
TweenLite.to(this, 0.5, {y:0});
}
public function Remove(_arg1:Event=null){
var _local2:*;
var _local3:*;
TweenLite.killTweensOf(Content.Circles);
TweenLite.to(this, 0.5, {y:-225});
if (CircleTimer){
CircleTimer.removeEventListener(TimerEvent.TIMER, AddCircle);
CircleTimer.stop();
};
_local2 = 0;
while (_local2 < Circles.numChildren) {
_local3 = Sprite(Circles.getChildAt(_local2));
TweenLite.killTweensOf(_local3);
_local2++;
};
}
public function Deactivate(){
var _local1:*;
var _local2:*;
var _local3:*;
TweenFilterLite.to(Content, 0.5, {alpha:0.1});
_local1 = 0.1;
_local2 = (Content.Texts.numChildren - 1);
while (_local2 >= 0) {
_local3 = Content.Texts.getChildAt(_local2);
TweenLite.to(_local3, 0.4, {y:250, delay:_local1, ease:Regular.easeOut});
_local1 = (_local1 + 0.1);
_local2--;
};
_local1 = 0.1;
_local2 = (Content.Keys.numChildren - 1);
while (_local2 >= 0) {
_local3 = Content.Keys.getChildAt(_local2);
TweenLite.to(_local3, 0.4, {y:250, delay:_local1, ease:Regular.easeOut});
_local1 = (_local1 + 0.1);
_local2--;
};
if (CircleTimer){
CircleTimer.removeEventListener(TimerEvent.TIMER, AddCircle);
CircleTimer.stop();
};
}
private function AddCircle(_arg1:TimerEvent){
var _local2:*;
var _local3:Sprite;
var _local4:*;
_local2 = 0;
while (_local2 < Circles.numChildren) {
_local4 = Sprite(Circles.getChildAt(_local2));
if (_local4.width > 999){
Circles.removeChild(_local4);
};
_local2++;
};
_local3 = new Sprite();
_local3.graphics.lineStyle(40, 0xF0F0F0, 1, false, "none");
_local3.graphics.drawCircle(0, 0, 100);
_local3.x = 225;
_local3.y = 225;
TweenLite.to(_local3, 2, {width:1000, height:1000, ease:None.easeNone});
Circles.addChild(_local3);
}
public function elModeSelected(_arg1:Event){
Remove();
}
}
}//package
Section 35
//GameModeSelectionClassic (GameModeSelectionClassic)
package {
import gs.*;
import flash.events.*;
import flash.display.*;
import fl.transitions.easing.*;
import flash.utils.*;
public class GameModeSelectionClassic extends Sprite {
var CircleTimer:Timer;
public var Content:MovieClip;
var Circles:Sprite;
public function GameModeSelectionClassic(){
Circles = new Sprite();
}
public function Activate(){
var _local1:*;
var _local2:*;
var _local3:*;
TweenFilterLite.to(Content, 0.5, {alpha:1});
_local1 = 0.1;
_local2 = (Content.Texts.numChildren - 1);
while (_local2 >= 0) {
_local3 = Content.Texts.getChildAt(_local2);
TweenLite.to(_local3, 0.4, {y:(20 + (_local2 * 22)), delay:_local1, ease:Regular.easeOut});
_local1 = (_local1 + 0.1);
_local2--;
};
_local1 = 0.1;
_local2 = (Content.Keys.numChildren - 1);
while (_local2 >= 0) {
_local3 = Content.Keys.getChildAt(_local2);
TweenLite.to(_local3, 0.4, {y:(25 + (_local2 * 22)), delay:_local1, ease:Regular.easeOut});
_local1 = (_local1 + 0.1);
trace(_local3);
_local2--;
};
Content.addChildAt(Circles, 0);
Content.addChildAt(Content.BG, 0);
CircleTimer = new Timer(400);
CircleTimer.addEventListener(TimerEvent.TIMER, AddCircle);
CircleTimer.start();
}
public function Show(){
TweenLite.to(this, 0.5, {y:225});
}
public function Remove(_arg1:Event=null){
var _local2:*;
var _local3:*;
TweenLite.killTweensOf(Content.Circles);
TweenLite.to(this, 0.5, {y:450});
if (CircleTimer){
CircleTimer.removeEventListener(TimerEvent.TIMER, AddCircle);
CircleTimer.stop();
};
_local2 = 0;
while (_local2 < Circles.numChildren) {
_local3 = Sprite(Circles.getChildAt(_local2));
TweenLite.killTweensOf(_local3);
_local2++;
};
}
public function Deactivate(){
var _local1:*;
var _local2:*;
TweenFilterLite.to(Content, 0.5, {alpha:0.2});
_local1 = (Content.Texts.numChildren - 1);
while (_local1 >= 0) {
_local2 = Content.Texts.getChildAt(_local1);
TweenLite.to(_local2, 0.4, {y:-50, delay:(_local1 * 0.1), ease:Regular.easeOut});
_local1--;
};
_local1 = (Content.Keys.numChildren - 1);
while (_local1 >= 0) {
_local2 = Content.Keys.getChildAt(_local1);
TweenLite.to(_local2, 0.4, {y:-50, delay:(_local1 * 0.1), ease:Regular.easeOut});
_local1--;
};
if (CircleTimer){
CircleTimer.removeEventListener(TimerEvent.TIMER, AddCircle);
CircleTimer.stop();
};
}
private function AddCircle(_arg1:TimerEvent){
var _local2:*;
var _local3:Sprite;
var _local4:*;
_local2 = 0;
while (_local2 < Circles.numChildren) {
_local4 = Sprite(Circles.getChildAt(_local2));
if (_local4.width > 1999){
Circles.removeChild(_local4);
};
_local2++;
};
_local3 = new Sprite();
_local3.graphics.lineStyle(40, 0x333333, 1, false, "none");
_local3.graphics.drawCircle(0, 0, 10);
_local3.x = 225;
TweenLite.to(_local3, 2, {width:2000, height:2000, ease:None.easeNone});
Circles.addChild(_local3);
}
public function elModeSelected(_arg1:Event){
Remove();
}
}
}//package
Section 36
//GamestatsManager (GamestatsManager)
package {
import gs.*;
import flash.events.*;
import flash.display.*;
import flash.filters.*;
import fl.transitions.*;
import flash.media.*;
import fl.transitions.easing.*;
import flash.utils.*;
import flash.net.*;
import flash.external.*;
public class GamestatsManager {
private static var amfSaveScoreResponder:Responder;
private static var amfSessionID:String;
private static var amfService:NetConnection;
public static var eDisp:EventDispatcher;
private static function onFault(_arg1){
var _local2:*;
for (_local2 in _arg1) {
};
}
public static function connect(){
var _local1:String;
var _local2:Responder;
eDisp = new EventDispatcher();
amfService = new NetConnection();
_local1 = "http://www.jesshansen.com/services/amfphp";
amfService.objectEncoding = ObjectEncoding.AMF0;
amfService.connect(_local1);
_local2 = new Responder(amfSessionIDReceived, onFault);
amfService.call("system.connect", _local2);
}
private static function amfScoreSaved(_arg1){
ExternalInterface.call("gamestats.getHighest");
ExternalInterface.call("gamestats.getLatest");
}
public static function saveScore(_arg1:uint, _arg2:Number){
amfService.call("gamestats.saveScore", amfSaveScoreResponder, amfSessionID, _arg1, _arg2);
}
private static function amfSessionIDReceived(_arg1){
amfSessionID = _arg1.sessid;
amfSaveScoreResponder = new Responder(amfScoreSaved, onFault);
}
}
}//package
Section 37
//Grapes (Grapes)
package {
import flash.display.*;
public class Grapes extends Fruit {
public var Gfx:MovieClip;
public function Grapes(){
BasePoints = 20000;
}
}
}//package
Section 38
//InfoBar (InfoBar)
package {
import flash.events.*;
import flash.display.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.utils.*;
import flash.text.*;
public class InfoBar extends Sprite {
public var BarWTween:Tween;
public var TXTScore:TextField;
public var TXTMultiplier:TextField;
var GameTimer:Timer;
public var MultiplierBar:MovieClip;
public var MultiplierDuration:uint;
var ResetTime:Number;
public function InfoBar(){
MultiplierDuration = 6;
MultiplierBar.alpha = 0;
}
public function elGameStarted(_arg1:Event){
}
public function elScoreUpdated(_arg1:Event){
var _local2:String;
var _local3:*;
_local2 = _arg1.target.Score.toString();
_local3 = _local2.length;
while (_local3 < 8) {
_local2 = ("0" + _local2);
_local3++;
};
TXTScore.text = _local2;
}
public function elGameTimeUpdated(_arg1:Event){
var _local2:*;
var _local3:uint;
var _local4:uint;
var _local5:String;
_local2 = _arg1.target.GameTime;
_local3 = (_local2 / 60);
_local4 = (_local2 % 60);
_local5 = (_local3 + ":");
if (_local4 < 10){
_local5 = (_local5 + "0");
};
_local5 = (_local5 + _local4.toString());
}
private function ResetMultiplier(_arg1:TweenEvent=null){
MultiplierBar.alpha = 0;
dispatchEvent(new Event("MultiplierReset"));
TXTMultiplier.text = ("x" + GameMode(Snaketastic.CurrentGameHolder).Multiplier);
}
public function elFoodWasEaten(_arg1:Event){
TXTMultiplier.text = ("x" + GameMode(Snaketastic.CurrentGameHolder).Multiplier);
MultiplierBar.alpha = 1;
if (BarWTween){
BarWTween.stop();
};
BarWTween = new Tween(MultiplierBar, "width", None.easeNone, 100, 1, MultiplierDuration, true);
BarWTween.addEventListener(TweenEvent.MOTION_FINISH, ResetMultiplier);
}
}
}//package
Section 39
//Key (Key)
package {
import flash.events.*;
import flash.display.*;
public class Key {
private static var initialized:Boolean = false;
private static var keysDown:Object = new Object();
public static function initialize(_arg1:Stage){
if (!initialized){
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
_arg1.addEventListener(Event.DEACTIVATE, clearKeys);
initialized = true;
};
}
private static function clearKeys(_arg1:Event):void{
keysDown = new Object();
}
public static function isDown(_arg1:uint):Boolean{
if (!initialized){
throw (new Error("Key class has yet been initialized."));
};
return (Boolean((_arg1 in keysDown)));
}
private static function keyPressed(_arg1:KeyboardEvent):void{
keysDown[_arg1.keyCode] = true;
}
private static function keyReleased(_arg1:KeyboardEvent):void{
if ((_arg1.keyCode in keysDown)){
delete keysDown[_arg1.keyCode];
};
}
}
}//package
Section 40
//LeaderboardHeader (LeaderboardHeader)
package {
import flash.display.*;
public dynamic class LeaderboardHeader extends MovieClip {
}
}//package
Section 41
//LeaderboardViewer (LeaderboardViewer)
package {
import gs.*;
import flash.events.*;
import flash.display.*;
import fl.transitions.easing.*;
import mochi.*;
import flash.utils.*;
import flash.ui.*;
public class LeaderboardViewer extends Sprite {
var BoardIDs:Array;
var Overlay:Sprite;
var LeaderboardHolder:MovieClip;
var MainMenu1:MainMenu;
var BoardIndex:uint;
var MainMenuItems:Array;
var LeaderboardSwitchTimer:Timer;
public function LeaderboardViewer(){
BoardIDs = new Array("35cf964bc9355425", "a97d79f3ae2b4d78", "5d6a8d89e412cc14", "bafd4129ffbdcc75");
addEventListener(Event.ADDED_TO_STAGE, elAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, elRemovedFromStage);
}
private function elAddedToStage(_arg1:Event){
stage.addEventListener(KeyboardEvent.KEY_DOWN, elKeyDown);
stage.focus = this;
LeaderboardHolder = new MovieClip();
addChild(LeaderboardHolder);
Overlay = new Sprite();
Overlay.graphics.beginFill(0xFFFFFF);
Overlay.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
Overlay.graphics.endFill();
addChild(Overlay);
TweenLite.to(Overlay, 2, {autoAlpha:0, ease:Strong.easeOut});
ShowBoard();
}
private function Remove(){
MochiScores.closeLeaderboard();
stage.removeEventListener(KeyboardEvent.KEY_DOWN, elKeyDown);
parent.removeChild(this);
}
private function elRemovedFromStage(_arg1:Event){
}
private function ShowBoard(){
MochiScores.closeLeaderboard();
LeaderboardSwitchTimer = new Timer(100, 1);
LeaderboardSwitchTimer.addEventListener(TimerEvent.TIMER, elTimer);
LeaderboardSwitchTimer.start();
}
private function elTimer(_arg1:TimerEvent){
MochiScores.showLeaderboard({boardID:BoardIDs[BoardIndex], clip:LeaderboardHolder, hideDoneButton:true, numScores:20});
}
public function elKeyDown(_arg1:KeyboardEvent){
switch (_arg1.keyCode){
case Keyboard.LEFT:
if (BoardIndex > 0){
BoardIndex--;
} else {
BoardIndex = (BoardIDs.length - 1);
};
ShowBoard();
break;
case Keyboard.RIGHT:
if (BoardIndex < (BoardIDs.length - 1)){
BoardIndex++;
} else {
BoardIndex = 0;
};
ShowBoard();
break;
case Keyboard.ESCAPE:
dispatchEvent(new Event("ScreenCancelled"));
Remove();
break;
};
}
}
}//package
Section 42
//Lemon (Lemon)
package {
import flash.display.*;
public class Lemon extends Fruit {
public var Gfx:MovieClip;
public function Lemon(){
BasePoints = 40000;
}
}
}//package
Section 43
//MainMenu (MainMenu)
package {
import flash.events.*;
import flash.display.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.text.*;
import flash.ui.*;
public class MainMenu extends MovieClip {
private var ItemsMC:Sprite;
public var Position:uint;
private var ActivatedItem:MainMenuItem;
private var YTween:Tween;
public var Items:Array;
private var FocusedItemIndex:uint;
private static var ii:Boolean;
public function MainMenu(_arg1:Array){
Items = _arg1;
addEventListener(Event.ADDED_TO_STAGE, elAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, elRemovedFromStage);
}
public function elKeyDown(_arg1:KeyboardEvent){
switch (_arg1.keyCode){
case Keyboard.UP:
FocusPrev();
break;
case Keyboard.DOWN:
FocusNext();
break;
case Keyboard.ENTER:
ActivateItem();
if (ActivatedItem.DeactivateOnClick == true){
stage.removeEventListener(KeyboardEvent.KEY_DOWN, elKeyDown);
};
break;
};
}
public function FocusPrev(){
if (FocusedItemIndex > 0){
FocusItem((FocusedItemIndex - 1));
};
}
private function FocusItem(_arg1:uint){
trace(MainMenuItem(ItemsMC.getChildByName(("Item_" + FocusedItemIndex))));
MainMenuItem(ItemsMC.getChildByName(("Item_" + FocusedItemIndex))).Blur();
FocusedItemIndex = _arg1;
MainMenuItem(ItemsMC.getChildByName(("Item_" + FocusedItemIndex))).Focus();
}
public function Activate(){
stage.focus = this;
stage.addEventListener(KeyboardEvent.KEY_DOWN, elKeyDown);
}
private function elAddedToStage(_arg1:Event){
var _local2:*;
var _local3:*;
var _local4:MainMenuItem;
if (ii == false){
ItemsMC = new Sprite();
_local2 = 0;
_local3 = 0;
while (_local3 < Items.length) {
_local4 = new MainMenuItem(Items[_local3].Title, Items[_local3].TextClass);
_local4.OnActivated = Items[_local3].OnActivated;
_local4.DeactivateOnClick = Items[_local3].DeactivateOnClick;
_local4.OnFocus = Items[_local3].OnFocus;
_local4.Position = _local3;
_local4.name = ("Item_" + _local3);
_local4.y = _local2;
_local2 = (_local2 + 32);
ItemsMC.addChild(_local4);
_local3++;
};
addChild(ItemsMC);
FocusItem(0);
Activate();
ii = true;
};
}
public function Deactivate(){
stage.removeEventListener(KeyboardEvent.KEY_DOWN, elKeyDown);
}
private function elRemovedFromStage(_arg1:Event){
Deactivate();
}
public function ActivateItem(){
this.dispatchEvent(new Event("MainMenuItemActivated"));
ActivatedItem = MainMenuItem(ItemsMC.getChildByName(("Item_" + FocusedItemIndex)));
if (ActivatedItem.OnActivated != null){
ActivatedItem.OnActivated();
};
}
public function FocusNext(){
if (FocusedItemIndex < (Items.length - 1)){
FocusItem((FocusedItemIndex + 1));
};
}
}
}//package
Section 44
//MainMenuItem (MainMenuItem)
package {
import gs.*;
import flash.events.*;
import flash.display.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.text.*;
public class MainMenuItem extends MovieClip {
public var Description:String;
public var OnFocus:Function;
public var Title:String;
public var Position:uint;
public var OnActivated:Function;
public var Text:Sprite;
public var DeactivateOnClick:Boolean;
public function MainMenuItem(_arg1:String, _arg2:Class){
Text = new (_arg2);
addChild(Text);
Title = _arg1;
_arg2(Text).TXTText.text = ("" + _arg1);
_arg2(Text).TXTText.x = (-(_arg2(Text).TXTText.width) / 2);
_arg2(Text).TXTText.y = (-(_arg2(Text).TXTText.height) / 2);
x = (_arg2(Text).TXTText.width / 2);
y = (_arg2(Text).TXTText.height / 2);
alpha = 0.6;
}
public function Blur(){
TweenLite.to(this, 0.2, {scaleX:1, scaleY:1, alpha:0.6, ease:Strong.easeOut});
this.dispatchEvent(new Event("MainMenuItemBlur"));
}
public function Focus(){
if (OnFocus != null){
OnFocus();
};
TweenLite.to(this, 0.2, {scaleX:1.15, scaleY:1.15, alpha:1, ease:Strong.easeOut});
this.dispatchEvent(new Event("MainMenuItemFocus"));
}
}
}//package
Section 45
//MainMenuItemText (MainMenuItemText)
package {
import flash.display.*;
import flash.text.*;
public dynamic class MainMenuItemText extends MovieClip {
public var TXTText:TextField;
}
}//package
Section 46
//MochiAd (MochiAd)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return ("2.2");
}
public static function showTimedAd(_arg1:Object):void{
MochiAd.showInterLevelAd(_arg1);
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var f:Function;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
f = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
mc._mochiad_ctr_failed = true;
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function sendHighScore(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["sendHighScore", _arg1], _arg2, _arg3);
return (true);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (_local3);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _cleanup(_arg1:Object):void{
var idx:Number;
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
idx = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = _local1.loaderInfo.bytesTotal;
if ((((_local4 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
_local3 = true;
};
};
};
if ((((_local2 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _loadCommunicator(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var clipname:String;
var server:String;
var depth:Number;
var mc:MovieClip;
var lv:URLVariables;
var k:String;
var lc:LocalConnection;
var name:String;
var req:URLRequest;
var loader:Loader;
var options = _arg1;
DEFAULTS = {com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
clipname = ("_mochiad_com_" + options.id);
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip[clipname]){
return (clip[clipname]);
};
server = (options.com_server + options.id);
MochiAd._allowDomains(server);
delete options.id;
delete options.com_server;
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, clipname, depth);
lv = new URLVariables();
for (k in options) {
lv[k] = options[k];
};
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.name = name;
mc.lc = lc;
lv.lc = name;
mc._id = 0;
mc._queue = [];
mc.rpcResult = function (_arg1:Object):void{
var _local3:Array;
var _local4:Array;
var _local5:Number;
var _local6:Object;
var _local7:Object;
_arg1 = parseInt(_arg1.toString());
_local3 = mc._callbacks[_arg1];
if (typeof(_local3) == "undefined"){
return;
};
delete mc._callbacks[_arg1];
_local4 = [];
_local5 = 2;
while (_local5 < _local3.length) {
_local4.push(_local3[_local5]);
_local5++;
};
_local5 = 1;
while (_local5 < arguments.length) {
_local4.push(arguments[_local5]);
_local5++;
};
_local6 = _local3[1];
_local7 = _local3[0];
if (((_local7) && ((typeof(_local6) == "string")))){
_local6 = _local7[_local6];
};
if (typeof(_local6) == "function"){
_local6.apply(_local7, _local4);
};
};
mc._didConnect = function (_arg1:String):void{
var _local2:Array;
var _local3:Function;
var _local4:Number;
var _local5:Array;
mc._endpoint = _arg1;
_local2 = mc._queue;
delete mc._queue;
_local3 = mc.doSend;
_local4 = 0;
while (_local4 < _local2.length) {
_local5 = _local2[_local4];
_local3.apply(this, _local5);
_local4++;
};
};
mc.doSend = function (_arg1:Array, _arg2:Object, _arg3:Object):void{
var _local5:Number;
var _local6:LocalConnection;
var _local7:Array;
var _local8:Number;
if (mc._endpoint == null){
_local7 = [];
_local8 = 0;
while (_local8 < arguments.length) {
_local7.push(arguments[_local8]);
_local8++;
};
mc._queue.push(_local7);
return;
};
mc._id = (mc._id + 1);
_local5 = mc._id;
mc._callbacks[_local5] = [_arg2, ((_arg3) || (_arg2))];
_local6 = new LocalConnection();
_local6.send(mc._endpoint, "rpc", _local5, _arg1);
};
mc._callbacks = {};
mc._callbacks[0] = [mc, "_didConnect"];
lv.st = getTimer();
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
loader.load(req);
mc.addChild(loader);
mc._mochiad_com = loader;
return (mc);
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var f:Function;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
MochiAd._cleanup(mc);
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
bar.x = 10;
bar.y = (h - 20);
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
if (!this.parent.parent){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
if (!chk.showing){
_local11 = _local2.loaderInfo.bytesTotal;
if ((((_local11 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local3 > chk.ad_timeout){
_local4 = true;
};
};
};
if ((((_local3 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
MochiAd.showPreGameAd(_arg1);
}
public static function fetchHighScores(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["fetchHighScores", _arg1], _arg2, _arg3);
return (true);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 47
//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 48
//Pellet (Pellet)
package {
import gs.*;
import flash.events.*;
import flash.filters.*;
import fl.transitions.*;
import fl.transitions.easing.*;
public class Pellet extends Food {
var InitTime:uint;
var XSTween:Tween;
var YTween:Tween;
var YSTween:Tween;
var XTween:Tween;
public function Pellet(){
var _local1:DropShadowFilter;
super();
BasePoints = 100;
_local1 = new DropShadowFilter(50, 45, 0, 0.2, 30, 30, 1);
filters = [_local1];
addEventListener(Event.ADDED_TO_STAGE, elAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, elRemovedFromStage);
}
private function elAddedToStage(_arg1:Event){
var _local2:Number;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:uint;
_local2 = Math.random();
_local9 = 100;
if (_local2 < 0.5){
_local3 = Math.max((x - _local9), 0);
_local4 = Math.min((x + _local9), stage.stageWidth);
_local5 = ((Math.random() * (_local4 - _local3)) + _local3);
_local8 = ((y)<(stage.stageHeight / 2)) ? 0 : stage.stageHeight;
} else {
_local6 = Math.max((y - _local9), 0);
_local7 = Math.min((y + _local9), stage.stageHeight);
_local8 = ((Math.random() * (_local7 - _local6)) + _local6);
_local5 = ((x)<(stage.stageWidth / 2)) ? 0 : stage.stageWidth;
};
XTween = new Tween(this, "x", Regular.easeOut, _local5, x, 2, true);
YTween = new Tween(this, "y", Regular.easeOut, _local8, y, 2, true);
TweenFilterLite.to(this, 2, {dropShadowFilter:{distance:0, blurX:2, blurY:2}, ease:Bounce.easeOut});
XSTween = new Tween(this, "scaleX", Bounce.easeOut, 2, 1, 2, true);
YSTween = new Tween(this, "scaleY", Bounce.easeOut, 2, 1, 2, true);
addEventListener(Event.ENTER_FRAME, elEnterFrame);
}
override public function Mobilize(){
TweenFilterLite.to(this, 2, {dropShadowFilter:{distance:0, blurX:2, blurY:2}, ease:Bounce.easeOut});
if (XTween){
XTween.resume();
};
if (YTween){
YTween.resume();
};
if (XSTween){
XSTween.resume();
};
if (YSTween){
YSTween.resume();
};
addEventListener(Event.ENTER_FRAME, elEnterFrame);
}
private function elEnterFrame(_arg1:Event){
}
override public function Immobilize(){
TweenFilterLite.killTweensOf(this);
XTween.stop();
YTween.stop();
XSTween.stop();
YSTween.stop();
removeEventListener(Event.ENTER_FRAME, elEnterFrame);
}
private function elRemovedFromStage(_arg1:Event){
}
}
}//package
Section 49
//ScoreBox (ScoreBox)
package {
import flash.display.*;
public dynamic class ScoreBox extends MovieClip {
public var Text:MovieClip;
public function ScoreBox(){
addFrameScript(24, frame25);
}
function frame25(){
if (this.stage){
this.parent.removeChild(this);
};
}
}
}//package
Section 50
//ShatteringGlass (ShatteringGlass)
package {
import flash.events.*;
import flash.display.*;
import fl.transitions.*;
import flash.geom.*;
import fl.transitions.easing.*;
import flash.utils.*;
public class ShatteringGlass extends Sprite {
private var DropRandomizeOrder:Boolean;
private var DropEasing:Function;
private var DropInterval:Number;
private var DropTweens:Array;
private var DropTimer:Timer;
private var DropFinalY:Number;
public var ShardHolders:Array;
private var DropDuration:Number;
private var DropDelayTimer:Timer;
private function SetUpDrop(_arg1:TimerEvent=null){
DropTimer = new Timer((DropInterval * 1000), ShardHolders.length);
DropTimer.addEventListener(TimerEvent.TIMER, DropNextShard);
DropTimer.start();
}
private function ShardHasDropped(_arg1:TweenEvent){
_arg1.target.obj.dispatchEvent(new Event("ShardHasDropped"));
}
public function DropShards(_arg1:Object=null){
var _local2:*;
var _local3:Number;
_local2 = (_arg1) ? _arg1 : new Object();
DropInterval = ((_local2.Interval)>=0) ? _local2.Interval : 0.3;
DropEasing = (_local2.Easing) ? _local2.Easing : Regular.easeIn;
DropDuration = (_local2.Duration) ? _local2.Duration : 1;
DropFinalY = (_local2.FinalY) ? _local2.FinalY : 1000;
DropRandomizeOrder = (_local2.RandomizeOrder) ? _local2.RandomizeOrder : true;
_local3 = ((_local2.InitialDelay)>=0) ? _local2.InitialDelay : 0;
if (_local3 == 0){
SetUpDrop();
} else {
DropDelayTimer = new Timer((_local3 * 1000), 1);
DropDelayTimer.addEventListener(TimerEvent.TIMER, SetUpDrop);
DropDelayTimer.start();
};
DropTweens = new Array();
}
private function DropNextShard(_arg1:TimerEvent){
var _local2:*;
var _local3:*;
var _local4:*;
if (DropRandomizeOrder){
_local2 = Math.floor((Math.random() * ShardHolders.length));
} else {
_local2 = 0;
};
_local3 = ShardHolders[_local2];
_local4 = new Tween(_local3, "y", DropEasing, _local3.y, DropFinalY, DropDuration, true);
_local4.addEventListener(TweenEvent.MOTION_FINISH, ShardHasDropped);
DropTweens.push(_local4);
ShardHolders.splice(_local2, 1);
if (ShardHolders.length == 0){
dispatchEvent(new Event("FinalShardIsDropping"));
};
}
public function Shatter(_arg1:DisplayObject, _arg2:Object=null){
var _local3:*;
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Array;
var _local12:Number;
var _local13:Array;
var _local14:Array;
var _local15:*;
var _local16:*;
var _local17:Array;
var _local18:*;
var _local19:Array;
var _local20:Number;
var _local21:*;
var _local22:*;
var _local23:int;
var _local24:uint;
var _local25:Point;
var _local26:*;
var _local27:*;
var _local28:Array;
var _local29:*;
var _local30:Sprite;
var _local31:Sprite;
var _local32:*;
var _local33:Rectangle;
var _local34:BitmapData;
var _local35:Bitmap;
var _local36:Sprite;
_local3 = _arg1;
_local4 = _arg2;
_local5 = (_local4.CenterX) ? _local4.CenterX : (_local3.width / 2);
_local6 = (_local4.CenterY) ? _local4.CenterY : (_local3.height / 2);
_local7 = (_local4.MinShardSize) ? _local4.MinShardSize : 20;
_local8 = (_local4.MaxShardSize) ? _local4.MaxShardSize : 60;
_local9 = (((_local4.RadiusFirst) && ((_local4.RadiusFirst > 0)))) ? _local4.RadiusFirst : 20;
_local10 = (((_local4.RadiusMultiplier) && ((_local4.RadiusMultiplier > 1)))) ? _local4.RadiusMultiplier : 1.3;
_local11 = new Array();
_local11.push({Coord:new Point(_local3.width, _local3.height), Angle:((Math.atan2((_local3.height - _local6), (_local3.width - _local5)) * 180) / Math.PI)});
_local11.push({Coord:new Point(0, _local3.height), Angle:((Math.atan2((_local3.height - _local6), -(_local5)) * 180) / Math.PI)});
_local11.push({Coord:new Point(0, 0), Angle:(((Math.atan2(-(_local6), -(_local5)) * 180) / Math.PI) + 360)});
_local11.push({Coord:new Point(_local3.width, 0), Angle:(((Math.atan2(-(_local6), (_local3.width - _local5)) * 180) / Math.PI) + 360)});
_local12 = 0;
_local13 = new Array();
while (_local12 < 360) {
_local19 = new Array(new Point(_local5, _local6));
_local20 = _local9;
_local21 = _local5;
_local22 = _local6;
while ((((((((_local21 > 0)) && ((_local21 < _local3.width)))) && ((_local22 > 0)))) && ((_local22 < _local3.height)))) {
_local23 = ((_local12 - (Math.random() * ((_local7 / 2) - 4))) - (((_local7 / 2) - 4) / 2));
_local21 = int((_local5 + (Math.cos(((_local23 / 180) * Math.PI)) * _local20)));
_local22 = int((_local6 + (Math.sin(((_local23 / 180) * Math.PI)) * _local20)));
_local21 = ((_local21)<0) ? 0 : _local21;
_local21 = ((_local21)>_local3.width) ? _local3.width : _local21;
_local22 = ((_local22)<0) ? 0 : _local22;
_local22 = ((_local22)>_local3.height) ? _local3.height : _local22;
_local25 = new Point(_local21, _local22);
_local19.push(_local25);
_local20 = (_local20 * _local10);
};
_local23 = ((_local23)<0) ? (_local23 + 360) : _local23;
_local24 = 0;
_local16 = 0;
while (_local16 < _local11.length) {
if (_local23 > _local11[_local16].Angle){
_local24++;
};
_local16++;
};
_local24 = ((_local24)==4) ? 0 : _local24;
_local13.push({FinalAngle:_local23, EndQuadrant:_local24, Points:_local19});
_local12 = (_local12 + ((Math.random() * (_local8 - _local7)) + _local7));
};
_local14 = new Array();
_local15 = 0;
while (_local15 < _local13.length) {
_local26 = _local13[_local15];
if (_local15 < (_local13.length - 1)){
_local27 = _local13[(_local15 + 1)];
} else {
_local27 = _local13[0];
};
_local28 = new Array();
_local16 = 0;
while (_local16 < _local26.Points.length) {
_local28.push(_local26.Points[_local16]);
_local16++;
};
_local29 = _local26.EndQuadrant;
while (_local29 != _local27.EndQuadrant) {
_local28.push(_local11[_local29].Coord);
++_local29;
if (_local29 == 4){
_local29 = 0;
};
};
_local16 = (_local27.Points.length - 1);
while (_local16 >= 0) {
_local28.push(_local27.Points[_local16]);
_local16--;
};
_local14.push(_local28);
_local15++;
};
_local17 = new Array();
ShardHolders = new Array();
_local18 = new BitmapData(_local3.width, _local3.height);
_local18.draw(_local3);
_local16 = 0;
while (_local16 < _local14.length) {
_local30 = new Sprite();
_local31 = new Sprite();
_local31.graphics.moveTo(0, 0);
_local31.graphics.beginFill(0xFFFFFF, 1);
_local32 = 0;
while (_local32 < _local14[_local16].length) {
_local31.graphics.lineTo(_local14[_local16][_local32].x, _local14[_local16][_local32].y);
_local32++;
};
_local31.graphics.endFill();
_local33 = _local31.getBounds(_local30);
_local17.push(_local33);
_local34 = new BitmapData(_local17[_local16].width, _local17[_local16].height, false, 0);
_local34.copyPixels(_local18, new Rectangle(_local17[_local16].x, _local17[_local16].y, (_local17[_local16].x + _local17[_local16].width), (_local17[_local16].y + _local17[_local16].height)), new Point());
_local35 = new Bitmap(_local34);
_local36 = new Sprite();
_local36.addChild(_local35);
_local36.x = _local17[_local16].x;
_local36.y = _local17[_local16].y;
_local30.addChild(_local36);
_local30.addChild(_local31);
_local36.mask = _local31;
_local30.x = _local3.x;
_local30.y = _local3.y;
_local3.parent.addChild(_local30);
ShardHolders.push(_local30);
_local16++;
};
_local3.parent.removeChild(_local3);
}
}
}//package
Section 51
//Snake (Snake)
package {
import flash.events.*;
import flash.display.*;
import flash.ui.*;
public class Snake extends MovieClip {
private const BASE_PART_DELAY:Number = 5;
private const BASE_SPEED:Number = 3;
var Length:int;
public var Tongue:MovieClip;
private var Speed;
var PartDelay:Number;
var Direction:Number;
var WrapOffset:uint;// = 10
var PartDelayCounter:Number;
var SpeedState:String;
public var CollisionArea:MovieClip;
var Parts:Array;
var Movement:Array;
public function Snake(){
WrapOffset = 10;
super();
Key.initialize(stage);
Length = 1;
Direction = 190;
Movement = new Array();
Parts = new Array();
PartDelayCounter = 0;
SpeedState = "Normal";
PartDelay = BASE_PART_DELAY;
addEventListener(Event.ADDED_TO_STAGE, elAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, elRemovedFromStage);
}
private function elAddedToStage(_arg1:Event){
addEventListener(Event.ENTER_FRAME, elEnterFrame);
}
public function Mobilize(_arg1:Event=null){
addEventListener(Event.ENTER_FRAME, elEnterFrame);
}
public function elFoodWasEaten(_arg1:Event){
var _local2:*;
Tongue.play();
_local2 = _arg1.target;
if ((_local2 is Pellet)){
Length++;
};
}
private function elEnterFrame(_arg1:Event){
var _local2:SnakePart;
if (Key.isDown(Keyboard.LEFT)){
Direction = (Direction - 10);
} else {
if (Key.isDown(Keyboard.RIGHT)){
Direction = (Direction + 10);
};
};
if (Key.isDown(Keyboard.UP)){
if (SpeedState != "Faster"){
Speed = (BASE_SPEED * 1.8);
PartDelay = (BASE_PART_DELAY * 0.5);
PartDelayCounter = (PartDelayCounter * 0.5);
SpeedState = "Faster";
};
} else {
if (Key.isDown(Keyboard.DOWN)){
if (SpeedState != "Slower"){
Speed = (BASE_SPEED * 0.5);
PartDelay = (BASE_PART_DELAY * 2);
PartDelayCounter = (PartDelayCounter * 2);
SpeedState = "Slower";
};
} else {
Speed = BASE_SPEED;
PartDelay = BASE_PART_DELAY;
if (SpeedState == "Faster"){
PartDelayCounter = (PartDelayCounter * 2);
} else {
if (SpeedState == "Slower"){
PartDelayCounter = (PartDelayCounter * 0.5);
};
};
SpeedState = "Normal";
};
};
if (x < -(WrapOffset)){
x = (stage.stageWidth + WrapOffset);
} else {
if (x > (stage.stageWidth + WrapOffset)){
x = -(WrapOffset);
};
};
if (y < -(WrapOffset)){
y = (stage.stageHeight + WrapOffset);
} else {
if (y > (stage.stageHeight + WrapOffset)){
y = -(WrapOffset);
};
};
rotation = Direction;
PartDelayCounter++;
if (PartDelayCounter >= PartDelay){
PartDelayCounter = 0;
Movement.push({X:x, Y:y});
_local2 = new SnakePart();
_local2.x = x;
_local2.y = y;
_local2.rotation = Direction;
Parts.push(_local2);
GameMode(Snaketastic.CurrentGameHolder).SnakePartsHolder.addChild(_local2);
if (Movement.length > Length){
Parts[0].Remove();
Parts.shift();
Movement.shift();
};
};
x = (x + (Math.cos(((Direction / 180) * Math.PI)) * Speed));
y = (y + (Math.sin(((Direction / 180) * Math.PI)) * Speed));
}
public function Immobilize(_arg1:Event=null){
removeEventListener(Event.ENTER_FRAME, elEnterFrame);
}
private function elRemovedFromStage(_arg1:Event){
removeEventListener(Event.ENTER_FRAME, elEnterFrame);
}
}
}//package
Section 52
//SnakePart (SnakePart)
package {
import gs.*;
import flash.events.*;
import flash.display.*;
import fl.transitions.*;
public class SnakePart extends MovieClip {
var XSTween:Tween;
var YSTween:Tween;
public function SnakePart(){
stop();
addEventListener(Event.ADDED_TO_STAGE, elAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, elRemovedFromStage);
}
private function RemoveFromStage(){
parent.removeChild(this);
}
private function elAddedToStage(_arg1:Event){
addEventListener(Event.ENTER_FRAME, elEnterFrame);
}
private function elEnterFrame(_arg1:Event){
}
public function Remove(){
TweenLite.to(this, 0.5, {scaleX:0.01, scaleY:0.01, onComplete:RemoveFromStage});
}
private function elRemovedFromStage(_arg1:Event){
removeEventListener(Event.ADDED_TO_STAGE, elAddedToStage);
removeEventListener(Event.REMOVED_FROM_STAGE, elRemovedFromStage);
removeEventListener(Event.ENTER_FRAME, elEnterFrame);
}
}
}//package
Section 53
//Snaketastic (Snaketastic)
package {
import gs.*;
import flash.events.*;
import flash.display.*;
import fl.transitions.easing.*;
import mochi.*;
import flash.text.*;
import PsyStats.*;
public dynamic class Snaketastic extends MovieClip {
private var GameModeAdvanced1:GameModeAdvanced;
private var PsyLoginDialogLoader:Loader;
private var LeaderboardViewer1:LeaderboardViewer;
private var TitleScreenStyle:String;
private var GameModeClassic1:GameModeClassic;
private var GameModeSelection1:GameModeSelection;
private var TitleScreen1:TitleScreen;
public static const GAME_MODE_IDS:Object = {ADVANCED:1, CLASSIC_SLOW:2, CLASSIC_MED:3, CLASSIC_FAST:4};
public static var txt:TextField;
public static var CurrentGameHolder:Sprite;
public function Snaketastic(){
var _local1:Array;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3);
stage.quality = StageQuality.BEST;
_local1 = new Array("Advanced", "Classic");
TitleScreenStyle = _local1[Math.floor((Math.random() * _local1.length))];
Key.initialize(stage);
}
public function elScreenRemoved(_arg1:Event){
var _local2:*;
_local2 = _arg1.target;
if ((_local2 is GameModeSelection)){
_local2.removeEventListener("ModeSelected", StartGame);
_local2.removeEventListener("ScreenRemoved", elScreenRemoved);
};
}
private function elKeyDown(_arg1:KeyboardEvent){
switch (_arg1.keyCode){
case 83:
SoundManager.ToggleSounds();
SoundManager.ToggleMusic();
break;
};
}
public function Init(){
stage.addEventListener(KeyboardEvent.KEY_DOWN, elKeyDown);
stage.addEventListener(Event.RESIZE, elResize);
stage.stageFocusRect = false;
SoundManager.InitSounds();
GamestatsManager.connect();
ViewTitleScreen();
}
public function elResize(_arg1:Event){
trace(stage.scaleY);
trace(stage.stageWidth);
}
public function StartGame(_arg1:Event){
var _local2:*;
var _local3:DialogBox;
if (((TitleScreen1) && (contains(TitleScreen1)))){
TitleScreen1.alpha = 0;
TitleScreen1.x = stage.stageWidth;
};
_local2 = _arg1.target.ActivatedMode;
if (((GameModeAdvanced1) && (contains(GameModeAdvanced1)))){
removeChild(GameModeAdvanced1);
};
if (((GameModeClassic1) && (contains(GameModeClassic1)))){
removeChild(GameModeClassic1);
};
if (_local2 == "Advanced"){
GameModeAdvanced1 = new GameModeAdvanced();
GameModeAdvanced1.addEventListener("ScreenCancelled", elScreenCancelled);
addChildAt(GameModeAdvanced1, 0);
CurrentGameHolder = GameModeAdvanced1;
GameModeAdvanced1.Start();
} else {
if (_local2 == "Classic"){
GameModeClassic1 = new GameModeClassic();
GameModeClassic1.addEventListener("ScreenCancelled", elScreenCancelled);
addChildAt(GameModeClassic1, 0);
CurrentGameHolder = GameModeClassic1;
GameModeClassic1.PreparePlayingField();
_local3 = new DialogBox("SPEED", new Array({Text:"SLOW", OnSelect:GameModeClassic1.Start, OnSelectParams:{Speed:"Slow"}}, {Text:"MEDIUM", OnSelect:GameModeClassic1.Start, OnSelectParams:{Speed:"Medium"}}, {Text:"FAST", OnSelect:GameModeClassic1.Start, OnSelectParams:{Speed:"Fast"}}));
_local3.x = (((stage.stageWidth / 2) - (_local3.width / 2)) + 10);
_local3.y = ((stage.stageHeight / 2) - (_local3.height / 2));
addChild(_local3);
stage.focus = _local3;
};
};
}
function frame3(){
Init();
stop();
}
public function ViewModeSelection(_arg1:Event=null){
GameModeSelection1 = new GameModeSelection();
GameModeSelection1.addEventListener("ModeSelected", StartGame);
GameModeSelection1.addEventListener("ScreenRemoved", elScreenRemoved);
GameModeSelection1.addEventListener("ScreenCancelled", elScreenCancelled);
SoundManager.PlayMusic("GameModeSelection", 0, 99999);
addChild(GameModeSelection1);
}
function frame1(){
MochiBot.track(this, "6f001e2b");
MochiServices.connect("ab4d24068d9e507a", root);
}
public function ViewLeaderboards(_arg1:Event=null){
LeaderboardViewer1 = new LeaderboardViewer();
LeaderboardViewer1.addEventListener("ScreenCancelled", elScreenCancelled);
addChild(LeaderboardViewer1);
}
function frame2(){
MochiAd.showPreGameAd({clip:root, id:"ab4d24068d9e507a", res:"450x450"});
}
public function elScreenCancelled(_arg1:Event){
var _local2:*;
_local2 = _arg1.target;
if ((_local2 is GameModeAdvanced)){
ViewModeSelection();
} else {
if ((_local2 is GameModeClassic)){
ViewModeSelection();
} else {
if ((_local2 is GameModeSelection)){
ViewTitleScreen();
} else {
if ((_local2 is LeaderboardViewer)){
ViewTitleScreen();
};
};
};
};
}
public function CheckDomain(_arg1:Event=null){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
_local2 = (this.loaderInfo.url.indexOf("://") + 3);
_local3 = this.loaderInfo.url.indexOf("/", _local2);
_local4 = this.loaderInfo.url.substring(_local2, _local3);
_local5 = (_local4.lastIndexOf(".") - 1);
_local6 = (_local4.lastIndexOf(".", _local5) + 1);
_local4 = _local4.substring(_local6, _local4.length);
if (_local4 != "flashgamelicense.com"){
root.x = 50000;
root.y = 40000;
};
}
public function ViewTitleScreen(){
if (((TitleScreen1) && (contains(TitleScreen1)))){
};
if (((GameModeAdvanced1) && (contains(GameModeAdvanced1)))){
removeChild(GameModeAdvanced1);
};
if (((GameModeClassic1) && (contains(GameModeClassic1)))){
removeChild(GameModeClassic1);
};
if (!TitleScreen1){
TitleScreen1 = new TitleScreen(TitleScreenStyle);
TitleScreen1.addEventListener("StartGame", ViewModeSelection);
TitleScreen1.addEventListener("ViewLeaderboards", ViewLeaderboards);
addChildAt(TitleScreen1, 0);
} else {
if (!contains(TitleScreen1)){
addChildAt(TitleScreen1, 0);
};
};
TitleScreen1.alpha = 1;
TitleScreen1.x = 0;
if ((TitleScreen1.Content is TitleScreenAdvanced)){
TitleScreenAdvanced(TitleScreen1.Content).MainMenu1.Activate();
} else {
if ((TitleScreen1.Content is TitleScreenClassic)){
TitleScreenClassic(TitleScreen1.Content).MainMenu1.Activate();
};
};
}
}
}//package
Section 54
//sndAchievementAwarded (sndAchievementAwarded)
package {
import flash.media.*;
public dynamic class sndAchievementAwarded extends Sound {
}
}//package
Section 55
//sndCGulp (sndCGulp)
package {
import flash.media.*;
public dynamic class sndCGulp extends Sound {
}
}//package
Section 56
//sndCGulp2 (sndCGulp2)
package {
import flash.media.*;
public dynamic class sndCGulp2 extends Sound {
}
}//package
Section 57
//sndCGulp3 (sndCGulp3)
package {
import flash.media.*;
public dynamic class sndCGulp3 extends Sound {
}
}//package
Section 58
//sndGameModeHighlight (sndGameModeHighlight)
package {
import flash.media.*;
public dynamic class sndGameModeHighlight extends Sound {
}
}//package
Section 59
//sndGameModeHighlight2 (sndGameModeHighlight2)
package {
import flash.media.*;
public dynamic class sndGameModeHighlight2 extends Sound {
}
}//package
Section 60
//sndGameModeHighlight3 (sndGameModeHighlight3)
package {
import flash.media.*;
public dynamic class sndGameModeHighlight3 extends Sound {
}
}//package
Section 61
//sndGameModeSelection (sndGameModeSelection)
package {
import flash.media.*;
public dynamic class sndGameModeSelection extends Sound {
}
}//package
Section 62
//sndGlass1 (sndGlass1)
package {
import flash.media.*;
public dynamic class sndGlass1 extends Sound {
}
}//package
Section 63
//sndGlass2 (sndGlass2)
package {
import flash.media.*;
public dynamic class sndGlass2 extends Sound {
}
}//package
Section 64
//sndGlass3 (sndGlass3)
package {
import flash.media.*;
public dynamic class sndGlass3 extends Sound {
}
}//package
Section 65
//sndGlass4 (sndGlass4)
package {
import flash.media.*;
public dynamic class sndGlass4 extends Sound {
}
}//package
Section 66
//sndGlass5 (sndGlass5)
package {
import flash.media.*;
public dynamic class sndGlass5 extends Sound {
}
}//package
Section 67
//sndGlass6 (sndGlass6)
package {
import flash.media.*;
public dynamic class sndGlass6 extends Sound {
}
}//package
Section 68
//sndGlass7 (sndGlass7)
package {
import flash.media.*;
public dynamic class sndGlass7 extends Sound {
}
}//package
Section 69
//sndGulp (sndGulp)
package {
import flash.media.*;
public dynamic class sndGulp extends Sound {
}
}//package
Section 70
//SoundManager (SoundManager)
package {
import flash.events.*;
import flash.display.*;
import flash.filters.*;
import fl.transitions.*;
import flash.media.*;
import fl.transitions.easing.*;
public class SoundManager extends MovieClip {
public static var Music:Object = new Object();
public static var MusicState:String;
public static var SoundsState:String;
public static var Sounds:Object = new Object();
private static var MusicTransform1:SoundTransform;
private static var MusicIsMuted:Boolean;
public static var MusicChannel1:SoundChannel;
private static var VTween:Tween;
private static var SoundsAreMuted:Boolean;
public static function UnmuteSounds(){
SoundsAreMuted = false;
}
public static function ToggleMusic(){
if (MusicIsMuted){
if (VTween){
VTween.stop();
};
VTween = new Tween(MusicTransform1, "volume", Regular.easeOut, MusicTransform1.volume, 1, 0.5, true);
VTween.addEventListener(TweenEvent.MOTION_CHANGE, elSetMusicTransform);
MusicIsMuted = false;
} else {
if (VTween){
VTween.stop();
};
VTween = new Tween(MusicTransform1, "volume", Regular.easeOut, MusicTransform1.volume, 0, 0.5, true);
VTween.addEventListener(TweenEvent.MOTION_CHANGE, elSetMusicTransform);
MusicIsMuted = true;
};
}
public static function InitSounds(){
SoundsAreMuted = false;
MusicIsMuted = false;
SoundsState = "PlayAll";
MusicState = "PlayAll";
Sounds.Gulp = new sndGulp();
Music.GameModeSelection = new sndGameModeSelection();
Sounds.GameModeHighlight = new sndGameModeHighlight();
Sounds.GameModeHighlight2 = new sndGameModeHighlight2();
Sounds.GameModeHighlight3 = new sndGameModeHighlight3();
Sounds.AchievementAwarded = new sndAchievementAwarded();
Sounds.CGulp = new sndCGulp();
Sounds.CGulp2 = new sndCGulp2();
Sounds.CGulp3 = new sndCGulp3();
Sounds.Glass1 = new sndGlass1();
Sounds.Glass2 = new sndGlass2();
Sounds.Glass3 = new sndGlass3();
Sounds.Glass4 = new sndGlass4();
Sounds.Glass5 = new sndGlass5();
Sounds.Glass6 = new sndGlass6();
Sounds.Glass7 = new sndGlass7();
MusicTransform1 = new SoundTransform();
}
private static function elStopMusic(_arg1:TweenEvent){
MusicChannel1.stop();
MusicChannel1 = null;
}
public static function MuteSounds(){
SoundsAreMuted = true;
}
public static function ToggleSounds(){
if (SoundsAreMuted){
SoundsAreMuted = false;
} else {
SoundsAreMuted = true;
};
}
public static function StopMusic(){
if (VTween){
VTween.stop();
};
VTween = new Tween(MusicTransform1, "volume", Regular.easeOut, MusicTransform1.volume, 0, 0.5, true);
VTween.addEventListener(TweenEvent.MOTION_CHANGE, elSetMusicTransform);
VTween.addEventListener(TweenEvent.MOTION_FINISH, elStopMusic);
}
private static function elSetMusicTransform(_arg1:TweenEvent){
if (((MusicChannel1) && (MusicTransform1))){
MusicChannel1.soundTransform = MusicTransform1;
};
}
public static function MuteMusic(){
MusicIsMuted = true;
}
public static function PlayMusic(_arg1:String, _arg2:int=0, _arg3:int=0){
if (MusicState == "PlayAll"){
MusicChannel1 = new SoundChannel();
MusicChannel1 = Music[_arg1].play(_arg2, _arg3);
if (VTween){
VTween.stop();
};
if (MusicIsMuted){
MusicTransform1.volume = 0;
} else {
MusicTransform1.volume = 1;
};
MusicChannel1.soundTransform = MusicTransform1;
};
}
public static function UnmuteMusic(){
MusicIsMuted = false;
}
public static function PlaySound(_arg1:String, _arg2:int=0, _arg3:int=0){
if (((!(SoundsAreMuted)) && ((((SoundsState == "PlayAll")) || ((_arg1 == "BubblePop")))))){
Sounds[_arg1].play(_arg2, _arg3);
};
}
}
}//package
Section 71
//Strawberry (Strawberry)
package {
import flash.display.*;
public class Strawberry extends Fruit {
public var Gfx:MovieClip;
public function Strawberry(){
BasePoints = 50000;
}
}
}//package
Section 72
//TitleScreen (TitleScreen)
package {
import flash.events.*;
import flash.display.*;
public class TitleScreen extends Sprite {
var ActivatedMode:String;
var Content:Sprite;
public function TitleScreen(_arg1:String){
var _local2:*;
super();
_local2 = _arg1;
if (_local2 == "Advanced"){
Content = new TitleScreenAdvanced();
} else {
if (_local2 == "Classic"){
Content = new TitleScreenClassic();
};
};
Content.addEventListener("StartGame", StartGame);
Content.addEventListener("ViewLeaderboards", ViewLeaderboards);
addChild(Content);
}
private function ViewLeaderboards(_arg1:Event){
this.dispatchEvent(new Event("ViewLeaderboards"));
}
private function StartGame(_arg1:Event){
this.dispatchEvent(new Event("StartGame"));
}
}
}//package
Section 73
//TitleScreenAdvanced (TitleScreenAdvanced)
package {
import flash.events.*;
import flash.display.*;
import flash.external.*;
public class TitleScreenAdvanced extends Sprite {
public var MainMenu1:MainMenu;
private var MainMenuItems:Array;
public function TitleScreenAdvanced(){
addEventListener(Event.ADDED_TO_STAGE, elAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, elRemovedFromStage);
MainMenuItems = new Array({Title:"Start Game", TextClass:MainMenuItemText, OnActivated:StartGame, DeactivateOnClick:true}, {Title:"Leaderboards", TextClass:MainMenuItemText, OnActivated:ViewLeaderboards, DeactivateOnClick:true}, {Title:"More Games At JessHansen.com", TextClass:MainMenuItemText, OnActivated:PlayMoreGames, DeactivateOnClick:false});
}
public function ViewLeaderboards(){
this.dispatchEvent(new Event("ViewLeaderboards"));
}
public function StartGame(){
this.dispatchEvent(new Event("StartGame"));
}
private function elAddedToStage(_arg1:Event){
MainMenu1 = new MainMenu(MainMenuItems);
MainMenu1.y = 240;
addChild(MainMenu1);
stage.focus = this;
}
public function PlayMoreGames(){
ExternalInterface.call("window.open", "http://www.jesshansen.com/games", "_blank");
}
private function elRemovedFromStage(_arg1:Event){
}
}
}//package
Section 74
//TitleScreenClassic (TitleScreenClassic)
package {
import flash.events.*;
import flash.display.*;
import flash.external.*;
public class TitleScreenClassic extends Sprite {
var MainMenu1:MainMenu;
var MainMenuItems:Array;
public function TitleScreenClassic(){
addEventListener(Event.ADDED_TO_STAGE, elAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, elRemovedFromStage);
MainMenuItems = new Array({Title:"Start Game", TextClass:CMainMenuItemText, OnActivated:StartGame, DeactivateOnClick:true}, {Title:"Leaderboards", TextClass:CMainMenuItemText, OnActivated:ViewLeaderboards, DeactivateOnClick:true}, {Title:"More Games At JessHansen.com", TextClass:CMainMenuItemText, OnActivated:PlayMoreGames, DeactivateOnClick:false});
}
public function ViewLeaderboards(){
this.dispatchEvent(new Event("ViewLeaderboards"));
}
public function StartGame(){
this.dispatchEvent(new Event("StartGame"));
}
private function elAddedToStage(_arg1:Event){
MainMenu1 = new MainMenu(MainMenuItems);
MainMenu1.y = 240;
addChild(MainMenu1);
stage.focus = this;
}
public function PlayMoreGames(){
ExternalInterface.call("window.open", "http://www.jesshansen.com/games", "_blank");
}
private function elRemovedFromStage(_arg1:Event){
}
}
}//package
Section 75
//Watermelon (Watermelon)
package {
import flash.display.*;
public class Watermelon extends Fruit {
public var Gfx:MovieClip;
public function Watermelon(){
BasePoints = 60000;
}
}
}//package