Section 1
//Linear (com.greensock.easing.Linear)
package com.greensock.easing {
public class Linear {
public static const power:uint = 0;
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package com.greensock.easing
Section 2
//TweenNano (com.greensock.TweenNano)
package com.greensock {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class TweenNano {
public var duration:Number;
public var vars:Object;
public var startTime:Number;
public var target:Object;
public var active:Boolean;
public var gc:Boolean;
public var useFrames:Boolean;
public var ratio:Number;// = 0
protected var _ease:Function;
protected var _initted:Boolean;
protected var _propTweens:Array;
protected static var _time:Number;
protected static var _frame:uint;
protected static var _masterList:Dictionary = new Dictionary(false);
protected static var _shape:Shape = new Shape();
protected static var _tnInitted:Boolean;
protected static var _reservedProps:Object = {ease:1, delay:1, useFrames:1, overwrite:1, onComplete:1, onCompleteParams:1, runBackwards:1, immediateRender:1, onUpdate:1, onUpdateParams:1};
public function TweenNano(_arg1:Object, _arg2:Number, _arg3:Object){
if (!_tnInitted){
_time = (getTimer() * 0.001);
_frame = 0;
_shape.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
_tnInitted = true;
};
this.vars = _arg3;
this.duration = _arg2;
this.active = Boolean((((((_arg2 == 0)) && ((this.vars.delay == 0)))) && (!((this.vars.immediateRender == false)))));
this.target = _arg1;
if (typeof(this.vars.ease) != "function"){
_ease = TweenNano.easeOut;
} else {
_ease = this.vars.ease;
};
_propTweens = [];
this.useFrames = Boolean((_arg3.useFrames == true));
var _local4:Number = (("delay" in this.vars)) ? Number(this.vars.delay) : 0;
this.startTime = (this.useFrames) ? (_frame + _local4) : (_time + _local4);
var _local5:Array = _masterList[_arg1];
if ((((((_local5 == null)) || ((int(this.vars.overwrite) == 1)))) || ((this.vars.overwrite == null)))){
_masterList[_arg1] = [this];
} else {
_local5[_local5.length] = this;
};
if ((((this.vars.immediateRender == true)) || (this.active))){
renderTime(0);
};
}
public function init():void{
var _local1:String;
var _local2:Array;
var _local3:int;
for (_local1 in this.vars) {
if (!(_local1 in _reservedProps)){
_propTweens[_propTweens.length] = [_local1, this.target[_local1], ((typeof(this.vars[_local1]))=="number") ? (this.vars[_local1] - this.target[_local1]) : Number(this.vars[_local1])];
};
};
if (this.vars.runBackwards){
_local3 = _propTweens.length;
while (--_local3 > -1) {
_local2 = _propTweens[_local3];
_local2[1] = (_local2[1] + _local2[2]);
_local2[2] = -(_local2[2]);
};
};
_initted = true;
}
public function renderTime(_arg1:Number):void{
var _local2:Array;
if (!_initted){
init();
};
var _local3:int = _propTweens.length;
if (_arg1 >= this.duration){
_arg1 = this.duration;
this.ratio = 1;
} else {
if (_arg1 <= 0){
this.ratio = 0;
} else {
this.ratio = _ease(_arg1, 0, 1, this.duration);
};
};
while (--_local3 > -1) {
_local2 = _propTweens[_local3];
this.target[_local2[0]] = (_local2[1] + (this.ratio * _local2[2]));
};
if (this.vars.onUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_arg1 == this.duration){
complete(true);
};
}
public function complete(_arg1:Boolean=false):void{
if (!_arg1){
renderTime(this.duration);
return;
};
kill();
if (this.vars.onComplete){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public function kill():void{
this.gc = true;
this.active = false;
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenNano{
return (new TweenNano(_arg1, _arg2, _arg3));
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenNano{
_arg3.runBackwards = true;
if (!("immediateRender" in _arg3)){
_arg3.immediateRender = true;
};
return (new TweenNano(_arg1, _arg2, _arg3));
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenNano{
return (new TweenNano(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, useFrames:_arg4, overwrite:0}));
}
public static function updateAll(_arg1:Event=null):void{
var _local3:Array;
var _local4:Object;
var _local5:int;
var _local6:Number;
var _local7:TweenNano;
_frame = (_frame + 1);
_time = (getTimer() * 0.001);
var _local2:Dictionary = _masterList;
for (_local4 in _local2) {
_local3 = _local2[_local4];
_local5 = _local3.length;
while (--_local5 > -1) {
_local7 = _local3[_local5];
_local6 = (_local7.useFrames) ? _frame : _time;
if (((_local7.active) || (((!(_local7.gc)) && ((_local6 >= _local7.startTime)))))){
_local7.renderTime((_local6 - _local7.startTime));
} else {
if (_local7.gc){
_local3.splice(_local5, 1);
};
};
};
if (_local3.length == 0){
delete _local2[_local4];
};
};
}
public static function killTweensOf(_arg1:Object, _arg2:Boolean=false):void{
var _local3:Array;
var _local4:int;
if ((_arg1 in _masterList)){
if (_arg2){
_local3 = _masterList[_arg1];
_local4 = _local3.length;
while (--_local4 > -1) {
if (!TweenNano(_local3[_local4]).gc){
TweenNano(_local3[_local4]).complete(false);
};
};
};
delete _masterList[_arg1];
};
}
private static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((-1 * _arg1) * (_arg1 - 2)));
}
}
}//package com.greensock
Section 3
//AdLoader (CPMStar.AdLoader)
package CPMStar {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.system.*;
public class AdLoader extends Sprite {
private var cpmstarLoader:Loader;
private var contentspotid:String;
public function AdLoader(_arg1:String){
this.contentspotid = _arg1;
addEventListener(Event.ADDED, addedHandler);
}
private function addedHandler(_arg1:Event):void{
removeEventListener(Event.ADDED, addedHandler);
Security.allowDomain("server.cpmstar.com");
var _local2 = "http://server.cpmstar.com/adviewas3.swf";
var _local3:DisplayObjectContainer = parent;
cpmstarLoader = new Loader();
cpmstarLoader.contentLoaderInfo.addEventListener(Event.INIT, dispatchHandler);
cpmstarLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dispatchHandler);
cpmstarLoader.load(new URLRequest(((_local2 + "?contentspotid=") + contentspotid)));
addChild(cpmstarLoader);
}
private function dispatchHandler(_arg1:Event):void{
dispatchEvent(_arg1);
}
}
}//package CPMStar
Section 4
//BitmapLayer (dgparticles.BitmapLayer)
package dgparticles {
import flash.display.*;
import flash.geom.*;
public class BitmapLayer extends Bitmap {
private var refreshRect:Rectangle;
public var refreshX1:Number;
public var refreshY1:Number;
public var refreshX2:Number;
public var refreshY2:Number;
public var bgColor:uint;
public function BitmapLayer(_arg1, _arg2:int, _arg3:uint=0, _arg4:String="auto", _arg5:Boolean=false){
refreshRect = new Rectangle();
super(new BitmapData(_arg1, _arg2, true, _arg3), _arg4, _arg5);
bgColor = _arg3;
}
public function get bounds():Rectangle{
return (bitmapData.rect);
}
public function clear():void{
if ((((refreshX2 == 0)) || ((refreshY2 == 0)))){
return;
};
refreshRect.x = refreshX1;
refreshRect.y = refreshY1;
refreshRect.width = (refreshX2 - refreshX1);
refreshRect.height = (refreshY2 - refreshY1);
bitmapData.fillRect(refreshRect, bgColor);
}
}
}//package dgparticles
Section 5
//Color4 (dgparticles.Color4)
package dgparticles {
public class Color4 {
public var a;
public var r;
public var g;
public var b:int;
public function Color4(_arg1, _arg2, _arg3, _arg4:int){
this.a = _arg1;
this.r = _arg2;
this.g = _arg3;
this.b = _arg4;
}
public function toHex():uint{
return (Color4.ARGBToHex(a, r, g, b));
}
public function toString():String{
return (((((((("a = " + a) + "; r = ") + r) + "; g = ") + g) + "; b = ") + b));
}
public function clone():Color4{
return (new Color4(a, r, g, b));
}
public static function substructColors(_arg1, _arg2:Color4):Color4{
var _local3:int = (_arg1.a - _arg2.a);
var _local4:int = (_arg1.r - _arg2.r);
var _local5:int = (_arg1.g - _arg2.g);
var _local6:int = (_arg1.b - _arg2.b);
return (new Color4(_local3, _local4, _local5, _local6));
}
public static function ARGBToHex(_arg1, _arg2, _arg3, _arg4:uint):uint{
return (((((_arg1 << 24) | (_arg2 << 16)) | (_arg3 << 8)) | _arg4));
}
public static function RGBToHex(_arg1, _arg2, _arg3:uint):uint{
return ((((_arg1 << 16) | (_arg2 << 8)) | _arg3));
}
public static function HexToARGB(_arg1:uint):Color4{
var _local2:uint = ((_arg1 >> 24) & 0xFF);
var _local3:uint = ((_arg1 >> 16) & 0xFF);
var _local4:uint = ((_arg1 >> 8) & 0xFF);
var _local5:uint = (_arg1 & 0xFF);
return (new Color4(_local2, _local3, _local4, _local5));
}
}
}//package dgparticles
Section 6
//Emitter (dgparticles.Emitter)
package dgparticles {
import flash.geom.*;
public class Emitter {
public var settings:EmitterSettings;
private var particles:Array;
public var timeSinceStart:Number;// = 0
private var ps:ParticleSystem;
public var pos:Point;
private var newParticlesCount:Number;// = 0
public var deltaMove:Point;
public function Emitter(_arg1:ParticleSystem){
particles = new Array();
deltaMove = new Point();
super();
this.ps = _arg1;
}
public function get parcticlesCount():int{
return (particles.length);
}
public function get position():Point{
return (pos);
}
public function set position(_arg1:Point):void{
var _local2:Number;
var _local3:Number;
var _local4:int;
var _local5:Particle;
if (settings.moveWithEmmiter){
_local2 = (_arg1.x - pos.x);
_local3 = (_arg1.y - pos.y);
_local4 = 0;
while (_local4 < particles.length) {
_local5 = particles[_local4];
_local5.position.x = (_local5.position.x + _local2);
_local5.position.y = (_local5.position.y + _local3);
_local4++;
};
};
pos.x = _arg1.x;
pos.y = _arg1.y;
}
public function update(_arg1:Number):Boolean{
var _local3:Particle;
var _local4:Boolean;
var _local2:int = (particles.length - 1);
while (_local2 >= 0) {
_local3 = particles[_local2];
_local4 = !(_local3.update(_arg1));
if (((_local4) && (ps.bitmapLayer.bounds.intersects(_local3.bounds)))){
_local3.draw(ps.bitmapLayer.bitmapData);
if (_local3.destRect.x < ps.bitmapLayer.refreshX1){
ps.bitmapLayer.refreshX1 = _local3.destRect.x;
};
if (_local3.destRect.y < ps.bitmapLayer.refreshY1){
ps.bitmapLayer.refreshY1 = _local3.destRect.y;
};
if (_local3.destRect.right > ps.bitmapLayer.refreshX2){
ps.bitmapLayer.refreshX2 = _local3.destRect.right;
};
if (_local3.destRect.bottom > ps.bitmapLayer.refreshY2){
ps.bitmapLayer.refreshY2 = _local3.destRect.bottom;
};
} else {
particles.splice(_local2, 1);
ps.backParticle(_local3);
};
_local2--;
};
timeSinceStart = (timeSinceStart + _arg1);
if (timeSinceStart >= settings.lifeTime){
return ((particles.length == 0));
};
newParticlesCount = (newParticlesCount + ((settings.emissionRate / 1000) * _arg1));
while (newParticlesCount >= 1) {
emitParticle();
newParticlesCount--;
};
return (false);
}
private function emitParticle():void{
var _local1:Particle = ps.createParticle();
settings.initParticle(_local1, position);
_local1.initialize(this);
particles.push(_local1);
}
}
}//package dgparticles
Section 7
//EmitterSettings (dgparticles.EmitterSettings)
package dgparticles {
import flash.display.*;
import flash.geom.*;
public class EmitterSettings {
public var name:String;
public var capacity:Number;
public var direction:Number;
public var angle:Number;
public var minParticleLife;
public var maxParticleLife:Number;
public var minAcceleration;
public var maxAcceleration:Number;
public var minTangAcceleration;
public var maxTangAcceleration:Number;
public var minVelocity;
public var maxVelocity:Number;
public var minGravityY;
public var maxGravityY:Number;
public var minSpin;
public var maxSpin:Number;
public var blendMode:String;// = "add"
public var lifeTime:Number;// = 100000000
public var emissionRate:Number;
public var startColor;
public var midColor;
public var endColor:Color4;
public var startScaleX;
public var midScaleX;
public var endScaleX:Number;
public var startScaleY;
public var midScaleY;
public var endScaleY:Number;
public var moveWithEmmiter:Boolean;// = false
public var radius:Number;// = 0
public var middle:int;// = 50
private var imgName:String;
private var particleBitmapData:BitmapData;
public function get imageName():String{
return (imgName);
}
public function set imageName(_arg1:String):void{
imgName = _arg1;
particleBitmapData = Utilites.getParticleByName(_arg1);
}
public function initParticle(_arg1:Particle, _arg2:Point):void{
_arg1.position.x = (_arg2.x + Utils.randomNumber(-(radius), radius));
_arg1.position.y = (_arg2.y + Utils.randomNumber(-(radius), radius));
_arg1.lifeTime = Utils.randomNumber(minParticleLife, maxParticleLife);
_arg1.spin = Utils.randomNumber(minSpin, maxSpin);
_arg1.gravityY = Utils.randomNumber(minGravityY, maxGravityY);
_arg1.acceleration = Utils.randomNumber(minAcceleration, maxAcceleration);
_arg1.tangAcceleration = Utils.randomNumber(minTangAcceleration, maxTangAcceleration);
_arg1.startColor = startColor;
_arg1.midColor = midColor;
_arg1.endColor = endColor;
_arg1.startScaleX = startScaleX;
_arg1.startScaleY = startScaleY;
_arg1.midScaleX = midScaleX;
_arg1.midScaleY = midScaleY;
_arg1.endScaleX = endScaleX;
_arg1.endScaleY = endScaleY;
_arg1.bitmapData = particleBitmapData;
var _local3:Number = (direction + Utils.randomNumber((-(angle) / 2), (angle / 2)));
_local3 = (_local3 * Utils.DEG_TO_RAD);
var _local4:Number = Utils.randomNumber(minVelocity, maxVelocity);
_arg1.velocity.x = (Math.sin(_local3) * _local4);
_arg1.velocity.y = (Math.cos(_local3) * _local4);
}
public function loadFromObject(_arg1:Object):void{
var _local2:String;
for (_local2 in _arg1) {
if ((((((_local2 == "startColor")) || ((_local2 == "midColor")))) || ((_local2 == "endColor")))){
this[_local2] = Color4.HexToARGB(_arg1[_local2]);
} else {
this[_local2] = _arg1[_local2];
};
};
}
public function clone():EmitterSettings{
var _local1:EmitterSettings = new EmitterSettings();
_local1.name = name;
_local1.capacity = capacity;
_local1.direction = direction;
_local1.angle = angle;
_local1.emissionRate = emissionRate;
_local1.blendMode = blendMode;
_local1.lifeTime = lifeTime;
_local1.imageName = imgName;
_local1.radius = radius;
_local1.moveWithEmmiter = moveWithEmmiter;
_local1.middle = middle;
_local1.minAcceleration = minAcceleration;
_local1.maxAcceleration = maxAcceleration;
_local1.minGravityY = minGravityY;
_local1.maxGravityY = maxGravityY;
_local1.minParticleLife = minParticleLife;
_local1.maxParticleLife = maxParticleLife;
_local1.minVelocity = minVelocity;
_local1.maxVelocity = maxVelocity;
_local1.minTangAcceleration = minTangAcceleration;
_local1.maxTangAcceleration = maxTangAcceleration;
_local1.minSpin = minSpin;
_local1.maxSpin = maxSpin;
_local1.startColor = startColor.clone();
_local1.midColor = midColor.clone();
_local1.endColor = endColor.clone();
_local1.startScaleX = startScaleX;
_local1.startScaleY = startScaleY;
_local1.midScaleX = midScaleX;
_local1.midScaleY = midScaleY;
_local1.endScaleX = endScaleX;
_local1.endScaleY = endScaleY;
return (_local1);
}
public function toString():String{
var _local1 = "{ ";
_local1 = (_local1 + (("name: \"" + name) + "\""));
_local1 = (_local1 + (", emissionRate: " + emissionRate));
_local1 = (_local1 + (", capacity: " + capacity));
_local1 = (_local1 + (", lifeTime: " + lifeTime));
_local1 = (_local1 + (", angle: " + angle));
_local1 = (_local1 + (", direction: " + direction));
_local1 = (_local1 + ((", imageName: \"" + imgName) + "\""));
_local1 = (_local1 + ((", blendMode: \"" + blendMode) + "\""));
_local1 = (_local1 + (", radius: " + radius));
_local1 = (_local1 + (", moveWithEmmiter: " + int(moveWithEmmiter)));
_local1 = (_local1 + (", middle: " + middle));
_local1 = (_local1 + (", minParticleLife: " + minParticleLife));
_local1 = (_local1 + (", maxParticleLife: " + maxParticleLife));
_local1 = (_local1 + (", minSpin: " + minSpin));
_local1 = (_local1 + (", maxSpin: " + maxSpin));
_local1 = (_local1 + (", minVelocity: " + minVelocity));
_local1 = (_local1 + (", maxVelocity: " + maxVelocity));
_local1 = (_local1 + (", minGravityY: " + minGravityY));
_local1 = (_local1 + (", maxGravityY: " + maxGravityY));
_local1 = (_local1 + (", minAcceleration: " + minAcceleration));
_local1 = (_local1 + (", maxAcceleration: " + maxAcceleration));
_local1 = (_local1 + (", minTangAcceleration: " + minTangAcceleration));
_local1 = (_local1 + (", maxTangAcceleration: " + maxTangAcceleration));
_local1 = (_local1 + (", startScaleX: " + startScaleX));
_local1 = (_local1 + (", startScaleY: " + startScaleY));
_local1 = (_local1 + (", midScaleX: " + midScaleX));
_local1 = (_local1 + (", midScaleY: " + midScaleY));
_local1 = (_local1 + (", endScaleX: " + endScaleX));
_local1 = (_local1 + (", endScaleY: " + endScaleY));
_local1 = (_local1 + (", startColor: " + startColor.toHex()));
_local1 = (_local1 + (", midColor: " + midColor.toHex()));
_local1 = (_local1 + (", endColor: " + endColor.toHex()));
_local1 = (_local1 + " }");
return (_local1);
}
}
}//package dgparticles
Section 8
//Particle (dgparticles.Particle)
package dgparticles {
import flash.display.*;
import flash.geom.*;
import fl.motion.*;
public class Particle {
private var smoothing:Boolean;
public var emitter:Emitter;
public var position:Point;
public var velocity:Point;
public var gravityY:int;
public var acceleration:int;
public var tangAcceleration:int;
public var spin:int;
public var lifeTime:Number;
public var bitmapData:BitmapData;
public var bounds:Rectangle;
public var startColor;
public var midColor;
public var endColor:Color4;
public var startScaleX;
public var midScaleX;
public var endScaleX:Number;
public var startScaleY;
public var midScaleY;
public var endScaleY:Number;
private var dColorA;
private var dColorR;
private var dColorG;
private var dColorB:Number;
private var dScaleX:Number;
private var dScaleY:Number;
private var scaleX:Number;
private var scaleY:Number;
private var timeSinceStart:uint;
private var matrix:Matrix;
private var colorTransform:ColorTransform;
private var middleTime:Number;
private var afterMiddleTime:Boolean;
private var colorAlpha:Number;
private var centerPoint:Point;
public var destRect:Rectangle;
private var accelVec:Point;
private var accelVec2:Point;
private var rct:Rectangle;
public function Particle(){
position = new Point();
velocity = new Point();
bounds = new Rectangle();
matrix = new Matrix();
colorTransform = new ColorTransform(0, 0, 0, 1);
centerPoint = new Point();
destRect = new Rectangle();
accelVec = new Point();
accelVec2 = new Point();
rct = new Rectangle();
super();
}
public function initialize(_arg1:Emitter):void{
smoothing = ParticleSystem.smoothing;
this.emitter = _arg1;
centerPoint.x = (bitmapData.width / 2);
centerPoint.y = (bitmapData.height / 2);
timeSinceStart = 0;
middleTime = ((lifeTime * _arg1.settings.middle) / 100);
afterMiddleTime = false;
calcDeltaParameters();
scaleX = startScaleX;
scaleY = startScaleY;
colorAlpha = startColor.a;
colorTransform.redOffset = startColor.r;
colorTransform.greenOffset = startColor.g;
colorTransform.blueOffset = startColor.b;
}
public function update(_arg1:Number):Boolean{
timeSinceStart = (timeSinceStart + _arg1);
if (timeSinceStart > lifeTime){
return (true);
};
if (emitter.settings.moveWithEmmiter){
position.x = (position.x - emitter.deltaMove.x);
position.y = (position.y - emitter.deltaMove.y);
};
if (((!(afterMiddleTime)) && ((timeSinceStart >= middleTime)))){
afterMiddleTime = true;
calcDeltaParameters();
};
var _local2:Number = (_arg1 / 1000);
accelVec.x = (position.x - emitter.position.x);
accelVec.y = (position.y - emitter.position.y);
accelVec.normalize(1);
accelVec2.x = -(accelVec.y);
accelVec2.y = accelVec.x;
accelVec.x = (accelVec.x * acceleration);
accelVec.y = (accelVec.y * acceleration);
accelVec2.x = (accelVec2.x * tangAcceleration);
accelVec2.y = (accelVec2.y * tangAcceleration);
velocity.x = (velocity.x + ((accelVec.x + accelVec2.x) * _local2));
velocity.y = (velocity.y + (((accelVec.y + accelVec2.y) + gravityY) * _local2));
position.x = (position.x + (velocity.x * _local2));
position.y = (position.y + (velocity.y * _local2));
scaleX = (scaleX + (dScaleX * _arg1));
scaleY = (scaleY + (dScaleY * _arg1));
matrix.identity();
matrix.scale(scaleX, scaleY);
matrix.translate((position.x - (centerPoint.x * scaleX)), (position.y - (centerPoint.y * scaleY)));
bounds.x = matrix.tx;
bounds.y = matrix.ty;
bounds.width = (bitmapData.width * scaleX);
bounds.height = (bitmapData.height * scaleY);
MatrixTransformer.rotateAroundInternalPoint(matrix, centerPoint.x, centerPoint.y, ((spin * timeSinceStart) / 1000));
colorAlpha = (colorAlpha + (dColorA * _arg1));
colorTransform.alphaMultiplier = (colorAlpha / 0xFF);
colorTransform.redOffset = (colorTransform.redOffset + (dColorR * _arg1));
colorTransform.greenOffset = (colorTransform.greenOffset + (dColorG * _arg1));
colorTransform.blueOffset = (colorTransform.blueOffset + (dColorB * _arg1));
destRect.x = (bounds.x + 1);
destRect.y = (bounds.y + 1);
destRect.width = (bounds.width - 2);
destRect.height = (bounds.height - 2);
return (false);
}
private function calcDeltaParameters():void{
var _local1:Number = (afterMiddleTime) ? (lifeTime - middleTime) : middleTime;
dScaleX = (afterMiddleTime) ? (endScaleX - midScaleX) : (midScaleX - startScaleX);
dScaleY = (afterMiddleTime) ? (endScaleY - midScaleY) : (midScaleY - startScaleY);
dScaleX = (dScaleX / _local1);
dScaleY = (dScaleY / _local1);
var _local2:Color4 = (afterMiddleTime) ? Color4.substructColors(endColor, midColor) : Color4.substructColors(midColor, startColor);
dColorA = (_local2.a / _local1);
dColorR = (_local2.r / _local1);
dColorG = (_local2.g / _local1);
dColorB = (_local2.b / _local1);
}
public function draw(_arg1:BitmapData):void{
if (spin != 0){
_arg1.draw(bitmapData, matrix, colorTransform, emitter.settings.blendMode, null, smoothing);
} else {
_arg1.draw(bitmapData, matrix, colorTransform, emitter.settings.blendMode, destRect, smoothing);
};
}
}
}//package dgparticles
Section 9
//ParticleSystem (dgparticles.ParticleSystem)
package dgparticles {
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
public class ParticleSystem {
public var capacity:int;// = 2000
public var bitmapLayer:BitmapLayer;
private var freeParticles:Array;
public var emitters:Array;
private var emSettings:Array;
public var enabled:Boolean;// = true
private var lastTime:Number;
public static var smoothing:Boolean = true;
public function ParticleSystem(_arg1:BitmapLayer){
freeParticles = new Array();
emitters = new Array();
emSettings = new Array();
lastTime = getTimer();
super();
this.bitmapLayer = _arg1;
_arg1.addEventListener(Event.ENTER_FRAME, update);
}
public function get parcticlesCount():int{
var _local1:int;
var _local2:int;
while (_local2 < emitters.length) {
_local1 = (_local1 + emitters[_local2].parcticlesCount);
_local2++;
};
return (_local1);
}
public function get emittersCount():int{
return (emitters.length);
}
public function addSettings(_arg1:EmitterSettings):void{
emSettings.push(_arg1);
}
public function addSettingsByObject(_arg1:Object):void{
var _local2:EmitterSettings = new EmitterSettings();
_local2.loadFromObject(_arg1);
emSettings.push(_local2);
}
public function createEmmiter(_arg1:String, _arg2:Point):Emitter{
var _local3:Emitter = new Emitter(this);
_local3.settings = getSettingsByName(_arg1).clone();
_local3.pos = _arg2;
emitters.push(_local3);
return (_local3);
}
public function killEmmiter(_arg1:Emitter):void{
var _local2:int;
while (_local2 < emitters.length) {
if (emitters[_local2] == _arg1){
emitters.splice(_local2, 1);
return;
};
_local2++;
};
}
public function killEmmiterSmooth(_arg1:Emitter):void{
var _local3:Emitter;
var _local2:int;
while (_local2 < emitters.length) {
_local3 = emitters[_local2];
if (_local3 == _arg1){
_local3.timeSinceStart = _local3.settings.lifeTime;
return;
};
_local2++;
};
}
public function killAllEmmiters():void{
emitters.splice(0, emitters.length);
}
public function getSettingsByName(_arg1:String):EmitterSettings{
var _local2:int;
while (_local2 < emSettings.length) {
if ((emSettings[_local2] as EmitterSettings).name == _arg1){
return ((emSettings[_local2] as EmitterSettings));
};
_local2++;
};
return (null);
}
public function createParticle():Particle{
return (((freeParticles.length)>0) ? Particle(freeParticles.pop()) : new Particle());
}
public function backParticle(_arg1:Particle):void{
freeParticles.push(_arg1);
}
private function update(_arg1:Event):void{
var _local2:Number = getTimer();
var _local3:Number = (_local2 - lastTime);
lastTime = _local2;
if (!enabled){
return;
};
bitmapLayer.clear();
bitmapLayer.refreshX1 = bitmapLayer.width;
bitmapLayer.refreshY1 = bitmapLayer.height;
bitmapLayer.refreshX2 = 0;
bitmapLayer.refreshY2 = 0;
var _local4:int = (emitters.length - 1);
while (_local4 >= 0) {
if (emitters[_local4].update(_local3)){
emitters.splice(_local4, 1);
};
_local4--;
};
}
public function dispose():void{
bitmapLayer.removeEventListener(Event.ENTER_FRAME, update);
}
}
}//package dgparticles
Section 10
//Utils (dgparticles.Utils)
package dgparticles {
public class Utils {
public static const DEG_TO_RAD = 0.0174532925199433;
public static function randomInt(_arg1, _arg2:int):int{
return ((_arg1 + int((Math.random() * (_arg2 - _arg1)))));
}
public static function randomNumber(_arg1, _arg2:Number):Number{
return ((_arg1 + (Math.random() * (_arg2 - _arg1))));
}
}
}//package dgparticles
Section 11
//AdjustColor (fl.motion.AdjustColor)
package fl.motion {
public class AdjustColor {
private var m_brightnessMatrix:ColorMatrix;
private var m_contrastMatrix:ColorMatrix;
private var m_saturationMatrix:ColorMatrix;
private var m_hueMatrix:ColorMatrix;
private var m_finalMatrix:ColorMatrix;
private static var s_arrayOfDeltaIndex:Array = [0, 0.01, 0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.1, 0.11, 0.12, 0.14, 0.15, 0.16, 0.17, 0.18, 0.2, 0.21, 0.22, 0.24, 0.25, 0.27, 0.28, 0.3, 0.32, 0.34, 0.36, 0.38, 0.4, 0.42, 0.44, 0.46, 0.48, 0.5, 0.53, 0.56, 0.59, 0.62, 0.65, 0.68, 0.71, 0.74, 0.77, 0.8, 0.83, 0.86, 0.89, 0.92, 0.95, 0.98, 1, 1.06, 1.12, 1.18, 1.24, 1.3, 1.36, 1.42, 1.48, 1.54, 1.6, 1.66, 1.72, 1.78, 1.84, 1.9, 1.96, 2, 2.12, 2.25, 2.37, 2.5, 2.62, 2.75, 2.87, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.3, 4.7, 4.9, 5, 5.5, 6, 6.5, 6.8, 7, 7.3, 7.5, 7.8, 8, 8.4, 8.7, 9, 9.4, 9.6, 9.8, 10];
public function set brightness(_arg1:Number):void{
if (this.m_brightnessMatrix == null){
this.m_brightnessMatrix = new ColorMatrix();
};
if (_arg1 != 0){
this.m_brightnessMatrix.SetBrightnessMatrix(_arg1);
};
}
public function set contrast(_arg1:Number):void{
var _local2:Number = _arg1;
if (_arg1 == 0){
_local2 = 127;
} else {
if (_arg1 > 0){
_local2 = ((s_arrayOfDeltaIndex[int(_arg1)] * 127) + 127);
} else {
_local2 = (((_arg1 / 100) * 127) + 127);
};
};
if (this.m_contrastMatrix == null){
this.m_contrastMatrix = new ColorMatrix();
};
this.m_contrastMatrix.SetContrastMatrix(_local2);
}
public function set saturation(_arg1:Number):void{
var _local2:Number = _arg1;
if (_arg1 == 0){
_local2 = 1;
} else {
if (_arg1 > 0){
_local2 = (1 + ((3 * _arg1) / 100));
} else {
_local2 = ((_arg1 / 100) + 1);
};
};
if (this.m_saturationMatrix == null){
this.m_saturationMatrix = new ColorMatrix();
};
this.m_saturationMatrix.SetSaturationMatrix(_local2);
}
public function set hue(_arg1:Number):void{
if (this.m_hueMatrix == null){
this.m_hueMatrix = new ColorMatrix();
};
if (_arg1 != 0){
this.m_hueMatrix.SetHueMatrix(((_arg1 * Math.PI) / 180));
};
}
public function AllValuesAreSet():Boolean{
return (((((((this.m_brightnessMatrix) && (this.m_contrastMatrix))) && (this.m_saturationMatrix))) && (this.m_hueMatrix)));
}
public function CalculateFinalFlatArray():Array{
if (this.CalculateFinalMatrix()){
return (this.m_finalMatrix.GetFlatArray());
};
return (null);
}
private function CalculateFinalMatrix():Boolean{
if (!this.AllValuesAreSet()){
return (false);
};
this.m_finalMatrix = new ColorMatrix();
this.m_finalMatrix.Multiply(this.m_brightnessMatrix);
this.m_finalMatrix.Multiply(this.m_contrastMatrix);
this.m_finalMatrix.Multiply(this.m_saturationMatrix);
this.m_finalMatrix.Multiply(this.m_hueMatrix);
return (true);
}
}
}//package fl.motion
Section 12
//Animator (fl.motion.Animator)
package fl.motion {
import flash.display.*;
import flash.geom.*;
public class Animator extends AnimatorBase {
public function Animator(_arg1:XML=null, _arg2:DisplayObject=null){
this.motion = new Motion(_arg1);
super(_arg1, _arg2);
}
override public function set motion(_arg1:MotionBase):void{
super.motion = _arg1;
var _local2:Motion = (_arg1 as Motion);
if (((((_local2) && (_local2.source))) && (_local2.source.transformationPoint))){
this.transformationPoint = _local2.source.transformationPoint.clone();
};
}
override protected function setTargetState():void{
this.targetState.scaleX = this._target.scaleX;
this.targetState.scaleY = this._target.scaleY;
this.targetState.skewX = MatrixTransformer.getSkewX(this._target.transform.matrix);
this.targetState.skewY = MatrixTransformer.getSkewY(this._target.transform.matrix);
this.targetState.bounds = this._target.getBounds(this._target);
this.initTransformPointInternal(this._target.transform.matrix);
this.targetState.z = 0;
this.targetState.rotationX = (this.targetState.rotationY = 0);
}
private function initTransformPointInternal(_arg1:Matrix):void{
var _local3:Number;
var _local4:Number;
var _local5:Point;
var _local2:Object = this.targetState.bounds;
if (this.transformationPoint){
_local3 = ((this.transformationPoint.x * _local2.width) + _local2.left);
_local4 = ((this.transformationPoint.y * _local2.height) + _local2.top);
this.targetState.transformPointInternal = new Point(_local3, _local4);
_local5 = _arg1.transformPoint(this.targetState.transformPointInternal);
this.targetState.x = _local5.x;
this.targetState.y = _local5.y;
} else {
this.targetState.transformPointInternal = new Point(0, 0);
this.targetState.x = this._target.x;
this.targetState.y = this._target.y;
};
}
override protected function setTimeClassic(_arg1:int, _arg2:MotionBase, _arg3:KeyframeBase):Boolean{
var _local6:Number;
var _local7:Number;
var _local8:Point;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Matrix;
var _local14:Boolean;
var _local15:Point;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Matrix;
var _local22:Number;
var _local4:Motion = (_arg2 as Motion);
if (!_local4){
return (false);
};
var _local5:Matrix = _local4.getMatrix(_arg1);
if (_local5){
if (((((!(motionArray)) || (!(_lastMatrixApplied)))) || (!(matricesEqual(_local5, _lastMatrixApplied))))){
this._target.transform.matrix = _local5;
_lastMatrixApplied = _local5;
};
} else {
if (((motionArray) && (!((_local4 == _lastMotionUsed))))){
this.transformationPoint = (_local4.motion_internal::transformationPoint) ? _local4.motion_internal::transformationPoint : new Point(0.5, 0.5);
this.initTransformPointInternal(_local4.motion_internal::initialMatrix);
_lastMotionUsed = _local4;
};
_local6 = _local4.getValue(_arg1, Tweenables.X);
_local7 = _local4.getValue(_arg1, Tweenables.Y);
_local8 = new Point(_local6, _local7);
if (this.positionMatrix){
_local8 = this.positionMatrix.transformPoint(_local8);
};
_local8.x = (_local8.x + this.targetState.x);
_local8.y = (_local8.y + this.targetState.y);
_local9 = (_local4.getValue(_arg1, Tweenables.SCALE_X) * this.targetState.scaleX);
_local10 = (_local4.getValue(_arg1, Tweenables.SCALE_Y) * this.targetState.scaleY);
_local11 = 0;
_local12 = 0;
if (this.orientToPath){
_local18 = _local4.getValue((_arg1 + 1), Tweenables.X);
_local19 = _local4.getValue((_arg1 + 1), Tweenables.Y);
_local20 = (Math.atan2((_local19 - _local7), (_local18 - _local6)) * (180 / Math.PI));
if (!isNaN(_local20)){
_local11 = (_local20 + this.targetState.skewX);
_local12 = (_local20 + this.targetState.skewY);
};
} else {
_local11 = (_local4.getValue(_arg1, Tweenables.SKEW_X) + this.targetState.skewX);
_local12 = (_local4.getValue(_arg1, Tweenables.SKEW_Y) + this.targetState.skewY);
};
_local13 = new Matrix((_local9 * Math.cos((_local12 * (Math.PI / 180)))), (_local9 * Math.sin((_local12 * (Math.PI / 180)))), (-(_local10) * Math.sin((_local11 * (Math.PI / 180)))), (_local10 * Math.cos((_local11 * (Math.PI / 180)))), 0, 0);
_local14 = false;
if (_local4.useRotationConcat(_arg1)){
_local21 = new Matrix();
_local22 = _local4.getValue(_arg1, Tweenables.ROTATION_CONCAT);
_local21.rotate(_local22);
_local13.concat(_local21);
_local14 = true;
};
_local13.tx = _local8.x;
_local13.ty = _local8.y;
_local15 = _local13.transformPoint(this.targetState.transformPointInternal);
_local16 = (_local13.tx - _local15.x);
_local17 = (_local13.ty - _local15.y);
_local13.tx = (_local13.tx + _local16);
_local13.ty = (_local13.ty + _local17);
if (((((!(motionArray)) || (!(_lastMatrixApplied)))) || (!(matricesEqual(_local13, _lastMatrixApplied))))){
if (!_local14){
this._target.rotation = _local12;
};
this._target.transform.matrix = _local13;
if (((((_local14) && ((this._target.scaleX == 0)))) && ((this._target.scaleY == 0)))){
this._target.scaleX = _local9;
this._target.scaleY = _local10;
};
_lastMatrixApplied = _local13;
};
};
if (((!((_lastCacheAsBitmapApplied == _arg3.cacheAsBitmap))) || (!(_cacheAsBitmapHasBeenApplied)))){
this._target.cacheAsBitmap = _arg3.cacheAsBitmap;
_cacheAsBitmapHasBeenApplied = true;
_lastCacheAsBitmapApplied = _arg3.cacheAsBitmap;
};
return (true);
}
public static function fromXMLString(_arg1:String, _arg2:DisplayObject=null):Animator{
return (new Animator(new XML(_arg1), _arg2));
}
public static function matricesEqual(_arg1:Matrix, _arg2:Matrix):Boolean{
return ((((((((((((_arg1.a == _arg2.a)) && ((_arg1.b == _arg2.b)))) && ((_arg1.c == _arg2.c)))) && ((_arg1.d == _arg2.d)))) && ((_arg1.tx == _arg2.tx)))) && ((_arg1.ty == _arg2.ty))));
}
}
}//package fl.motion
Section 13
//AnimatorBase (fl.motion.AnimatorBase)
package fl.motion {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
public class AnimatorBase extends EventDispatcher {
private var _motion:MotionBase;
private var _motionArray:Array;
protected var _lastMotionUsed:MotionBase;
protected var _lastColorTransformApplied:ColorTransform;
protected var _filtersApplied:Boolean;
protected var _lastBlendModeApplied:String;
protected var _cacheAsBitmapHasBeenApplied:Boolean;
protected var _lastCacheAsBitmapApplied:Boolean;
protected var _lastMatrixApplied:Matrix;
protected var _lastMatrix3DApplied:Object;
protected var _toRemove:Array;
protected var _lastFrameHandled:int;
protected var _lastSceneHandled:String;
protected var _registeredParent:Boolean;
public var orientToPath:Boolean;// = false
public var transformationPoint:Point;
public var transformationPointZ:int;
public var autoRewind:Boolean;// = false
public var positionMatrix:Matrix;
public var repeatCount:int;// = 1
private var _isPlaying:Boolean;// = false
protected var _target:DisplayObject;
protected var _lastTarget:DisplayObject;
private var _lastRenderedTime:int;// = -1
private var _lastRenderedMotion:MotionBase;// = null
private var _time:int;// = -1
private var _targetParent:DisplayObjectContainer;// = null
private var _targetParentBtn:SimpleButton;// = null
private var _targetName:String;// = ""
private var targetStateOriginal:Object;// = null
private var _placeholderName:String;// = null
private var _instanceFactoryClass:Class;// = null
private var instanceFactory:Object;// = null
private var _useCurrentFrame:Boolean;// = false
private var _spanStart:int;// = -1
private var _spanEnd:int;// = -1
private var _sceneName:String;// = ""
private var _frameEvent:String;// = "enterFrame"
private var _targetState3D:Array;// = null
protected var _isAnimator3D:Boolean;
private var playCount:int;// = 0
protected var targetState:Object;
private static var enterFrameBeacon:MovieClip = new MovieClip();
public function AnimatorBase(_arg1:XML=null, _arg2:DisplayObject=null){
this.target = _arg2;
this._isAnimator3D = false;
this.transformationPoint = new Point(0.5, 0.5);
this.transformationPointZ = 0;
this._sceneName = "";
this._toRemove = new Array();
this._lastFrameHandled = -1;
this._lastSceneHandled = null;
this._registeredParent = false;
}
public function get motion():MotionBase{
return (this._motion);
}
public function set motion(_arg1:MotionBase):void{
this._motion = _arg1;
if (_arg1){
if (this.motionArray){
this._spanStart = (this._spanEnd = -1);
};
this.motionArray = null;
};
}
public function get motionArray():Array{
return (this._motionArray);
}
public function set motionArray(_arg1:Array):void{
var _local2:int;
this._motionArray = (((_arg1) && ((_arg1.length > 0)))) ? _arg1 : null;
if (this._motionArray){
this.motion = null;
this._spanStart = this._motionArray[0].motion_internal::spanStart;
this._spanEnd = (this._spanStart - 1);
_local2 = 0;
while (_local2 < this._motionArray.length) {
this._spanEnd = (this._spanEnd + this._motionArray[_local2].duration);
_local2++;
};
};
}
public function get isPlaying():Boolean{
return (this._isPlaying);
}
public function get target():DisplayObject{
return (this._target);
}
public function set target(_arg1:DisplayObject):void{
if (!_arg1){
return;
};
this._target = _arg1;
if (_arg1 != this._lastTarget){
this._lastColorTransformApplied = null;
this._filtersApplied = false;
this._lastBlendModeApplied = null;
this._cacheAsBitmapHasBeenApplied = false;
this._lastMatrixApplied = null;
this._lastMatrix3DApplied = null;
this._toRemove = new Array();
};
this._lastTarget = _arg1;
var _local2:Boolean;
if (((this.targetParent) && (!((this.targetName == ""))))){
if (this.targetStateOriginal){
this.targetState = this.targetStateOriginal;
return;
};
_local2 = true;
};
this.targetState = {};
this.setTargetState();
if (_local2){
this.targetStateOriginal = this.targetState;
};
}
protected function setTargetState():void{
}
public function set initialPosition(_arg1:Array):void{
}
public function get time():int{
return (this._time);
}
public function set time(_arg1:int):void{
var _local3:Array;
var _local6:DisplayObject;
var _local7:int;
var _local8:ColorTransform;
var _local9:Array;
if (_arg1 == this._time){
return;
};
if (this._placeholderName){
_local6 = this._targetParent[this._placeholderName];
if (!_local6){
_local6 = this._targetParent.getChildByName(this._placeholderName);
};
if (((((_local6) && ((_local6.parent == this._targetParent)))) && ((this._target.parent == this._targetParent)))){
this._targetParent.addChildAt(this._target, (this._targetParent.getChildIndex(_local6) + 1));
};
};
var _local2:MotionBase = this.motion;
if (_local2){
if (_arg1 > (_local2.duration - 1)){
_arg1 = (_local2.duration - 1);
} else {
if (_arg1 < 0){
_arg1 = 0;
};
};
this._time = _arg1;
} else {
_local3 = this.motionArray;
if (_arg1 <= this._spanStart){
_local2 = _local3[0];
_arg1 = this._spanStart;
} else {
if (_arg1 >= this._spanEnd){
_local2 = _local3[(_local3.length - 1)];
_arg1 = this._spanEnd;
} else {
_local7 = 0;
while (_local7 < _local3.length) {
_local2 = _local3[_local7];
if (_arg1 <= ((_local2.motion_internal::spanStart + _local2.duration) - 1)){
break;
};
_local7++;
};
};
};
this._time = _arg1;
_arg1 = (_arg1 - _local2.motion_internal::spanStart);
};
this.dispatchEvent(new MotionEvent(MotionEvent.TIME_CHANGE));
var _local4:KeyframeBase = _local2.getCurrentKeyframe(_arg1);
var _local5:Boolean = (((((_local4.index == this._lastRenderedTime)) && (((!(_local3)) || ((this._lastRenderedMotion == _local2)))))) && (!(_local4.tweensLength)));
if (_local5){
return;
};
if (_local4.blank){
this._target.visible = false;
} else {
if (this._isAnimator3D){
this._lastMatrixApplied = null;
this.setTime3D(_arg1, _local2);
} else {
this._lastMatrix3DApplied = null;
this.setTimeClassic(_arg1, _local2, _local4);
};
_local8 = _local2.getColorTransform(_arg1);
if (_local3){
if (((!(_local8)) && (this._lastColorTransformApplied))){
_local8 = new ColorTransform();
};
if (((_local8) && (((!(this._lastColorTransformApplied)) || (!(colorTransformsEqual(_local8, this._lastColorTransformApplied))))))){
this._target.transform.colorTransform = _local8;
this._lastColorTransformApplied = _local8;
};
} else {
if (_local8){
this._target.transform.colorTransform = _local8;
};
};
_local9 = _local2.getFilters(_arg1);
if (((((_local3) && (!(_local9)))) && (this._filtersApplied))){
this._target.filters = null;
this._filtersApplied = false;
} else {
if (_local9){
this._target.filters = _local9;
this._filtersApplied = true;
};
};
if (((!(_local3)) || (!((this._lastBlendModeApplied == _local4.blendMode))))){
this._target.blendMode = _local4.blendMode;
this._lastBlendModeApplied = _local4.blendMode;
};
};
this._lastRenderedTime = _arg1;
this._lastRenderedMotion = _local2;
this.dispatchEvent(new MotionEvent(MotionEvent.MOTION_UPDATE));
}
protected function setTime3D(_arg1:int, _arg2:MotionBase):Boolean{
return (false);
}
protected function setTimeClassic(_arg1:int, _arg2:MotionBase, _arg3:KeyframeBase):Boolean{
return (false);
}
public function get targetParent():DisplayObjectContainer{
return (this._targetParent);
}
public function set targetParent(_arg1:DisplayObjectContainer):void{
this._targetParent = _arg1;
}
public function get targetParentButton():SimpleButton{
return (this._targetParentBtn);
}
public function set targetParentButton(_arg1:SimpleButton){
this._targetParentBtn = _arg1;
}
public function get targetName():String{
return (this._targetName);
}
public function set targetName(_arg1:String):void{
this._targetName = _arg1;
}
public function get placeholderName():String{
return (this._placeholderName);
}
public function set placeholderName(_arg1:String):void{
this._placeholderName = _arg1;
}
public function get instanceFactoryClass():Class{
return (this._instanceFactoryClass);
}
public function set instanceFactoryClass(_arg1:Class):void{
var f = _arg1;
if (f == this._instanceFactoryClass){
return;
};
this._instanceFactoryClass = f;
try {
this.instanceFactory = this._instanceFactoryClass["getSingleton"]();
} catch(e:Error) {
instanceFactory = null;
};
}
public function useCurrentFrame(_arg1:Boolean, _arg2:int):void{
this._useCurrentFrame = _arg1;
if (!this.motionArray){
this._spanStart = _arg2;
};
}
public function get usingCurrentFrame():Boolean{
return (this._useCurrentFrame);
}
public function get spanStart():int{
return (this._spanStart);
}
public function get spanEnd():int{
if (this._spanEnd >= 0){
return (this._spanEnd);
};
if (((this._motion) && ((this._motion.duration > 0)))){
return (((this._spanStart + this._motion.duration) - 1));
};
return (this._spanStart);
}
public function get sceneName():String{
return (this._sceneName);
}
public function set sceneName(_arg1:String):void{
this._sceneName = _arg1;
}
private function handleEnterFrame(_arg1:Event):void{
var _local2:MovieClip;
if (this._registeredParent){
_local2 = (this._targetParent as MovieClip);
if (_local2 == null){
return;
};
if (((((((!(this.usingCurrentFrame)) || (!((_local2.currentFrame == this._lastFrameHandled))))) || (!((_local2.currentScene.name == this._lastSceneHandled))))) || ((((this.target == null)) && (!((this.instanceFactoryClass == null))))))){
processCurrentFrame(_local2, this, false);
};
this.removeChildren();
this._lastFrameHandled = _local2.currentFrame;
this._lastSceneHandled = _local2.currentScene.name;
} else {
this.nextFrame();
};
}
private function removeChildren():void{
var _local2:Object;
var _local3:MovieClip;
var _local1:int;
while (_local1 < this._toRemove.length) {
_local2 = this._toRemove[_local1];
if ((((_local2.target == this._target)) || (!((_local2.target.parent == this._targetParent))))){
this._toRemove.splice(_local1, 1);
} else {
_local3 = MovieClip(this._targetParent);
if ((((_local2.currentFrame == _local3.currentFrame)) && ((((_local3.scenes.length <= 1)) || ((_local2.currentSceneName == _local3.currentScene.name)))))){
_local1++;
} else {
this.removeChildTarget(_local3, _local2.target, _local2.target.name);
this._toRemove.splice(_local1, 1);
};
};
};
}
protected function removeChildTarget(_arg1:MovieClip, _arg2:DisplayObject, _arg3:String):void{
_arg1.removeChild(_arg2);
if (((_arg1.hasOwnProperty(_arg3)) && ((_arg1[_arg3] == _arg2)))){
_arg1[_arg3] = null;
};
this._lastColorTransformApplied = null;
this._filtersApplied = false;
this._lastBlendModeApplied = null;
this._cacheAsBitmapHasBeenApplied = false;
this._lastMatrixApplied = null;
this._lastMatrix3DApplied = null;
}
public function get frameEvent():String{
return (this._frameEvent);
}
public function set frameEvent(_arg1:String):void{
this._frameEvent = _arg1;
}
public function get targetState3D():Array{
return (this._targetState3D);
}
public function set targetState3D(_arg1:Array):void{
this._targetState3D = _arg1;
}
public function nextFrame(_arg1:Boolean=false, _arg2:Boolean=true):void{
if (((((this.motionArray) && ((this.time >= this.spanEnd)))) || (((!(this.motionArray)) && ((this.time >= (this.motion.duration - 1))))))){
this.handleLastFrame(_arg1, _arg2);
} else {
this.time++;
};
}
public function play(_arg1:int=-1, _arg2:Boolean=true):void{
var _local3:DisplayObject;
var _local4:DisplayObject;
var _local5:DisplayObject;
if (!this._isPlaying){
if ((((((this._target == null)) && (this._targetParent))) && (!((this._targetName == ""))))){
_local3 = (this._targetParent.hasOwnProperty(this._targetName)) ? this._targetParent[this._targetName] : this._targetParent.getChildByName(this._targetName);
if ((((this.instanceFactory == null)) || (this.instanceFactory["isTargetForFrame"](_local3, _arg1, this.sceneName)))){
this.target = _local3;
};
if (!this.target){
_local3 = this._targetParent.getChildByName(this._targetName);
if ((((this.instanceFactory == null)) || (this.instanceFactory["isTargetForFrame"](_local3, _arg1, this.sceneName)))){
this.target = _local3;
};
if (((((!(this.target)) && (this._placeholderName))) && (this.instanceFactory))){
_local4 = this.instanceFactory["getInstance"](this._targetParent, this._targetName, _arg1, this.sceneName);
if (_local4){
_local4.name = this._targetName;
this._targetParent[this._targetName] = _local4;
_local5 = this._targetParent[this._placeholderName];
if (!_local5){
_local5 = this._targetParent.getChildByName(this._placeholderName);
};
if (_local5){
this._targetParent.addChildAt(_local4, (this._targetParent.getChildIndex(_local5) + 1));
} else {
this._targetParent.addChild(_local4);
};
this.target = _local4;
};
};
};
};
if (_arg2){
enterFrameBeacon.addEventListener(this.frameEvent, this.handleEnterFrame, false, 0, true);
};
if (!this.target){
return;
};
this._isPlaying = true;
};
this.playCount = 0;
if (_arg1 > -1){
this.time = _arg1;
} else {
this.rewind();
};
this.dispatchEvent(new MotionEvent(MotionEvent.MOTION_START));
}
public function end(_arg1:Boolean=false, _arg2:Boolean=true, _arg3:Boolean=false):void{
var _local4:MovieClip;
if (_arg2){
enterFrameBeacon.removeEventListener(this.frameEvent, this.handleEnterFrame);
};
this._isPlaying = false;
this.playCount = 0;
if (this.autoRewind){
this.rewind();
} else {
if (((this.motion) && (!((this.time == (this.motion.duration - 1)))))){
this.time = (this.motion.duration - 1);
} else {
if (((this.motionArray) && (!((this.time == this._spanEnd))))){
this.time = this._spanEnd;
};
};
};
if (_arg1){
if (((this._targetParent) && (!((this._targetName == ""))))){
if (((((((this._target) && (this.instanceFactory))) && ((this._targetParent is MovieClip)))) && ((this._targetParent == this._target.parent)))){
if (_arg3){
this.removeChildTarget(MovieClip(this._targetParent), this._target, this._targetName);
} else {
_local4 = MovieClip(this._targetParent);
this._toRemove.push({target:this._target, currentFrame:_local4.currentFrame, currentSceneName:_local4.currentScene.name});
};
};
this._target = null;
};
this._lastRenderedTime = -1;
this._time = -1;
};
this.dispatchEvent(new MotionEvent(MotionEvent.MOTION_END));
}
public function stop():void{
enterFrameBeacon.removeEventListener(this.frameEvent, this.handleEnterFrame);
this._isPlaying = false;
this.playCount = 0;
this.rewind();
this.dispatchEvent(new MotionEvent(MotionEvent.MOTION_END));
}
public function pause():void{
enterFrameBeacon.removeEventListener(this.frameEvent, this.handleEnterFrame);
this._isPlaying = false;
}
public function resume():void{
enterFrameBeacon.addEventListener(this.frameEvent, this.handleEnterFrame, false, 0, true);
this._isPlaying = true;
}
public function startFrameEvents():void{
enterFrameBeacon.addEventListener(this.frameEvent, this.handleEnterFrame, false, 0, true);
}
public function rewind():void{
this.time = (this.motionArray) ? this._spanStart : 0;
}
private function placeholderButtonEnterFrameHandler(_arg1:Event):void{
var _local3:DisplayObjectContainer;
if ((((this._targetParentBtn == null)) || ((this.instanceFactory == null)))){
this._target.removeEventListener(this.frameEvent, this.placeholderButtonEnterFrameHandler);
return;
};
var _local2:DisplayObject = this.instanceFactory["getInstance"](this._targetParentBtn, this._targetName, this._spanStart);
if (_local2 == null){
return;
};
this._target.removeEventListener(this.frameEvent, this.placeholderButtonEnterFrameHandler);
if ((((this._target.parent == null)) || ((DisplayObject(this._target.parent) == this._targetParentBtn)))){
switch (this._spanStart){
case 1:
this._targetParentBtn.overState = _local2;
break;
case 2:
this._targetParentBtn.downState = _local2;
break;
case 3:
this._targetParentBtn.hitTestState = _local2;
break;
default:
this._targetParentBtn.upState = _local2;
break;
};
} else {
_local3 = (this._target.parent as DisplayObjectContainer);
if (_local3 != null){
_local3.addChildAt(_local2, (_local3.getChildIndex(this._target) + 1));
_local3.removeChild(this._target);
};
};
this.target = _local2;
this.time = 0;
}
private function placeholderSpriteEnterFrameHandler(_arg1:Event):void{
if ((((this._targetParent == null)) || ((this.instanceFactory == null)))){
this._target.removeEventListener(this.frameEvent, this.placeholderSpriteEnterFrameHandler);
return;
};
var _local2:DisplayObject = this.instanceFactory["getInstance"](this._targetParent, this._targetName, 0);
if (_local2 == null){
return;
};
_local2.name = this._targetName;
this._targetParent[this._targetName] = _local2;
this._target.removeEventListener(this.frameEvent, this.placeholderSpriteEnterFrameHandler);
this._targetParent[this._placeholderName] = null;
this._targetParent.addChildAt(_local2, (this._targetParent.getChildIndex(this._target) + 1));
this._targetParent.removeChild(this._target);
this.target = _local2;
this.time = 0;
}
private function handleLastFrame(_arg1:Boolean=false, _arg2:Boolean=true):void{
this.playCount++;
if ((((this.repeatCount == 0)) || ((this.playCount < this.repeatCount)))){
this.rewind();
} else {
this.end(_arg1, _arg2, false);
};
}
protected static function colorTransformsEqual(_arg1:ColorTransform, _arg2:ColorTransform):Boolean{
return ((((((((((((((((_arg1.alphaMultiplier == _arg2.alphaMultiplier)) && ((_arg1.alphaOffset == _arg2.alphaOffset)))) && ((_arg1.blueMultiplier == _arg2.blueMultiplier)))) && ((_arg1.blueOffset == _arg2.blueOffset)))) && ((_arg1.greenMultiplier == _arg2.greenMultiplier)))) && ((_arg1.greenOffset == _arg2.greenOffset)))) && ((_arg1.redMultiplier == _arg2.redMultiplier)))) && ((_arg1.redOffset == _arg2.redOffset))));
}
public static function registerParentFrameHandler(_arg1:MovieClip, _arg2:AnimatorBase, _arg3:int, _arg4:int=0, _arg5:Boolean=false):void{
_arg2._registeredParent = true;
if (_arg3 == -1){
_arg3 = (_arg1.currentFrame - 1);
};
if (_arg5){
_arg2.useCurrentFrame(true, _arg3);
} else {
_arg2.repeatCount = _arg4;
};
}
public static function processCurrentFrame(_arg1:MovieClip, _arg2:AnimatorBase, _arg3:Boolean, _arg4:Boolean=false):void{
var _local5:int;
var _local6:int;
if (((_arg2) && (_arg1))){
if (_arg2.usingCurrentFrame){
_local5 = (_arg1.currentFrame - 1);
if (_arg1.scenes.length > 1){
if (_arg1.currentScene.name != _arg2.sceneName){
_local5 = -1;
};
};
if ((((_local5 >= _arg2.spanStart)) && ((_local5 <= _arg2.spanEnd)))){
_local6 = (_arg2.motionArray) ? _local5 : (_local5 - _arg2.spanStart);
if (!_arg2.isPlaying){
_arg2.play(_local6, _arg3);
} else {
if (!_arg4){
if (_local5 == _arg2.spanEnd){
_arg2.handleLastFrame(true, false);
} else {
_arg2.time = _local6;
};
};
};
} else {
if (((_arg2.isPlaying) && (!(_arg4)))){
_arg2.end(true, false, true);
} else {
if (((!(_arg2.isPlaying)) && (_arg4))){
_arg2.startFrameEvents();
};
};
};
} else {
if (((_arg2.targetParent) && (((((_arg2.targetParent.hasOwnProperty(_arg2.targetName)) && ((_arg2.targetParent[_arg2.targetName] == null)))) || ((_arg2.targetParent.getChildByName(_arg2.targetName) == null)))))){
if (_arg2.isPlaying){
_arg2.end(true, false);
} else {
if (_arg4){
_arg2.startFrameEvents();
};
};
} else {
if (!_arg2.isPlaying){
if (_arg4){
_arg2.play(0, _arg3);
};
} else {
if (!_arg4){
_arg2.nextFrame(false, false);
};
};
};
};
};
}
public static function registerButtonState(_arg1:SimpleButton, _arg2:AnimatorBase, _arg3:int, _arg4:int=-1, _arg5:String=null, _arg6:String=null, _arg7:Class=null):void{
var newTarget:DisplayObject;
var container:DisplayObjectContainer;
var targetParentBtn = _arg1;
var anim = _arg2;
var stateFrame = _arg3;
var zIndex = _arg4;
var targetName = _arg5;
var placeholderName = _arg6;
var instanceFactoryClass = _arg7;
var target:DisplayObject = targetParentBtn.upState;
switch (stateFrame){
case 1:
target = targetParentBtn.overState;
break;
case 2:
target = targetParentBtn.downState;
break;
case 3:
target = targetParentBtn.hitTestState;
break;
};
if (!target){
return;
};
if (zIndex >= 0){
try {
container = DisplayObjectContainer(target);
newTarget = container.getChildAt(zIndex);
} catch(e:Error) {
newTarget = null;
};
if (newTarget != null){
target = newTarget;
};
};
anim.target = target;
if (((!((placeholderName == null))) && (!((instanceFactoryClass == null))))){
anim.targetParentButton = targetParentBtn;
anim.targetName = targetName;
anim.instanceFactoryClass = instanceFactoryClass;
anim.useCurrentFrame(true, stateFrame);
anim.target.addEventListener(anim.frameEvent, anim.placeholderButtonEnterFrameHandler, false, 0, true);
anim.placeholderButtonEnterFrameHandler(null);
} else {
anim.time = 0;
};
}
public static function registerSpriteParent(_arg1:Sprite, _arg2:AnimatorBase, _arg3:String, _arg4:String=null, _arg5:Class=null):void{
var _local6:DisplayObject;
if ((((((_arg1 == null)) || ((_arg2 == null)))) || ((_arg3 == null)))){
return;
};
if (((!((_arg4 == null))) && (!((_arg5 == null))))){
_local6 = _arg1[_arg4];
if (_local6 == null){
_local6 = _arg1.getChildByName(_arg4);
};
_arg2.target = _local6;
_arg2.targetParent = _arg1;
_arg2.targetName = _arg3;
_arg2.placeholderName = _arg4;
_arg2.instanceFactoryClass = _arg5;
_arg2.useCurrentFrame(true, 0);
_arg2.target.addEventListener(_arg2.frameEvent, _arg2.placeholderSpriteEnterFrameHandler, false, 0, true);
_arg2.placeholderSpriteEnterFrameHandler(null);
} else {
_local6 = _arg1[_arg3];
if (_local6 == null){
_local6 = _arg1.getChildByName(_arg3);
};
_arg2.target = _local6;
_arg2.time = 0;
};
}
}
}//package fl.motion
Section 14
//BezierEase (fl.motion.BezierEase)
package fl.motion {
import flash.geom.*;
public class BezierEase implements ITween {
public var points:Array;
private var firstNode:Point;
private var lastNode:Point;
private var _target:String;// = ""
public function BezierEase(_arg1:XML=null){
this.points = [];
this.parseXML(_arg1);
}
public function get target():String{
return (this._target);
}
public function set target(_arg1:String):void{
this._target = _arg1;
}
private function parseXML(_arg1:XML=null):BezierEase{
var _local3:XML;
if (!_arg1){
return (this);
};
if (_arg1.@target.length()){
this.target = _arg1.@target;
};
var _local2:XMLList = _arg1.elements();
for each (_local3 in _local2) {
this.points.push(new Point(Number(_local3.@x), Number(_local3.@y)));
};
return (this);
}
public function getValue(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg4 <= 0){
return (NaN);
};
var _local5:Number = (_arg1 / _arg4);
if (_local5 <= 0){
return (_arg2);
};
if (_local5 >= 1){
return ((_arg2 + _arg3));
};
this.firstNode = new Point(0, _arg2);
this.lastNode = new Point(1, (_arg2 + _arg3));
var _local6:Array = [this.firstNode].concat(this.points);
_local6.push(this.lastNode);
var _local7:Number = CustomEase.getYForPercent(_local5, _local6);
return (_local7);
}
}
}//package fl.motion
Section 15
//BezierSegment (fl.motion.BezierSegment)
package fl.motion {
import flash.geom.*;
public class BezierSegment {
public var a:Point;
public var b:Point;
public var c:Point;
public var d:Point;
public function BezierSegment(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Point){
this.a = _arg1;
this.b = _arg2;
this.c = _arg3;
this.d = _arg4;
}
public function getValue(_arg1:Number):Point{
var _local2:Number = this.a.x;
var _local3:Number = (((((_arg1 * _arg1) * (this.d.x - _local2)) + ((3 * (1 - _arg1)) * ((_arg1 * (this.c.x - _local2)) + ((1 - _arg1) * (this.b.x - _local2))))) * _arg1) + _local2);
var _local4:Number = this.a.y;
var _local5:Number = (((((_arg1 * _arg1) * (this.d.y - _local4)) + ((3 * (1 - _arg1)) * ((_arg1 * (this.c.y - _local4)) + ((1 - _arg1) * (this.b.y - _local4))))) * _arg1) + _local4);
return (new Point(_local3, _local5));
}
public function getYForX(_arg1:Number, _arg2:Array=null):Number{
var _local6:Number;
if (this.a.x < this.d.x){
if (_arg1 <= (this.a.x + 1E-16)){
return (this.a.y);
};
if (_arg1 >= (this.d.x - 1E-16)){
return (this.d.y);
};
} else {
if (_arg1 >= (this.a.x + 1E-16)){
return (this.a.y);
};
if (_arg1 <= (this.d.x - 1E-16)){
return (this.d.y);
};
};
if (!_arg2){
_arg2 = getCubicCoefficients(this.a.x, this.b.x, this.c.x, this.d.x);
};
var _local3:Array = getCubicRoots(_arg2[0], _arg2[1], _arg2[2], (_arg2[3] - _arg1));
var _local4:Number = NaN;
if (_local3.length == 0){
_local4 = 0;
} else {
if (_local3.length == 1){
_local4 = _local3[0];
} else {
for each (_local6 in _local3) {
if ((((0 <= _local6)) && ((_local6 <= 1)))){
_local4 = _local6;
break;
};
};
};
};
if (isNaN(_local4)){
return (NaN);
};
var _local5:Number = getSingleValue(_local4, this.a.y, this.b.y, this.c.y, this.d.y);
return (_local5);
}
public static function getSingleValue(_arg1:Number, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0):Number{
return ((((((_arg1 * _arg1) * (_arg5 - _arg2)) + ((3 * (1 - _arg1)) * ((_arg1 * (_arg4 - _arg2)) + ((1 - _arg1) * (_arg3 - _arg2))))) * _arg1) + _arg2));
}
public static function getCubicCoefficients(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Array{
return ([(((-(_arg1) + (3 * _arg2)) - (3 * _arg3)) + _arg4), (((3 * _arg1) - (6 * _arg2)) + (3 * _arg3)), ((-3 * _arg1) + (3 * _arg2)), _arg1]);
}
public static function getCubicRoots(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0):Array{
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:int;
var _local16:Number;
if (!_arg1){
return (BezierSegment.getQuadraticRoots(_arg2, _arg3, _arg4));
};
if (_arg1 != 1){
_arg2 = (_arg2 / _arg1);
_arg3 = (_arg3 / _arg1);
_arg4 = (_arg4 / _arg1);
};
var _local5:Number = (((_arg2 * _arg2) - (3 * _arg3)) / 9);
var _local6:Number = (((((_arg2 * _arg2) - (3 * _arg3)) / 9) * _local5) * _local5);
var _local7:Number = ((((((2 * _arg2) * _arg2) * _arg2) - ((9 * _arg2) * _arg3)) + (27 * _arg4)) / 54);
var _local8:Number = (_local6 - (_local7 * _local7));
if (_local8 >= 0){
if (!_local5){
return ([0]);
};
_local9 = Math.acos((_local7 / Math.sqrt(_local6)));
_local10 = Math.sqrt(_local5);
_local11 = (((-2 * _local10) * Math.cos((_local9 / 3))) - (_arg2 / 3));
_local12 = (((-2 * _local10) * Math.cos(((_local9 + (2 * Math.PI)) / 3))) - (_arg2 / 3));
_local13 = (((-2 * _local10) * Math.cos(((_local9 + (4 * Math.PI)) / 3))) - (_arg2 / 3));
return ([_local11, _local12, _local13]);
//unresolved jump
};
_local14 = Math.pow((Math.sqrt(-(_local8)) + Math.abs(_local7)), (1 / 3));
_local15 = ((_local7)>0) ? 1 : ((_local7 < 0)) ? -1 : 0;
_local16 = ((-(_local15) * (_local14 + (_local5 / _local14))) - (_arg2 / 3));
return ([_local16]);
}
public static function getQuadraticRoots(_arg1:Number, _arg2:Number, _arg3:Number):Array{
var _local7:Number;
var _local4:Array = [];
if (!_arg1){
if (!_arg2){
return ([]);
};
_local4[0] = (-(_arg3) / _arg2);
return (_local4);
};
var _local5:Number = ((_arg2 * _arg2) - ((4 * _arg1) * _arg3));
var _local6:int = ((_local5)>0) ? 1 : ((_local5 < 0)) ? -1 : 0;
if (_local6 < 0){
return ([]);
};
if (!_local6){
_local4[0] = (-(_arg2) / (2 * _arg1));
} else {
_local4[0] = (_local4[1] = (-(_arg2) / (2 * _arg1)));
_local7 = (Math.sqrt(_local5) / (2 * _arg1));
_local4[0] = (_local4[0] - _local7);
_local4[1] = (_local4[1] + _local7);
};
return (_local4);
}
}
}//package fl.motion
Section 16
//Color (fl.motion.Color)
package fl.motion {
import flash.display.*;
import flash.geom.*;
public class Color extends ColorTransform {
private var _tintColor:Number;// = 0
private var _tintMultiplier:Number;// = 0
public function Color(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
public function get brightness():Number{
return ((this.redOffset) ? (1 - this.redMultiplier) : (this.redMultiplier - 1));
}
public function set brightness(_arg1:Number):void{
if (_arg1 > 1){
_arg1 = 1;
} else {
if (_arg1 < -1){
_arg1 = -1;
};
};
var _local2:Number = (1 - Math.abs(_arg1));
var _local3:Number = 0;
if (_arg1 > 0){
_local3 = (_arg1 * 0xFF);
};
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = _local2));
this.redOffset = (this.greenOffset = (this.blueOffset = _local3));
}
public function setTint(_arg1:uint, _arg2:Number):void{
this._tintColor = _arg1;
this._tintMultiplier = _arg2;
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = (1 - _arg2)));
var _local3:uint = ((_arg1 >> 16) & 0xFF);
var _local4:uint = ((_arg1 >> 8) & 0xFF);
var _local5:uint = (_arg1 & 0xFF);
this.redOffset = Math.round((_local3 * _arg2));
this.greenOffset = Math.round((_local4 * _arg2));
this.blueOffset = Math.round((_local5 * _arg2));
}
public function get tintColor():uint{
return (this._tintColor);
}
public function set tintColor(_arg1:uint):void{
this.setTint(_arg1, this.tintMultiplier);
}
private function deriveTintColor():uint{
var _local1:Number = (1 / this.tintMultiplier);
var _local2:uint = Math.round((this.redOffset * _local1));
var _local3:uint = Math.round((this.greenOffset * _local1));
var _local4:uint = Math.round((this.blueOffset * _local1));
var _local5:uint = (((_local2 << 16) | (_local3 << 8)) | _local4);
return (_local5);
}
public function get tintMultiplier():Number{
return (this._tintMultiplier);
}
public function set tintMultiplier(_arg1:Number):void{
this.setTint(this.tintColor, _arg1);
}
private function parseXML(_arg1:XML=null):Color{
var _local3:XML;
var _local4:String;
var _local5:uint;
if (!_arg1){
return (this);
};
var _local2:XML = _arg1.elements()[0];
if (!_local2){
return (this);
};
for each (_local3 in _local2.attributes()) {
_local4 = _local3.localName();
if (_local4 == "tintColor"){
_local5 = (Number(_local3.toString()) as uint);
this.tintColor = _local5;
} else {
this[_local4] = Number(_local3.toString());
};
};
return (this);
}
public static function fromXML(_arg1:XML):Color{
return (Color(new (Color).parseXML(_arg1)));
}
public static function interpolateTransform(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{
var _local4:Number = (1 - _arg3);
var _local5:ColorTransform = new ColorTransform(((_arg1.redMultiplier * _local4) + (_arg2.redMultiplier * _arg3)), ((_arg1.greenMultiplier * _local4) + (_arg2.greenMultiplier * _arg3)), ((_arg1.blueMultiplier * _local4) + (_arg2.blueMultiplier * _arg3)), ((_arg1.alphaMultiplier * _local4) + (_arg2.alphaMultiplier * _arg3)), ((_arg1.redOffset * _local4) + (_arg2.redOffset * _arg3)), ((_arg1.greenOffset * _local4) + (_arg2.greenOffset * _arg3)), ((_arg1.blueOffset * _local4) + (_arg2.blueOffset * _arg3)), ((_arg1.alphaOffset * _local4) + (_arg2.alphaOffset * _arg3)));
return (_local5);
}
public static function interpolateColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number = (1 - _arg3);
var _local5:uint = ((_arg1 >> 24) & 0xFF);
var _local6:uint = ((_arg1 >> 16) & 0xFF);
var _local7:uint = ((_arg1 >> 8) & 0xFF);
var _local8:uint = (_arg1 & 0xFF);
var _local9:uint = ((_arg2 >> 24) & 0xFF);
var _local10:uint = ((_arg2 >> 16) & 0xFF);
var _local11:uint = ((_arg2 >> 8) & 0xFF);
var _local12:uint = (_arg2 & 0xFF);
var _local13:uint = ((_local5 * _local4) + (_local9 * _arg3));
var _local14:uint = ((_local6 * _local4) + (_local10 * _arg3));
var _local15:uint = ((_local7 * _local4) + (_local11 * _arg3));
var _local16:uint = ((_local8 * _local4) + (_local12 * _arg3));
var _local17:uint = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16);
return (_local17);
}
}
}//package fl.motion
Section 17
//ColorMatrix (fl.motion.ColorMatrix)
package fl.motion {
public class ColorMatrix extends DynamicMatrix {
protected static const LUMINANCER:Number = 0.3086;
protected static const LUMINANCEG:Number = 0.6094;
protected static const LUMINANCEB:Number = 0.082;
public function ColorMatrix(){
super(5, 5);
LoadIdentity();
}
public function SetBrightnessMatrix(_arg1:Number):void{
if (!m_matrix){
return;
};
m_matrix[0][4] = _arg1;
m_matrix[1][4] = _arg1;
m_matrix[2][4] = _arg1;
}
public function SetContrastMatrix(_arg1:Number):void{
if (!m_matrix){
return;
};
var _local2:Number = (0.5 * (127 - _arg1));
_arg1 = (_arg1 / 127);
m_matrix[0][0] = _arg1;
m_matrix[1][1] = _arg1;
m_matrix[2][2] = _arg1;
m_matrix[0][4] = _local2;
m_matrix[1][4] = _local2;
m_matrix[2][4] = _local2;
}
public function SetSaturationMatrix(_arg1:Number):void{
if (!m_matrix){
return;
};
var _local2:Number = (1 - _arg1);
var _local3:Number = (_local2 * LUMINANCER);
m_matrix[0][0] = (_local3 + _arg1);
m_matrix[1][0] = _local3;
m_matrix[2][0] = _local3;
_local3 = (_local2 * LUMINANCEG);
m_matrix[0][1] = _local3;
m_matrix[1][1] = (_local3 + _arg1);
m_matrix[2][1] = _local3;
_local3 = (_local2 * LUMINANCEB);
m_matrix[0][2] = _local3;
m_matrix[1][2] = _local3;
m_matrix[2][2] = (_local3 + _arg1);
}
public function SetHueMatrix(_arg1:Number):void{
var _local11:int;
if (!m_matrix){
return;
};
LoadIdentity();
var _local2:DynamicMatrix = new DynamicMatrix(3, 3);
var _local3:DynamicMatrix = new DynamicMatrix(3, 3);
var _local4:DynamicMatrix = new DynamicMatrix(3, 3);
var _local5:Number = Math.cos(_arg1);
var _local6:Number = Math.sin(_arg1);
var _local7:Number = 0.213;
var _local8:Number = 0.715;
var _local9:Number = 0.072;
_local2.SetValue(0, 0, _local7);
_local2.SetValue(1, 0, _local7);
_local2.SetValue(2, 0, _local7);
_local2.SetValue(0, 1, _local8);
_local2.SetValue(1, 1, _local8);
_local2.SetValue(2, 1, _local8);
_local2.SetValue(0, 2, _local9);
_local2.SetValue(1, 2, _local9);
_local2.SetValue(2, 2, _local9);
_local3.SetValue(0, 0, (1 - _local7));
_local3.SetValue(1, 0, -(_local7));
_local3.SetValue(2, 0, -(_local7));
_local3.SetValue(0, 1, -(_local8));
_local3.SetValue(1, 1, (1 - _local8));
_local3.SetValue(2, 1, -(_local8));
_local3.SetValue(0, 2, -(_local9));
_local3.SetValue(1, 2, -(_local9));
_local3.SetValue(2, 2, (1 - _local9));
_local3.MultiplyNumber(_local5);
_local4.SetValue(0, 0, -(_local7));
_local4.SetValue(1, 0, 0.143);
_local4.SetValue(2, 0, -((1 - _local7)));
_local4.SetValue(0, 1, -(_local8));
_local4.SetValue(1, 1, 0.14);
_local4.SetValue(2, 1, _local8);
_local4.SetValue(0, 2, (1 - _local9));
_local4.SetValue(1, 2, -0.283);
_local4.SetValue(2, 2, _local9);
_local4.MultiplyNumber(_local6);
_local2.Add(_local3);
_local2.Add(_local4);
var _local10:int;
while (_local10 < 3) {
_local11 = 0;
while (_local11 < 3) {
m_matrix[_local10][_local11] = _local2.GetValue(_local10, _local11);
_local11++;
};
_local10++;
};
}
public function GetFlatArray():Array{
var _local4:int;
if (!m_matrix){
return (null);
};
var _local1:Array = new Array();
var _local2:int;
var _local3:int;
while (_local3 < 4) {
_local4 = 0;
while (_local4 < 5) {
_local1[_local2] = m_matrix[_local3][_local4];
_local2++;
_local4++;
};
_local3++;
};
return (_local1);
}
}
}//package fl.motion
class XFormData {
public var ox:Number;
public var oy:Number;
public var oz:Number;
private function XFormData(){
}
}
Section 18
//CustomEase (fl.motion.CustomEase)
package fl.motion {
import flash.geom.*;
public class CustomEase implements ITween {
public var points:Array;
private var firstNode:Point;
private var lastNode:Point;
private var _target:String;// = ""
public function CustomEase(_arg1:XML=null){
this.points = [];
this.parseXML(_arg1);
this.firstNode = new Point(0, 0);
this.lastNode = new Point(1, 1);
}
public function get target():String{
return (this._target);
}
public function set target(_arg1:String):void{
this._target = _arg1;
}
private function parseXML(_arg1:XML=null):CustomEase{
var _local3:XML;
if (!_arg1){
return (this);
};
if (_arg1.@target.length()){
this.target = _arg1.@target;
};
var _local2:XMLList = _arg1.elements();
for each (_local3 in _local2) {
this.points.push(new Point(Number(_local3.@x), Number(_local3.@y)));
};
return (this);
}
public function getValue(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg4 <= 0){
return (NaN);
};
var _local5:Number = (_arg1 / _arg4);
if (_local5 <= 0){
return (_arg2);
};
if (_local5 >= 1){
return ((_arg2 + _arg3));
};
var _local6:Array = [this.firstNode].concat(this.points);
_local6.push(this.lastNode);
var _local7:Number = getYForPercent(_local5, _local6);
return ((_arg2 + (_local7 * _arg3)));
}
static function getYForPercent(_arg1:Number, _arg2:Array):Number{
var _local8:int;
var _local9:BezierSegment;
var _local3:BezierSegment = new BezierSegment(_arg2[0], _arg2[1], _arg2[2], _arg2[3]);
var _local4:Array = [_local3];
var _local5 = 3;
while (_local5 < (_arg2.length - 3)) {
_local4.push(new BezierSegment(_arg2[_local5], _arg2[(_local5 + 1)], _arg2[(_local5 + 2)], _arg2[(_local5 + 3)]));
_local5 = (_local5 + 3);
};
var _local6:BezierSegment = _local3;
if (_arg2.length >= 5){
_local8 = 0;
while (_local8 < _local4.length) {
_local9 = _local4[_local8];
if ((((_local9.a.x <= _arg1)) && ((_arg1 <= _local9.d.x)))){
_local6 = _local9;
break;
};
_local8++;
};
};
var _local7:Number = _local6.getYForX(_arg1);
return (_local7);
}
}
}//package fl.motion
Section 19
//DynamicMatrix (fl.motion.DynamicMatrix)
package fl.motion {
public class DynamicMatrix {
protected var m_width:int;
protected var m_height:int;
protected var m_matrix:Array;
public static const MATRIX_ORDER_PREPEND:int = 0;
public static const MATRIX_ORDER_APPEND:int = 1;
public function DynamicMatrix(_arg1:int, _arg2:int){
this.Create(_arg1, _arg2);
}
protected function Create(_arg1:int, _arg2:int):void{
var _local3:int;
var _local4:int;
if ((((_arg1 > 0)) && ((_arg2 > 0)))){
this.m_width = _arg1;
this.m_height = _arg2;
this.m_matrix = new Array(_arg2);
_local3 = 0;
while (_local3 < _arg2) {
this.m_matrix[_local3] = new Array(_arg1);
_local4 = 0;
while (_local4 < _arg2) {
this.m_matrix[_local3][_local4] = 0;
_local4++;
};
_local3++;
};
};
}
protected function Destroy():void{
this.m_matrix = null;
}
public function GetWidth():Number{
return (this.m_width);
}
public function GetHeight():Number{
return (this.m_height);
}
public function GetValue(_arg1:int, _arg2:int):Number{
var _local3:Number = 0;
if ((((((((_arg1 >= 0)) && ((_arg1 < this.m_height)))) && ((_arg2 >= 0)))) && ((_arg2 <= this.m_width)))){
_local3 = this.m_matrix[_arg1][_arg2];
};
return (_local3);
}
public function SetValue(_arg1:int, _arg2:int, _arg3:Number):void{
if ((((((((_arg1 >= 0)) && ((_arg1 < this.m_height)))) && ((_arg2 >= 0)))) && ((_arg2 <= this.m_width)))){
this.m_matrix[_arg1][_arg2] = _arg3;
};
}
public function LoadIdentity():void{
var _local1:int;
var _local2:int;
if (this.m_matrix){
_local1 = 0;
while (_local1 < this.m_height) {
_local2 = 0;
while (_local2 < this.m_width) {
if (_local1 == _local2){
this.m_matrix[_local1][_local2] = 1;
} else {
this.m_matrix[_local1][_local2] = 0;
};
_local2++;
};
_local1++;
};
};
}
public function LoadZeros():void{
var _local1:int;
var _local2:int;
if (this.m_matrix){
_local1 = 0;
while (_local1 < this.m_height) {
_local2 = 0;
while (_local2 < this.m_width) {
this.m_matrix[_local1][_local2] = 0;
_local2++;
};
_local1++;
};
};
}
public function Multiply(_arg1:DynamicMatrix, _arg2:int=0):Boolean{
var _local5:DynamicMatrix;
var _local6:int;
var _local7:int;
var _local8:Number;
var _local9:int;
var _local10:int;
if (((!(this.m_matrix)) || (!(_arg1)))){
return (false);
};
var _local3:int = _arg1.GetHeight();
var _local4:int = _arg1.GetWidth();
if (_arg2 == MATRIX_ORDER_APPEND){
if (this.m_width != _local3){
return (false);
};
_local5 = new DynamicMatrix(_local4, this.m_height);
_local6 = 0;
while (_local6 < this.m_height) {
_local7 = 0;
while (_local7 < _local4) {
_local8 = 0;
_local9 = 0;
_local10 = 0;
while ((((_local9 < Math.max(this.m_height, _local3))) && ((_local10 < Math.max(this.m_width, _local4))))) {
_local8 = (_local8 + (_arg1.GetValue(_local9, _local7) * this.m_matrix[_local6][_local10]));
_local9++;
_local10++;
};
_local5.SetValue(_local6, _local7, _local8);
_local7++;
};
_local6++;
};
this.Destroy();
this.Create(_local4, this.m_height);
_local6 = 0;
while (_local6 < _local3) {
_local7 = 0;
while (_local7 < this.m_width) {
this.m_matrix[_local6][_local7] = _local5.GetValue(_local6, _local7);
_local7++;
};
_local6++;
};
} else {
if (this.m_height != _local4){
return (false);
};
_local5 = new DynamicMatrix(this.m_width, _local3);
_local6 = 0;
while (_local6 < _local3) {
_local7 = 0;
while (_local7 < this.m_width) {
_local8 = 0;
_local9 = 0;
_local10 = 0;
while ((((_local9 < Math.max(_local3, this.m_height))) && ((_local10 < Math.max(_local4, this.m_width))))) {
_local8 = (_local8 + (this.m_matrix[_local9][_local7] * _arg1.GetValue(_local6, _local10)));
_local9++;
_local10++;
};
_local5.SetValue(_local6, _local7, _local8);
_local7++;
};
_local6++;
};
this.Destroy();
this.Create(this.m_width, _local3);
_local6 = 0;
while (_local6 < _local3) {
_local7 = 0;
while (_local7 < this.m_width) {
this.m_matrix[_local6][_local7] = _local5.GetValue(_local6, _local7);
_local7++;
};
_local6++;
};
};
return (true);
}
public function MultiplyNumber(_arg1:Number):Boolean{
var _local3:int;
var _local4:Number;
if (!this.m_matrix){
return (false);
};
var _local2:int;
while (_local2 < this.m_height) {
_local3 = 0;
while (_local3 < this.m_width) {
_local4 = 0;
_local4 = (this.m_matrix[_local2][_local3] * _arg1);
this.m_matrix[_local2][_local3] = _local4;
_local3++;
};
_local2++;
};
return (true);
}
public function Add(_arg1:DynamicMatrix):Boolean{
var _local5:int;
var _local6:Number;
if (((!(this.m_matrix)) || (!(_arg1)))){
return (false);
};
var _local2:int = _arg1.GetHeight();
var _local3:int = _arg1.GetWidth();
if (((!((this.m_width == _local3))) || (!((this.m_height == _local2))))){
return (false);
};
var _local4:int;
while (_local4 < this.m_height) {
_local5 = 0;
while (_local5 < this.m_width) {
_local6 = 0;
_local6 = (this.m_matrix[_local4][_local5] + _arg1.GetValue(_local4, _local5));
this.m_matrix[_local4][_local5] = _local6;
_local5++;
};
_local4++;
};
return (true);
}
}
}//package fl.motion
Section 20
//FunctionEase (fl.motion.FunctionEase)
package fl.motion {
import flash.utils.*;
public class FunctionEase implements ITween {
private var _functionName:String;// = ""
public var easingFunction:Function;// = null
public var parameters:Array;// = null
private var _target:String;// = ""
public function FunctionEase(_arg1:XML=null){
this.parseXML(_arg1);
}
public function get functionName():String{
return (this._functionName);
}
public function set functionName(_arg1:String):void{
var _local2:Array = _arg1.split(".");
var _local3:String = _local2.pop();
var _local4:String = _local2.join(".");
var _local5:Class = (getDefinitionByName(_local4) as Class);
if ((_local5[_local3] is Function)){
this.easingFunction = _local5[_local3];
this._functionName = _arg1;
};
}
public function get target():String{
return (this._target);
}
public function set target(_arg1:String):void{
this._target = _arg1;
}
private function parseXML(_arg1:XML=null):FunctionEase{
if (!_arg1){
return (this);
};
if (_arg1.@functionName.length()){
this.functionName = _arg1.@functionName;
};
if (_arg1.@target.length()){
this.target = _arg1.@target;
};
return (this);
}
public function getValue(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Array;
if ((this.parameters is Array)){
_local5 = [_arg1, _arg2, _arg3, _arg4].concat(this.parameters);
return (this.easingFunction.apply(null, _local5));
};
return (this.easingFunction(_arg1, _arg2, _arg3, _arg4));
}
}
}//package fl.motion
Section 21
//ITween (fl.motion.ITween)
package fl.motion {
public interface ITween {
function get target():String;
function set target(_arg1:String):void;
function getValue(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number;
}
}//package fl.motion
Section 22
//Keyframe (fl.motion.Keyframe)
package fl.motion {
import flash.filters.*;
import flash.utils.*;
public class Keyframe extends KeyframeBase {
public var tweens:Array;
public var tweenScale:Boolean;// = true
public var tweenSnap:Boolean;// = false
public var tweenSync:Boolean;// = false
public function Keyframe(_arg1:XML=null){
super(_arg1);
this.tweens = [];
this.parseXML(_arg1);
}
private function parseXML(_arg1:XML=null):KeyframeBase{
var tweenableName:String;
var elements:XMLList;
var filtersArray:Array;
var child:XML;
var attribute:XML;
var attributeValue:String;
var name:String;
var tweenChildren:XMLList;
var tweenChild:XML;
var tweenName:String;
var filtersChildren:XMLList;
var filterXML:XML;
var filterName:String;
var filterClassName:String;
var filterClass:Object;
var filterInstance:BitmapFilter;
var filterTypeInfo:XML;
var accessorList:XMLList;
var ratios:Array;
var attrib:XML;
var attribName:String;
var accessor:XML;
var attribType:String;
var attribValue:String;
var uintValue:uint;
var valuesArray:Array;
var xml = _arg1;
if (!xml){
return (this);
};
var indexString:String = xml.@index.toXMLString();
var indexValue:int = parseInt(indexString);
if (indexString){
this.index = indexValue;
} else {
throw (new Error("<Keyframe> is missing the required attribute \"index\"."));
};
if (xml.@label.length()){
this.label = xml.@label;
};
if (xml.@tweenScale.length()){
this.tweenScale = (xml.@tweenScale.toString() == "true");
};
if (xml.@tweenSnap.length()){
this.tweenSnap = (xml.@tweenSnap.toString() == "true");
};
if (xml.@tweenSync.length()){
this.tweenSync = (xml.@tweenSync.toString() == "true");
};
if (xml.@blendMode.length()){
this.blendMode = xml.@blendMode;
};
if (xml.@cacheAsBitmap.length()){
this.cacheAsBitmap = (xml.@cacheAsBitmap.toString() == "true");
};
if (xml.@rotateDirection.length()){
this.rotateDirection = xml.@rotateDirection;
};
if (xml.@rotateTimes.length()){
this.rotateTimes = parseInt(xml.@rotateTimes);
};
if (xml.@orientToPath.length()){
this.orientToPath = (xml.@orientToPath.toString() == "true");
};
if (xml.@blank.length()){
this.blank = (xml.@blank.toString() == "true");
};
var tweenableNames:Array = ["x", "y", "scaleX", "scaleY", "rotation", "skewX", "skewY"];
for each (tweenableName in tweenableNames) {
attribute = xml.attribute(tweenableName)[0];
if (!attribute){
} else {
attributeValue = attribute.toString();
if (attributeValue){
this[tweenableName] = Number(attributeValue);
};
};
};
elements = xml.elements();
filtersArray = [];
for each (child in elements) {
name = child.localName();
if (name == "tweens"){
tweenChildren = child.elements();
for each (tweenChild in tweenChildren) {
tweenName = tweenChild.localName();
if (tweenName == "SimpleEase"){
this.tweens.push(new SimpleEase(tweenChild));
} else {
if (tweenName == "CustomEase"){
this.tweens.push(new CustomEase(tweenChild));
} else {
if (tweenName == "BezierEase"){
this.tweens.push(new BezierEase(tweenChild));
} else {
if (tweenName == "FunctionEase"){
this.tweens.push(new FunctionEase(tweenChild));
};
};
};
};
};
} else {
if (name == "filters"){
filtersChildren = child.elements();
for each (filterXML in filtersChildren) {
filterName = filterXML.localName();
filterClassName = ("flash.filters." + filterName);
if (filterName == "AdjustColorFilter"){
} else {
filterClass = getDefinitionByName(filterClassName);
filterInstance = new (filterClass);
filterTypeInfo = describeType(filterInstance);
accessorList = filterTypeInfo.accessor;
ratios = [];
for each (attrib in filterXML.attributes()) {
attribName = attrib.localName();
accessor = accessorList.(@name == attribName)[0];
attribType = accessor.@type;
attribValue = attrib.toString();
if (attribType == "int"){
filterInstance[attribName] = parseInt(attribValue);
} else {
if (attribType == "uint"){
filterInstance[attribName] = (parseInt(attribValue) as uint);
uintValue = (parseInt(attribValue) as uint);
} else {
if (attribType == "Number"){
filterInstance[attribName] = Number(attribValue);
} else {
if (attribType == "Boolean"){
filterInstance[attribName] = (attribValue == "true");
} else {
if (attribType == "Array"){
attribValue = attribValue.substring(1, (attribValue.length - 1));
valuesArray = null;
if ((((attribName == "ratios")) || ((attribName == "colors")))){
valuesArray = splitUint(attribValue);
} else {
if (attribName == "alphas"){
valuesArray = splitNumber(attribValue);
};
};
if (attribName == "ratios"){
ratios = valuesArray;
} else {
if (valuesArray){
filterInstance[attribName] = valuesArray;
};
};
} else {
if (attribType == "String"){
filterInstance[attribName] = attribValue;
};
};
};
};
};
};
};
if (ratios.length){
filterInstance["ratios"] = ratios;
};
filtersArray.push(filterInstance);
};
};
} else {
if (name == "color"){
this.color = Color.fromXML(child);
};
};
};
this.filters = filtersArray;
};
return (this);
}
public function getTween(_arg1:String=""):ITween{
var _local2:ITween;
for each (_local2 in this.tweens) {
if ((((((((_local2.target == _arg1)) || ((((_local2.target == "rotation")) && ((((_arg1 == "skewX")) || ((_arg1 == "skewY")))))))) || ((((_local2.target == "position")) && ((((_arg1 == "x")) || ((_arg1 == "y")))))))) || ((((_local2.target == "scale")) && ((((_arg1 == "scaleX")) || ((_arg1 == "scaleY")))))))){
return (_local2);
};
};
return (null);
}
override protected function hasTween():Boolean{
return (!((this.getTween() == null)));
}
override public function get tweensLength():int{
return (this.tweens.length);
}
private static function splitNumber(_arg1:String):Array{
var _local2:Array = _arg1.split(",");
var _local3:int;
while (_local3 < _local2.length) {
_local2[_local3] = Number(_local2[_local3]);
_local3++;
};
return (_local2);
}
private static function splitUint(_arg1:String):Array{
var _local2:Array = _arg1.split(",");
var _local3:int;
while (_local3 < _local2.length) {
_local2[_local3] = (parseInt(_local2[_local3]) as uint);
_local3++;
};
return (_local2);
}
private static function splitInt(_arg1:String):Array{
var _local2:Array = _arg1.split(",");
var _local3:int;
while (_local3 < _local2.length) {
_local2[_local3] = (parseInt(_local2[_local3]) as int);
_local3++;
};
return (_local2);
}
}
}//package fl.motion
Section 23
//KeyframeBase (fl.motion.KeyframeBase)
package fl.motion {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
public class KeyframeBase {
private var _index:int;// = -1
public var x:Number;// = NAN
public var y:Number;// = NAN
public var scaleX:Number;// = NAN
public var scaleY:Number;// = NAN
public var skewX:Number;// = NAN
public var skewY:Number;// = NAN
public var rotationConcat:Number;// = NAN
public var useRotationConcat:Boolean;// = false
public var filters:Array;
public var color:Color;
public var label:String;// = ""
public var loop:String;
public var firstFrame:String;
public var cacheAsBitmap:Boolean;// = false
public var blendMode:String;
public var rotateDirection:String;// = "auto"
public var rotateTimes:uint;// = 0
public var orientToPath:Boolean;// = false
public var blank:Boolean;// = false
public var matrix3D:Object;// = null
public var matrix:Matrix;// = null
public var z:Number;// = NAN
public var rotationX:Number;// = NAN
public var rotationY:Number;// = NAN
public var adjustColorObjects:Dictionary;// = null
public function KeyframeBase(_arg1:XML=null){
this.blendMode = BlendMode.NORMAL;
super();
this.filters = [];
this.adjustColorObjects = new Dictionary();
}
public function get index():int{
return (this._index);
}
public function set index(_arg1:int):void{
this._index = ((_arg1)<0) ? 0 : _arg1;
if (this._index == 0){
this.setDefaults();
};
}
public function get rotation():Number{
return (this.skewY);
}
public function set rotation(_arg1:Number):void{
if (((isNaN(this.skewX)) || (isNaN(this.skewY)))){
this.skewX = _arg1;
} else {
this.skewX = (this.skewX + (_arg1 - this.skewY));
};
this.skewY = _arg1;
}
private function setDefaults():void{
if (isNaN(this.x)){
this.x = 0;
};
if (isNaN(this.y)){
this.y = 0;
};
if (isNaN(this.z)){
this.z = 0;
};
if (isNaN(this.scaleX)){
this.scaleX = 1;
};
if (isNaN(this.scaleY)){
this.scaleY = 1;
};
if (isNaN(this.skewX)){
this.skewX = 0;
};
if (isNaN(this.skewY)){
this.skewY = 0;
};
if (isNaN(this.rotationConcat)){
this.rotationConcat = 0;
};
if (!this.color){
this.color = new Color();
};
}
public function getValue(_arg1:String):Number{
return (Number(this[_arg1]));
}
public function setValue(_arg1:String, _arg2:Number):void{
this[_arg1] = _arg2;
}
protected function hasTween():Boolean{
return (false);
}
public function affectsTweenable(_arg1:String=""):Boolean{
return (((((((((((((((!(_arg1)) || (!(isNaN(this[_arg1]))))) || ((((_arg1 == "color")) && (this.color))))) || ((((_arg1 == "filters")) && (this.filters.length))))) || ((((_arg1 == "matrix3D")) && (this.matrix3D))))) || ((((_arg1 == "matrix")) && (this.matrix))))) || (this.blank))) || (this.hasTween())));
}
public function setAdjustColorProperty(_arg1:int, _arg2:String, _arg3):void{
var _local5:ColorMatrixFilter;
var _local6:Array;
if (_arg1 >= this.filters.length){
return;
};
var _local4:AdjustColor = this.adjustColorObjects[_arg1];
if (_local4 == null){
_local4 = new AdjustColor();
this.adjustColorObjects[_arg1] = _local4;
};
switch (_arg2){
case "adjustColorBrightness":
_local4.brightness = _arg3;
break;
case "adjustColorContrast":
_local4.contrast = _arg3;
break;
case "adjustColorSaturation":
_local4.saturation = _arg3;
break;
case "adjustColorHue":
_local4.hue = _arg3;
break;
};
if (_local4.AllValuesAreSet()){
_local5 = (this.filters[_arg1] as ColorMatrixFilter);
if (_local5){
_local6 = _local4.CalculateFinalFlatArray();
if (_local6){
_local5.matrix = _local6;
};
};
};
}
public function get tweensLength():int{
return (0);
}
}
}//package fl.motion
Section 24
//MatrixTransformer (fl.motion.MatrixTransformer)
package fl.motion {
import flash.geom.*;
public class MatrixTransformer {
public static function getScaleX(_arg1:Matrix):Number{
return (Math.sqrt(((_arg1.a * _arg1.a) + (_arg1.b * _arg1.b))));
}
public static function setScaleX(_arg1:Matrix, _arg2:Number):void{
var _local4:Number;
var _local5:Number;
var _local3:Number = getScaleX(_arg1);
if (_local3){
_local4 = (_arg2 / _local3);
_arg1.a = (_arg1.a * _local4);
_arg1.b = (_arg1.b * _local4);
} else {
_local5 = getSkewYRadians(_arg1);
_arg1.a = (Math.cos(_local5) * _arg2);
_arg1.b = (Math.sin(_local5) * _arg2);
};
}
public static function getScaleY(_arg1:Matrix):Number{
return (Math.sqrt(((_arg1.c * _arg1.c) + (_arg1.d * _arg1.d))));
}
public static function setScaleY(_arg1:Matrix, _arg2:Number):void{
var _local4:Number;
var _local5:Number;
var _local3:Number = getScaleY(_arg1);
if (_local3){
_local4 = (_arg2 / _local3);
_arg1.c = (_arg1.c * _local4);
_arg1.d = (_arg1.d * _local4);
} else {
_local5 = getSkewXRadians(_arg1);
_arg1.c = (-(Math.sin(_local5)) * _arg2);
_arg1.d = (Math.cos(_local5) * _arg2);
};
}
public static function getSkewXRadians(_arg1:Matrix):Number{
return (Math.atan2(-(_arg1.c), _arg1.d));
}
public static function setSkewXRadians(_arg1:Matrix, _arg2:Number):void{
var _local3:Number = getScaleY(_arg1);
_arg1.c = (-(_local3) * Math.sin(_arg2));
_arg1.d = (_local3 * Math.cos(_arg2));
}
public static function getSkewYRadians(_arg1:Matrix):Number{
return (Math.atan2(_arg1.b, _arg1.a));
}
public static function setSkewYRadians(_arg1:Matrix, _arg2:Number):void{
var _local3:Number = getScaleX(_arg1);
_arg1.a = (_local3 * Math.cos(_arg2));
_arg1.b = (_local3 * Math.sin(_arg2));
}
public static function getSkewX(_arg1:Matrix):Number{
return ((Math.atan2(-(_arg1.c), _arg1.d) * (180 / Math.PI)));
}
public static function setSkewX(_arg1:Matrix, _arg2:Number):void{
setSkewXRadians(_arg1, (_arg2 * (Math.PI / 180)));
}
public static function getSkewY(_arg1:Matrix):Number{
return ((Math.atan2(_arg1.b, _arg1.a) * (180 / Math.PI)));
}
public static function setSkewY(_arg1:Matrix, _arg2:Number):void{
setSkewYRadians(_arg1, (_arg2 * (Math.PI / 180)));
}
public static function getRotationRadians(_arg1:Matrix):Number{
return (getSkewYRadians(_arg1));
}
public static function setRotationRadians(_arg1:Matrix, _arg2:Number):void{
var _local3:Number = getRotationRadians(_arg1);
var _local4:Number = getSkewXRadians(_arg1);
setSkewXRadians(_arg1, ((_local4 + _arg2) - _local3));
setSkewYRadians(_arg1, _arg2);
}
public static function getRotation(_arg1:Matrix):Number{
return ((getRotationRadians(_arg1) * (180 / Math.PI)));
}
public static function setRotation(_arg1:Matrix, _arg2:Number):void{
setRotationRadians(_arg1, (_arg2 * (Math.PI / 180)));
}
public static function rotateAroundInternalPoint(_arg1:Matrix, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Point = new Point(_arg2, _arg3);
_local5 = _arg1.transformPoint(_local5);
_arg1.tx = (_arg1.tx - _local5.x);
_arg1.ty = (_arg1.ty - _local5.y);
_arg1.rotate((_arg4 * (Math.PI / 180)));
_arg1.tx = (_arg1.tx + _local5.x);
_arg1.ty = (_arg1.ty + _local5.y);
}
public static function rotateAroundExternalPoint(_arg1:Matrix, _arg2:Number, _arg3:Number, _arg4:Number):void{
_arg1.tx = (_arg1.tx - _arg2);
_arg1.ty = (_arg1.ty - _arg3);
_arg1.rotate((_arg4 * (Math.PI / 180)));
_arg1.tx = (_arg1.tx + _arg2);
_arg1.ty = (_arg1.ty + _arg3);
}
public static function matchInternalPointWithExternal(_arg1:Matrix, _arg2:Point, _arg3:Point):void{
var _local4:Point = _arg1.transformPoint(_arg2);
var _local5:Number = (_arg3.x - _local4.x);
var _local6:Number = (_arg3.y - _local4.y);
_arg1.tx = (_arg1.tx + _local5);
_arg1.ty = (_arg1.ty + _local6);
}
}
}//package fl.motion
Section 25
//Motion (fl.motion.Motion)
package fl.motion {
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
public class Motion extends MotionBase {
public var source:Source;
private var _keyframesCompact:Array;
private static var typeCache:Object = {};
public function Motion(_arg1:XML=null){
var _local2:Keyframe;
super();
this.keyframes = [];
this.parseXML(_arg1);
if (!this.source){
this.source = new Source();
};
if (this.duration == 0){
_local2 = (this.getNewKeyframe() as Keyframe);
_local2.index = 0;
this.addKeyframe(_local2);
};
}
public function get keyframesCompact():Array{
var _local1:KeyframeBase;
this._keyframesCompact = [];
for each (_local1 in this.keyframes) {
if (_local1){
this._keyframesCompact.push(_local1);
};
};
return (this._keyframesCompact);
}
public function set keyframesCompact(_arg1:Array):void{
var _local2:KeyframeBase;
this._keyframesCompact = _arg1.concat();
this.keyframes = [];
for each (_local2 in this._keyframesCompact) {
this.addKeyframe(_local2);
};
}
override public function getColorTransform(_arg1:int):ColorTransform{
var _local7:Keyframe;
var _local8:ColorTransform;
var _local9:Number;
var _local10:Number;
var _local2:ColorTransform;
var _local3:Keyframe = (this.getCurrentKeyframe(_arg1, "color") as Keyframe);
if (((!(_local3)) || (!(_local3.color)))){
return (null);
};
var _local4:ColorTransform = _local3.color;
var _local5:Number = (_arg1 - _local3.index);
var _local6:ITween = ((((_local3.getTween("color")) || (_local3.getTween("alpha")))) || (_local3.getTween()));
if ((((_local5 == 0)) || (!(_local6)))){
_local2 = _local4;
} else {
if (_local6){
_local7 = (this.getNextKeyframe(_arg1, "color") as Keyframe);
if (((!(_local7)) || (!(_local7.color)))){
_local2 = _local4;
} else {
_local8 = _local7.color;
_local9 = (_local7.index - _local3.index);
_local10 = _local6.getValue(_local5, 0, 1, _local9);
_local2 = Color.interpolateTransform(_local4, _local8, _local10);
};
};
};
return (_local2);
}
override public function getFilters(_arg1:Number):Array{
var _local7:Keyframe;
var _local8:Array;
var _local9:Number;
var _local10:Number;
var _local2:Array;
var _local3:Keyframe = (this.getCurrentKeyframe(_arg1, "filters") as Keyframe);
if (((!(_local3)) || (((_local3.filters) && (!(_local3.filters.length)))))){
return ([]);
};
var _local4:Array = _local3.filters;
var _local5:Number = (_arg1 - _local3.index);
var _local6:ITween = ((_local3.getTween("filters")) || (_local3.getTween()));
if ((((_local5 == 0)) || (!(_local6)))){
_local2 = _local4;
} else {
if (_local6){
_local7 = (this.getNextKeyframe(_arg1, "filters") as Keyframe);
if (((!(_local7)) || (!(_local7.filters.length)))){
_local2 = _local4;
} else {
_local8 = _local7.filters;
_local9 = (_local7.index - _local3.index);
_local10 = _local6.getValue(_local5, 0, 1, _local9);
_local2 = interpolateFilters(_local4, _local8, _local10);
};
};
};
return (_local2);
}
override protected function findTweenedValue(_arg1:Number, _arg2:String, _arg3:KeyframeBase, _arg4:Number, _arg5:Number):Number{
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local6:Keyframe = (_arg3 as Keyframe);
if (!_local6){
return (NaN);
};
var _local7:ITween = ((_local6.getTween(_arg2)) || (_local6.getTween()));
if (((((!(_local7)) || (((!(_local6.tweenScale)) && ((((_arg2 == Tweenables.SCALE_X)) || ((_arg2 == Tweenables.SCALE_Y)))))))) || ((((_local6.rotateDirection == RotateDirection.NONE)) && ((((((_arg2 == Tweenables.ROTATION)) || ((_arg2 == Tweenables.SKEW_X)))) || ((_arg2 == Tweenables.SKEW_Y)))))))){
return (_arg5);
};
var _local8:String = _arg2;
if (_local7.target == ""){
_local8 = "";
};
var _local9:Keyframe = (this.getNextKeyframe(_arg1, _local8) as Keyframe);
if (((!(_local9)) || (_local9.blank))){
return (_arg5);
};
_local10 = _local9.getValue(_arg2);
if (isNaN(_local10)){
_local10 = _arg5;
};
_local11 = (_local10 - _arg5);
if ((((((_arg2 == Tweenables.SKEW_X)) || ((_arg2 == Tweenables.SKEW_Y)))) || ((_arg2 == Tweenables.ROTATION)))){
if (_local6.rotateDirection == RotateDirection.AUTO){
_local11 = (_local11 % 360);
if (_local11 > 180){
_local11 = (_local11 - 360);
} else {
if (_local11 < -180){
_local11 = (_local11 + 360);
};
};
} else {
if (_local6.rotateDirection == RotateDirection.CW){
if (_local11 < 0){
_local11 = ((_local11 % 360) + 360);
};
_local11 = (_local11 + (_local6.rotateTimes * 360));
} else {
if (_local11 > 0){
_local11 = ((_local11 % 360) - 360);
};
_local11 = (_local11 - (_local6.rotateTimes * 360));
};
};
};
_local12 = (_local9.index - _local6.index);
return (_local7.getValue(_arg4, _arg5, _local11, _local12));
}
private function parseXML(_arg1:XML):Motion{
var _local4:XML;
var _local5:XML;
if (!_arg1){
return (this);
};
if (_arg1.@duration.length()){
this.duration = parseInt(_arg1.@duration);
};
var _local2:XMLList = _arg1.elements();
var _local3:Number = 0;
while (_local3 < _local2.length()) {
_local4 = _local2[_local3];
if (_local4.localName() == "source"){
_local5 = _local4.children()[0];
this.source = new Source(_local5);
} else {
if (_local4.localName() == "Keyframe"){
this.addKeyframe(this.getNewKeyframe(_local4));
};
};
_local3++;
};
return (this);
}
override protected function getNewKeyframe(_arg1:XML=null):KeyframeBase{
return (new Keyframe(_arg1));
}
public static function fromXMLString(_arg1:String):Motion{
var _local2:XML = new XML(_arg1);
return (new Motion(_local2));
}
public static function interpolateFilters(_arg1:Array, _arg2:Array, _arg3:Number):Array{
var _local6:BitmapFilter;
var _local7:BitmapFilter;
var _local8:BitmapFilter;
if (_arg1.length != _arg2.length){
return (null);
};
var _local4:Array = [];
var _local5:int;
while (_local5 < _arg1.length) {
_local6 = _arg1[_local5];
_local7 = _arg2[_local5];
_local8 = interpolateFilter(_local6, _local7, _arg3);
if (_local8){
_local4.push(_local8);
};
_local5++;
};
return (_local4);
}
public static function interpolateFilter(_arg1:BitmapFilter, _arg2:BitmapFilter, _arg3:Number):BitmapFilter{
var _local8:XML;
var _local9:String;
var _local10:String;
var _local11:uint;
var _local12:uint;
var _local13:uint;
var _local14:Array;
var _local15:Array;
var _local16:Array;
var _local17:int;
var _local18:int;
var _local19:int;
var _local20:int;
var _local21:int;
var _local22:Number;
var _local23:uint;
var _local24:Number;
var _local25:int;
var _local26:Number;
var _local27:uint;
var _local28:Number;
var _local29:int;
var _local30:uint;
var _local31:Number;
if (((!(_arg2)) || (!((_arg1["constructor"] == _arg2["constructor"]))))){
return (_arg1);
};
if (_arg3 > 1){
_arg3 = 1;
} else {
if (_arg3 < 0){
_arg3 = 0;
};
};
var _local4:Number = (1 - _arg3);
var _local5:BitmapFilter = _arg1.clone();
var _local6:XML = getTypeInfo(_arg1);
var _local7:XMLList = _local6.accessor;
for each (_local8 in _local7) {
_local9 = _local8.@name.toString();
_local10 = _local8.@type;
if ((((_local10 == "Number")) || ((_local10 == "int")))){
_local5[_local9] = ((_arg1[_local9] * _local4) + (_arg2[_local9] * _arg3));
} else {
if (_local10 == "uint"){
switch (_local9){
case "color":
case "highlightColor":
case "shadowColor":
_local11 = _arg1[_local9];
_local12 = _arg2[_local9];
_local13 = Color.interpolateColor(_local11, _local12, _arg3);
_local5[_local9] = _local13;
break;
default:
_local5[_local9] = ((_arg1[_local9] * _local4) + (_arg2[_local9] * _arg3));
break;
};
};
};
};
if ((((_arg1 is GradientGlowFilter)) || ((_arg1 is GradientBevelFilter)))){
_local14 = [];
_local15 = [];
_local16 = [];
_local17 = _arg1["ratios"].length;
_local18 = _arg2["ratios"].length;
_local19 = Math.max(_local17, _local18);
_local20 = 0;
while (_local20 < _local19) {
_local21 = Math.min(_local20, (_local17 - 1));
_local22 = _arg1["ratios"][_local21];
_local23 = _arg1["colors"][_local21];
_local24 = _arg1["alphas"][_local21];
_local25 = Math.min(_local20, (_local18 - 1));
_local26 = _arg2["ratios"][_local25];
_local27 = _arg2["colors"][_local25];
_local28 = _arg2["alphas"][_local25];
_local29 = ((_local22 * _local4) + (_local26 * _arg3));
_local30 = Color.interpolateColor(_local23, _local27, _arg3);
_local31 = ((_local24 * _local4) + (_local28 * _arg3));
_local14[_local20] = _local29;
_local15[_local20] = _local30;
_local16[_local20] = _local31;
_local20++;
};
_local5["colors"] = _local15;
_local5["alphas"] = _local16;
_local5["ratios"] = _local14;
};
return (_local5);
}
private static function getTypeInfo(_arg1):XML{
var _local2 = "";
if ((_arg1 is String)){
_local2 = _arg1;
} else {
_local2 = getQualifiedClassName(_arg1);
};
if ((_local2 in typeCache)){
return (typeCache[_local2]);
};
if ((_arg1 is String)){
_arg1 = getDefinitionByName(_arg1);
};
return ((typeCache[_local2] = describeType(_arg1)));
}
}
}//package fl.motion
Section 26
//motion_internal (fl.motion.motion_internal)
package fl.motion {
public namespace motion_internal = "http://www.adobe.com/2009/flash/motion/internal";
}//package fl.motion
Section 27
//MotionBase (fl.motion.MotionBase)
package fl.motion {
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
public class MotionBase {
public var keyframes:Array;
private var _spanStart:int;
private var _transformationPoint:Point;
private var _transformationPointZ:int;
private var _initialPosition:Array;
private var _initialMatrix:Matrix;
private var _duration:int;// = 0
private var _is3D:Boolean;// = false
private var _overrideScale:Boolean;
private var _overrideSkew:Boolean;
private var _overrideRotate:Boolean;
public function MotionBase(_arg1:XML=null){
var _local2:KeyframeBase;
super();
this.keyframes = [];
if (this.duration == 0){
_local2 = this.getNewKeyframe();
_local2.index = 0;
this.addKeyframe(_local2);
};
this._overrideScale = false;
this._overrideSkew = false;
this._overrideRotate = false;
}
motion_internal function set spanStart(_arg1:int):void{
this._spanStart = _arg1;
}
motion_internal function get spanStart():int{
return (this._spanStart);
}
motion_internal function set transformationPoint(_arg1:Point):void{
this._transformationPoint = _arg1;
}
motion_internal function get transformationPoint():Point{
return (this._transformationPoint);
}
motion_internal function set transformationPointZ(_arg1:int):void{
this._transformationPointZ = _arg1;
}
motion_internal function get transformationPointZ():int{
return (this._transformationPointZ);
}
motion_internal function set initialPosition(_arg1:Array):void{
this._initialPosition = _arg1;
}
motion_internal function get initialPosition():Array{
return (this._initialPosition);
}
motion_internal function set initialMatrix(_arg1:Matrix):void{
this._initialMatrix = _arg1;
}
motion_internal function get initialMatrix():Matrix{
return (this._initialMatrix);
}
public function get duration():int{
if (this._duration < this.keyframes.length){
this._duration = this.keyframes.length;
};
return (this._duration);
}
public function set duration(_arg1:int):void{
if (_arg1 < this.keyframes.length){
_arg1 = this.keyframes.length;
};
this._duration = _arg1;
}
public function get is3D():Boolean{
return (this._is3D);
}
public function set is3D(_arg1:Boolean):void{
this._is3D = _arg1;
}
public function overrideTargetTransform(_arg1:Boolean=true, _arg2:Boolean=true, _arg3:Boolean=true):void{
this._overrideScale = _arg1;
this._overrideSkew = _arg2;
this._overrideRotate = _arg3;
}
private function indexOutOfRange(_arg1:int):Boolean{
return (((((isNaN(_arg1)) || ((_arg1 < 0)))) || ((_arg1 > (this.duration - 1)))));
}
public function getCurrentKeyframe(_arg1:int, _arg2:String=""):KeyframeBase{
var _local4:KeyframeBase;
if (((((isNaN(_arg1)) || ((_arg1 < 0)))) || ((_arg1 > (this.duration - 1))))){
return (null);
};
var _local3:int = _arg1;
while (_local3 > 0) {
_local4 = this.keyframes[_local3];
if (((_local4) && (_local4.affectsTweenable(_arg2)))){
return (_local4);
};
_local3--;
};
return (this.keyframes[0]);
}
public function getNextKeyframe(_arg1:int, _arg2:String=""):KeyframeBase{
var _local4:KeyframeBase;
if (((((isNaN(_arg1)) || ((_arg1 < 0)))) || ((_arg1 > (this.duration - 1))))){
return (null);
};
var _local3:int = (_arg1 + 1);
while (_local3 < this.keyframes.length) {
_local4 = this.keyframes[_local3];
if (((_local4) && (_local4.affectsTweenable(_arg2)))){
return (_local4);
};
_local3++;
};
return (null);
}
public function setValue(_arg1:int, _arg2:String, _arg3:Number):void{
if (_arg1 == 0){
return;
};
var _local4:KeyframeBase = this.keyframes[_arg1];
if (!_local4){
_local4 = this.getNewKeyframe();
_local4.index = _arg1;
this.addKeyframe(_local4);
};
_local4.setValue(_arg2, _arg3);
}
public function getColorTransform(_arg1:int):ColorTransform{
var _local2:ColorTransform;
var _local3:KeyframeBase = this.getCurrentKeyframe(_arg1, "color");
if (((!(_local3)) || (!(_local3.color)))){
return (null);
};
var _local4:ColorTransform = _local3.color;
var _local5:Number = (_arg1 - _local3.index);
if (_local5 == 0){
_local2 = _local4;
};
return (_local2);
}
public function getMatrix3D(_arg1:int):Object{
var _local2:KeyframeBase = this.getCurrentKeyframe(_arg1, "matrix3D");
return ((_local2) ? _local2.matrix3D : null);
}
public function getMatrix(_arg1:int):Matrix{
var _local2:KeyframeBase = this.getCurrentKeyframe(_arg1, "matrix");
return ((_local2) ? _local2.matrix : null);
}
public function useRotationConcat(_arg1:int):Boolean{
var _local2:KeyframeBase = this.getCurrentKeyframe(_arg1, "rotationConcat");
return ((_local2) ? _local2.useRotationConcat : false);
}
public function getFilters(_arg1:Number):Array{
var _local2:Array;
var _local3:KeyframeBase = this.getCurrentKeyframe(_arg1, "filters");
if (((!(_local3)) || (((_local3.filters) && (!(_local3.filters.length)))))){
return ([]);
};
var _local4:Array = _local3.filters;
var _local5:Number = (_arg1 - _local3.index);
if (_local5 == 0){
_local2 = _local4;
};
return (_local2);
}
protected function findTweenedValue(_arg1:Number, _arg2:String, _arg3:KeyframeBase, _arg4:Number, _arg5:Number):Number{
return (NaN);
}
public function getValue(_arg1:Number, _arg2:String):Number{
var _local3:Number = NaN;
var _local4:KeyframeBase = this.getCurrentKeyframe(_arg1, _arg2);
if (((!(_local4)) || (_local4.blank))){
return (NaN);
};
var _local5:Number = _local4.getValue(_arg2);
if (((isNaN(_local5)) && ((_local4.index > 0)))){
_local5 = this.getValue((_local4.index - 1), _arg2);
};
if (isNaN(_local5)){
return (NaN);
};
var _local6:Number = (_arg1 - _local4.index);
if (_local6 == 0){
return (_local5);
};
_local3 = this.findTweenedValue(_arg1, _arg2, _local4, _local6, _local5);
return (_local3);
}
public function addKeyframe(_arg1:KeyframeBase):void{
this.keyframes[_arg1.index] = _arg1;
if (this.duration < this.keyframes.length){
this.duration = this.keyframes.length;
};
}
public function addPropertyArray(_arg1:String, _arg2:Array, _arg3:int=-1, _arg4:int=-1):void{
var _local10:KeyframeBase;
var _local11:*;
var _local12:int;
var _local13:*;
var _local5:int = _arg2.length;
var _local6:* = null;
var _local7:Boolean;
var _local8:Number = 0;
if (_local5 > 0){
if ((_arg2[0] is Number)){
_local7 = false;
if ((_arg2[0] is Number)){
_local8 = Number(_arg2[0]);
};
};
};
if (this.duration < _local5){
this.duration = _local5;
};
if ((((_arg3 == -1)) || ((_arg4 == -1)))){
_arg3 = 0;
_arg4 = this.duration;
};
var _local9:int = _arg3;
while (_local9 < _arg4) {
_local10 = KeyframeBase(this.keyframes[_local9]);
if (_local10 == null){
_local10 = this.getNewKeyframe();
_local10.index = _local9;
this.addKeyframe(_local10);
};
if (((_local10.filters) && ((_local10.filters.length == 0)))){
_local10.filters = null;
};
_local11 = _local6;
_local12 = (_local9 - _arg3);
if (_local12 < _arg2.length){
if (((_arg2[_local12]) || (!(_local7)))){
_local11 = _arg2[_local12];
};
};
switch (_arg1){
case "blendMode":
case "matrix3D":
case "matrix":
_local10[_arg1] = _local11;
break;
case "rotationConcat":
_local10.useRotationConcat = true;
if (((!(this._overrideRotate)) && (!(_local7)))){
_local10.setValue(_arg1, (((_local11 - _local8) * Math.PI) / 180));
} else {
_local10.setValue(_arg1, ((_local11 * Math.PI) / 180));
};
break;
case "brightness":
case "tintMultiplier":
case "tintColor":
case "alphaMultiplier":
case "alphaOffset":
case "redMultiplier":
case "redOffset":
case "greenMultiplier":
case "greenOffset":
case "blueMultiplier":
case "blueOffset":
if (_local10.color == null){
_local10.color = new Color();
};
_local10.color[_arg1] = _local11;
break;
case "rotationZ":
_local10.useRotationConcat = true;
this._is3D = true;
if (((!(this._overrideRotate)) && (!(_local7)))){
_local10.setValue("rotationConcat", (_local11 - _local8));
} else {
_local10.setValue("rotationConcat", _local11);
};
break;
case "rotationX":
case "rotationY":
case "z":
this._is3D = true;
default:
_local13 = _local11;
if (!_local7){
switch (_arg1){
case "scaleX":
case "scaleY":
if (!this._overrideScale){
if (_local8 == 0){
_local13 = (_local11 + 1);
} else {
_local13 = (_local11 / _local8);
};
};
break;
case "skewX":
case "skewY":
if (!this._overrideSkew){
_local13 = (_local11 - _local8);
};
break;
case "rotationX":
case "rotationY":
if (!this._overrideRotate){
_local13 = (_local11 - _local8);
};
break;
};
};
_local10.setValue(_arg1, _local13);
break;
};
_local6 = _local11;
_local9++;
};
}
public function initFilters(_arg1:Array, _arg2:Array, _arg3:int=-1, _arg4:int=-1):void{
var _local6:Class;
var _local7:int;
var _local8:KeyframeBase;
var _local9:BitmapFilter;
var _local10:int;
if ((((_arg3 == -1)) || ((_arg4 == -1)))){
_arg3 = 0;
_arg4 = this.duration;
};
var _local5:int;
while (_local5 < _arg1.length) {
_local6 = (getDefinitionByName(_arg1[_local5]) as Class);
_local7 = _arg3;
while (_local7 < _arg4) {
_local8 = KeyframeBase(this.keyframes[_local7]);
if (_local8 == null){
_local8 = this.getNewKeyframe();
_local8.index = _local7;
this.addKeyframe(_local8);
};
if (((_local8) && ((_local8.filters == null)))){
_local8.filters = new Array();
};
if (((_local8) && (_local8.filters))){
_local9 = null;
switch (_arg1[_local5]){
case "flash.filters.GradientBevelFilter":
case "flash.filters.GradientGlowFilter":
_local10 = _arg2[_local5];
_local9 = BitmapFilter(new _local6(4, 45, new Array(_local10), new Array(_local10), new Array(_local10)));
break;
default:
_local9 = BitmapFilter(new (_local6));
break;
};
if (_local9){
_local8.filters.push(_local9);
};
};
_local7++;
};
_local5++;
};
}
public function addFilterPropertyArray(_arg1:int, _arg2:String, _arg3:Array, _arg4:int=-1, _arg5:int=-1):void{
var _local10:KeyframeBase;
var _local11:*;
var _local12:int;
var _local6:int = _arg3.length;
var _local7:* = null;
var _local8:Boolean;
if (_local6 > 0){
if ((_arg3[0] is Number)){
_local8 = false;
};
};
if (this.duration < _local6){
this.duration = _local6;
};
if ((((_arg4 == -1)) || ((_arg5 == -1)))){
_arg4 = 0;
_arg5 = this.duration;
};
var _local9:int = _arg4;
while (_local9 < _arg5) {
_local10 = KeyframeBase(this.keyframes[_local9]);
if (_local10 == null){
_local10 = this.getNewKeyframe();
_local10.index = _local9;
this.addKeyframe(_local10);
};
_local11 = _local7;
_local12 = (_local9 - _arg4);
if (_local12 < _arg3.length){
if (((_arg3[_local12]) || (!(_local8)))){
_local11 = _arg3[_local12];
};
};
switch (_arg2){
case "adjustColorBrightness":
case "adjustColorContrast":
case "adjustColorSaturation":
case "adjustColorHue":
_local10.setAdjustColorProperty(_arg1, _arg2, _local11);
break;
default:
if (_arg1 < _local10.filters.length){
_local10.filters[_arg1][_arg2] = _local11;
};
break;
};
_local7 = _local11;
_local9++;
};
}
protected function getNewKeyframe(_arg1:XML=null):KeyframeBase{
return (new KeyframeBase(_arg1));
}
}
}//package fl.motion
Section 28
//MotionEvent (fl.motion.MotionEvent)
package fl.motion {
import flash.events.*;
public class MotionEvent extends Event {
public static const MOTION_START:String = "motionStart";
public static const MOTION_END:String = "motionEnd";
public static const MOTION_UPDATE:String = "motionUpdate";
public static const TIME_CHANGE:String = "timeChange";
public function MotionEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function clone():Event{
return (new MotionEvent(this.type, this.bubbles, this.cancelable));
}
}
}//package fl.motion
Section 29
//RotateDirection (fl.motion.RotateDirection)
package fl.motion {
public class RotateDirection {
public static const AUTO:String = "auto";
public static const NONE:String = "none";
public static const CW:String = "cw";
public static const CCW:String = "ccw";
}
}//package fl.motion
Section 30
//SimpleEase (fl.motion.SimpleEase)
package fl.motion {
public class SimpleEase implements ITween {
private var _ease:Number;// = 0
private var _target:String;// = ""
public function SimpleEase(_arg1:XML=null){
this.parseXML(_arg1);
}
public function get ease():Number{
return (this._ease);
}
public function set ease(_arg1:Number):void{
this._ease = ((_arg1 > 1)) ? 1 : ((_arg1 < -1)) ? -1 : (isNaN(_arg1)) ? 0 : _arg1;
}
public function get target():String{
return (this._target);
}
public function set target(_arg1:String):void{
this._target = _arg1;
}
private function parseXML(_arg1:XML=null):SimpleEase{
if (_arg1){
if (_arg1.@ease.length()){
this.ease = Number(_arg1.@ease);
};
if (_arg1.@target.length()){
this.target = _arg1.@target;
};
};
return (this);
}
public function getValue(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (easeQuadPercent(_arg1, _arg2, _arg3, _arg4, this.ease));
}
public static function easeQuadPercent(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Number{
if (_arg4 <= 0){
return (NaN);
};
if (_arg1 <= 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 >= 1){
return ((_arg2 + _arg3));
};
if (!_arg5){
return (((_arg3 * _arg1) + _arg2));
};
if (_arg5 > 1){
_arg5 = 1;
} else {
if (_arg5 < -1){
_arg5 = -1;
};
};
if (_arg5 < 0){
return ((((_arg3 * _arg1) * ((_arg1 * -(_arg5)) + (1 + _arg5))) + _arg2));
};
return ((((_arg3 * _arg1) * (((2 - _arg1) * _arg5) + (1 - _arg5))) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg4 <= 0){
return (NaN);
};
if (_arg1 <= 0){
return (_arg2);
};
if (_arg1 >= _arg4){
return ((_arg2 + _arg3));
};
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package fl.motion
Section 31
//Source (fl.motion.Source)
package fl.motion {
import flash.geom.*;
public class Source {
public var frameRate:Number;// = NAN
public var elementType:String;// = ""
public var symbolName:String;// = ""
public var instanceName:String;// = ""
public var linkageID:String;// = ""
public var x:Number;// = 0
public var y:Number;// = 0
public var scaleX:Number;// = 1
public var scaleY:Number;// = 1
public var skewX:Number;// = 0
public var skewY:Number;// = 0
public var rotation:Number;// = 0
public var transformationPoint:Point;
public var dimensions:Rectangle;
public function Source(_arg1:XML=null){
this.parseXML(_arg1);
}
private function parseXML(_arg1:XML=null):Source{
var _local3:XML;
var _local4:XML;
var _local5:XML;
if (!_arg1){
return (this);
};
if (_arg1.@instanceName){
this.instanceName = String(_arg1.@instanceName);
};
if (_arg1.@symbolName){
this.symbolName = String(_arg1.@symbolName);
};
if (_arg1.@linkageID){
this.linkageID = String(_arg1.@linkageID);
};
if (!isNaN(_arg1.@frameRate)){
this.frameRate = Number(_arg1.@frameRate);
};
var _local2:XMLList = _arg1.elements();
for each (_local3 in _local2) {
if (_local3.localName() == "transformationPoint"){
_local4 = _local3.children()[0];
this.transformationPoint = new Point(Number(_local4.@x), Number(_local4.@y));
} else {
if (_local3.localName() == "dimensions"){
_local5 = _local3.children()[0];
this.dimensions = new Rectangle(Number(_local5.@left), Number(_local5.@top), Number(_local5.@width), Number(_local5.@height));
};
};
};
return (this);
}
}
}//package fl.motion
Section 32
//Tweenables (fl.motion.Tweenables)
package fl.motion {
public class Tweenables {
public static const X:String = "x";
public static const Y:String = "y";
public static const Z:String = "z";
public static const SCALE_X:String = "scaleX";
public static const SCALE_Y:String = "scaleY";
public static const SKEW_X:String = "skewX";
public static const SKEW_Y:String = "skewY";
public static const ROTATION:String = "rotation";
public static const ROTATION_X:String = "rotationX";
public static const ROTATION_Y:String = "rotationY";
public static const ROTATION_CONCAT:String = "rotationConcat";
}
}//package fl.motion
Section 33
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_SHOW:String = "StoreShow";
public static const STORE_HIDE:String = "StoreHide";
public static const ITEM_OWNED:String = "ItemOwned";
public static const ITEM_NEW:String = "ItemNew";
public static const STORE_ITEMS:String = "StoreItems";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IOError";
public static const NO_USER:String = "NoUser";
public static var _inventory:MochiInventory;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static function get inventory():MochiInventory{
return (_inventory);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showStore(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function requestFunding(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestFunding", _arg1);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_inventory = new MochiInventory();
});
addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_inventory = null;
});
}
}//package mochi.as3
Section 34
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Fragment:Number;
private var Sibling:MochiDigits;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function get value():Number{
return (Number(this.toString()));
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function reencode():void{
var _local1:uint = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function toString():String{
var _local1:String = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
}
}//package mochi.as3
Section 35
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
eventTable = {};
}
public function addEventListener(_arg1:String, _arg2:Function):void{
removeEventListener(_arg1, _arg2);
eventTable[_arg1].push(_arg2);
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
eventTable[_arg1] = [];
return;
};
for (_local3 in eventTable[_arg1]) {
if (eventTable[_arg1][_local3] != _arg2){
} else {
eventTable[_arg1].splice(Number(_local3), 1);
};
};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
return;
};
for (_local3 in eventTable[_arg1]) {
var _local6 = eventTable[_arg1];
_local6[_local3](_arg2);
};
}
}
}//package mochi.as3
Section 36
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
public class MochiEvents {
public static const ACHIEVEMENTS_OWNED:String = "AchievementOwned";
public static const ACHIEVEMENT_NEW:String = "AchievementReceived";
public static const GAME_ACHIEVEMENTS:String = "GameAchievements";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IOError";
public static const IO_PENDING:String = "IOPending";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_CENTER:String = "ALIGN_C";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const FORMAT_SHORT:String = "ShortForm";
public static const FORMAT_LONG:String = "LongForm";
public static const FORMAT_NONE:String = "NoForm";
private static var gameStart:Number;
private static var levelStart:Number;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function getAchievements(_arg1:Object=null):void{
MochiServices.send("events_getAchievements", _arg1);
}
public static function unlockAchievement(_arg1:Object):void{
MochiServices.send("events_unlockAchievement", _arg1);
}
public static function startSession(_arg1:String):void{
MochiServices.send("events_beginSession", {achievementID:_arg1}, null, null);
}
public static function showAwards(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.stayOnTop();
MochiServices.send("events_showAwards", _arg1);
}
public static function setNotifications(_arg1:Object):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("events_setNotifications", _arg1, null, null);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function startPlay(_arg1:String="gameplay"):void{
MochiServices.send("events_setRoundID", {tag:String(_arg1)}, null, null);
}
public static function endPlay():void{
MochiServices.send("events_clearRoundID", null, null, null);
}
public static function trackEvent(_arg1:String, _arg2=null):void{
MochiServices.send("events_trackEvent", {tag:_arg1, value:_arg2}, null, null);
}
}
}//package mochi.as3
Section 37
//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 _consumableProperties:Object;
private var _syncPending:Boolean;
private var _outstandingID:Number;
private var _syncID:Number;
private var _names:Array;
private var _storeSync:Object;
private static const CONSUMER_KEY:String = "MochiConsumables";
private static const KEY_SALT:String = " syncMaint";
public static const READY:String = "InvReady";
public static const WRITTEN:String = "InvWritten";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IoError";
public static const VALUE_ERROR:String = "InvValueError";
public static const NOT_READY:String = "InvNotReady";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiInventory():void{
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned);
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut);
_storeSync = new Object();
_syncPending = false;
_outstandingID = 0;
_syncID = 0;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, sync);
_timer.start();
if (MochiSocial.loggedIn){
loggedIn();
} else {
loggedOut();
};
}
public function release():void{
MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut);
}
private function loggedOut(_arg1:Object=null):void{
_consumableProperties = null;
}
private function loggedIn(_arg1:Object=null):void{
MochiUserData.get(CONSUMER_KEY, getConsumableBag);
}
private function newItems(_arg1:Object):void{
if (!this[(_arg1.id + KEY_SALT)]){
this[(_arg1.id + KEY_SALT)] = 0;
};
if (!this[_arg1.id]){
this[_arg1.id] = 0;
};
this[(_arg1.id + KEY_SALT)] = (this[(_arg1.id + KEY_SALT)] + _arg1.count);
this[_arg1.id] = (this[_arg1.id] + _arg1.count);
if (((_arg1.privateProperties) && (_arg1.privateProperties.consumable))){
if (!this[_arg1.privateProperties.tag]){
this[_arg1.privateProperties.tag] = 0;
};
this[_arg1.privateProperties.tag] = (this[_arg1.privateProperties.tag] + (_arg1.privateProperties.inc * _arg1.count));
};
}
private function itemOwned(_arg1:Object):void{
_storeSync[_arg1.id] = {properties:_arg1.properties, count:_arg1.count};
}
private function getConsumableBag(_arg1:MochiUserData):void{
var _local2:String;
var _local3:Number;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
return;
};
_consumableProperties = {};
_names = new Array();
if (_arg1.data){
for (_local2 in _arg1.data) {
_names.push(_local2);
_consumableProperties[_local2] = new MochiDigits(_arg1.data[_local2]);
};
};
for (_local2 in _storeSync) {
_local3 = _storeSync[_local2].count;
if (_consumableProperties[(_local2 + KEY_SALT)]){
_local3 = (_local3 - _consumableProperties[(_local2 + KEY_SALT)].value);
};
if (_local3 == 0){
} else {
newItems({id:_local2, count:_local3, properties:_storeSync[_local2].properties});
};
};
triggerEvent(READY, {});
}
private function putConsumableBag(_arg1:MochiUserData):void{
_syncPending = false;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
_outstandingID = -1;
};
triggerEvent(WRITTEN, {});
}
private function sync(_arg1:Event=null):void{
var _local3:String;
if (((_syncPending) || ((_syncID == _outstandingID)))){
return;
};
_outstandingID = _syncID;
var _local2:Object = {};
for (_local3 in _consumableProperties) {
_local2[_local3] = MochiDigits(_consumableProperties[_local3]).value;
};
MochiUserData.put(CONSUMER_KEY, _local2, putConsumableBag);
_syncPending = true;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (-1);
};
if (_consumableProperties[_arg1]){
return (MochiDigits(_consumableProperties[_arg1]).value);
};
return (undefined);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(_arg1):Boolean{
if (!_consumableProperties[_arg1]){
return (false);
};
_names.splice(_names.indexOf(_arg1), 1);
delete _consumableProperties[_arg1];
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(_arg1):Boolean{
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (false);
};
if (_consumableProperties[_arg1] == undefined){
return (false);
};
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:MochiDigits;
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return;
};
if (!(_arg2 is Number)){
triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:_arg2});
return;
};
if (_consumableProperties[_arg1]){
_local3 = MochiDigits(_consumableProperties[_arg1]);
if (_local3.value == _arg2){
return;
};
_local3.value = _arg2;
} else {
_names.push(_arg1);
_consumableProperties[_arg1] = new MochiDigits(_arg2);
};
_syncID++;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(_arg1:int):int{
return (((_arg1)>=_names.length) ? 0 : (_arg1 + 1));
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(_arg1:int):String{
return (_names[(_arg1 - 1)]);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
}
}//package mochi.as3
Section 38
//MochiScores (mochi.as3.MochiScores)
package mochi.as3 {
import flash.display.*;
import flash.text.*;
public class MochiScores {
public static var onCloseHandler:Object;
public static var onErrorHandler:Object;
private static var boardID:String;
public static function onClose(_arg1:Object=null):void{
if (((((_arg1) && ((_arg1.error == true)))) && (onErrorHandler))){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiServices.warnID(_arg1, true);
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
public static function showLeaderboard(_arg1:Object=null):void{
var n:Number;
var options = _arg1;
if (options != null){
delete options.clip;
MochiServices.setContainer();
MochiServices.bringToTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
_arg1 = Number(_arg1);
if (isNaN(_arg1)){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(_arg1) != _arg1){
trace((("WARNING: Submitted score '" + String(_arg1)) + "' will be truncated"));
};
_arg1 = Number(_arg1);
};
};
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
var _local2:Object = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
}
}//package mochi.as3
Section 39
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiServices {
public static const CONNECTED:String = "onConnected";
private static var _id:String;
private static var _container:Object;
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _timer:Timer;
private static var _preserved:Object;
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
private static var _services:String = "services.swf";
private static var _mochiLC:String = "MochiLC.swf";
private static var _swfVersion:String;
private static var _listenChannelName:String = "__ms_";
private static var _sendChannel:LocalConnection;
private static var _sendChannelName:String;
private static var _connecting:Boolean = false;
private static var _connected:Boolean = false;
public static var netup:Boolean = true;
public static var netupAttempted:Boolean = false;
public static var onError:Object;
public static var widget:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _queue:Array;
private static var _nextCallbackID:Number;
private static var _callbacks:Object;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static function get id():String{
return (_id);
}
public static function get clip():Object{
return (_container);
}
public static function get childClip():Object{
return (_clip);
}
public static function getVersion():String{
return ("3.9.4 as3");
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
};
return (_local2);
}
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
public static function get connected():Boolean{
return (_connected);
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
_arg1 = _arg1.toLowerCase();
if (_arg1.length != 16){
trace((("WARNING: " + (_arg2) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
var _local3:Number = 0;
while (_local3 < _arg1.length) {
switch (_arg1.charAt(_local3)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + _arg1));
return;
};
_local3++;
};
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
warnID(id, false);
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
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.");
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_mochiLocalConnection.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, connectWait);
_timer = null;
} catch(error:Error) {
};
};
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
public static function bringToTop(_arg1:Event=null):void{
var e = _arg1;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_clip.parent){
_clip.parent.removeChild(_clip);
};
if (_arg1 != null){
if ((_arg1 is DisplayObjectContainer)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is DisplayObjectContainer)){
DisplayObjectContainer(_container).addChild(_clip);
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
MochiServices.onError("NotConnected");
return (null);
};
if (urlOptions(_arg2).servURL){
_servURL = urlOptions(_arg2).servURL;
};
var _local3:String = (_servURL + _services);
if (urlOptions(_arg2).servicesURL){
_local3 = urlOptions(_arg2).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(_local3);
_clip = new MovieClip();
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, detach);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
var _local4:URLRequest = new URLRequest(_local3);
var _local5:URLVariables = new URLVariables();
_local5.listenLC = _listenChannelName;
_local5.mochiad_options = _arg2.loaderInfo.parameters.mochiad_options;
_local5.api_version = getVersion();
if (widget){
_local5.widget = true;
};
_local4.data = _local5;
_loader.load(_local4);
_clip.addChild(_loader);
_sendChannel = new LocalConnection();
_queue = [];
_nextCallbackID = 0;
_callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
private static function detach(_arg1:Event):void{
var _local2:LoaderInfo = LoaderInfo(_arg1.target);
_local2.removeEventListener(Event.COMPLETE, detach);
_local2.removeEventListener(IOErrorEvent.IO_ERROR, detach);
_local2.removeEventListener(Event.COMPLETE, loadLCBridgeComplete);
_local2.removeEventListener(IOErrorEvent.IO_ERROR, loadError);
}
private static function loadLCBridge(_arg1:Object):void{
var _local2:Loader = new Loader();
var _local3:String = (_servURL + _mochiLC);
var _local4:URLRequest = new URLRequest(_local3);
_local2.contentLoaderInfo.addEventListener(Event.COMPLETE, detach);
_local2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach);
_local2.contentLoaderInfo.addEventListener(Event.COMPLETE, loadLCBridgeComplete);
_local2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
_local2.load(_local4);
_arg1.addChild(_local2);
}
private static function loadLCBridgeComplete(_arg1:Event):void{
var _local2:Loader = LoaderInfo(_arg1.target).loader;
_mochiLocalConnection = MovieClip(_local2.content);
listen();
}
private static function loadError(_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
} else {
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, connectWait);
_timer = null;
};
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
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 onReceive(_arg1:Object):void{
var methodName:String;
var pkg = _arg1;
var cb:String = pkg.callbackID;
var cblst:Object = _callbacks[cb];
if (!cblst){
return;
};
var method:* = cblst.callbackMethod;
methodName = "";
var obj:Object = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete _callbacks[cb];
}
private static function onEvent(_arg1:Object):void{
var _local2:String = _arg1.target;
var _local3:String = _arg1.event;
switch (_local2){
case "services":
MochiServices.triggerEvent(_arg1.event, _arg1.args);
break;
case "events":
MochiEvents.triggerEvent(_arg1.event, _arg1.args);
break;
case "coins":
MochiCoins.triggerEvent(_arg1.event, _arg1.args);
break;
case "social":
MochiSocial.triggerEvent(_arg1.event, _arg1.args);
break;
};
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (((_clip) && (_queue))){
while (_queue.length > 0) {
_local2 = _queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _callbacks[_local2.callbackID];
};
delete _callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError("NotConnected");
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError("NotConnected");
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_nextCallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + _arg1));
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_queue.push({methodName:_arg1, args:_arg2, callbackID:_nextCallbackID});
};
if (_clip != null){
if (_callbacks != null){
_callbacks[_nextCallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_nextCallbackID++;
};
};
}
private static function urlOptions(_arg1:Object):Object{
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:Array;
var _local2:Object = {};
if (_arg1.stage){
_local3 = _arg1.stage.loaderInfo.parameters.mochiad_options;
} else {
_local3 = _arg1.loaderInfo.parameters.mochiad_options;
};
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var avm1Click:DisplayObject;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
var vars:Object = 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);
var s = "?";
var i:Number = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://link.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
var _local2:Rectangle = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local4:int;
var _local14:Loader;
var _local3:Array = [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];
var _local5:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
var _local6:Array = [0, 64, 0, 0, 0];
var _local7:MovieClip = new MovieClip();
var _local8:LocalConnection = new LocalConnection();
var _local9:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
var _local10:ByteArray = new ByteArray();
var _local11:ByteArray = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
var _local12:uint = ((_local3.length + _local11.length) + 4);
var _local13:uint = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
}
}//package mochi.as3
Section 40
//MochiSocial (mochi.as3.MochiSocial)
package mochi.as3 {
public class MochiSocial {
public static const LOGGED_IN:String = "LoggedIn";
public static const LOGGED_OUT:String = "LoggedOut";
public static const LOGIN_SHOW:String = "LoginShow";
public static const LOGIN_HIDE:String = "LoginHide";
public static const LOGIN_SHOWN:String = "LoginShown";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const PROFILE_HIDE:String = "ProfileHide";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const FRIEND_LIST:String = "FriendsList";
public static const PROFILE_DATA:String = "ProfileData";
public static const GAMEPLAY_DATA:String = "GameplayData";
public static const ACTION_CANCELED:String = "onCancel";
public static const ACTION_COMPLETE:String = "onComplete";
public static const USER_INFO:String = "UserInfo";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IOError";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static var _user_info:Object = null;
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function getAPIURL():String{
if (!_user_info){
return (null);
};
return (_user_info.api_url);
}
public static function getAPIToken():String{
if (!_user_info){
return (null);
};
return (_user_info.api_token);
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_showLoginWidget", {options:_arg1});
}
public static function hideLoginWidget():void{
MochiServices.send("social_hideLoginWidget");
}
public static function requestLogin(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestLogin", _arg1);
}
public static function showProfile(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.stayOnTop();
MochiServices.send("social_showProfile", _arg1);
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("social_saveUserProperties", _arg1);
}
public static function getFriendsList(_arg1:Object=null):void{
MochiServices.send("social_getFriendsList", _arg1);
}
public static function postToStream(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_postToStream", _arg1);
}
public static function inviteFriends(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_inviteFriends", _arg1);
}
public static function requestFan(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestFan", _arg1);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function get loggedIn():Boolean{
return (!((_user_info == null)));
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_user_info = _arg1;
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_user_info = null;
});
}
}//package mochi.as3
Section 41
//MochiUserData (mochi.as3.MochiUserData)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class MochiUserData extends EventDispatcher {
public var _loader:URLLoader;
public var key:String;// = null
public var data;// = null
public var error:Event;// = null
public var operation:String;// = null
public var callback:Function;// = null
public function MochiUserData(_arg1:String="", _arg2:Function=null){
this.key = _arg1;
this.callback = _arg2;
}
public function serialize(_arg1):ByteArray{
var _local2:ByteArray = new ByteArray();
_local2.objectEncoding = ObjectEncoding.AMF3;
_local2.writeObject(_arg1);
_local2.compress();
return (_local2);
}
public function deserialize(_arg1:ByteArray){
_arg1.objectEncoding = ObjectEncoding.AMF3;
_arg1.uncompress();
return (_arg1.readObject());
}
public function request(_arg1:String, _arg2:ByteArray):void{
var _operation = _arg1;
var _data = _arg2;
operation = _operation;
var api_url:String = MochiSocial.getAPIURL();
var api_token:String = MochiSocial.getAPIToken();
if ((((api_url == null)) || ((api_token == null)))){
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in"));
return;
};
_loader = new URLLoader();
var args:URLVariables = new URLVariables();
args.op = _operation;
args.key = key;
var req:URLRequest = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString()));
req.method = URLRequestMethod.POST;
req.contentType = "application/x-mochi-userdata";
req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)];
req.data = _data;
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.addEventListener(Event.COMPLETE, completeHandler);
_loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
try {
_loader.load(req);
} catch(e:SecurityError) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + e.toString())));
};
}
public function completeHandler(_arg1:Event):void{
var event = _arg1;
try {
if (_loader.data.length){
data = deserialize(_loader.data);
} else {
data = null;
};
} catch(e:Error) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + e.toString())));
return;
};
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function errorHandler(_arg1:IOErrorEvent):void{
data = null;
error = _arg1;
if (callback != null){
performCallback();
} else {
dispatchEvent(_arg1);
};
close();
}
public function securityErrorHandler(_arg1:SecurityErrorEvent):void{
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _arg1.toString())));
}
public function performCallback():void{
try {
callback(this);
} catch(e:Error) {
trace(("[MochiUserData] exception during callback: " + e));
};
}
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 getEvent():void{
request("get", serialize(null));
}
public function putEvent(_arg1):void{
request("put", serialize(_arg1));
}
override public function toString():String{
return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]"));
}
public static function get(_arg1:String, _arg2:Function):void{
var _local3:MochiUserData = new MochiUserData(_arg1, _arg2);
_local3.getEvent();
}
public static function put(_arg1:String, _arg2, _arg3:Function):void{
var _local4:MochiUserData = new MochiUserData(_arg1, _arg3);
_local4.putEvent(_arg2);
}
}
}//package mochi.as3
Section 42
//Log (Playtomic.Log)
package Playtomic {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.external.*;
public final class Log {
private static const PingF:Timer = new Timer(60000);
private static const PingR:Timer = new Timer(30000);
public static var Enabled:Boolean = false;
public static var Queue:Boolean = true;
public static var SWFID:int = 0;
public static var GUID:String = "";
public static var SourceUrl:String;
public static var BaseUrl:String;
public static var Cookie:SharedObject;
public static var Request:LogRequest;
private static var FirstPing:Boolean = true;
private static var Pings:int = 0;
private static var Plays:int = 0;
private static var HighestGoal:int = 0;
private static var Frozen:Boolean = false;
private static var FrozenQueue:Array = new Array();
private static var Customs:Array = new Array();
private static var LevelCounters:Array = new Array();
private static var LevelAverages:Array = new Array();
private static var LevelRangeds:Array = new Array();
public static function View(_arg1:int=0, _arg2:String="", _arg3:String=""):void{
if (SWFID > 0){
return;
};
SWFID = _arg1;
GUID = _arg2;
Enabled = true;
if ((((SWFID == 0)) || ((GUID == "")))){
Enabled = false;
return;
};
if (((((!((_arg3.indexOf("http://") == 0))) && (!((Security.sandboxType == "localWithNetwork"))))) && (!((Security.sandboxType == "localTrusted"))))){
Enabled = false;
return;
};
SourceUrl = GetUrl(_arg3);
if ((((((SourceUrl == null)) || ((SourceUrl == "")))) || ((SourceUrl.indexOf("https://") == 0)))){
Enabled = false;
return;
};
Security.allowDomain((("http://g" + Log.GUID) + ".api.playtomic.com/"));
Security.allowInsecureDomain((("http://g" + Log.GUID) + ".api.playtomic.com/"));
Security.loadPolicyFile((("http://g" + Log.GUID) + ".api.playtomic.com/crossdomain.xml"));
Request = LogRequest.Create();
Cookie = SharedObject.getLocal("playtomic");
var _local4:int = GetCookie("views");
Send(("v/" + (_local4 + 1)), true);
PingF.addEventListener(TimerEvent.TIMER, PingServer);
PingF.start();
}
public static function IncreaseViews():void{
var _local1:int = GetCookie("views");
_local1++;
SaveCookie("views", _local1);
}
public static function IncreasePlays():void{
Plays++;
}
public static function Play():void{
if (!Enabled){
return;
};
LevelCounters = new Array();
LevelAverages = new Array();
LevelRangeds = new Array();
Send(("p/" + (Plays + 1)), true);
}
private static function PingServer(... _args):void{
if (!Enabled){
return;
};
Pings++;
Send(((("t/" + (FirstPing) ? "y" : "n") + "/") + Pings), true);
if (FirstPing){
PingF.stop();
PingR.addEventListener(TimerEvent.TIMER, PingServer);
PingR.start();
FirstPing = false;
};
}
public static function CustomMetric(_arg1:String, _arg2:String=null, _arg3:Boolean=false):void{
if (!Enabled){
return;
};
if (_arg2 == null){
_arg2 = "";
};
if (_arg3){
if (Customs.indexOf(_arg1) > -1){
return;
};
Customs.push(_arg1);
};
Send(((("c/" + Clean(_arg1)) + "/") + Clean(_arg2)));
}
public static function LevelCounterMetric(_arg1:String, _arg2, _arg3:Boolean=false):void{
if (!Enabled){
return;
};
if (_arg3){
if (LevelCounters.indexOf(_arg1) > -1){
return;
};
LevelCounters.push(_arg1);
};
Send(((("lc/" + Clean(_arg1)) + "/") + Clean(_arg2)));
}
public static function LevelRangedMetric(_arg1:String, _arg2, _arg3:int, _arg4:Boolean=false):void{
if (!Enabled){
return;
};
if (_arg4){
if (LevelRangeds.indexOf(_arg1) > -1){
return;
};
LevelRangeds.push(_arg1);
};
Send(((((("lr/" + Clean(_arg1)) + "/") + Clean(_arg2)) + "/") + _arg3));
}
public static function LevelAverageMetric(_arg1:String, _arg2, _arg3:int, _arg4:Boolean=false):void{
if (!Enabled){
return;
};
if (_arg4){
if (LevelAverages.indexOf(_arg1) > -1){
return;
};
LevelAverages.push(_arg1);
};
Send(((((("la/" + Clean(_arg1)) + "/") + Clean(_arg2)) + "/") + _arg3));
}
public static function Link(_arg1:String, _arg2:String, _arg3:String, _arg4:int, _arg5:int, _arg6:int):void{
if (!Enabled){
return;
};
Send(((((((((((("l/" + Clean(_arg2)) + "/") + Clean(_arg3)) + "/") + Clean(_arg1)) + "/") + _arg4) + "/") + _arg5) + "/") + _arg6));
}
public static function Freeze():void{
Frozen = true;
}
public static function UnFreeze():void{
Frozen = false;
Request.MassQueue(FrozenQueue);
}
public static function ForceSend():void{
if (!Enabled){
return;
};
Request.Send();
Request = LogRequest.Create();
if (FrozenQueue.length > 0){
Request.MassQueue(FrozenQueue);
};
}
private static function Send(_arg1:String, _arg2:Boolean=false):void{
if (Frozen){
FrozenQueue.push(_arg1);
return;
};
Request.Queue(_arg1);
if (((((Request.Ready) || (_arg2))) || (!(Queue)))){
Request.Send();
Request = LogRequest.Create();
};
}
private static function Clean(_arg1:String):String{
while (_arg1.indexOf("/") > -1) {
_arg1 = _arg1.replace("/", "\\");
};
while (_arg1.indexOf("~") > -1) {
_arg1 = _arg1.replace("~", "-");
};
return (escape(_arg1));
}
private static function GetCookie(_arg1:String):int{
if (Cookie.data[_arg1] == undefined){
return (0);
};
return (int(Cookie.data[_arg1]));
}
private static function SaveCookie(_arg1:String, _arg2:int):void{
var _local3:SharedObject = SharedObject.getLocal("swfstats");
_local3.data[_arg1] = _arg2.toString();
_local3.flush();
}
private static function GetUrl(_arg1:String):String{
var url:String;
var defaulturl = _arg1;
if (ExternalInterface.available){
try {
url = String(ExternalInterface.call("window.location.href.toString"));
} catch(s:Error) {
url = defaulturl;
};
} else {
if ((((defaulturl.indexOf("http://") == 0)) || ((defaulturl.indexOf("https://") == 0)))){
url = defaulturl;
};
};
if ((((((url == null)) || ((url == "")))) || ((url == "null")))){
if ((((Security.sandboxType == "localWithNetwork")) || ((Security.sandboxType == "localTrusted")))){
url = "http://local-testing/";
} else {
url = null;
};
};
return (escape(url));
}
}
}//package Playtomic
Section 43
//LogRequest (Playtomic.LogRequest)
package Playtomic {
import flash.events.*;
import flash.net.*;
public final class LogRequest {
private var Sender:URLLoader;
private var Target:URLRequest;
private var Data:String;// = ""
private var BaseUrl:String;
public var Ready:Boolean;// = false
private static var Failed:int = 0;
private static var Pool:Array = new Array();
public function LogRequest(){
this.Sender = new URLLoader();
this.Sender.addEventListener(Event.COMPLETE, this.Complete, false, 1, false);
this.Sender.addEventListener(IOErrorEvent.IO_ERROR, this.IOErrorHandler, false, 0, true);
this.Sender.addEventListener(HTTPStatusEvent.HTTP_STATUS, this.StatusChange, false, 0, true);
this.Sender.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.SecurityErrorHandler, false, 0, true);
this.Target = new URLRequest();
this.BaseUrl = ((("http://g" + Log.GUID) + ".api.playtomic.com/tracker/q.aspx?swfid=") + Log.SWFID);
}
public function MassQueue(_arg1:Array):void{
var _local3:LogRequest;
if (Failed > 3){
return;
};
var _local2:int = (_arg1.length - 1);
while (_local2 > -1) {
this.Data = (this.Data + (((this.Data == "")) ? "" : "~" + _arg1[_local2]));
_arg1.splice(_local2, 1);
if (this.Data.length > 300){
_local3 = Create();
_local3.MassQueue(_arg1);
this.Ready = true;
this.Send();
return;
};
_local2--;
};
Log.Request = this;
}
public function Queue(_arg1:String):void{
if (Failed > 3){
return;
};
this.Data = (this.Data + (((this.Data == "")) ? "" : "~" + _arg1));
if (this.Data.length > 300){
this.Ready = true;
};
}
public function Send():void{
this.Target.url = (((((((this.BaseUrl + "&q=") + this.Data) + "&url=") + Log.SourceUrl) + "&") + Math.random()) + "z");
this.Sender.load(this.Target);
}
private function Complete(_arg1:Event=null):void{
if ((((this.Data.indexOf("v/") == 0)) || ((this.Data.indexOf("~v/") > -1)))){
Log.IncreaseViews();
};
if ((((this.Data.indexOf("p/") == 0)) || ((this.Data.indexOf("~p/") > -1)))){
Log.IncreasePlays();
};
Pool.push(this);
}
private function IOErrorHandler(_arg1:IOErrorEvent):void{
Failed++;
}
private function SecurityErrorHandler(_arg1:SecurityErrorEvent):void{
}
private function StatusChange(_arg1:HTTPStatusEvent):void{
}
public static function Create():LogRequest{
var _local1:LogRequest = ((Pool.length > 0)) ? (Pool.pop() as LogRequest) : new (LogRequest);
_local1.Data = "";
_local1.Ready = false;
return (_local1);
}
}
}//package Playtomic
Section 44
//ameplay_266 (wiring_public_fla.ameplay_266)
package wiring_public_fla {
import flash.display.*;
public dynamic class ameplay_266 extends MovieClip {
public function ameplay_266(){
addFrameScript(34, frame35);
}
function frame35(){
stop();
}
}
}//package wiring_public_fla
Section 45
//b1_260 (wiring_public_fla.b1_260)
package wiring_public_fla {
import flash.display.*;
public dynamic class b1_260 extends MovieClip {
public function b1_260(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package wiring_public_fla
Section 46
//b2_259 (wiring_public_fla.b2_259)
package wiring_public_fla {
import flash.display.*;
public dynamic class b2_259 extends MovieClip {
public function b2_259(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package wiring_public_fla
Section 47
//b3_258 (wiring_public_fla.b3_258)
package wiring_public_fla {
import flash.display.*;
public dynamic class b3_258 extends MovieClip {
public function b3_258(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package wiring_public_fla
Section 48
//b4_257 (wiring_public_fla.b4_257)
package wiring_public_fla {
import flash.display.*;
public dynamic class b4_257 extends MovieClip {
public function b4_257(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package wiring_public_fla
Section 49
//b5_256 (wiring_public_fla.b5_256)
package wiring_public_fla {
import flash.display.*;
public dynamic class b5_256 extends MovieClip {
public function b5_256(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package wiring_public_fla
Section 50
//b6_252 (wiring_public_fla.b6_252)
package wiring_public_fla {
import flash.display.*;
public dynamic class b6_252 extends MovieClip {
public function b6_252(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package wiring_public_fla
Section 51
//btMenu1_241 (wiring_public_fla.btMenu1_241)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class btMenu1_241 extends MovieClip {
public var txt:TextField;
public function btMenu1_241(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("Menu");
}
}
}//package wiring_public_fla
Section 52
//btMenu2_242 (wiring_public_fla.btMenu2_242)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class btMenu2_242 extends MovieClip {
public var txt:TextField;
public function btMenu2_242(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("Menu");
}
}
}//package wiring_public_fla
Section 53
//btMusic_248 (wiring_public_fla.btMusic_248)
package wiring_public_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public dynamic class btMusic_248 extends MovieClip {
public var hint:TextField;
public var bt:MovieClip;
public function btMusic_248(){
addFrameScript(0, frame1);
}
public function mouseOverHandler(_arg1:MouseEvent):void{
hint.visible = true;
}
public function mouseOutHandler(_arg1:MouseEvent):void{
hint.visible = false;
}
function frame1(){
hint.visible = false;
hint.mouseEnabled = false;
buttonMode = true;
bt.addEventListener(MouseEvent.ROLL_OVER, mouseOverHandler);
bt.addEventListener(MouseEvent.ROLL_OUT, mouseOutHandler);
hint.text = Lang.getText("music");
}
}
}//package wiring_public_fla
Section 54
//btMusicOn_249 (wiring_public_fla.btMusicOn_249)
package wiring_public_fla {
import flash.display.*;
public dynamic class btMusicOn_249 extends MovieClip {
public function btMusicOn_249(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package wiring_public_fla
Section 55
//btSound_246 (wiring_public_fla.btSound_246)
package wiring_public_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public dynamic class btSound_246 extends MovieClip {
public var hint:TextField;
public var bt:MovieClip;
public function btSound_246(){
addFrameScript(0, frame1);
}
public function mouseOverHandler(_arg1:MouseEvent):void{
hint.visible = true;
}
public function mouseOutHandler(_arg1:MouseEvent):void{
hint.visible = false;
}
function frame1(){
hint.visible = false;
hint.mouseEnabled = false;
buttonMode = true;
bt.addEventListener(MouseEvent.ROLL_OVER, mouseOverHandler);
bt.addEventListener(MouseEvent.ROLL_OUT, mouseOutHandler);
hint.text = Lang.getText("sounds");
}
}
}//package wiring_public_fla
Section 56
//btSoundOn_247 (wiring_public_fla.btSoundOn_247)
package wiring_public_fla {
import flash.display.*;
public dynamic class btSoundOn_247 extends MovieClip {
public function btSoundOn_247(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package wiring_public_fla
Section 57
//congratspanel_219 (wiring_public_fla.congratspanel_219)
package wiring_public_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public dynamic class congratspanel_219 extends MovieClip {
public var txtLevComplete:TextField;
public var txtBonus:TextField;
public var txtxTotal:TextField;
public var btMoreGames:SimpleButton;
public var txtCombo:TextField;
public var txtEarnedLable:TextField;
public var panel_bg:MovieClip;
public var txtTotal:TextField;
public var txtEarned:TextField;
public var btContinue:SimpleButton;
public function congratspanel_219(){
addFrameScript(0, frame1);
}
function frame1(){
txtLevComplete.text = Lang.getText("LevelComplete");
txtEarnedLable.text = Lang.getText("EarnedScore");
txtCombo.text = Lang.getText("BonusScore");
txtxTotal.text = Lang.getText("TotalScore");
btMoreGames.addEventListener(MouseEvent.CLICK, (parent as Level).main.gotoSite);
}
}
}//package wiring_public_fla
Section 58
//credits_275 (wiring_public_fla.credits_275)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class credits_275 extends MovieClip {
public var btDG:SimpleButton;
public var txtCedits:TextField;
public var btBack:SimpleButton;
public function credits_275(){
addFrameScript(0, frame1);
}
function frame1(){
txtCedits.text = Lang.getText("Credits");
}
}
}//package wiring_public_fla
Section 59
//ggp_button_280 (wiring_public_fla.ggp_button_280)
package wiring_public_fla {
import flash.display.*;
public dynamic class ggp_button_280 extends MovieClip {
public function ggp_button_280(){
addFrameScript(0, frame1);
}
function frame1(){
buttonMode = true;
gotoAndStop((Lang.curLang + 1));
}
}
}//package wiring_public_fla
Section 60
//ggp_button_small_16 (wiring_public_fla.ggp_button_small_16)
package wiring_public_fla {
import flash.display.*;
public dynamic class ggp_button_small_16 extends MovieClip {
public function ggp_button_small_16(){
addFrameScript(0, frame1);
}
function frame1(){
buttonMode = true;
gotoAndStop((Lang.curLang + 1));
}
}
}//package wiring_public_fla
Section 61
//Gmovie_263 (wiring_public_fla.Gmovie_263)
package wiring_public_fla {
import flash.display.*;
public dynamic class Gmovie_263 extends MovieClip {
public function Gmovie_263(){
addFrameScript(139, frame140);
}
function frame140(){
}
}
}//package wiring_public_fla
Section 62
//howtoplay_307 (wiring_public_fla.howtoplay_307)
package wiring_public_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public dynamic class howtoplay_307 extends MovieClip {
public var txtHelp4:TextField;
public var btNext4:SimpleButton;
public var txtHelp3:TextField;
public var btNext:SimpleButton;
public var txtHelp2:TextField;
public var txtHelp1:TextField;
public var txtProgress:TextField;
public var btNext2:SimpleButton;
public var btNext3:SimpleButton;
public function howtoplay_307(){
addFrameScript(0, frame1, 284, frame285, 285, frame286, 599, frame600, 600, frame601, 601, frame602);
}
public function goStep2(_arg1:MouseEvent){
gotoAndPlay("step2");
}
public function playG(_arg1:MouseEvent){
gotoAndPlay("step3");
}
public function playG2(_arg1:MouseEvent){
gotoAndPlay("step4");
}
public function playG3(_arg1:MouseEvent){
Utilites.main.playGame();
}
function frame1(){
txtHelp1.text = Lang.getText("help1");
btNext.addEventListener(MouseEvent.CLICK, goStep2);
}
function frame285(){
gotoAndPlay("step1");
}
function frame286(){
txtHelp2.text = Lang.getText("help2");
btNext2.addEventListener(MouseEvent.CLICK, playG);
}
function frame600(){
gotoAndPlay("step2");
}
function frame601(){
txtHelp3.text = Lang.getText("help3");
stop();
btNext3.addEventListener(MouseEvent.CLICK, playG2);
}
function frame602(){
txtHelp4.text = Lang.getText("help4");
stop();
btNext4.addEventListener(MouseEvent.CLICK, playG3);
}
}
}//package wiring_public_fla
Section 63
//mc_game_over_235 (wiring_public_fla.mc_game_over_235)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_game_over_235 extends MovieClip {
public var btSubmit:SimpleButton;
public var btReplay:SimpleButton;
public var txtGameOver:TextField;
public function mc_game_over_235(){
addFrameScript(0, frame1);
}
function frame1(){
txtGameOver.text = Lang.getText("GameOver");
}
}
}//package wiring_public_fla
Section 64
//mc_pause_215 (wiring_public_fla.mc_pause_215)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_pause_215 extends MovieClip {
public var txtPause:TextField;
public var btContinue:SimpleButton;
public function mc_pause_215(){
addFrameScript(0, frame1);
}
function frame1(){
txtPause.text = Lang.getText("Pause");
}
}
}//package wiring_public_fla
Section 65
//ruflag_282 (wiring_public_fla.ruflag_282)
package wiring_public_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public dynamic class ruflag_282 extends MovieClip {
public var hint:TextField;
public var bt:MovieClip;
public function ruflag_282(){
addFrameScript(0, frame1);
}
public function mouseOverHandler(_arg1:MouseEvent):void{
hint.visible = true;
}
public function mouseOutHandler(_arg1:MouseEvent):void{
hint.visible = false;
}
function frame1(){
hint.visible = false;
hint.mouseEnabled = false;
buttonMode = true;
bt.addEventListener(MouseEvent.ROLL_OVER, mouseOverHandler);
bt.addEventListener(MouseEvent.ROLL_OUT, mouseOutHandler);
}
}
}//package wiring_public_fla
Section 66
//txtBack1_277 (wiring_public_fla.txtBack1_277)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtBack1_277 extends MovieClip {
public var txt:TextField;
public function txtBack1_277(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("Back");
}
}
}//package wiring_public_fla
Section 67
//txtBack2_278 (wiring_public_fla.txtBack2_278)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtBack2_278 extends MovieClip {
public var txt:TextField;
public function txtBack2_278(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("Back");
}
}
}//package wiring_public_fla
Section 68
//txtContinue1_217 (wiring_public_fla.txtContinue1_217)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtContinue1_217 extends MovieClip {
public var txt:TextField;
public function txtContinue1_217(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("Continue");
}
}
}//package wiring_public_fla
Section 69
//txtContinue2_218 (wiring_public_fla.txtContinue2_218)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtContinue2_218 extends MovieClip {
public var txt:TextField;
public function txtContinue2_218(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("Continue");
}
}
}//package wiring_public_fla
Section 70
//txtCredits1_270 (wiring_public_fla.txtCredits1_270)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtCredits1_270 extends MovieClip {
public var txt:TextField;
public function txtCredits1_270(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("Credits");
}
}
}//package wiring_public_fla
Section 71
//txtCredits2_271 (wiring_public_fla.txtCredits2_271)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtCredits2_271 extends MovieClip {
public var txt:TextField;
public function txtCredits2_271(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("Credits");
}
}
}//package wiring_public_fla
Section 72
//txtMainMenu1_233 (wiring_public_fla.txtMainMenu1_233)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtMainMenu1_233 extends MovieClip {
public var txt:TextField;
public function txtMainMenu1_233(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("Main Menu");
}
}
}//package wiring_public_fla
Section 73
//txtMainMenu2_234 (wiring_public_fla.txtMainMenu2_234)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtMainMenu2_234 extends MovieClip {
public var txt:TextField;
public function txtMainMenu2_234(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("Main Menu");
}
}
}//package wiring_public_fla
Section 74
//txtMenu1_291 (wiring_public_fla.txtMenu1_291)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtMenu1_291 extends MovieClip {
public var txt:TextField;
public function txtMenu1_291(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("Menu");
}
}
}//package wiring_public_fla
Section 75
//txtMenu2_292 (wiring_public_fla.txtMenu2_292)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtMenu2_292 extends MovieClip {
public var txt:TextField;
public function txtMenu2_292(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("Menu");
}
}
}//package wiring_public_fla
Section 76
//txtMoreGames1_226 (wiring_public_fla.txtMoreGames1_226)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtMoreGames1_226 extends MovieClip {
public var txt:TextField;
public function txtMoreGames1_226(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("MoreGames");
}
}
}//package wiring_public_fla
Section 77
//txtMoreGames1_227 (wiring_public_fla.txtMoreGames1_227)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtMoreGames1_227 extends MovieClip {
public var txt:TextField;
public function txtMoreGames1_227(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("MoreGames");
}
}
}//package wiring_public_fla
Section 78
//txtMoreGames1_273 (wiring_public_fla.txtMoreGames1_273)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtMoreGames1_273 extends MovieClip {
public var txt:TextField;
public function txtMoreGames1_273(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("MoreGames");
}
}
}//package wiring_public_fla
Section 79
//txtMoreGames2_274 (wiring_public_fla.txtMoreGames2_274)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtMoreGames2_274 extends MovieClip {
public var txt:TextField;
public function txtMoreGames2_274(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("MoreGames");
}
}
}//package wiring_public_fla
Section 80
//txtNext1_223 (wiring_public_fla.txtNext1_223)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtNext1_223 extends MovieClip {
public var txt:TextField;
public function txtNext1_223(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("Next");
}
}
}//package wiring_public_fla
Section 81
//txtNext2_224 (wiring_public_fla.txtNext2_224)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtNext2_224 extends MovieClip {
public var txt:TextField;
public function txtNext2_224(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("Next");
}
}
}//package wiring_public_fla
Section 82
//txtPause1_244 (wiring_public_fla.txtPause1_244)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtPause1_244 extends MovieClip {
public var txt:TextField;
public function txtPause1_244(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("Pause");
}
}
}//package wiring_public_fla
Section 83
//txtPause2_245 (wiring_public_fla.txtPause2_245)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtPause2_245 extends MovieClip {
public var txt:TextField;
public function txtPause2_245(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("Pause");
}
}
}//package wiring_public_fla
Section 84
//txtPlay1_3 (wiring_public_fla.txtPlay1_3)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtPlay1_3 extends MovieClip {
public var txt:TextField;
public function txtPlay1_3(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("Play");
}
}
}//package wiring_public_fla
Section 85
//txtPlay2_4 (wiring_public_fla.txtPlay2_4)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtPlay2_4 extends MovieClip {
public var txt:TextField;
public function txtPlay2_4(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("Play");
}
}
}//package wiring_public_fla
Section 86
//txtReplay1_237 (wiring_public_fla.txtReplay1_237)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtReplay1_237 extends MovieClip {
public var txt:TextField;
public function txtReplay1_237(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("ReplayLevel");
}
}
}//package wiring_public_fla
Section 87
//txtReplay2_238 (wiring_public_fla.txtReplay2_238)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtReplay2_238 extends MovieClip {
public var txt:TextField;
public function txtReplay2_238(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("ReplayLevel");
}
}
}//package wiring_public_fla
Section 88
//txtSubmit1_230 (wiring_public_fla.txtSubmit1_230)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtSubmit1_230 extends MovieClip {
public var txt:TextField;
public function txtSubmit1_230(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("Submit");
}
}
}//package wiring_public_fla
Section 89
//txtSubmit2_231 (wiring_public_fla.txtSubmit2_231)
package wiring_public_fla {
import flash.display.*;
import flash.text.*;
public dynamic class txtSubmit2_231 extends MovieClip {
public var txt:TextField;
public function txtSubmit2_231(){
addFrameScript(0, frame1);
}
function frame1(){
txt.text = Lang.getText("Submit");
}
}
}//package wiring_public_fla
Section 90
//usaflag_284 (wiring_public_fla.usaflag_284)
package wiring_public_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public dynamic class usaflag_284 extends MovieClip {
public var hint:TextField;
public var bt:MovieClip;
public function usaflag_284(){
addFrameScript(0, frame1);
}
public function mouseOverHandler(_arg1:MouseEvent):void{
hint.visible = true;
}
public function mouseOutHandler(_arg1:MouseEvent):void{
hint.visible = false;
}
function frame1(){
hint.visible = false;
hint.mouseEnabled = false;
buttonMode = true;
bt.addEventListener(MouseEvent.ROLL_OVER, mouseOverHandler);
bt.addEventListener(MouseEvent.ROLL_OUT, mouseOutHandler);
}
}
}//package wiring_public_fla
Section 91
//yashik_13 (wiring_public_fla.yashik_13)
package wiring_public_fla {
import flash.display.*;
public dynamic class yashik_13 extends MovieClip {
public function yashik_13(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package wiring_public_fla
Section 92
//AddBonusAnim (AddBonusAnim)
package {
import flash.display.*;
import flash.events.*;
import dgparticles.*;
import flash.geom.*;
import com.greensock.*;
public class AddBonusAnim {
private var level:Level;
private var mcBonus:MovieClip;
private var em:Emitter;
public static var count:int = 0;
public function AddBonusAnim(_arg1:Block, _arg2:Level){
this.level = _arg2;
mcBonus = new MCBonus();
var _local3:Point = _arg1.localToGlobal(Utilites.ZERO_POINT);
mcBonus.x = _local3.x;
mcBonus.y = _local3.y;
mcBonus.width = _arg2.CELL_SEZE;
mcBonus.height = _arg2.CELL_SEZE;
_arg2.addChild(mcBonus);
var _local4:Number = ((_arg2.txtScore.x + (_arg2.txtScore.width / 2)) - (_arg2.CELL_SEZE / 2));
var _local5:Number = (_arg2.txtScore.y + (_arg2.txtScore.height / 2));
TweenNano.to(mcBonus, 0.7, {x:_local4, y:_local5, onComplete:addScores});
em = _arg2.ps.createEmmiter("bonus", _local3);
mcBonus.addEventListener(Event.ENTER_FRAME, update);
count++;
}
private function update(_arg1:Event):void{
em.position = new Point(mcBonus.x, mcBonus.y);
}
private function addScores():void{
level.manager.addBonusScore();
mcBonus.removeEventListener(Event.ENTER_FRAME, update);
mcBonus.parent.removeChild(mcBonus);
mcBonus = null;
level.ps.killEmmiterSmooth(em);
count--;
}
}
}//package
Section 93
//BlinkingLamp (BlinkingLamp)
package {
import flash.display.*;
import flash.events.*;
import fl.motion.*;
import flash.utils.*;
public class BlinkingLamp extends CustomFPSMovie {
private const OFF:int = 0;
private const ON:int = 1;
private const BLINK:int = 2;
private var state:int;// = 0
private var stateTimer:Timer;
public var animator:Animator;
private var mainMenu:MainMenu;
public function BlinkingLamp(_arg1:MovieClip, _arg2:int, _arg3:MainMenu){
super(_arg1, _arg2);
this.mainMenu = _arg3;
stateTimer = new Timer(1200);
stateTimer.addEventListener(TimerEvent.TIMER, changeState);
stateTimer.start();
var _local4:XML = <Motion duration="100" xmlns="fl.motion.*" xmlns:geom="flash.geom.*" xmlns:filters="flash.filters.*"><source><Source frameRate="20" x="259" y="217" scaleX="1" scaleY="1" rotation="0" elementType="movie clip" symbolName="main menu/main menu/lamp blue"><dimensions><geom:Rectangle left="-15" top="0" width="30" height="80"/></dimensions><transformationPoint><geom:Point x="0.5" y="0"/></transformationPoint></Source></source>
<Keyframe index="0" tweenSnap="true"><tweens><SimpleEase ease="0.5"/></tweens></Keyframe>
<Keyframe index="24" tweenSnap="true" rotation="-7"><tweens><SimpleEase ease="-0.5"/></tweens></Keyframe>
<Keyframe index="49" tweenSnap="true" rotation="-0.3"><tweens><SimpleEase ease="0.5"/></tweens></Keyframe>
<Keyframe index="74" tweenSnap="true" rotation="7"><tweens><SimpleEase ease="-0.5"/></tweens></Keyframe>
<Keyframe index="99" tweenSnap="true" rotation="0"><tweens><SimpleEase ease="0"/></tweens></Keyframe></Motion>
;
animator = new Animator(_local4, _arg1);
animator.repeatCount = 9999999999999;
animator.play();
stop();
}
private function changeState(_arg1:TimerEvent=null):void{
if (state == OFF){
state = ((Math.random())<0.7) ? BLINK : ON;
if (state == BLINK){
stateTimer.delay = (Utilites.randomNumber(0.5, 1) * 1000);
};
if (state == ON){
stateTimer.delay = (Utilites.randomNumber(4, 7) * 1000);
};
} else {
if ((((state == ON)) && ((mainMenu.blinkCount == 0)))){
state = ((Math.random())<0.2) ? OFF : BLINK;
if (state == OFF){
stateTimer.delay = (Utilites.randomNumber(0.5, 1) * 1000);
};
if (state == BLINK){
stateTimer.delay = (Utilites.randomNumber(0.5, 1) * 1000);
};
} else {
if (state == BLINK){
mainMenu.blinkCount--;
state = ((Math.random())<0.17) ? OFF : ON;
if (state == OFF){
stateTimer.delay = (Utilites.randomNumber(0.5, 1) * 1000);
};
if (state == ON){
stateTimer.delay = (Utilites.randomNumber(4, 6) * 1000);
};
};
};
};
if (state == BLINK){
mainMenu.blinkCount++;
play();
} else {
if (state == ON){
mc.gotoAndStop(2);
stop();
} else {
if (state == OFF){
mc.gotoAndStop(1);
stop();
};
};
};
}
override public function dispose():void{
super.dispose();
animator.stop();
animator = null;
}
}
}//package
Section 94
//BlinkWindow (BlinkWindow)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class BlinkWindow {
private var _window:MovieClip;
private var blinkCnt:int;
private var timer:Timer;
public function BlinkWindow(_arg1:MovieClip){
_window = _arg1;
_window.visible = true;
blinkCnt = Utilites.randomInt(3, 5);
timer = new Timer(140);
timer.addEventListener(TimerEvent.TIMER, update);
timer.start();
}
private function update(_arg1:Event):void{
timer.delay = Utilites.randomNumber(50, 100);
_window.alpha = ((_window.alpha)==1) ? 0 : 1;
blinkCnt--;
if ((((blinkCnt < 0)) && ((_window.alpha == 1)))){
timer.removeEventListener(TimerEvent.TIMER, update);
timer.stop();
_window = null;
};
}
}
}//package
Section 95
//Block (Block)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import com.greensock.*;
public class Block extends MovieClip {
public var block1:MovieClip;
public var block2:MovieClip;
public var block3:MovieClip;
public var block4:MovieClip;
public var block5:MovieClip;
public var block6:MovieClip;
public var block7:MovieClip;
public var state:int;// = 0
public var row:int;
public var col:int;
private var level:Level;
private var connects:Array;
public var block:MovieClip;
private var bonus:CustomFPSMovie;
private var mc_bonus:MovieClip;
public var isBonus:Boolean;// = false
public var isFixed:Boolean;// = false
public var isEmpty:Boolean;// = false
private var _connected:Boolean;// = false
private var onAnimComplete:Function;
public static const NORMAL:int = 0;
public static const WAIT_ANIM:int = 1;
public static const ELECTRIC_ANIM:int = 2;
public static const AFTER_ANIM:int = 3;
public static const CONNECTED:int = 4;
public static const GENERATING:int = 5;
public static const ROTATING:int = 6;
public function Block(){
mc_bonus = new MCBonus();
super();
}
public function initialize(_arg1:Level){
this.level = _arg1;
parent.addChild(mc_bonus);
mc_bonus.x = x;
mc_bonus.y = y;
mc_bonus.mouseEnabled = false;
mc_bonus.mouseChildren = false;
bonus = new CustomFPSMovie(mc_bonus.mc, 15);
generate();
addEventListener(MouseEvent.CLICK, rotateBlock);
addEventListener(MouseEvent.ROLL_OVER, rollOverBlock);
addEventListener(MouseEvent.ROLL_OUT, rollOutBlock);
}
public function generate():void{
var _local1:int;
while (_local1 < numChildren) {
getChildAt(_local1).visible = false;
_local1++;
};
var _local2:int = generateIndex();
block = (getChildByName(("block" + _local2)) as MovieClip);
block.visible = true;
block.gotoAndStop(1);
var _local3:int = Utilites.randomInt(0, 3);
rotate(_local3);
rotation = (_local3 * 90);
scaleX = 0.2;
scaleY = 0.2;
state = GENERATING;
level.needUpdate = true;
TweenNano.to(this, 0.7, {scaleX:1, scaleY:1, onComplete:resetState});
}
public function get connected():Boolean{
return (_connected);
}
public function set connected(_arg1:Boolean):void{
if (state == ROTATING){
return;
};
_connected = _arg1;
block.gotoAndStop((_arg1) ? 2 : 1);
}
public function get connectionUp():Boolean{
return (connects[0]);
}
public function get connectionRight():Boolean{
return (connects[1]);
}
public function get connectionDown():Boolean{
return (connects[2]);
}
public function get connectionLeft():Boolean{
return (connects[3]);
}
public function connectedUp():Boolean{
if (!connectionUp){
return (false);
};
var _local1:Block = level.getBlockAt((row - 1), col);
return (((_local1) && (_local1.connectionDown)));
}
public function connectedDown():Boolean{
if (!connectionDown){
return (false);
};
var _local1:Block = level.getBlockAt((row + 1), col);
return (((_local1) && (_local1.connectionUp)));
}
public function connectedLeft():Boolean{
if (!connectionLeft){
return (false);
};
var _local1:Block = level.getBlockAt(row, (col - 1));
return (((_local1) && (_local1.connectionRight)));
}
public function connectedRight():Boolean{
if (!connectionRight){
return (false);
};
var _local1:Block = level.getBlockAt(row, (col + 1));
return (((_local1) && (_local1.connectionLeft)));
}
private function generateIndex():int{
isBonus = false;
isFixed = false;
isEmpty = false;
var _local1:int = Utilites.randomInt(1, 3);
var _local2 = (Math.random() < 0.2);
if (_local2){
if (level.bonusCnt < LevelSettings.bonusCnt){
level.bonusCnt++;
isBonus = true;
} else {
if (level.fixedCnt < LevelSettings.fixedCnt){
level.fixedCnt++;
_local1 = (_local1 + 3);
isFixed = true;
} else {
if (level.emptyCnt < LevelSettings.emptyCnt){
level.emptyCnt++;
_local1 = 7;
isEmpty = true;
};
};
};
};
mc_bonus.visible = isBonus;
if ((((_local1 == 1)) || ((_local1 == 4)))){
connects = [false, false, true, true];
} else {
if ((((_local1 == 2)) || ((_local1 == 5)))){
connects = [false, true, false, true];
} else {
if ((((_local1 == 3)) || ((_local1 == 6)))){
connects = [false, true, true, true];
} else {
if (_local1 == 7){
connects = [false, false, false, false];
};
};
};
};
return (_local1);
}
public function calcState():void{
connected = (((((((((((col == 0)) && (connectionLeft))) || (((connectedLeft()) && (level.getBlockAt(row, (col - 1)).connected))))) || (((connectedRight()) && (level.getBlockAt(row, (col + 1)).connected))))) || (((connectedDown()) && (level.getBlockAt((row + 1), col).connected))))) || (((connectedUp()) && (level.getBlockAt((row - 1), col).connected))));
}
public function resetState():void{
state = NORMAL;
block.gotoAndStop(1);
level.needUpdate = true;
}
private function rollOverBlock(_arg1:MouseEvent):void{
if (((((!((level.manager.state == LevelManager.GAME))) || (isFixed))) || (isEmpty))){
return;
};
if ((((((state == NORMAL)) || ((state == CONNECTED)))) || ((state == GENERATING)))){
transform.colorTransform = new ColorTransform(1, 1, 1, 1, 15, 15, 15);
};
}
private function rollOutBlock(_arg1:MouseEvent):void{
transform.colorTransform = new ColorTransform();
}
private function rotateBlock(_arg1:MouseEvent):void{
var _local2:Number;
if (((((!((level.manager.state == LevelManager.GAME))) || (isFixed))) || (isEmpty))){
return;
};
if ((((state == NORMAL)) || ((state == CONNECTED)))){
level.blocksContainer.setChildIndex(this, 0);
_local2 = (rotation + 90);
TweenNano.to(this, 0.15, {rotation:_local2, onComplete:resetState});
rotate();
state = ROTATING;
};
}
private function rotate(_arg1:int=1):void{
var _local3:Boolean;
var _local2:int;
while (_local2 < _arg1) {
_local3 = connects[0];
connects[0] = connects[3];
connects[3] = connects[2];
connects[2] = connects[1];
connects[1] = _local3;
_local2++;
};
}
public function electricAnim(_arg1:Function, _arg2:int):Boolean{
var _local3:int;
if ((((state == WAIT_ANIM)) || ((state == CONNECTED)))){
state = ELECTRIC_ANIM;
onAnimComplete = _arg1;
_local3 = (rotation / 90);
_local3 = (_local3 % 3);
_arg2 = (_arg2 - _local3);
if (_arg2 < 0){
_arg2 = (_arg2 + 4);
};
if (_arg2 > 3){
_arg2 = (_arg2 - 4);
};
block.gotoAndStop(("from" + _arg2.toString()));
return (true);
};
return (false);
}
public function update():void{
if (state == ELECTRIC_ANIM){
block.nextFrame();
if (block.currentLabel == "end"){
state = AFTER_ANIM;
block.gotoAndStop(2);
if (isBonus){
new AddBonusAnim(this, level);
mc_bonus.visible = false;
isBonus = false;
level.bonusCnt--;
SoundManager.playOnce("snd_bonus", 1);
};
if (isFixed){
level.fixedCnt--;
};
if (isEmpty){
level.emptyCnt--;
};
onAnimComplete.call(this, this);
};
};
}
}
}//package
Section 96
//Building (Building)
package {
import flash.display.*;
import flash.geom.*;
public class Building {
private var mc:MovieClip;
public var totalWin:int;// = 0
public var lightUpWin:int;// = 0
private static const OFF_MULTIPLIER:Number = 0.2;
public function Building(_arg1:MovieClip){
this.mc = _arg1;
totalWin = (_arg1.numChildren - 1);
_arg1.getChildByName("building").transform.colorTransform = new ColorTransform((1 * OFF_MULTIPLIER), (1 * OFF_MULTIPLIER), (1 * OFF_MULTIPLIER));
var _local2 = 1;
while (_local2 < _arg1.numChildren) {
_arg1.getChildByName(("w" + _local2)).visible = false;
_local2++;
};
}
public function get isAllWinLightUp():Boolean{
return ((lightUpWin >= totalWin));
}
public function setWinState(_arg1:Boolean):void{
var _local2 = 1;
while (_local2 <= totalWin) {
mc.getChildByName(("w" + _local2)).visible = _arg1;
_local2++;
};
lightUpWin = (_arg1) ? totalWin : 0;
var _local3:Number = (OFF_MULTIPLIER + (((1 - OFF_MULTIPLIER) * lightUpWin) / totalWin));
mc.getChildByName("building").transform.colorTransform = new ColorTransform(_local3, _local3, _local3);
}
public function lightUp(_arg1:int):int{
var _local3:MovieClip;
var _local4:Number;
var _local2 = 1;
while (((!(isAllWinLightUp)) && ((_arg1 > 0)))) {
_local3 = (mc.getChildByName(("w" + _local2)) as MovieClip);
if (!_local3.visible){
new BlinkWindow(_local3);
lightUpWin++;
_local4 = (OFF_MULTIPLIER + (((1 - OFF_MULTIPLIER) * lightUpWin) / totalWin));
mc.getChildByName("building").transform.colorTransform = new ColorTransform(_local4, _local4, _local4);
_arg1--;
};
_local2++;
};
return (_arg1);
}
}
}//package
Section 97
//City (City)
package {
import flash.display.*;
public class City {
public var mcCity:MovieClip;
private var buildings:Array;
public function initialize():void{
var _local2:Building;
buildings = new Array();
var _local1:int;
while (_local1 < mcCity.numChildren) {
_local2 = new Building((mcCity.getChildByName(("h" + (_local1 + 1).toString())) as MovieClip));
buildings.push(_local2);
_local1++;
};
}
public function prepare():void{
var _local3:Boolean;
var _local1:Array = LevelSettings.getBuildingIndicies();
var _local2:int;
while (_local2 < buildings.length) {
_local3 = (_local1.indexOf((_local2 + 1)) > -1);
buildings[_local2].setWinState(_local3);
_local2++;
};
}
public function getLightWinCount(_arg1:int):int{
return (buildings[(_arg1 - 1)].lightUpWin);
}
public function getWinCount(_arg1:int):int{
return (buildings[(_arg1 - 1)].totalWin);
}
public function lightUp(_arg1:int):void{
var _local4:Building;
var _local2:Array = LevelSettings.buildings;
var _local3:int;
while (_local3 < _local2.length) {
_local4 = buildings[(_local2[_local3] - 1)];
if (!_local4.isAllWinLightUp){
_local4.lightUp(_arg1);
break;
};
_local3++;
};
}
private function isAllWinLightUp():Boolean{
var _local1:Boolean;
var _local2:int;
while (_local2 < buildings.length) {
if (!buildings[_local2].isAllWinLightUp){
_local1 = false;
break;
};
_local2++;
};
return (_local1);
}
}
}//package
Section 98
//ComboText (ComboText)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import com.greensock.*;
import com.greensock.easing.*;
import flash.text.*;
public class ComboText extends MovieClip {
public var txt:TextField;
private var alphaDt:Number;// = 0
private static var pos1:Point = new Point(530, 100);
private static var pos2:Point = new Point(635, 130);
private static var changePos:Boolean = false;
public function ComboText(_arg1:int, _arg2:int, _arg3:Level){
txt.autoSize = TextFieldAutoSize.CENTER;
var _local4 = (Lang.getText("COMBO") + "\n+");
if (_arg1 == 3){
_local4 = (Lang.getText("SUPER COMBO") + "\n+");
};
if (_arg1 == 4){
_local4 = (Lang.getText("MEGA COMBO") + "\n+");
};
if (_arg1 == 5){
_local4 = (Lang.getText("HYPER COMBO") + "\n+");
};
if (_arg1 > 5){
_local4 = (Lang.getText("ULTRA COMBO") + "\n+");
};
txt.text = (_local4 + _arg2);
_arg3.addChild(this);
if (changePos){
x = pos1.x;
y = pos1.y;
} else {
x = pos2.x;
y = pos2.y;
};
changePos = !(changePos);
TweenNano.to(this, 3, {alpha:0.2, y:45, onComplete:dispose, ease:Linear.easeOut});
alphaDt = ((1 / stage.frameRate) * 3);
}
private function update(_arg1:Event):void{
txt.alpha = (txt.alpha + alphaDt);
if ((((txt.alpha < 0)) || ((txt.alpha > 1)))){
txt.alpha = Utilites.clamp(txt.alpha, 0, 1);
alphaDt = -(alphaDt);
};
}
private function dispose():void{
removeEventListener(Event.ENTER_FRAME, update);
parent.removeChild(this);
}
}
}//package
Section 99
//CustomFPSMovie (CustomFPSMovie)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class CustomFPSMovie {
protected var timer:Timer;
public var mc:MovieClip;
public var animDir:int;// = 1
public static const FORWARD:int = 1;
public static const BACKWARD:int = -1;
public function CustomFPSMovie(_arg1:MovieClip, _arg2:int){
timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, updateAnimation);
initialize(_arg1, _arg2);
}
public function set fps(_arg1:int):void{
timer.delay = (1000 / _arg1);
}
public function get fps():int{
return (int((1000 / timer.delay)));
}
public function initialize(_arg1:MovieClip, _arg2:int):void{
this.mc = _arg1;
_arg1.stop();
timer.delay = (1000 / _arg2);
timer.start();
}
protected function updateAnimation(_arg1:TimerEvent):void{
if (animDir == FORWARD){
if (mc.currentFrame == mc.totalFrames){
mc.gotoAndStop(1);
} else {
mc.nextFrame();
};
} else {
if (mc.currentFrame == 1){
mc.gotoAndStop(mc.totalFrames);
} else {
mc.prevFrame();
};
};
}
public function play():void{
timer.start();
}
public function stop():void{
timer.stop();
}
public function dispose():void{
timer.removeEventListener(TimerEvent.TIMER, updateAnimation);
timer.stop();
timer = null;
mc = null;
}
}
}//package
Section 100
//DGSound (DGSound)
package {
import flash.events.*;
import flash.media.*;
public class DGSound {
public var sound:Sound;
private var channel:SoundChannel;
private var volume:Number;// = 1
private var position:Number;// = 0
public var loops:int;// = 1
public var played:Boolean;
public var name:String;
public function DGSound(_arg1:Sound, _arg2:String){
this.sound = _arg1;
this.name = _arg2;
}
public function get vol():Number{
return (channel.soundTransform.volume);
}
public function set vol(_arg1:Number):void{
channel.soundTransform = new SoundTransform(_arg1);
}
public function get transform():SoundTransform{
return (channel.soundTransform);
}
public function set transform(_arg1:SoundTransform):void{
channel.soundTransform = _arg1;
}
public function play(_arg1:int, _arg2:Number, _arg3:Number):void{
this.volume = _arg2;
this.loops = _arg1;
channel = sound.play(position, _arg1, new SoundTransform(_arg3));
channel.addEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
played = false;
}
private function soundCompleteHandler(_arg1:Event):void{
channel.removeEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
played = true;
}
public function stop():void{
if (channel != null){
channel.stop();
channel.removeEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
};
position = 0;
loops = -1;
played = true;
}
public function pause():void{
position = channel.position;
channel.stop();
channel.removeEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
}
public function restoreVolume():void{
vol = volume;
}
public function resume():void{
if ((((position >= sound.length)) || ((loops > 1)))){
position = 0;
};
channel = sound.play(position, loops, new SoundTransform(volume));
channel.addEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
}
}
}//package
Section 101
//FpsCounter (FpsCounter)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class FpsCounter {
public static var fps:int;
private static var initialized:Boolean;
private static var _stage:Stage;
private static var timeCounter:int;
private static var fpsCounter:int;
private static var lastTime:Number;
public static function initialize(_arg1:Stage){
if (initialized){
return;
};
_stage = _arg1;
_arg1.addEventListener(Event.ENTER_FRAME, update);
initialized = true;
}
private static function update(_arg1:Event):void{
var _local2:int = getTimer();
var _local3:int = (_local2 - lastTime);
lastTime = _local2;
fpsCounter = (fpsCounter + 1);
timeCounter = (timeCounter + _local3);
if (timeCounter > 1000){
timeCounter = (timeCounter - 1000);
fps = fpsCounter;
fpsCounter = 0;
};
}
public static function dispose():void{
if (initialized){
_stage.removeEventListener(Event.ENTER_FRAME, update);
initialized = false;
};
}
}
}//package
Section 102
//Input (Input)
package {
import flash.display.*;
import flash.events.*;
public class Input {
private static var pressedKeys:Array = new Array();
private static var initialized:Boolean;
public static var isMouseDown:Boolean;
public static function initialize(_arg1:Stage){
if (initialized){
return;
};
initialized = true;
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyDown);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyUp);
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
_arg1.addEventListener(MouseEvent.MOUSE_UP, mouseUp);
}
private static function keyDown(_arg1:KeyboardEvent):void{
var _local2:int = pressedKeys.indexOf(_arg1.keyCode);
if (_local2 == -1){
pressedKeys.push(_arg1.keyCode);
};
}
private static function keyUp(_arg1:KeyboardEvent):void{
var _local2:int = pressedKeys.indexOf(_arg1.keyCode);
if (_local2 > -1){
pressedKeys.splice(_local2, 1);
};
}
private static function mouseDown(_arg1:MouseEvent):void{
isMouseDown = true;
}
private static function mouseUp(_arg1:MouseEvent):void{
isMouseDown = false;
}
public static function isKeyDown(_arg1:int):Boolean{
var _local2:int = pressedKeys.indexOf(_arg1);
return ((_local2 > -1));
}
}
}//package
Section 103
//Lamps (Lamps)
package {
import flash.display.*;
import flash.events.*;
public class Lamps {
private const LAMPS_COUNT:int = 12;
private var lamps:MovieClip;
private var blink:Boolean;// = false
private var dtAlpha:Number;
private var _level:Level;
private var curPow:Number;// = 0
private var dtPow:Number;// = 1
public function Lamps(_arg1:MovieClip, _arg2:Level){
_level = _arg2;
lamps = _arg1;
dtAlpha = ((1 / lamps.stage.frameRate) * 2);
}
public function clear():void{
curPow = 0;
blink = false;
lamps.alpha = 1;
lamps.gotoAndStop(2);
}
public function update():void{
var _local3:Number;
var _local4:Number;
var _local1:Number = _level.power;
if (_local1 > curPow){
curPow = Utilites.clamp((curPow + dtPow), 0, _local1);
};
if (_local1 < curPow){
curPow = Utilites.clamp((curPow - dtPow), _local1, 200);
};
if (curPow >= 100){
_level.manager.gameOver();
};
_local1 = ((curPow / 10) * LAMPS_COUNT);
var _local2 = 1;
while (_local2 <= LAMPS_COUNT) {
_local3 = (_local1 - (_local2 * 10));
_local4 = 0;
if (_local3 >= -3){
_local4 = 1;
} else {
if (_local3 <= -10){
_local4 = 0;
} else {
_local4 = (1 - (-(_local3) / 10));
};
};
lamps.getChildByName(("mc" + _local2)).alpha = _local4;
_local2++;
};
}
public function dispose(){
lamps.removeEventListener(Event.ENTER_FRAME, update);
}
}
}//package
Section 104
//Lang (Lang)
package {
public class Lang {
public static var curLang:int = 0;
private static var langs:Object = new Object();
public static function getText(_arg1:String):String{
var txt = _arg1;
try {
langs[txt][curLang];
} catch(e) {
trace(((("txt = " + txt) + "; cur lang = ") + curLang));
return (txt);
};
return (langs[txt][curLang]);
}
public static function init():void{
langs["music"] = ["music", "музыка"];
langs["sounds"] = ["sounds", "звуки"];
langs["SelLevel"] = ["Select Level", "Выберите уровень"];
langs["HowToPlay"] = ["How To Play", "Правила игры"];
langs["Pause"] = ["Pause", "Пауза"];
langs["EarnedScore"] = ["Earned score:", "Набрано очков:"];
langs["BonusScore"] = ["Combo bonus:", "Бонус:"];
langs["TotalScore"] = ["Total score:", "Общий счёт:"];
langs["ReplayLevel"] = ["Replay Level", "Переиграть уровень"];
langs["COMBO"] = ["COMBO !", "Комбо!"];
langs["SUPER COMBO"] = ["SUPER COMBO !", "Супер Комбо!"];
langs["MEGA COMBO"] = ["MEGA COMBO !", "Мега Комбо!"];
langs["HYPER COMBO"] = ["HYPER COMBO !", "Гипер Комбо!"];
langs["ULTRA COMBO"] = ["ULTRA COMBO !", "Ультра Комбо!"];
langs["help1"] = ["Click to rotate block", "Клик - повернуть блок"];
langs["help2"] = ["Light up two or more windows\nto get COMBO and Extra scores", "Зажгите несколько окон одновременно\n чтобы получить бонусные очки"];
langs["help3"] = ["Light up all windows\nin building to pass level", "Зажгите все окна в здании\n чтобы пройти уровень"];
langs["help4"] = ["Watch voltage overloading", "Следите за перегрузкой трансформатора!"];
langs["Level"] = ["Level", "Уровень"];
langs["LevelComplete"] = ["Level complete!", "Уровень пройден!"];
langs["Play"] = ["Play", "Играть"];
langs["Continue"] = ["Continue", "Продолжить"];
langs["NewGame"] = ["New Game", "Новая игра"];
langs["Credits"] = ["Credits", "Создатели"];
langs["MoreGames"] = ["More Games", "Другие игры"];
langs["Back"] = ["Back", "Назад"];
langs["Restart"] = ["RESTART", "Переиграть"];
langs["TOTALSCORE"] = ["TOTAL SCORE:", "Все очков:"];
langs["Submit"] = ["Submit Score", "В рекорды"];
langs["Next"] = ["Next", "Далее"];
langs["Combo"] = ["Combo", "Комбо"];
langs["SendScore"] = ["Submit score", "Таблица рекордов"];
langs["ResLine"] = ["new resources arrival line", ""];
langs["LevelComplete1"] = ["Level complete!", "Уровень пройден!"];
langs["SCORESOBTAINED"] = ["SCORES OBTAINED:", "Набрано очков:"];
langs["NEXTLEVELAT"] = ["NEXT LEVEL AT:", "Следующий уровень:"];
langs["brifHelp"] = ["Click to fire! Press \"space\" to launch rockets!\nPress \"Esc\" for pause.\nDon't forget to buy upgrades in the shop!", "Кликайте мышкой чтобы стрелять.\nЖмите пробел для запуска ракет.\nEsc - пауза. Удачи!"];
langs["Money"] = ["Money", "Деньги"];
langs["Score"] = ["Score:", "Счет:"];
langs["lives"] = ["lives", "Жизни"];
langs["overheat"] = ["overheat", "Перегрев"];
langs["armor"] = ["armor", "Броня"];
langs["Armor"] = ["Armor", "Броня"];
langs["Reactor"] = ["Reactor", "Охладитель"];
langs["Machinegun"] = ["Machinegun", "Пулемет"];
langs["Rockets"] = ["Rockets", "Ракеты"];
langs["bought"] = ["bought", "Куплено"];
langs["Notenoughmoney"] = ["Not enough money", "Не достаточно денег"];
langs["Price"] = ["Price", "Цена"];
langs["Buy"] = ["Buy", "Купить"];
langs["Defense"] = ["Defense", "Защита"];
langs["Energy"] = ["Energy", "Охлаждение"];
langs["Atack"] = ["Atack", "Атака"];
langs["shopHelp"] = ["Choose the upgrades at the right\nGet acknowledged with parameters of upgrade, price and quality\nPress «Buy» button if you are sure in purchase", "Выбирайте справа улучшение для своего корабля.\n\nНажмите кнопку \"Купить\" чтобы усовершенствовать корабль."];
langs["paused"] = ["PAUSED", "Пауза"];
langs["Menu"] = ["Menu", "Меню"];
langs["Main Menu"] = ["Main Menu", "Меню"];
langs["MainMenu"] = ["Main Menu", "Главное Меню"];
langs["Yourscores"] = ["Your score", "Всего набрано очков"];
langs["GameOver"] = ["GAME OVER", "Игра окончена"];
langs["Congratulations"] = ["CONGRATULATIONS !", "Поздравляем!"];
}
}
}//package
Section 105
//Level (Level)
package {
import flash.display.*;
import flash.events.*;
import dgparticles.*;
import flash.geom.*;
import com.greensock.*;
import flash.text.*;
import flash.system.*;
public class Level extends MovieClip {
public const GAME_WIDTH:Number = 800;
public const GAME_HEIGHT:Number = 500;
public const CELL_SEZE:Number = 42;
public const X_OFFSET:Number = 226;
public const Y_OFFSET:Number = 97;
public const COL_COUNT:int = 6;
public const ROW_COUNT:int = 9;
public var btMusic:MovieClip;
public var btPause:SimpleButton;
public var txtScore:TextField;
public var txtScore1:TextField;
public var mc_pers:MovieClip;
public var mc_between_levels:MovieClip;
public var mc_pause:MovieClip;
public var btMenu:SimpleButton;
public var mc_city:MovieClip;
public var mc_game_over:MovieClip;
public var btLogo2:MovieClip;
public var mc_yashik:MovieClip;
public var btSound:MovieClip;
public var mc_confirm_exit:MovieClip;
public var txtLevel:TextField;
public var txtProgress:TextField;
public var mc_lamps:MovieClip;
public var blocksContainer:Sprite;
public var blocks:Array;
public var city:City;
private var txts:Array;
public var needUpdate:Boolean;// = true
public var manager:LevelManager;
public var power:Number;// = 0
public var powerSpeed:Number;
public var bonusCnt:int;// = 0
public var emptyCnt:int;// = 0
public var fixedCnt:int;// = 0
public var pers:Pers;
public var yashik:Yashik;
private var lamps:Lamps;
public var ps:ParticleSystem;
private var visitedBlocks:Array;
public function Level(){
blocksContainer = new Sprite();
city = new City();
txts = new Array();
visitedBlocks = new Array();
super();
addFrameScript(0, frame1);
}
public function get main():Main{
return (Utilites.main);
}
public function initialize():void{
Input.initialize(stage);
FpsCounter.initialize(stage);
manager = new LevelManager(this);
lamps = new Lamps(mc_lamps, this);
checkCity();
city.mcCity = (getChildByName("mc_city") as MovieClip);
addChild(blocksContainer);
city.initialize();
addEventListener(Event.ENTER_FRAME, update);
pers = new Pers((getChildByName("mc_pers") as MovieClip), 15, this);
yashik = new Yashik((getChildByName("mc_yashik") as MovieClip), 15);
var _local1:BitmapLayer = new BitmapLayer(GAME_WIDTH, GAME_HEIGHT, 0, "auto", true);
addChild(_local1);
ps = new ParticleSystem(_local1);
ps.addSettingsByObject({name:"bonus", emissionRate:50, capacity:1000, lifeTime:10000000, angle:360, direction:0, imageName:"particle4", blendMode:"add", radius:0, moveWithEmmiter:0, middle:50, minParticleLife:500, maxParticleLife:1000, minSpin:0, maxSpin:0, minVelocity:20, maxVelocity:20, minGravityY:0, maxGravityY:0, minAcceleration:0, maxAcceleration:0, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:1.2, startScaleY:1.2, midScaleX:1.9, midScaleY:1.9, endScaleX:1, endScaleY:1, startColor:4294953984, midColor:4281584895, endColor:0});
ps.addSettingsByObject({name:"firework1", emissionRate:350, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle11", blendMode:"add", radius:0, moveWithEmmiter:0, middle:50, minParticleLife:1500, maxParticleLife:1000, minSpin:0, maxSpin:0, minVelocity:40, maxVelocity:50, minGravityY:30, maxGravityY:40, minAcceleration:10, maxAcceleration:10, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:0.5, startScaleY:0.5, midScaleX:0.8, midScaleY:0.8, endScaleX:0.5, endScaleY:0.5, startColor:3610496204, midColor:2785004595, endColor:0xFF0000});
ps.addSettingsByObject({name:"firework2", emissionRate:350, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle1", blendMode:"add", radius:0, moveWithEmmiter:1, middle:50, minParticleLife:1500, maxParticleLife:1000, minSpin:0, maxSpin:0, minVelocity:40, maxVelocity:50, minGravityY:30, maxGravityY:40, minAcceleration:10, maxAcceleration:10, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:0.5, startScaleY:0.5, midScaleX:0.8, midScaleY:0.8, endScaleX:0.5, endScaleY:0.5, startColor:3607101593, midColor:2768306175, endColor:6750207});
ps.addSettingsByObject({name:"explode", emissionRate:300, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle13", blendMode:"normal", radius:30, moveWithEmmiter:0, middle:76, minParticleLife:1000, maxParticleLife:2000, minSpin:0, maxSpin:0, minVelocity:20, maxVelocity:30, minGravityY:-50, maxGravityY:-60, minAcceleration:10, maxAcceleration:20, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:2, startScaleY:2, midScaleX:2, midScaleY:2, endScaleX:2.1, endScaleY:2.1, startColor:4278190080, midColor:2026687692, endColor:0xFFFFFF});
ps.addSettingsByObject({name:"smoke", emissionRate:30, capacity:1000, lifeTime:1000000000, angle:360, direction:0, imageName:"particle13", blendMode:"normal", radius:30, moveWithEmmiter:1, middle:76, minParticleLife:1000, maxParticleLife:2000, minSpin:0, maxSpin:0, minVelocity:20, maxVelocity:10, minGravityY:-80, maxGravityY:-60, minAcceleration:10, maxAcceleration:20, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:2, startScaleY:2, midScaleX:1.8, midScaleY:1.8, endScaleX:2.5, endScaleY:2.5, startColor:0, midColor:3033320652, endColor:0xFFFFFF});
loadLevel();
}
private function checkCity():void{
var _local3:MovieClip;
var _local4:int;
var _local5:int;
var _local1:int;
var _local2 = 1;
while (_local2 <= mc_city.numChildren) {
_local3 = (mc_city.getChildByName(("h" + _local2)) as MovieClip);
if (_local3.getChildByName("building") == null){
trace("no building");
};
_local4 = 0;
_local5 = 1;
while (_local5 < _local3.numChildren) {
_local4++;
if (_local3.getChildByName(("w" + _local5)) == null){
trace(("no w" + _local5));
};
_local5++;
};
trace(((("b" + _local2) + " - ") + _local4));
_local1 = (_local1 + _local4);
_local2++;
};
trace(("total windows " + _local1));
}
private function clear():void{
while (blocksContainer.numChildren > 0) {
blocksContainer.removeChildAt(0);
};
}
public function loadLevel():void{
var _local2:Array;
var _local3:int;
var _local4:Block;
bonusCnt = 0;
emptyCnt = 0;
fixedCnt = 0;
clear();
lamps.clear();
manager.prepare();
ps.killAllEmmiters();
powerSpeed = LevelSettings.powSpeed;
blocks = new Array();
var _local1:int;
while (_local1 < ROW_COUNT) {
_local2 = new Array();
_local3 = 0;
while (_local3 < COL_COUNT) {
_local4 = new Block();
_local4.row = _local1;
_local4.col = _local3;
_local4.x = (X_OFFSET + (_local3 * CELL_SEZE));
_local4.y = (Y_OFFSET + (_local1 * CELL_SEZE));
blocksContainer.addChild(_local4);
_local4.initialize(this);
_local2.push(_local4);
_local3++;
};
blocks.push(_local2);
_local1++;
};
}
private function update(_arg1:Event=null):void{
var _local3:int;
MovieClip(parent).txtInfo.text = ((((("fps: " + FpsCounter.fps) + "\nmem: ") + ((System.totalMemory / 0x0400) / 0x0400).toFixed(0)) + " mb\nparticles: ") + ps.parcticlesCount);
updateGUI();
if (((!(manager.update())) && (!(needUpdate)))){
return;
};
if (needUpdate){
updateLogic();
needUpdate = false;
};
var _local2:int;
while (_local2 < blocks.length) {
_local3 = 0;
while (_local3 < blocks[_local2].length) {
blocks[_local2][_local3].update();
_local3++;
};
_local2++;
};
power = Utilites.clamp((power + powerSpeed), 0, 105);
lamps.update();
}
public function updateGUI():void{
txtScore.text = manager.totalScore().toString();
txtLevel.text = ((Lang.getText("Level") + " ") + (LevelSettings.levelIndex + 1).toString());
}
public function updateLogic():void{
var _local2:int;
var _local3:Block;
var _local4:Array;
var _local1:int;
while (_local1 < ROW_COUNT) {
_local2 = 0;
while (_local2 < COL_COUNT) {
_local3 = blocks[_local1][_local2];
if (_local3.state == Block.CONNECTED){
_local3.resetState();
};
_local2++;
};
_local1++;
};
visitedBlocks.splice(0, visitedBlocks.length);
_local1 = 0;
while (_local1 < ROW_COUNT) {
if (blocks[_local1][0].connectionLeft){
connectBlock(_local1, 0);
};
_local1++;
};
_local1 = 0;
while (_local1 < ROW_COUNT) {
_local3 = blocks[_local1][(COL_COUNT - 1)];
if ((((_local3.state == Block.CONNECTED)) && (_local3.connectionRight))){
_local4 = new Array();
getPath(_local1, (COL_COUNT - 1), _local4);
TweenNano.delayedCall(0.6, startAnim, [_local4]);
};
_local1++;
};
}
private function connectBlock(_arg1:int, _arg2:int):void{
var _local3:Block = blocks[_arg1][_arg2];
if ((((visitedBlocks.indexOf(_local3) > -1)) || ((_local3.state == Block.ROTATING)))){
return;
};
visitedBlocks.push(_local3);
if ((((_local3.state == Block.NORMAL)) || ((_local3.state == Block.GENERATING)))){
_local3.block.gotoAndStop(2);
if (_local3.state == Block.NORMAL){
_local3.state = Block.CONNECTED;
};
};
if (_local3.connectedUp()){
connectBlock((_arg1 - 1), _arg2);
};
if (_local3.connectedDown()){
connectBlock((_arg1 + 1), _arg2);
};
if (_local3.connectedLeft()){
connectBlock(_arg1, (_arg2 - 1));
};
if (_local3.connectedRight()){
connectBlock(_arg1, (_arg2 + 1));
};
}
public function startAnim(_arg1:Array):void{
var _local2:Array = checkPath(_arg1);
if (((((_local2) && (!((manager.state == LevelManager.GAME_COMPLETE))))) && (!((manager.state == LevelManager.LEVEL_COMPLETE))))){
new MachedBlocks(_local2, this);
};
}
public function lightUp():void{
power = Utilites.clamp((power - 15), 0, 100);
city.lightUp(1);
manager.lightUp(1);
}
private function checkPath(_arg1:Array):Array{
var _local3:Array;
var _local4:Array;
var _local5:Array;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Block;
var _local2:Block = _arg1[0];
if (_local2.connectionRight){
_local3 = new Array();
getPath(_local2.row, _local2.col, _local3);
_local4 = new Array();
_local5 = new Array();
_local6 = 0;
while (_local6 < _arg1.length) {
_local2 = _arg1[_local6];
if (_local2.state == Block.CONNECTED){
if ((((_local2.col == 0)) && (_local2.connectionLeft))){
_local4.push(_local2);
};
if ((((((_local2.state == Block.CONNECTED)) && ((_local2.col == (COL_COUNT - 1))))) && (_local2.connectionRight))){
_local5.push(_local2);
};
};
_local6++;
};
_local7 = 0;
_local8 = 0;
_local6 = 0;
while (_local6 < _local3.length) {
_local9 = _local3[_local6];
if (_local9.state == Block.CONNECTED){
if ((((((_local9.col == 0)) && (_local9.connectionLeft))) && ((_local4.indexOf(_local9) > -1)))){
_local7++;
};
if ((((((_local9.col == (COL_COUNT - 1))) && (_local9.connectionRight))) && ((_local5.indexOf(_local9) > -1)))){
_local8++;
};
};
_local6++;
};
if ((((_local7 > 0)) && ((_local8 == _local5.length)))){
return (_local3);
};
};
return (null);
}
private function getPath(_arg1:int, _arg2:int, _arg3:Array):void{
var _local4:Block = blocks[_arg1][_arg2];
if ((((_local4.state == Block.ROTATING)) || ((_arg3.indexOf(_local4) > -1)))){
return;
};
_arg3.push(_local4);
if (_local4.connectedUp()){
getPath((_arg1 - 1), _arg2, _arg3);
};
if (_local4.connectedDown()){
getPath((_arg1 + 1), _arg2, _arg3);
};
if (_local4.connectedLeft()){
getPath(_arg1, (_arg2 - 1), _arg3);
};
if (_local4.connectedRight()){
getPath(_arg1, (_arg2 + 1), _arg3);
};
}
private function debugDraw():void{
var _local2:int;
var _local1:int;
while (_local1 < ROW_COUNT) {
_local2 = 0;
while (_local2 < COL_COUNT) {
txts[((_local1 * COL_COUNT) + _local2)].visible = true;
_local2++;
};
_local1++;
};
}
public function cellExists(_arg1:int, _arg2:int):Boolean{
return ((((((((_arg1 > -1)) && ((_arg1 < ROW_COUNT)))) && ((_arg2 > -1)))) && ((_arg2 < COL_COUNT))));
}
public function getBlockAt(_arg1:int, _arg2:int):Block{
if (((((cellExists(_arg1, _arg2)) && (!((blocks[_arg1] == undefined))))) && (!((blocks[_arg1][_arg2] == undefined))))){
return (blocks[_arg1][_arg2]);
};
return (null);
}
public function makeFireWorks():void{
var _local1:Point;
var _local2:Rectangle;
var _local3:Emitter;
var _local4:Array;
var _local5:int;
var _local6:int;
var _local7:Number;
if (manager.state == LevelManager.LEVEL_COMPLETE){
_local1 = new Point(Utilites.randomInt(50, 400), Utilites.randomInt(50, 300));
_local2 = new Rectangle(200, 70, 400, 300);
while (_local2.containsPoint(_local1)) {
_local1 = new Point(Utilites.randomInt(50, 750), Utilites.randomInt(50, 250));
};
_local3 = ps.createEmmiter(("firework" + Utilites.randomInt(1, 2)), _local1);
_local4 = [[3607101593, 2768306175, 6750207], [2691104563, 3191078758, 6750105], [1516634265, 3194382028, 6724095], [1526687487, 2613864191, 16764159], [1526726502, 2617245593, 16777062]];
_local5 = Utilites.randomInt(0, (_local4.length - 1));
_local3.settings.startColor = Color4.HexToARGB(_local4[_local5][0]);
_local3.settings.midColor = Color4.HexToARGB(_local4[_local5][1]);
_local3.settings.endColor = Color4.HexToARGB(_local4[_local5][2]);
_local6 = Utilites.randomInt(2, 2);
_local7 = Utilites.randomNumber(0.1, 0.3);
SoundManager.playOnce(("snd_explode" + _local6), _local7);
TweenNano.delayedCall(0.8, makeFireWorks);
};
}
public function dispose(){
lamps.dispose();
ps.killAllEmmiters();
removeEventListener(Event.ENTER_FRAME, update);
}
function frame1(){
btLogo2.addEventListener(MouseEvent.CLICK, main.gotoSite);
txtScore1.text = Lang.getText("Score");
}
}
}//package
Section 106
//LevelManager (LevelManager)
package {
import flash.events.*;
import flash.geom.*;
import com.greensock.*;
public class LevelManager {
public var state:int;// = 0
private var level:Level;
private var lightLamps:int;// = 0
private var needLamps:int;// = 0
private var score:int;// = 0
private var earnedScore:int;// = 0
private var comboBonus:int;// = 0
public static const GAME:int = 0;
public static const PAUSE:int = 1;
public static const LEVEL_COMPLETE:int = 2;
public static const GAME_COMPLETE:int = 3;
public static const GAME_OVER:int = 4;
public function LevelManager(_arg1:Level){
this.level = _arg1;
_arg1.stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHanldler);
_arg1.btPause.addEventListener(MouseEvent.CLICK, pauseOn);
_arg1.mc_pause.x = 0;
_arg1.mc_pause.y = 0;
_arg1.mc_pause.visible = false;
_arg1.mc_pause.btContinue.addEventListener(MouseEvent.CLICK, pauseOff);
_arg1.mc_between_levels.x = 0;
_arg1.mc_between_levels.y = 0;
_arg1.mc_between_levels.visible = false;
_arg1.mc_between_levels.btContinue.addEventListener(MouseEvent.CLICK, continueGame);
_arg1.mc_confirm_exit.x = 0;
_arg1.mc_confirm_exit.y = 0;
_arg1.mc_confirm_exit.visible = false;
_arg1.mc_confirm_exit.btMainMenu.addEventListener(MouseEvent.CLICK, gotoMainMenu);
_arg1.mc_confirm_exit.btContinue.addEventListener(MouseEvent.CLICK, hideConfirmExit);
_arg1.mc_confirm_exit.btSubmit.addEventListener(MouseEvent.CLICK, submitScore);
_arg1.btMenu.addEventListener(MouseEvent.CLICK, showConfirmExit);
_arg1.mc_game_over.x = 0;
_arg1.mc_game_over.y = 0;
_arg1.mc_game_over.visible = false;
_arg1.mc_game_over.btReplay.addEventListener(MouseEvent.CLICK, continueGame);
_arg1.mc_game_over.btSubmit.addEventListener(MouseEvent.CLICK, submitScore);
_arg1.btMusic.bt.gotoAndStop((SoundManager.enableMusic) ? 1 : 2);
_arg1.btMusic.bt.addEventListener(MouseEvent.CLICK, btMusicClick);
_arg1.btSound.bt.gotoAndStop((SoundManager.enableSound) ? 1 : 2);
_arg1.btSound.bt.addEventListener(MouseEvent.CLICK, btSoundClick);
}
private function btMusicClick(_arg1:MouseEvent):void{
SoundManager.enableMusic = !(SoundManager.enableMusic);
level.btMusic.bt.gotoAndStop((SoundManager.enableMusic) ? 1 : 2);
}
private function btSoundClick(_arg1:MouseEvent):void{
SoundManager.enableSound = !(SoundManager.enableSound);
level.btSound.bt.gotoAndStop((SoundManager.enableSound) ? 1 : 2);
}
private function showConfirmExit(_arg1:MouseEvent):void{
state = PAUSE;
level.mc_confirm_exit.visible = true;
level.setChildIndex(level.mc_confirm_exit, (level.numChildren - 1));
}
private function hideConfirmExit(_arg1:MouseEvent):void{
state = GAME;
level.mc_confirm_exit.visible = false;
}
public function gameOver():void{
if (state == GAME_OVER){
return;
};
MachedBlocks.stopSound();
state = GAME_OVER;
level.pers.explode();
level.mc_game_over.alpha = 0;
level.mc_game_over.visible = true;
level.setChildIndex(level.mc_game_over, (level.numChildren - 1));
TweenNano.to(level.mc_game_over, 1, {alpha:1});
level.ps.createEmmiter("smoke", new Point(103, 250));
}
private function submitScore(_arg1:MouseEvent):void{
saveScore();
completeGame(false);
}
private function gotoMainMenu(_arg1:MouseEvent){
var e = _arg1;
dispose();
Utilites.main.showBlack(function (){
Utilites.main.gotoAndStop("main menu");
});
}
private function dispose():void{
level.dispose();
MachedBlocks.stopSound();
level.stage.removeEventListener(KeyboardEvent.KEY_UP, keyUpHanldler);
}
public function prepare():void{
lightLamps = 0;
comboBonus = 0;
earnedScore = 0;
needLamps = 0;
level.pers.openBox();
level.yashik.openBox();
MachedBlocks.stopSound();
level.city.prepare();
level.power = 0;
score = Saves.totalScore();
if (Saves.saves[LevelSettings.levelIndex].score != undefined){
score = (score - Saves.saves[LevelSettings.levelIndex].score);
};
var _local1:int;
while (_local1 < LevelSettings.buildings.length) {
needLamps = (needLamps + level.city.getWinCount(LevelSettings.buildings[_local1]));
_local1++;
};
updateProgress();
var _local2:int = (level.numChildren - 1);
level.setChildIndex(level.ps.bitmapLayer, _local2);
level.setChildIndex(level.mc_pers, _local2);
}
public function totalScore():int{
return ((score + earnedScore));
}
private function keyUpHanldler(_arg1:KeyboardEvent):void{
if ((((_arg1.keyCode == 27)) || ((_arg1.keyCode == 80)))){
if (state == GAME){
pauseOn();
} else {
if (state == PAUSE){
pauseOff();
};
};
};
}
private function pauseOn(_arg1:MouseEvent=null):void{
if (state != GAME){
return;
};
state = PAUSE;
level.mc_pause.visible = true;
level.setChildIndex(level.mc_pause, (level.numChildren - 1));
}
private function pauseOff(_arg1:MouseEvent=null):void{
state = GAME;
level.mc_pause.visible = false;
}
public function completeLevel():void{
saveScore();
LevelSettings.levelIndex++;
if (LevelSettings.levelIndex >= Main.TOTAL_LEVELS){
completeGame();
return;
};
state = LEVEL_COMPLETE;
TweenNano.delayedCall(1.2, completeLevel2);
SoundManager.playOnce("snd_win", 0.8);
}
private function saveScore():void{
var _local1:Number = Saves.saves[LevelSettings.levelIndex].score;
if (earnedScore > _local1){
Saves.saves[LevelSettings.levelIndex].score = earnedScore;
Saves.save();
};
}
private function completeLevel2():void{
level.main.showBlack(completeLevel3);
}
private function completeLevel3():void{
MachedBlocks.stopSound();
level.main.hideBlack();
level.makeFireWorks();
if (level.ps.bitmapLayer.parent){
level.ps.bitmapLayer.parent.removeChild(level.ps.bitmapLayer);
};
level.mc_between_levels.addChildAt(level.ps.bitmapLayer, 1);
level.setChildIndex(level.mc_between_levels, (level.numChildren - 1));
level.mc_between_levels.visible = true;
level.mc_between_levels.txtEarned.text = (earnedScore - comboBonus).toString();
level.mc_between_levels.txtBonus.text = comboBonus.toString();
level.mc_between_levels.txtTotal.text = Saves.totalScore().toString();
}
private function completeGame(_arg1:Boolean=true):void{
var win = _arg1;
state = GAME_COMPLETE;
Main.isVin = true;
dispose();
Utilites.main.showBlack(function (){
Utilites.main.gotoAndStop("end game");
});
}
private function continueGame(_arg1:MouseEvent):void{
level.main.showBlack(continueGame2);
if (Saves.saves[LevelSettings.levelIndex].score == undefined){
Saves.saves[LevelSettings.levelIndex].score = 0;
Saves.save();
};
}
private function continueGame2():void{
state = GAME;
if (level.ps.bitmapLayer.parent){
level.ps.bitmapLayer.parent.removeChild(level.ps.bitmapLayer);
};
level.addChild(level.ps.bitmapLayer);
level.mc_between_levels.visible = false;
level.mc_game_over.visible = false;
level.loadLevel();
level.main.hideBlack();
level.ps.killAllEmmiters();
}
public function lightUp(_arg1:int):void{
earnedScore = (earnedScore + 1000);
lightLamps = (lightLamps + _arg1);
updateProgress();
}
private function updateProgress():void{
var _local4:int;
var _local5:String;
var _local6:int;
var _local7:int;
var _local1:Array = LevelSettings.buildings;
var _local2 = "";
var _local3:int;
while (_local3 < _local1.length) {
_local4 = _local1[_local3];
_local5 = LevelSettings.names[(_local4 - 1)];
_local6 = level.city.getWinCount(_local4);
_local7 = level.city.getLightWinCount(_local4);
if (_local3 > 0){
_local2 = (_local2 + ", ");
};
_local2 = (_local2 + ((((_local5 + " ") + _local7) + "/") + _local6));
_local3++;
};
level.txtProgress.text = _local2;
}
public function addCombo(_arg1:int):void{
var _local2:Number = 1;
if (_arg1 == 3){
_local2 = 1.5;
};
if (_arg1 == 4){
_local2 = 2;
};
if (_arg1 == 5){
_local2 = 2.5;
};
if (_arg1 > 5){
_local2 = 3;
};
var _local3:Number = ((1000 * _arg1) * _local2);
earnedScore = (earnedScore + _local3);
comboBonus = (comboBonus + _local3);
var _local4:ComboText = new ComboText(_arg1, _local3, level);
SoundManager.playOnce("snd_combo", 0.2);
}
public function addBonusScore():void{
earnedScore = (earnedScore + 2000);
}
public function update():Boolean{
if (state != GAME){
return (false);
};
if ((((((((lightLamps >= needLamps)) && (!((state == LEVEL_COMPLETE))))) && ((MachedBlocks.count == 0)))) && ((AddBonusAnim.count == 0)))){
completeLevel();
};
return (true);
}
}
}//package
Section 107
//LevelSettings (LevelSettings)
package {
public class LevelSettings {
public static var levelIndex:int = 0;
private static var _powSpeed:Array = [0.01, 0.015, 0.02, 0.025, 0.03, 0.035, 0.04, 0.045, 0.05, 0.055, 0.06, 0.065, 0.07, 0.07, 0.06];
private static var _bonusCnt:Array = [1, 2, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7];
private static var _emptyCnt:Array = [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 3, 3];
private static var _fixedCnt:Array = [0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4];
private static var _buildings:Array = [[6], [2], [11], [1], [3], [8], [16], [4], [7], [13], [9], [15], [5], [10], [14]];
public static var names:Array = ["TMC Tower", "World Building", "Atlantic Building", "Sky Plaza", "Power Electric Tower", "Pyramid Plaza", "Dream Gate Tower", "Union Tower", "Central TV Building", "EV Motors Building", "Freedom Tower", "Empire State Tower", "City Finance Building", "City Hall", "Max Tower", "National Center"];
public static function get powSpeed():Number{
return (_powSpeed[levelIndex]);
}
public static function get bonusCnt():int{
return (_bonusCnt[levelIndex]);
}
public static function get emptyCnt():int{
return (_emptyCnt[levelIndex]);
}
public static function get fixedCnt():int{
return (_fixedCnt[levelIndex]);
}
public static function get buildings():Array{
return (_buildings[levelIndex]);
}
public static function getBuildingIndicies():Array{
var _local3:int;
var _local1:Array = new Array();
var _local2:int;
while (_local2 < levelIndex) {
_local3 = 0;
while (_local3 < _buildings[_local2].length) {
_local1.push(_buildings[_local2][_local3]);
_local3++;
};
_local2++;
};
return (_local1);
}
}
}//package
Section 108
//MachedBlocks (MachedBlocks)
package {
import flash.display.*;
import com.greensock.*;
public class MachedBlocks {
private var level:Level;
private var blocks:Array;
private var animCount:int;// = 0
private var animCountTok:int;// = 0
private var bulbCnt:int;// = 0
public static var count:int = 0;
private static var tokSnd:DGSound;
public function MachedBlocks(_arg1:Array, _arg2:Level){
var _local4:Block;
super();
this.level = _arg2;
this.blocks = _arg1;
if ((((count == 0)) && ((_arg2.manager.state == LevelManager.GAME)))){
tokSnd = SoundManager.playLoop("snd_tok", 0.5);
};
count++;
var _local3:int;
while (_local3 < _arg1.length) {
_local4 = _arg1[_local3];
_local4.state = Block.WAIT_ANIM;
if ((((_local4.col == 0)) && (_local4.connectionLeft))){
_local4.electricAnim(animNext, 3);
animCount++;
};
_local3++;
};
}
private function animNext(_arg1:Block):void{
var _local4:int;
animCount--;
if (blocks.indexOf(_arg1) == -1){
blocks.push(_arg1);
};
var _local2:int = _arg1.row;
var _local3:int = _arg1.col;
if ((((_local3 == (level.COL_COUNT - 1))) && (_arg1.connectionRight))){
addTokAnimRight(_arg1);
};
if (((_arg1.connectedUp()) && (level.blocks[(_local2 - 1)][_local3].electricAnim(animNext, 2)))){
animCount++;
};
if (((_arg1.connectedDown()) && (level.blocks[(_local2 + 1)][_local3].electricAnim(animNext, 0)))){
animCount++;
};
if (((_arg1.connectedLeft()) && (level.blocks[_local2][(_local3 - 1)].electricAnim(animNext, 1)))){
animCount++;
};
if (((_arg1.connectedRight()) && (level.blocks[_local2][(_local3 + 1)].electricAnim(animNext, 3)))){
animCount++;
};
if (animCount == 0){
if (bulbCnt > 1){
level.manager.addCombo(bulbCnt);
};
_local4 = 0;
while (_local4 < blocks.length) {
blocks[_local4].generate();
_local4++;
};
onFinishAnim();
};
}
private function addTokAnimRight(_arg1:Block):void{
var _local2:MovieClip;
bulbCnt++;
animCountTok++;
_local2 = new TokAnimRight();
_local2.x = (_arg1.x + (_arg1.width / 2));
_local2.y = _arg1.y;
level.addChild(_local2);
TweenNano.delayedCall(_local2.totalFrames, removeTokAnimRight, [_local2], true);
}
private function removeTokAnimRight(_arg1:MovieClip):void{
_arg1.parent.removeChild(_arg1);
var _local2:MovieClip = new ProvodAnim();
_local2.x = 472;
_local2.y = 267;
_local2.gotoAndPlay(2);
level.addChild(_local2);
TweenNano.delayedCall((_local2.totalFrames - 1), lightUp, [_local2], true);
}
private function lightUp(_arg1:MovieClip):void{
_arg1.parent.removeChild(_arg1);
level.lightUp();
animCountTok--;
onFinishAnim();
}
private function onFinishAnim():void{
if ((((animCount == 0)) && ((animCountTok == 0)))){
if (count > 0){
count--;
};
if (count == 0){
stopSound();
};
};
}
public static function stopSound():void{
count = 0;
if (tokSnd){
tokSnd.stop();
};
}
}
}//package
Section 109
//Main (Main)
package {
import flash.display.*;
import flash.events.*;
import com.greensock.*;
import Playtomic.*;
import mochi.as3.*;
import flash.net.*;
import CPMStar.*;
import flash.text.*;
import flash.system.*;
public class Main extends MovieClip {
public var txtScore:TextField;
public var level15:SimpleButton;
public var btLevel14:MovieClip;
public var lock8:MovieClip;
public var btMusic:MovieClip;
public var lock9:MovieClip;
public var pr:preloader;
public var btLevel11:MovieClip;
public var mc_credits:MovieClip;
public var btMoreGames:SimpleButton;
public var btLevel10:MovieClip;
public var level1:SimpleButton;
public var btLevel13:MovieClip;
public var level2:SimpleButton;
public var usFlag:MovieClip;
public var adBox:MovieClip;
public var txtInfo:TextField;
public var level3:SimpleButton;
public var btLevel12:MovieClip;
public var lock10:MovieClip;
public var btLevel8:MovieClip;
public var btLevel9:MovieClip;
public var level4:SimpleButton;
public var lock11:MovieClip;
public var txtHowToPlay:TextField;
public var level5:SimpleButton;
public var lock12:MovieClip;
public var ggSplash:MovieClip;
public var level6:SimpleButton;
public var lock13:MovieClip;
public var btLevel6:MovieClip;
public var btPlay:SimpleButton;
public var bg:MainMenu;
public var btPlay2:SimpleButton;
public var level7:SimpleButton;
public var btLevel7:MovieClip;
public var btBack:SimpleButton;
public var lock14:MovieClip;
public var lock1:MovieClip;
public var txtCongrat:TextField;
public var level:Level;
public var level8:SimpleButton;
public var btLevel4:MovieClip;
public var lock15:MovieClip;
public var lock2:MovieClip;
public var btSound:MovieClip;
public var txtGameOver:TextField;
public var level9:SimpleButton;
public var btLevel5:MovieClip;
public var level10:SimpleButton;
public var lock3:MovieClip;
public var hgSplash:MovieClip;
public var btContinue:SimpleButton;
public var level11:SimpleButton;
public var lock4:MovieClip;
public var btLevel2:MovieClip;
public var ruFlag:MovieClip;
public var btLevel3:MovieClip;
public var level12:SimpleButton;
public var lock5:MovieClip;
public var txtSelLevel:TextField;
public var btLogo:MovieClip;
public var level13:SimpleButton;
public var lock6:MovieClip;
public var Add_link:MovieClip;
public var btLevel15:MovieClip;
public var level14:SimpleButton;
public var lock7:MovieClip;
public var btLevel1:MovieClip;
public var btCredits:SimpleButton;
public var CPMStarContentSpotID:String;
public var ad:DisplayObject;
public var curSplash:MovieClip;
public var scoreList:String;
public var i:int;
public var bt:SimpleButton;
public var btLock:DisplayObject;
public var btBg:DisplayObject;
public var playerscore:int;
public var o:Object;
public var boardID:String;
private var blackMC:Sprite;
public static const TOTAL_LEVELS:int = 15;
public static var isVin:Boolean = false;
public function Main(){
addFrameScript(0, frame1, 1, frame2, 3, frame4, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10);
super();
Lang.init();
if (Capabilities.language == "ru"){
Lang.curLang = 1;
} else {
Lang.curLang = 0;
};
Utilites.main = this;
stage.scaleMode = StageScaleMode.EXACT_FIT;
Saves.load();
blackMC = new Sprite();
}
public function gomm(_arg1:MouseEvent){
var gomm2:Function;
var e = _arg1;
gomm2 = function (){
gotoAndStop("splash");
};
removeChild(adBox);
btPlay2.removeEventListener(MouseEvent.CLICK, gomm);
showBlack(gomm2);
}
public function isUrl(_arg1:Array):Boolean{
var _local2:String = stage.loaderInfo.loaderURL;
var _local3:Number = (_local2.indexOf("://") + 3);
var _local4:Number = _local2.indexOf("/", _local3);
var _local5:String = _local2.substring(_local3, _local4);
var _local6:Number = (_local5.lastIndexOf(".") - 1);
var _local7:Number = (_local5.lastIndexOf(".", _local6) + 1);
_local5 = _local5.substring(_local7, _local5.length);
trace(("domain = " + _local5));
var _local8:int;
while (_local8 < _arg1.length) {
if (_local5 == _arg1[_local8]){
return (true);
};
_local8++;
};
return (false);
}
public function upd(_arg1:Event){
if (curSplash.currentFrame == curSplash.totalFrames){
curSplash.stop();
curSplash.removeEventListener(Event.ENTER_FRAME, upd);
stage.frameRate = 60;
gotoAndStop("main menu");
};
}
public function goSelectLevel(_arg1:MouseEvent):void{
var e = _arg1;
SoundManager.playButtonClick();
showBlack(function (){
gotoAndStop("select level");
});
Log.Play();
}
public function showCredits(_arg1:MouseEvent):void{
mc_credits.y = 0;
mc_credits.alpha = 0;
setChildIndex(mc_credits, (numChildren - 1));
TweenNano.to(mc_credits, 0.7, {alpha:1});
SoundManager.playButtonClick();
}
public function hideCredits(_arg1:MouseEvent):void{
var e = _arg1;
SoundManager.playButtonClick();
TweenNano.to(mc_credits, 0.7, {alpha:0, onComplete:function (){
mc_credits.y = -500;
}});
}
public function gotoDGSite(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://dg-company.com/"), "_blank");
}
public function btMusicClick(_arg1:MouseEvent):void{
SoundManager.enableMusic = !(SoundManager.enableMusic);
btMusic.bt.gotoAndStop((SoundManager.enableMusic) ? 1 : 2);
}
public function btSoundClick(_arg1:MouseEvent):void{
SoundManager.enableSound = !(SoundManager.enableSound);
btSound.bt.gotoAndStop((SoundManager.enableSound) ? 1 : 2);
}
public function gotoAddLink(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.getgameplay.com/page/3/Games-to-your-site.html"), "_blank");
}
public function usFlagHandler(_arg1:MouseEvent):void{
if (Lang.curLang != 0){
Lang.curLang = 0;
gotoAndPlay("lang reset");
SoundManager.stopAll();
};
}
public function ruFlagHandler(_arg1:MouseEvent):void{
if (Lang.curLang != 1){
Lang.curLang = 1;
gotoAndPlay("lang reset");
SoundManager.stopAll();
};
}
public function startGame(_arg1:MouseEvent){
var e = _arg1;
SoundManager.playButtonClick();
var ind:int = (parseInt(e.target.name.substring(5)) - 1);
LevelSettings.levelIndex = ind;
if (ind == 0){
showBlack(function (){
gotoAndStop("how_to_play");
});
} else {
Utilites.main.playGame();
};
}
public function goMainMenu(_arg1:MouseEvent){
var e = _arg1;
SoundManager.playButtonClick();
showBlack(function (){
gotoAndStop("main menu");
});
}
public function continueHandler(_arg1:MouseEvent){
var e = _arg1;
showBlack(function (){
gotoAndStop("main menu");
});
}
public function hideBlack():void{
addChild(blackMC);
blackMC.alpha = 1;
TweenNano.to(blackMC, 1, {alpha:0, onComplete:function (){
removeChild(blackMC);
}});
}
public function showBlack(_arg1:Function=null, _arg2:uint=0, _arg3:Number=0.5):void{
var onComplete = _arg1;
var color = _arg2;
var duration = _arg3;
blackMC.graphics.clear();
blackMC.graphics.beginFill(color);
blackMC.graphics.drawRect(0, 0, 800, 500);
addChild(blackMC);
blackMC.alpha = 0;
TweenNano.to(blackMC, duration, {alpha:1, onComplete:function ():void{
removeChild(blackMC);
if (onComplete != null){
onComplete.call();
};
}});
}
public function playGame(_arg1:MouseEvent=null):void{
showBlack(play2);
}
private function play2():void{
gotoAndPlay("game");
SoundManager.playGameMusic();
}
public function gotoSite(_arg1:MouseEvent=null){
if (Lang.curLang == 0){
navigateToURL(new URLRequest("http://www.getgameplay.com/?utm_source=Wiring&utm_medium=Game&utm_campaign=WiringGame"), "_blank");
} else {
navigateToURL(new URLRequest("http://hotgames.kz/"), "_blank");
};
SoundManager.playOnce("snd_click", 1);
}
public function gotoSite2(_arg1:MouseEvent=null){
if (Lang.curLang == 0){
navigateToURL(new URLRequest("http://www.getgameplay.com/?utm_source=Wiring&utm_medium=Game&utm_campaign=WiringGame"), "_blank");
} else {
navigateToURL(new URLRequest("http://hotgames.kz/"), "_blank");
};
SoundManager.playOnce("snd_click", 1);
}
function frame1(){
stage.showDefaultContextMenu = false;
stage.scaleMode = StageScaleMode.EXACT_FIT;
tabChildren = false;
MochiServices.connect("db652b945b19c4e0", root);
Log.View(4660, "b7175e6254d446d1", root.loaderInfo.loaderURL);
}
function frame2(){
stop();
btPlay2.visible = false;
btPlay2.addEventListener(MouseEvent.CLICK, gomm);
pr.update();
if (!isUrl(["kongregate.com"])){
CPMStarContentSpotID = "5719Q0B2BBA40";
ad = new AdLoader(CPMStarContentSpotID);
adBox.addChild(ad);
} else {
adBox.visible = false;
};
}
function frame4(){
if (Lang.curLang == 1){
curSplash = hgSplash;
ggSplash.visible = false;
ggSplash.stop();
} else {
curSplash = ggSplash;
hgSplash.visible = false;
hgSplash.stop();
stage.frameRate = 30;
};
curSplash.addEventListener(Event.ENTER_FRAME, upd);
ggSplash.buttonMode = true;
ggSplash.addEventListener(MouseEvent.CLICK, gotoSite2);
hgSplash.buttonMode = true;
hgSplash.addEventListener(MouseEvent.CLICK, gotoSite2);
}
function frame6(){
stop();
hideBlack();
SoundManager.initialize(stage);
SoundManager.playMenuMusic();
btPlay.addEventListener(MouseEvent.CLICK, goSelectLevel);
btCredits.addEventListener(MouseEvent.CLICK, showCredits);
mc_credits.btBack.addEventListener(MouseEvent.CLICK, hideCredits);
mc_credits.btDG.addEventListener(MouseEvent.CLICK, gotoDGSite);
if (bg.filters.length > 0){
this.filters = bg.filters;
bg.filters = [];
};
btMusic.bt.gotoAndStop((SoundManager.enableMusic) ? 1 : 2);
btMusic.bt.addEventListener(MouseEvent.CLICK, btMusicClick);
btSound.bt.gotoAndStop((SoundManager.enableSound) ? 1 : 2);
btSound.bt.addEventListener(MouseEvent.CLICK, btSoundClick);
btMoreGames.addEventListener(MouseEvent.CLICK, gotoSite);
btLogo.addEventListener(MouseEvent.CLICK, gotoSite);
Add_link.buttonMode = true;
Add_link.visible = (Lang.curLang == 0);
trace(Add_link.visible);
Add_link.addEventListener(MouseEvent.CLICK, gotoAddLink);
usFlag.addEventListener(MouseEvent.CLICK, usFlagHandler);
ruFlag.addEventListener(MouseEvent.CLICK, ruFlagHandler);
}
function frame7(){
hideBlack();
txtSelLevel.text = Lang.getText("SelLevel");
scoreList = "";
i = 1;
while (i <= Main.TOTAL_LEVELS) {
bt = (getChildByName(("level" + i)) as SimpleButton);
bt.visible = !((Saves.saves[(i - 1)].score == undefined));
bt.addEventListener(MouseEvent.CLICK, startGame);
btLock = getChildByName(("lock" + i));
btBg = getChildByName(("btLevel" + i));
btLock.x = btBg.x;
btLock.y = btBg.y;
btLock.visible = !(bt.visible);
btBg.visible = bt.visible;
if (Saves.saves[(i - 1)].score != undefined){
scoreList = (scoreList + (((i + ") ") + Saves.saves[(i - 1)].score) + "; "));
};
i++;
};
trace(scoreList);
btBack.addEventListener(MouseEvent.CLICK, goMainMenu);
}
function frame8(){
stop();
hideBlack();
txtHowToPlay.text = Lang.getText("HowToPlay");
}
function frame9(){
stop();
level.initialize();
hideBlack();
}
function frame10(){
hideBlack();
txtScore.text = Saves.totalScore().toString();
playerscore = Saves.totalScore();
txtGameOver.visible = false;
txtCongrat.visible = true;
txtCongrat.text = Lang.getText("Congratulations");
btContinue.addEventListener(MouseEvent.CLICK, continueHandler);
Saves.clear();
o = {n:[4, 6, 8, 4, 7, 3, 7, 11, 14, 11, 8, 12, 9, 9, 15, 4], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
boardID = o.f(0, "");
MochiScores.showLeaderboard({boardID:boardID, score:playerscore});
}
}
}//package
Section 110
//MainMenu (MainMenu)
package {
import flash.display.*;
import fl.motion.*;
public class MainMenu extends MovieClip {
public var mc_blue_lamp:MovieClip;
public var mc_yellow_lamp:MovieClip;
public var mc_lamp:MovieClip;
private var yLamp:BlinkingLamp;
private var bLamp:BlinkingLamp;
public var blinkCount:int;// = 0
private var animator:Animator;
public function MainMenu(){
yLamp = new BlinkingLamp((getChildByName("mc_yellow_lamp") as MovieClip), 20, this);
yLamp.animator.play(40);
bLamp = new BlinkingLamp((getChildByName("mc_blue_lamp") as MovieClip), 20, this);
bLamp.animator.play(10);
var _local1:XML = <Motion duration="100" xmlns="fl.motion.*" xmlns:geom="flash.geom.*" xmlns:filters="flash.filters.*">
<source>
<Source frameRate="25" x="259" y="217" scaleX="1" scaleY="1" rotation="0" elementType="movie clip" symbolName="main menu/main menu/lamp blue">
<dimensions>
<geom:Rectangle left="-15" top="0" width="30" height="80"/>
</dimensions>
<transformationPoint>
<geom:Point x="0.5" y="0"/>
</transformationPoint>
</Source>
</source>
<Keyframe index="0" tweenSnap="true">
<tweens>
<SimpleEase ease="0.5"/>
</tweens>
</Keyframe>
<Keyframe index="24" tweenSnap="true" rotation="-7">
<tweens>
<SimpleEase ease="-0.5"/>
</tweens>
</Keyframe>
<Keyframe index="49" tweenSnap="true" rotation="-0.3">
<tweens>
<SimpleEase ease="0.5"/>
</tweens>
</Keyframe>
<Keyframe index="74" tweenSnap="true" rotation="7">
<tweens>
<SimpleEase ease="-0.5"/>
</tweens>
</Keyframe>
<Keyframe index="99" tweenSnap="true" rotation="0">
<tweens>
<SimpleEase ease="0"/>
</tweens>
</Keyframe>
</Motion>
;
animator = new Animator(_local1, mc_lamp);
animator.repeatCount = 9999999999999;
animator.play(50);
}
}
}//package
Section 111
//MCBonus (MCBonus)
package {
import flash.display.*;
public dynamic class MCBonus extends MovieClip {
public var mc:MovieClip;
}
}//package
Section 112
//particle1 (particle1)
package {
import flash.display.*;
public dynamic class particle1 extends BitmapData {
public function particle1(_arg1:int=32, _arg2:int=32){
super(_arg1, _arg2);
}
}
}//package
Section 113
//particle11 (particle11)
package {
import flash.display.*;
public dynamic class particle11 extends BitmapData {
public function particle11(_arg1:int=32, _arg2:int=32){
super(_arg1, _arg2);
}
}
}//package
Section 114
//particle13 (particle13)
package {
import flash.display.*;
public dynamic class particle13 extends BitmapData {
public function particle13(_arg1:int=32, _arg2:int=32){
super(_arg1, _arg2);
}
}
}//package
Section 115
//particle4 (particle4)
package {
import flash.display.*;
public dynamic class particle4 extends BitmapData {
public function particle4(_arg1:int=32, _arg2:int=32){
super(_arg1, _arg2);
}
}
}//package
Section 116
//Pers (Pers)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
public class Pers extends CustomFPSMovie {
private var state:int;// = 0
private var fonAnim:int;// = 2
private var fonOffset:int;// = 25
private var pauseTime:int;// = 0
private var boomTime:int;// = 0
private var level:Level;
private static const OPEN:int = 0;
private static const FONAR:int = 1;
private static const BOOM:int = 2;
public function Pers(_arg1:MovieClip, _arg2:int, _arg3:Level){
super(_arg1, _arg2);
this.level = _arg3;
}
private function get fonFrame():int{
return ((mc.currentFrame - fonOffset));
}
public function openBox():void{
play();
mc.gotoAndStop(1);
state = OPEN;
pauseTime = 0;
animDir = 1;
}
public function explode():void{
fps = 15;
state = BOOM;
animDir = FORWARD;
mc.gotoAndStop("pered vzrivom");
boomTime = (0.3 * fps);
pauseTime = 0;
level.ps.createEmmiter("explode", new Point(103, 250));
SoundManager.playOnce("snd_explode_box", 0.1);
}
override protected function updateAnimation(_arg1:TimerEvent):void{
if (pauseTime > 0){
pauseTime--;
return;
};
if (((!((state == FONAR))) && ((mc.currentLabel == "fonar")))){
fps = 10;
state = FONAR;
};
if ((((state == BOOM)) && ((mc.currentLabel == "konec_vzriva")))){
boomTime--;
if (boomTime < 0){
fonAnim = 5;
animDir = BACKWARD;
super.updateAnimation(_arg1);
};
return;
};
super.updateAnimation(_arg1);
if (state == FONAR){
if ((((fonAnim == 1)) && ((fonFrame == 11)))){
fonAnim = 2;
mc.gotoAndStop((fonOffset + 0));
pauseTime = (fps * Utilites.randomNumber(2, 3));
} else {
if ((((fonAnim == 2)) && ((fonFrame == 9)))){
fonAnim = 3;
animDir = BACKWARD;
pauseTime = (fps * Utilites.randomNumber(2, 3));
} else {
if ((((fonAnim == 3)) && ((fonFrame == 4)))){
fonAnim = 4;
animDir = FORWARD;
pauseTime = (fps * Utilites.randomNumber(2, 3));
} else {
if ((((fonAnim == 4)) && ((fonFrame == 9)))){
fonAnim = 5;
animDir = BACKWARD;
pauseTime = (fps * Utilites.randomNumber(2, 3));
} else {
if ((((fonAnim == 5)) && ((fonFrame == 6)))){
fonAnim = 6;
animDir = BACKWARD;
pauseTime = (fps * Utilites.randomNumber(2, 3));
} else {
if ((((fonAnim == 6)) && ((fonFrame == 3)))){
fonAnim = 7;
animDir = FORWARD;
pauseTime = (fps * Utilites.randomNumber(2, 3));
} else {
if ((((fonAnim == 7)) && ((fonFrame == 11)))){
fonAnim = 2;
animDir = FORWARD;
mc.gotoAndStop((fonOffset + 0));
pauseTime = (fps * Utilites.randomNumber(2, 3));
};
};
};
};
};
};
};
};
}
}
}//package
Section 117
//preloader (preloader)
package {
import flash.display.*;
import flash.events.*;
public class preloader extends MovieClip {
public var percent:Number;// = 0
public function preloader(){
addEventListener(Event.ENTER_FRAME, update);
}
public function update(_arg1:Event=null):void{
var _local2:Number = loaderInfo.bytesLoaded;
var _local3:Number = loaderInfo.bytesTotal;
if (_local3 > 0){
percent = Math.floor(((_local2 / _local3) * 100));
};
gotoAndStop((percent + 1));
if ((((_local2 >= _local3)) || ((_local3 == 0)))){
if (hasEventListener(Event.ENTER_FRAME)){
removeEventListener(Event.ENTER_FRAME, update);
};
if ((parent is MovieClip)){
(parent as MovieClip).getChildByName("btPlay2").visible = true;
};
};
}
}
}//package
Section 118
//ProvodAnim (ProvodAnim)
package {
import flash.display.*;
public dynamic class ProvodAnim extends MovieClip {
public function ProvodAnim(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 119
//Saves (Saves)
package {
import flash.utils.*;
import flash.net.*;
public class Saves {
public static var saves:Array = new Array();
public static function save(){
var _local1:ByteArray = new ByteArray();
var _local2:int;
while (_local2 < Main.TOTAL_LEVELS) {
if (saves[_local2] != undefined){
_local1.writeObject(saves[_local2]);
};
_local2++;
};
var _local3:SharedObject = SharedObject.getLocal("wiring_game_by_dgcompany");
_local3.data.saves = _local1;
_local3.flush();
}
public static function clear():void{
var _local1:SharedObject = SharedObject.getLocal("wiring_game_by_dgcompany");
_local1.clear();
_local1.flush();
}
public static function load(){
var i:int;
var obj:Object;
var savesObject:SharedObject = SharedObject.getLocal("wiring_game_by_dgcompany");
var data:ByteArray = savesObject.data.saves;
i = 0;
while (i < Main.TOTAL_LEVELS) {
try {
obj = data.readObject();
saves[i] = obj;
} catch(err:Error) {
saves[i] = new Object();
};
i = (i + 1);
};
if (saves[0].score == undefined){
saves[0].score = 0;
};
}
public static function totalScore():int{
var _local1:int;
var _local2:int;
while (_local2 < Main.TOTAL_LEVELS) {
if (saves[_local2].score != undefined){
_local1 = (_local1 + saves[_local2].score);
};
_local2++;
};
return (_local1);
}
}
}//package
Section 120
//snd_bonus (snd_bonus)
package {
import flash.media.*;
public dynamic class snd_bonus extends Sound {
}
}//package
Section 121
//snd_click (snd_click)
package {
import flash.media.*;
public dynamic class snd_click extends Sound {
}
}//package
Section 122
//snd_combo (snd_combo)
package {
import flash.media.*;
public dynamic class snd_combo extends Sound {
}
}//package
Section 123
//snd_explode_box (snd_explode_box)
package {
import flash.media.*;
public dynamic class snd_explode_box extends Sound {
}
}//package
Section 124
//snd_explode1 (snd_explode1)
package {
import flash.media.*;
public dynamic class snd_explode1 extends Sound {
}
}//package
Section 125
//snd_explode2 (snd_explode2)
package {
import flash.media.*;
public dynamic class snd_explode2 extends Sound {
}
}//package
Section 126
//snd_game (snd_game)
package {
import flash.media.*;
public dynamic class snd_game extends Sound {
}
}//package
Section 127
//snd_menu (snd_menu)
package {
import flash.media.*;
public dynamic class snd_menu extends Sound {
}
}//package
Section 128
//snd_tok (snd_tok)
package {
import flash.media.*;
public dynamic class snd_tok extends Sound {
}
}//package
Section 129
//snd_win (snd_win)
package {
import flash.media.*;
public dynamic class snd_win extends Sound {
}
}//package
Section 130
//SoundManager (SoundManager)
package {
import flash.display.*;
import flash.events.*;
import com.greensock.*;
public class SoundManager {
private static var sounds:Array = new Array();
private static var _enableSound:Boolean = true;
private static var _enableMusic:Boolean = true;
private static var initialized:Boolean = false;
private static var musicSnds:Array = ["snd_game", "snd_menu"];
private static var menuMusic:DGSound;
private static var gameMusic:DGSound;
public static function get enableSound():Boolean{
return (_enableSound);
}
public static function set enableSound(_arg1:Boolean):void{
var _local3:DGSound;
_enableSound = _arg1;
var _local2:int;
while (_local2 < sounds.length) {
_local3 = sounds[_local2];
if (musicSnds.indexOf(_local3.name) == -1){
if (_enableSound){
_local3.restoreVolume();
} else {
_local3.vol = 0;
};
};
_local2++;
};
}
public static function get enableMusic():Boolean{
return (_enableMusic);
}
public static function set enableMusic(_arg1:Boolean):void{
var _local3:DGSound;
_enableMusic = _arg1;
var _local2:int;
while (_local2 < sounds.length) {
_local3 = sounds[_local2];
if (musicSnds.indexOf(_local3.name) > -1){
if (_enableMusic){
_local3.restoreVolume();
} else {
_local3.vol = 0;
};
};
_local2++;
};
}
public static function initialize(_arg1:Stage):void{
if (!initialized){
_arg1.addEventListener(Event.ENTER_FRAME, update);
};
initialized = true;
}
public static function update(_arg1:Event=null):void{
if (!enableSound){
return;
};
var _local2:int = (sounds.length - 1);
while (_local2 >= 0) {
if (sounds[_local2].played){
sounds[_local2].loops--;
if (sounds[_local2].loops <= 0){
sounds.splice(_local2, 1);
};
};
_local2--;
};
}
public static function playLoop(_arg1:String, _arg2:Number):DGSound{
var _local4:Number;
var _local3:DGSound = new DGSound(Utilites.getSoundByName(_arg1), _arg1);
if (musicSnds.indexOf(_arg1) > -1){
_local4 = (enableMusic) ? _arg2 : 0;
} else {
_local4 = (enableSound) ? _arg2 : 0;
};
_local3.play(999999, _arg2, _local4);
sounds.push(_local3);
return (_local3);
}
public static function playOnce(_arg1:String, _arg2:Number):DGSound{
if (sounds.length >= 32){
return (null);
};
var _local3:DGSound = new DGSound(Utilites.getSoundByName(_arg1), _arg1);
var _local4:int = getCount(_arg1);
_arg2 = Utilites.clamp(_arg2, 0, 10);
if (_arg2 == 0){
return (null);
};
var _local5:Number = (enableSound) ? _arg2 : 0;
_local3.play(0, _arg2, _local5);
sounds.push(_local3);
return (_local3);
}
public static function removeSound(_arg1:DGSound):void{
if (_arg1 == null){
return;
};
var _local2:int = (sounds.length - 1);
while (_local2 >= 0) {
if (_arg1.name == sounds[_local2].name){
sounds[_local2].stop();
sounds.splice(_local2, 1);
return;
};
_local2--;
};
}
public static function getCount(_arg1:String):int{
var _local2:int;
var _local3:int;
while (_local3 < sounds.length) {
if (_arg1 == sounds[_local3].name){
_local2++;
};
_local3++;
};
return (_local2);
}
public static function getSoundByName(_arg1:String):DGSound{
var _local2:int = (sounds.length - 1);
while (_local2 >= 0) {
if (_arg1 == sounds[_local2].name){
return ((sounds[_local2] as DGSound));
};
_local2--;
};
return (null);
}
public static function stopAll():void{
var _local1:int;
while (_local1 < sounds.length) {
sounds[_local1].stop();
_local1++;
};
sounds.splice(0, sounds.length);
}
public static function pauseAll():void{
enableSound = false;
var _local1:int;
while (_local1 < sounds.length) {
sounds[_local1].pause();
_local1++;
};
}
public static function resumeAll():void{
enableSound = true;
var _local1:int;
while (_local1 < sounds.length) {
sounds[_local1].resume();
_local1++;
};
}
public static function playButtonClick(_arg1:MouseEvent=null):void{
SoundManager.playOnce("snd_click", 0.3);
}
public static function playMenuMusic():void{
var func1:Function;
func1 = function ():void{
if (getCount("snd_menu") == 0){
stopAll();
menuMusic = SoundManager.playLoop("snd_menu", 0.5);
};
};
if (gameMusic){
TweenNano.to(gameMusic, 0.5, {vol:0, onComplete:func1});
} else {
func1();
};
}
public static function playGameMusic():void{
var func1:Function;
func1 = function ():void{
stopAll();
gameMusic = SoundManager.playLoop("snd_game", 0.1);
};
TweenNano.to(menuMusic, 0.5, {vol:0, onComplete:func1});
}
}
}//package
Section 131
//TokAnimRight (TokAnimRight)
package {
import flash.display.*;
public dynamic class TokAnimRight extends MovieClip {
}
}//package
Section 132
//Utilites (Utilites)
package {
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
public class Utilites {
public static const ZERO_POINT:Point = new Point();
public static var main:Main;
public static function randomInt(_arg1, _arg2:Number):int{
if (_arg1 == _arg2){
return (_arg1);
};
return (Math.round(((Math.random() * (_arg2 - _arg1)) + _arg1)));
}
public static function randomNumber(_arg1, _arg2:Number):Number{
if (_arg1 == _arg2){
return (_arg1);
};
return (((Math.random() * (_arg2 - _arg1)) + _arg1));
}
public static function inRange(_arg1, _arg2, _arg3:Number):Boolean{
return ((((_arg1 >= _arg2)) && ((_arg1 <= _arg3))));
}
public static function clamp(_arg1, _arg2, _arg3:Number):Number{
if (_arg1 < _arg2){
_arg1 = _arg2;
};
if (_arg1 > _arg3){
_arg1 = _arg3;
};
return (_arg1);
}
public static function arrayToString(_arg1:Array):String{
var _local3:int;
var _local2 = "";
if (_arg1){
_local3 = 0;
while (_local3 < _arg1.length) {
_local2 = (_local2 + (_arg1[_local3].toString() + "; "));
_local3++;
};
};
return (_local2);
}
public static function getSoundByName(_arg1:String):Sound{
var _local2:Class = (getDefinitionByName(_arg1) as Class);
return (new (_local2));
}
public static function getParticleByName(_arg1:String):BitmapData{
var _local2:BitmapData;
switch (_arg1){
case "particle1":
_local2 = new particle1();
break;
case "particle4":
_local2 = new particle4();
break;
case "particle11":
_local2 = new particle11();
break;
case "particle13":
_local2 = new particle13();
break;
};
return (_local2);
}
}
}//package
Section 133
//Yashik (Yashik)
package {
import flash.display.*;
import flash.events.*;
public class Yashik extends CustomFPSMovie {
public function Yashik(_arg1:MovieClip, _arg2:int){
super(_arg1, _arg2);
}
override protected function updateAnimation(_arg1:TimerEvent):void{
super.updateAnimation(_arg1);
if (mc.currentFrame == mc.totalFrames){
stop();
};
}
public function openBox(){
mc.gotoAndStop(1);
play();
}
}
}//package