Section 1
//AdLoader (CPMStar.AdLoader)
package CPMStar {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.system.*;
public class AdLoader extends Sprite {
private var contentspotid:String;
private var cpmstarLoader:Loader;
public function AdLoader(contentspotid:String){
super();
this.contentspotid = contentspotid;
addEventListener(Event.ADDED, addedHandler);
}
private function addedHandler(event:Event):void{
var cpmstarViewSWFUrl:String;
var container:DisplayObjectContainer;
removeEventListener(Event.ADDED, addedHandler);
Security.allowDomain("server.cpmstar.com");
cpmstarViewSWFUrl = "http://server.cpmstar.com/adviewas3.swf";
container = parent;
cpmstarLoader = new Loader();
cpmstarLoader.contentLoaderInfo.addEventListener(Event.INIT, dispatchHandler);
cpmstarLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dispatchHandler);
cpmstarLoader.load(new URLRequest(((cpmstarViewSWFUrl + "?contentspotid=") + contentspotid)));
addChild(cpmstarLoader);
}
private function dispatchHandler(event:Event):void{
dispatchEvent(event);
}
}
}//package CPMStar
Section 2
//TweenEvent (gs.events.TweenEvent)
package gs.events {
import flash.events.*;
public class TweenEvent extends Event {
public var info:Object;
public static const UPDATE:String = "update";
public static const START:String = "start";
public static const version:Number = 0.9;
public static const COMPLETE:String = "complete";
public function TweenEvent($type:String, $info:Object=null, $bubbles:Boolean=false, $cancelable:Boolean=false){
super($type, $bubbles, $cancelable);
this.info = $info;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.info, this.bubbles, this.cancelable));
}
}
}//package gs.events
Section 3
//AutoAlphaPlugin (gs.plugins.AutoAlphaPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class AutoAlphaPlugin extends TweenPlugin {
protected var _tweenVisible:Boolean;
protected var _tween:TweenLite;
protected var _visible:Boolean;
protected var _target:Object;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function AutoAlphaPlugin(){
super();
this.propName = "autoAlpha";
this.overwriteProps = ["alpha", "visible"];
this.onComplete = onCompleteTween;
}
override public function set changeFactor($n:Number):void{
updateTweens($n);
if (((!((_target.visible == true))) && (_tweenVisible))){
_target.visible = true;
};
}
public function onCompleteTween():void{
if (((((_tweenVisible) && (!((_tween.vars.runBackwards == true))))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
_target = $target;
_tween = $tween;
_visible = Boolean(!(($value == 0)));
_tweenVisible = true;
addTween($target, "alpha", $target.alpha, $value, "alpha");
return (true);
}
override public function killProps($lookup:Object):void{
super.killProps($lookup);
_tweenVisible = !(Boolean(("visible" in $lookup)));
}
}
}//package gs.plugins
Section 4
//BevelFilterPlugin (gs.plugins.BevelFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class BevelFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BevelFilterPlugin(){
super();
this.propName = "bevelFilter";
this.overwriteProps = ["bevelFilter"];
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
_target = $target;
_type = BevelFilter;
initFilter($value, new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, (($value.quality) || (2))));
return (true);
}
}
}//package gs.plugins
Section 5
//BezierPlugin (gs.plugins.BezierPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class BezierPlugin extends TweenPlugin {
protected var _future:Object;
protected var _orient:Boolean;
protected var _orientData:Array;
protected var _beziers:Object;
protected var _target:Object;
protected static const _RAD2DEG:Number = 57.2957795130823;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function BezierPlugin(){
_future = {};
super();
this.propName = "bezier";
this.overwriteProps = [];
}
override public function set changeFactor($n:Number):void{
var i:int;
var p:String;
var b:Object;
var t:Number;
var segments:uint;
var val:Number;
var neg:int;
var oldTarget:Object;
var oldRound:Boolean;
var dx:Number;
var dy:Number;
var cotb:Array;
var toAdd:Number;
if ($n == 1){
for (p in _beziers) {
i = (_beziers[p].length - 1);
_target[p] = _beziers[p][i][2];
};
} else {
for (p in _beziers) {
segments = _beziers[p].length;
if ($n < 0){
i = 0;
} else {
if ($n >= 1){
i = (segments - 1);
} else {
i = int((segments * $n));
};
};
t = (($n - (i * (1 / segments))) * segments);
b = _beziers[p][i];
if (this.round){
val = (b[0] + (t * (((2 * (1 - t)) * (b[1] - b[0])) + (t * (b[2] - b[0])))));
neg = ((val)<0) ? -1 : 1;
_target[p] = ((((val % 1) * neg))>0.5) ? (int(val) + neg) : int(val);
} else {
_target[p] = (b[0] + (t * (((2 * (1 - t)) * (b[1] - b[0])) + (t * (b[2] - b[0])))));
};
};
};
if (_orient){
oldTarget = _target;
oldRound = this.round;
_target = _future;
this.round = false;
_orient = false;
this.changeFactor = ($n + 0.01);
_target = oldTarget;
this.round = oldRound;
_orient = true;
i = 0;
while (i < _orientData.length) {
cotb = _orientData[i];
toAdd = ((cotb[3]) || (0));
dx = (_future[cotb[0]] - _target[cotb[0]]);
dy = (_future[cotb[1]] - _target[cotb[1]]);
_target[cotb[2]] = ((Math.atan2(dy, dx) * _RAD2DEG) + toAdd);
i++;
};
};
}
protected function init($tween:TweenLite, $beziers:Array, $through:Boolean):void{
var props:Object;
var i:int;
var p:String;
_target = $tween.target;
if ($tween.exposedVars.orientToBezier == true){
_orientData = [["x", "y", "rotation", 0]];
_orient = true;
} else {
if (($tween.exposedVars.orientToBezier is Array)){
_orientData = $tween.exposedVars.orientToBezier;
_orient = true;
};
};
props = {};
i = 0;
while (i < $beziers.length) {
for (p in $beziers[i]) {
if (props[p] == undefined){
props[p] = [$tween.target[p]];
};
if (typeof($beziers[i][p]) == "number"){
props[p].push($beziers[i][p]);
} else {
props[p].push(($tween.target[p] + Number($beziers[i][p])));
};
};
i++;
};
for (p in props) {
this.overwriteProps[this.overwriteProps.length] = p;
if ($tween.exposedVars[p] != undefined){
if (typeof($tween.exposedVars[p]) == "number"){
props[p].push($tween.exposedVars[p]);
} else {
props[p].push(($tween.target[p] + Number($tween.exposedVars[p])));
};
delete $tween.exposedVars[p];
i = ($tween.tweens.length - 1);
while (i > -1) {
if ($tween.tweens[i].name == p){
$tween.tweens.splice(i, 1);
};
i--;
};
};
};
_beziers = parseBeziers(props, $through);
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
if (!($value is Array)){
return (false);
};
init($tween, ($value as Array), false);
return (true);
}
override public function killProps($lookup:Object):void{
var p:String;
for (p in _beziers) {
if ((p in $lookup)){
delete _beziers[p];
};
};
super.killProps($lookup);
}
public static function parseBeziers($props:Object, $through:Boolean=false):Object{
var i:int;
var a:Array;
var b:Object;
var p:String;
var all:Object;
all = {};
if ($through){
for (p in $props) {
a = $props[p];
b = [];
all[p] = b;
if (a.length > 2){
b[b.length] = [a[0], (a[1] - ((a[2] - a[0]) / 4)), a[1]];
i = 1;
while (i < (a.length - 1)) {
b[b.length] = [a[i], (a[i] + (a[i] - b[(i - 1)][1])), a[(i + 1)]];
i++;
};
} else {
b[b.length] = [a[0], ((a[0] + a[1]) / 2), a[1]];
};
};
} else {
for (p in $props) {
a = $props[p];
b = [];
all[p] = b;
if (a.length > 3){
b[b.length] = [a[0], a[1], ((a[1] + a[2]) / 2)];
i = 2;
while (i < (a.length - 2)) {
b[b.length] = [b[(i - 2)][2], a[i], ((a[i] + a[(i + 1)]) / 2)];
i++;
};
b[b.length] = [b[(b.length - 1)][2], a[(a.length - 2)], a[(a.length - 1)]];
} else {
if (a.length == 3){
b[b.length] = [a[0], a[1], a[2]];
} else {
if (a.length == 2){
b[b.length] = [a[0], ((a[0] + a[1]) / 2), a[1]];
};
};
};
};
};
return (all);
}
}
}//package gs.plugins
Section 6
//BezierThroughPlugin (gs.plugins.BezierThroughPlugin)
package gs.plugins {
import gs.*;
public class BezierThroughPlugin extends BezierPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BezierThroughPlugin(){
super();
this.propName = "bezierThrough";
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
if (!($value is Array)){
return (false);
};
init($tween, ($value as Array), true);
return (true);
}
}
}//package gs.plugins
Section 7
//BlurFilterPlugin (gs.plugins.BlurFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class BlurFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BlurFilterPlugin(){
super();
this.propName = "blurFilter";
this.overwriteProps = ["blurFilter"];
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
_target = $target;
_type = BlurFilter;
initFilter($value, new BlurFilter(0, 0, (($value.quality) || (2))));
return (true);
}
}
}//package gs.plugins
Section 8
//ColorMatrixFilterPlugin (gs.plugins.ColorMatrixFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class ColorMatrixFilterPlugin extends FilterPlugin {
protected var _matrix:Array;
protected var _matrixTween:EndArrayPlugin;
public static const API:Number = 1;
public static const VERSION:Number = 1.1;
protected static var _lumG:Number = 0.71516;
protected static var _lumR:Number = 0.212671;
protected static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
protected static var _lumB:Number = 0.072169;
public function ColorMatrixFilterPlugin(){
super();
this.propName = "colorMatrixFilter";
this.overwriteProps = ["colorMatrixFilter"];
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
var cmf:Object;
var endMatrix:Array;
_target = $target;
_type = ColorMatrixFilter;
cmf = $value;
initFilter({remove:$value.remove, index:$value.index, addFilter:$value.addFilter}, new ColorMatrixFilter(_idMatrix.slice()));
_matrix = ColorMatrixFilter(_filter).matrix;
endMatrix = [];
if (((!((cmf.matrix == null))) && ((cmf.matrix is Array)))){
endMatrix = cmf.matrix;
} else {
if (cmf.relative == true){
endMatrix = _matrix.slice();
} else {
endMatrix = _idMatrix.slice();
};
endMatrix = setBrightness(endMatrix, cmf.brightness);
endMatrix = setContrast(endMatrix, cmf.contrast);
endMatrix = setHue(endMatrix, cmf.hue);
endMatrix = setSaturation(endMatrix, cmf.saturation);
endMatrix = setThreshold(endMatrix, cmf.threshold);
if (!isNaN(cmf.colorize)){
endMatrix = colorize(endMatrix, cmf.colorize, cmf.amount);
};
};
_matrixTween = new EndArrayPlugin();
_matrixTween.init(_matrix, endMatrix);
return (true);
}
override public function set changeFactor($n:Number):void{
_matrixTween.changeFactor = $n;
ColorMatrixFilter(_filter).matrix = _matrix;
super.changeFactor = $n;
}
public static function setSaturation($m:Array, $n:Number):Array{
var inv:Number;
var r:Number;
var g:Number;
var b:Number;
var temp:Array;
if (isNaN($n)){
return ($m);
};
inv = (1 - $n);
r = (inv * _lumR);
g = (inv * _lumG);
b = (inv * _lumB);
temp = [(r + $n), g, b, 0, 0, r, (g + $n), b, 0, 0, r, g, (b + $n), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(temp, $m));
}
public static function setHue($m:Array, $n:Number):Array{
var c:Number;
var s:Number;
var temp:Array;
if (isNaN($n)){
return ($m);
};
$n = ($n * (Math.PI / 180));
c = Math.cos($n);
s = Math.sin($n);
temp = [((_lumR + (c * (1 - _lumR))) + (s * -(_lumR))), ((_lumG + (c * -(_lumG))) + (s * -(_lumG))), ((_lumB + (c * -(_lumB))) + (s * (1 - _lumB))), 0, 0, ((_lumR + (c * -(_lumR))) + (s * 0.143)), ((_lumG + (c * (1 - _lumG))) + (s * 0.14)), ((_lumB + (c * -(_lumB))) + (s * -0.283)), 0, 0, ((_lumR + (c * -(_lumR))) + (s * -((1 - _lumR)))), ((_lumG + (c * -(_lumG))) + (s * _lumG)), ((_lumB + (c * (1 - _lumB))) + (s * _lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return (applyMatrix(temp, $m));
}
public static function setThreshold($m:Array, $n:Number):Array{
var temp:Array;
if (isNaN($n)){
return ($m);
};
temp = [(_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * $n), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * $n), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * $n), 0, 0, 0, 1, 0];
return (applyMatrix(temp, $m));
}
public static function applyMatrix($m:Array, $m2:Array):Array{
var temp:Array;
var i:int;
var z:int;
var y:int;
var x:int;
if (((!(($m is Array))) || (!(($m2 is Array))))){
return ($m2);
};
temp = [];
i = 0;
z = 0;
y = 0;
while (y < 4) {
x = 0;
while (x < 5) {
if (x == 4){
z = $m[(i + 4)];
} else {
z = 0;
};
temp[(i + x)] = ((((($m[i] * $m2[x]) + ($m[(i + 1)] * $m2[(x + 5)])) + ($m[(i + 2)] * $m2[(x + 10)])) + ($m[(i + 3)] * $m2[(x + 15)])) + z);
x++;
};
i = (i + 5);
y++;
};
return (temp);
}
public static function colorize($m:Array, $color:Number, $amount:Number=1):Array{
var r:Number;
var g:Number;
var b:Number;
var inv:Number;
var temp:Array;
if (isNaN($color)){
return ($m);
};
if (isNaN($amount)){
$amount = 1;
};
r = ((($color >> 16) & 0xFF) / 0xFF);
g = ((($color >> 8) & 0xFF) / 0xFF);
b = (($color & 0xFF) / 0xFF);
inv = (1 - $amount);
temp = [(inv + (($amount * r) * _lumR)), (($amount * r) * _lumG), (($amount * r) * _lumB), 0, 0, (($amount * g) * _lumR), (inv + (($amount * g) * _lumG)), (($amount * g) * _lumB), 0, 0, (($amount * b) * _lumR), (($amount * b) * _lumG), (inv + (($amount * b) * _lumB)), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(temp, $m));
}
public static function setBrightness($m:Array, $n:Number):Array{
if (isNaN($n)){
return ($m);
};
$n = (($n * 100) - 100);
return (applyMatrix([1, 0, 0, 0, $n, 0, 1, 0, 0, $n, 0, 0, 1, 0, $n, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], $m));
}
public static function setContrast($m:Array, $n:Number):Array{
var temp:Array;
if (isNaN($n)){
return ($m);
};
$n = ($n + 0.01);
temp = [$n, 0, 0, 0, (128 * (1 - $n)), 0, $n, 0, 0, (128 * (1 - $n)), 0, 0, $n, 0, (128 * (1 - $n)), 0, 0, 0, 1, 0];
return (applyMatrix(temp, $m));
}
}
}//package gs.plugins
Section 9
//DropShadowFilterPlugin (gs.plugins.DropShadowFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class DropShadowFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function DropShadowFilterPlugin(){
super();
this.propName = "dropShadowFilter";
this.overwriteProps = ["dropShadowFilter"];
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
_target = $target;
_type = DropShadowFilter;
initFilter($value, new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, (($value.quality) || (2)), $value.inner, $value.knockout, $value.hideObject));
return (true);
}
}
}//package gs.plugins
Section 10
//EndArrayPlugin (gs.plugins.EndArrayPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class EndArrayPlugin extends TweenPlugin {
protected var _info:Array;
protected var _a:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function EndArrayPlugin(){
_info = [];
super();
this.propName = "endArray";
this.overwriteProps = ["endArray"];
}
override public function set changeFactor($n:Number):void{
var i:int;
var ti:ArrayTweenInfo;
var val:Number;
var neg:int;
if (this.round){
i = (_info.length - 1);
while (i > -1) {
ti = _info[i];
val = (ti.start + (ti.change * $n));
neg = ((val)<0) ? -1 : 1;
_a[ti.index] = ((((val % 1) * neg))>0.5) ? (int(val) + neg) : int(val);
i--;
};
} else {
i = (_info.length - 1);
while (i > -1) {
ti = _info[i];
_a[ti.index] = (ti.start + (ti.change * $n));
i--;
};
};
}
public function init($start:Array, $end:Array):void{
var i:int;
_a = $start;
i = ($end.length - 1);
while (i > -1) {
if (((!(($start[i] == $end[i]))) && (!(($start[i] == null))))){
_info[_info.length] = new ArrayTweenInfo(i, _a[i], ($end[i] - _a[i]));
};
i--;
};
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
if (((!(($target is Array))) || (!(($value is Array))))){
return (false);
};
init(($target as Array), $value);
return (true);
}
}
}//package gs.plugins
Section 11
//FilterPlugin (gs.plugins.FilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
import gs.utils.tween.*;
public class FilterPlugin extends TweenPlugin {
protected var _index:int;
protected var _filter:BitmapFilter;
protected var _type:Class;
protected var _remove:Boolean;
protected var _target:Object;
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function FilterPlugin(){
super();
}
override public function set changeFactor($n:Number):void{
var i:int;
var ti:TweenInfo;
var filters:Array;
filters = _target.filters;
i = (_tweens.length - 1);
while (i > -1) {
ti = _tweens[i];
ti.target[ti.property] = (ti.start + (ti.change * $n));
i--;
};
if (!(filters[_index] is _type)){
_index = (filters.length - 1);
i = (filters.length - 1);
while (i > -1) {
if ((filters[i] is _type)){
_index = i;
break;
};
i--;
};
};
filters[_index] = _filter;
_target.filters = filters;
}
public function onCompleteTween():void{
var i:int;
var filters:Array;
if (_remove){
filters = _target.filters;
if (!(filters[_index] is _type)){
i = (filters.length - 1);
while (i > -1) {
if ((filters[i] is _type)){
filters.splice(i, 1);
break;
};
i--;
};
} else {
filters.splice(_index, 1);
};
_target.filters = filters;
};
}
protected function initFilter($props:Object, $default:BitmapFilter):void{
var filters:Array;
var p:String;
var i:int;
var colorTween:HexColorsPlugin;
var props:Object;
filters = _target.filters;
_index = -1;
if ($props.index != null){
_index = $props.index;
} else {
i = (filters.length - 1);
while (i > -1) {
if ((filters[i] is _type)){
_index = i;
break;
};
i--;
};
};
if ((((((_index == -1)) || ((filters[_index] == null)))) || (($props.addFilter == true)))){
_index = (($props.index)!=null) ? $props.index : filters.length;
filters[_index] = $default;
_target.filters = filters;
};
_filter = filters[_index];
_remove = Boolean(($props.remove == true));
if (_remove){
this.onComplete = onCompleteTween;
};
props = (($props.isTV)==true) ? $props.exposedVars : $props;
for (p in props) {
if (((((((((!((p in _filter))) || ((_filter[p] == props[p])))) || ((p == "remove")))) || ((p == "index")))) || ((p == "addFilter")))){
} else {
if ((((((p == "color")) || ((p == "highlightColor")))) || ((p == "shadowColor")))){
colorTween = new HexColorsPlugin();
colorTween.initColor(_filter, p, _filter[p], props[p]);
_tweens[_tweens.length] = new TweenInfo(colorTween, "changeFactor", 0, 1, p, false);
} else {
if ((((((((p == "quality")) || ((p == "inner")))) || ((p == "knockout")))) || ((p == "hideObject")))){
_filter[p] = props[p];
} else {
addTween(_filter, p, _filter[p], props[p], p);
};
};
};
};
}
}
}//package gs.plugins
Section 12
//FramePlugin (gs.plugins.FramePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class FramePlugin extends TweenPlugin {
public var frame:int;
protected var _target:MovieClip;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function FramePlugin(){
super();
this.propName = "frame";
this.overwriteProps = ["frame"];
this.round = true;
}
override public function set changeFactor($n:Number):void{
updateTweens($n);
_target.gotoAndStop(this.frame);
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
if (((!(($target is MovieClip))) || (isNaN($value)))){
return (false);
};
_target = ($target as MovieClip);
this.frame = _target.currentFrame;
addTween(this, "frame", this.frame, $value, "frame");
return (true);
}
}
}//package gs.plugins
Section 13
//GlowFilterPlugin (gs.plugins.GlowFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class GlowFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function GlowFilterPlugin(){
super();
this.propName = "glowFilter";
this.overwriteProps = ["glowFilter"];
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
_target = $target;
_type = GlowFilter;
initFilter($value, new GlowFilter(0xFFFFFF, 0, 0, 0, (($value.strength) || (1)), (($value.quality) || (2)), $value.inner, $value.knockout));
return (true);
}
}
}//package gs.plugins
Section 14
//HexColorsPlugin (gs.plugins.HexColorsPlugin)
package gs.plugins {
import gs.*;
public class HexColorsPlugin extends TweenPlugin {
protected var _colors:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function HexColorsPlugin(){
super();
this.propName = "hexColors";
this.overwriteProps = [];
_colors = [];
}
override public function set changeFactor($n:Number):void{
var i:int;
var a:Array;
i = (_colors.length - 1);
while (i > -1) {
a = _colors[i];
a[0][a[1]] = ((((a[2] + ($n * a[3])) << 16) | ((a[4] + ($n * a[5])) << 8)) | (a[6] + ($n * a[7])));
i--;
};
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
var p:String;
for (p in $value) {
initColor($target, p, uint($target[p]), uint($value[p]));
};
return (true);
}
override public function killProps($lookup:Object):void{
var i:int;
i = (_colors.length - 1);
while (i > -1) {
if ($lookup[_colors[i][1]] != undefined){
_colors.splice(i, 1);
};
i--;
};
super.killProps($lookup);
}
public function initColor($target:Object, $propName:String, $start:uint, $end:uint):void{
var r:Number;
var g:Number;
var b:Number;
if ($start != $end){
r = ($start >> 16);
g = (($start >> 8) & 0xFF);
b = ($start & 0xFF);
_colors[_colors.length] = [$target, $propName, r, (($end >> 16) - r), g, ((($end >> 8) & 0xFF) - g), b, (($end & 0xFF) - b)];
this.overwriteProps[this.overwriteProps.length] = $propName;
};
}
}
}//package gs.plugins
Section 15
//RemoveTintPlugin (gs.plugins.RemoveTintPlugin)
package gs.plugins {
public class RemoveTintPlugin extends TintPlugin {
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function RemoveTintPlugin(){
super();
this.propName = "removeTint";
}
}
}//package gs.plugins
Section 16
//RoundPropsPlugin (gs.plugins.RoundPropsPlugin)
package gs.plugins {
public class RoundPropsPlugin extends TweenPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function RoundPropsPlugin(){
super();
this.propName = "roundProps";
this.overwriteProps = [];
this.round = true;
}
public function add($object:Object, $propName:String, $start:Number, $change:Number):void{
addTween($object, $propName, $start, ($start + $change), $propName);
this.overwriteProps[this.overwriteProps.length] = $propName;
}
}
}//package gs.plugins
Section 17
//ShortRotationPlugin (gs.plugins.ShortRotationPlugin)
package gs.plugins {
import gs.*;
public class ShortRotationPlugin extends TweenPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function ShortRotationPlugin(){
super();
this.propName = "shortRotation";
this.overwriteProps = [];
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
var p:String;
if (typeof($value) == "number"){
trace("WARNING: You appear to be using the old shortRotation syntax. Instead of passing a number, please pass an object with properties that correspond to the rotations values For example, TweenMax.to(mc, 2, {shortRotation:{rotationX:-170, rotationY:25}})");
return (false);
};
for (p in $value) {
initRotation($target, p, $target[p], $value[p]);
};
return (true);
}
public function initRotation($target:Object, $propName:String, $start:Number, $end:Number):void{
var dif:Number;
dif = (($end - $start) % 360);
if (dif != (dif % 180)){
dif = ((dif)<0) ? (dif + 360) : (dif - 360);
};
addTween($target, $propName, $start, ($start + dif), $propName);
this.overwriteProps[this.overwriteProps.length] = $propName;
}
}
}//package gs.plugins
Section 18
//TintPlugin (gs.plugins.TintPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.geom.*;
import gs.utils.tween.*;
public class TintPlugin extends TweenPlugin {
protected var _ct:ColorTransform;
protected var _ignoreAlpha:Boolean;
protected var _target:DisplayObject;
public static const VERSION:Number = 1.1;
public static const API:Number = 1;
protected static var _props:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset"];
public function TintPlugin(){
super();
this.propName = "tint";
this.overwriteProps = ["tint"];
}
override public function set changeFactor($n:Number):void{
var ct:ColorTransform;
updateTweens($n);
if (_ignoreAlpha){
ct = _target.transform.colorTransform;
_ct.alphaMultiplier = ct.alphaMultiplier;
_ct.alphaOffset = ct.alphaOffset;
};
_target.transform.colorTransform = _ct;
}
public function init($target:DisplayObject, $end:ColorTransform):void{
var i:int;
var p:String;
_target = $target;
_ct = _target.transform.colorTransform;
i = (_props.length - 1);
while (i > -1) {
p = _props[i];
if (_ct[p] != $end[p]){
_tweens[_tweens.length] = new TweenInfo(_ct, p, _ct[p], ($end[p] - _ct[p]), "tint", false);
};
i--;
};
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
var end:ColorTransform;
if (!($target is DisplayObject)){
return (false);
};
end = new ColorTransform();
if (((!(($value == null))) && (!(($tween.exposedVars.removeTint == true))))){
end.color = uint($value);
};
_ignoreAlpha = true;
init(($target as DisplayObject), end);
return (true);
}
}
}//package gs.plugins
Section 19
//TweenPlugin (gs.plugins.TweenPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class TweenPlugin {
public var overwriteProps:Array;
protected var _tweens:Array;
public var round:Boolean;
public var onComplete:Function;
public var propName:String;
protected var _changeFactor:Number;// = 0
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function TweenPlugin(){
_tweens = [];
_changeFactor = 0;
super();
}
protected function updateTweens($changeFactor:Number):void{
var i:int;
var ti:TweenInfo;
var val:Number;
var neg:int;
if (this.round){
i = (_tweens.length - 1);
while (i > -1) {
ti = _tweens[i];
val = (ti.start + (ti.change * $changeFactor));
neg = ((val)<0) ? -1 : 1;
ti.target[ti.property] = ((((val % 1) * neg))>0.5) ? (int(val) + neg) : int(val);
i--;
};
} else {
i = (_tweens.length - 1);
while (i > -1) {
ti = _tweens[i];
ti.target[ti.property] = (ti.start + (ti.change * $changeFactor));
i--;
};
};
}
public function set changeFactor($n:Number):void{
updateTweens($n);
_changeFactor = $n;
}
protected function addTween($object:Object, $propName:String, $start:Number, $end, $overwriteProp:String=null):void{
var change:Number;
if ($end != null){
change = ((typeof($end))=="number") ? ($end - $start) : Number($end);
if (change != 0){
_tweens[_tweens.length] = new TweenInfo($object, $propName, $start, change, (($overwriteProp) || ($propName)), false);
};
};
}
public function killProps($lookup:Object):void{
var i:int;
i = (this.overwriteProps.length - 1);
while (i > -1) {
if ((this.overwriteProps[i] in $lookup)){
this.overwriteProps.splice(i, 1);
};
i--;
};
i = (_tweens.length - 1);
while (i > -1) {
if ((_tweens[i].name in $lookup)){
_tweens.splice(i, 1);
};
i--;
};
}
public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
addTween($target, this.propName, $target[this.propName], $value, this.propName);
return (true);
}
public function get changeFactor():Number{
return (_changeFactor);
}
public static function activate($plugins:Array):Boolean{
var i:int;
var instance:Object;
i = ($plugins.length - 1);
while (i > -1) {
instance = new ($plugins[i]);
TweenLite.plugins[instance.propName] = $plugins[i];
i--;
};
return (true);
}
}
}//package gs.plugins
Section 20
//VisiblePlugin (gs.plugins.VisiblePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class VisiblePlugin extends TweenPlugin {
protected var _tween:TweenLite;
protected var _visible:Boolean;
protected var _target:Object;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function VisiblePlugin(){
super();
this.propName = "visible";
this.overwriteProps = ["visible"];
this.onComplete = onCompleteTween;
}
override public function set changeFactor($n:Number):void{
if (_target.visible != true){
_target.visible = true;
};
}
public function onCompleteTween():void{
if (((!((_tween.vars.runBackwards == true))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
_target = $target;
_tween = $tween;
_visible = Boolean($value);
return (true);
}
}
}//package gs.plugins
Section 21
//VolumePlugin (gs.plugins.VolumePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.media.*;
public class VolumePlugin extends TweenPlugin {
protected var _st:SoundTransform;
protected var _target:Object;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function VolumePlugin(){
super();
this.propName = "volume";
this.overwriteProps = ["volume"];
}
override public function set changeFactor($n:Number):void{
updateTweens($n);
_target.soundTransform = _st;
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
if (((isNaN($value)) || (!($target.hasOwnProperty("soundTransform"))))){
return (false);
};
_target = $target;
_st = _target.soundTransform;
addTween(_st, "volume", _st.volume, $value, "volume");
return (true);
}
}
}//package gs.plugins
Section 22
//ArrayTweenInfo (gs.utils.tween.ArrayTweenInfo)
package gs.utils.tween {
public class ArrayTweenInfo {
public var change:Number;
public var index:uint;
public var start:Number;
public function ArrayTweenInfo($index:uint, $start:Number, $change:Number){
super();
this.index = $index;
this.start = $start;
this.change = $change;
}
}
}//package gs.utils.tween
Section 23
//TweenInfo (gs.utils.tween.TweenInfo)
package gs.utils.tween {
public class TweenInfo {
public var start:Number;
public var name:String;
public var change:Number;
public var target:Object;
public var property:String;
public var isPlugin:Boolean;
public function TweenInfo($target:Object, $property:String, $start:Number, $change:Number, $name:String, $isPlugin:Boolean){
super();
this.target = $target;
this.property = $property;
this.start = $start;
this.change = $change;
this.name = $name;
this.isPlugin = $isPlugin;
}
}
}//package gs.utils.tween
Section 24
//OverwriteManager (gs.OverwriteManager)
package gs {
import gs.utils.tween.*;
import flash.utils.*;
import flash.errors.*;
public class OverwriteManager {
public static const ALL:int = 1;
public static const NONE:int = 0;
public static const AUTO:int = 2;
public static const CONCURRENT:int = 3;
public static const version:Number = 3.12;
public static var mode:int;
public static var enabled:Boolean;
public function OverwriteManager(){
super();
}
public static function killVars($killVars:Object, $vars:Object, $tweens:Array):void{
var i:int;
var p:String;
var ti:TweenInfo;
i = ($tweens.length - 1);
while (i > -1) {
ti = $tweens[i];
if ((ti.name in $killVars)){
$tweens.splice(i, 1);
} else {
if (((ti.isPlugin) && ((ti.name == "_MULTIPLE_")))){
ti.target.killProps($killVars);
if (ti.target.overwriteProps.length == 0){
$tweens.splice(i, 1);
};
};
};
i--;
};
for (p in $killVars) {
delete $vars[p];
};
}
public static function manageOverwrites($tween:TweenLite, $targetTweens:Array):void{
var vars:Object;
var m:int;
var startTime:Number;
var a:Array;
var i:int;
var tween:TweenLite;
var index:int;
var tweens:Array;
var v:Object;
var j:int;
var ti:TweenInfo;
var overwriteProps:Array;
vars = $tween.vars;
m = ((vars.overwrite)==undefined) ? mode : int(vars.overwrite);
if ((((m < 2)) || (($targetTweens == null)))){
return;
};
startTime = $tween.startTime;
a = [];
index = -1;
i = ($targetTweens.length - 1);
while (i > -1) {
tween = $targetTweens[i];
if (tween == $tween){
index = i;
} else {
if ((((((i < index)) && ((tween.startTime <= startTime)))) && (((tween.startTime + ((tween.duration * 1000) / tween.combinedTimeScale)) > startTime)))){
a[a.length] = tween;
};
};
i--;
};
if ((((a.length == 0)) || (($tween.tweens.length == 0)))){
return;
};
if (m == AUTO){
tweens = $tween.tweens;
v = {};
i = (tweens.length - 1);
while (i > -1) {
ti = tweens[i];
if (ti.isPlugin){
if (ti.name == "_MULTIPLE_"){
overwriteProps = ti.target.overwriteProps;
j = (overwriteProps.length - 1);
while (j > -1) {
v[overwriteProps[j]] = true;
j--;
};
} else {
v[ti.name] = true;
};
v[ti.target.propName] = true;
} else {
v[ti.name] = true;
};
i--;
};
i = (a.length - 1);
while (i > -1) {
killVars(v, a[i].exposedVars, a[i].tweens);
i--;
};
} else {
i = (a.length - 1);
while (i > -1) {
a[i].enabled = false;
i--;
};
};
}
public static function init($mode:int=2):int{
if (TweenLite.version < 10.09){
trace("TweenLite warning: Your TweenLite class needs to be updated to work with OverwriteManager (or you may need to clear your ASO files). Please download and install the latest version from http://www.tweenlite.com.");
};
TweenLite.overwriteManager = OverwriteManager;
mode = $mode;
enabled = true;
return (mode);
}
}
}//package gs
Section 25
//TweenLite (gs.TweenLite)
package gs {
import flash.display.*;
import flash.events.*;
import gs.utils.tween.*;
import gs.plugins.*;
import flash.utils.*;
public class TweenLite {
public var delay:Number;
protected var _hasUpdate:Boolean;
protected var _hasPlugins:Boolean;
public var started:Boolean;
public var initted:Boolean;
public var active:Boolean;
public var startTime:Number;
public var target:Object;
public var duration:Number;
public var gc:Boolean;
public var vars:Object;
public var ease:Function;
public var tweens:Array;
public var exposedVars:Object;
public var combinedTimeScale:Number;
public var initTime:Number;
public static const version:Number = 10.092;
private static var _timer:Timer = new Timer(2000);
public static var defaultEase:Function = TweenLite.easeOut;
public static var plugins:Object = {};
public static var currentTime:uint;
public static var masterList:Dictionary = new Dictionary(false);
protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, persist:1, renderOnStart:1, proxiedEase:1, easeParams:1, yoyo:1, loop:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, orientToBezier:1, timeScale:1};
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var timingSprite:Sprite = new Sprite();
public static var overwriteManager:Object;
private static var _tlInitted:Boolean;
public function TweenLite($target:Object, $duration:Number, $vars:Object){
var mode:int;
super();
if ($target == null){
return;
};
if (!_tlInitted){
TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin]);
currentTime = getTimer();
timingSprite.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_timer.addEventListener("timer", killGarbage, false, 0, true);
_timer.start();
_tlInitted = true;
};
this.vars = $vars;
this.duration = (($duration) || (0.001));
this.delay = (($vars.delay) || (0));
this.combinedTimeScale = (($vars.timeScale) || (1));
this.active = Boolean(((($duration == 0)) && ((this.delay == 0))));
this.target = $target;
if (typeof(this.vars.ease) != "function"){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
this.ease = this.vars.ease;
this.exposedVars = ((this.vars.isTV)==true) ? this.vars.exposedVars : this.vars;
this.tweens = [];
this.initTime = currentTime;
this.startTime = (this.initTime + (this.delay * 1000));
mode = (((($vars.overwrite == undefined)) || (((!(overwriteManager.enabled)) && (($vars.overwrite > 1)))))) ? overwriteManager.mode : int($vars.overwrite);
if (((!(($target in masterList))) || ((mode == 1)))){
masterList[$target] = [this];
} else {
masterList[$target].push(this);
};
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (this.active))){
initTweenVals();
if (this.active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
if (((((!((this.exposedVars.visible == null))) && ((this.vars.runBackwards == true)))) && ((this.target is DisplayObject)))){
this.target.visible = this.exposedVars.visible;
};
};
}
public function set enabled($b:Boolean):void{
var a:Array;
var found:Boolean;
var i:int;
if ($b){
if (!(this.target in masterList)){
masterList[this.target] = [this];
} else {
a = masterList[this.target];
i = (a.length - 1);
while (i > -1) {
if (a[i] == this){
found = true;
break;
};
i--;
};
if (!found){
a[a.length] = this;
};
};
};
this.gc = ($b) ? false : true;
if (this.gc){
this.active = false;
} else {
this.active = this.started;
};
}
public function clear():void{
this.tweens = [];
this.vars = (this.exposedVars = {ease:this.vars.ease});
_hasUpdate = false;
}
public function render($t:uint):void{
var time:Number;
var factor:Number;
var ti:TweenInfo;
var i:int;
time = (($t - this.startTime) * 0.001);
if (time >= this.duration){
time = this.duration;
factor = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
factor = this.ease(time, 0, 1, this.duration);
};
i = (this.tweens.length - 1);
while (i > -1) {
ti = this.tweens[i];
ti.target[ti.property] = (ti.start + (factor * ti.change));
i--;
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (time == this.duration){
complete(true);
};
}
public function activate():void{
this.started = (this.active = true);
if (!this.initted){
initTweenVals();
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
}
public function get enabled():Boolean{
return ((this.gc) ? false : true);
}
public function initTweenVals():void{
var p:String;
var i:int;
var plugin:*;
var ti:TweenInfo;
if (((!((this.exposedVars.timeScale == undefined))) && (this.target.hasOwnProperty("timeScale")))){
this.tweens[this.tweens.length] = new TweenInfo(this.target, "timeScale", this.target.timeScale, (this.exposedVars.timeScale - this.target.timeScale), "timeScale", false);
};
for (p in this.exposedVars) {
if ((p in _reservedProps)){
} else {
if ((p in plugins)){
plugin = new (plugins[p]);
if (plugin.onInitTween(this.target, this.exposedVars[p], this) == false){
this.tweens[this.tweens.length] = new TweenInfo(this.target, p, this.target[p], ((typeof(this.exposedVars[p]))=="number") ? (this.exposedVars[p] - this.target[p]) : Number(this.exposedVars[p]), p, false);
} else {
this.tweens[this.tweens.length] = new TweenInfo(plugin, "changeFactor", 0, 1, ((plugin.overwriteProps.length)==1) ? plugin.overwriteProps[0] : "_MULTIPLE_", true);
_hasPlugins = true;
};
} else {
this.tweens[this.tweens.length] = new TweenInfo(this.target, p, this.target[p], ((typeof(this.exposedVars[p]))=="number") ? (this.exposedVars[p] - this.target[p]) : Number(this.exposedVars[p]), p, false);
};
};
};
if (this.vars.runBackwards == true){
i = (this.tweens.length - 1);
while (i > -1) {
ti = this.tweens[i];
ti.start = (ti.start + ti.change);
ti.change = -(ti.change);
i--;
};
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
if (((TweenLite.overwriteManager.enabled) && ((this.target in masterList)))){
overwriteManager.manageOverwrites(this, masterList[this.target]);
};
this.initted = true;
}
protected function easeProxy($t:Number, $b:Number, $c:Number, $d:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function killVars($vars:Object):void{
if (overwriteManager.enabled){
overwriteManager.killVars($vars, this.exposedVars, this.tweens);
};
}
public function complete($skipRender:Boolean=false):void{
var i:int;
if (!$skipRender){
if (!this.initted){
initTweenVals();
};
this.startTime = (currentTime - ((this.duration * 1000) / this.combinedTimeScale));
render(currentTime);
return;
};
if (_hasPlugins){
i = (this.tweens.length - 1);
while (i > -1) {
if (((this.tweens[i].isPlugin) && (!((this.tweens[i].target.onComplete == null))))){
this.tweens[i].target.onComplete();
};
i--;
};
};
if (this.vars.persist != true){
this.enabled = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public static function updateAll($e:Event=null):void{
var time:uint;
var ml:Dictionary;
var a:Array;
var i:int;
var tween:TweenLite;
time = (currentTime = getTimer());
ml = masterList;
for each (a in ml) {
i = (a.length - 1);
while (i > -1) {
tween = a[i];
if (tween.active){
tween.render(time);
} else {
if (tween.gc){
a.splice(i, 1);
} else {
if (time >= tween.startTime){
tween.activate();
tween.render(time);
};
};
};
i--;
};
};
}
public static function removeTween($tween:TweenLite, $clear:Boolean=true):void{
if ($tween != null){
if ($clear){
$tween.clear();
};
$tween.enabled = false;
};
}
public static function killTweensOf($target:Object=null, $complete:Boolean=false):void{
var a:Array;
var i:int;
var tween:TweenLite;
if (((!(($target == null))) && (($target in masterList)))){
a = masterList[$target];
i = (a.length - 1);
while (i > -1) {
tween = a[i];
if ((($complete) && (!(tween.gc)))){
tween.complete(false);
};
tween.clear();
i--;
};
delete masterList[$target];
};
}
public static function from($target:Object, $duration:Number, $vars:Object):TweenLite{
$vars.runBackwards = true;
return (new TweenLite($target, $duration, $vars));
}
public static function easeOut($t:Number, $b:Number, $c:Number, $d:Number):Number{
$t = ($t / $d);
return ((((-($c) * $t) * ($t - 2)) + $b));
}
protected static function killGarbage($e:TimerEvent):void{
var ml:Dictionary;
var tgt:Object;
ml = masterList;
for (tgt in ml) {
if (ml[tgt].length == 0){
delete ml[tgt];
};
};
}
public static function delayedCall($delay:Number, $onComplete:Function, $onCompleteParams:Array=null):TweenLite{
return (new TweenLite($onComplete, 0, {delay:$delay, onComplete:$onComplete, onCompleteParams:$onCompleteParams, overwrite:0}));
}
public static function to($target:Object, $duration:Number, $vars:Object):TweenLite{
return (new TweenLite($target, $duration, $vars));
}
}
}//package gs
Section 26
//TweenMax (gs.TweenMax)
package gs {
import flash.events.*;
import gs.utils.tween.*;
import gs.plugins.*;
import gs.events.*;
import flash.utils.*;
public class TweenMax extends TweenLite implements IEventDispatcher {
protected var _dispatcher:EventDispatcher;
protected var _callbacks:Object;
public var pauseTime:Number;
protected var _repeatCount:Number;
protected var _timeScale:Number;
public static const version:Number = 10.12;
public static var removeTween:Function = TweenLite.removeTween;
private static var _overwriteMode:int = (OverwriteManager.enabled) ? OverwriteManager.mode : OverwriteManager.init();
;
protected static var _pausedTweens:Dictionary = new Dictionary(false);
protected static var _globalTimeScale:Number = 1;
public static var killTweensOf:Function = TweenLite.killTweensOf;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _activatedPlugins:Boolean = TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin, HexColorsPlugin, BlurFilterPlugin, ColorMatrixFilterPlugin, BevelFilterPlugin, DropShadowFilterPlugin, GlowFilterPlugin, RoundPropsPlugin, BezierPlugin, BezierThroughPlugin, ShortRotationPlugin]);
public function TweenMax($target:Object, $duration:Number, $vars:Object){
super($target, $duration, $vars);
if (TweenLite.version < 10.092){
trace("TweenMax error! Please update your TweenLite class or try deleting your ASO files. TweenMax requires a more recent version. Download updates at http://www.TweenMax.com.");
};
if (((!((this.combinedTimeScale == 1))) && ((this.target is TweenMax)))){
_timeScale = 1;
this.combinedTimeScale = _globalTimeScale;
} else {
_timeScale = this.combinedTimeScale;
this.combinedTimeScale = (this.combinedTimeScale * _globalTimeScale);
};
if (((!((this.combinedTimeScale == 1))) && (!((this.delay == 0))))){
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
};
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
initDispatcher();
if (((($duration == 0)) && ((this.delay == 0)))){
onUpdateDispatcher();
onCompleteDispatcher();
};
};
_repeatCount = 0;
if (((!(isNaN(this.vars.yoyo))) || (!(isNaN(this.vars.loop))))){
this.vars.persist = true;
};
if ((((this.delay == 0)) && (!((this.vars.startAt == null))))){
this.vars.startAt.overwrite = 0;
new TweenMax(this.target, 0, this.vars.startAt);
};
}
public function set repeatCount($n:Number):void{
_repeatCount = $n;
}
override public function set enabled($b:Boolean):void{
if (!$b){
_pausedTweens[this] = null;
delete _pausedTweens[this];
};
super.enabled = $b;
if ($b){
this.combinedTimeScale = (_timeScale * _globalTimeScale);
};
}
public function set reversed($b:Boolean):void{
if (this.reversed != $b){
reverse();
};
}
override public function render($t:uint):void{
var time:Number;
var factor:Number;
var ti:TweenInfo;
var i:int;
time = ((($t - this.startTime) * 0.001) * this.combinedTimeScale);
if (time >= this.duration){
time = this.duration;
factor = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
factor = this.ease(time, 0, 1, this.duration);
};
i = (this.tweens.length - 1);
while (i > -1) {
ti = this.tweens[i];
ti.target[ti.property] = (ti.start + (factor * ti.change));
i--;
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (time == this.duration){
complete(true);
};
}
protected function adjustStartValues():void{
var p:Number;
var factor:Number;
var inv:Number;
var endValue:Number;
var ti:TweenInfo;
var i:int;
p = this.progress;
if (p != 0){
factor = this.ease(p, 0, 1, 1);
inv = (1 / (1 - factor));
i = (this.tweens.length - 1);
while (i > -1) {
ti = this.tweens[i];
endValue = (ti.start + ti.change);
if (ti.isPlugin){
ti.change = ((endValue - factor) * inv);
} else {
ti.change = ((endValue - ti.target[ti.property]) * inv);
};
ti.start = (endValue - ti.change);
i--;
};
};
}
public function get timeScale():Number{
return (_timeScale);
}
public function restart($includeDelay:Boolean=false):void{
if ($includeDelay){
this.initTime = currentTime;
this.startTime = (currentTime + (this.delay * (1000 / this.combinedTimeScale)));
} else {
this.startTime = currentTime;
this.initTime = (currentTime - (this.delay * (1000 / this.combinedTimeScale)));
};
_repeatCount = 0;
if (this.target != this.vars.onComplete){
render(this.startTime);
};
this.pauseTime = NaN;
_pausedTweens[this] = null;
delete _pausedTweens[this];
this.enabled = true;
}
public function get paused():Boolean{
return (!(isNaN(this.pauseTime)));
}
public function killProperties($names:Array):void{
var v:Object;
var i:int;
v = {};
i = ($names.length - 1);
while (i > -1) {
v[$names[i]] = true;
i--;
};
killVars(v);
}
public function resume():void{
this.enabled = true;
if (!isNaN(this.pauseTime)){
this.initTime = (this.initTime + (currentTime - this.pauseTime));
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
this.pauseTime = NaN;
if (((!(this.started)) && ((currentTime >= this.startTime)))){
activate();
} else {
this.active = this.started;
};
_pausedTweens[this] = null;
delete _pausedTweens[this];
};
}
override public function complete($skipRender:Boolean=false):void{
if (((((!(isNaN(this.vars.yoyo))) && ((((_repeatCount < this.vars.yoyo)) || ((this.vars.yoyo == 0)))))) || (((!(isNaN(this.vars.loop))) && ((((_repeatCount < this.vars.loop)) || ((this.vars.loop == 0)))))))){
_repeatCount++;
if (!isNaN(this.vars.yoyo)){
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
};
this.startTime = ($skipRender) ? (this.startTime + (this.duration * (1000 / this.combinedTimeScale))) : currentTime;
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
} else {
if (this.vars.persist == true){
pause();
};
};
super.complete($skipRender);
}
public function invalidate($adjustStartValues:Boolean=true):void{
var p:Number;
if (this.initted){
p = this.progress;
if (((!($adjustStartValues)) && (!((p == 0))))){
this.progress = 0;
};
this.tweens = [];
_hasPlugins = false;
this.exposedVars = ((this.vars.isTV)==true) ? this.vars.exposedProps : this.vars;
initTweenVals();
_timeScale = ((this.vars.timeScale) || (1));
this.combinedTimeScale = (_timeScale * _globalTimeScale);
this.delay = ((this.vars.delay) || (0));
if (isNaN(this.pauseTime)){
this.startTime = (this.initTime + ((this.delay * 1000) / this.combinedTimeScale));
};
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
if (_dispatcher != null){
this.vars.onStart = _callbacks.onStart;
this.vars.onUpdate = _callbacks.onUpdate;
this.vars.onComplete = _callbacks.onComplete;
_dispatcher = null;
};
initDispatcher();
};
if (p != 0){
if ($adjustStartValues){
adjustStartValues();
} else {
this.progress = p;
};
};
};
}
public function get progress():Number{
var t:Number;
var p:Number;
t = (isNaN(this.pauseTime)) ? currentTime : this.pauseTime;
p = (((((t - this.initTime) * 0.001) - (this.delay / this.combinedTimeScale)) / this.duration) * this.combinedTimeScale);
if (p > 1){
return (1);
};
if (p < 0){
return (0);
};
return (p);
}
public function willTrigger($type:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.willTrigger($type));
}
public function dispatchEvent($e:Event):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.dispatchEvent($e));
}
public function get reversed():Boolean{
return ((this.ease == reverseEase));
}
public function get repeatCount():Number{
return (_repeatCount);
}
protected function onStartDispatcher(... _args):void{
if (_callbacks.onStart != null){
_callbacks.onStart.apply(null, this.vars.onStartParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START));
}
public function setDestination($property:String, $value, $adjustStartValues:Boolean=true):void{
var p:Number;
var i:int;
var ti:TweenInfo;
var varsOld:Object;
var exposedVarsOld:Object;
var tweensOld:Array;
var hadPlugins:Boolean;
var addedTweens:Array;
var killVars:Object;
p = this.progress;
if (this.initted){
if (!$adjustStartValues){
i = (this.tweens.length - 1);
while (i > -1) {
ti = this.tweens[i];
if (ti.name == $property){
ti.target[ti.property] = ti.start;
};
i--;
};
};
varsOld = this.vars;
exposedVarsOld = this.exposedVars;
tweensOld = this.tweens;
hadPlugins = _hasPlugins;
this.tweens = [];
this.vars = (this.exposedVars = {});
this.vars[$property] = $value;
initTweenVals();
if (((!((this.ease == reverseEase))) && ((varsOld.ease is Function)))){
this.ease = varsOld.ease;
};
if ((($adjustStartValues) && (!((p == 0))))){
adjustStartValues();
};
addedTweens = this.tweens;
this.vars = varsOld;
this.exposedVars = exposedVarsOld;
this.tweens = tweensOld;
killVars = {};
killVars[$property] = true;
i = (this.tweens.length - 1);
while (i > -1) {
ti = this.tweens[i];
if (ti.name == $property){
this.tweens.splice(i, 1);
} else {
if (((ti.isPlugin) && ((ti.name == "_MULTIPLE_")))){
ti.target.killProps(killVars);
if (ti.target.overwriteProps.length == 0){
this.tweens.splice(i, 1);
};
};
};
i--;
};
this.tweens = this.tweens.concat(addedTweens);
_hasPlugins = Boolean(((hadPlugins) || (_hasPlugins)));
};
this.vars[$property] = (this.exposedVars[$property] = $value);
}
public function set timeScale($n:Number):void{
if ($n < 1E-5){
$n = (_timeScale = 1E-5);
} else {
_timeScale = $n;
$n = ($n * _globalTimeScale);
};
this.initTime = ((currentTime - ((((currentTime - this.initTime) - (this.delay * (1000 / this.combinedTimeScale))) * this.combinedTimeScale) * (1 / $n))) - (this.delay * (1000 / $n)));
if (this.startTime != 999999999999999){
this.startTime = (this.initTime + (this.delay * (1000 / $n)));
};
this.combinedTimeScale = $n;
}
public function removeEventListener($type:String, $listener:Function, $useCapture:Boolean=false):void{
if (_dispatcher != null){
_dispatcher.removeEventListener($type, $listener, $useCapture);
};
}
override public function initTweenVals():void{
var i:int;
var j:int;
var prop:String;
var multiProps:String;
var rp:Array;
var plugin:Object;
var ti:TweenInfo;
if (((!((this.vars.startAt == null))) && (!((this.delay == 0))))){
this.vars.startAt.overwrite = 0;
new TweenMax(this.target, 0, this.vars.startAt);
};
super.initTweenVals();
if ((((this.exposedVars.roundProps is Array)) && (!((TweenLite.plugins.roundProps == null))))){
rp = this.exposedVars.roundProps;
i = (rp.length - 1);
while (i > -1) {
prop = rp[i];
j = (this.tweens.length - 1);
while (j > -1) {
ti = this.tweens[j];
if (ti.name == prop){
if (ti.isPlugin){
ti.target.round = true;
} else {
if (plugin == null){
plugin = new TweenLite.plugins.roundProps();
plugin.add(ti.target, prop, ti.start, ti.change);
_hasPlugins = true;
this.tweens[j] = new TweenInfo(plugin, "changeFactor", 0, 1, prop, true);
} else {
plugin.add(ti.target, prop, ti.start, ti.change);
this.tweens.splice(j, 1);
};
};
} else {
if (((((ti.isPlugin) && ((ti.name == "_MULTIPLE_")))) && (!(ti.target.round)))){
multiProps = ((" " + ti.target.overwriteProps.join(" ")) + " ");
if (multiProps.indexOf(((" " + prop) + " ")) != -1){
ti.target.round = true;
};
};
};
j--;
};
i--;
};
};
}
protected function initDispatcher():void{
var v:Object;
var p:String;
if (_dispatcher == null){
_dispatcher = new EventDispatcher(this);
_callbacks = {onStart:this.vars.onStart, onUpdate:this.vars.onUpdate, onComplete:this.vars.onComplete};
if (this.vars.isTV == true){
this.vars = this.vars.clone();
} else {
v = {};
for (p in this.vars) {
v[p] = this.vars[p];
};
this.vars = v;
};
this.vars.onStart = onStartDispatcher;
this.vars.onComplete = onCompleteDispatcher;
if ((this.vars.onStartListener is Function)){
_dispatcher.addEventListener(TweenEvent.START, this.vars.onStartListener, false, 0, true);
};
if ((this.vars.onUpdateListener is Function)){
_dispatcher.addEventListener(TweenEvent.UPDATE, this.vars.onUpdateListener, false, 0, true);
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
if ((this.vars.onCompleteListener is Function)){
_dispatcher.addEventListener(TweenEvent.COMPLETE, this.vars.onCompleteListener, false, 0, true);
};
};
}
protected function onUpdateDispatcher(... _args):void{
if (_callbacks.onUpdate != null){
_callbacks.onUpdate.apply(null, this.vars.onUpdateParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
}
public function set progress($n:Number):void{
this.startTime = (currentTime - ((this.duration * $n) * 1000));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
if (!this.started){
activate();
};
render(currentTime);
if (!isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.active = false;
};
}
public function reverse($adjustDuration:Boolean=true, $forcePlay:Boolean=true):void{
var p:Number;
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
p = this.progress;
if ((($adjustDuration) && ((p > 0)))){
this.startTime = (currentTime - ((((1 - p) * this.duration) * 1000) / this.combinedTimeScale));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
};
if ($forcePlay != false){
if (p < 1){
resume();
} else {
restart();
};
};
}
public function addEventListener($type:String, $listener:Function, $useCapture:Boolean=false, $priority:int=0, $useWeakReference:Boolean=false):void{
if (_dispatcher == null){
initDispatcher();
};
if (((($type == TweenEvent.UPDATE)) && (!((this.vars.onUpdate == onUpdateDispatcher))))){
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
_dispatcher.addEventListener($type, $listener, $useCapture, $priority, $useWeakReference);
}
public function set paused($b:Boolean):void{
if ($b){
pause();
} else {
resume();
};
}
public function hasEventListener($type:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.hasEventListener($type));
}
public function pause():void{
if (isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.enabled = false;
_pausedTweens[this] = this;
};
}
public function reverseEase($t:Number, $b:Number, $c:Number, $d:Number):Number{
return (this.vars.ease(($d - $t), $b, $c, $d));
}
protected function onCompleteDispatcher(... _args):void{
if (_callbacks.onComplete != null){
_callbacks.onComplete.apply(null, this.vars.onCompleteParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
}
public static function set globalTimeScale($n:Number):void{
setGlobalTimeScale($n);
}
public static function pauseAll($tweens:Boolean=true, $delayedCalls:Boolean=false):void{
changePause(true, $tweens, $delayedCalls);
}
public static function killAllDelayedCalls($complete:Boolean=false):void{
killAll($complete, false, true);
}
public static function setGlobalTimeScale($scale:Number):void{
var ml:Dictionary;
var i:int;
var a:Array;
if ($scale < 1E-5){
$scale = 1E-5;
};
ml = masterList;
_globalTimeScale = $scale;
for each (a in ml) {
i = (a.length - 1);
while (i > -1) {
if ((a[i] is TweenMax)){
a[i].timeScale = (a[i].timeScale * 1);
};
i--;
};
};
}
public static function get globalTimeScale():Number{
return (_globalTimeScale);
}
public static function getTweensOf($target:Object):Array{
var a:Array;
var toReturn:Array;
var tween:TweenLite;
var i:int;
a = masterList[$target];
toReturn = [];
if (a != null){
i = (a.length - 1);
while (i > -1) {
if (!a[i].gc){
toReturn[toReturn.length] = a[i];
};
i--;
};
};
for each (tween in _pausedTweens) {
if (tween.target == $target){
toReturn[toReturn.length] = tween;
};
};
return (toReturn);
}
public static function delayedCall($delay:Number, $onComplete:Function, $onCompleteParams:Array=null, $persist:Boolean=false):TweenMax{
return (new TweenMax($onComplete, 0, {delay:$delay, onComplete:$onComplete, onCompleteParams:$onCompleteParams, persist:$persist, overwrite:0}));
}
public static function isTweening($target:Object):Boolean{
var a:Array;
var i:int;
a = getTweensOf($target);
i = (a.length - 1);
while (i > -1) {
if (((((a[i].active) || ((a[i].startTime == currentTime)))) && (!(a[i].gc)))){
return (true);
};
i--;
};
return (false);
}
public static function changePause($pause:Boolean, $tweens:Boolean=true, $delayedCalls:Boolean=false):void{
var a:Array;
var isDC:Boolean;
var i:int;
a = getAllTweens();
i = (a.length - 1);
while (i > -1) {
isDC = (a[i].target == a[i].vars.onComplete);
if ((((a[i] is TweenMax)) && ((((isDC == $delayedCalls)) || (!((isDC == $tweens))))))){
a[i].paused = $pause;
};
i--;
};
}
public static function killAllTweens($complete:Boolean=false):void{
killAll($complete, true, false);
}
public static function from($target:Object, $duration:Number, $vars:Object):TweenMax{
$vars.runBackwards = true;
return (new TweenMax($target, $duration, $vars));
}
public static function killAll($complete:Boolean=false, $tweens:Boolean=true, $delayedCalls:Boolean=true):void{
var a:Array;
var isDC:Boolean;
var i:int;
a = getAllTweens();
i = (a.length - 1);
while (i > -1) {
isDC = (a[i].target == a[i].vars.onComplete);
if ((((isDC == $delayedCalls)) || (!((isDC == $tweens))))){
if ($complete){
a[i].complete(false);
a[i].clear();
} else {
TweenLite.removeTween(a[i], true);
};
};
i--;
};
}
public static function getAllTweens():Array{
var ml:Dictionary;
var toReturn:Array;
var a:Array;
var i:int;
var tween:TweenLite;
ml = masterList;
toReturn = [];
for each (a in ml) {
i = (a.length - 1);
while (i > -1) {
if (!a[i].gc){
toReturn[toReturn.length] = a[i];
};
i--;
};
};
for each (tween in _pausedTweens) {
toReturn[toReturn.length] = tween;
};
return (toReturn);
}
public static function resumeAll($tweens:Boolean=true, $delayedCalls:Boolean=false):void{
changePause(false, $tweens, $delayedCalls);
}
public static function to($target:Object, $duration:Number, $vars:Object):TweenMax{
return (new TweenMax($target, $duration, $vars));
}
}
}//package gs
Section 27
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const NO_USER:String = "NoUser";
public static const IO_ERROR:String = "IOError";
public static const ITEM_NEW:String = "ItemNew";
public static const ITEM_OWNED:String = "ItemOwned";
public static const STORE_ITEMS:String = "StoreItems";
public static const ERROR:String = "Error";
public static const STORE_SHOW:String = "StoreShow";
public static var _inventory:MochiInventory;
public function MochiCoins(){
super();
}
public static function triggerEvent(eventType:String, args:Object):void{
MochiSocial.triggerEvent(eventType, args);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
MochiSocial.removeEventListener(eventType, delegate);
}
public static function addEventListener(eventType:String, delegate:Function):void{
MochiSocial.addEventListener(eventType, delegate);
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function get inventory():MochiInventory{
return (_inventory);
}
public static function showStore(options:Object=null):void{
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:options}, null, null);
}
public static function showItem(options:Object=null):void{
if (((!(options)) || (!((typeof(options.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:options}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showVideo(options:Object=null):void{
if (((!(options)) || (!((typeof(options.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:options}, null, null);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (args:Object):void{
_inventory = new MochiInventory();
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (args:Object):void{
_inventory = null;
});
}
}//package mochi.as3
Section 28
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(digit:Number=0, index:uint=0):void{
super();
Encoder = 0;
setValue(digit, index);
}
public function set value(v:Number):void{
setValue(v);
}
public function reencode():void{
var newEncode:uint;
newEncode = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (newEncode ^ Encoder));
Encoder = newEncode;
}
public function toString():String{
var s:String;
s = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
s = (s + Sibling.toString());
};
return (s);
}
public function get value():Number{
return (Number(this.toString()));
}
public function setValue(digit:Number=0, index:uint=0):void{
var s:String;
s = digit.toString();
var _temp1 = index;
index = (index + 1);
Fragment = (s.charCodeAt(_temp1) ^ Encoder);
if (index < s.length){
Sibling = new MochiDigits(digit, index);
} else {
Sibling = null;
};
reencode();
}
public function addValue(inc:Number):void{
value = (value + inc);
}
}
}//package mochi.as3
Section 29
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
super();
eventTable = {};
}
public function triggerEvent(event:String, args:Object):void{
var i:Object;
if (eventTable[event] == undefined){
return;
};
for (i in eventTable[event]) {
var _local6 = eventTable[event];
_local6[i](args);
};
}
public function removeEventListener(event:String, delegate:Function):void{
var s:Object;
if (eventTable[event] == undefined){
eventTable[event] = [];
return;
};
for (s in eventTable[event]) {
if (eventTable[event][s] != delegate){
} else {
eventTable[event].splice(Number(s), 1);
};
};
}
public function addEventListener(event:String, delegate:Function):void{
removeEventListener(event, delegate);
eventTable[event].push(delegate);
}
}
}//package mochi.as3
Section 30
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public function MochiEvents(){
super();
}
public static function endPlay():void{
MochiServices.send("events_clearRoundID", null, null, null);
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
public static function trackEvent(tag:String, value=null):void{
MochiServices.send("events_trackEvent", {tag:tag, value:value}, null, null);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function startSession(achievementID:String):void{
MochiServices.send("events_beginSession", {achievementID:achievementID}, null, null);
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function setNotifications(clip:MovieClip, style:Object):void{
var args:Object;
var s:Object;
args = {};
for (s in style) {
args[s] = style[s];
};
args.clip = clip;
MochiServices.send("events_setNotifications", args, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startPlay(tag:String="gameplay"):void{
MochiServices.send("events_setRoundID", {tag:String(tag)}, null, null);
}
}
}//package mochi.as3
Section 31
//MochiInventory (mochi.as3.MochiInventory)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
public dynamic class MochiInventory extends Proxy {
private var _timer:Timer;
private var _names:Array;
private var _consumableProperties:Object;
private var _syncID:Number;
private var _storeSync:Object;
private var _outstandingID:Number;
private var _syncPending:Boolean;
public static const READY:String = "InvReady";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IoError";
private static const KEY_SALT:String = " syncMaint";
public static const WRITTEN:String = "InvWritten";
public static const NOT_READY:String = "InvNotReady";
public static const VALUE_ERROR:String = "InvValueError";
private static const CONSUMER_KEY:String = "MochiConsumables";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiInventory():void{
super();
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned);
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut);
_storeSync = new Object();
_syncPending = false;
_outstandingID = 0;
_syncID = 0;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, sync);
_timer.start();
if (MochiSocial.loggedIn){
loggedIn();
} else {
loggedOut();
};
}
private function newItems(event:Object):void{
if (!this[(event.id + KEY_SALT)]){
this[(event.id + KEY_SALT)] = 0;
};
if (!this[event.id]){
this[event.id] = 0;
};
this[(event.id + KEY_SALT)] = (this[(event.id + KEY_SALT)] + event.count);
this[event.id] = (this[event.id] + event.count);
if (event.privateProperties.consumable){
if (!this[event.privateProperties.tag]){
this[event.privateProperties.tag] = 0;
};
this[event.privateProperties.tag] = (this[event.privateProperties.tag] + (event.privateProperties.inc * event.count));
};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(name){
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (-1);
};
if (_consumableProperties[name]){
return (MochiDigits(_consumableProperties[name]).value);
};
return (undefined);
}
public function release():void{
MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(name):Boolean{
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (false);
};
if (_consumableProperties[name] == undefined){
return (false);
};
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(index:int):int{
return (((index)>=_names.length) ? 0 : (index + 1));
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(name, value):void{
var d:MochiDigits;
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return;
};
if (!(value is Number)){
triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:value});
return;
};
if (_consumableProperties[name]){
d = MochiDigits(_consumableProperties[name]);
if (d.value == value){
return;
};
d.value = value;
} else {
_names.push(name);
_consumableProperties[name] = new MochiDigits(value);
};
_syncID++;
}
private function sync(e:Event=null):void{
var output:Object;
var key:String;
if (((_syncPending) || ((_syncID == _outstandingID)))){
return;
};
_outstandingID = _syncID;
output = {};
for (key in _consumableProperties) {
output[key] = MochiDigits(_consumableProperties[key]).value;
};
MochiUserData.put(CONSUMER_KEY, output, putConsumableBag);
_syncPending = true;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(index:int):String{
return (_names[(index - 1)]);
}
private function loggedIn(args:Object=null):void{
MochiUserData.get(CONSUMER_KEY, getConsumableBag);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(name):Boolean{
if (!_consumableProperties[name]){
return (false);
};
_names.splice(_names.indexOf(name), 1);
delete _consumableProperties[name];
return (true);
}
private function itemOwned(event:Object):void{
_storeSync[event.id] = {properties:event.properties, count:event.count};
}
private function putConsumableBag(userData:MochiUserData):void{
_syncPending = false;
if (userData.error){
triggerEvent(ERROR, {type:IO_ERROR, error:userData.error});
_outstandingID = -1;
};
triggerEvent(WRITTEN, {});
}
private function getConsumableBag(userData:MochiUserData):void{
var key:String;
var unsynced:Number;
if (userData.error){
triggerEvent(ERROR, {type:IO_ERROR, error:userData.error});
return;
};
_consumableProperties = {};
_names = new Array();
if (userData.data){
for (key in userData.data) {
_names.push(key);
_consumableProperties[key] = new MochiDigits(userData.data[key]);
};
};
for (key in _storeSync) {
unsynced = _storeSync[key].count;
if (_consumableProperties[(key + KEY_SALT)]){
unsynced = (unsynced - _consumableProperties[key]);
};
if (unsynced == 0){
} else {
newItems({id:key, count:unsynced, properties:_storeSync[key].properties});
};
};
triggerEvent(READY, {});
}
private function loggedOut(args:Object=null):void{
_consumableProperties = null;
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
}
}//package mochi.as3
Section 32
//MochiScores (mochi.as3.MochiScores)
package mochi.as3 {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public function MochiScores(){
super();
}
public static function showLeaderboard(options:Object=null):void{
var n:Number;
var options = options;
if (options != null){
delete options.clip;
MochiServices.setContainer();
MochiServices.bringToTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(callbackObj:Object, callbackMethod:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
public static function requestList(callbackObj:Object, callbackMethod:Object=null):void{
MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
public static function scoresArrayToObjects(scores:Object):Object{
var so:Object;
var i:Number;
var j:Number;
var o:Object;
var row_obj:Object;
var item:String;
var param:String;
so = {};
for (item in scores) {
if (typeof(scores[item]) == "object"){
if (((!((scores[item].cols == null))) && (!((scores[item].rows == null))))){
so[item] = [];
o = scores[item];
j = 0;
while (j < o.rows.length) {
row_obj = {};
i = 0;
while (i < o.cols.length) {
row_obj[o.cols[i]] = o.rows[j][i];
i++;
};
so[item].push(row_obj);
j++;
};
} else {
so[item] = {};
for (param in scores[item]) {
so[item][param] = scores[item][param];
};
};
} else {
so[item] = scores[item];
};
};
return (so);
}
public static function submit(score:Number, name:String, callbackObj:Object=null, callbackMethod:Object=null):void{
score = Number(score);
if (isNaN(score)){
trace((("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((score == Number.NEGATIVE_INFINITY)) || ((score == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(score) != score){
trace((("WARNING: Submitted score '" + String(score)) + "' will be truncated"));
};
score = Number(score);
};
};
MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
public static function onClose(args:Object=null):void{
if (((((args) && ((args.error == true)))) && (onErrorHandler))){
if (args.errorCode == null){
args.errorCode = "IOError";
};
onErrorHandler(args.errorCode);
MochiServices.doClose();
return;
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(boardID:String):void{
MochiServices.warnID(boardID, true);
MochiScores.boardID = boardID;
MochiServices.send("scores_setBoardID", {boardID:boardID});
}
}
}//package mochi.as3
Section 33
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.geom.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _queue:Array;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
public static var servicesSync:MochiSync = new MochiSync();
private static var _nextCallbackID:Number;
private static var _clip:MovieClip;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _loader:Loader;
private static var _callbacks:Object;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public function MochiServices(){
super();
}
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(pkg:Object):void{
var cb:String;
var cblst:Object;
var method:*;
var methodName:String;
var obj:Object;
var pkg = pkg;
cb = pkg.callbackID;
cblst = _callbacks[cb];
if (!cblst){
return;
};
method = cblst.callbackMethod;
methodName = "";
obj = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
method.apply(obj, pkg.args);
//unresolved jump
var _slot1 = error;
trace(((("Error invoking callback method '" + methodName) + "': ") + _slot1.toString()));
} else {
if (obj != null){
obj(pkg.args);
//unresolved jump
var _slot1 = error;
trace(("Error invoking method on object: " + _slot1.toString()));
};
};
delete _callbacks[cb];
}
public static function send(methodName:String, args:Object=null, callbackObject:Object=null, callbackMethod:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_nextCallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + methodName));
handleError(args, callbackObject, callbackMethod);
flush(true);
return;
};
_queue.push({methodName:methodName, args:args, callbackID:_nextCallbackID});
};
if (_clip != null){
if (_callbacks != null){
_callbacks[_nextCallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_nextCallbackID++;
};
};
}
private static function init(id:String, clip:Object):void{
_id = id;
if (clip != null){
_container = clip;
loadCommunicator(id, _container);
};
}
public static function get childClip():Object{
return (_clip);
}
private static function clickMovie(url:String, cb:Function):MovieClip{
var avm1_bytecode:Array;
var b:int;
var header:Array;
var footer:Array;
var mc:MovieClip;
var lc:LocalConnection;
var lc_name:String;
var ba:ByteArray;
var cpool:ByteArray;
var actionLength:uint;
var fileLength:uint;
var loader:Loader;
avm1_bytecode = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
header = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
footer = [0, 64, 0, 0, 0];
mc = new MovieClip();
lc = new LocalConnection();
lc_name = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
lc = new LocalConnection();
mc.lc = lc;
mc.click = cb;
lc.client = mc;
lc.connect(lc_name);
ba = new ByteArray();
cpool = new ByteArray();
cpool.endian = Endian.LITTLE_ENDIAN;
cpool.writeShort(1);
cpool.writeUTFBytes(((url + " ") + lc_name));
cpool.writeByte(0);
actionLength = ((avm1_bytecode.length + cpool.length) + 4);
fileLength = (actionLength + 35);
ba.endian = Endian.LITTLE_ENDIAN;
ba.writeUTFBytes("FWS");
ba.writeByte(8);
ba.writeUnsignedInt(fileLength);
for each (b in header) {
ba.writeByte(b);
};
ba.writeUnsignedInt(actionLength);
ba.writeByte(136);
ba.writeShort(cpool.length);
ba.writeBytes(cpool);
for each (b in avm1_bytecode) {
ba.writeByte(b);
};
for each (b in footer) {
ba.writeByte(b);
};
loader = new Loader();
loader.loadBytes(ba);
mc.addChild(loader);
return (mc);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(url:String, burl:String, btn:DisplayObjectContainer, onClick:Function=null):void{
var vars:Object;
var avm1Click:DisplayObject;
var s:String;
var i:Number;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = url;
var burl = burl;
var btn = btn;
var onClick = onClick;
vars = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
s = "?";
i = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (url:String):void{
var rect:Rectangle;
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(url, onClick);
rect = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = rect.x;
avm1Click.y = rect.y;
avm1Click.scaleX = (0.01 * rect.width);
avm1Click.scaleY = (0.01 * rect.height);
};
err = function (ev:Object):void{
netup = false;
ev.target.removeEventListener(ev.type, arguments.callee);
setURL(burl);
};
complete = function (ev:Object):void{
ev.target.removeEventListener(ev.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
_mochiLocalConnection.close();
//unresolved jump
var _slot1 = error;
};
if (_timer != null){
_timer.stop();
//unresolved jump
var _slot1 = error;
};
}
public static function allowDomains(server:String):String{
var hostname:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (server.indexOf("http://") != -1){
hostname = server.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(hostname);
Security.allowInsecureDomain(hostname);
};
};
return (hostname);
}
public static function getVersion():String{
return ("3.8 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
public static function warnID(bid:String, leaderboard:Boolean):void{
var i:Number;
bid = bid.toLowerCase();
if (bid.length != 16){
trace((("WARNING: " + (leaderboard) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (bid == "1e113c7239048b3f"){
if (leaderboard){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (bid == "84993a1de4031cd8"){
if (leaderboard){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
i = 0;
while (i < bid.length) {
switch (bid.charAt(i)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + bid));
return;
};
i++;
};
}
private static function flush(error:Boolean):void{
var request:Object;
var callback:Object;
if (((_clip) && (_queue))){
while (_queue.length > 0) {
request = _queue.shift();
callback = null;
if (request != null){
if (request.callbackID != null){
callback = _callbacks[request.callbackID];
};
delete _callbacks[request.callbackID];
if (((error) && (!((callback == null))))){
handleError(request.args, callback.callbackObject, callback.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(pkg:Object):void{
var target:String;
var event:String;
target = pkg.target;
event = pkg.event;
switch (target){
case "events":
MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case "coins":
MochiCoins.triggerEvent(pkg.event, pkg.args);
break;
case "sync":
servicesSync.triggerEvent(pkg.event, pkg.args);
break;
};
}
private static function urlOptions(clip:Object):Object{
var opts:Object;
var options:String;
var pairs:Array;
var i:Number;
var kv:Array;
opts = {};
if (clip.stage){
options = clip.stage.loaderInfo.parameters.mochiad_options;
} else {
options = clip.loaderInfo.parameters.mochiad_options;
};
if (options){
pairs = options.split("&");
i = 0;
while (i < pairs.length) {
kv = pairs[i].split("=");
opts[unescape(kv[0])] = unescape(kv[1]);
i++;
};
};
return (opts);
}
public static function setContainer(container:Object=null, doAdd:Boolean=true):void{
if (_clip.parent){
_clip.parent.removeChild(_clip);
};
if (container != null){
if ((container is DisplayObjectContainer)){
_container = container;
};
};
if (doAdd){
if ((_container is DisplayObjectContainer)){
DisplayObjectContainer(_container).addChild(_clip);
};
};
}
private static function handleError(args:Object, callbackObject:Object, callbackMethod:Object):void{
var args = args;
var callbackObject = callbackObject;
var callbackMethod = callbackMethod;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
var _local5 = callbackObject;
_local5[callbackMethod](args);
//unresolved jump
var _slot1 = error;
} else {
if (callbackMethod != null){
callbackMethod.apply(args);
//unresolved jump
var _slot1 = error;
};
};
};
}
private static function loadError(ev:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _queue.shift());
};
};
}
private static function loadLCBridge(clip:Object):void{
var loader:Loader;
var mochiLCURL:String;
var req:URLRequest;
var complete:Function;
var clip = clip;
loader = new Loader();
mochiLCURL = (_servURL + _mochiLC);
req = new URLRequest(mochiLCURL);
complete = function (ev:Object):void{
_mochiLocalConnection = MovieClip(loader.content);
listen();
};
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (args:Object):void{
MochiServices.comChannelName = args.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(val:String):void{
if (val != null){
if (val.length > 3){
_sendChannelName = (val + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(id:String, clip:Object):MovieClip{
var servicesURL:String;
var req:URLRequest;
var vars:URLVariables;
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(clip).servURL){
_servURL = urlOptions(clip).servURL;
};
servicesURL = (_servURL + _services);
if (urlOptions(clip).servicesURL){
servicesURL = urlOptions(clip).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(servicesURL);
_clip = new MovieClip();
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
req = new URLRequest(servicesURL);
vars = new URLVariables();
vars.listenLC = _listenChannelName;
vars.mochiad_options = clip.loaderInfo.parameters.mochiad_options;
vars.api_version = getVersion();
if (widget){
vars.widget = true;
};
req.data = vars;
_loader.load(req);
_clip.addChild(_loader);
_sendChannel = new LocalConnection();
_queue = [];
_nextCallbackID = 0;
_callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function connect(id:String, clip:Object, onError:Object=null):void{
var id = id;
var clip = clip;
var onError = onError;
warnID(id, false);
if ((clip is DisplayObject)){
if (clip.stage == null){
trace("MochiServices connect requires the containing clip be attached to the stage");
};
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (errorCode:String):void{
trace(errorCode);
};
};
};
}
public static function updateCopy(args:Object):void{
MochiServices.send("coins_updateCopy", args, null, null);
}
public static function bringToTop(e:Event=null):void{
var e = e;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
//unresolved jump
var _slot1 = errorObject;
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
}
public static function connectWait(e:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 34
//MochiSocial (mochi.as3.MochiSocial)
package mochi.as3 {
public class MochiSocial {
public static const LOGGED_IN:String = "LoggedIn";
public static const PROFILE_HIDE:String = "ProfileHide";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const IO_ERROR:String = "IOError";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const USER_INFO:String = "UserInfo";
public static const ERROR:String = "Error";
public static const LOGIN_SHOW:String = "LoginShow";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_SHOWN:String = "LoginShown";
public static const LOGIN_HIDE:String = "LoginHide";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static var _user_info:Object = null;
public function MochiSocial(){
super();
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function saveUserProperties(properties:Object):void{
MochiServices.send("coins_saveUserProperties", properties);
}
public static function get loggedIn():Boolean{
return (!((_user_info == null)));
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
public static function getUserInfo():void{
MochiServices.send("coins_getUserInfo");
}
public static function showLoginWidget(options:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showLoginWidget", {options:options});
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function requestLogin():void{
MochiServices.send("coins_requestLogin");
}
public static function getAPIURL():String{
if (!_user_info){
return (null);
};
return (_user_info.api_url);
}
public static function hideLoginWidget():void{
MochiServices.send("coins_hideLoginWidget");
}
public static function getAPIToken():String{
if (!_user_info){
return (null);
};
return (_user_info.api_token);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (args:Object):void{
_user_info = args;
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (args:Object):void{
_user_info = null;
});
}
}//package mochi.as3
Section 35
//MochiSync (mochi.as3.MochiSync)
package mochi.as3 {
import flash.utils.*;
public dynamic class MochiSync extends Proxy {
private var _syncContainer:Object;
public static var SYNC_PROPERTY:String = "UpdateProperty";
public static var SYNC_REQUEST:String = "SyncRequest";
public function MochiSync():void{
super();
_syncContainer = {};
}
public function triggerEvent(eventType:String, args:Object):void{
switch (eventType){
case SYNC_REQUEST:
MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY:
_syncContainer[args.name] = args.value;
break;
};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(name){
return (_syncContainer[name]);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(name, value):void{
var n:String;
if (_syncContainer[name] == value){
return;
};
n = name.toString();
_syncContainer[n] = value;
MochiServices.send("sync_propUpdate", {name:n, value:value});
}
}
}//package mochi.as3
Section 36
//MochiUserData (mochi.as3.MochiUserData)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class MochiUserData extends EventDispatcher {
public var callback:Function;// = null
public var error:Event;// = null
public var key:String;// = null
public var operation:String;// = null
public var data;// = null
public var _loader:URLLoader;
public function MochiUserData(key:String="", callback:Function=null){
key = null;
data = null;
error = null;
operation = null;
callback = null;
super();
this.key = key;
this.callback = callback;
}
public function securityErrorHandler(event:SecurityErrorEvent):void{
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + event.toString())));
}
public function putEvent(obj):void{
request("put", serialize(obj));
}
public function request(_operation:String, _data:ByteArray):void{
var api_url:String;
var api_token:String;
var args:URLVariables;
var req:URLRequest;
var _operation = _operation;
var _data = _data;
operation = _operation;
api_url = MochiSocial.getAPIURL();
api_token = MochiSocial.getAPIToken();
if ((((api_url == null)) || ((api_token == null)))){
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in"));
return;
};
_loader = new URLLoader();
args = new URLVariables();
args.op = _operation;
args.key = key;
req = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString()));
req.method = URLRequestMethod.POST;
req.contentType = "application/x-mochi-userdata";
req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)];
req.data = _data;
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.addEventListener(Event.COMPLETE, completeHandler);
_loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.load(req);
//unresolved jump
var _slot1 = e;
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _slot1.toString())));
}
public function performCallback():void{
callback(this);
//unresolved jump
var _slot1 = e;
trace(("[MochiUserData] exception during callback: " + _slot1));
}
public function serialize(obj):ByteArray{
var arr:ByteArray;
arr = new ByteArray();
arr.objectEncoding = ObjectEncoding.AMF3;
arr.writeObject(obj);
arr.compress();
return (arr);
}
public function errorHandler(event:IOErrorEvent):void{
data = null;
error = event;
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function completeHandler(event:Event):void{
var event = event;
if (_loader.data.length){
data = deserialize(_loader.data);
} else {
data = null;
};
//unresolved jump
var _slot1 = e;
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + _slot1.toString())));
return;
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function getEvent():void{
request("get", serialize(null));
}
override public function toString():String{
return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]"));
}
public function close():void{
if (_loader){
_loader.removeEventListener(Event.COMPLETE, completeHandler);
_loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.close();
_loader = null;
};
error = null;
callback = null;
}
public function deserialize(arr:ByteArray){
arr.objectEncoding = ObjectEncoding.AMF3;
arr.uncompress();
return (arr.readObject());
}
public static function get(key:String, callback:Function):void{
var userData:MochiUserData;
userData = new MochiUserData(key, callback);
userData.getEvent();
}
public static function put(key:String, obj, callback:Function):void{
var userData:MochiUserData;
userData = new MochiUserData(key, callback);
userData.putEvent(obj);
}
}
}//package mochi.as3
Section 37
//Log (SWFStats.Log)
package SWFStats {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
public final class Log {
private static const PingR:Timer = new Timer(30000);
private static const Random:Number = Math.random();
private static const PingF:Timer = new Timer(60000);
public static var GUID:String = "";
private static var Plays:int = 0;
private static var Enabled:Boolean = false;
private static var FirstPing:Boolean = true;
private static var Pings:int = 0;
public static var SourceUrl:String;
private static var HighestGoal:int = 0;
public static var SWFID:int = 0;
public function Log(){
super();
}
private static function GetCookie(n:String):int{
var cookie:SharedObject;
cookie = SharedObject.getLocal("swfstats");
if (cookie.data[n] == undefined){
return (0);
};
return (int(cookie.data[n]));
}
private static function SaveCookie(n:String, v:int):void{
var cookie:SharedObject;
cookie = SharedObject.getLocal("swfstats");
cookie.data[n] = v.toString();
cookie.flush();
}
public static function View(swfid:int=0, guid:String="", defaulturl:String=""):void{
var views:int;
SWFID = swfid;
GUID = guid;
Enabled = true;
if ((((SWFID == 0)) || ((GUID == "")))){
Enabled = false;
return;
};
if (((((!((defaulturl.indexOf("http://") == 0))) && (!((Security.sandboxType == "localWithNetwork"))))) && (!((Security.sandboxType == "localTrusted"))))){
Enabled = false;
return;
};
SourceUrl = GetUrl(defaulturl);
if ((((SourceUrl == null)) || ((SourceUrl == "")))){
Enabled = false;
return;
};
Security.allowDomain("http://tracker.swfstats.com/");
Security.allowInsecureDomain("http://tracker.swfstats.com/");
Security.loadPolicyFile("http://tracker.swfstats.com/crossdomain.xml");
Security.allowDomain("http://utils.swfstats.com/");
Security.allowInsecureDomain("http://utils.swfstats.com/");
Security.loadPolicyFile("http://utils.swfstats.com/crossdomain.xml");
views = GetCookie("views");
views++;
SaveCookie("views", views);
Send("View", ("views=" + views));
PingF.addEventListener(TimerEvent.TIMER, PingServer);
PingF.start();
}
public static function LevelCounterMetric(name:String, level):void{
if (!Enabled){
return;
};
Send("LevelMetric", ((("name=" + escape(name)) + "&level=") + level));
}
private static function Send(page:String, data:String):void{
var sendaction:URLLoader;
sendaction = new URLLoader();
sendaction.addEventListener(IOErrorEvent.IO_ERROR, ErrorHandler);
sendaction.addEventListener(HTTPStatusEvent.HTTP_STATUS, StatusChange);
sendaction.addEventListener(SecurityErrorEvent.SECURITY_ERROR, ErrorHandler);
sendaction.load(new URLRequest(((((((((((("http://tracker.swfstats.com/Games/" + page) + ".html?guid=") + GUID) + "&swfid=") + SWFID) + "&") + data) + "&url=") + SourceUrl) + "&") + Random)));
}
public static function Play():void{
if (!Enabled){
return;
};
Plays++;
Send("Play", ("plays=" + Plays));
}
private static function GetUrl(defaulturl:String):String{
var url:String;
var defaulturl = defaulturl;
if (ExternalInterface.available){
url = String(ExternalInterface.call("window.location.href.toString"));
//unresolved jump
var _slot1 = s;
url = defaulturl;
} else {
if (defaulturl.indexOf("http://") == 0){
url = defaulturl;
};
};
if ((((((url == null)) || ((url == "")))) || ((url == "null")))){
if ((((Security.sandboxType == "localWithNetwork")) || ((Security.sandboxType == "localTrusted")))){
url = "http://local-testing/";
} else {
url = null;
};
};
return (url);
}
private static function ErrorHandler(... _args):void{
Enabled = false;
}
public static function LevelRangedMetric(name:String, level, value:int):void{
if (!Enabled){
return;
};
Send("LevelMetricRanged", ((((("name=" + escape(name)) + "&level=") + level) + "&value=") + value));
}
private static function StatusChange(... _args):void{
}
public static function Goal(n:int, name:String):void{
}
private static function PingServer(... _args):void{
if (!Enabled){
return;
};
Pings++;
Send("Ping", (((FirstPing) ? "&firstping=yes" : "" + "&pings=") + Pings));
if (FirstPing){
PingF.stop();
PingR.addEventListener(TimerEvent.TIMER, PingServer);
PingR.start();
FirstPing = false;
};
}
public static function LevelAverageMetric(name:String, level, value:int):void{
if (!Enabled){
return;
};
Send("LevelMetricAverage", ((((("name=" + escape(name)) + "&level=") + level) + "&value=") + value));
}
public static function CustomMetric(name:String, group:String=null):void{
if (!Enabled){
return;
};
if (group == null){
group = "";
};
Send("CustomMetric", ((("name=" + escape(name)) + "&group=") + escape(group)));
}
}
}//package SWFStats
Section 38
//TTween (unam.TTween)
package unam {
import flash.display.*;
import gs.*;
public class TTween {
public function TTween(){
super();
}
public static function backTint(Mc:MovieClip, duration:int, type:int):void{
var color:int;
if (type == 1){
color = 3381759;
} else {
if (type == 2){
color = 15284264;
} else {
if (type == 3){
color = 11155411;
} else {
if (type == 4){
color = 3268470;
} else {
if (type == 5){
color = 16494391;
} else {
if (type == 0){
color = 0;
};
};
};
};
};
};
TweenMax.to(Mc.bt, duration, {tint:color});
}
}
}//package unam
Section 39
//unam (unam.unam)
package unam {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import mochi.as3.*;
import flash.media.*;
import flash.net.*;
import flash.utils.*;
import CPMStar.*;
public dynamic class unam extends MovieClip {
public var ad:DisplayObject;
public var musiconoff:Boolean;// = true
public var mochiConnectClip:MovieClip;
public var tutorial_screen:tutorial;
public var o:Object;
private var achiev_screen:MovieClip;
public var preLoader:preloader;
private var achievBox:MovieClip;
public var up:Boolean;// = false
public var clasHigh:int;// = 0
public var rezMc:MovieClip;
private var playBt:MovieClip;
public var adBox:MovieClip;
public var nplay:Boolean;// = false
public var IDboard:int;
public var achPoint:Point;
public var SG_intro:MovieClip;
public var gLogged:Boolean;// = false
public var msgMc:MovieClip;
public var myTimer:Timer;
public var goSound:gameoverSound;
public var optionP2:MovieClip;
public var optionP1:MovieClip;
public var splash_screen:splash;
public var finScore:Number;
public var game_over_screen:game_over;
public var ach_x20:Boolean;// = false
public var soundonoff:Boolean;// = true
private var comAd:MovieClip;
public var backgroundMusic:bgmusic;
public var congString:String;
public var optMc:MovieClip;
public var gameMod:int;
public var sgBg:MovieClip;
public var fPlaysCount:int;// = 0
public var play_screen:the_game;
public var Main:MovieClip;
public var bgmSoundChannel:SoundChannel;
private var vetBoo:Boolean;// = false
public var mySharedObject:SharedObject;
private var adclip:Sprite;
public var goSoundChannel:SoundChannel;
public function unam():void{
clasHigh = 0;
up = false;
nplay = false;
ach_x20 = false;
soundonoff = true;
musiconoff = true;
gLogged = false;
fPlaysCount = 0;
vetBoo = false;
super();
Main = Engine.instance;
addEventListener(Event.ADDED_TO_STAGE, go);
}
private function showAd():void{
var CPMStarContentSpotID:String;
game_over_screen.remove_sGameOver();
if (SmileyGamerAPI.allowedClickAwayAdType() == SmileyGamerAPI.SG_ONLY){
restart_menu(1);
adclip = new Sprite();
SmileyGamerAPI.showSGMoreGamesAd(adclip);
addChild(adclip);
adclip.x = 115;
adclip.y = 2;
comAd = new combAd();
addChild(comAd);
comAd.x = 0x0202;
comAd.y = 381;
comAd.buttonMode = true;
comAd.useHandCursor = true;
comAd.addEventListener(MouseEvent.CLICK, combAdClicked);
} else {
if (SmileyGamerAPI.allowedClickAwayAdType() == SmileyGamerAPI.MIXED){
restart_menu(1);
if ((fPlaysCount % 2) == 1){
adBox = new adBoxMc();
addChild(adBox);
adBox.x = 115;
adBox.y = 2;
CPMStarContentSpotID = "2255QA8D85261";
ad = new AdLoader(CPMStarContentSpotID);
adBox.addChild(ad);
} else {
adclip = new Sprite();
SmileyGamerAPI.showSGMoreGamesAd(adclip);
addChild(adclip);
adclip.x = 115;
adclip.y = 2;
};
comAd = new combAd();
addChild(comAd);
comAd.x = 0x0202;
comAd.y = 381;
comAd.buttonMode = true;
comAd.useHandCursor = true;
comAd.addEventListener(MouseEvent.CLICK, combAdClicked);
} else {
restart_menu(0);
};
};
fPlaysCount = (fPlaysCount + 1);
}
private function loadAssets(e:Event):void{
preLoader.circlesTweened();
}
public function remove_play():void{
if (play_screen){
removeChild(play_screen);
play_screen = null;
};
}
public function remove_tuto_screen():void{
if (tutorial_screen){
removeChild(tutorial_screen);
tutorial_screen = null;
};
}
public function show_game_over(score:int):void{
game_over_screen = new game_over();
addChild(game_over_screen);
game_over_screen.greyoverMc.alpha = 0;
game_over_screen.addEventListener("goOver", _goOver);
finScore = score;
if (((backgroundMusic) && ((musiconoff == true)))){
bgmSoundChannel.stop();
goSound = new gameoverSound();
goSoundChannel = goSound.play();
goSoundChannel.addEventListener(Event.SOUND_COMPLETE, onBackgroundMusicFinished);
};
addEventListener(Event.ENTER_FRAME, greyS, false, 0, true);
}
public function out_opt(e:MouseEvent):void{
var target2:MovieClip;
target2 = (e.target as MovieClip);
TTween.backTint(target2, 0.5, 0);
}
public function onBackgroundMusicFinished(event:Event):void{
if (musiconoff){
bgmSoundChannel = backgroundMusic.play();
bgmSoundChannel.addEventListener(Event.SOUND_COMPLETE, onBackgroundMusicFinished);
};
}
private function preloaderOver(e:Event):void{
remove_preloader();
gotoAndStop("mainmenu");
}
public function remove_preloader():void{
if (preLoader){
preLoader.removeEventListener("loadComplete", loadAssets);
preLoader.removeEventListener("preloaderOver", preloaderOver);
removeChild(preLoader);
preLoader = null;
};
}
private function combAdClicked(e:MouseEvent):void{
SmileyGamerAPI.showPlayGamePage("Combine", 2428);
}
public function remove_splash():void{
if (splash_screen){
removeChild(splash_screen);
splash_screen = null;
clasHigh = 0;
};
}
public function foc():void{
stage.focus = stage;
}
public function show_tuto():void{
tutorial_screen = new tutorial(this);
addChild(tutorial_screen);
tutorial_screen.x = 100;
tutorial_screen.y = ((0x0200 / 2) - (tutorial_screen.height / 2));
}
public function monff():void{
if (((!(backgroundMusic)) && ((musiconoff == true)))){
backgroundMusic = new bgmusic();
bgmSoundChannel = backgroundMusic.play();
bgmSoundChannel.addEventListener(Event.SOUND_COMPLETE, onBackgroundMusicFinished);
};
if (((backgroundMusic) && ((musiconoff == false)))){
bgmSoundChannel.stop();
backgroundMusic = null;
};
}
public function over_opt(e:MouseEvent):void{
var target:MovieClip;
target = (e.target as MovieClip);
TTween.backTint(target, 0.5, (Math.floor((Math.random() * ((1 + 4) - 1))) + 1));
}
private function go(evt:Event):void{
sgBg = new preloaderBg();
addChild(sgBg);
sgBg.x = 0;
sgBg.y = 0;
SG_intro = new SG_intro_bg();
addChild(SG_intro);
SG_intro.x = 300;
SG_intro.y = (0x0200 / 2);
SG_intro.mouseChildren = false;
SG_intro.addEventListener(MouseEvent.CLICK, SmileyGamerAPI.showHome);
myTimer = new Timer(6000);
myTimer.addEventListener(TimerEvent.TIMER, timerListener);
myTimer.start();
MochiBot.track(this, "4875f6fc");
removeEventListener(Event.ADDED_TO_STAGE, go);
}
public function option_menu():void{
optMc = new bm();
addChild(optMc);
optMc.x = 177;
optMc.y = 173;
msgMc = new optmsg();
addChild(msgMc);
msgMc.x = 210;
msgMc.y = 218;
optionP1 = new optionpart();
addChild(optionP1);
optionP1.x = 210;
if (!musiconoff){
optionP1.x = 299;
};
optionP1.y = 247;
optionP2 = new optionpart();
addChild(optionP2);
optionP2.x = 210;
if (!soundonoff){
optionP2.x = 299;
};
optionP2.y = 307;
msgMc.mon.mouseChildren = false;
msgMc.mon.addEventListener(MouseEvent.MOUSE_OVER, over_opt);
msgMc.mon.addEventListener(MouseEvent.MOUSE_OUT, out_opt);
msgMc.moff.mouseChildren = false;
msgMc.moff.addEventListener(MouseEvent.MOUSE_OVER, over_opt);
msgMc.moff.addEventListener(MouseEvent.MOUSE_OUT, out_opt);
msgMc.son.mouseChildren = false;
msgMc.son.addEventListener(MouseEvent.MOUSE_OVER, over_opt);
msgMc.son.addEventListener(MouseEvent.MOUSE_OUT, out_opt);
msgMc.soff.mouseChildren = false;
msgMc.soff.addEventListener(MouseEvent.MOUSE_OVER, over_opt);
msgMc.soff.addEventListener(MouseEvent.MOUSE_OUT, out_opt);
msgMc.menuBt.mouseChildren = false;
msgMc.menuBt.addEventListener(MouseEvent.MOUSE_OVER, over_opt);
msgMc.menuBt.addEventListener(MouseEvent.MOUSE_OUT, out_opt);
msgMc.xcl.mouseChildren = false;
msgMc.xcl.addEventListener(MouseEvent.MOUSE_OVER, over_opt);
msgMc.xcl.addEventListener(MouseEvent.MOUSE_OUT, out_opt);
}
public function remove_achievements():void{
if (achiev_screen){
removeChild(achiev_screen);
achiev_screen = null;
};
}
public function remove_game_over():void{
if (game_over_screen){
removeChild(game_over_screen);
game_over_screen = null;
};
}
private function timerListener(e:TimerEvent):void{
playBt = new miplay();
addChild(playBt);
playBt.x = (300 - (47 / 2));
playBt.y = 480;
playBt.buttonMode = true;
playBt.useHandCursor = true;
playBt.addEventListener(MouseEvent.CLICK, goToSplash);
myTimer.removeEventListener(TimerEvent.TIMER, timerListener);
myTimer = null;
}
public function show_achievements():void{
achiev_screen = new achievscreen(this);
addChild(achiev_screen);
achiev_screen.x = 100;
achiev_screen.y = (((0x0200 / 2) - (achiev_screen.height / 2)) + 10);
}
public function achActive():void{
splash_screen.achbt.addEventListener(MouseEvent.CLICK, splash_screen.on_ach_clicked);
if (splash_screen.sMask){
splash_screen.removeChild(splash_screen.sMask);
splash_screen.sMask = null;
};
}
private function _goOver(e:Event):void{
game_over_screen.removeEventListener("goOver", _goOver);
show_highscore(1);
}
public function greyS(e:Event):void{
if (game_over_screen.greyoverMc.alpha < 0.5){
game_over_screen.greyoverMc.alpha = (game_over_screen.greyoverMc.alpha + 0.04);
} else {
removeEventListener(Event.ENTER_FRAME, greyS);
game_over_screen.sGameOver();
};
}
private function removeAch(e:Event):void{
achievBox.remove();
achievBox.removeEventListener("achOver", removeAch);
removeChild(achievBox);
achievBox = null;
}
public function show_highscore(u:int):void{
var o:Object;
var boardID:String;
var u = u;
if (gameMod == 1){
clasHigh = 1;
o = {n:[9, 0, 0, 11, 2, 8, 9, 15, 13, 15, 1, 6, 10, 1, 7, 4], f:function (i:Number, s:String):String{
if (s.length == 16){
return (s);
};
return (this.f((i + 1), (s + this.n[i].toString(16))));
}};
boardID = o.f(0, "");
} else {
clasHigh = 2;
o = {n:[6, 4, 8, 9, 7, 1, 3, 3, 7, 4, 8, 7, 9, 7, 4, 10], f:function (i:Number, s:String):String{
if (s.length == 16){
return (s);
};
return (this.f((i + 1), (s + this.n[i].toString(16))));
}};
boardID = o.f(0, "");
};
if (u == 1){
MochiScores.showLeaderboard({boardID:boardID, score:finScore, onClose:showAd});
} else {
MochiScores.showLeaderboard({boardID:boardID, onClose:removeMask});
splash_screen.achbt.removeEventListener(MouseEvent.CLICK, splash_screen.on_ach_clicked);
};
}
public function remove_restart_menu():void{
removeChild(rezMc);
rezMc = null;
msgMc.yesbt.removeEventListener(MouseEvent.MOUSE_OVER, over_opt);
msgMc.yesbt.removeEventListener(MouseEvent.MOUSE_OUT, out_opt);
msgMc.nobt.removeEventListener(MouseEvent.MOUSE_OVER, over_opt);
msgMc.nobt.removeEventListener(MouseEvent.MOUSE_OUT, out_opt);
removeChild(msgMc);
msgMc = null;
if (adBox){
adBox.removeChild(ad);
ad = null;
removeChild(adBox);
adBox = null;
};
if (adclip){
removeChild(adclip);
adclip = null;
};
if (comAd){
comAd.removeEventListener(MouseEvent.CLICK, combAdClicked);
removeChild(comAd);
comAd = null;
};
}
public function restart_menu(tp:int):void{
rezMc = new bm();
addChild(rezMc);
rezMc.x = 177;
rezMc.y = 173;
msgMc = new resmsg();
addChild(msgMc);
msgMc.x = 210;
msgMc.y = 218;
if (tp == 1){
rezMc.y = (rezMc.y + 80);
msgMc.y = (msgMc.y + 80);
};
msgMc.yesbt.mouseChildren = false;
msgMc.yesbt.addEventListener(MouseEvent.MOUSE_OVER, over_opt);
msgMc.yesbt.addEventListener(MouseEvent.MOUSE_OUT, out_opt);
msgMc.nobt.mouseChildren = false;
msgMc.nobt.addEventListener(MouseEvent.MOUSE_OVER, over_opt);
msgMc.nobt.addEventListener(MouseEvent.MOUSE_OUT, out_opt);
}
public function removeMask():void{
splash_screen.removeM();
}
public function remove_option_menu():void{
removeChild(optMc);
optMc = null;
msgMc.mon.removeEventListener(MouseEvent.MOUSE_OVER, over_opt);
msgMc.mon.removeEventListener(MouseEvent.MOUSE_OUT, out_opt);
msgMc.moff.removeEventListener(MouseEvent.MOUSE_OVER, over_opt);
msgMc.moff.removeEventListener(MouseEvent.MOUSE_OUT, out_opt);
msgMc.son.removeEventListener(MouseEvent.MOUSE_OVER, over_opt);
msgMc.son.removeEventListener(MouseEvent.MOUSE_OUT, out_opt);
msgMc.soff.removeEventListener(MouseEvent.MOUSE_OVER, over_opt);
msgMc.soff.removeEventListener(MouseEvent.MOUSE_OUT, out_opt);
msgMc.menuBt.removeEventListener(MouseEvent.MOUSE_OVER, over_opt);
msgMc.menuBt.removeEventListener(MouseEvent.MOUSE_OUT, out_opt);
msgMc.xcl.removeEventListener(MouseEvent.MOUSE_OVER, over_opt);
msgMc.xcl.removeEventListener(MouseEvent.MOUSE_OUT, out_opt);
removeChild(msgMc);
msgMc = null;
if (optionP1){
removeChild(optionP1);
removeChild(optionP2);
optionP1 = null;
optionP2 = null;
};
}
private function checkVetAch():void{
if (mySharedObject.data.vetCpt == 20){
achievBox = new achBox(9);
addChild(achievBox);
achievBox.x = 10;
achievBox.y = 440;
achievBox.acht_Tfront.text = AchievementsConstants.ACHIEVEMENT_VETERAN;
achievBox.acht_Tback.text = AchievementsConstants.ACHIEVEMENT_VETERAN;
achievBox.addEventListener("achOver", removeAch);
achievBox.acht_dfront.text = AchievementsConstants.ACHIEVEMENT_VETERAN_DESC;
achievBox.acht_dback.text = AchievementsConstants.ACHIEVEMENT_VETERAN_DESC;
mySharedObject.data.ACHIEVEMENT_VETERAN = true;
mySharedObject.flush();
};
}
private function goToSplash(e:MouseEvent):void{
SG_intro.removeEventListener(MouseEvent.CLICK, SmileyGamerAPI.showHome);
removeChild(sgBg);
removeChild(SG_intro);
SG_intro = null;
sgBg = null;
playBt.removeEventListener(MouseEvent.CLICK, goToSplash);
removeChild(playBt);
playBt = null;
show_splash();
}
public function play_the_game(mod:int):void{
gameMod = mod;
play_screen = new the_game(this, mod);
addChild(play_screen);
play_screen.x = 0;
foc();
}
public function achPosition():void{
if (mouseY >= 250){
achPoint = new Point(10, 10);
} else {
achPoint = new Point(10, 570);
};
}
public function show_splash():void{
mySharedObject = SharedObject.getLocal("cu87as7");
if (mySharedObject.data.ACHIEVEMENT_1000_CUBES == undefined){
mySharedObject.data.ACHIEVEMENT_1000_CUBES = false;
};
if (mySharedObject.data.ACHIEVEMENT_CLICK__PROFIT == undefined){
mySharedObject.data.ACHIEVEMENT_CLICK__PROFIT = false;
};
if (mySharedObject.data.ACHIEVEMENT_FIVE_HUNDRED == undefined){
mySharedObject.data.ACHIEVEMENT_FIVE_HUNDRED = false;
};
if (mySharedObject.data.ACHIEVEMENT_ONE_THOUSAND == undefined){
mySharedObject.data.ACHIEVEMENT_ONE_THOUSAND = false;
};
if (mySharedObject.data.ACHIEVEMENT_ONE_THOUSAND_FIVE_HUNDRED == undefined){
mySharedObject.data.ACHIEVEMENT_ONE_THOUSAND_FIVE_HUNDRED = false;
};
if (mySharedObject.data.ACHIEVEMENT_OVER_9000_ == undefined){
mySharedObject.data.ACHIEVEMENT_OVER_9000_ = false;
};
if (mySharedObject.data.ACHIEVEMENT_SEVEN_HUNDRED_AND_FIFTY == undefined){
mySharedObject.data.ACHIEVEMENT_SEVEN_HUNDRED_AND_FIFTY = false;
};
if (mySharedObject.data.ACHIEVEMENT_VETERAN == undefined){
mySharedObject.data.ACHIEVEMENT_VETERAN = false;
};
if (mySharedObject.data.ACHIEVEMENT_BONUS_X20 == undefined){
mySharedObject.data.ACHIEVEMENT_BONUS_X20 = false;
};
if (mySharedObject.data.totalCubes == undefined){
mySharedObject.data.totalCubes = 0;
};
if (mySharedObject.data.vetCpt == undefined){
mySharedObject.data.vetCpt = 0;
};
if (!vetBoo){
mySharedObject.data.vetCpt = (mySharedObject.data.vetCpt + 1);
};
mySharedObject.flush();
splash_screen = new splash(this);
addChild(splash_screen);
if (!vetBoo){
vetBoo = true;
checkVetAch();
};
monff();
if (((!(backgroundMusic)) && ((musiconoff == true)))){
backgroundMusic = new bgmusic();
bgmSoundChannel = backgroundMusic.play();
bgmSoundChannel.addEventListener(Event.SOUND_COMPLETE, onBackgroundMusicFinished);
};
}
}
}//package unam
Section 40
//AssetHolder_1 (unam_fla.AssetHolder_1)
package unam_fla {
import flash.display.*;
public dynamic class AssetHolder_1 extends MovieClip {
public function AssetHolder_1(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package unam_fla
Section 41
//ach_bt (ach_bt)
package {
import flash.display.*;
public dynamic class ach_bt extends MovieClip {
public var bt:MovieClip;
public function ach_bt(){
super();
}
}
}//package
Section 42
//ach_dec_b (ach_dec_b)
package {
import flash.display.*;
import flash.text.*;
public dynamic class ach_dec_b extends MovieClip {
public var bt:TextField;
public var ft:TextField;
public function ach_dec_b(){
super();
}
}
}//package
Section 43
//ach_tit_b (ach_tit_b)
package {
import flash.display.*;
import flash.text.*;
public dynamic class ach_tit_b extends MovieClip {
public var bt:TextField;
public var ft:TextField;
public function ach_tit_b(){
super();
}
}
}//package
Section 44
//ach1000 (ach1000)
package {
import flash.display.*;
public dynamic class ach1000 extends MovieClip {
public function ach1000(){
super();
}
}
}//package
Section 45
//ach10003 (ach10003)
package {
import flash.display.*;
public dynamic class ach10003 extends MovieClip {
public function ach10003(){
super();
}
}
}//package
Section 46
//ach1500 (ach1500)
package {
import flash.display.*;
public dynamic class ach1500 extends MovieClip {
public function ach1500(){
super();
}
}
}//package
Section 47
//ach325 (ach325)
package {
import flash.display.*;
public dynamic class ach325 extends MovieClip {
public function ach325(){
super();
}
}
}//package
Section 48
//ach500 (ach500)
package {
import flash.display.*;
public dynamic class ach500 extends MovieClip {
public function ach500(){
super();
}
}
}//package
Section 49
//ach750 (ach750)
package {
import flash.display.*;
public dynamic class ach750 extends MovieClip {
public function ach750(){
super();
}
}
}//package
Section 50
//ach9000 (ach9000)
package {
import flash.display.*;
public dynamic class ach9000 extends MovieClip {
public function ach9000(){
super();
}
}
}//package
Section 51
//achb20 (achb20)
package {
import flash.display.*;
public dynamic class achb20 extends MovieClip {
public function achb20(){
super();
}
}
}//package
Section 52
//achBox (achBox)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public dynamic class achBox extends MovieClip {
public var acht_Tfront:TextField;
public var acht_Tback:TextField;
public var acht_dback:TextField;
public var cpt:int;// = 0
public var iconMc:MovieClip;
public var acht_dfront:TextField;
public function achBox(tp:int):void{
cpt = 0;
super();
if (tp == 1){
iconMc = new ach500();
addChild(iconMc);
} else {
if (tp == 2){
iconMc = new ach325();
addChild(iconMc);
} else {
if (tp == 3){
iconMc = new ach750();
addChild(iconMc);
} else {
if (tp == 4){
iconMc = new ach1000();
addChild(iconMc);
} else {
if (tp == 5){
iconMc = new ach1500();
addChild(iconMc);
} else {
if (tp == 6){
iconMc = new ach9000();
addChild(iconMc);
} else {
if (tp == 7){
iconMc = new ach10003();
addChild(iconMc);
} else {
if (tp == 8){
iconMc = new achb20();
addChild(iconMc);
} else {
if (tp == 9){
iconMc = new achx20();
addChild(iconMc);
};
};
};
};
};
};
};
};
};
iconMc.scaleX = (iconMc.scaleX / 2);
iconMc.scaleY = (iconMc.scaleY / 2);
iconMc.x = 5;
iconMc.y = 5;
addEventListener(Event.ENTER_FRAME, timevent, false, 0, true);
}
public function timevent(e:Event):void{
cpt = (cpt + 1);
if (cpt >= 120){
removeEventListener(Event.ENTER_FRAME, timevent);
dispatchEvent(new Event("achOver"));
};
}
public function remove():void{
removeChild(iconMc);
iconMc = null;
}
}
}//package
Section 53
//AchievementsConstants (AchievementsConstants)
package {
public class AchievementsConstants {
public static const ACHIEVEMENT_BONUS_X20_DESC:String = "Earn 20 bonus in Bonus Mode.";
public static const ACHIEVEMENT_CLICK__PROFIT_DESC:String = "Earn at least 325 points with a single click.";
public static const ACHIEVEMENT_1000_CUBES:String = "1000 Cubes";
public static const ACHIEVEMENT_ONE_THOUSAND_FIVE_HUNDRED:String = "One Thousand Five Hundred";
public static const ACHIEVEMENT_CLICK__PROFIT:String = "Click ? Profit";
public static const ACHIEVEMENT_FIVE_HUNDRED_DESC:String = "Score 500 points in Classic mode.";
public static const ACHIEVEMENT_BONUS_X20:String = "Bonus x20";
public static const ACHIEVEMENT_ONE_THOUSAND:String = "One Thousand";
public static const ACHIEVEMENT_1000_CUBES_DESC:String = "Clear 1000 cubes.";
public static const ACHIEVEMENT_OVER_9000__DESC:String = "Score over 9000 points in any mode. ";
public static const ACHIEVEMENT_OVER_9000_:String = "Over 9000 !";
public static const ACHIEVEMENT_VETERAN:String = "Veteran";
public static const ACHIEVEMENT_ONE_THOUSAND_DESC:String = "Score 1000 points in Classic Mode.";
public static const ACHIEVEMENT_SEVEN_HUNDRED_AND_FIFTY:String = "Seven Hundred and Fifty";
public static const ACHIEVEMENT_ONE_THOUSAND_FIVE_HUNDRED_DESC:String = "Score 1500 points in Bonus Mode.";
public static const ACHIEVEMENT_FIVE_HUNDRED:String = "Five Hundred";
public static const ACHIEVEMENT_VETERAN_DESC:String = "Play 20 games.";
public static const ACHIEVEMENT_SEVEN_HUNDRED_AND_FIFTY_DESC:String = "Score 750 points in Bonus mode.";
public function AchievementsConstants(){
super();
}
}
}//package
Section 54
//achievscreen (achievscreen)
package {
import flash.display.*;
import gs.*;
import flash.events.*;
import flash.geom.*;
import unam.*;
import flash.text.*;
public dynamic class achievscreen extends MovieClip {
public var titArray:Array;
private var Y:int;// = 0
public var decArray:Array;
public var iconArray:Array;
public var main:unam;
public var xross:MovieClip;
public var coverArray:Array;
public function achievscreen(passed:unam):void{
var addC:Boolean;
var T:String;
var D:String;
var i:int;
Y = 0;
super();
main = passed;
iconArray = new Array();
titArray = new Array();
decArray = new Array();
coverArray = new Array();
addC = false;
i = 1;
while (i < 10) {
titArray[i] = new ach_tit_b();
decArray[i] = new ach_dec_b();
if (i == 1){
iconArray[i] = new ach500();
T = AchievementsConstants.ACHIEVEMENT_FIVE_HUNDRED;
D = AchievementsConstants.ACHIEVEMENT_FIVE_HUNDRED_DESC;
if (main.mySharedObject.data.ACHIEVEMENT_FIVE_HUNDRED == false){
addC = true;
};
} else {
if (i == 2){
iconArray[i] = new ach325();
T = AchievementsConstants.ACHIEVEMENT_CLICK__PROFIT;
D = AchievementsConstants.ACHIEVEMENT_CLICK__PROFIT_DESC;
if (main.mySharedObject.data.ACHIEVEMENT_CLICK__PROFIT == false){
addC = true;
};
} else {
if (i == 3){
iconArray[i] = new ach750();
T = AchievementsConstants.ACHIEVEMENT_SEVEN_HUNDRED_AND_FIFTY;
D = AchievementsConstants.ACHIEVEMENT_SEVEN_HUNDRED_AND_FIFTY_DESC;
if (main.mySharedObject.data.ACHIEVEMENT_SEVEN_HUNDRED_AND_FIFTY == false){
addC = true;
};
} else {
if (i == 4){
iconArray[i] = new ach1000();
T = AchievementsConstants.ACHIEVEMENT_ONE_THOUSAND;
D = AchievementsConstants.ACHIEVEMENT_ONE_THOUSAND_DESC;
if (main.mySharedObject.data.ACHIEVEMENT_ONE_THOUSAND == false){
addC = true;
};
} else {
if (i == 5){
iconArray[i] = new ach1500();
T = AchievementsConstants.ACHIEVEMENT_ONE_THOUSAND_FIVE_HUNDRED;
D = AchievementsConstants.ACHIEVEMENT_ONE_THOUSAND_FIVE_HUNDRED_DESC;
if (main.mySharedObject.data.ACHIEVEMENT_ONE_THOUSAND_FIVE_HUNDRED == false){
};
} else {
if (i == 6){
iconArray[i] = new ach9000();
T = AchievementsConstants.ACHIEVEMENT_OVER_9000_;
D = AchievementsConstants.ACHIEVEMENT_OVER_9000__DESC;
if (main.mySharedObject.data.ACHIEVEMENT_OVER_9000_ == false){
addC = true;
};
} else {
if (i == 7){
iconArray[i] = new ach10003();
T = AchievementsConstants.ACHIEVEMENT_1000_CUBES;
D = AchievementsConstants.ACHIEVEMENT_1000_CUBES_DESC;
if (main.mySharedObject.data.ACHIEVEMENT_1000_CUBES == false){
addC = true;
};
} else {
if (i == 8){
iconArray[i] = new achb20();
T = AchievementsConstants.ACHIEVEMENT_BONUS_X20;
D = AchievementsConstants.ACHIEVEMENT_BONUS_X20_DESC;
if (main.mySharedObject.data.ACHIEVEMENT_FIVE_HUNDRED == false){
addC = true;
};
} else {
if (i == 9){
iconArray[i] = new achx20();
T = AchievementsConstants.ACHIEVEMENT_VETERAN;
D = AchievementsConstants.ACHIEVEMENT_VETERAN_DESC;
if (main.mySharedObject.data.ACHIEVEMENT_VETERAN == false){
addC = true;
};
};
};
};
};
};
};
};
};
};
addChild(iconArray[i]);
addChild(titArray[i]);
addChild(decArray[i]);
iconArray[i].scaleX = (iconArray[i].scaleX / 2);
iconArray[i].scaleY = (iconArray[i].scaleY / 2);
titArray[i].ft.text = T;
decArray[i].ft.text = D;
titArray[i].bt.text = T;
decArray[i].bt.text = D;
if ((i % 2) == 1){
iconArray[i].x = 10;
Y = (10 + ((i - 1) * 40));
} else {
iconArray[i].x = 200;
};
titArray[i].x = (iconArray[i].x + 50);
decArray[i].x = (iconArray[i].x - 5);
iconArray[i].y = Y;
titArray[i].y = iconArray[i].y;
decArray[i].y = (iconArray[i].y + 48);
if (i == 9){
decArray[i].x = (iconArray[i].x + 50);
decArray[i].y = (iconArray[i].y + 30);
};
if (addC){
addC = false;
coverArray[i] = new cover();
addChild(coverArray[i]);
coverArray[i].x = iconArray[i].x;
coverArray[i].y = iconArray[i].y;
};
i++;
};
xross = new x_close();
addChild(xross);
xross.y = 10;
xross.x = 375;
xross.mouseChildren = false;
xross.addEventListener(MouseEvent.MOUSE_OVER, over_opt);
xross.addEventListener(MouseEvent.MOUSE_OUT, out_opt);
xross.addEventListener(MouseEvent.CLICK, on_x_clicked);
}
public function on_x_clicked(e:MouseEvent):void{
var j:int;
j = 1;
while (j < 10) {
if (titArray[j]){
removeChild(titArray[j]);
titArray[j] = null;
};
if (decArray[j]){
removeChild(decArray[j]);
decArray[j] = null;
};
if (coverArray[j]){
removeChild(coverArray[j]);
coverArray[j] = null;
};
if (iconArray[j]){
removeChild(iconArray[j]);
iconArray[j] = null;
};
j++;
};
xross.removeEventListener(MouseEvent.MOUSE_OVER, over_opt);
xross.removeEventListener(MouseEvent.MOUSE_OUT, out_opt);
xross.removeEventListener(MouseEvent.CLICK, on_x_clicked);
removeChild(xross);
xross = null;
main.remove_achievements();
}
public function out_opt(e:MouseEvent):void{
var target2:MovieClip;
target2 = (e.target as MovieClip);
TTween.backTint(target2, 0.5, 0);
}
public function over_opt(e:MouseEvent):void{
var target:MovieClip;
target = (e.target as MovieClip);
TTween.backTint(target, 0.5, (Math.floor((Math.random() * ((1 + 5) - 1))) + 1));
}
}
}//package
Section 55
//achivbt (achivbt)
package {
import flash.display.*;
public dynamic class achivbt extends MovieClip {
public var bt:MovieClip;
public function achivbt(){
super();
}
}
}//package
Section 56
//achivmc (achivmc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class achivmc extends MovieClip {
public var bt:TextField;
public var ft:TextField;
public function achivmc(){
super();
}
}
}//package
Section 57
//achx20 (achx20)
package {
import flash.display.*;
public dynamic class achx20 extends MovieClip {
public function achx20(){
super();
}
}
}//package
Section 58
//adBoxMc (adBoxMc)
package {
import flash.display.*;
public dynamic class adBoxMc extends MovieClip {
public function adBoxMc(){
super();
}
}
}//package
Section 59
//addgame (addgame)
package {
import flash.display.*;
public dynamic class addgame extends MovieClip {
public var bt:MovieClip;
public function addgame(){
super();
}
}
}//package
Section 60
//addScore (addScore)
package {
import flash.display.*;
import flash.events.*;
public class addScore extends MovieClip {
public var un_mc:MovieClip;
public var sco:int;
public var mi_mc:MovieClip;
public var particleFadeSpeed:Number;// = 5
public var particleRange:Number;// = 100
public var gravity:Number;// = 0.3
public var ce:int;// = 0
public var particleTotal:Number;// = 25
public var di_mc:MovieClip;
public var exrad:MovieClip;
public var un:int;// = 0
public var ce_mc:MovieClip;
public var di:int;// = 0
public var mi:int;// = 0
public var parti:Array;
public var particleMaxSpeed:Number;// = 5
public function addScore(targetX, targetY, bty, score){
particleMaxSpeed = 5;
particleFadeSpeed = 5;
particleTotal = 25;
particleRange = 100;
gravity = 0.3;
parti = new Array(particleTotal);
mi = 0;
ce = 0;
di = 0;
un = 0;
super();
sco = score;
if (sco >= 1000){
mi = ((sco - (sco % 1000)) / 1000);
ce = (((sco % 1000) - (sco % 100)) / 100);
di = (((sco % 100) - (sco % 10)) / 10);
un = (sco % 10);
};
if (sco >= 100){
ce = ((sco - (sco % 100)) / 100);
di = (((sco % 100) - (sco % 10)) / 10);
un = (sco % 10);
};
if (sco >= 10){
di = ((sco - (sco % 10)) / 10);
un = (sco % 10);
} else {
un = sco;
};
if (mi != 0){
if (bty == 0){
mi_mc = new o_();
ce_mc = new o_();
di_mc = new o_();
un_mc = new o_();
};
if (bty == 1){
mi_mc = new b_();
ce_mc = new b_();
di_mc = new b_();
un_mc = new b_();
};
if (bty == 2){
mi_mc = new r_();
ce_mc = new r_();
di_mc = new r_();
un_mc = new r_();
};
if (bty == 3){
mi_mc = new v_();
ce_mc = new v_();
di_mc = new v_();
un_mc = new v_();
};
if (bty == 4){
mi_mc = new m_();
ce_mc = new m_();
di_mc = new m_();
un_mc = new m_();
};
addChild(mi_mc);
mi_mc.gotoAndStop((mi + 1));
addChild(mi_mc);
addChild(ce_mc);
ce_mc.gotoAndStop((ce + 1));
addChild(di_mc);
di_mc.gotoAndStop((di + 1));
addChild(un_mc);
un_mc.gotoAndStop((un + 1));
mi_mc.x = (targetX - 80);
mi_mc.y = targetY;
mi_mc.addEventListener(Event.ENTER_FRAME, fadeN);
ce_mc.x = (targetX - 40);
ce_mc.y = targetY;
ce_mc.addEventListener(Event.ENTER_FRAME, fadeN);
di_mc.x = targetX;
di_mc.y = targetY;
di_mc.addEventListener(Event.ENTER_FRAME, fadeN);
un_mc.x = (targetX + 40);
un_mc.y = targetY;
un_mc.addEventListener(Event.ENTER_FRAME, fadeN);
} else {
if (ce != 0){
if (bty == 0){
ce_mc = new o_();
di_mc = new o_();
un_mc = new o_();
};
if (bty == 1){
ce_mc = new b_();
di_mc = new b_();
un_mc = new b_();
};
if (bty == 2){
ce_mc = new r_();
di_mc = new r_();
un_mc = new r_();
};
if (bty == 3){
ce_mc = new v_();
di_mc = new v_();
un_mc = new v_();
};
if (bty == 4){
ce_mc = new m_();
di_mc = new m_();
un_mc = new m_();
};
addChild(ce_mc);
ce_mc.gotoAndStop((ce + 1));
addChild(di_mc);
di_mc.gotoAndStop((di + 1));
addChild(un_mc);
un_mc.gotoAndStop((un + 1));
ce_mc.x = (targetX - 60);
ce_mc.y = targetY;
ce_mc.addEventListener(Event.ENTER_FRAME, fadeN);
di_mc.x = (targetX - 20);
di_mc.y = targetY;
di_mc.addEventListener(Event.ENTER_FRAME, fadeN);
un_mc.x = (targetX + 20);
un_mc.y = targetY;
un_mc.addEventListener(Event.ENTER_FRAME, fadeN);
} else {
if (di != 0){
if (bty == 0){
di_mc = new o_();
un_mc = new o_();
};
if (bty == 1){
di_mc = new b_();
un_mc = new b_();
};
if (bty == 2){
di_mc = new r_();
un_mc = new r_();
};
if (bty == 3){
di_mc = new v_();
un_mc = new v_();
};
if (bty == 4){
di_mc = new m_();
un_mc = new m_();
};
addChild(di_mc);
di_mc.gotoAndStop((di + 1));
addChild(un_mc);
un_mc.gotoAndStop((un + 1));
di_mc.x = (targetX - 20);
di_mc.y = targetY;
di_mc.addEventListener(Event.ENTER_FRAME, fadeN);
un_mc.x = (targetX + 20);
un_mc.y = targetY;
un_mc.addEventListener(Event.ENTER_FRAME, fadeN);
} else {
if (un != 0){
if (bty == 0){
un_mc = new o_();
};
if (bty == 1){
un_mc = new b_();
};
if (bty == 2){
un_mc = new r_();
};
if (bty == 3){
un_mc = new v_();
};
if (bty == 4){
un_mc = new m_();
};
addChild(un_mc);
un_mc.gotoAndStop((un + 1));
un_mc.x = targetX;
un_mc.y = targetY;
un_mc.addEventListener(Event.ENTER_FRAME, fadeN);
};
};
};
};
}
public function fadeN(e:Event):void{
e.target.scaleX = (e.target.scaleX + 0.05);
e.target.scaleY = (e.target.scaleY + 0.05);
e.target.alpha = (e.target.alpha - 0.08);
if (e.target.alpha < 0.1){
removeChild(MovieClip(e.target));
e.target.removeEventListener(Event.ENTER_FRAME, fadeN);
};
}
}
}//package
Section 61
//b_ (b_)
package {
import flash.display.*;
public dynamic class b_ extends MovieClip {
public function b_(){
super();
}
}
}//package
Section 62
//backgroundach (backgroundach)
package {
import flash.display.*;
public dynamic class backgroundach extends MovieClip {
public function backgroundach(){
super();
}
}
}//package
Section 63
//bgmusic (bgmusic)
package {
import flash.media.*;
public dynamic class bgmusic extends Sound {
public function bgmusic(){
super();
}
}
}//package
Section 64
//bk (bk)
package {
import flash.display.*;
public dynamic class bk extends MovieClip {
public function bk(){
super();
}
}
}//package
Section 65
//bkmenu (bkmenu)
package {
import flash.display.*;
public dynamic class bkmenu extends MovieClip {
public function bkmenu(){
super();
}
}
}//package
Section 66
//bLa (bLa)
package {
import flash.display.*;
public dynamic class bLa extends MovieClip {
public function bLa(){
super();
}
}
}//package
Section 67
//blaline (blaline)
package {
import flash.display.*;
public dynamic class blaline extends MovieClip {
public function blaline(){
super();
}
}
}//package
Section 68
//bLb (bLb)
package {
import flash.display.*;
public dynamic class bLb extends MovieClip {
public function bLb(){
super();
}
}
}//package
Section 69
//blback (blback)
package {
import flash.display.*;
public dynamic class blback extends MovieClip {
public function blback(){
super();
}
}
}//package
Section 70
//bLc (bLc)
package {
import flash.display.*;
public dynamic class bLc extends MovieClip {
public function bLc(){
super();
}
}
}//package
Section 71
//blight (blight)
package {
import flash.display.*;
public dynamic class blight extends MovieClip {
public function blight(){
super();
}
}
}//package
Section 72
//blk1 (blk1)
package {
import flash.display.*;
public dynamic class blk1 extends MovieClip {
public function blk1(){
super();
}
}
}//package
Section 73
//blk2 (blk2)
package {
import flash.display.*;
public dynamic class blk2 extends MovieClip {
public function blk2(){
super();
}
}
}//package
Section 74
//blk3 (blk3)
package {
import flash.display.*;
public dynamic class blk3 extends MovieClip {
public function blk3(){
super();
}
}
}//package
Section 75
//blk4 (blk4)
package {
import flash.display.*;
public dynamic class blk4 extends MovieClip {
public function blk4(){
super();
}
}
}//package
Section 76
//blk5 (blk5)
package {
import flash.display.*;
public dynamic class blk5 extends MovieClip {
public function blk5(){
super();
}
}
}//package
Section 77
//bLl (bLl)
package {
import flash.display.*;
public dynamic class bLl extends MovieClip {
public function bLl(){
super();
}
}
}//package
Section 78
//bLs (bLs)
package {
import flash.display.*;
public dynamic class bLs extends MovieClip {
public function bLs(){
super();
}
}
}//package
Section 79
//bLt (bLt)
package {
import flash.display.*;
public dynamic class bLt extends MovieClip {
public function bLt(){
super();
}
}
}//package
Section 80
//bLu (bLu)
package {
import flash.display.*;
public dynamic class bLu extends MovieClip {
public function bLu(){
super();
}
}
}//package
Section 81
//bm (bm)
package {
import flash.display.*;
public dynamic class bm extends MovieClip {
public var blbm:MovieClip;
public function bm(){
super();
}
}
}//package
Section 82
//bmenu (bmenu)
package {
import flash.display.*;
public dynamic class bmenu extends MovieClip {
public function bmenu(){
super();
}
}
}//package
Section 83
//bsmoke (bsmoke)
package {
import flash.display.*;
public dynamic class bsmoke extends MovieClip {
public function bsmoke(){
super();
}
}
}//package
Section 84
//combAd (combAd)
package {
import flash.display.*;
public dynamic class combAd extends MovieClip {
public function combAd(){
super();
}
}
}//package
Section 85
//cover (cover)
package {
import flash.display.*;
public dynamic class cover extends MovieClip {
public function cover(){
super();
}
}
}//package
Section 86
//credit (credit)
package {
import flash.display.*;
public dynamic class credit extends MovieClip {
public var bt:MovieClip;
public function credit(){
super();
}
}
}//package
Section 87
//creditsMc (creditsMc)
package {
import flash.display.*;
public dynamic class creditsMc extends MovieClip {
public function creditsMc(){
super();
}
}
}//package
Section 88
//ctext (ctext)
package {
import flash.display.*;
import flash.text.*;
public dynamic class ctext extends MovieClip {
public var l_f:TextField;
public function ctext(){
super();
}
}
}//package
Section 89
//disscore (disscore)
package {
import flash.display.*;
import flash.text.*;
public dynamic class disscore extends MovieClip {
public var discoTo:TextField;
public var disco:TextField;
public function disscore(){
super();
}
}
}//package
Section 90
//Engine (Engine)
package {
import flash.display.*;
import flash.events.*;
import mochi.as3.*;
import flash.utils.*;
import SWFStats.*;
import flash.ui.*;
public dynamic class Engine extends MovieClip {
private var preLoader:preloader;
private static var _instance:Engine;
public function Engine(){
super();
addFrameScript(0, frame1, 2, frame3);
addEventListener(Event.ADDED_TO_STAGE, go);
}
private function loadAssets(e:Event):void{
preLoader.circlesTweened();
}
protected function init():void{
var mainClass:Class;
mainClass = (getDefinitionByName("unam.unam") as Class);
addChild((new (mainClass) as DisplayObject));
}
function frame3(){
stop();
init();
}
private function preloaderOver(e:Event):void{
remove_preloader();
gotoAndStop("mainmenu");
}
function frame1(){
stop();
}
public function remove_preloader():void{
if (preLoader){
preLoader.removeEventListener("loadComplete", loadAssets);
preLoader.removeEventListener("preloaderOver", preloaderOver);
removeChild(preLoader);
preLoader = null;
};
}
public function onConnectError(status:String):void{
trace(status);
}
public function mochiConnect():void{
MochiServices.connect("88328c7aa2057827", root, onConnectError);
Log.View(431, "90e0d69e-bb19-4cfb-a829-ba42f5efd683", root.loaderInfo.loaderURL);
}
private function go(evt:Event):void{
var cMenu:ContextMenu;
mochiConnect();
SmileyGamerAPI.init(stage, 5619, "Cublast");
preLoader = new preloader(this.loaderInfo);
addChild(preLoader);
preLoader.addEventListener("loadComplete", loadAssets);
preLoader.addEventListener("preloaderOver", preloaderOver);
cMenu = new ContextMenu();
cMenu.hideBuiltInItems();
this.contextMenu = cMenu;
_instance = this;
removeEventListener(Event.ADDED_TO_STAGE, go);
}
public static function get instance():Engine{
return (_instance);
}
}
}//package
Section 91
//ex1 (ex1)
package {
import flash.display.*;
public dynamic class ex1 extends MovieClip {
public function ex1(){
super();
}
}
}//package
Section 92
//ex2 (ex2)
package {
import flash.display.*;
public dynamic class ex2 extends MovieClip {
public function ex2(){
super();
}
}
}//package
Section 93
//ex3 (ex3)
package {
import flash.display.*;
public dynamic class ex3 extends MovieClip {
public function ex3(){
super();
}
}
}//package
Section 94
//ex4 (ex4)
package {
import flash.display.*;
public dynamic class ex4 extends MovieClip {
public function ex4(){
super();
}
}
}//package
Section 95
//ex5 (ex5)
package {
import flash.display.*;
public dynamic class ex5 extends MovieClip {
public function ex5(){
super();
}
}
}//package
Section 96
//Exp (Exp)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
public class Exp extends MovieClip {
public var rad:Number;
public var particleFadeSpeed:Number;// = 5
public var particleRange:Number;// = 100
public var gravity:Number;// = 0.3
public var particleTotal:Number;// = 25
public var scale:Number;
public var filter:GlowFilter;
public var exrad:MovieClip;
public var parti:Array;
public var particleMaxSpeed:Number;// = 5
public function Exp(targetX, targetY, bty, size){
var i:Number;
particleMaxSpeed = 5;
particleFadeSpeed = 5;
particleTotal = 25;
particleRange = 100;
gravity = 0.3;
parti = new Array(particleTotal);
super();
if (size == 1){
scale = 2;
rad = 0.15;
} else {
scale = 0.5;
rad = 0.2;
};
i = 0;
while (i < particleTotal) {
filter = new GlowFilter();
if (bty == 0){
parti[i] = new par1();
filter.color = 0xFF8800;
if (i == 0){
exrad = new ex1();
};
};
if (bty == 1){
parti[i] = new par2();
filter.color = 4167150;
if (i == 0){
exrad = new ex2();
};
};
if (bty == 2){
parti[i] = new par3();
filter.color = 14955556;
if (i == 0){
exrad = new ex3();
};
};
if (bty == 3){
parti[i] = new par4();
filter.color = 7781914;
if (i == 0){
exrad = new ex4();
};
};
if (bty == 4){
parti[i] = new par5();
filter.color = 11155411;
if (i == 0){
exrad = new ex5();
};
};
if (i == 0){
addChild(exrad);
exrad.x = targetX;
exrad.y = targetY;
exrad.filters = [filter];
exrad.addEventListener(Event.ENTER_FRAME, radm);
};
parti[i].filters = [filter];
addChild(parti[i]);
parti[i].x = targetX;
parti[i].y = targetY;
parti[i].name = i;
parti[i].rotation = (Math.random() * 360);
parti[i].alpha = ((Math.random() * 50) + 50);
parti[i].scaleX = (Math.random() * scale);
parti[i].scaleY = (Math.random() * scale);
parti[i].boundyLeft = (targetX - particleRange);
parti[i].boundyTop = (targetY - particleRange);
parti[i].boundyRight = (targetX + particleRange);
parti[i].boundyBottom = (targetY + particleRange);
parti[i].speedX = ((Math.random() * particleMaxSpeed) - (Math.random() * particleMaxSpeed));
parti[i].speedY = ((Math.random() * particleMaxSpeed) - (Math.random() * particleMaxSpeed));
parti[i].speedX = (parti[i].speedX * particleMaxSpeed);
parti[i].speedY = (parti[i].speedY * particleMaxSpeed);
parti[i].fadeSpeed = (Math.random() * (particleFadeSpeed * particleFadeSpeed));
parti[i].addEventListener(Event.ENTER_FRAME, moveParticles);
i++;
};
}
public function moveParticles(e:Event):void{
e.target.alpha = (e.target.alpha - e.target.fadeSpeed);
e.target.x = (e.target.x + e.target.speedX);
e.target.y = (e.target.y + e.target.speedY);
if (e.target.speedY < particleMaxSpeed){
e.target.speedY = (e.target.speedY + gravity);
};
if ((((((((e.target.x < e.target.boundyLeft)) || ((e.target.x > e.target.boundyRight)))) || ((e.target.y < e.target.boundyTop)))) || ((e.target.y > e.target.boundyBottom)))){
e.target.alpha = (e.target.alpha * 0.35);
};
if (e.target.alpha <= 0){
if ((((e.target.name == 24)) && (!((exrad == null))))){
removeChild(exrad);
exrad.removeEventListener(Event.ENTER_FRAME, radm);
exrad = null;
};
removeChild(parti[e.target.name]);
parti[e.target.name].removeEventListener(Event.ENTER_FRAME, moveParticles);
parti[e.target.name] = null;
};
}
public function radm(e:Event):void{
exrad.scaleX = (exrad.scaleX + 0.35);
exrad.scaleY = (exrad.scaleY + 0.35);
exrad.alpha = (exrad.alpha - rad);
if (exrad.alpha < 0.1){
removeChild(exrad);
exrad.removeEventListener(Event.ENTER_FRAME, radm);
exrad = null;
};
}
}
}//package
Section 97
//fmenu (fmenu)
package {
import flash.display.*;
public dynamic class fmenu extends MovieClip {
public function fmenu(){
super();
}
}
}//package
Section 98
//ftWarning (ftWarning)
package {
import flash.display.*;
public dynamic class ftWarning extends MovieClip {
public var sktuto:skTuto;
public var stuto:sTuto;
public function ftWarning(){
super();
}
}
}//package
Section 99
//game_over (game_over)
package {
import flash.display.*;
import gs.*;
import flash.events.*;
public dynamic class game_over extends MovieClip {
public var goCdwn:int;// = 0
public var greyoverMc:MovieClip;
public var V_mc:MovieClip;
public var A_mc:MovieClip;
public var G_mc:MovieClip;
public var goCont:MovieClip;
public var e_mc:MovieClip;
public var O_mc:MovieClip;
public var R_mc:MovieClip;
public var M_mc:MovieClip;
public var E_mc:MovieClip;
public function game_over():void{
goCdwn = 0;
super();
}
public function sGameOver():void{
goCont = new MovieClip();
this.addChild(goCont);
G_mc = new goG();
A_mc = new goA();
M_mc = new goM();
E_mc = new goE();
O_mc = new goO();
V_mc = new goV();
e_mc = new goE();
R_mc = new goR();
goCont.addChild(G_mc);
goCont.addChild(A_mc);
goCont.addChild(M_mc);
goCont.addChild(E_mc);
goCont.addChild(O_mc);
goCont.addChild(V_mc);
goCont.addChild(e_mc);
goCont.addChild(R_mc);
G_mc.y = -70;
A_mc.y = -70;
M_mc.y = -70;
E_mc.y = -70;
O_mc.y = -70;
V_mc.y = -70;
e_mc.y = -70;
R_mc.y = -70;
G_mc.x = 96;
A_mc.x = 132;
M_mc.x = 172;
E_mc.x = 216;
O_mc.x = 0x0101;
V_mc.x = 293;
e_mc.x = 330;
R_mc.x = 357;
TweenLite.to(G_mc, ((Math.random() * 2) + 1), {y:136, onComplete:goFinishTween});
TweenLite.to(A_mc, ((Math.random() * 2) + 1), {y:136, onComplete:goFinishTween});
TweenLite.to(M_mc, ((Math.random() * 2) + 1), {y:136, onComplete:goFinishTween});
TweenLite.to(E_mc, ((Math.random() * 2) + 1), {y:136, onComplete:goFinishTween});
TweenLite.to(O_mc, ((Math.random() * 2) + 1), {y:136, onComplete:goFinishTween});
TweenLite.to(V_mc, ((Math.random() * 2) + 1), {y:136, onComplete:goFinishTween});
TweenLite.to(e_mc, ((Math.random() * 2) + 1), {y:136, onComplete:goFinishTween});
TweenLite.to(R_mc, ((Math.random() * 2) + 1), {y:136, onComplete:goFinishTween});
}
public function goFinishTween():void{
goCdwn = (goCdwn + 1);
if (goCdwn == 8){
dispatchEvent(new Event("goOver"));
goCdwn = 0;
};
}
public function remove_sGameOver():void{
goCont.removeChild(G_mc);
goCont.removeChild(A_mc);
goCont.removeChild(M_mc);
goCont.removeChild(E_mc);
goCont.removeChild(O_mc);
goCont.removeChild(V_mc);
goCont.removeChild(e_mc);
goCont.removeChild(R_mc);
G_mc = null;
A_mc = null;
M_mc = null;
E_mc = null;
O_mc = null;
V_mc = null;
e_mc = null;
R_mc = null;
removeChild(goCont);
goCont = null;
}
}
}//package
Section 100
//gameoverSound (gameoverSound)
package {
import flash.media.*;
public dynamic class gameoverSound extends Sound {
public function gameoverSound(){
super();
}
}
}//package
Section 101
//goA (goA)
package {
import flash.display.*;
public dynamic class goA extends MovieClip {
public function goA(){
super();
}
}
}//package
Section 102
//goE (goE)
package {
import flash.display.*;
public dynamic class goE extends MovieClip {
public function goE(){
super();
}
}
}//package
Section 103
//goG (goG)
package {
import flash.display.*;
public dynamic class goG extends MovieClip {
public function goG(){
super();
}
}
}//package
Section 104
//goM (goM)
package {
import flash.display.*;
public dynamic class goM extends MovieClip {
public function goM(){
super();
}
}
}//package
Section 105
//goO (goO)
package {
import flash.display.*;
public dynamic class goO extends MovieClip {
public function goO(){
super();
}
}
}//package
Section 106
//goR (goR)
package {
import flash.display.*;
public dynamic class goR extends MovieClip {
public function goR(){
super();
}
}
}//package
Section 107
//goV (goV)
package {
import flash.display.*;
public dynamic class goV extends MovieClip {
public function goV(){
super();
}
}
}//package
Section 108
//gSBox (gSBox)
package {
import flash.display.*;
public dynamic class gSBox extends MovieClip {
public function gSBox(){
super();
}
}
}//package
Section 109
//gsmoke (gsmoke)
package {
import flash.display.*;
public dynamic class gsmoke extends MovieClip {
public function gsmoke(){
super();
}
}
}//package
Section 110
//high_bt (high_bt)
package {
import flash.display.*;
public dynamic class high_bt extends MovieClip {
public var bt:MovieClip;
public function high_bt(){
super();
}
}
}//package
Section 111
//intBox (intBox)
package {
import flash.display.*;
public dynamic class intBox extends MovieClip {
public function intBox(){
super();
}
}
}//package
Section 112
//La (La)
package {
import flash.display.*;
public dynamic class La extends MovieClip {
public var ba:bLa;
public function La(){
super();
}
}
}//package
Section 113
//Lb (Lb)
package {
import flash.display.*;
public dynamic class Lb extends MovieClip {
public var bb:bLb;
public function Lb(){
super();
}
}
}//package
Section 114
//Lc (Lc)
package {
import flash.display.*;
public dynamic class Lc extends MovieClip {
public var bc:bLc;
public function Lc(){
super();
}
}
}//package
Section 115
//Ll (Ll)
package {
import flash.display.*;
public dynamic class Ll extends MovieClip {
public var bl:bLl;
public function Ll(){
super();
}
}
}//package
Section 116
//Ls (Ls)
package {
import flash.display.*;
public dynamic class Ls extends MovieClip {
public var bs:bLs;
public function Ls(){
super();
}
}
}//package
Section 117
//Lt (Lt)
package {
import flash.display.*;
public dynamic class Lt extends MovieClip {
public var bt:bLt;
public function Lt(){
super();
}
}
}//package
Section 118
//Lu (Lu)
package {
import flash.display.*;
public dynamic class Lu extends MovieClip {
public var bu:bLu;
public function Lu(){
super();
}
}
}//package
Section 119
//m_ (m_)
package {
import flash.display.*;
public dynamic class m_ extends MovieClip {
public function m_(){
super();
}
}
}//package
Section 120
//menubt (menubt)
package {
import flash.display.*;
public dynamic class menubt extends MovieClip {
public var bt:bkmenu;
public function menubt(){
super();
}
}
}//package
Section 121
//mgame (mgame)
package {
import flash.display.*;
public dynamic class mgame extends MovieClip {
public var bt:MovieClip;
public function mgame(){
super();
}
}
}//package
Section 122
//miniBn (miniBn)
package {
import flash.display.*;
public dynamic class miniBn extends MovieClip {
public var bt:MovieClip;
public function miniBn(){
super();
}
}
}//package
Section 123
//miniCl (miniCl)
package {
import flash.display.*;
public dynamic class miniCl extends MovieClip {
public var bt:MovieClip;
public function miniCl(){
super();
}
}
}//package
Section 124
//minilogo (minilogo)
package {
import flash.display.*;
public dynamic class minilogo extends MovieClip {
public function minilogo(){
super();
}
}
}//package
Section 125
//miplay (miplay)
package {
import flash.display.*;
public dynamic class miplay extends MovieClip {
public function miplay(){
super();
}
}
}//package
Section 126
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public function MochiBot(){
super();
}
public static function track(parent:Sprite, tag:String):MochiBot{
var self:MochiBot;
var server:String;
var lv:URLVariables;
var url:String;
var req:URLRequest;
var loader:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
self = new (MochiBot);
parent.addChild(self);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
server = "http://core.mochibot.com/my/core.swf";
lv = new URLVariables();
lv["sb"] = Security.sandboxType;
lv["v"] = Capabilities.version;
lv["swfid"] = tag;
lv["mv"] = "8";
lv["fv"] = "9";
url = self.root.loaderInfo.loaderURL;
if (url.indexOf("http") == 0){
lv["url"] = url;
} else {
lv["url"] = "local";
};
req = new URLRequest(server);
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
self.addChild(loader);
loader.load(req);
return (self);
}
}
}//package
Section 127
//nEffect (nEffect)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import unam.*;
public class nEffect extends MovieClip {
public var partiMC:MovieClip;
public var holderHeight:Number;
public var blockMC:MovieClip;
public var colorTransform:ColorTransform;
private var X:int;
private var Y:int;
public var main_class:unam;
private var type:int;
public var holderWidth:Number;
public var holder:MovieClip;
public var explArray:Array;
public var circles:Array;
public var cDown:Number;// = 50
public var parti:Array;
public var bGg:MovieClip;
public function nEffect(targetX:int, targetY:int, bty:int, mc:MovieClip){
circles = new Array();
parti = new Array();
colorTransform = new ColorTransform();
explArray = new Array();
cDown = 50;
super();
X = targetX;
Y = targetY;
type = bty;
blockMC = mc;
partiMC = new MovieClip();
addChild(partiMC);
createParticle();
addEventListener(Event.ENTER_FRAME, moveParticles, false, 0, true);
}
private function moveParticles(e:Event){
var i:int;
if (cDown >= 0){
blockMC.alpha = (blockMC.alpha + 0.02);
createParticle();
};
i = (parti.length - 1);
while (i >= 0) {
if (parti[i].x > (parti[i].st + 30)){
parti[i].life = 0;
};
if (parti[i].x < (parti[i].st - 10)){
parti[i].life = 0;
} else {
parti[i].x = (parti[i].x + parti[i].dx);
};
parti[i].y = (parti[i].y + parti[i].dy);
parti[i].alpha = (parti[i].alpha - 0.02);
parti[i].dy = (parti[i].dy - 0.5);
if (parti[i].alpha < 0.02){
parti[i].life = 0;
};
if (parti[i].life-- <= 0){
partiMC.removeChild(parti[i]);
parti.splice(i, 1);
};
i--;
};
}
public function createParticle():void{
var p:Particle;
var PrevP:int;
p = new Particle();
PrevP = (Math.floor((Math.random() * ((4 - 1) + 1))) + 1);
p.x = ((X + Math.floor((Math.random() * (55 + 1)))) - 1);
p.y = (Y + cDown);
p.glow = new GlowFilter();
if (type == 0){
colorTransform.color = 0xFF8800;
p.glow.color = 0xFF8800;
p.transform.colorTransform = colorTransform;
} else {
if (type == 1){
colorTransform.color = 4167150;
p.transform.colorTransform = colorTransform;
p.glow.color = 4167150;
} else {
if (type == 2){
colorTransform.color = 14955556;
p.glow.color = 14955556;
p.transform.colorTransform = colorTransform;
} else {
if (type == 3){
colorTransform.color = 7781914;
p.glow.color = 7781914;
p.transform.colorTransform = colorTransform;
} else {
if (type == 4){
colorTransform.color = 11155411;
p.glow.color = 11155411;
p.transform.colorTransform = colorTransform;
};
};
};
};
};
p.filters = [p.glow];
p.life = (100 + Math.round((Math.random() * 10)));
p.dx = ((Math.random() * 2) - 1);
p.dy = -1;
p.st = p.x;
partiMC.addChild(p);
parti.push(p);
cDown = (cDown - 1);
}
}
}//package
Section 128
//nextbt (nextbt)
package {
import flash.display.*;
public dynamic class nextbt extends MovieClip {
public var bt:MovieClip;
public function nextbt(){
super();
}
}
}//package
Section 129
//no_bt (no_bt)
package {
import flash.display.*;
public dynamic class no_bt extends MovieClip {
public var bt:MovieClip;
public function no_bt(){
super();
}
}
}//package
Section 130
//o_ (o_)
package {
import flash.display.*;
public dynamic class o_ extends MovieClip {
public function o_(){
super();
}
}
}//package
Section 131
//off_bt (off_bt)
package {
import flash.display.*;
public dynamic class off_bt extends MovieClip {
public var bt:MovieClip;
public function off_bt(){
super();
}
}
}//package
Section 132
//on_bt (on_bt)
package {
import flash.display.*;
public dynamic class on_bt extends MovieClip {
public var bt:MovieClip;
public function on_bt(){
super();
}
}
}//package
Section 133
//optbt (optbt)
package {
import flash.display.*;
public dynamic class optbt extends MovieClip {
public var bt:MovieClip;
public function optbt(){
super();
}
}
}//package
Section 134
//optionpart (optionpart)
package {
import flash.display.*;
public dynamic class optionpart extends MovieClip {
public function optionpart(){
super();
}
}
}//package
Section 135
//optmsg (optmsg)
package {
import flash.display.*;
public dynamic class optmsg extends MovieClip {
public var mon:on_bt;
public var soff:soff_bt;
public var menuBt:menubt;
public var son:son_bt;
public var xcl:x_close;
public var moff:off_bt;
public function optmsg(){
super();
}
}
}//package
Section 136
//osmoke (osmoke)
package {
import flash.display.*;
public dynamic class osmoke extends MovieClip {
public function osmoke(){
super();
}
}
}//package
Section 137
//par1 (par1)
package {
import flash.display.*;
public dynamic class par1 extends MovieClip {
public function par1(){
super();
}
}
}//package
Section 138
//par2 (par2)
package {
import flash.display.*;
public dynamic class par2 extends MovieClip {
public function par2(){
super();
}
}
}//package
Section 139
//par3 (par3)
package {
import flash.display.*;
public dynamic class par3 extends MovieClip {
public function par3(){
super();
}
}
}//package
Section 140
//par4 (par4)
package {
import flash.display.*;
public dynamic class par4 extends MovieClip {
public function par4(){
super();
}
}
}//package
Section 141
//par5 (par5)
package {
import flash.display.*;
public dynamic class par5 extends MovieClip {
public function par5(){
super();
}
}
}//package
Section 142
//Particle (Particle)
package {
import flash.display.*;
public dynamic class Particle extends MovieClip {
public function Particle(){
super();
}
}
}//package
Section 143
//pl_mask (pl_mask)
package {
import flash.display.*;
public dynamic class pl_mask extends MovieClip {
public function pl_mask(){
super();
}
}
}//package
Section 144
//playB (playB)
package {
import flash.display.*;
public dynamic class playB extends MovieClip {
public var bt:MovieClip;
public function playB(){
super();
}
}
}//package
Section 145
//playC (playC)
package {
import flash.display.*;
public dynamic class playC extends MovieClip {
public var bt:MovieClip;
public function playC(){
super();
}
}
}//package
Section 146
//preloader (preloader)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import CPMStar.*;
import flash.filters.*;
import flash.geom.*;
public dynamic class preloader extends MovieClip {
private var myGlow2:GlowFilter;
public var partiMC:MovieClip;
private var myGlow3:GlowFilter;
public var holderHeight:Number;
private var gsOn:Boolean;// = false
private var sAd:Boolean;// = false
private var myGlow1:GlowFilter;
private var myGlow5:GlowFilter;
public var ad:DisplayObject;
private var myTimer:Timer;
private var loadComplete:Boolean;// = false
public var compt:MovieClip;
public var colorTransform:ColorTransform;
public var countDown:int;// = 0
public var pMask:MovieClip;
private var URLallowed:Array;
public var playbt:MovieClip;
private var onRightDomain:Boolean;// = true
public var holderWidth:Number;
public var holder:MovieClip;
public var adBox:MovieClip;
public var explArray:Array;
public var cubeTransform:ColorTransform;
private var sPlay:Boolean;// = false
public var circles:Array;
private var myGlow4:GlowFilter;
public var ldrInfo:LoaderInfo;
public var bLight:MovieClip;
public var parti:Array;
public var bGg:MovieClip;
public function preloader(ldrInfo:LoaderInfo=null):void{
var i:uint;
circles = new Array();
parti = new Array();
colorTransform = new ColorTransform();
cubeTransform = new ColorTransform();
explArray = new Array();
countDown = 0;
URLallowed = ["smileygamer.com"];
onRightDomain = true;
gsOn = false;
myGlow1 = new GlowFilter();
myGlow2 = new GlowFilter();
myGlow3 = new GlowFilter();
myGlow4 = new GlowFilter();
myGlow5 = new GlowFilter();
sAd = false;
sPlay = false;
loadComplete = false;
super();
this.ldrInfo = ldrInfo;
myGlow1.color = 0xFF8800;
myGlow1.blurX = 5;
myGlow1.blurY = 5;
myGlow1.quality = 2;
myGlow2.color = 4167150;
myGlow2.blurX = 5;
myGlow2.blurY = 5;
myGlow2.quality = 2;
myGlow3.color = 14955556;
myGlow3.blurX = 5;
myGlow3.blurY = 5;
myGlow3.quality = 2;
myGlow4.color = 7781914;
myGlow4.blurX = 5;
myGlow4.blurY = 5;
myGlow4.quality = 2;
myGlow5.color = 11155411;
myGlow5.blurX = 5;
myGlow5.blurY = 5;
myGlow5.quality = 2;
bGg = new preloaderBg();
addChild(bGg);
compt = new ctext();
addChild(compt);
holder = new MovieClip();
addChild(holder);
i = 0;
while (i < 5) {
circles[i] = new PreloaderSquare();
circles[i].x = (i * 20);
circles[i].tweened = false;
holder.addChild(circles[i]);
i++;
};
holderWidth = holder.width;
holderHeight = holder.height;
holder.x = ((600 / 2) - (holderWidth / 2));
holder.y = ((0x0200 / 2) - (holderHeight / 2));
compt.x = ((600 / 2) - (compt.width / 2));
compt.y = (((0x0200 / 2) - (compt.height / 2)) + 24);
addEventListener(Event.ENTER_FRAME, progressHandler);
if (SmileyGamerAPI.canShowPreloaderAd()){
adBox = new adBoxMc();
addChild(adBox);
adBox.x = 150;
adBox.y = 65.5;
showAd();
holder.y = (holder.y + 120);
compt.y = (compt.y + 120);
sAd = true;
} else {
sPlay = true;
};
}
private function showAd():void{
var CPMStarContentSpotID:String;
CPMStarContentSpotID = "2254QD32C4BA0";
ad = new AdLoader(CPMStarContentSpotID);
adBox.addChild(ad);
}
public function circlesTweened():void{
if (((sPlay) && (!(playbt)))){
pMask = new pl_mask();
playbt = new miplay();
bLight = new blight();
addChild(playbt);
addChild(pMask);
addChild(bLight);
playbt.x = ((600 / 2) - (playbt.width / 2));
playbt.y = ((0x0200 / 2) + (holderWidth / 2));
playbt.buttonMode = true;
playbt.useHandCursor = true;
if (sAd){
playbt.y = (playbt.y + 120);
};
pMask.x = playbt.x;
pMask.y = (playbt.y + 23);
bLight.x = pMask.x;
bLight.y = pMask.y;
bLight.glow = new GlowFilter();
bLight.glow.color = 0xFFFFFF;
bLight.filters = [bLight.glow];
partiMC = new MovieClip();
addChild(partiMC);
createParticle();
addEventListener(Event.ENTER_FRAME, moveParticles, false, 0, true);
};
}
private function moveParticles(e:Event){
var i:int;
var e = e;
if (compt){
compt.alpha = (compt.alpha - 0.05);
if (compt.alpha <= 0.05){
removeChild(compt);
compt = null;
};
};
if (((pMask) && ((pMask.y >= (playbt.y + 10))))){
pMask.y = (pMask.y - 0.5);
bLight.alpha = (bLight.alpha - 0.022);
bLight.y = pMask.y;
createParticle();
} else {
if (bLight){
removeChild(bLight);
bLight = null;
};
if (pMask){
removeChild(pMask);
pMask = null;
checkDomain();
playbt.addEventListener(MouseEvent.CLICK, clickplay, false, 0, true);
};
};
i = (parti.length - 1);
for (;i >= 0;(i = (i - 1))) {
if (parti[i].x > (parti[i].st + 30)){
parti[i].life = 0;
};
if (parti[i].x < (parti[i].st - 10)){
parti[i].life = 0;
} else {
parti[i].x = (parti[i].x + parti[i].dx);
};
parti[i].y = (parti[i].y + parti[i].dy);
parti[i].alpha = (parti[i].alpha - 0.02);
if (parti[i].alpha < 0.02){
parti[i].life = 0;
};
if (parti[i].life-- <= 0){
partiMC.removeChild(parti[i]);
parti.splice(i, 1);
continue;
var _slot1 = e;
};
};
}
private function timerListener(e:TimerEvent):void{
sPlay = true;
if (((!(playbt)) && (loadComplete))){
circlesTweened();
};
}
public function progressHandler(e:Event):void{
var total:Number;
var loaded:Number;
var loadedPercentage:Number;
var pc:Number;
total = ldrInfo.bytesTotal;
loaded = ldrInfo.bytesLoaded;
loadedPercentage = Math.floor(((loaded / total) * 100));
pc = Math.floor(((loaded / total) * 100));
compt.l_f.text = (pc + "%");
if ((((loadedPercentage < 21)) && (!(circles[0].tweened)))){
cubeTransform.color = 0xFF8800;
cubeTransform.alphaMultiplier = (loadedPercentage / 20);
circles[0].transform.colorTransform = cubeTransform;
myGlow1.alpha = (loadedPercentage / 20);
circles[0].filters = [myGlow1];
};
if ((((loadedPercentage > 20)) && (!(circles[0].tweened)))){
circles[0].tweened = true;
cubeTransform.color = 0xFF8800;
cubeTransform.alphaMultiplier = 1;
circles[0].transform.colorTransform = cubeTransform;
myGlow1.alpha = 1;
circles[0].filters = [myGlow1];
};
if ((((loadedPercentage > 20)) && ((gsOn == false)))){
gsOn = true;
dispatchEvent(new Event("gamerSafeEvent"));
};
if ((((((loadedPercentage > 20)) && ((loadedPercentage < 41)))) && (!(circles[1].tweened)))){
cubeTransform.color = 4167150;
cubeTransform.alphaMultiplier = (loadedPercentage / 40);
circles[1].transform.colorTransform = cubeTransform;
myGlow2.alpha = (loadedPercentage / 40);
circles[1].filters = [myGlow2];
};
if ((((loadedPercentage > 40)) && (!(circles[1].tweened)))){
circles[1].tweened = true;
cubeTransform.color = 4167150;
cubeTransform.alphaMultiplier = 1;
circles[1].transform.colorTransform = cubeTransform;
myGlow2.alpha = 1;
circles[1].filters = [myGlow2];
};
if ((((((loadedPercentage > 40)) && ((loadedPercentage < 61)))) && (!(circles[2].tweened)))){
cubeTransform.color = 14955556;
cubeTransform.alphaMultiplier = (loadedPercentage / 60);
circles[2].transform.colorTransform = cubeTransform;
myGlow3.alpha = (loadedPercentage / 60);
circles[2].filters = [myGlow3];
};
if ((((loadedPercentage > 60)) && (!(circles[2].tweened)))){
circles[2].tweened = true;
cubeTransform.color = 14955556;
cubeTransform.alphaMultiplier = 1;
circles[2].transform.colorTransform = cubeTransform;
myGlow3.alpha = 1;
circles[2].filters = [myGlow3];
};
if ((((((loadedPercentage > 60)) && ((loadedPercentage < 81)))) && (!(circles[3].tweened)))){
cubeTransform.color = 7781914;
cubeTransform.alphaMultiplier = (loadedPercentage / 80);
circles[3].transform.colorTransform = cubeTransform;
myGlow4.alpha = (loadedPercentage / 80);
circles[3].filters = [myGlow4];
};
if ((((loadedPercentage > 80)) && (!(circles[3].tweened)))){
cubeTransform.color = 7781914;
cubeTransform.alphaMultiplier = 1;
circles[3].transform.colorTransform = cubeTransform;
myGlow4.alpha = 1;
circles[3].filters = [myGlow4];
circles[3].tweened = true;
};
if ((((((loadedPercentage > 80)) && ((loadedPercentage <= 100)))) && (!(circles[4].tweened)))){
cubeTransform.color = 11155411;
cubeTransform.alphaMultiplier = (loadedPercentage / 100);
circles[4].transform.colorTransform = cubeTransform;
myGlow5.alpha = (loadedPercentage / 100);
circles[4].filters = [myGlow5];
};
if ((((loadedPercentage == 100)) && (!(circles[4].tweened)))){
circles[4].tweened = true;
cubeTransform.color = 11155411;
cubeTransform.alphaMultiplier = 1;
circles[4].transform.colorTransform = cubeTransform;
myGlow5.alpha = 1;
circles[4].filters = [myGlow5];
removeEventListener(Event.ENTER_FRAME, progressHandler);
dispatchEvent(new Event("loadComplete"));
loadComplete = true;
myTimer = new Timer(7000);
myTimer.addEventListener(TimerEvent.TIMER, timerListener);
myTimer.start();
};
}
private function checkDomain():void{
var currentUrl:*;
var i:int;
currentUrl = this.ldrInfo.url;
currentUrl = currentUrl.split("://");
currentUrl = currentUrl[1].split("/");
currentUrl = currentUrl[0];
if (currentUrl.substr(0, 4) == "www."){
currentUrl = currentUrl.substring(4);
};
i = 0;
while (i < URLallowed.length) {
if (currentUrl == URLallowed[i]){
onRightDomain = true;
break;
};
i++;
};
}
public function waitAndGo(e:Event):void{
var tt:int;
countDown = (countDown + 1);
if (playbt){
playbt.alpha = (playbt.alpha - 0.04);
};
if (countDown == 25){
removeEventListener(Event.ENTER_FRAME, moveParticles);
removeEventListener(Event.ENTER_FRAME, waitAndGo);
removeChild(playbt);
playbt = null;
tt = 0;
while (tt < 5) {
if (explArray[tt]){
removeChild(explArray[tt]);
explArray[tt] = null;
};
tt++;
};
dispatchEvent(new Event("preloaderOver"));
};
}
public function clickplay(event:MouseEvent){
var j:int;
if (onRightDomain){
addEventListener(Event.ENTER_FRAME, waitAndGo, false, 0, true);
playbt.removeEventListener(MouseEvent.CLICK, clickplay);
if (sAd){
if (adBox){
adBox.removeChild(ad);
ad = null;
removeChild(adBox);
adBox = null;
};
};
j = 0;
while (j < 5) {
explArray[j] = new Exp(((holder.x + (j * 20)) + 7), (holder.y + 7), j, 2);
addChild(explArray[j]);
if (circles[j]){
holder.removeChild(circles[j]);
circles[j] = null;
};
j++;
};
} else {
trace("Site Locked Version");
};
}
public function createParticle():void{
var p:Particle;
var PrevP:int;
p = new Particle();
PrevP = (Math.floor((Math.random() * ((4 - 1) + 1))) + 1);
p.x = ((pMask.x + Math.floor((Math.random() * (55 + 1)))) - 1);
p.y = pMask.y;
p.glow = new GlowFilter();
if ((((p.x >= (pMask.x - 5))) && ((p.x < (pMask.x + 11))))){
colorTransform.color = 0xFF8800;
p.glow.color = 0xFF8800;
p.transform.colorTransform = colorTransform;
} else {
if ((((p.x >= (pMask.x + 11))) && ((p.x < (pMask.x + 22))))){
colorTransform.color = 4167150;
p.transform.colorTransform = colorTransform;
p.glow.color = 4167150;
} else {
if ((((p.x >= (pMask.x + 22))) && ((p.x < (pMask.x + 33))))){
colorTransform.color = 14955556;
p.glow.color = 14955556;
p.transform.colorTransform = colorTransform;
} else {
if ((((p.x >= (pMask.x + 33))) && ((p.x < (pMask.x + 44))))){
colorTransform.color = 7781914;
p.glow.color = 7781914;
p.transform.colorTransform = colorTransform;
} else {
if ((((p.x >= (pMask.x + 44))) && ((p.x < (pMask.x + 55))))){
colorTransform.color = 11155411;
p.glow.color = 11155411;
p.transform.colorTransform = colorTransform;
};
};
};
};
};
p.filters = [p.glow];
p.life = (100 + Math.round((Math.random() * 10)));
p.dx = ((Math.random() * 2) - 1);
p.dy = -1;
p.st = p.x;
partiMC.addChild(p);
parti.push(p);
}
}
}//package
Section 147
//preloaderBg (preloaderBg)
package {
import flash.display.*;
public dynamic class preloaderBg extends MovieClip {
public function preloaderBg(){
super();
}
}
}//package
Section 148
//PreloaderSquare (PreloaderSquare)
package {
import flash.display.*;
public dynamic class PreloaderSquare extends MovieClip {
public function PreloaderSquare(){
super();
}
}
}//package
Section 149
//previousbt (previousbt)
package {
import flash.display.*;
public dynamic class previousbt extends MovieClip {
public var bt:MovieClip;
public function previousbt(){
super();
}
}
}//package
Section 150
//psmoke (psmoke)
package {
import flash.display.*;
public dynamic class psmoke extends MovieClip {
public function psmoke(){
super();
}
}
}//package
Section 151
//r_ (r_)
package {
import flash.display.*;
public dynamic class r_ extends MovieClip {
public function r_(){
super();
}
}
}//package
Section 152
//resbt (resbt)
package {
import flash.display.*;
public dynamic class resbt extends MovieClip {
public var bt:MovieClip;
public function resbt(){
super();
}
}
}//package
Section 153
//resmsg (resmsg)
package {
import flash.display.*;
public dynamic class resmsg extends MovieClip {
public var yesbt:yes_bt;
public var nobt:no_bt;
public function resmsg(){
super();
}
}
}//package
Section 154
//rsmoke (rsmoke)
package {
import flash.display.*;
public dynamic class rsmoke extends MovieClip {
public function rsmoke(){
super();
}
}
}//package
Section 155
//sEffect (sEffect)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.utils.*;
public class sEffect extends MovieClip {
public var partiMC:MovieClip;
private var X:Number;
public var mcString:String;
private var Y:Number;
public var g_class:the_game;
private var type:int;
public var circles:Array;
public var sNbr:Number;// = 0
public var parti:Array;
public var _particle:Array;
public var bGg:MovieClip;
public function sEffect(passed_class:the_game, targetX:int, targetY:int, bty:int){
circles = new Array();
parti = new Array();
sNbr = 0;
super();
g_class = passed_class;
type = bty;
if (type == 0){
mcString = "osmoke";
};
if (type == 1){
mcString = "bsmoke";
};
if (type == 2){
mcString = "rsmoke";
};
if (type == 3){
mcString = "gsmoke";
};
if (type == 4){
mcString = "psmoke";
};
X = targetX;
Y = targetY;
_particle = new Array();
partiMC = new MovieClip();
addChild(partiMC);
doTrail(X, Y);
}
public function doTrail(targetX:Number, targetY:Number):void{
var tMC:Class;
var randomScale:*;
if (_particle[sNbr]){
_particle[sNbr].removeEventListener(Event.ENTER_FRAME, moveP);
removeChild(_particle[sNbr]);
_particle[sNbr] = null;
};
tMC = (getDefinitionByName(mcString) as Class);
_particle[sNbr] = (new (tMC) as MovieClip);
_particle[sNbr].x = (targetX + (sNbr * 5));
_particle[sNbr].y = (targetY + (Math.random() * 4));
_particle[sNbr].rotation = (Math.random() * 360);
randomScale = ((Math.random() * 0.5) + 0.5);
_particle[sNbr].scaleX = randomScale;
_particle[sNbr].scaleY = randomScale;
_particle[sNbr].speed = ((Math.random() * 1.2) + 1);
_particle[sNbr]._alpha_ = 0.02;
_particle[sNbr].name = sNbr;
partiMC.addChild(_particle[sNbr]);
_particle[sNbr].addEventListener(Event.ENTER_FRAME, moveP, false, 0, true);
sNbr = (sNbr + 1);
if (sNbr < 10){
doTrail(X, Y);
};
}
private function moveP(e:Event){
var his:*;
his = e.target.name;
if (_particle[his]){
_particle[his].y = (_particle[his].y - _particle[his].speed);
_particle[his].alpha = (_particle[his].alpha - _particle[his]._alpha_);
if (_particle[his].alpha <= 0){
_particle[his].removeEventListener(Event.ENTER_FRAME, moveP);
partiMC.removeChild(_particle[his]);
_particle[his] = null;
if (his == 20){
removeChild(partiMC);
partiMC = null;
g_class.remove_sEffect();
};
};
};
}
}
}//package
Section 156
//SG_intro_bg (SG_intro_bg)
package {
import flash.display.*;
public dynamic class SG_intro_bg extends MovieClip {
public function SG_intro_bg(){
super();
}
}
}//package
Section 157
//skTuto (skTuto)
package {
import flash.display.*;
public dynamic class skTuto extends MovieClip {
public function skTuto(){
super();
}
}
}//package
Section 158
//smask (smask)
package {
import flash.display.*;
public dynamic class smask extends MovieClip {
public function smask(){
super();
}
}
}//package
Section 159
//SmileyGamerAPI (SmileyGamerAPI)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
public class SmileyGamerAPI {
public static const MIXED:int = 2;
public static const HOME:String = "http://www.smileygamer.com";
private static const ONLY_SG_AD_DOMAINS:Array = ["kaisergames.de", "y8.com", "kongregate.com", "freeonlinegames.com", "gamesclub.com", "media.jaludo.com"];
private static const NO_AD_DOMAINS:Array = ["www8.agame.com", "addictinggames.com", "armorgames.com", "www.flashgamelicense.com"];
public static const SG_ONLY:int = 1;
public static const NONE:int = 0;
private static var sGame:String;
private static var sStage:Stage;
private static var sID:int;
private static var sReferer:String;
public function SmileyGamerAPI(){
super();
}
public static function isInDomains(aDomains:Array):Boolean{
var allowed:Boolean;
var i:int;
allowed = false;
i = 0;
while (i < aDomains.length) {
allowed = ((allowed) || (isDomain(aDomains[i])));
i++;
};
return (allowed);
}
public static function showSGMoreGamesTab(aClip:DisplayObjectContainer, aColor:uint=0):void{
var url:String;
var ldr:Loader;
var aClip = aClip;
var aColor = aColor;
Security.allowDomain("smileygamer.com");
url = "http://www.smileygamer.com/sgads/SGMoreGamesTab.swf";
ldr = new Loader();
ldr.load(new URLRequest(((((url + "?gameid=") + sID) + "&color=") + aColor)));
//unresolved jump
var _slot1 = e;
aClip.addChild(ldr);
}
public static function allowedClickAwayAdType():int{
if (isInDomains(NO_AD_DOMAINS)){
return (NONE);
};
if (isInDomains(ONLY_SG_AD_DOMAINS)){
return (SG_ONLY);
};
return (MIXED);
}
public static function showFreeContent(aEvent:Event=null):void{
showURL((HOME + "/freecontent.html"), true);
}
public static function canShowPreloaderAd():Boolean{
return (!(((((isHome()) || (isInDomains(NO_AD_DOMAINS)))) || (isInDomains(ONLY_SG_AD_DOMAINS)))));
}
public static function init(aStage:Stage, aID:int, aGame:String):void{
sStage = aStage;
sID = aID;
sGame = aGame;
sReferer = getReferer();
}
public static function showPlayGamePage(aGameName:String=null, aID:int=0):void{
if (aGameName == null){
showURL((((((HOME + "/play/") + sID) + "/") + getGameSlug()) + ".html"), true);
} else {
showURL((((((HOME + "/play/") + aID) + "/") + getGameSlug(aGameName)) + ".html"), true);
};
}
public static function isDomain(aDomain:String):Boolean{
if (((isLocal()) && ((sStage.loaderInfo.loaderURL.toLowerCase().indexOf(aDomain) > -1)))){
return (true);
};
return ((((sReferer.indexOf(aDomain) == 0)) || (((!((sReferer.indexOf(("." + aDomain)) == -1))) && ((sReferer.indexOf(("." + aDomain)) == ((sReferer.length - aDomain.length) - 1)))))));
}
public static function showSGMoreGamesAd(aClip:DisplayObjectContainer):void{
var url:String;
var ldr:Loader;
var dispatchHandler:Function;
var aClip = aClip;
dispatchHandler = function (event:Event):void{
aClip.dispatchEvent(event);
};
Security.allowDomain("smileygamer.com");
url = "http://www.smileygamer.com/sgads/SGMoreGamesAd.swf";
ldr = new Loader();
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, dispatchHandler);
ldr.load(new URLRequest(((((url + "?gameid=") + sID) + "&siteref=") + sReferer)));
//unresolved jump
var _slot1 = e;
aClip.addChild(ldr);
}
public static function isLocal():Boolean{
return ((sReferer == "local"));
}
public static function isHome():Boolean{
return (isDomain("smileygamer.com"));
}
public static function showURL(aURL:String, aAddRef:Boolean=false):void{
var aURL = aURL;
var aAddRef = aAddRef;
if (aAddRef){
aURL = ((aURL + "?gameref=") + sID);
};
ExternalInterface.call("window.open", aURL, "_blank", "");
//unresolved jump
var _slot1 = e;
navigateToURL(new URLRequest(aURL), "_blank");
//unresolved jump
var _slot1 = e;
}
public static function getGameSlug(aGameName:String=null):String{
var name:String;
name = ((aGameName)!=null) ? aGameName : sGame;
name = name.toLowerCase();
name = name.replace(/\s/g, "-");
return (name);
}
public static function getReferer():String{
var referer:String;
if (sStage != null){
referer = sStage.loaderInfo.loaderURL.toLowerCase();
if (referer.indexOf("file://") == 0){
referer = "local";
} else {
referer = referer.split("/")[2];
};
return (referer);
//unresolved jump
};
return ("");
}
public static function showHome(aEvent:Event=null):void{
showURL(HOME, true);
}
}
}//package
Section 160
//soff_bt (soff_bt)
package {
import flash.display.*;
public dynamic class soff_bt extends MovieClip {
public var bt:MovieClip;
public function soff_bt(){
super();
}
}
}//package
Section 161
//son_bt (son_bt)
package {
import flash.display.*;
public dynamic class son_bt extends MovieClip {
public var bt:MovieClip;
public function son_bt(){
super();
}
}
}//package
Section 162
//splash (splash)
package {
import flash.display.*;
import gs.*;
import flash.events.*;
import flash.geom.*;
import unam.*;
import flash.net.*;
public class splash extends Sprite {
public var bnHigh:MovieClip;
public var creditBox:MovieClip;
public var cubP:int;// = 0
public var BackM:MovieClip;
public var splArr:Array;
public var explo:Exp;
private var ftTut:Boolean;// = false
public var creditMc:MovieClip;
public var cubAr:Array;
public var play_bt2:MovieClip;
private var particleMC:Sprite;
public var miniLogo:MovieClip;
private var particles:Array;
public var warnMc:MovieClip;
public var credVar:int;// = 1
public var lines:Shape;
public var bgBmp:BitmapData;
public var linesA:Array;
public var btitle:MovieClip;
public var play_bt:MovieClip;
public var achivementbt:MovieClip;
public var bk_mc:MovieClip;
public var achbt:MovieClip;
public var rline:MovieClip;
public var cnt:int;// = 0
public var highbt:MovieClip;
public var main_class:unam;
public var gOff:Number;
public var moreG:MovieClip;
public var linesAx:Array;
public var linesAy:Array;
public var rOff:Number;
public var bOff:Number;
public var ftitle:MovieClip;
public var clHigh:MovieClip;
public var Ttl:MovieClip;
public var addG:MovieClip;
public var mySharedObject:SharedObject;
public var backgroundFill:Bitmap;
public var backgroundBD:BitmapData;
public var sMask:MovieClip;
public function splash(passed_class:unam){
var bWidth:int;
splArr = new Array(10);
cnt = 0;
cubP = 0;
bgBmp = new title1(600, 0x0200);
credVar = 1;
ftTut = false;
super();
cubAr = new Array();
particleMC = new Sprite();
this.addChild(particleMC);
particles = new Array();
main_class = passed_class;
bk_mc = new bk();
addChild(bk_mc);
main_class.clasHigh = 0;
backgroundBD = new BitmapData(600, 0x0200, true, 4294967295);
backgroundBD.copyPixels(bgBmp, new Rectangle(0, 0, 600, 0x0200), new Point(0, 0));
backgroundFill = new Bitmap(backgroundBD);
addChild(backgroundFill);
mySharedObject = SharedObject.getLocal("cu87as7");
if (mySharedObject.data.firstTime == undefined){
mySharedObject.data.firstTime = true;
mySharedObject.flush();
ftTut = true;
};
rline = new blaline();
addChild(rline);
rline.x = 0;
rline.y = 32;
btitle = new MovieClip();
addChild(btitle);
Ttl = new Title();
addChild(Ttl);
Ttl.x = 182;
Ttl.y = 31;
ftitle = new MovieClip();
addChild(ftitle);
creditMc = new credit();
addChild(creditMc);
creditMc.x = 552;
creditMc.y = 497;
tintTween(Ttl.c.bc, 1);
tintTween(Ttl.u.bu, 1);
tintTween(Ttl.b.bb, 1);
tintTween(Ttl.l.bl, 1);
tintTween(Ttl.a.ba, 1);
tintTween(Ttl.s.bs, 1);
tintTween(Ttl.t.bt, 1);
tintTween(rline, 0);
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
BackM = new bm();
addChild(BackM);
BackM.x = 205;
BackM.y = 300;
tintTween(BackM.blbm, 0);
play_bt = new playC();
addChild(play_bt);
bWidth = (BackM.width / 2);
play_bt.x = (205 + (bWidth - (play_bt.width / 2)));
play_bt.y = 309;
play_bt2 = new playB();
addChild(play_bt2);
play_bt2.x = (205 + (bWidth - (play_bt2.width / 2)));
play_bt2.y = (play_bt.y + (play_bt.height + 5));
achbt = new ach_bt();
addChild(achbt);
achbt.x = (205 + (bWidth - (achbt.width / 2)));
achbt.y = (play_bt2.y + (play_bt2.height + 5));
achivementbt = new achivbt();
addChild(achivementbt);
achivementbt.x = (205 + (bWidth - (achivementbt.width / 2)));
achivementbt.y = (achbt.y + (achbt.height + 5));
achivementbt.mouseChildren = false;
highbt = new high_bt();
addChild(highbt);
highbt.x = (205 + (bWidth - (highbt.width / 2)));
highbt.y = (achivementbt.y + (achivementbt.height + 5));
play_bt2.addEventListener(MouseEvent.CLICK, on_play2_clicked);
play_bt.addEventListener(MouseEvent.CLICK, on_play_clicked);
achbt.addEventListener(MouseEvent.CLICK, on_ach_clicked);
highbt.addEventListener(MouseEvent.CLICK, on_high_clicked);
play_bt.addEventListener(MouseEvent.MOUSE_OVER, over_play);
play_bt.addEventListener(MouseEvent.MOUSE_OUT, out_play);
play_bt2.addEventListener(MouseEvent.MOUSE_OVER, over_play2);
play_bt2.addEventListener(MouseEvent.MOUSE_OUT, out_play2);
achbt.addEventListener(MouseEvent.MOUSE_OVER, over_achbt);
achbt.addEventListener(MouseEvent.MOUSE_OUT, out_achbt);
highbt.addEventListener(MouseEvent.MOUSE_OVER, over_highbt);
highbt.addEventListener(MouseEvent.MOUSE_OUT, out_highbt);
creditMc.addEventListener(MouseEvent.MOUSE_OVER, over_creditMc);
creditMc.addEventListener(MouseEvent.MOUSE_OUT, out_creditMc);
creditMc.addEventListener(MouseEvent.CLICK, on_creditMc_clicked);
achivementbt.addEventListener(MouseEvent.CLICK, on_achiv_clicked);
achivementbt.addEventListener(MouseEvent.MOUSE_OVER, over_achvbt);
achivementbt.addEventListener(MouseEvent.MOUSE_OUT, out_achvbt);
miniLogo = new minilogo();
addChild(miniLogo);
miniLogo.x = 450;
miniLogo.y = (0x0200 - 60);
miniLogo.mouseChildren = false;
miniLogo.buttonMode = true;
miniLogo.useHandCursor = true;
moreG = new mgame();
addChild(moreG);
moreG.x = 440;
moreG.y = (0x0200 - 20);
moreG.mouseChildren = false;
moreG.buttonMode = true;
moreG.useHandCursor = true;
moreG.addEventListener(MouseEvent.MOUSE_OVER, over_opt);
moreG.addEventListener(MouseEvent.MOUSE_OUT, out_opt);
moreG.addEventListener(MouseEvent.CLICK, SmileyGamerAPI.showHome);
miniLogo.addEventListener(MouseEvent.CLICK, SmileyGamerAPI.showHome);
addG = new addgame();
addG.x = 20;
addG.y = (0x0200 - 20);
addG.mouseChildren = false;
addChild(addG);
addG.buttonMode = true;
addG.useHandCursor = true;
addG.addEventListener(MouseEvent.MOUSE_OVER, over_opt);
addG.addEventListener(MouseEvent.MOUSE_OUT, out_opt);
addG.addEventListener(MouseEvent.CLICK, SmileyGamerAPI.showFreeContent);
}
public function exploc(e:Event):void{
var tex:int;
var tey:int;
var _u:int;
if ((((e.target == "[object blk1]")) && ((e.target.transform.colorTransform.redOffset < 80)))){
rOff = (e.target.transform.colorTransform.redOffset + 10);
gOff = (e.target.transform.colorTransform.greenOffset + 10);
e.target.transform.colorTransform = new ColorTransform(1, 1, 1, 1, rOff, gOff, 0, 0);
} else {
if ((((e.target == "[object blk2]")) && ((e.target.transform.colorTransform.blueOffset < 80)))){
gOff = (e.target.transform.colorTransform.greenOffset + 10);
bOff = (e.target.transform.colorTransform.blueOffset + 10);
e.target.transform.colorTransform = new ColorTransform(1, 1, 1, 1, 0, gOff, bOff, 0);
} else {
if ((((e.target == "[object blk3]")) && ((e.target.transform.colorTransform.redOffset < 80)))){
rOff = (e.target.transform.colorTransform.redOffset + 10);
e.target.transform.colorTransform = new ColorTransform(1, 1, 1, 1, rOff, 0, 0, 0);
} else {
if ((((e.target == "[object blk4]")) && ((e.target.transform.colorTransform.greenOffset < 80)))){
gOff = (e.target.transform.colorTransform.greenOffset + 10);
e.target.transform.colorTransform = new ColorTransform(1, 1, 1, 1, 0, gOff, 0, 0);
} else {
if ((((e.target == "[object blk5]")) && ((e.target.transform.colorTransform.redOffset < 80)))){
rOff = (e.target.transform.colorTransform.redOffset + 10);
bOff = (e.target.transform.colorTransform.blueOffset + 10);
e.target.transform.colorTransform = new ColorTransform(1, 1, 1, 1, rOff, 0, bOff, 0);
};
};
};
};
};
if ((((((e.target.transform.colorTransform.redOffset >= 80)) || ((e.target.transform.colorTransform.blueOffset >= 80)))) || ((e.target.transform.colorTransform.greenOffset >= 80)))){
tex = e.target.x;
tey = e.target.y;
_u = e.target.typ;
explo = new Exp((tex + 20), (tey + 20), _u, 1);
addChild(explo);
if (e.target.po == 0){
btitle.removeChild(MovieClip(e.target));
} else {
ftitle.removeChild(MovieClip(e.target));
};
e.target.removeEventListener(Event.ENTER_FRAME, exploc);
cubAr[e.target.pos] = null;
};
}
public function on_play2_clicked(event:MouseEvent):void{
if (ftTut){
warnMc = new ftWarning();
addChild(warnMc);
warnMc.x = 0;
warnMc.y = 0;
warnMc.stuto.addEventListener(MouseEvent.CLICK, on_stuto_clicked);
warnMc.sktuto.addEventListener(MouseEvent.CLICK, on_sktuto_clicked);
} else {
if (clHigh){
clHigh.removeEventListener(MouseEvent.CLICK, on_mhigh_clicked);
bnHigh.removeEventListener(MouseEvent.CLICK, on_mhigh_clicked);
};
remove();
main_class.play_the_game(2);
main_class.remove_splash();
};
}
public function over_achbt(event:MouseEvent):void{
TTween.backTint(achbt, 0.5, 2);
}
public function tintTween(tMc:MovieClip, type:int):void{
var tm:Number;
var color:int;
tm = ((Math.random() * 2) + 0.5);
color = Math.round((Math.random() * (5 - 1)));
if (color == 0){
color = 16494647;
} else {
if (color == 1){
color = 4167150;
} else {
if (color == 2){
color = 15284264;
} else {
if (color == 3){
color = 7781914;
} else {
if (color == 4){
color = 11155411;
};
};
};
};
};
if (type == 0){
TweenMax.to(tMc, tm, {tint:color, onComplete:onFinishTween, onCompleteParams:[tm, tMc, type]});
} else {
TweenMax.to(tMc, tm, {tint:color, glowFilter:{color:color, alpha:1, blurX:10, blurY:10, remove:true}, onComplete:onFinishTween, onCompleteParams:[tm, tMc, type]});
};
}
public function enterFrameHandler(event:Event):void{
var rdm:int;
rdm = Math.round((Math.random() * (100 - 1)));
if ((((rdm < 10)) && ((cubAr.length < 10)))){
createcub();
};
}
public function onFinishTween(Tim:Number, Mc:MovieClip, typ:int):void{
TweenMax.to(Mc, Tim, {removeTint:true});
tintTween(Mc, typ);
}
public function out_opt(e:MouseEvent):void{
var target2:MovieClip;
target2 = (e.target as MovieClip);
TTween.backTint(target2, 0.5, 0);
}
public function removeM():void{
if (sMask){
removeChild(sMask);
sMask = null;
};
}
public function over_play2(event:MouseEvent):void{
TTween.backTint(play_bt2, 0.5, 4);
}
public function on_sktuto_clicked(event:MouseEvent):void{
ftTut = false;
mySharedObject.data.firstTime = false;
mySharedObject.flush();
warnMc.stuto.removeEventListener(MouseEvent.CLICK, on_stuto_clicked);
warnMc.sktuto.removeEventListener(MouseEvent.CLICK, on_sktuto_clicked);
removeChild(warnMc);
warnMc = null;
}
public function out_creditMc(event:MouseEvent):void{
TTween.backTint(creditMc, 0.5, 0);
}
public function on_play_clicked(event:MouseEvent):void{
if (ftTut){
warnMc = new ftWarning();
addChild(warnMc);
warnMc.x = 0;
warnMc.y = 0;
warnMc.stuto.addEventListener(MouseEvent.CLICK, on_stuto_clicked);
warnMc.sktuto.addEventListener(MouseEvent.CLICK, on_sktuto_clicked);
} else {
if (clHigh){
clHigh.removeEventListener(MouseEvent.CLICK, on_mhigh_clicked);
bnHigh.removeEventListener(MouseEvent.CLICK, on_mhigh_clicked);
};
remove();
main_class.play_the_game(1);
main_class.remove_splash();
};
}
public function remove():void{
var u:int;
play_bt.removeEventListener(MouseEvent.CLICK, on_play_clicked);
play_bt2.removeEventListener(MouseEvent.CLICK, on_play2_clicked);
play_bt.removeEventListener(MouseEvent.MOUSE_OVER, over_play);
play_bt.removeEventListener(MouseEvent.MOUSE_OUT, out_play);
play_bt2.removeEventListener(MouseEvent.MOUSE_OVER, over_play2);
play_bt2.removeEventListener(MouseEvent.MOUSE_OUT, out_play2);
achbt.removeEventListener(MouseEvent.CLICK, on_ach_clicked);
achbt.removeEventListener(MouseEvent.MOUSE_OVER, over_achbt);
achbt.removeEventListener(MouseEvent.MOUSE_OUT, out_achbt);
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
highbt.removeEventListener(MouseEvent.MOUSE_OVER, over_highbt);
highbt.removeEventListener(MouseEvent.MOUSE_OUT, out_highbt);
highbt.removeEventListener(MouseEvent.CLICK, on_high_clicked);
creditMc.removeEventListener(MouseEvent.CLICK, on_creditMc_clicked);
creditMc.removeEventListener(MouseEvent.MOUSE_OVER, over_creditMc);
creditMc.removeEventListener(MouseEvent.MOUSE_OUT, out_creditMc);
u = 0;
while (u < 10) {
if (cubAr[u]){
if (cubAr[u].po == 0){
btitle.removeChild(cubAr[u]);
} else {
ftitle.removeChild(cubAr[u]);
};
cubAr[u].removeEventListener(Event.ENTER_FRAME, exploc);
cubAr[u] = null;
};
u++;
};
if (backgroundFill){
removeChild(backgroundFill);
backgroundFill = null;
backgroundBD.dispose();
};
if (clHigh){
clHigh.removeEventListener(MouseEvent.CLICK, on_mhigh_clicked);
bnHigh.removeEventListener(MouseEvent.CLICK, on_mhigh_clicked);
clHigh.removeEventListener(MouseEvent.MOUSE_OVER, over_opt);
clHigh.removeEventListener(MouseEvent.MOUSE_OUT, out_opt);
bnHigh.removeEventListener(MouseEvent.MOUSE_OVER, over_opt);
bnHigh.removeEventListener(MouseEvent.MOUSE_OUT, out_opt);
removeChild(clHigh);
removeChild(bnHigh);
clHigh = null;
bnHigh = null;
};
if (creditBox){
removeChild(creditBox);
creditBox = null;
};
if (miniLogo){
miniLogo.removeEventListener(MouseEvent.CLICK, SmileyGamerAPI.showHome);
removeChild(miniLogo);
miniLogo = null;
moreG.removeEventListener(MouseEvent.MOUSE_OVER, over_opt);
moreG.removeEventListener(MouseEvent.MOUSE_OUT, out_opt);
moreG.removeEventListener(MouseEvent.CLICK, SmileyGamerAPI.showHome);
removeChild(moreG);
moreG = null;
};
if (addG){
addG.removeEventListener(MouseEvent.MOUSE_OVER, over_opt);
addG.removeEventListener(MouseEvent.MOUSE_OUT, out_opt);
addG.removeEventListener(MouseEvent.CLICK, SmileyGamerAPI.showFreeContent);
removeChild(addG);
addG = null;
};
removeChild(creditMc);
creditMc = null;
removeChild(highbt);
highbt = null;
removeChild(play_bt);
play_bt = null;
removeChild(play_bt2);
play_bt2 = null;
removeChild(achbt);
achbt = null;
removeChild(Ttl);
Ttl = null;
removeChild(rline);
rline = null;
}
public function on_creditMc_clicked(event:MouseEvent):void{
if (((((++credVar % 2) == 0)) && (!(creditBox)))){
creditBox = new creditsMc();
addChild(creditBox);
creditBox.x = 500.7;
creditBox.y = 411.7;
} else {
if (creditBox){
removeChild(creditBox);
creditBox = null;
};
};
}
public function over_opt(e:MouseEvent):void{
var target:MovieClip;
target = (e.target as MovieClip);
TTween.backTint(target, 0.5, (Math.floor((Math.random() * ((1 + 5) - 1))) + 1));
}
public function over_achvbt(event:MouseEvent):void{
TTween.backTint(achivementbt, 0.5, 5);
}
public function on_high_clicked(event:MouseEvent):void{
if (!clHigh){
clHigh = new miniCl();
bnHigh = new miniBn();
addChild(clHigh);
addChild(bnHigh);
clHigh.x = 230.7;
clHigh.y = 467.4;
bnHigh.x = 310.7;
bnHigh.y = 467.4;
clHigh.mouseChildren = false;
bnHigh.mouseChildren = false;
clHigh.addEventListener(MouseEvent.CLICK, on_mhigh_clicked);
bnHigh.addEventListener(MouseEvent.CLICK, on_mhigh_clicked);
clHigh.addEventListener(MouseEvent.MOUSE_OVER, over_opt);
clHigh.addEventListener(MouseEvent.MOUSE_OUT, out_opt);
bnHigh.addEventListener(MouseEvent.MOUSE_OVER, over_opt);
bnHigh.addEventListener(MouseEvent.MOUSE_OUT, out_opt);
} else {
removeChild(clHigh);
removeChild(bnHigh);
clHigh.removeEventListener(MouseEvent.CLICK, on_mhigh_clicked);
bnHigh.removeEventListener(MouseEvent.CLICK, on_mhigh_clicked);
clHigh.removeEventListener(MouseEvent.MOUSE_OVER, over_opt);
clHigh.removeEventListener(MouseEvent.MOUSE_OUT, out_opt);
bnHigh.removeEventListener(MouseEvent.MOUSE_OVER, over_opt);
bnHigh.removeEventListener(MouseEvent.MOUSE_OUT, out_opt);
clHigh = null;
bnHigh = null;
};
}
public function on_ach_clicked(event:MouseEvent):void{
main_class.show_tuto();
}
public function out_achvbt(event:MouseEvent):void{
TTween.backTint(achivementbt, 0.5, 0);
}
public function on_mhigh_clicked(e:MouseEvent):void{
if ((((e.currentTarget == "[object miniCl]")) && (!((main_class.clasHigh == 1))))){
main_class.gameMod = 1;
main_class.show_highscore(0);
};
if ((((e.currentTarget == "[object miniBn]")) && (!((main_class.clasHigh == 2))))){
main_class.gameMod = 2;
main_class.show_highscore(0);
};
if (!sMask){
sMask = new smask();
addChild(sMask);
sMask.x = 212;
sMask.y = 405.4;
};
}
public function on_stuto_clicked(event:MouseEvent):void{
main_class.show_tuto();
ftTut = false;
mySharedObject.data.firstTime = false;
mySharedObject.flush();
warnMc.stuto.removeEventListener(MouseEvent.CLICK, on_stuto_clicked);
warnMc.sktuto.removeEventListener(MouseEvent.CLICK, on_sktuto_clicked);
removeChild(warnMc);
warnMc = null;
}
public function over_highbt(event:MouseEvent):void{
TTween.backTint(highbt, 0.5, 3);
}
public function out_achbt(event:MouseEvent):void{
TTween.backTint(achbt, 0.5, 0);
}
public function out_play2(event:MouseEvent):void{
TTween.backTint(play_bt2, 0.5, 0);
}
public function over_creditMc(event:MouseEvent):void{
TTween.backTint(creditMc, 0.5, (Math.floor((Math.random() * ((1 + 5) - 1))) + 1));
}
public function out_play(event:MouseEvent):void{
TTween.backTint(play_bt, 0.5, 0);
}
public function out_highbt(event:MouseEvent):void{
TTween.backTint(highbt, 0.5, 0);
}
public function createcub():void{
var varx:int;
var h:int;
var u:int;
var po:int;
varx = Math.round((Math.random() * (5 - 1)));
u = 9;
while (u >= 0) {
if (!cubAr[u]){
h = u;
};
u--;
};
if (varx == 0){
cubAr[h] = new blk1();
} else {
if (varx == 1){
cubAr[h] = new blk2();
} else {
if (varx == 2){
cubAr[h] = new blk3();
} else {
if (varx == 3){
cubAr[h] = new blk4();
} else {
if (varx == 4){
cubAr[h] = new blk5();
};
};
};
};
};
po = Math.round((Math.random() * (2 - 1)));
if (po == 0){
btitle.addChild(cubAr[h]);
} else {
ftitle.addChild(cubAr[h]);
};
cubAr[h].x = ((Math.random() * 280) + 160);
cubAr[h].y = ((Math.random() * 100) + 20);
cubAr[h].rotation = (Math.random() * 360);
cubAr[h].scaleX = 0.5;
cubAr[h].scaleY = 0.5;
cubAr[h].typ = varx;
cubAr[h].pos = h;
cubAr[h].po = po;
cubAr[h].addEventListener(Event.ENTER_FRAME, exploc);
}
public function on_achiv_clicked(event:MouseEvent):void{
main_class.show_achievements();
}
public function over_play(event:MouseEvent):void{
TTween.backTint(play_bt, 0.5, 1);
}
}
}//package
Section 163
//sTuto (sTuto)
package {
import flash.display.*;
public dynamic class sTuto extends MovieClip {
public function sTuto(){
super();
}
}
}//package
Section 164
//t_frame (t_frame)
package {
import flash.display.*;
public dynamic class t_frame extends MovieClip {
public function t_frame(){
super();
}
}
}//package
Section 165
//test (test)
package {
import flash.display.*;
public dynamic class test extends MovieClip {
public function test(){
super();
}
}
}//package
Section 166
//tg (tg)
package {
import flash.display.*;
public dynamic class tg extends MovieClip {
public var res_bt:resbt;
public var opt_bt:optbt;
public var mlogo:minilogo;
public function tg(){
super();
}
}
}//package
Section 167
//the_game (the_game)
package {
import flash.display.*;
import gs.*;
import flash.events.*;
import flash.geom.*;
import unam.*;
import mochi.as3.*;
import flash.media.*;
import flash.text.*;
import SWFStats.*;
public dynamic class the_game extends MovieClip {
public var bonusC:int;// = 0
public var shareTcube:int;
public var scoY:int;// = 0
public var scoX:int;// = 0
public var sfxSoundChannel:SoundChannel;
public var sffect:sEffect;
public var bkbk:MovieClip;
public var explo:Exp;
public var nrbCube:int;// = 0
public var checkt:int;// = 8
public var ach_325:Boolean;// = false
public var ach_1000:Boolean;// = false
public var exploSound:Xplo;
public var achievBox:MovieClip;
public var score:MochiDigits;
public var rezMc:MovieClip;
public var TScore:int;// = 0
public var btype:Array;
public var achPoint:Point;
public var ach_10003:Boolean;// = false
public var scoBlo:MovieClip;
public var Mod:int;
public var ach_b20:Boolean;// = false
public var msgMc:MovieClip;
public var chcpt:int;// = 0
public var ach_1500:Boolean;// = false
public var tweenCpt:int;// = 0
public var compt:int;// = 0
public var tArr:Array;
public var dArr:Array;
public var mouseOn:Boolean;// = true
public var tgMc:MovieClip;
public var ach_9000:Boolean;// = false
public var main_class:unam;
public var shakOn:Boolean;// = false
public var scoreCol:int;// = 0
public var gOff:Number;
public var effect:nEffect;
public var showScore:addScore;
public var bnusA:Array;
public var miniBArr:Array;
public var rOff:Number;
public var shareTcv:int;
public var uArr:Array;
public var cptt:int;// = 0
public var scoreCpt:int;// = 0
public var bOff:Number;
public var ach_500:Boolean;// = false
public var tshx:int;// = 0
public var higher:int;// = -1
public var tshy:int;// = 0
public var ach_750:Boolean;// = false
public var gOver:Boolean;// = false
public var sScore:MovieClip;
public var mainArr:Array;
public var shareScore:int;
public function the_game(passed_class:unam, mod:int):void{
var i:int;
var j:int;
var _bm:int;
var tt:int;
var varx:int;
var tvarx:int;
var tnm:int;
btype = new Array();
mainArr = new Array(10);
tArr = new Array(100);
dArr = new Array(100);
uArr = new Array(100);
compt = 0;
shakOn = false;
tshx = 0;
tshy = 0;
gOver = false;
scoreCpt = 0;
scoreCol = 0;
scoX = 0;
scoY = 0;
cptt = 0;
TScore = 0;
sScore = new disscore();
scoBlo = new MovieClip();
miniBArr = new Array(10);
chcpt = 0;
higher = -1;
mouseOn = true;
tweenCpt = 0;
nrbCube = 0;
checkt = 8;
bonusC = 0;
ach_500 = false;
ach_1000 = false;
ach_750 = false;
ach_1500 = false;
ach_10003 = false;
ach_9000 = false;
ach_325 = false;
ach_b20 = false;
super();
main_class = passed_class;
Log.Play();
if (main_class.quesBox){
main_class.removeBox();
};
if (main_class.mySharedObject.data.ACHIEVEMENT_FIVE_HUNDRED == true){
ach_500 = true;
};
if (main_class.mySharedObject.data.ACHIEVEMENT_ONE_THOUSAND == true){
ach_1000 = true;
};
if (main_class.mySharedObject.data.ACHIEVEMENT_SEVEN_HUNDRED_AND_FIFTY == true){
ach_750 = true;
};
if (main_class.mySharedObject.data.ACHIEVEMENT_OVER_9000_ == true){
ach_9000 = true;
};
if (main_class.mySharedObject.data.ACHIEVEMENT_1000_CUBES == true){
ach_10003 = true;
};
if (main_class.mySharedObject.data.ACHIEVEMENT_ONE_THOUSAND_FIVE_HUNDRED == true){
ach_1500 = true;
};
if (main_class.mySharedObject.data.ACHIEVEMENT_CLICK__PROFIT == true){
ach_325 = true;
};
if (main_class.mySharedObject.data.ACHIEVEMENT_BONUS_X20 == true){
ach_b20 = true;
};
Mod = mod;
tgMc = new tg();
addChild(tgMc);
exploSound = new Xplo();
score = new MochiDigits();
score.setValue(0);
tgMc.mlogo.mouseChildren = false;
tgMc.mlogo.addEventListener(MouseEvent.CLICK, SmileyGamerAPI.showHome);
if (Mod != 1){
bnusA = new Array(3);
bkbk = new blback();
addChild(bkbk);
bkbk.x = 530;
bkbk.y = 314;
tgMc.opt_bt.y = 290;
tgMc.mlogo.y = (tgMc.mlogo.y - 176);
};
shareTcube = main_class.mySharedObject.data.totalCubes;
tgMc.opt_bt.mouseChildren = false;
tgMc.res_bt.mouseChildren = false;
tgMc.opt_bt.addEventListener(MouseEvent.MOUSE_OVER, opt_over);
tgMc.opt_bt.addEventListener(MouseEvent.MOUSE_OUT, opt_out);
tgMc.res_bt.addEventListener(MouseEvent.MOUSE_OVER, res_over);
tgMc.res_bt.addEventListener(MouseEvent.MOUSE_OUT, res_out);
addChild(scoBlo);
scoBlo.x = 544;
scoBlo.y = 45.8;
addChild(sScore);
sScore.x = 512.4;
sScore.y = 43.8;
_bm = 0;
while (_bm < 100) {
tArr[_bm] = null;
_bm++;
};
tt = 0;
i = 0;
while (i < 10) {
mainArr[i] = new Array(10);
j = 0;
while (j < 10) {
mainArr[i][j] = new Array(10);
varx = (Math.floor((Math.random() * ((1 + 4) - 0))) + 0);
tvarx = (varx * 51);
if (varx == 0){
mainArr[i][j] = new blk1();
} else {
if (varx == 1){
mainArr[i][j] = new blk2();
} else {
if (varx == 2){
mainArr[i][j] = new blk3();
} else {
if (varx == 3){
mainArr[i][j] = new blk4();
} else {
if (varx == 4){
mainArr[i][j] = new blk5();
};
};
};
};
};
addChild(mainArr[i][j]);
mainArr[i][j].y = (461 - (i * 51));
mainArr[i][j].x = (j * 51);
mainArr[i][j].cy = (461 - (i * 51));
mainArr[i][j].cx = (j * 51);
mainArr[i][j].py = i;
mainArr[i][j].px = j;
tnm = ((i * 10) + j);
mainArr[i][j].name = tnm;
btype[tnm] = varx;
tt = (tt + 1);
j++;
};
i++;
};
main_class.Main.stage.addEventListener(MouseEvent.CLICK, stageClick);
this.addEventListener(Event.ENTER_FRAME, chgo);
}
public function chgo(e:Event){
cptt = (cptt + 1);
if (cptt == 50){
gOverCheck();
cptt = 0;
};
}
public function lUp(e:Event):void{
var tex:int;
var tey:int;
var _px:int;
var _py:int;
var _u:int;
var ll:int;
if ((((e.target == "[object blk1]")) && ((e.target.transform.colorTransform.redOffset < 80)))){
rOff = (e.target.transform.colorTransform.redOffset + 10);
gOff = (e.target.transform.colorTransform.greenOffset + 10);
e.target.transform.colorTransform = new ColorTransform(1, 1, 1, 1, rOff, gOff, 0, 0);
} else {
if ((((e.target == "[object blk2]")) && ((e.target.transform.colorTransform.blueOffset < 80)))){
gOff = (e.target.transform.colorTransform.greenOffset + 10);
bOff = (e.target.transform.colorTransform.blueOffset + 10);
e.target.transform.colorTransform = new ColorTransform(1, 1, 1, 1, 0, gOff, bOff, 0);
} else {
if ((((e.target == "[object blk3]")) && ((e.target.transform.colorTransform.redOffset < 80)))){
rOff = (e.target.transform.colorTransform.redOffset + 10);
e.target.transform.colorTransform = new ColorTransform(1, 1, 1, 1, rOff, 0, 0, 0);
} else {
if ((((e.target == "[object blk4]")) && ((e.target.transform.colorTransform.greenOffset < 80)))){
gOff = (e.target.transform.colorTransform.greenOffset + 10);
e.target.transform.colorTransform = new ColorTransform(1, 1, 1, 1, 0, gOff, 0, 0);
} else {
if ((((e.target == "[object blk5]")) && ((e.target.transform.colorTransform.redOffset < 80)))){
rOff = (e.target.transform.colorTransform.redOffset + 10);
bOff = (e.target.transform.colorTransform.blueOffset + 10);
e.target.transform.colorTransform = new ColorTransform(1, 1, 1, 1, rOff, 0, bOff, 0);
};
};
};
};
};
if ((((((e.target.transform.colorTransform.redOffset >= 80)) || ((e.target.transform.colorTransform.blueOffset >= 80)))) || ((e.target.transform.colorTransform.greenOffset >= 80)))){
tex = e.target.cx;
tey = e.target.cy;
_px = e.target.px;
_py = e.target.py;
_u = ((_py * 10) + _px);
if ((((Mod == 2)) && ((e.target.name >= 1000)))){
_u = (e.target.name - 1000);
explo = new Exp((tex + 25), (tey + 25), bnusA[_u].Ty, 1);
scoreCol = bnusA[_u].Ty;
} else {
explo = new Exp((tex + 25), (tey + 25), btype[_u], 1);
scoreCol = btype[_u];
};
if (e.target.name < 1000){
scoX = (scoX + tex);
scoY = (scoY + tey);
};
addChild(explo);
if (((!((Mod == 2))) || ((((Mod == 2)) && ((e.target.name < 1000)))))){
mainArr[_py][_px].removeEventListener(Event.ENTER_FRAME, lUp);
removeChild(mainArr[_py][_px]);
mainArr[_py][_px] = null;
btype[_u] = null;
} else {
if ((((Mod == 2)) && ((e.target.name >= 1000)))){
bnusA[_u].removeEventListener(Event.ENTER_FRAME, lUp);
bnusA[_u].On = false;
removeChild(bnusA[_u]);
bnusA[_u] = null;
if (_u != 2){
ll = (_u + 1);
while (ll < 3) {
if (bnusA[ll]){
bnusA[(ll - 1)] = bnusA[ll];
bnusA[(ll - 1)].x = 531;
bnusA[(ll - 1)].y = (315 + ((ll - 1) * 60));
bnusA[(ll - 1)].cx = 531;
bnusA[(ll - 1)].cy = (315 + ((ll - 1) * 60));
bnusA[(ll - 1)].name = ((ll - 1) + 1000);
bnusA[(ll - 1)].On = false;
tArr[((ll - 1) + 1000)] = ((ll - 1) + 1000);
bnusA[ll] = null;
};
ll++;
};
};
};
};
dArr[_u] = null;
uArr[_u] = null;
tArr[_u] = null;
chcpt = (chcpt + 1);
if (_u == higher){
mvD();
mvR();
chLft();
gOverCheck();
higher = -1;
};
};
}
public function onFinishTween():void{
tweenCpt = (tweenCpt - 1);
if (tweenCpt == 0){
mouseOn = true;
};
}
public function checkScore():void{
if (TScore == score.value){
if (Mod == 1){
if ((((((TScore >= 500)) && ((TScore < 1000)))) && ((ach_500 == false)))){
achPosition();
achievBox = new achBox(1);
addChild(achievBox);
achievBox.x = achPoint.x;
achievBox.y = achPoint.y;
achievBox.acht_Tfront.text = "Five Hundred";
achievBox.acht_Tback.text = "Five Hundred";
achievBox.addEventListener("achOver", removeAch);
achievBox.acht_dfront.text = AchievementsConstants.ACHIEVEMENT_FIVE_HUNDRED_DESC;
achievBox.acht_dback.text = AchievementsConstants.ACHIEVEMENT_FIVE_HUNDRED_DESC;
main_class.mySharedObject.data.ACHIEVEMENT_FIVE_HUNDRED = true;
main_class.mySharedObject.flush();
ach_500 = true;
shareScore = TScore;
};
if ((((((TScore >= 1000)) && ((TScore < 3500)))) && ((ach_1000 == false)))){
achPosition();
achievBox = new achBox(4);
addChild(achievBox);
achievBox.x = achPoint.x;
achievBox.y = achPoint.y;
achievBox.acht_Tfront.text = AchievementsConstants.ACHIEVEMENT_ONE_THOUSAND;
achievBox.acht_Tback.text = AchievementsConstants.ACHIEVEMENT_ONE_THOUSAND;
achievBox.addEventListener("achOver", removeAch);
achievBox.acht_dfront.text = AchievementsConstants.ACHIEVEMENT_ONE_THOUSAND_DESC;
achievBox.acht_dback.text = AchievementsConstants.ACHIEVEMENT_ONE_THOUSAND_DESC;
main_class.mySharedObject.data.ACHIEVEMENT_ONE_THOUSAND = true;
main_class.mySharedObject.flush();
ach_1000 = true;
};
};
if (Mod == 2){
if ((((((TScore >= 750)) && ((TScore < 1500)))) && ((ach_750 == false)))){
achPosition();
achievBox = new achBox(3);
addChild(achievBox);
achievBox.x = achPoint.x;
achievBox.y = achPoint.y;
achievBox.acht_Tfront.text = AchievementsConstants.ACHIEVEMENT_SEVEN_HUNDRED_AND_FIFTY;
achievBox.acht_Tback.text = AchievementsConstants.ACHIEVEMENT_SEVEN_HUNDRED_AND_FIFTY;
achievBox.addEventListener("achOver", removeAch);
achievBox.acht_dfront.text = AchievementsConstants.ACHIEVEMENT_SEVEN_HUNDRED_AND_FIFTY_DESC;
achievBox.acht_dback.text = AchievementsConstants.ACHIEVEMENT_SEVEN_HUNDRED_AND_FIFTY_DESC;
main_class.mySharedObject.data.ACHIEVEMENT_SEVEN_HUNDRED_AND_FIFTY = true;
main_class.mySharedObject.flush();
ach_750 = true;
};
if ((((((TScore >= 1500)) && ((TScore < 3500)))) && ((ach_1500 == false)))){
achPosition();
achievBox = new achBox(5);
addChild(achievBox);
achievBox.x = achPoint.x;
achievBox.y = achPoint.y;
achievBox.acht_Tfront.text = AchievementsConstants.ACHIEVEMENT_ONE_THOUSAND_FIVE_HUNDRED;
achievBox.acht_Tback.text = AchievementsConstants.ACHIEVEMENT_ONE_THOUSAND_FIVE_HUNDRED;
achievBox.addEventListener("achOver", removeAch);
achievBox.acht_dfront.text = AchievementsConstants.ACHIEVEMENT_ONE_THOUSAND_FIVE_HUNDRED_DESC;
achievBox.acht_dback.text = AchievementsConstants.ACHIEVEMENT_ONE_THOUSAND_FIVE_HUNDRED_DESC;
main_class.mySharedObject.data.ACHIEVEMENT_ONE_THOUSAND_FIVE_HUNDRED = true;
main_class.mySharedObject.flush();
ach_1500 = true;
};
if ((((bonusC >= 20)) && ((ach_b20 == false)))){
achPosition();
achievBox = new achBox(8);
addChild(achievBox);
achievBox.x = achPoint.x;
achievBox.y = achPoint.y;
achievBox.acht_Tfront.text = AchievementsConstants.ACHIEVEMENT_BONUS_X20;
achievBox.acht_Tback.text = AchievementsConstants.ACHIEVEMENT_BONUS_X20;
achievBox.addEventListener("achOver", removeAch);
achievBox.acht_dfront.text = AchievementsConstants.ACHIEVEMENT_BONUS_X20_DESC;
achievBox.acht_dback.text = AchievementsConstants.ACHIEVEMENT_BONUS_X20_DESC;
main_class.mySharedObject.data.ACHIEVEMENT_BONUS_X20 = true;
main_class.mySharedObject.flush();
ach_b20 = true;
};
};
if ((((TScore >= 9000)) && ((ach_9000 == false)))){
achPosition();
achievBox = new achBox(6);
addChild(achievBox);
achievBox.x = achPoint.x;
achievBox.y = achPoint.y;
achievBox.acht_Tfront.text = AchievementsConstants.ACHIEVEMENT_OVER_9000_;
achievBox.acht_Tback.text = AchievementsConstants.ACHIEVEMENT_OVER_9000_;
achievBox.addEventListener("achOver", removeAch);
achievBox.acht_dfront.text = AchievementsConstants.ACHIEVEMENT_OVER_9000__DESC;
achievBox.acht_dback.text = AchievementsConstants.ACHIEVEMENT_OVER_9000__DESC;
main_class.mySharedObject.data.ACHIEVEMENT_OVER_9000_ = true;
main_class.mySharedObject.flush();
ach_9000 = true;
};
if ((((scoreCpt >= 325)) && ((ach_325 == false)))){
achPosition();
achievBox = new achBox(2);
addChild(achievBox);
achievBox.x = achPoint.x;
achievBox.y = achPoint.y;
achievBox.acht_Tfront.text = AchievementsConstants.ACHIEVEMENT_CLICK__PROFIT;
achievBox.acht_Tback.text = AchievementsConstants.ACHIEVEMENT_CLICK__PROFIT;
achievBox.addEventListener("achOver", removeAch);
achievBox.acht_dfront.text = AchievementsConstants.ACHIEVEMENT_CLICK__PROFIT_DESC;
achievBox.acht_dback.text = AchievementsConstants.ACHIEVEMENT_CLICK__PROFIT_DESC;
main_class.mySharedObject.data.ACHIEVEMENT_CLICK__PROFIT = true;
main_class.mySharedObject.flush();
ach_325 = true;
};
shareTcube = (shareTcube + nrbCube);
if ((((shareTcube >= 1000)) && ((ach_10003 == false)))){
achPosition();
achievBox = new achBox(7);
addChild(achievBox);
achievBox.x = achPoint.x;
achievBox.y = achPoint.y;
achievBox.acht_Tfront.text = AchievementsConstants.ACHIEVEMENT_1000_CUBES;
achievBox.acht_Tback.text = AchievementsConstants.ACHIEVEMENT_1000_CUBES;
achievBox.addEventListener("achOver", removeAch);
achievBox.acht_dfront.text = AchievementsConstants.ACHIEVEMENT_1000_CUBES_DESC;
achievBox.acht_dback.text = AchievementsConstants.ACHIEVEMENT_1000_CUBES_DESC;
main_class.mySharedObject.data.ACHIEVEMENT_1000_CUBES = true;
main_class.mySharedObject.flush();
ach_10003 = true;
};
};
}
public function rezt(rtype:int){
var ii:int;
var jj:int;
ii = 0;
while (ii < 10) {
jj = 0;
while (jj < 10) {
if (mainArr[ii][jj] != null){
removeChild(mainArr[ii][jj]);
mainArr[ii][jj] = null;
};
jj++;
};
ii++;
};
main_class.stage.removeEventListener(MouseEvent.CLICK, stageClick);
this.removeEventListener(Event.ENTER_FRAME, chgo);
tgMc.opt_bt.removeEventListener(MouseEvent.MOUSE_OVER, opt_over);
tgMc.opt_bt.removeEventListener(MouseEvent.MOUSE_OUT, opt_out);
tgMc.res_bt.removeEventListener(MouseEvent.MOUSE_OVER, res_over);
tgMc.res_bt.removeEventListener(MouseEvent.MOUSE_OUT, res_out);
main_class.remove_play();
if (rtype == 0){
main_class.play_the_game(Mod);
} else {
main_class.show_splash();
};
}
public function shk(e:Event):void{
if (e.target != null){
e.target.x = (e.target.cx + ((1 + (Math.random() * (2 * 3))) - 3));
e.target.y = (e.target.cy + ((1 + (Math.random() * (2 * 3))) - 3));
};
}
public function opt_over(e:MouseEvent):void{
TTween.backTint(tgMc.opt_bt, 0.5, (Math.floor((Math.random() * ((1 + 5) - 1))) + 1));
}
public function checkNb(target:int, d:int, u:int, type:int){
var Target:int;
var D:int;
var U:int;
var tmTarget:int;
var dd:int;
Target = target;
D = d;
U = u;
if (mainArr[D][U] != null){
if (((((U + 1) <= 9)) && (!((type == 2))))){
if (mainArr[D][(U + 1)] != null){
tmTarget = ((D * 10) + (U + 1));
if ((((btype[target] == btype[tmTarget])) && (!((tArr[tmTarget] == tmTarget))))){
compt = (compt + 1);
tArr[tmTarget] = tmTarget;
tArr[Target] = Target;
dArr[tmTarget] = D;
uArr[tmTarget] = (U + 1);
dArr[Target] = D;
uArr[Target] = U;
checkNb(tmTarget, D, (U + 1), 1);
};
};
};
if (((((U - 1) >= 0)) && (!((type == 1))))){
if (mainArr[D][(U - 1)] != null){
tmTarget = ((D * 10) + (U - 1));
if ((((btype[target] == btype[tmTarget])) && (!((tArr[tmTarget] == tmTarget))))){
compt = (compt + 1);
tArr[tmTarget] = tmTarget;
tArr[Target] = Target;
dArr[tmTarget] = D;
uArr[tmTarget] = (U - 1);
dArr[Target] = D;
uArr[Target] = U;
checkNb(tmTarget, D, (U - 1), 2);
};
};
};
if (((((D + 1) <= 9)) && (!((type == 4))))){
if (mainArr[(D + 1)][U] != null){
tmTarget = (((D + 1) * 10) + U);
if ((((btype[target] == btype[tmTarget])) && (!((tArr[tmTarget] == tmTarget))))){
compt = (compt + 1);
tArr[tmTarget] = tmTarget;
tArr[Target] = Target;
dArr[tmTarget] = (D + 1);
uArr[tmTarget] = U;
dArr[Target] = D;
uArr[Target] = U;
checkNb(tmTarget, (D + 1), U, 3);
};
};
};
if (((((D - 1) >= 0)) && (!((type == 3))))){
if (mainArr[(D - 1)][U] != null){
tmTarget = (((D - 1) * 10) + U);
if ((((btype[target] == btype[tmTarget])) && (!((tArr[tmTarget] == tmTarget))))){
compt = (compt + 1);
tArr[tmTarget] = tmTarget;
tArr[Target] = Target;
dArr[tmTarget] = (D - 1);
uArr[tmTarget] = U;
dArr[Target] = D;
uArr[Target] = U;
checkNb(tmTarget, (D - 1), U, 4);
};
};
};
if ((((compt >= 1)) && ((mouseOn == true)))){
shak(D, U);
};
if ((((((Mod == 2)) && ((compt == 0)))) && ((mouseOn == true)))){
dd = 0;
while (dd < 3) {
if (bnusA[dd] != null){
if (btype[target] == bnusA[dd].Ty){
tArr[Target] = Target;
dArr[Target] = D;
uArr[Target] = U;
shak(D, U);
};
};
dd++;
};
};
};
}
public function res_over(e:MouseEvent):void{
TTween.backTint(tgMc.res_bt, 0.5, (Math.floor((Math.random() * ((1 + 5) - 1))) + 1));
}
public function res_out(e:MouseEvent):void{
TTween.backTint(tgMc.res_bt, 0.5, 0);
}
public function remove_sEffect():void{
if (sffect){
removeChild(sffect);
sffect = null;
};
}
public function stageClick(e:MouseEvent):void{
var s:int;
var u:int;
var tName:int;
var uni:int;
var dix:int;
var bn:int;
var h:int;
var _m:int;
var _n:int;
var tcx:int;
var tcy:int;
var bb:int;
shakOn = false;
if (tweenCpt == 0){
mouseOn = true;
};
if (mouseOn == true){
s = 0;
while (s < 100) {
if (tArr[s]){
if (mainArr[dArr[s]][uArr[s]]){
if (Mod == 2){
u = mainArr[dArr[s]][uArr[s]].name;
checkt = btype[u];
};
mainArr[dArr[s]][uArr[s]].removeEventListener(Event.ENTER_FRAME, shk);
mainArr[dArr[s]][uArr[s]].x = mainArr[dArr[s]][uArr[s]].cx;
mainArr[dArr[s]][uArr[s]].y = mainArr[dArr[s]][uArr[s]].cy;
};
};
s++;
};
if ((e.target is MovieClip)){
if ((((((((((e.target == "[object blk1]")) || ((e.target == "[object blk2]")))) || ((e.target == "[object blk3]")))) || ((e.target == "[object blk4]")))) || ((e.target == "[object blk5]")))){
tName = e.target.name;
if (Mod == 2){
bn = (e.target.name - 1000);
if (e.target.name.length != 4){
h = 0;
while (h < 3) {
if (bnusA[h]){
bnusA[h].On = false;
};
h++;
};
checkt = btype[tName];
};
};
if (e.target.name.length == 1){
uni = e.target.name;
dix = 0;
} else {
if (e.target.name.length == 2){
uni = e.target.name.substr(1, (e.target.name.length - 1));
dix = ((e.target.name - uni) / 10);
} else {
if (e.target.name.length == 3){
uni = 0;
dix = 10;
} else {
if ((((Mod == 2)) && ((e.target.name.length == 4)))){
if (bnusA[bn].Ty == checkt){
bnusA[bn].On = true;
scoreCpt = 1;
};
};
};
};
};
if ((((((((tArr[tName] == tName)) && ((Mod == 1)))) || ((((((Mod == 2)) && ((tName < 1000)))) && ((tArr[tName] == tName)))))) || ((((((((Mod == 2)) && ((tArr[tName] == tName)))) && ((tName >= 1000)))) && ((bnusA[bn].On == true)))))){
checkt = 8;
mouseOn = false;
shakOn = true;
if (main_class.soundonoff){
sfxSoundChannel = exploSound.play();
};
if (showScore){
removeChild(showScore);
showScore = null;
};
_m = 0;
while (_m < 100) {
if (tArr[_m] == _m){
scoreCpt = (scoreCpt + 1);
};
_m++;
};
if (scoreCpt > 1){
_n = 0;
while (_n < 100) {
if (tArr[_n] == _n){
if (mainArr[dArr[_n]][uArr[_n]]){
if (_n > higher){
higher = _n;
};
tcx = mainArr[dArr[_n]][uArr[_n]].cx;
tcy = mainArr[dArr[_n]][uArr[_n]].cy;
scoreCol = btype[_n];
scoX = (scoX + tcx);
scoY = (scoY + tcy);
mainArr[dArr[_n]][uArr[_n]].removeEventListener(Event.ENTER_FRAME, shk);
mainArr[dArr[_n]][uArr[_n]].addEventListener(Event.ENTER_FRAME, lUp);
};
};
_n++;
};
};
if (Mod == 2){
if (bnusA[(tName - 1000)]){
};
if ((((((tName >= 1000)) && ((bnusA[(tName - 1000)].On == true)))) && ((scoreCpt > 1)))){
bnusA[(tName - 1000)].addEventListener(Event.ENTER_FRAME, lUp);
};
};
};
if (scoreCpt > 1){
if ((((((Mod == 2)) && ((scoreCpt >= 5)))) && ((tArr[tName] == tName)))){
bb = 0;
while (bb < 3) {
if (!bnusA[bb]){
if (btype[tName] == 0){
bnusA[bb] = new blk1();
bnusA[bb].Ty = 0;
} else {
if (btype[tName] == 1){
bnusA[bb] = new blk2();
bnusA[bb].Ty = 1;
} else {
if (btype[tName] == 2){
bnusA[bb] = new blk3();
bnusA[bb].Ty = 2;
} else {
if (btype[tName] == 3){
bnusA[bb] = new blk4();
bnusA[bb].Ty = 3;
} else {
if (btype[tName] == 4){
bnusA[bb] = new blk5();
bnusA[bb].Ty = 4;
};
};
};
};
};
if (bnusA[bb]){
addChild(bnusA[bb]);
sffect = new sEffect(this, 531, (365 + (bb * 60)), btype[tName]);
addChild(sffect);
sffect.mouseEnabled = false;
sffect.mouseChildren = false;
effect = new nEffect(531, (315 + (bb * 60)), btype[tName], bnusA[bb]);
addChild(effect);
effect.mouseEnabled = false;
effect.mouseChildren = false;
bnusA[bb].x = 531;
bnusA[bb].y = (315 + (bb * 60));
bnusA[bb].cx = 531;
bnusA[bb].cy = (315 + (bb * 60));
bnusA[bb].name = (bb + 1000);
bnusA[bb].On = false;
bnusA[bb].alpha = 0;
tArr[(bb + 1000)] = (bb + 1000);
bb = 4;
bonusC = (bonusC + 1);
};
};
bb++;
};
};
if ((((Mod == 2)) && ((e.target.name >= 1000)))){
scoX = ((scoX / (scoreCpt - 1)) + 20);
scoY = ((scoY / (scoreCpt - 1)) + 20);
} else {
scoX = ((scoX / scoreCpt) + 20);
scoY = ((scoY / scoreCpt) + 20);
};
nrbCube = scoreCpt;
scoreCpt = ((scoreCpt * (scoreCpt + 1)) / 2);
showScore = new addScore(scoX, scoY, scoreCol, scoreCpt);
addChild(showScore);
score.addValue(scoreCpt);
TScore = (TScore + scoreCpt);
checkScore();
if ((((TScore < 10)) && (!(miniBArr[0])))){
miniBArr[0] = new blk1();
miniBArr[0].scaleX = 0.55;
miniBArr[0].scaleY = 0.55;
miniBArr[0].x = -1;
scoBlo.addChild(miniBArr[0]);
};
if ((((((TScore >= 10)) && ((TScore < 100)))) && (!(miniBArr[1])))){
if (miniBArr[0] == null){
miniBArr[0] = new blk1();
miniBArr[0].scaleX = 0.55;
miniBArr[0].scaleY = 0.55;
miniBArr[0].x = -1;
scoBlo.addChild(miniBArr[0]);
};
miniBArr[1] = new blk2();
miniBArr[1].scaleX = 0.55;
miniBArr[1].scaleY = 0.55;
miniBArr[1].x = -1;
miniBArr[1].y = 26;
scoBlo.addChild(miniBArr[1]);
};
if ((((((TScore >= 100)) && ((TScore < 1000)))) && (!(miniBArr[2])))){
if (miniBArr[0] == null){
miniBArr[0] = new blk1();
miniBArr[0].scaleX = 0.55;
miniBArr[0].scaleY = 0.55;
miniBArr[0].x = -1;
scoBlo.addChild(miniBArr[0]);
};
if (miniBArr[1] == null){
miniBArr[1] = new blk2();
miniBArr[1].scaleX = 0.55;
miniBArr[1].scaleY = 0.55;
miniBArr[1].x = -1;
miniBArr[1].y = 26;
scoBlo.addChild(miniBArr[1]);
};
miniBArr[2] = new blk3();
miniBArr[2].scaleX = 0.55;
miniBArr[2].scaleY = 0.55;
miniBArr[2].x = -1;
miniBArr[2].y = 52;
scoBlo.addChild(miniBArr[2]);
};
if ((((((TScore >= 1000)) && ((TScore < 10000)))) && (!(miniBArr[3])))){
if (miniBArr[0] == null){
miniBArr[0] = new blk1();
miniBArr[0].scaleX = 0.55;
miniBArr[0].scaleY = 0.55;
miniBArr[0].x = -1;
scoBlo.addChild(miniBArr[0]);
};
if (miniBArr[1] == null){
miniBArr[1] = new blk2();
miniBArr[1].scaleX = 0.55;
miniBArr[1].scaleY = 0.55;
miniBArr[1].x = -1;
miniBArr[1].y = 26;
scoBlo.addChild(miniBArr[1]);
};
if (miniBArr[2] == null){
miniBArr[2] = new blk3();
miniBArr[2].scaleX = 0.55;
miniBArr[2].scaleY = 0.55;
miniBArr[2].x = -1;
miniBArr[2].y = 52;
scoBlo.addChild(miniBArr[2]);
};
miniBArr[3] = new blk4();
miniBArr[3].scaleX = 0.55;
miniBArr[3].scaleY = 0.55;
miniBArr[3].x = -1;
miniBArr[3].y = 78;
scoBlo.addChild(miniBArr[3]);
};
if ((((((TScore >= 10000)) && ((TScore < 100000)))) && (!(miniBArr[4])))){
miniBArr[4] = new blk5();
miniBArr[4].scaleX = 0.55;
miniBArr[4].scaleY = 0.55;
miniBArr[4].x = -1;
miniBArr[4].y = 104;
scoBlo.addChild(miniBArr[4]);
};
sScore.discoTo.text = String(TScore);
sScore.disco.text = String(TScore);
};
scoreCpt = 0;
nrbCube = 0;
scoreCol = 0;
scoX = 0;
scoY = 0;
clearTarr();
compt = 0;
if ((((shakOn == false)) && ((tName < 100)))){
checkNb(tName, dix, uni, 0);
};
} else {
if (e.target == "[object resbt]"){
main_class.restart_menu(0);
} else {
if (e.target == "[object optbt]"){
main_class.option_menu();
} else {
if (e.target == "[object off_bt]"){
if (main_class.musiconoff == true){
main_class.musiconoff = false;
main_class.optionP1.x = (main_class.optionP1.x + 89);
main_class.monff();
};
} else {
if (e.target == "[object on_bt]"){
if (main_class.musiconoff == false){
main_class.musiconoff = true;
main_class.optionP1.x = (main_class.optionP1.x - 89);
main_class.monff();
};
} else {
if (e.target == "[object soff_bt]"){
if (main_class.soundonoff == true){
main_class.soundonoff = false;
main_class.optionP2.x = (main_class.optionP2.x + 89);
};
} else {
if (e.target == "[object son_bt]"){
if (main_class.soundonoff == false){
main_class.soundonoff = true;
main_class.optionP2.x = (main_class.optionP2.x - 89);
};
} else {
if ((((((e.target == "[object menubt]")) || ((e.target == "[object fmenu]")))) || ((e.target == "[object bkmenu]")))){
if (rezMc){
removeChild(rezMc);
rezMc = null;
};
if (msgMc){
removeChild(msgMc);
msgMc = null;
};
main_class.remove_option_menu();
rezt(1);
} else {
if (e.target == "[object x_close]"){
main_class.remove_option_menu();
} else {
if (e.target == "[object no_bt]"){
if (rezMc){
removeChild(rezMc);
rezMc = null;
};
if (msgMc){
removeChild(msgMc);
msgMc = null;
};
main_class.remove_restart_menu();
if (gOver == true){
main_class.remove_game_over();
rezt(1);
};
} else {
if (e.target == "[object yes_bt]"){
if (rezMc){
removeChild(rezMc);
rezMc = null;
};
if (msgMc){
removeChild(msgMc);
msgMc = null;
};
main_class.remove_restart_menu();
rezt(0);
} else {
clearTarr();
};
};
};
};
};
};
};
};
};
};
};
} else {
clearTarr();
};
};
}
public function shak(dd:int, uu:int):void{
if (((!((mainArr[dd][uu] == null))) && ((mouseOn == true)))){
mainArr[dd][uu].cx = mainArr[dd][uu].x;
mainArr[dd][uu].cy = mainArr[dd][uu].y;
mainArr[dd][uu].addEventListener(Event.ENTER_FRAME, shk, false, 0, true);
};
}
public function greyO(e:Event):void{
var rOffset:Number;
var gOffset:Number;
var bOffset:Number;
if (e.target.transform.colorTransform.redOffset > -50){
rOffset = (e.target.transform.colorTransform.redOffset - 10);
gOffset = (e.target.transform.colorTransform.greenOffset - 10);
bOffset = (e.target.transform.colorTransform.redOffset - 10);
e.target.transform.colorTransform = new ColorTransform(1, 1, 1, 1, rOffset, gOffset, bOffset, 0);
};
}
private function removeAch(e:Event):void{
achievBox.remove();
achievBox.removeEventListener("achOver", removeAch);
removeChild(achievBox);
achievBox = null;
}
public function clearTarr():void{
var _dm:int;
_dm = 0;
while (_dm < 100) {
if (tArr[_dm] != null){
if (mainArr[dArr[_dm]][uArr[_dm]]){
mainArr[dArr[_dm]][uArr[_dm]].removeEventListener(Event.ENTER_FRAME, shk);
mainArr[dArr[_dm]][uArr[_dm]].x = mainArr[dArr[_dm]][uArr[_dm]].cx;
mainArr[dArr[_dm]][uArr[_dm]].y = mainArr[dArr[_dm]][uArr[_dm]].cy;
tArr[_dm] = null;
dArr[_dm] = null;
uArr[_dm] = null;
};
};
_dm++;
};
}
public function chLft():void{
var clf:int;
clf = 9;
while (clf >= 0) {
if (mainArr[0][clf] == null){
createNl();
mvR();
};
clf--;
};
}
public function mvD():void{
var _i:int;
var _j:int;
var xx:int;
var tmi:int;
var tmj:int;
mouseOn = false;
_i = 0;
while (_i < 10) {
_j = 0;
while (_j < 10) {
if (!mainArr[_i][_j]){
xx = (_i + 1);
while (xx < 10) {
if (((!((mainArr[xx][_j] == null))) && ((mainArr[_i][_j] == null)))){
mainArr[xx][_j].removeEventListener(Event.ENTER_FRAME, shk);
mainArr[_i][_j] = mainArr[xx][_j];
mainArr[_i][_j].removeEventListener(Event.ENTER_FRAME, shk);
mainArr[_i][_j].name = ((_i * 10) + _j);
mainArr[_i][_j].cx = (_j * 51);
mainArr[_i][_j].cy = (461 - (_i * 51));
mainArr[_i][_j].py = _i;
mainArr[_i][_j].px = _j;
tArr[((_i * 10) + _j)] = null;
dArr[((_i * 10) + _j)] = null;
uArr[((_i * 10) + _j)] = null;
mainArr[xx][_j] = null;
tweenCpt = (tweenCpt + 1);
TweenMax.to(mainArr[_i][_j], 1, {x:(_j * 51), y:(461 - (_i * 51)), onComplete:onFinishTween});
btype[((_i * 10) + _j)] = btype[((xx * 10) + _j)];
btype[((xx * 10) + _j)] = null;
};
xx++;
};
};
if (mainArr[_i][_j] != null){
if (mainArr[_i][_j].y != (461 - (_i * 51))){
tweenCpt = (tweenCpt + 1);
TweenMax.to(mainArr[_i][_j], 1, {x:(_j * 51), y:(461 - (_i * 51)), onComplete:onFinishTween});
};
};
_j++;
};
_i++;
};
mvR();
}
public function opt_out(e:MouseEvent):void{
TTween.backTint(tgMc.opt_bt, 0.5, 0);
}
public function mvR():void{
var _i_:int;
var _j_:int;
var zz:int;
var tst:int;
mouseOn = false;
_i_ = 0;
while (_i_ < 10) {
_j_ = 9;
while (_j_ > 0) {
if (mainArr[_i_][_j_] == null){
zz = _j_;
while (zz >= 0) {
if (((!((mainArr[_i_][zz] == null))) && ((mainArr[_i_][_j_] == null)))){
mainArr[_i_][zz].removeEventListener(Event.ENTER_FRAME, shk);
tst = (_j_ - zz);
mainArr[_i_][_j_] = mainArr[_i_][zz];
mainArr[_i_][_j_].removeEventListener(Event.ENTER_FRAME, shk);
mainArr[_i_][_j_].name = ((_i_ * 10) + _j_);
mainArr[_i_][_j_].cx = (_j_ * 51);
mainArr[_i_][_j_].cy = (461 - (_i_ * 51));
mainArr[_i_][_j_].py = _i_;
mainArr[_i_][_j_].px = _j_;
tArr[((_i_ * 10) + _j_)] = null;
dArr[((_i_ * 10) + _j_)] = null;
uArr[((_i_ * 10) + _j_)] = null;
mainArr[_i_][zz] = null;
tweenCpt = (tweenCpt + 1);
TweenMax.to(mainArr[_i_][_j_], 1, {x:(_j_ * 51), y:(461 - (_i_ * 51)), onComplete:onFinishTween});
btype[((_i_ * 10) + _j_)] = btype[((_i_ * 10) + zz)];
btype[((_i_ * 10) + zz)] = null;
};
zz--;
};
};
if (mainArr[_i_][_j_] != null){
if (mainArr[_i_][_j_].x != (_j_ * 51)){
tweenCpt = (tweenCpt + 1);
TweenMax.to(mainArr[_i_][_j_], 1, {x:(_j_ * 51), y:(461 - (_i_ * 51)), onComplete:onFinishTween});
};
};
_j_--;
};
_i_++;
};
}
public function createNl():void{
var nl:int;
var varn:int;
var tvarn:int;
var tnml:int;
mouseOn = false;
nl = 0;
while (nl < 10) {
varn = (Math.floor((Math.random() * ((1 + 4) - 0))) + 0);
tvarn = (varn * 51);
if (varn == 0){
mainArr[nl][0] = new blk1();
} else {
if (varn == 1){
mainArr[nl][0] = new blk2();
} else {
if (varn == 2){
mainArr[nl][0] = new blk3();
} else {
if (varn == 3){
mainArr[nl][0] = new blk4();
} else {
if (varn == 4){
mainArr[nl][0] = new blk5();
};
};
};
};
};
addChild(mainArr[nl][0]);
mainArr[nl][0].y = (461 - (nl * 51));
mainArr[nl][0].x = -51;
mainArr[nl][0].cy = (461 - (nl * 51));
mainArr[nl][0].cx = 51;
mainArr[nl][0].py = nl;
mainArr[nl][0].px = 0;
tnml = ((nl * 10) + 0);
mainArr[nl][0].name = tnml;
btype[tnml] = varn;
tweenCpt = (tweenCpt + 1);
TweenMax.to(mainArr[nl][0], 1, {x:0, y:(461 - (nl * 51)), onComplete:onFinishTween});
nl++;
};
}
public function achPosition():void{
if (mouseY >= 250){
achPoint = new Point(10, 10);
} else {
achPoint = new Point(10, 440);
};
}
public function gOverCheck(){
var iy:int;
var xj:int;
var biy:int;
var tbiy:int;
var cc:int;
var gy:int;
var gj:int;
gOver = true;
iy = 0;
while (iy < 10) {
xj = 0;
while (xj < 10) {
if (mainArr[iy][xj] != null){
biy = ((iy * 10) + xj);
if ((xj - 1) >= 0){
tbiy = ((iy * 10) + (xj - 1));
if (btype[biy] == btype[tbiy]){
gOver = false;
iy = 9;
xj = 9;
};
};
if ((xj + 1) < 10){
tbiy = ((iy * 10) + (xj + 1));
if (btype[biy] == btype[tbiy]){
gOver = false;
iy = 9;
xj = 9;
};
};
if ((iy - 1) >= 0){
tbiy = (((iy - 1) * 10) + xj);
if (btype[biy] == btype[tbiy]){
gOver = false;
iy = 9;
xj = 9;
};
};
if ((iy + 1) < 10){
tbiy = (((iy + 1) * 10) + xj);
if (btype[biy] == btype[tbiy]){
gOver = false;
iy = 9;
xj = 9;
};
};
};
xj++;
};
iy++;
};
if (Mod == 2){
cc = 0;
while (cc < 3) {
if (bnusA[cc] != null){
gOver = false;
};
cc++;
};
};
if (gOver == true){
this.removeEventListener(Event.ENTER_FRAME, chgo);
cptt = 0;
if (TScore == score.value){
main_class.show_game_over(TScore);
main_class.mySharedObject.data.totalCubes = shareTcube;
main_class.mySharedObject.flush();
} else {
main_class.show_game_over(0);
};
gy = 0;
while (gy < 10) {
gj = 0;
while (gj < 10) {
if (mainArr[gy][gj] != null){
mainArr[gy][gj].addEventListener(Event.ENTER_FRAME, greyO);
};
gj++;
};
gy++;
};
};
}
}
}//package
Section 168
//Title (Title)
package {
import flash.display.*;
public class Title extends MovieClip {
public var c:Lc;
public var b:Lb;
public var a:La;
public var u:Lu;
public var l:Ll;
public var t:Lt;
public var s:Ls;
public function Title(){
super();
}
}
}//package
Section 169
//title1 (title1)
package {
import flash.display.*;
public dynamic class title1 extends BitmapData {
public function title1(w:Number, h:Number){
super(w, h);
}
}
}//package
Section 170
//ttl (ttl)
package {
import flash.display.*;
public dynamic class ttl extends MovieClip {
public function ttl(){
super();
}
}
}//package
Section 171
//tuto_txt (tuto_txt)
package {
import flash.display.*;
public dynamic class tuto_txt extends MovieClip {
public function tuto_txt(){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11);
}
function frame10(){
stop();
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
function frame8(){
stop();
}
function frame2(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 172
//tutorial (tutorial)
package {
import flash.display.*;
import gs.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import unam.*;
import flash.text.*;
public dynamic class tutorial extends MovieClip {
public var tutArray:Array;
public var next_bt:MovieClip;
public var tutext:MovieClip;
public var frm:int;// = 1
public var ii:int;
public var backGround:MovieClip;
public var bnC:MovieClip;
public var achArr:Array;
public var tu:MovieClip;
public var tframe:MovieClip;
public var bns:MovieClip;
public var main:unam;
public var colArray:Array;
public var xross:MovieClip;
public var prev_bt:MovieClip;
private var myGlow1:GlowFilter;
public function tutorial(passed_class:unam):void{
var i:int;
var j:int;
var varx:int;
var tvarx:int;
var tnm:int;
frm = 1;
tutArray = new Array(10);
colArray = new Array(10);
myGlow1 = new GlowFilter();
super();
main = passed_class;
myGlow1.color = 16716049;
myGlow1.blurX = 5;
myGlow1.blurY = 5;
myGlow1.quality = 2;
tframe = new t_frame();
addChild(tframe);
tframe.y = 10;
tframe.x = (200 - (tframe.width / 2));
next_bt = new nextbt();
addChild(next_bt);
next_bt.y = 370;
next_bt.x = 360;
i = 0;
while (i < 10) {
tutArray[i] = new Array(10);
j = 0;
while (j < 10) {
tutArray[i][j] = new Array(10);
varx = (Math.floor((Math.random() * ((1 + 4) - 0))) + 0);
tvarx = (varx * 26);
if ((((((((i == 0)) && ((j >= 7)))) && (!((j == 9))))) || ((((i == 1)) && ((j >= 8)))))){
varx = 3;
};
if ((((((i == 0)) && ((j == 6)))) || ((((i == 1)) && ((((j == 6)) || ((j == 7)))))))){
varx = 2;
};
if ((((i == 2)) && ((j >= 8)))){
varx = 4;
};
if ((((i == 0)) && ((j == 9)))){
varx = 1;
};
if ((((i >= 6)) && ((((j >= 0)) && ((j < 4)))))){
while (varx == 0) {
varx = (Math.floor((Math.random() * ((1 + 4) - 0))) + 0);
};
};
if ((((((((i == 7)) && ((j == 2)))) || ((((i == 8)) && ((j == 2)))))) || ((((i == 9)) && ((j == 2)))))){
varx = 0;
};
if (varx == 0){
tutArray[i][j] = new blk1();
} else {
if (varx == 1){
tutArray[i][j] = new blk2();
} else {
if (varx == 2){
tutArray[i][j] = new blk3();
} else {
if (varx == 3){
tutArray[i][j] = new blk4();
} else {
if (varx == 4){
tutArray[i][j] = new blk5();
};
};
};
};
};
addChild(tutArray[i][j]);
tutArray[i][j].scaleX = (tutArray[i][j].scaleX / 2);
tutArray[i][j].scaleY = (tutArray[i][j].scaleY / 2);
tutArray[i][j].y = ((tframe.y + 5) + (i * 26));
tutArray[i][j].x = ((tframe.x + 5) + (j * 26));
tutArray[i][j].cy = (461 - (i * 26));
tutArray[i][j].cx = (j * 26);
tutArray[i][j].py = i;
tutArray[i][j].px = j;
tnm = ((i * 10) + j);
if ((((((((i == 0)) && ((j >= 7)))) && (!((j == 9))))) || ((((i == 1)) && ((j >= 8)))))){
tutArray[i][j].name = "exp";
tutArray[i][j].filters = [myGlow1];
} else {
if ((((((((i == 7)) && ((j == 2)))) || ((((i == 8)) && ((j == 2)))))) || ((((i == 9)) && ((j == 2)))))){
tutArray[i][j].name = "exp2";
} else {
tutArray[i][j].name = tnm;
};
};
j++;
};
i++;
};
main.stage.addEventListener(MouseEvent.CLICK, stageClick);
tutext = new tuto_txt();
addChild(tutext);
tutext.y = (335 - (tutext.height / 2));
tutext.x = (220 - (tutext.width / 2));
tutext.gotoAndStop(1);
next_bt.visible = false;
next_bt.mouseChildren = false;
next_bt.addEventListener(MouseEvent.CLICK, on_n_clicked);
next_bt.addEventListener(MouseEvent.MOUSE_OVER, over_opt);
next_bt.addEventListener(MouseEvent.MOUSE_OUT, out_opt);
xross = new x_close();
addChild(xross);
xross.y = 10;
xross.x = 375;
xross.mouseChildren = false;
xross.addEventListener(MouseEvent.MOUSE_OVER, over_opt);
xross.addEventListener(MouseEvent.MOUSE_OUT, out_opt);
xross.addEventListener(MouseEvent.CLICK, on_x_clicked);
}
public function on_x_clicked(e:MouseEvent):void{
var i:int;
var j:int;
var e = e;
removeChild(tframe);
removeChild(next_bt);
removeChild(tutext);
removeChild(xross);
xross.removeEventListener(MouseEvent.CLICK, on_x_clicked);
next_bt.removeEventListener(MouseEvent.CLICK, on_n_clicked);
next_bt.removeEventListener(MouseEvent.MOUSE_OVER, over_opt);
next_bt.removeEventListener(MouseEvent.MOUSE_OUT, out_opt);
xross.removeEventListener(MouseEvent.MOUSE_OVER, over_opt);
xross.removeEventListener(MouseEvent.MOUSE_OUT, out_opt);
tframe = null;
next_bt = null;
tu = null;
tutext = null;
xross = null;
i = 0;
while (i < 10) {
j = 0;
for (;j < 10;removeChild(tutArray[i][j]), (tutArray[i][j] = null), (j = (j + 1))) {
//unresolved if
if ((((((((((((i == 7)) || ((i == 8)))) || ((i == 9)))) && ((j == 2)))) || ((((i == 0)) && ((((j == 7)) || ((j == 8)))))))) || ((((i == 1)) && ((((j == 8)) || ((j == 9)))))))){
tutArray[i][j].removeEventListener(Event.ENTER_FRAME, shk);
continue;
var _slot1 = e;
};
};
if (colArray[i]){
removeChild(colArray[i]);
colArray[i] = null;
};
i = (i + 1);
};
if (bns){
removeChild(bns);
bns = null;
};
if (bnC){
removeChild(bnC);
bnC = null;
};
main.stage.removeEventListener(MouseEvent.CLICK, stageClick);
main.remove_tuto_screen();
}
public function on_n_clicked(e:MouseEvent):void{
if (frm == 3){
frame(4);
next_bt.visible = false;
} else {
if (frm == 8){
frame(9);
next_bt.visible = false;
} else {
if (frm >= 9){
frame((frm + 1));
} else {
frame(frm);
};
};
};
frm = (frm + 1);
if (frm >= 11){
next_bt.visible = false;
};
tutext.gotoAndStop(frm);
}
public function stageClick(e:MouseEvent):void{
if ((((e.target.name == "exp")) && ((frm == 1)))){
frm = (frm + 1);
frame(1);
} else {
if ((((e.target.name == "exp")) && ((frm == 2)))){
frm = (frm + 1);
frame(2);
frame(3);
} else {
if ((((e.target.name == "exp2")) && ((frm == 4)))){
frm = (frm + 1);
frame(5);
next_bt.visible = false;
} else {
if ((((e.target.name == "exp2")) && ((frm == 5)))){
frm = (frm + 1);
frame(6);
frame(7);
next_bt.visible = false;
};
};
};
};
tutext.gotoAndStop(frm);
}
public function creaAch():void{
var i:int;
achArr = new Array(10);
i = 0;
while (i < 10) {
achArr[i] = new achivmc();
addChild(achArr[i]);
achArr[i].x = 60;
achArr[i].y = (60 + (20 * i));
i++;
};
}
public function shak(dd:int, uu:int):void{
if (tutArray[dd][uu] != null){
tutArray[dd][uu].cx = tutArray[dd][uu].x;
tutArray[dd][uu].cy = tutArray[dd][uu].y;
tutArray[dd][uu].addEventListener(Event.ENTER_FRAME, shk, false, 0, true);
};
}
public function onFinishTween(p:int):void{
var u:int;
var uu:int;
var v:int;
if (p == 1){
u = 7;
while (u >= 0) {
TweenMax.to(tutArray[1][u], 1.5, {x:((tframe.x + 5) + ((u + 1) * 26)), y:((tframe.y + 5) + (1 * 26)), onComplete:onFinishTween, onCompleteParams:[(u + 10)]});
u--;
};
};
if (p == 10){
uu = 6;
while (uu >= 0) {
TweenMax.to(tutArray[0][uu], 1.5, {x:((tframe.x + 5) + ((uu + 3) * 26)), y:((tframe.y + 5) + (0 * 26)), onComplete:onFinishTween, onCompleteParams:[(uu + 20)]});
uu--;
};
};
if (p == 20){
next_bt.visible = true;
};
if (p == 39){
v = 7;
while (v <= 9) {
TweenMax.to(tutArray[v][0], 1.5, {x:((tframe.x + 5) + (1 * 26)), y:((tframe.y + 5) + (v * 26)), onComplete:onFinishTween, onCompleteParams:[(v + 40)]});
v++;
};
};
if (p == 49){
frm = 8;
frame(frm);
tutext.gotoAndStop(frm);
};
if (p == 56){
next_bt.visible = true;
};
}
public function reset(d:int):void{
var r:int;
var t:int;
r = 0;
while (r <= d) {
t = 0;
while (t < 10) {
if (tutArray[r][t]){
tutArray[r][t].y = ((tframe.y + 5) + (r * 26));
tutArray[r][t].x = ((tframe.x + 5) + (t * 26));
};
t++;
};
r++;
};
}
public function frame(fr:int):void{
var i:int;
var j:int;
var rr:int;
var s:int;
var v:int;
var varx:int;
var tvarx:int;
var w:int;
if (fr == 1){
tutArray[0][7].visible = true;
tutArray[0][8].visible = true;
tutArray[1][8].visible = true;
tutArray[1][9].visible = true;
shak(0, 7);
shak(0, 8);
shak(1, 8);
shak(1, 9);
};
if (fr == 2){
tutArray[0][7].removeEventListener(Event.ENTER_FRAME, shk);
tutArray[0][8].removeEventListener(Event.ENTER_FRAME, shk);
tutArray[1][8].removeEventListener(Event.ENTER_FRAME, shk);
tutArray[1][9].removeEventListener(Event.ENTER_FRAME, shk);
tutArray[0][7].visible = false;
tutArray[0][8].visible = false;
tutArray[1][8].visible = false;
tutArray[1][9].visible = false;
};
if (fr == 3){
TweenMax.to(tutArray[0][9], 1.5, {x:((tframe.x + 5) + (9 * 26)), y:((tframe.y + 5) + (1 * 26)), onComplete:onFinishTween, onCompleteParams:[1]});
tutArray[0][7].visible = false;
tutArray[0][8].visible = false;
tutArray[1][8].visible = false;
tutArray[1][9].visible = false;
};
if (fr == 4){
rr = 0;
while (rr <= 6) {
s = 0;
while (s < 10) {
if (tutArray[rr][s]){
removeChild(tutArray[rr][s]);
tutArray[rr][s] = null;
};
s++;
};
rr++;
};
tutArray[7][2].filters = [myGlow1];
tutArray[8][2].filters = [myGlow1];
tutArray[9][2].filters = [myGlow1];
};
if (fr == 5){
shak(7, 2);
shak(8, 2);
shak(9, 2);
};
if (fr == 6){
tutArray[7][2].removeEventListener(Event.ENTER_FRAME, shk);
tutArray[8][2].removeEventListener(Event.ENTER_FRAME, shk);
tutArray[9][2].removeEventListener(Event.ENTER_FRAME, shk);
tutArray[7][2].visible = false;
tutArray[8][2].visible = false;
tutArray[9][2].visible = false;
};
if (fr == 7){
v = 7;
while (v <= 9) {
TweenMax.to(tutArray[v][1], 1.5, {x:((tframe.x + 5) + (2 * 26)), y:((tframe.y + 5) + (v * 26)), onComplete:onFinishTween, onCompleteParams:[(v + 30)]});
v++;
};
};
if (fr == 8){
next_bt.visible = true;
j = 0;
while (j < 10) {
varx = (Math.floor((Math.random() * ((1 + 4) - 0))) + 0);
tvarx = (varx * 26);
if (varx == 0){
colArray[j] = new blk1();
} else {
if (varx == 1){
colArray[j] = new blk2();
} else {
if (varx == 2){
colArray[j] = new blk3();
} else {
if (varx == 3){
colArray[j] = new blk4();
} else {
if (varx == 4){
colArray[j] = new blk5();
};
};
};
};
};
addChild(colArray[j]);
colArray[j].scaleX = (colArray[j].scaleX / 2);
colArray[j].scaleY = (colArray[j].scaleY / 2);
colArray[j].y = ((tframe.y + 5) + (j * 26));
colArray[j].x = ((tframe.x + 5) + (0 * 26));
j++;
};
};
if (fr == 9){
w = 0;
while (w <= 6) {
TweenMax.to(colArray[w], 1.5, {x:((tframe.x + 5) + (9 * 26)), y:((tframe.y + 5) + (w * 26)), onComplete:onFinishTween, onCompleteParams:[(w + 50)]});
w++;
};
};
if (fr == 10){
i = 0;
while (i < 10) {
j = 0;
while (j < 10) {
if (tutArray[i][j]){
removeChild(tutArray[i][j]);
tutArray[i][j] = null;
};
j++;
};
if (colArray[i]){
removeChild(colArray[i]);
colArray[i] = null;
};
i++;
};
bns = new blback();
addChild(bns);
bns.x = ((tframe.x + (tframe.width / 2)) - (bns.width / 2));
bns.y = (tframe.y + 20);
};
if (fr == 11){
bnC = new blk2();
addChild(bnC);
bnC.x = (bns.x + 1);
bnC.y = (bns.y + 1);
};
}
public function out_opt(e:MouseEvent):void{
var target2:MovieClip;
target2 = (e.target as MovieClip);
TTween.backTint(target2, 0.5, 0);
}
public function shk(e:Event):void{
if (e.target != null){
e.target.x = (e.target.cx + ((1 + (Math.random() * (2 * 3))) - 3));
e.target.y = (e.target.cy + ((1 + (Math.random() * (2 * 3))) - 3));
};
}
public function over_opt(e:MouseEvent):void{
var target:MovieClip;
target = (e.target as MovieClip);
TTween.backTint(target, 0.5, (Math.floor((Math.random() * ((1 + 4) - 1))) + 1));
}
}
}//package
Section 173
//v_ (v_)
package {
import flash.display.*;
public dynamic class v_ extends MovieClip {
public function v_(){
super();
}
}
}//package
Section 174
//x_close (x_close)
package {
import flash.display.*;
public dynamic class x_close extends MovieClip {
public var bt:MovieClip;
public function x_close(){
super();
}
}
}//package
Section 175
//Xplo (Xplo)
package {
import flash.media.*;
public dynamic class Xplo extends Sound {
public function Xplo(){
super();
}
}
}//package
Section 176
//yes_bt (yes_bt)
package {
import flash.display.*;
public dynamic class yes_bt extends MovieClip {
public var bt:MovieClip;
public function yes_bt(){
super();
}
}
}//package