Section 1
//AuxFunctions (caurina.transitions.AuxFunctions)
package caurina.transitions {
public class AuxFunctions {
public static function concatObjects(... _args):Object{
var _local3:Object;
var _local5:String;
var _local2:Object = {};
var _local4:int;
while (_local4 < _args.length) {
_local3 = _args[_local4];
for (_local5 in _local3) {
if (_local3[_local5] == null){
delete _local2[_local5];
} else {
_local2[_local5] = _local3[_local5];
};
};
_local4++;
};
return (_local2);
}
public static function numberToG(_arg1:Number):Number{
return (((_arg1 & 0xFF00) >> 8));
}
public static function numberToR(_arg1:Number):Number{
return (((_arg1 & 0xFF0000) >> 16));
}
public static function isInArray(_arg1:String, _arg2:Array):Boolean{
var _local3:uint = _arg2.length;
var _local4:uint;
while (_local4 < _local3) {
if (_arg2[_local4] == _arg1){
return (true);
};
_local4++;
};
return (false);
}
public static function getObjectLength(_arg1:Object):uint{
var _local3:String;
var _local2:uint;
for (_local3 in _arg1) {
_local2++;
};
return (_local2);
}
public static function numberToB(_arg1:Number):Number{
return ((_arg1 & 0xFF));
}
}
}//package caurina.transitions
Section 2
//Equations (caurina.transitions.Equations)
package caurina.transitions {
public class Equations {
public function Equations(){
trace("Equations is a static class and should not be instantiated.");
}
public static function easeOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeInOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * (0.3 * 1.5)) : _arg5.period;
var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2));
};
--_arg1;
return ((((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) * 0.5) + _arg3) + _arg2));
}
public static function easeInOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
public static function easeInOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeInBounce((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOutBounce(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
public static function easeInOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_local6 = (_local6 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_local6 + 1) * _arg1) - _local6))) + _arg2));
};
_arg1 = (_arg1 - 2);
_local6 = (_local6 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 2)) + _arg2));
}
public static function easeOutInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCubic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInCubic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 1)) + _arg2));
}
public static function easeInOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
public static function easeInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_local6 + 1) * _arg1) - _local6)) + _arg2));
}
public static function easeInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeOutInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuint((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuint(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBounce((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBounce(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function init():void{
Tweener.registerTransition("easenone", easeNone);
Tweener.registerTransition("linear", easeNone);
Tweener.registerTransition("easeinquad", easeInQuad);
Tweener.registerTransition("easeoutquad", easeOutQuad);
Tweener.registerTransition("easeinoutquad", easeInOutQuad);
Tweener.registerTransition("easeoutinquad", easeOutInQuad);
Tweener.registerTransition("easeincubic", easeInCubic);
Tweener.registerTransition("easeoutcubic", easeOutCubic);
Tweener.registerTransition("easeinoutcubic", easeInOutCubic);
Tweener.registerTransition("easeoutincubic", easeOutInCubic);
Tweener.registerTransition("easeinquart", easeInQuart);
Tweener.registerTransition("easeoutquart", easeOutQuart);
Tweener.registerTransition("easeinoutquart", easeInOutQuart);
Tweener.registerTransition("easeoutinquart", easeOutInQuart);
Tweener.registerTransition("easeinquint", easeInQuint);
Tweener.registerTransition("easeoutquint", easeOutQuint);
Tweener.registerTransition("easeinoutquint", easeInOutQuint);
Tweener.registerTransition("easeoutinquint", easeOutInQuint);
Tweener.registerTransition("easeinsine", easeInSine);
Tweener.registerTransition("easeoutsine", easeOutSine);
Tweener.registerTransition("easeinoutsine", easeInOutSine);
Tweener.registerTransition("easeoutinsine", easeOutInSine);
Tweener.registerTransition("easeincirc", easeInCirc);
Tweener.registerTransition("easeoutcirc", easeOutCirc);
Tweener.registerTransition("easeinoutcirc", easeInOutCirc);
Tweener.registerTransition("easeoutincirc", easeOutInCirc);
Tweener.registerTransition("easeinexpo", easeInExpo);
Tweener.registerTransition("easeoutexpo", easeOutExpo);
Tweener.registerTransition("easeinoutexpo", easeInOutExpo);
Tweener.registerTransition("easeoutinexpo", easeOutInExpo);
Tweener.registerTransition("easeinelastic", easeInElastic);
Tweener.registerTransition("easeoutelastic", easeOutElastic);
Tweener.registerTransition("easeinoutelastic", easeInOutElastic);
Tweener.registerTransition("easeoutinelastic", easeOutInElastic);
Tweener.registerTransition("easeinback", easeInBack);
Tweener.registerTransition("easeoutback", easeOutBack);
Tweener.registerTransition("easeinoutback", easeInOutBack);
Tweener.registerTransition("easeoutinback", easeOutInBack);
Tweener.registerTransition("easeinbounce", easeInBounce);
Tweener.registerTransition("easeoutbounce", easeOutBounce);
Tweener.registerTransition("easeinoutbounce", easeInOutBounce);
Tweener.registerTransition("easeoutinbounce", easeOutInBounce);
}
public static function easeOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg1)==_arg4) ? (_arg2 + _arg3) : (((_arg3 * 1.001) * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2));
}
public static function easeOutInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBack((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBack(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg1)==0) ? _arg2 : (((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2) - (_arg3 * 0.001)));
}
public static function easeInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2));
}
public static function easeInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg3 - easeOutBounce((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeOutInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutExpo((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInExpo(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((-(_arg3) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2));
}
public static function easeInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2));
}
public static function easeInOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 2)) + _arg2));
}
public static function easeOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeOutInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutElastic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInElastic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
--_arg1;
return ((-(((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2));
}
public static function easeOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuad((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuad(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2));
}
public static function easeInOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
}
public static function easeOutInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutSine((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInSine(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 == 0){
return (_arg2);
};
if (_arg1 == _arg4){
return ((_arg2 + _arg3));
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2) - (_arg3 * 0.0005)));
};
--_arg1;
return (((((_arg3 / 2) * 1.0005) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2));
}
public static function easeOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
return (((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) + _arg3) + _arg2));
}
public static function easeOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
}
public static function easeOutInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuart((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuart(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCirc((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInCirc(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
}
}//package caurina.transitions
Section 3
//PropertyInfoObj (caurina.transitions.PropertyInfoObj)
package caurina.transitions {
public class PropertyInfoObj {
public var modifierParameters:Array;
public var isSpecialProperty:Boolean;
public var valueComplete:Number;
public var modifierFunction:Function;
public var extra:Object;
public var valueStart:Number;
public var hasModifier:Boolean;
public var arrayIndex:Number;
public var originalValueComplete:Object;
public function PropertyInfoObj(_arg1:Number, _arg2:Number, _arg3:Object, _arg4:Number, _arg5:Object, _arg6:Boolean, _arg7:Function, _arg8:Array){
valueStart = _arg1;
valueComplete = _arg2;
originalValueComplete = _arg3;
arrayIndex = _arg4;
extra = _arg5;
isSpecialProperty = _arg6;
hasModifier = Boolean(_arg7);
modifierFunction = _arg7;
modifierParameters = _arg8;
}
public function toString():String{
var _local1 = "\n[PropertyInfoObj ";
_local1 = (_local1 + ("valueStart:" + String(valueStart)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("valueComplete:" + String(valueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("originalValueComplete:" + String(originalValueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("arrayIndex:" + String(arrayIndex)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("extra:" + String(extra)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("isSpecialProperty:" + String(isSpecialProperty)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("hasModifier:" + String(hasModifier)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierFunction:" + String(modifierFunction)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierParameters:" + String(modifierParameters)));
_local1 = (_local1 + "]\n");
return (_local1);
}
public function clone():PropertyInfoObj{
var _local1:PropertyInfoObj = new PropertyInfoObj(valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, modifierFunction, modifierParameters);
return (_local1);
}
}
}//package caurina.transitions
Section 4
//SpecialProperty (caurina.transitions.SpecialProperty)
package caurina.transitions {
public class SpecialProperty {
public var parameters:Array;
public var getValue:Function;
public var preProcess:Function;
public var setValue:Function;
public function SpecialProperty(_arg1:Function, _arg2:Function, _arg3:Array=null, _arg4:Function=null){
getValue = _arg1;
setValue = _arg2;
parameters = _arg3;
preProcess = _arg4;
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + "[SpecialProperty ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("setValue:" + String(setValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("preProcess:" + String(preProcess)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 5
//SpecialPropertyModifier (caurina.transitions.SpecialPropertyModifier)
package caurina.transitions {
public class SpecialPropertyModifier {
public var getValue:Function;
public var modifyValues:Function;
public function SpecialPropertyModifier(_arg1:Function, _arg2:Function){
modifyValues = _arg1;
getValue = _arg2;
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + "[SpecialPropertyModifier ");
_local1 = (_local1 + ("modifyValues:" + String(modifyValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 6
//SpecialPropertySplitter (caurina.transitions.SpecialPropertySplitter)
package caurina.transitions {
public class SpecialPropertySplitter {
public var parameters:Array;
public var splitValues:Function;
public function SpecialPropertySplitter(_arg1:Function, _arg2:Array){
splitValues = _arg1;
parameters = _arg2;
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + "[SpecialPropertySplitter ");
_local1 = (_local1 + ("splitValues:" + String(splitValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 7
//Tweener (caurina.transitions.Tweener)
package caurina.transitions {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Tweener {
private static var _timeScale:Number = 1;
private static var _currentTimeFrame:Number;
private static var _specialPropertySplitterList:Object;
private static var _engineExists:Boolean = false;
private static var _specialPropertyModifierList:Object;
private static var _currentTime:Number;
private static var _tweenList:Array;
private static var _specialPropertyList:Object;
private static var _transitionList:Object;
private static var _inited:Boolean = false;
private static var __tweener_controller__:MovieClip;
public function Tweener(){
trace("Tweener is a static class and should not be instantiated.");
}
public static function registerSpecialPropertyModifier(_arg1:String, _arg2:Function, _arg3:Function):void{
if (!_inited){
init();
};
var _local4:SpecialPropertyModifier = new SpecialPropertyModifier(_arg2, _arg3);
_specialPropertyModifierList[_arg1] = _local4;
}
public static function registerSpecialProperty(_arg1:String, _arg2:Function, _arg3:Function, _arg4:Array=null, _arg5:Function=null):void{
if (!_inited){
init();
};
var _local6:SpecialProperty = new SpecialProperty(_arg2, _arg3, _arg4, _arg5);
_specialPropertyList[_arg1] = _local6;
}
public static function init(_arg1=null):void{
_inited = true;
_transitionList = new Object();
Equations.init();
_specialPropertyList = new Object();
_specialPropertyModifierList = new Object();
_specialPropertySplitterList = new Object();
}
private static function updateTweens():Boolean{
var _local1:int;
if (_tweenList.length == 0){
return (false);
};
_local1 = 0;
while (_local1 < _tweenList.length) {
if ((((_tweenList[_local1] == undefined)) || (!(_tweenList[_local1].isPaused)))){
if (!updateTweenByIndex(_local1)){
removeTweenByIndex(_local1);
};
if (_tweenList[_local1] == null){
removeTweenByIndex(_local1, true);
_local1--;
};
};
_local1++;
};
return (true);
}
public static function addCaller(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local3:Number;
var _local4:Array;
var _local8:Function;
var _local9:TweenListObj;
var _local10:Number;
var _local11:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local4 = _arg1.concat();
} else {
_local4 = [_arg1];
};
var _local5:Object = _arg2;
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
var _local6:Number = (isNaN(_local5.time)) ? 0 : _local5.time;
var _local7:Number = (isNaN(_local5.delay)) ? 0 : _local5.delay;
if (typeof(_local5.transition) == "string"){
_local11 = _local5.transition.toLowerCase();
_local8 = _transitionList[_local11];
} else {
_local8 = _local5.transition;
};
if (!Boolean(_local8)){
_local8 = _transitionList["easeoutexpo"];
};
_local3 = 0;
while (_local3 < _local4.length) {
if (_local5.useFrames == true){
_local9 = new TweenListObj(_local4[_local3], (_currentTimeFrame + (_local7 / _timeScale)), (_currentTimeFrame + ((_local7 + _local6) / _timeScale)), true, _local8, _local5.transitionParams);
} else {
_local9 = new TweenListObj(_local4[_local3], (_currentTime + ((_local7 * 1000) / _timeScale)), (_currentTime + (((_local7 * 1000) + (_local6 * 1000)) / _timeScale)), false, _local8, _local5.transitionParams);
};
_local9.properties = null;
_local9.onStart = _local5.onStart;
_local9.onUpdate = _local5.onUpdate;
_local9.onComplete = _local5.onComplete;
_local9.onOverwrite = _local5.onOverwrite;
_local9.onStartParams = _local5.onStartParams;
_local9.onUpdateParams = _local5.onUpdateParams;
_local9.onCompleteParams = _local5.onCompleteParams;
_local9.onOverwriteParams = _local5.onOverwriteParams;
_local9.onStartScope = _local5.onStartScope;
_local9.onUpdateScope = _local5.onUpdateScope;
_local9.onCompleteScope = _local5.onCompleteScope;
_local9.onOverwriteScope = _local5.onOverwriteScope;
_local9.onErrorScope = _local5.onErrorScope;
_local9.isCaller = true;
_local9.count = _local5.count;
_local9.waitFrames = _local5.waitFrames;
_tweenList.push(_local9);
if ((((_local6 == 0)) && ((_local7 == 0)))){
_local10 = (_tweenList.length - 1);
updateTweenByIndex(_local10);
removeTweenByIndex(_local10);
};
_local3++;
};
return (true);
}
public static function pauseAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
pauseTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function removeTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(removeTweenByIndex, _arg1, _local3));
}
public static function splitTweens(_arg1:Number, _arg2:Array):uint{
var _local5:uint;
var _local6:String;
var _local7:Boolean;
var _local3:TweenListObj = _tweenList[_arg1];
var _local4:TweenListObj = _local3.clone(false);
_local5 = 0;
while (_local5 < _arg2.length) {
_local6 = _arg2[_local5];
if (Boolean(_local3.properties[_local6])){
_local3.properties[_local6] = undefined;
delete _local3.properties[_local6];
};
_local5++;
};
for (_local6 in _local4.properties) {
_local7 = false;
_local5 = 0;
while (_local5 < _arg2.length) {
if (_arg2[_local5] == _local6){
_local7 = true;
break;
};
_local5++;
};
if (!_local7){
_local4.properties[_local6] = undefined;
delete _local4.properties[_local6];
};
};
_tweenList.push(_local4);
return ((_tweenList.length - 1));
}
public static function updateFrame():void{
_currentTimeFrame++;
}
public static function resumeTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj = _tweenList[_arg1];
if ((((_local2 == null)) || (!(_local2.isPaused)))){
return (false);
};
var _local3:Number = getCurrentTweeningTime(_local2);
_local2.timeStart = (_local2.timeStart + (_local3 - _local2.timePaused));
_local2.timeComplete = (_local2.timeComplete + (_local3 - _local2.timePaused));
_local2.timePaused = undefined;
_local2.isPaused = false;
return (true);
}
public static function getVersion():String{
return ("AS3 1.31.69");
}
public static function onEnterFrame(_arg1:Event):void{
updateTime();
updateFrame();
var _local2:Boolean;
_local2 = updateTweens();
if (!_local2){
stopEngine();
};
}
public static function updateTime():void{
_currentTime = getTimer();
}
private static function updateTweenByIndex(_arg1:Number):Boolean{
var tTweening:TweenListObj;
var mustUpdate:Boolean;
var nv:Number;
var t:Number;
var b:Number;
var c:Number;
var d:Number;
var pName:String;
var eventScope:Object;
var tScope:Object;
var tProperty:Object;
var pv:Number;
var i = _arg1;
tTweening = _tweenList[i];
if ((((tTweening == null)) || (!(Boolean(tTweening.scope))))){
return (false);
};
var isOver:Boolean;
var cTime:Number = getCurrentTweeningTime(tTweening);
if (cTime >= tTweening.timeStart){
tScope = tTweening.scope;
if (tTweening.isCaller){
do {
t = (((tTweening.timeComplete - tTweening.timeStart) / tTweening.count) * (tTweening.timesCalled + 1));
b = tTweening.timeStart;
c = (tTweening.timeComplete - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d);
} while (!(cTime >= nv));
} else {
mustUpdate = (((((tTweening.skipUpdates < 1)) || (!(tTweening.skipUpdates)))) || ((tTweening.updatesSkipped >= tTweening.skipUpdates)));
if (cTime >= tTweening.timeComplete){
isOver = true;
mustUpdate = true;
};
if (!tTweening.hasStarted){
if (Boolean(tTweening.onStart)){
eventScope = (Boolean(tTweening.onStartScope)) ? tTweening.onStartScope : tScope;
try {
tTweening.onStart.apply(eventScope, tTweening.onStartParams);
} catch(e:Error) {
handleError(tTweening, e, "onStart");
};
};
for (pName in tTweening.properties) {
if (tTweening.properties[pName].isSpecialProperty){
if (Boolean(_specialPropertyList[pName].preProcess)){
tTweening.properties[pName].valueComplete = _specialPropertyList[pName].preProcess(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].originalValueComplete, tTweening.properties[pName].extra);
};
pv = _specialPropertyList[pName].getValue(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
pv = tScope[pName];
};
tTweening.properties[pName].valueStart = (isNaN(pv)) ? tTweening.properties[pName].valueComplete : pv;
};
mustUpdate = true;
tTweening.hasStarted = true;
};
if (mustUpdate){
for (pName in tTweening.properties) {
tProperty = tTweening.properties[pName];
if (isOver){
nv = tProperty.valueComplete;
} else {
if (tProperty.hasModifier){
t = (cTime - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, 0, 1, d, tTweening.transitionParams);
nv = tProperty.modifierFunction(tProperty.valueStart, tProperty.valueComplete, nv, tProperty.modifierParameters);
} else {
t = (cTime - tTweening.timeStart);
b = tProperty.valueStart;
c = (tProperty.valueComplete - tProperty.valueStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d, tTweening.transitionParams);
};
};
if (tTweening.rounded){
nv = Math.round(nv);
};
if (tProperty.isSpecialProperty){
_specialPropertyList[pName].setValue(tScope, nv, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
tScope[pName] = nv;
};
};
tTweening.updatesSkipped = 0;
if (Boolean(tTweening.onUpdate)){
eventScope = (Boolean(tTweening.onUpdateScope)) ? tTweening.onUpdateScope : tScope;
try {
tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams);
} catch(e:Error) {
handleError(tTweening, e, "onUpdate");
};
};
} else {
tTweening.updatesSkipped++;
};
};
if (((isOver) && (Boolean(tTweening.onComplete)))){
eventScope = (Boolean(tTweening.onCompleteScope)) ? tTweening.onCompleteScope : tScope;
try {
tTweening.onComplete.apply(eventScope, tTweening.onCompleteParams);
} catch(e:Error) {
handleError(tTweening, e, "onComplete");
};
};
return (!(isOver));
};
return (true);
}
public static function setTimeScale(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (isNaN(_arg1)){
_arg1 = 1;
};
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
if (_arg1 != _timeScale){
if (_tweenList != null){
_local2 = 0;
while (_local2 < _tweenList.length) {
_local3 = getCurrentTweeningTime(_tweenList[_local2]);
_tweenList[_local2].timeStart = (_local3 - (((_local3 - _tweenList[_local2].timeStart) * _timeScale) / _arg1));
_tweenList[_local2].timeComplete = (_local3 - (((_local3 - _tweenList[_local2].timeComplete) * _timeScale) / _arg1));
if (_tweenList[_local2].timePaused != undefined){
_tweenList[_local2].timePaused = (_local3 - (((_local3 - _tweenList[_local2].timePaused) * _timeScale) / _arg1));
};
_local2++;
};
};
_timeScale = _arg1;
};
}
public static function resumeAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
resumeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
private static function handleError(_arg1:TweenListObj, _arg2:Error, _arg3:String):void{
var eventScope:Object;
var pTweening = _arg1;
var pError = _arg2;
var pCallBackName = _arg3;
if (((Boolean(pTweening.onError)) && ((pTweening.onError is Function)))){
eventScope = (Boolean(pTweening.onErrorScope)) ? pTweening.onErrorScope : pTweening.scope;
try {
pTweening.onError.apply(pTweening.scope, [pTweening.scope, pError]);
} catch(metaError:Error) {
printError(((((String(pTweening.scope) + " raised an error while executing the 'onError' handler. Original error:\n ") + pError.getStackTrace()) + "\nonError error: ") + metaError.getStackTrace()));
};
} else {
if (!Boolean(pTweening.onError)){
printError(((((String(pTweening.scope) + " raised an error while executing the '") + pCallBackName) + "'handler. \n") + pError.getStackTrace()));
};
};
}
private static function startEngine():void{
_engineExists = true;
_tweenList = new Array();
__tweener_controller__ = new MovieClip();
__tweener_controller__.addEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
_currentTimeFrame = 0;
updateTime();
}
public static function removeAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
removeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function addTween(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local4:Number;
var _local5:Number;
var _local6:String;
var _local7:Array;
var _local14:Function;
var _local15:Object;
var _local16:TweenListObj;
var _local17:Number;
var _local18:Array;
var _local19:Array;
var _local20:Array;
var _local21:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local7 = _arg1.concat();
} else {
_local7 = [_arg1];
};
var _local8:Object = TweenListObj.makePropertiesChain(arguments[(arguments.length - 1)]);
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
var _local9:Number = (isNaN(_local8.time)) ? 0 : _local8.time;
var _local10:Number = (isNaN(_local8.delay)) ? 0 : _local8.delay;
var _local11:Array = new Array();
var _local12:Object = {time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, transitionParams:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, onError:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams:true, onStartScope:true, onUpdateScope:true, onCompleteScope:true, onOverwriteScope:true, onErrorScope:true};
var _local13:Object = new Object();
for (_local6 in _local8) {
if (!_local12[_local6]){
if (_specialPropertySplitterList[_local6]){
_local18 = _specialPropertySplitterList[_local6].splitValues(_local8[_local6], _specialPropertySplitterList[_local6].parameters);
_local4 = 0;
while (_local4 < _local18.length) {
if (_specialPropertySplitterList[_local18[_local4].name]){
_local19 = _specialPropertySplitterList[_local18[_local4].name].splitValues(_local18[_local4].value, _specialPropertySplitterList[_local18[_local4].name].parameters);
_local5 = 0;
while (_local5 < _local19.length) {
_local11[_local19[_local5].name] = {valueStart:undefined, valueComplete:_local19[_local5].value, arrayIndex:_local19[_local5].arrayIndex, isSpecialProperty:false};
_local5++;
};
} else {
_local11[_local18[_local4].name] = {valueStart:undefined, valueComplete:_local18[_local4].value, arrayIndex:_local18[_local4].arrayIndex, isSpecialProperty:false};
};
_local4++;
};
} else {
if (_specialPropertyModifierList[_local6] != undefined){
_local20 = _specialPropertyModifierList[_local6].modifyValues(_local8[_local6]);
_local4 = 0;
while (_local4 < _local20.length) {
_local13[_local20[_local4].name] = {modifierParameters:_local20[_local4].parameters, modifierFunction:_specialPropertyModifierList[_local6].getValue};
_local4++;
};
} else {
_local11[_local6] = {valueStart:undefined, valueComplete:_local8[_local6]};
};
};
};
};
for (_local6 in _local11) {
if (_specialPropertyList[_local6] != undefined){
_local11[_local6].isSpecialProperty = true;
} else {
if (_local7[0][_local6] == undefined){
printError((((("The property '" + _local6) + "' doesn't seem to be a normal object property of ") + String(_local7[0])) + " or a registered special property."));
};
};
};
for (_local6 in _local13) {
if (_local11[_local6] != undefined){
_local11[_local6].modifierParameters = _local13[_local6].modifierParameters;
_local11[_local6].modifierFunction = _local13[_local6].modifierFunction;
};
};
if (typeof(_local8.transition) == "string"){
_local21 = _local8.transition.toLowerCase();
_local14 = _transitionList[_local21];
} else {
_local14 = _local8.transition;
};
if (!Boolean(_local14)){
_local14 = _transitionList["easeoutexpo"];
};
_local4 = 0;
while (_local4 < _local7.length) {
_local15 = new Object();
for (_local6 in _local11) {
_local15[_local6] = new PropertyInfoObj(_local11[_local6].valueStart, _local11[_local6].valueComplete, _local11[_local6].valueComplete, _local11[_local6].arrayIndex, {}, _local11[_local6].isSpecialProperty, _local11[_local6].modifierFunction, _local11[_local6].modifierParameters);
};
if (_local8.useFrames == true){
_local16 = new TweenListObj(_local7[_local4], (_currentTimeFrame + (_local10 / _timeScale)), (_currentTimeFrame + ((_local10 + _local9) / _timeScale)), true, _local14, _local8.transitionParams);
} else {
_local16 = new TweenListObj(_local7[_local4], (_currentTime + ((_local10 * 1000) / _timeScale)), (_currentTime + (((_local10 * 1000) + (_local9 * 1000)) / _timeScale)), false, _local14, _local8.transitionParams);
};
_local16.properties = _local15;
_local16.onStart = _local8.onStart;
_local16.onUpdate = _local8.onUpdate;
_local16.onComplete = _local8.onComplete;
_local16.onOverwrite = _local8.onOverwrite;
_local16.onError = _local8.onError;
_local16.onStartParams = _local8.onStartParams;
_local16.onUpdateParams = _local8.onUpdateParams;
_local16.onCompleteParams = _local8.onCompleteParams;
_local16.onOverwriteParams = _local8.onOverwriteParams;
_local16.onStartScope = _local8.onStartScope;
_local16.onUpdateScope = _local8.onUpdateScope;
_local16.onCompleteScope = _local8.onCompleteScope;
_local16.onOverwriteScope = _local8.onOverwriteScope;
_local16.onErrorScope = _local8.onErrorScope;
_local16.rounded = _local8.rounded;
_local16.skipUpdates = _local8.skipUpdates;
removeTweensByTime(_local16.scope, _local16.properties, _local16.timeStart, _local16.timeComplete);
_tweenList.push(_local16);
if ((((_local9 == 0)) && ((_local10 == 0)))){
_local17 = (_tweenList.length - 1);
updateTweenByIndex(_local17);
removeTweenByIndex(_local17);
};
_local4++;
};
return (true);
}
public static function registerTransition(_arg1:String, _arg2:Function):void{
if (!_inited){
init();
};
_transitionList[_arg1] = _arg2;
}
public static function printError(_arg1:String):void{
trace(("## [Tweener] Error: " + _arg1));
}
private static function affectTweens(_arg1:Function, _arg2:Object, _arg3:Array):Boolean{
var _local5:uint;
var _local6:Array;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local4:Boolean;
if (!Boolean(_tweenList)){
return (false);
};
_local5 = 0;
while (_local5 < _tweenList.length) {
if (((_tweenList[_local5]) && ((_tweenList[_local5].scope == _arg2)))){
if (_arg3.length == 0){
_arg1(_local5);
_local4 = true;
} else {
_local6 = new Array();
_local7 = 0;
while (_local7 < _arg3.length) {
if (Boolean(_tweenList[_local5].properties[_arg3[_local7]])){
_local6.push(_arg3[_local7]);
};
_local7++;
};
if (_local6.length > 0){
_local8 = AuxFunctions.getObjectLength(_tweenList[_local5].properties);
if (_local8 == _local6.length){
_arg1(_local5);
_local4 = true;
} else {
_local9 = splitTweens(_local5, _local6);
_arg1(_local9);
_local4 = true;
};
};
};
};
_local5++;
};
return (_local4);
}
public static function getTweens(_arg1:Object):Array{
var _local2:uint;
var _local3:String;
if (!Boolean(_tweenList)){
return ([]);
};
var _local4:Array = new Array();
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
for (_local3 in _tweenList[_local2].properties) {
_local4.push(_local3);
};
};
_local2++;
};
return (_local4);
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public static function pauseTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj = _tweenList[_arg1];
if ((((_local2 == null)) || (_local2.isPaused))){
return (false);
};
_local2.timePaused = getCurrentTweeningTime(_local2);
_local2.isPaused = true;
return (true);
}
public static function getCurrentTweeningTime(_arg1:Object):Number{
return ((_arg1.useFrames) ? _currentTimeFrame : _currentTime);
}
public static function getTweenCount(_arg1:Object):Number{
var _local2:uint;
if (!Boolean(_tweenList)){
return (0);
};
var _local3:Number = 0;
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
_local3 = (_local3 + AuxFunctions.getObjectLength(_tweenList[_local2].properties));
};
_local2++;
};
return (_local3);
}
private static function stopEngine():void{
_engineExists = false;
_tweenList = null;
_currentTime = 0;
_currentTimeFrame = 0;
__tweener_controller__.removeEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
__tweener_controller__ = null;
}
public static function removeTweensByTime(_arg1:Object, _arg2:Object, _arg3:Number, _arg4:Number):Boolean{
var removedLocally:Boolean;
var i:uint;
var pName:String;
var eventScope:Object;
var p_scope = _arg1;
var p_properties = _arg2;
var p_timeStart = _arg3;
var p_timeComplete = _arg4;
var removed:Boolean;
var tl:uint = _tweenList.length;
i = 0;
while (i < tl) {
if (((Boolean(_tweenList[i])) && ((p_scope == _tweenList[i].scope)))){
if ((((p_timeComplete > _tweenList[i].timeStart)) && ((p_timeStart < _tweenList[i].timeComplete)))){
removedLocally = false;
for (pName in _tweenList[i].properties) {
if (Boolean(p_properties[pName])){
if (Boolean(_tweenList[i].onOverwrite)){
eventScope = (Boolean(_tweenList[i].onOverwriteScope)) ? _tweenList[i].onOverwriteScope : _tweenList[i].scope;
try {
_tweenList[i].onOverwrite.apply(eventScope, _tweenList[i].onOverwriteParams);
} catch(e:Error) {
handleError(_tweenList[i], e, "onOverwrite");
};
};
_tweenList[i].properties[pName] = undefined;
delete _tweenList[i].properties[pName];
removedLocally = true;
removed = true;
};
};
if (removedLocally){
if (AuxFunctions.getObjectLength(_tweenList[i].properties) == 0){
removeTweenByIndex(i);
};
};
};
};
i = (i + 1);
};
return (removed);
}
public static function registerSpecialPropertySplitter(_arg1:String, _arg2:Function, _arg3:Array=null):void{
if (!_inited){
init();
};
var _local4:SpecialPropertySplitter = new SpecialPropertySplitter(_arg2, _arg3);
_specialPropertySplitterList[_arg1] = _local4;
}
public static function removeTweenByIndex(_arg1:Number, _arg2:Boolean=false):Boolean{
_tweenList[_arg1] = null;
if (_arg2){
_tweenList.splice(_arg1, 1);
};
return (true);
}
public static function resumeTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(resumeTweenByIndex, _arg1, _local3));
}
public static function pauseTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(pauseTweenByIndex, _arg1, _local3));
}
}
}//package caurina.transitions
Section 8
//TweenListObj (caurina.transitions.TweenListObj)
package caurina.transitions {
public class TweenListObj {
public var hasStarted:Boolean;
public var onUpdate:Function;
public var useFrames:Boolean;
public var count:Number;
public var onOverwriteParams:Array;
public var timeStart:Number;
public var timeComplete:Number;
public var onStartParams:Array;
public var onUpdateScope:Object;
public var rounded:Boolean;
public var onUpdateParams:Array;
public var properties:Object;
public var onComplete:Function;
public var transitionParams:Object;
public var updatesSkipped:Number;
public var onStart:Function;
public var onOverwriteScope:Object;
public var skipUpdates:Number;
public var onStartScope:Object;
public var scope:Object;
public var isCaller:Boolean;
public var timePaused:Number;
public var transition:Function;
public var onCompleteParams:Array;
public var onError:Function;
public var timesCalled:Number;
public var onErrorScope:Object;
public var onOverwrite:Function;
public var isPaused:Boolean;
public var waitFrames:Boolean;
public var onCompleteScope:Object;
public function TweenListObj(_arg1:Object, _arg2:Number, _arg3:Number, _arg4:Boolean, _arg5:Function, _arg6:Object){
scope = _arg1;
timeStart = _arg2;
timeComplete = _arg3;
useFrames = _arg4;
transition = _arg5;
transitionParams = _arg6;
properties = new Object();
isPaused = false;
timePaused = undefined;
isCaller = false;
updatesSkipped = 0;
timesCalled = 0;
skipUpdates = 0;
hasStarted = false;
}
public function clone(_arg1:Boolean):TweenListObj{
var _local3:String;
var _local2:TweenListObj = new TweenListObj(scope, timeStart, timeComplete, useFrames, transition, transitionParams);
_local2.properties = new Array();
for (_local3 in properties) {
_local2.properties[_local3] = properties[_local3].clone();
};
_local2.skipUpdates = skipUpdates;
_local2.updatesSkipped = updatesSkipped;
if (!_arg1){
_local2.onStart = onStart;
_local2.onUpdate = onUpdate;
_local2.onComplete = onComplete;
_local2.onOverwrite = onOverwrite;
_local2.onError = onError;
_local2.onStartParams = onStartParams;
_local2.onUpdateParams = onUpdateParams;
_local2.onCompleteParams = onCompleteParams;
_local2.onOverwriteParams = onOverwriteParams;
_local2.onStartScope = onStartScope;
_local2.onUpdateScope = onUpdateScope;
_local2.onCompleteScope = onCompleteScope;
_local2.onOverwriteScope = onOverwriteScope;
_local2.onErrorScope = onErrorScope;
};
_local2.rounded = rounded;
_local2.isPaused = isPaused;
_local2.timePaused = timePaused;
_local2.isCaller = isCaller;
_local2.count = count;
_local2.timesCalled = timesCalled;
_local2.waitFrames = waitFrames;
_local2.hasStarted = hasStarted;
return (_local2);
}
public function toString():String{
var _local3:String;
var _local1 = "\n[TweenListObj ";
_local1 = (_local1 + ("scope:" + String(scope)));
_local1 = (_local1 + ", properties:");
var _local2:Boolean;
for (_local3 in properties) {
if (!_local2){
_local1 = (_local1 + ",");
};
_local1 = (_local1 + ("[name:" + properties[_local3].name));
_local1 = (_local1 + (",valueStart:" + properties[_local3].valueStart));
_local1 = (_local1 + (",valueComplete:" + properties[_local3].valueComplete));
_local1 = (_local1 + "]");
_local2 = false;
};
_local1 = (_local1 + (", timeStart:" + String(timeStart)));
_local1 = (_local1 + (", timeComplete:" + String(timeComplete)));
_local1 = (_local1 + (", useFrames:" + String(useFrames)));
_local1 = (_local1 + (", transition:" + String(transition)));
_local1 = (_local1 + (", transitionParams:" + String(transitionParams)));
if (skipUpdates){
_local1 = (_local1 + (", skipUpdates:" + String(skipUpdates)));
};
if (updatesSkipped){
_local1 = (_local1 + (", updatesSkipped:" + String(updatesSkipped)));
};
if (Boolean(onStart)){
_local1 = (_local1 + (", onStart:" + String(onStart)));
};
if (Boolean(onUpdate)){
_local1 = (_local1 + (", onUpdate:" + String(onUpdate)));
};
if (Boolean(onComplete)){
_local1 = (_local1 + (", onComplete:" + String(onComplete)));
};
if (Boolean(onOverwrite)){
_local1 = (_local1 + (", onOverwrite:" + String(onOverwrite)));
};
if (Boolean(onError)){
_local1 = (_local1 + (", onError:" + String(onError)));
};
if (onStartParams){
_local1 = (_local1 + (", onStartParams:" + String(onStartParams)));
};
if (onUpdateParams){
_local1 = (_local1 + (", onUpdateParams:" + String(onUpdateParams)));
};
if (onCompleteParams){
_local1 = (_local1 + (", onCompleteParams:" + String(onCompleteParams)));
};
if (onOverwriteParams){
_local1 = (_local1 + (", onOverwriteParams:" + String(onOverwriteParams)));
};
if (onStartScope){
_local1 = (_local1 + (", onStartScope:" + String(onStartScope)));
};
if (onUpdateScope){
_local1 = (_local1 + (", onUpdateScope:" + String(onUpdateScope)));
};
if (onCompleteScope){
_local1 = (_local1 + (", onCompleteScope:" + String(onCompleteScope)));
};
if (onOverwriteScope){
_local1 = (_local1 + (", onOverwriteScope:" + String(onOverwriteScope)));
};
if (onErrorScope){
_local1 = (_local1 + (", onErrorScope:" + String(onErrorScope)));
};
if (rounded){
_local1 = (_local1 + (", rounded:" + String(rounded)));
};
if (isPaused){
_local1 = (_local1 + (", isPaused:" + String(isPaused)));
};
if (timePaused){
_local1 = (_local1 + (", timePaused:" + String(timePaused)));
};
if (isCaller){
_local1 = (_local1 + (", isCaller:" + String(isCaller)));
};
if (count){
_local1 = (_local1 + (", count:" + String(count)));
};
if (timesCalled){
_local1 = (_local1 + (", timesCalled:" + String(timesCalled)));
};
if (waitFrames){
_local1 = (_local1 + (", waitFrames:" + String(waitFrames)));
};
if (hasStarted){
_local1 = (_local1 + (", hasStarted:" + String(hasStarted)));
};
_local1 = (_local1 + "]\n");
return (_local1);
}
public static function makePropertiesChain(_arg1:Object):Object{
var _local3:Object;
var _local4:Object;
var _local5:Object;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local2:Object = _arg1.base;
if (_local2){
_local3 = {};
if ((_local2 is Array)){
_local4 = [];
_local8 = 0;
while (_local8 < _local2.length) {
_local4.push(_local2[_local8]);
_local8++;
};
} else {
_local4 = [_local2];
};
_local4.push(_arg1);
_local6 = _local4.length;
_local7 = 0;
while (_local7 < _local6) {
if (_local4[_local7]["base"]){
_local5 = AuxFunctions.concatObjects(makePropertiesChain(_local4[_local7]["base"]), _local4[_local7]);
} else {
_local5 = _local4[_local7];
};
_local3 = AuxFunctions.concatObjects(_local3, _local5);
_local7++;
};
if (_local3["base"]){
delete _local3["base"];
};
return (_local3);
//unresolved jump
};
return (_arg1);
}
}
}//package caurina.transitions
Section 9
//GameEvent (com.greenish.onlinegames.events.GameEvent)
package com.greenish.onlinegames.events {
import flash.events.*;
public class GameEvent extends Event {
public var score:Number;
public var time:Number;
public static var TIMEOUT:String = "onTimeOut";
public static var GAMEOVER:String = "onGameOver";
public static var THEEND:String = "onTheEnd";
public function GameEvent(_arg1:String, _arg2:Number=0, _arg3:Number=0){
super(_arg1);
this.score = _arg2;
this.time = _arg3;
}
override public function toString():String{
return (formatToString("GameEvent", "type", "bubbles", "cancelable", "eventPhase"));
}
override public function clone():Event{
return (new GameEvent(type));
}
}
}//package com.greenish.onlinegames.events
Section 10
//GameOverClass (com.greenish.onlinegames.GameOverClass)
package com.greenish.onlinegames {
import flash.events.*;
import com.greenish.onlinegames.events.*;
import flash.utils.*;
import flash.net.*;
public class GameOverClass extends EventDispatcher {
private var output:String;
private var type:String;
private var time:Number;
private var score:Number;
private var currentResult:ByteArray;
public function GameOverClass(_arg1:Number, _arg2:Number, _arg3:String){
var _local4:String;
var _local5:Timer;
super();
this.score = _arg1;
this.time = _arg2;
this.type = _arg3;
if (MainClass.isOnOurServer){
_local4 = ((((((((MainClass.idGame.toString() + ",") + MainClass.login) + ",") + MainClass.country.toString()) + ",") + _arg1.toString()) + ",") + _arg2.toString());
trace(_local4);
} else {
_local5 = new Timer(500, 1);
_local5.addEventListener(TimerEvent.TIMER, onLoadData);
_local5.start();
};
}
private function onLoadData(_arg1):void{
dispatchEvent(new GameEvent(type, score, time));
}
private function onLoadKey(_arg1:String):void{
var _local2:URLRequest = new URLRequest(MainClass.scorePath);
_local2.method = URLRequestMethod.POST;
var _local3:URLVariables = new URLVariables();
_local3.str_out = _arg1;
trace(("S = " + _arg1));
_local2.data = _local3;
var _local4:URLLoader = new URLLoader();
_local4.dataFormat = URLLoaderDataFormat.VARIABLES;
_local4.addEventListener(Event.COMPLETE, onLoadData);
_local4.load(_local2);
}
}
}//package com.greenish.onlinegames
Section 11
//MainClass (com.greenish.onlinegames.MainClass)
package com.greenish.onlinegames {
import flash.events.*;
import com.greenish.onlinegames.events.*;
import flash.display.*;
import flash.system.*;
import flash.net.*;
public class MainClass extends Sprite {
public static var server:String = "";
public static var keyPath:String = "";
public static var isOnOurServer:Boolean = true;
public static var login:String = "";
public static var skey:String = "";
public static var idGame:int = 0;
public static var country:int = 0;
public static var scorePath:String = "";
public function MainClass():void{
if (stage){
init();
} else {
addEventListener(Event.ADDED_TO_STAGE, init);
};
}
public function init(_arg1:Event=null):void{
Security.allowDomain("www.monsterz.ru");
Security.allowDomain("monsterz.ru");
Security.allowDomain("www.onlinegamestars.com");
Security.allowDomain("onlinegamestars.com");
removeEventListener(Event.ADDED_TO_STAGE, init);
login = LoaderInfo(this.root.loaderInfo).parameters.login;
keyPath = LoaderInfo(this.root.loaderInfo).parameters.keyPath;
scorePath = LoaderInfo(this.root.loaderInfo).parameters.scorePath;
country = int(LoaderInfo(this.root.loaderInfo).parameters.country);
idGame = int(LoaderInfo(this.root.loaderInfo).parameters.idGame);
server = LoaderInfo(this.root.loaderInfo).parameters.server;
trace("server", server);
if (server == null){
isOnOurServer = false;
server = "http://onlinegamestars.com/uplfile/xmlfiles/";
} else {
isOnOurServer = true;
};
trace("version 1.3", isOnOurServer, server);
if (isOnOurServer){
getKey(((((login + ",") + country.toString()) + ",") + idGame.toString()));
} else {
showRules();
};
}
public function showRules():void{
}
public function removeRules():void{
}
public function onLoadError(_arg1:IOErrorEvent):void{
showError();
}
public function startGameClick(_arg1:MouseEvent):void{
_arg1.target.removeEventListener(MouseEvent.CLICK, startGame);
removeRules();
startGame();
}
public function setGameOver(_arg1:GameEvent):void{
var _local2:GameOverClass = new GameOverClass(_arg1.score, _arg1.time, _arg1.type);
_local2.addEventListener(GameEvent.THEEND, onShowEndPage);
_local2.addEventListener(GameEvent.GAMEOVER, onShowEndPage);
_local2.addEventListener(GameEvent.TIMEOUT, onShowEndPage);
}
private function getKey(_arg1:String):void{
var _local2:URLRequest = new URLRequest(keyPath);
_local2.method = URLRequestMethod.POST;
var _local3:URLVariables = new URLVariables();
_local3.str_out = _arg1;
_local2.data = _local3;
var _local4:URLLoader = new URLLoader();
_local4.dataFormat = URLLoaderDataFormat.VARIABLES;
_local4.addEventListener(Event.COMPLETE, dataOnLoad);
_local4.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
_local4.load(_local2);
}
public function showError():void{
}
public function startGame():void{
}
public function onShowEndPage(_arg1:GameEvent):void{
}
private function dataOnLoad(_arg1:Event):void{
skey = String(_arg1.target.data.req);
trace(skey);
if (skey != ""){
showRules();
} else {
showError();
};
}
}
}//package com.greenish.onlinegames
Section 12
//Preloader (com.greenish.onlinegames.Preloader)
package com.greenish.onlinegames {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import mochi.as3.*;
public class Preloader extends MovieClip {
private var game:DisplayObject;
private var progressBar:MovieClip;
private var moch:MochiGfx;
private var intro:DisplayObjectContainer;
private var maska:Sprite;
public var gfx:PreloaderGfx;
private var IntroClass:Class;
public static var newGroundsId:Number;
public static var isCPMStar:Boolean = false;
public static var isNewGround:Boolean = false;
public static var CPMStarId:String;
public static var isMustMochi:Boolean = false;
public static var isMustMochiAd:Boolean = false;
public static var isMustIntro:Boolean = true;
public static var mochiId:String;
public function Preloader(){
IntroClass = Preloader_IntroClass;
super();
stage.scaleMode = StageScaleMode.SHOW_ALL;
stage.align = StageAlign.TOP_LEFT;
if (isNewGround){
NewgroundsAPI.linkAPI(stage);
NewgroundsAPI.connectMovie(newGroundsId);
};
gfx = new PreloaderGfx();
if (isCPMStar){
gfx["nextButton"].visible = false;
};
if (isNewGround == false){
progressBar = (gfx["progress"] as MovieClip);
progressBar.scaleX = 0;
};
gfx.x = 0;
gfx.y = 0;
addChild(gfx);
addEventListener(Event.ENTER_FRAME, checkFrame);
if (isNewGround == false){
loaderInfo.addEventListener(ProgressEvent.PROGRESS, progress);
};
}
private function checkFrame(_arg1:Event):void{
if (currentFrame == totalFrames){
removeEventListener(Event.ENTER_FRAME, checkFrame);
if (isCPMStar){
gfx["nextButton"].visible = true;
gfx["nextButton"].addEventListener(MouseEvent.CLICK, startup);
} else {
startup();
};
};
}
public function progress(_arg1:ProgressEvent):void{
progressBar.scaleX = (_arg1.bytesLoaded / _arg1.bytesTotal);
}
public function startGame():void{
try {
stage.removeChild(moch);
} catch(err:Error) {
};
maska = new Sprite();
maska.graphics.beginFill(0, 0.5);
maska.graphics.lineStyle(1, 0, 1);
maska.graphics.drawRect(0, 0, 755, 576);
maska.graphics.endFill();
var content:Sprite = new Sprite();
addChild(content);
addChild(maska);
content.mask = maska;
var mainClass:Class = (getDefinitionByName("Main") as Class);
game = (new (mainClass) as DisplayObject);
content.addChild(game);
}
private function onStartMochi(_arg1:Event):void{
stage.removeChild(intro);
if (isMustMochiAd){
moch = new MochiGfx();
stage.addChild(moch);
MochiAd.showPreGameAd({clip:moch, id:_slot1.mochiId, res:"755x576", background:0xFFFFFF, color:3174581, outline:0xFDAA00, no_bg:false, ad_finished:startGame});
} else {
startGame();
};
}
public function startup(_arg1:Event=null):void{
stop();
loaderInfo.removeEventListener(ProgressEvent.PROGRESS, progress);
if (isCPMStar){
gfx["nextButton"].removeEventListener(MouseEvent.CLICK, startup);
};
removeChild(gfx);
if (isMustIntro){
intro = new IntroClass();
intro.addEventListener("startMochi", onStartMochi);
stage.addChild(intro);
} else {
startGame();
};
}
}
}//package com.greenish.onlinegames
Section 13
//Preloader_IntroClass (com.greenish.onlinegames.Preloader_IntroClass)
package com.greenish.onlinegames {
import mx.core.*;
import flash.utils.*;
public class Preloader_IntroClass extends MovieClipLoaderAsset {
public var dataClass:Class;
private static var bytes:ByteArray = null;
public function Preloader_IntroClass(){
dataClass = Preloader_IntroClass_dataClass;
super();
initialWidth = (15100 / 20);
initialHeight = (0x2D00 / 20);
}
override public function get movieClipData():ByteArray{
if (bytes == null){
bytes = ByteArray(new dataClass());
};
return (bytes);
}
}
}//package com.greenish.onlinegames
Section 14
//Preloader_IntroClass_dataClass (com.greenish.onlinegames.Preloader_IntroClass_dataClass)
package com.greenish.onlinegames {
import mx.core.*;
public class Preloader_IntroClass_dataClass extends ByteArrayAsset {
}
}//package com.greenish.onlinegames
Section 15
//Button (com.onlinegamestars.ender.xmlui.Button)
package com.onlinegamestars.ender.xmlui {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Button extends UIItem {
private var scale:Number;// = 1
public var filtersOut:Array;
private var over:DisplayObject;
private var overScale:Number;// = 1
private var down:DisplayObject;
private var data:Object;
public var filtersDisable:Array;
private var background:DisplayObject;
public var filtersOver:Array;
public var text:DisplayObject;
private var disabled:Boolean;// = false
public function Button(_arg1:Object){
setData(_arg1);
}
public function enable():void{
disabled = false;
var _local1:Point = localToGlobal(new Point(mouseX, mouseY));
mouseEnabled = true;
if (hitTestPoint(_local1.x, _local1.y)){
filters = filtersOver;
} else {
filters = filtersOut;
};
}
private function onUpdate(_arg1:Event):void{
if (text != null){
if (data.centerText){
text.x = (((data.width / scaleX) - text.width) / 2);
text.y = ((height - text.height) / 2);
};
};
}
public function onRollOver(_arg1:MouseEvent=null):void{
if (disabled){
if (_arg1 != null){
_arg1.stopPropagation();
};
return;
};
filters = filtersOver;
scaleX = overScale;
scaleY = overScale;
if (over != null){
removeChildAt(0);
addChildAt(over, 0);
};
}
public function onRollOut(_arg1:MouseEvent=null):void{
if (disabled){
if (_arg1 != null){
_arg1.stopPropagation();
};
return;
};
filters = filtersOut;
scaleX = scale;
scaleY = scale;
if (getChildAt(0) != background){
removeChildAt(0);
addChildAt(background, 0);
};
}
public function disable():void{
disabled = true;
mouseEnabled = false;
filters = filtersDisable;
}
override public function setData(_arg1:Object):void{
this.data = _arg1;
while (numChildren > 0) {
removeChildAt(0);
};
if (_arg1.background == null){
_arg1.background = new Sprite();
if (((!((_arg1.width == null))) && (!((_arg1.height == null))))){
_arg1.background.addChild(new Bitmap(new BitmapData(_arg1.width, _arg1.height, true, 0xFF)));
};
_arg1.background.visible = false;
};
background = _arg1.background;
over = _arg1.over;
down = _arg1.down;
if (_arg1.overScale != undefined){
overScale = _arg1.overScale;
};
if (_arg1.scale != undefined){
scale = _arg1.scale;
};
scaleX = scale;
scaleY = scale;
addChild(_arg1.background);
x = _arg1.x;
y = _arg1.y;
if (_arg1.width != null){
width = _arg1.width;
};
if (_arg1.filterOver != null){
filtersOver = [_arg1.filterOver];
};
if (_arg1.filterOut != null){
filtersOut = [_arg1.filterOut];
};
if (((!((_arg1.text == null))) && ((_arg1.text is String)))){
text = new Text({text:_arg1.text});
} else {
text = _arg1.text;
};
_arg1.width = width;
_arg1.height = height;
if (text != null){
if (_arg1.centerText){
text.x = (((_arg1.width / scaleX) - text.width) / 2);
text.y = ((height - text.height) / 2);
};
addChild(text);
};
if (_arg1.hit != undefined){
this.hitArea = _arg1.hit;
};
addEventListener(MouseEvent.ROLL_OVER, onRollOver);
addEventListener(MouseEvent.ROLL_OUT, onRollOut);
addEventListener(Event.ENTER_FRAME, onUpdate);
mouseChildren = false;
onRollOut();
}
}
}//package com.onlinegamestars.ender.xmlui
Section 16
//LangBar (com.onlinegamestars.ender.xmlui.LangBar)
package com.onlinegamestars.ender.xmlui {
import flash.events.*;
import flash.display.*;
public class LangBar extends Sprite {
private var langButtons:Array;
private var langs:Array;
public function LangBar(_arg1:Array){
var _local2:Button;
langButtons = [];
super();
this.langs = _arg1;
var _local3:int;
while (_local3 < _arg1.length) {
_local2 = new Button({text:null, background:new (XMLUI.Resources[("flag_" + _arg1[_local3])])});
_local2.y = ((576 - _local2.height) - 2);
_local2.x = ((755 - 2) - ((_arg1.length - _local3) * (_local2.width + 2)));
_local2.addEventListener(MouseEvent.ROLL_OVER, onLangBtnRollOver);
_local2.addEventListener(MouseEvent.ROLL_OUT, onLangBtnRollOut);
_local2.addEventListener(MouseEvent.CLICK, onLangBtnClick);
addChild(_local2);
langButtons.push(_local2);
_local3++;
};
}
public function onLangBtnRollOver(_arg1:MouseEvent):void{
_arg1.target.scaleX = 1.1;
_arg1.target.scaleY = 1.1;
}
public function onLangBtnClick(_arg1:MouseEvent):void{
var _local2:int = langButtons.indexOf(_arg1.target);
XMLUI.xml = XMLUI.Resources[("xml" + langs[_local2].toString().toUpperCase())];
}
public function onLangBtnRollOut(_arg1:MouseEvent):void{
_arg1.target.scaleX = 1;
_arg1.target.scaleY = 1;
}
}
}//package com.onlinegamestars.ender.xmlui
Section 17
//Text (com.onlinegamestars.ender.xmlui.Text)
package com.onlinegamestars.ender.xmlui {
import flash.display.*;
import flash.filters.*;
import flash.text.*;
public class Text extends UIItem {
private var data:Object;
private var tf:TextField;
private var _text:String;
private var format:TextFormat;
public function Text(_arg1:Object){
setData(_arg1);
mouseChildren = false;
}
public function setColor(_arg1:uint):void{
data.x = x;
data.y = y;
data.color = _arg1;
setData(data);
}
override public function setData(_arg1:Object):void{
var _local3:Array;
var _local4:String;
var _local5:int;
var _local6:int;
var _local7:Array;
this.data = _arg1;
while (numChildren > 0) {
removeChildAt(0);
};
if (_arg1.background){
addChild(DisplayObject(_arg1.background));
};
tf = new TextField();
if (_arg1.autosize != null){
tf.autoSize = _arg1.autosize;
};
tf.embedFonts = _arg1.embed;
if (_arg1.multiline){
tf.multiline = true;
tf.wordWrap = true;
tf.autoSize = TextFieldAutoSize.CENTER;
};
format = new TextFormat(_arg1.font, _arg1.size, _arg1.color, _arg1.bold, _arg1.itallic, null, null, null, _arg1.align);
x = _arg1.x;
y = _arg1.y;
if (_arg1.width > 0){
tf.width = _arg1.width;
};
if (_arg1.height > 0){
tf.height = _arg1.height;
};
_text = String(_arg1.text);
if (_arg1.reverse){
_local3 = _text.split("\\n");
_text = "";
_local5 = 0;
while (_local5 < _local3.length) {
_local4 = _local3[_local5];
_local6 = (_local4.length - 1);
while (_local6 >= 0) {
_text = (_text + _local4.charAt(_local6));
_local6--;
};
if (_local5 < (_local3.length - 1)){
_text = (_text + "\\n");
};
_local5++;
};
};
var _local2:RegExp = /\\n/g;
_text = _text.replace(_local2, "\n");
tf.selectable = false;
tf.text = String(_text);
tf.setTextFormat(format);
tf.height = (tf.getLineMetrics(0).height + 2);
if (_arg1.centerText){
tf.width = (width / scaleX);
tf.y = ((height - tf.height) / 2);
};
if (_arg1.glow != undefined){
if ((_arg1.glow is BitmapFilter)){
tf.filters = [_arg1.glow];
} else {
_local7 = String(_arg1.glow).split(";");
tf.filters = [new GlowFilter(_local7[0], _local7[1], _local7[2], _local7[3], _local7[4])];
};
};
addChild(tf);
}
public function get text():String{
return (_text);
}
public function printData(_arg1:Object):String{
var _local3:String;
var _local2 = "";
for (_local3 in _arg1) {
_local2 = (_local2 + (((_local3 + ": ") + _arg1[_local3]) + ", "));
};
return ((_local2 + ";!!!!"));
}
override public function toString():String{
return ((("[object Text('" + _text) + "')]"));
}
public function set text(_arg1:String):void{
data.x = x;
data.y = y;
_text = _arg1;
data.text = _arg1;
setData(data);
}
}
}//package com.onlinegamestars.ender.xmlui
Section 18
//UIItem (com.onlinegamestars.ender.xmlui.UIItem)
package com.onlinegamestars.ender.xmlui {
import flash.display.*;
public class UIItem extends Sprite {
public var id:String;
public function setData(_arg1:Object):void{
}
}
}//package com.onlinegamestars.ender.xmlui
Section 19
//XMLUI (com.onlinegamestars.ender.xmlui.XMLUI)
package com.onlinegamestars.ender.xmlui {
import flash.display.*;
import flash.utils.*;
public class XMLUI extends Sprite {
public static var Resources:Object;
public static var preserveCoordinates:Boolean = false;
private static var _xml:XML;
private static var list:Array = new Array();
public function XMLUI():void{
}
public static function getData(_arg1:String):Object{
var fmt:Object;
var id = _arg1;
if ((((id == "")) || ((id == null)))){
return ({});
};
var params:XML = _xml["*"].(@id == id)[0];
switch (params.name().localName){
case "str":
return ({text:String(params)});
case "txt":
fmt = getData(params.@fmtID);
fmt["text"] = String(params);
if (params.@font != undefined){
fmt["font"] = params.@font;
};
if (params.@background != undefined){
fmt["background"] = new (getResource(params.@background));
};
if (params.@multiline != undefined){
fmt["multiline"] = params.@multiline;
};
if (params.@color != undefined){
fmt["color"] = params.@color;
};
if (params.@size != undefined){
fmt["size"] = params.@size;
};
if (params.@bold != undefined){
fmt["bold"] = params.@bold;
};
if (params.@itallic != undefined){
fmt["itallic"] = params.@itallic;
};
if (params.@x != undefined){
fmt["x"] = params.@x;
};
if (params.@y != undefined){
fmt["y"] = params.@y;
};
if (params.@width != undefined){
fmt["width"] = params.@width;
};
if (params.@height != undefined){
fmt["height"] = params.@height;
};
if (params.@reverse != undefined){
fmt["reverse"] = params.@reverse;
};
if (params.@autosize != undefined){
fmt["autosize"] = params.@autosize;
};
if (params.@embed != undefined){
fmt["embed"] = params.@embed;
};
if (params.@centerText != undefined){
fmt["centerText"] = params.@centerText;
};
if (params.@glow != undefined){
fmt["glow"] = params.@glow;
};
if (params.@align != undefined){
fmt["align"] = params.@align;
};
return (fmt);
case "btn":
if (params.@fmtID != undefined){
fmt = getData(params.@fmtID);
fmt["text"] = String(params);
};
return ({text:((params.@fmtID)!=undefined) ? new Text(fmt) : null, background:((params.@background)!=undefined) ? new (getResource(params.@background)) : undefined, over:((params.@over)!=undefined) ? new (getResource(params.@over)) : undefined, down:((params.@down)!=undefined) ? new (getResource(params.@down)) : undefined, hit:((params.@hit)!=undefined) ? new Sprite().addChild(new (getResource(params.@hit))).parent : undefined, overScale:((params.@overScale)!=undefined) ? params.@overScale.valueOf() : 1, scale:((params.@scale)!=undefined) ? params.@scale.valueOf() : 1, x:((params.@x)!=undefined) ? params.@x.valueOf() : 0, y:((params.@y)!=undefined) ? params.@y.valueOf() : 0, centerText:((params.@centerText)=="false") ? false : true, width:((params.@width)!=undefined) ? params.@width.valueOf() : null, height:((params.@height)!=undefined) ? params.@height.valueOf() : null});
case "fmt":
fmt = {text:String(params), font:params.@font, background:params.@background, glow:params.@glow, bold:((params.@bold)=="true") ? true : false, itallic:((params.@itallic)=="true") ? true : false, multiline:((params.@multiline)=="true") ? true : false, color:params.@color, size:params.@size, x:((params.@x)!=undefined) ? params.@x.valueOf() : 0, y:((params.@y)!=undefined) ? params.@y.valueOf() : 0, width:params.@width, autosize:((params.@autosize)!=undefined) ? params.@autosize : "none", reverse:((params.@reverse)=="true") ? true : false, embed:((params.@embed)=="true") ? true : false, centerText:((params.@centerText)=="true") ? true : false, align:((params.@align)!=undefined) ? params.@align : "center"};
if (fmt.background != undefined){
fmt.background = new (getResource(fmt.background));
} else {
fmt.background = false;
};
return (fmt);
};
return ({});
}
private static function getResource(_arg1:String):Class{
if (Resources != null){
return (Resources[_arg1]);
};
return ((getDefinitionByName(_arg1) as Class));
}
public static function getString(_arg1:String):String{
return (getData(_arg1).text);
}
public static function newText(_arg1:String):Text{
var _local2:Text = new Text(getData(_arg1));
list.push([_arg1, _local2]);
return (_local2);
}
public static function set xml(_arg1:XML):void{
var _local2:int;
var _local3:int;
_xml = _arg1;
var _local4:int;
while (_local4 < list.length) {
_local2 = list[_local4][1].x;
_local3 = list[_local4][1].y;
list[_local4][1].setData(getData(list[_local4][0]));
if (preserveCoordinates){
list[_local4][1].x = _local2;
list[_local4][1].y = _local3;
};
_local4++;
};
}
public static function newButton(_arg1:String):Button{
var _local2:Button = new Button(getData(_arg1));
list.push([_arg1, _local2]);
return (_local2);
}
public static function get xml():XML{
return (_xml);
}
}
}//package com.onlinegamestars.ender.xmlui
Section 20
//Camera (com.onlinegamestars.ender.Camera)
package com.onlinegamestars.ender {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Camera extends MovieClip {
private var cameraTrans:Transform;
private var level:int;// = 1
private var curM:Matrix;
private var mc:DisplayObjectContainer;
private var bRotate:Boolean;// = false
private var parentM:Matrix;
private var resetTopLevelColor:ColorTransform;
private var h:int;
private var objToFollow:DisplayObject;// = null
private var resetM:Matrix;
private var w:int;
private var topLevelTrans:Transform;
public function Camera(_arg1:int=1){
this.level = _arg1;
super();
visible = false;
if (stage){
init();
} else {
addEventListener(Event.ADDED_TO_STAGE, init);
};
}
private function recalcParentMatrix():void{
var _local2:Transform;
mc = parent;
var _local1:int = ((level)>0) ? (level - 1) : 1000;
while (((((_local1--) && (mc))) && (!((mc == root))))) {
_local2 = new Transform(mc);
if (!parentM){
parentM = _local2.matrix;
} else {
parentM.concat(_local2.matrix);
};
mc = mc.parent;
};
cameraTrans = new Transform(this);
topLevelTrans = new Transform(mc);
resetM = topLevelTrans.matrix;
resetTopLevelColor = topLevelTrans.colorTransform;
}
private function cameraStep(_arg1:Event=null):void{
topLevelTrans.colorTransform = cameraTrans.colorTransform;
curM = cameraTrans.matrix;
if (parentM){
curM.concat(parentM);
};
curM.invert();
curM.translate((w / 2), (h / 2));
topLevelTrans.matrix = curM;
mc.filters = this.filters;
}
private function init(_arg1:Event=null):void{
removeEventListener(Event.ADDED_TO_STAGE, init);
var _local2:String = stage.scaleMode;
w = root.width;
h = root.height;
stage.scaleMode = _local2;
recalcParentMatrix();
cameraStep();
addEventListener(Event.ENTER_FRAME, cameraStep);
addEventListener(Event.REMOVED_FROM_STAGE, resetStage);
}
private function resetStage(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, cameraStep);
removeEventListener(Event.REMOVED_FROM_STAGE, resetStage);
topLevelTrans.matrix = resetM;
topLevelTrans.colorTransform = resetTopLevelColor;
}
}
}//package com.onlinegamestars.ender
Section 21
//getGrayscaleFilter (com.onlinegamestars.ender.getGrayscaleFilter)
package com.onlinegamestars.ender {
import flash.filters.*;
public function getGrayscaleFilter(_arg1:Number=0):ColorMatrixFilter{
return (new ColorMatrixFilter([0.33, 0.33, 0.33, 0, _arg1, 0.33, 0.33, 0.33, 0, _arg1, 0.33, 0.33, 0.33, 0, _arg1, 0, 0, 0, 1, 0]));
}
}//package com.onlinegamestars.ender
Section 22
//EndGamePage (components.EndGamePage)
package components {
import flash.events.*;
import com.onlinegamestars.ender.xmlui.*;
import flash.display.*;
import flash.filters.*;
public class EndGamePage extends Sprite {
private var txtScore:Text;
private var txtTitle:Text;
public var total:int;// = 0
private var txtScoreValue:Text;
private var txtMana:Text;
private var txtManaValue:Text;
private var txtTotalValue:Text;
private var txtGoldValue:Text;
private var txtGold:Text;
private var txtTotal:Text;
private var txtLives:Text;
private var txtLivesValue:Text;
public function EndGamePage(){
addChild(new Bitmap(new EndGamePageGfx(0, 0)));
addEventListener(MouseEvent.CLICK, onClicked);
visible = false;
txtTitle = (addChild(XMLUI.newText("txt_egp_title")) as Text);
txtScore = (addChild(XMLUI.newText("txt_egp_stat")) as Text);
txtScoreValue = (addChild(XMLUI.newText("txt_egp_value")) as Text);
txtLives = (addChild(XMLUI.newText("txt_egp_stat")) as Text);
txtLivesValue = (addChild(XMLUI.newText("txt_egp_value")) as Text);
txtLives.y = (txtLives.y + 35);
txtLivesValue.y = (txtLivesValue.y + 35);
txtGold = (addChild(XMLUI.newText("txt_egp_stat")) as Text);
txtGoldValue = (addChild(XMLUI.newText("txt_egp_value")) as Text);
txtGold.y = (txtGold.y + 70);
txtGoldValue.y = (txtGoldValue.y + 70);
txtMana = (addChild(XMLUI.newText("txt_egp_stat")) as Text);
txtManaValue = (addChild(XMLUI.newText("txt_egp_value")) as Text);
txtMana.y = (txtMana.y + 105);
txtManaValue.y = (txtManaValue.y + 105);
txtTotal = (addChild(XMLUI.newText("txt_egp_stat")) as Text);
txtTotalValue = (addChild(XMLUI.newText("txt_egp_value")) as Text);
txtTotal.y = (txtTotal.y + 155);
txtTotalValue.y = (txtTotalValue.y + 155);
}
private function sendScores(_arg1:int, _arg2:int):void{
var _local3:Object;
var _local4:String;
switch (_arg2){
case 0:
KongregateAPI.api.stats.submit("score_easy", _arg1);
break;
case 1:
KongregateAPI.api.stats.submit("score_normal", _arg1);
break;
case 2:
KongregateAPI.api.stats.submit("score_hard", _arg1);
break;
};
}
private function onClicked(_arg1:MouseEvent):void{
visible = false;
}
public function show(_arg1:uint=0, _arg2:int=0, _arg3:int=0, _arg4:int=0, _arg5:Boolean=false, _arg6:int=2):void{
var _local7 = 10;
var _local8 = 1;
var _local9 = 1;
if (_arg1 > 0){
if (_arg5){
txtTitle.text = XMLUI.getData("str_egp_title_end").text;
} else {
txtTitle.text = XMLUI.getData("str_egp_title_win").text;
};
MusicLibrary.playSound(MusicLibrary.Complete);
} else {
txtTitle.text = XMLUI.getData("str_egp_title_loose").text;
MusicLibrary.playSound(MusicLibrary.GameOver);
};
txtScore.text = XMLUI.getData("str_egp_score").text;
txtScoreValue.text = _arg4.toString();
txtLives.text = XMLUI.getData("str_egp_lives").text;
txtLivesValue.text = ((((_arg1.toString() + " x ") + _local7.toString()) + " = ") + (_arg1 * _local7).toString());
txtGold.text = XMLUI.getData("str_egp_gold").text;
txtGoldValue.text = ((((_arg2.toString() + " x ") + _local8.toString()) + " = ") + (_arg2 * _local8).toString());
txtMana.text = XMLUI.getData("str_egp_mana").text;
txtManaValue.text = ((((_arg3.toString() + " x ") + _local9.toString()) + " = ") + (_arg3 * _local9).toString());
txtTotal.text = XMLUI.getData("str_egp_total").text;
total = (total + (((_arg4 + (_local7 * _arg1)) + (_local8 * _arg2)) + (_local9 * _arg3)));
txtTotalValue.text = total.toString();
filters = [new GlowFilter(0xFFFFFF, 1, 16, 16)];
visible = true;
if ((((_arg1 <= 0)) || (_arg5))){
sendScores(total, _arg6);
total = 0;
};
}
}
}//package components
Section 23
//LevelSelectionPage (components.LevelSelectionPage)
package components {
import flash.events.*;
import com.onlinegamestars.ender.xmlui.*;
import flash.display.*;
import flash.filters.*;
import com.onlinegamestars.ender.*;
public class LevelSelectionPage extends Sprite {
private var back:mcProgressMap;
private var levelButtons:Array;
private var loadLevel:Function;
private var bHelpShowed:Boolean;// = false
public function LevelSelectionPage(_arg1:Function){
back = new mcProgressMap();
levelButtons = [];
super();
loadLevel = _arg1;
addChild(back);
var _local2:int;
while (_local2 < 10) {
levelButtons.push(XMLUI.newButton(("btn_level" + _local2.toString())));
addChild(levelButtons[_local2]);
levelButtons[_local2].filtersOver = [new GlowFilter(778008)];
levelButtons[_local2].filtersDisable = [getGrayscaleFilter(0)];
levelButtons[_local2].addEventListener(MouseEvent.CLICK, onLoadLevel);
if (_local2 > 0){
levelButtons[_local2].disable();
};
_local2++;
};
}
private function onLoadLevel(_arg1:MouseEvent):void{
var e = _arg1;
visible = false;
var n:int = levelButtons.indexOf(e.target);
if ((((n == 0)) && ((Main.bHelpShowed == false)))){
Main.onRulesClicked();
Main.btnClose.addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent):void{
loadLevel(0);
});
return;
};
loadLevel(n);
}
public function show(_arg1:int=0):void{
MusicLibrary.startBackMusic(MusicLibrary.MenuBack);
levelButtons[_arg1].enable();
visible = true;
}
}
}//package components
Section 24
//MochiAd (mochi.as3.MochiAd)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showClickAwayAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
var _local1:Object = this.parent._mochiad_ctr;
var _local2:Number = (getTimer() - this.started);
var _local3:Boolean;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
_local3 = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.root == null){
_local3 = true;
};
if (_local3){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(_arg1:String):String{
var _local2:String = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType == "application"){
return (_local2);
};
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (_arg1.origFrameRate != undefined){
_arg1.stage.frameRate = _arg1.origFrameRate;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad._containerLCName != undefined){
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"});
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time:Number = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
var _local1:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
var _local1:Object = this.parent._mochiad_ctr;
var _local2:Number = (getTimer() - this.started);
var _local3:Boolean;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
var _local3:Object = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (_local3);
}
public static function _cleanup(_arg1:Object):void{
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
var idx:Number = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(_arg1:Object):MovieClip{
var clip:Object;
var mc:MovieClip;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
var DEFAULTS:Object = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!(clip is DisplayObject)){
trace("Warning: Object passed as container clip not a descendant of the DisplayObject type");
return (null);
};
if (MovieClip(clip).stage == null){
trace("Warning: Container clip for ad is not attached to the stage");
return (null);
};
if (!MochiAd._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
var depth:Number = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
var wh:Array = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
} else {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
};
var lv:URLVariables = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
loader = new Loader();
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest(((server + ".swf?cacheBust=") + new Date().getTime()));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (_arg1:IOErrorEvent):void{
trace("[MochiAds] Blocked URL");
});
if (!options.skip){
loader.load(req);
};
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{
var _local4:Array = _arg2.split(".");
var _local5:Number = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
if (typeof(_arg1[_local4[_local5]]) == "function"){
return (_arg1[_local4[_local5]].apply(_arg1, _arg3));
};
return (undefined);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local6:Array;
var _local3:Object = _arg2.getBounds(_arg2.root);
var _local4:Number = 0;
var _local5:Number = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function adShowing(_arg1:Object):void{
_arg1.origFrameRate = _arg1.stage.frameRate;
_arg1.stage.frameRate = 30;
}
public static function getValue(_arg1:Object, _arg2:String):Object{
var _local3:Array = _arg2.split(".");
var _local4:Number = 0;
while (_local4 < (_local3.length - 1)) {
if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local3[_local4]];
_local4++;
};
return (_arg1[_local3[_local4]]);
}
public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{
var _local4:Object;
var _local5:Object;
switch (_arg3.id){
case "setValue":
MochiAd.setValue(_arg1, _arg3.objectName, _arg3.value);
break;
case "getValue":
_local4 = MochiAd.getValue(_arg1, _arg3.objectName);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(_arg1, _arg3.method, _arg3.args);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5);
break;
default:
trace(("[mochiads rpc] unknown rpc id: " + _arg3.id));
};
}
public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Array = _arg2.split(".");
var _local5:Number = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return;
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
_arg1[_local4[_local5]] = _arg3;
}
public static function showPreGameAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var complete:Boolean;
var unloaded:Boolean;
var sendHostProgress:Boolean;
var fn:Function;
var r:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}, ad_progress:function (_arg1:Number):void{
}, progress_override:function (_arg1:Object):Number{
return (NaN);
}, bar_offset:0};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
return;
};
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
if (options.skip){
ad_timeout = 0;
};
delete options.ad_timeout;
var fadeout_time:Number = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
var fn:Function = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
var bar:MovieClip = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = (10 + options.bar_offset);
bar.y = (h - 20);
};
var bar_w:Number = ((w - bar.x) - 10);
var bar_color:Number = options.color;
delete options.color;
var bar_background:Number = options.background;
delete options.background;
var bar_outline:Number = options.outline;
delete options.outline;
var backing_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 1);
var backing:Object = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo(bar_w, 0);
backing.lineTo(bar_w, 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
var inside_mc:MovieClip = createEmptyMovieClip(bar, "_inside", 2);
var inside:Object = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo(bar_w, 0);
inside.lineTo(bar_w, 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
var outline_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 3);
var outline:Object = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo(bar_w, 0);
outline.lineTo(bar_w, 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
var progress:Number = Math.min(1, options.progress_override(clip));
var f:Function = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
if (!isNaN(progress)){
complete = (progress == 1);
} else {
if (clip.loaderInfo.bytesLoaded == clip.loaderInfo.bytesTotal){
complete = true;
} else {
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
mc.rpcTestFn = function (_arg1:String):Object{
trace(("[MOCHIAD rpcTestFn] " + _arg1));
return (_arg1);
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (_arg1:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var _local12:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
var _local1:Object = this.parent.parent.root;
var _local2:Object = this.parent._mochiad_ctr;
var _local3:Number = (getTimer() - this.started);
var _local4:Boolean;
var _local5:Number = _local1.loaderInfo.bytesTotal;
var _local6:Number = _local1.loaderInfo.bytesLoaded;
var _local7:Number = Math.min(1, options.progress_override(_local1));
if (_local7 == 1){
complete = true;
};
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
var _local8:Number = ((100 * _local6) / _local5);
if (!isNaN(_local7)){
_local8 = (100 * _local7);
};
var _local9:Number = ((100 * _local3) / chk.ad_msec);
var _local10:Object = this._mochiad_bar._inside;
var _local11:Number = Math.min(100, Math.min(((_local8) || (0)), _local9));
_local11 = Math.max(this.last_pcnt, _local11);
this.last_pcnt = _local11;
_local10.scaleX = (_local11 * 0.01);
options.ad_progress(_local11);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local8});
if (_local8 >= 100){
sendHostProgress = false;
};
};
if (!chk.showing){
_local12 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local12 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((_local3 > chk.ad_timeout)) && ((_local8 == 100)))){
options.ad_failed();
_local4 = true;
};
};
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (unloaded){
MochiAd.unload(_local1);
} else {
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var mc = _arg1;
var f:Function = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package mochi.as3
Section 25
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const NO_USER:String = "NoUser";
public static const IO_ERROR:String = "IOError";
public static const ITEM_NEW:String = "ItemNew";
public static const ITEM_OWNED:String = "ItemOwned";
public static const STORE_ITEMS:String = "StoreItems";
public static const ERROR:String = "Error";
public static const STORE_SHOW:String = "StoreShow";
public static var _inventory:MochiInventory;
public static function triggerEvent(_arg1:String, _arg2:Object):void{
MochiSocial.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
MochiSocial.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
MochiSocial.addEventListener(_arg1, _arg2);
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function get inventory():MochiInventory{
return (_inventory);
}
public static function showStore(_arg1:Object=null):void{
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_inventory = new MochiInventory();
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_inventory = null;
});
}
}//package mochi.as3
Section 26
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function reencode():void{
var _local1:uint = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function toString():String{
var _local1:String = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
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 get value():Number{
return (Number(this.toString()));
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
}
}//package mochi.as3
Section 27
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
eventTable = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
return;
};
for (_local3 in eventTable[_arg1]) {
var _local6 = eventTable[_arg1];
_local6[_local3](_arg2);
};
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
eventTable[_arg1] = [];
return;
};
for (_local3 in eventTable[_arg1]) {
if (eventTable[_arg1][_local3] != _arg2){
} else {
eventTable[_arg1].splice(Number(_local3), 1);
};
};
}
public function addEventListener(_arg1:String, _arg2:Function):void{
removeEventListener(_arg1, _arg2);
eventTable[_arg1].push(_arg2);
}
}
}//package mochi.as3
Section 28
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public static function endPlay():void{
MochiServices.send("events_clearRoundID", null, null, null);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function trackEvent(_arg1:String, _arg2=null):void{
MochiServices.send("events_trackEvent", {tag:_arg1, value:_arg2}, null, null);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function startSession(_arg1:String):void{
MochiServices.send("events_beginSession", {achievementID:_arg1}, null, null);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function setNotifications(_arg1:MovieClip, _arg2:Object):void{
var _local4:Object;
var _local3:Object = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
_local3.clip = _arg1;
MochiServices.send("events_setNotifications", _local3, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startPlay(_arg1:String="gameplay"):void{
MochiServices.send("events_setRoundID", {tag:String(_arg1)}, null, null);
}
}
}//package mochi.as3
Section 29
//MochiInventory (mochi.as3.MochiInventory)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
public dynamic class MochiInventory extends Proxy {
private var _timer:Timer;
private var _names:Array;
private var _syncID:Number;
private var _consumableProperties:Object;
private var _storeSync:Object;
private var _outstandingID:Number;
private var _syncPending:Boolean;
public static const READY:String = "InvReady";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IoError";
private static const KEY_SALT:String = " syncMaint";
public static const WRITTEN:String = "InvWritten";
public static const NOT_READY:String = "InvNotReady";
public static const VALUE_ERROR:String = "InvValueError";
private static const CONSUMER_KEY:String = "MochiConsumables";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiInventory():void{
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned);
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut);
_storeSync = new Object();
_syncPending = false;
_outstandingID = 0;
_syncID = 0;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, sync);
_timer.start();
if (MochiSocial.loggedIn){
loggedIn();
} else {
loggedOut();
};
}
private function newItems(_arg1:Object):void{
if (!this[(_arg1.id + KEY_SALT)]){
this[(_arg1.id + KEY_SALT)] = 0;
};
if (!this[_arg1.id]){
this[_arg1.id] = 0;
};
this[(_arg1.id + KEY_SALT)] = (this[(_arg1.id + KEY_SALT)] + _arg1.count);
this[_arg1.id] = (this[_arg1.id] + _arg1.count);
if (_arg1.privateProperties.consumable){
if (!this[_arg1.privateProperties.tag]){
this[_arg1.privateProperties.tag] = 0;
};
this[_arg1.privateProperties.tag] = (this[_arg1.privateProperties.tag] + (_arg1.privateProperties.inc * _arg1.count));
};
}
public function release():void{
MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (-1);
};
if (_consumableProperties[_arg1]){
return (MochiDigits(_consumableProperties[_arg1]).value);
};
return (undefined);
}
private function loggedIn(_arg1:Object=null):void{
MochiUserData.get(CONSUMER_KEY, getConsumableBag);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(_arg1):Boolean{
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (false);
};
if (_consumableProperties[_arg1] == undefined){
return (false);
};
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(_arg1:int):int{
return (((_arg1)>=_names.length) ? 0 : (_arg1 + 1));
}
private function putConsumableBag(_arg1:MochiUserData):void{
_syncPending = false;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
_outstandingID = -1;
};
triggerEvent(WRITTEN, {});
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:MochiDigits;
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return;
};
if (!(_arg2 is Number)){
triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:_arg2});
return;
};
if (_consumableProperties[_arg1]){
_local3 = MochiDigits(_consumableProperties[_arg1]);
if (_local3.value == _arg2){
return;
};
_local3.value = _arg2;
} else {
_names.push(_arg1);
_consumableProperties[_arg1] = new MochiDigits(_arg2);
};
_syncID++;
}
private function itemOwned(_arg1:Object):void{
_storeSync[_arg1.id] = {properties:_arg1.properties, count:_arg1.count};
}
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 nextName(_arg1:int):String{
return (_names[(_arg1 - 1)]);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(_arg1):Boolean{
if (!_consumableProperties[_arg1]){
return (false);
};
_names.splice(_names.indexOf(_arg1), 1);
delete _consumableProperties[_arg1];
return (true);
}
private function getConsumableBag(_arg1:MochiUserData):void{
var _local2:String;
var _local3:Number;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
return;
};
_consumableProperties = {};
_names = new Array();
if (_arg1.data){
for (_local2 in _arg1.data) {
_names.push(_local2);
_consumableProperties[_local2] = new MochiDigits(_arg1.data[_local2]);
};
};
for (_local2 in _storeSync) {
_local3 = _storeSync[_local2].count;
if (_consumableProperties[(_local2 + KEY_SALT)]){
_local3 = (_local3 - _consumableProperties[_local2]);
};
if (_local3 == 0){
} else {
newItems({id:_local2, count:_local3, properties:_storeSync[_local2].properties});
};
};
triggerEvent(READY, {});
}
private function loggedOut(_arg1:Object=null):void{
_consumableProperties = null;
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
}
}//package mochi.as3
Section 30
//MochiScores (mochi.as3.MochiScores)
package mochi.as3 {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public static function showLeaderboard(_arg1:Object=null):void{
var n:Number;
var options = _arg1;
if (options != null){
delete options.clip;
MochiServices.setContainer();
MochiServices.bringToTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (_slot1.boardID != null){
options.boardID = _slot1.boardID;
};
};
MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _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);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
_arg1 = Number(_arg1);
if (isNaN(_arg1)){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(_arg1) != _arg1){
trace((("WARNING: Submitted score '" + String(_arg1)) + "' will be truncated"));
};
_arg1 = Number(_arg1);
};
};
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (((((_arg1) && ((_arg1.error == true)))) && (onErrorHandler))){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiServices.warnID(_arg1, true);
_slot1.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi.as3
Section 31
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _queue:Array;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
public static var servicesSync:MochiSync = new MochiSync();
private static var _nextCallbackID:Number;
private static var _clip:MovieClip;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _loader:Loader;
private static var _callbacks:Object;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(_arg1:Object):void{
var 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];
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_nextCallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + _arg1));
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_queue.push({methodName:_arg1, args:_arg2, callbackID:_nextCallbackID});
};
if (_clip != null){
if (_callbacks != null){
_callbacks[_nextCallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_nextCallbackID++;
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
public static function get childClip():Object{
return (_clip);
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _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 stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var 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://x.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);
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_mochiLocalConnection.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
};
return (_local2);
}
public static function getVersion():String{
return ("3.8 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
_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++;
};
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (((_clip) && (_queue))){
while (_queue.length > 0) {
_local2 = _queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _callbacks[_local2.callbackID];
};
delete _callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(_arg1:Object):void{
var _local2:String = _arg1.target;
var _local3:String = _arg1.event;
switch (_local2){
case "events":
MochiEvents.triggerEvent(_arg1.event, _arg1.args);
break;
case "coins":
MochiCoins.triggerEvent(_arg1.event, _arg1.args);
break;
case "sync":
servicesSync.triggerEvent(_arg1.event, _arg1.args);
break;
};
}
private static function urlOptions(_arg1:Object):Object{
var _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 setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_clip != null){
if (_clip.parent){
_clip.parent.removeChild(_clip);
};
};
if (_arg1 != null){
if ((_arg1 is DisplayObjectContainer)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is DisplayObjectContainer)){
DisplayObjectContainer(_container).addChild(_clip);
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
private static function loadError(_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _queue.shift());
};
};
}
private static function loadLCBridge(_arg1:Object):void{
var loader:Loader;
var clip = _arg1;
loader = new Loader();
var mochiLCURL:String = (_servURL + _mochiLC);
var req:URLRequest = new URLRequest(mochiLCURL);
var complete:Function = function (_arg1:Object):void{
_mochiLocalConnection = MovieClip(loader.content);
listen();
};
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
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(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);
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
warnID(id, false);
if ((clip is DisplayObject)){
if (clip.stage == null){
trace("MochiServices connect requires the containing clip be attached to the stage");
};
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function updateCopy(_arg1:Object):void{
MochiServices.send("coins_updateCopy", _arg1, null, null);
}
public static function bringToTop(_arg1:Event=null):void{
var e = _arg1;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 32
//MochiSocial (mochi.as3.MochiSocial)
package mochi.as3 {
public class MochiSocial {
public static const LOGGED_IN:String = "LoggedIn";
public static const PROFILE_HIDE:String = "ProfileHide";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const IO_ERROR:String = "IOError";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const USER_INFO:String = "UserInfo";
public static const ERROR:String = "Error";
public static const LOGIN_SHOW:String = "LoginShow";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_SHOWN:String = "LoginShown";
public static const LOGIN_HIDE:String = "LoginHide";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static var _user_info:Object = null;
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("coins_saveUserProperties", _arg1);
}
public static function get loggedIn():Boolean{
return (!((_user_info == null)));
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function getUserInfo():void{
MochiServices.send("coins_getUserInfo");
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showLoginWidget", {options:_arg1});
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function requestLogin():void{
MochiServices.send("coins_requestLogin");
}
public static function getAPIURL():String{
if (!_user_info){
return (null);
};
return (_user_info.api_url);
}
public static function hideLoginWidget():void{
MochiServices.send("coins_hideLoginWidget");
}
public static function getAPIToken():String{
if (!_user_info){
return (null);
};
return (_user_info.api_token);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_user_info = _arg1;
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_user_info = null;
});
}
}//package mochi.as3
Section 33
//MochiSync (mochi.as3.MochiSync)
package mochi.as3 {
import flash.utils.*;
public dynamic class MochiSync extends Proxy {
private var _syncContainer:Object;
public static var SYNC_PROPERTY:String = "UpdateProperty";
public static var SYNC_REQUEST:String = "SyncRequest";
public function MochiSync():void{
_syncContainer = {};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
if (_syncContainer[_arg1] == _arg2){
return;
};
var _local3:String = _arg1.toString();
_syncContainer[_local3] = _arg2;
MochiServices.send("sync_propUpdate", {name:_local3, value:_arg2});
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
return (_syncContainer[_arg1]);
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
switch (_arg1){
case SYNC_REQUEST:
MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY:
_syncContainer[_arg2.name] = _arg2.value;
break;
};
}
}
}//package mochi.as3
Section 34
//MochiUserData (mochi.as3.MochiUserData)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class MochiUserData extends EventDispatcher {
public var callback:Function;// = null
public var operation:String;// = null
public var error:Event;// = null
public var data;// = null
public var _loader:URLLoader;
public var key:String;// = 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 errorHandler(_arg1:IOErrorEvent):void{
data = null;
error = _arg1;
if (callback != null){
performCallback();
} else {
dispatchEvent(_arg1);
};
close();
}
public function putEvent(_arg1):void{
request("put", serialize(_arg1));
}
public function deserialize(_arg1:ByteArray){
_arg1.objectEncoding = ObjectEncoding.AMF3;
_arg1.uncompress();
return (_arg1.readObject());
}
public function securityErrorHandler(_arg1:SecurityErrorEvent):void{
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _arg1.toString())));
}
public function getEvent():void{
request("get", serialize(null));
}
override public function toString():String{
return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]"));
}
public function performCallback():void{
try {
callback(this);
} catch(e:Error) {
trace(("[MochiUserData] exception during callback: " + e));
};
}
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 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 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 35
//BitmapAsset (mx.core.BitmapAsset)
package mx.core {
import flash.display.*;
public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject {
mx_internal static const VERSION:String = "3.4.0.9271";
public function BitmapAsset(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
public function get measuredWidth():Number{
if (bitmapData){
return (bitmapData.width);
};
return (0);
}
public function get measuredHeight():Number{
if (bitmapData){
return (bitmapData.height);
};
return (0);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
}
}//package mx.core
Section 36
//ByteArrayAsset (mx.core.ByteArrayAsset)
package mx.core {
import flash.utils.*;
public class ByteArrayAsset extends ByteArray implements IFlexAsset {
mx_internal static const VERSION:String = "3.4.0.9271";
}
}//package mx.core
Section 37
//EdgeMetrics (mx.core.EdgeMetrics)
package mx.core {
public class EdgeMetrics {
public var top:Number;
public var left:Number;
public var bottom:Number;
public var right:Number;
mx_internal static const VERSION:String = "3.4.0.9271";
public static const EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
;
public function EdgeMetrics(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
this.left = _arg1;
this.top = _arg2;
this.right = _arg3;
this.bottom = _arg4;
}
public function clone():EdgeMetrics{
return (new EdgeMetrics(left, top, right, bottom));
}
}
}//package mx.core
Section 38
//FlexBitmap (mx.core.FlexBitmap)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexBitmap extends Bitmap {
mx_internal static const VERSION:String = "3.4.0.9271";
public function FlexBitmap(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
var bitmapData = _arg1;
var pixelSnapping = _arg2;
var smoothing = _arg3;
super(bitmapData, pixelSnapping, smoothing);
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 39
//FlexMovieClip (mx.core.FlexMovieClip)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexMovieClip extends MovieClip {
mx_internal static const VERSION:String = "3.4.0.9271";
public function FlexMovieClip(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 40
//FontAsset (mx.core.FontAsset)
package mx.core {
import flash.text.*;
public class FontAsset extends Font implements IFlexAsset {
mx_internal static const VERSION:String = "3.4.0.9271";
}
}//package mx.core
Section 41
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 42
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 43
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.accessibility.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get visible():Boolean;
function get rotation():Number;
function localToGlobal(_arg1:Point):Point;
function get name():String;
function set width(_arg1:Number):void;
function get measuredHeight():Number;
function get blendMode():String;
function get scale9Grid():Rectangle;
function set name(_arg1:String):void;
function set scaleX(_arg1:Number):void;
function set scaleY(_arg1:Number):void;
function get measuredWidth():Number;
function get accessibilityProperties():AccessibilityProperties;
function set scrollRect(_arg1:Rectangle):void;
function get cacheAsBitmap():Boolean;
function globalToLocal(_arg1:Point):Point;
function get height():Number;
function set blendMode(_arg1:String):void;
function get parent():DisplayObjectContainer;
function getBounds(_arg1:DisplayObject):Rectangle;
function get opaqueBackground():Object;
function set scale9Grid(_arg1:Rectangle):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set alpha(_arg1:Number):void;
function set accessibilityProperties(_arg1:AccessibilityProperties):void;
function get width():Number;
function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean;
function set cacheAsBitmap(_arg1:Boolean):void;
function get scaleX():Number;
function get scaleY():Number;
function get scrollRect():Rectangle;
function get mouseX():Number;
function get mouseY():Number;
function set height(_arg1:Number):void;
function set mask(_arg1:DisplayObject):void;
function getRect(_arg1:DisplayObject):Rectangle;
function get alpha():Number;
function set transform(_arg1:Transform):void;
function move(_arg1:Number, _arg2:Number):void;
function get loaderInfo():LoaderInfo;
function get root():DisplayObject;
function hitTestObject(_arg1:DisplayObject):Boolean;
function set opaqueBackground(_arg1:Object):void;
function set visible(_arg1:Boolean):void;
function get mask():DisplayObject;
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function get transform():Transform;
function set filters(_arg1:Array):void;
function get x():Number;
function get y():Number;
function get filters():Array;
function set rotation(_arg1:Number):void;
function get stage():Stage;
}
}//package mx.core
Section 44
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function get instanceIndices():Array;
function set instanceIndices(_arg1:Array):void;
function get isDocument():Boolean;
function set repeaters(_arg1:Array):void;
function initializeRepeaterArrays(_arg1:IRepeaterClient):void;
function get repeaters():Array;
function set repeaterIndices(_arg1:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 45
//MovieClipAsset (mx.core.MovieClipAsset)
package mx.core {
public class MovieClipAsset extends FlexMovieClip implements IFlexAsset, IFlexDisplayObject, IBorder {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.4.0.9271";
public function MovieClipAsset(){
_measuredWidth = width;
_measuredHeight = height;
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
public function get borderMetrics():EdgeMetrics{
if (scale9Grid == null){
return (EdgeMetrics.EMPTY);
};
return (new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil((measuredWidth - scale9Grid.right)), Math.ceil((measuredHeight - scale9Grid.bottom))));
}
}
}//package mx.core
Section 46
//MovieClipLoaderAsset (mx.core.MovieClipLoaderAsset)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.system.*;
public class MovieClipLoaderAsset extends MovieClipAsset implements IFlexAsset, IFlexDisplayObject {
protected var initialHeight:Number;// = 0
private var loader:Loader;// = null
private var initialized:Boolean;// = false
protected var initialWidth:Number;// = 0
private var requestedHeight:Number;
private var requestedWidth:Number;
mx_internal static const VERSION:String = "3.4.0.9271";
public function MovieClipLoaderAsset(){
var _local1:LoaderContext = new LoaderContext();
_local1.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
if (("allowLoadBytesCodeExecution" in _local1)){
_local1["allowLoadBytesCodeExecution"] = true;
};
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.loadBytes(movieClipData, _local1);
addChild(loader);
}
override public function get width():Number{
if (!initialized){
return (initialWidth);
};
return (super.width);
}
override public function set width(_arg1:Number):void{
if (!initialized){
requestedWidth = _arg1;
} else {
loader.width = _arg1;
};
}
override public function get measuredHeight():Number{
return (initialHeight);
}
private function completeHandler(_arg1:Event):void{
initialized = true;
initialWidth = loader.width;
initialHeight = loader.height;
if (!isNaN(requestedWidth)){
loader.width = requestedWidth;
};
if (!isNaN(requestedHeight)){
loader.height = requestedHeight;
};
dispatchEvent(_arg1);
}
override public function set height(_arg1:Number):void{
if (!initialized){
requestedHeight = _arg1;
} else {
loader.height = _arg1;
};
}
override public function get measuredWidth():Number{
return (initialWidth);
}
override public function get height():Number{
if (!initialized){
return (initialHeight);
};
return (super.height);
}
public function get movieClipData():ByteArray{
return (null);
}
}
}//package mx.core
Section 47
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 48
//SoundAsset (mx.core.SoundAsset)
package mx.core {
import flash.media.*;
public class SoundAsset extends Sound implements IFlexAsset {
mx_internal static const VERSION:String = "3.4.0.9271";
}
}//package mx.core
Section 49
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import flash.display.*;
import mx.core.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "3.4.0.9271";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var result:String;
var o:DisplayObject;
var s:String;
var indices:Array;
var displayObject = _arg1;
try {
o = displayObject;
while (o != null) {
if (((((o.parent) && (o.stage))) && ((o.parent == o.stage)))){
break;
};
s = o.name;
if ((o is IRepeaterClient)){
indices = IRepeaterClient(o).instanceIndices;
if (indices){
s = (s + (("[" + indices.join("][")) + "]"));
};
};
result = ((result == null)) ? s : ((s + ".") + result);
o = o.parent;
};
} catch(e:SecurityError) {
};
return (result);
}
public static function createUniqueName(_arg1:Object):String{
if (!_arg1){
return (null);
};
var _local2:String = getQualifiedClassName(_arg1);
var _local3:int = _local2.indexOf("::");
if (_local3 != -1){
_local2 = _local2.substr((_local3 + 2));
};
var _local4:int = _local2.charCodeAt((_local2.length - 1));
if ((((_local4 >= 48)) && ((_local4 <= 57)))){
_local2 = (_local2 + "_");
};
return ((_local2 + counter++));
}
}
}//package mx.utils
Section 50
//background (background)
package {
import flash.display.*;
public dynamic class background extends MovieClip {
}
}//package
Section 51
//burning_arrow (burning_arrow)
package {
import flash.display.*;
public dynamic class burning_arrow extends MovieClip {
}
}//package
Section 52
//ButtonTooltip (ButtonTooltip)
package {
import flash.display.*;
public dynamic class ButtonTooltip extends MovieClip {
}
}//package
Section 53
//Dialogue (Dialogue)
package {
import flash.events.*;
import com.onlinegamestars.ender.xmlui.*;
import flash.display.*;
import flash.geom.*;
public class Dialogue extends Sprite {
private var msg:Text;
private var xml:XML;
private var pointer:DisplayObject;
private var currentMessage:int;
public function Dialogue(){
msg = ((addChild(new mcDialogBack()) as MovieClip).addChild(XMLUI.newText("txt_message")) as Text);
mouseChildren = false;
addEventListener(MouseEvent.CLICK, nextMessage);
visible = false;
}
private function nextMessage(_arg1:MouseEvent=null):void{
var _local2:Point;
if (xml == null){
return;
};
currentMessage++;
if (currentMessage >= xml.message.length()){
visible = false;
dispatchEvent(new Event("COMPLETE"));
return;
};
MusicLibrary.playSound(MusicLibrary.Dialog);
msg.text = XMLUI.getData(xml.message[currentMessage].@msgID).text;
while (numChildren > 1) {
removeChildAt(1);
};
if (xml.message[currentMessage].@marker != undefined){
pointer = new (Resources.getInstance()[xml.message[currentMessage].@marker]);
_local2 = globalToLocal(new Point(((xml.message[currentMessage].@x)!=undefined) ? xml.message[currentMessage].@x : 0, ((xml.message[currentMessage].@y)!=undefined) ? xml.message[currentMessage].@y : 0));
pointer.x = _local2.x;
pointer.y = _local2.y;
pointer.rotation = ((xml.message[currentMessage].@rotation)!=undefined) ? xml.message[currentMessage].@rotation : 0;
addChild(pointer);
};
}
public function startDialogue(_arg1:XML):void{
visible = true;
this.xml = _arg1;
currentMessage = -1;
nextMessage();
}
}
}//package
Section 54
//empty (empty)
package {
import flash.display.*;
public dynamic class empty extends BitmapData {
public function empty(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 55
//EndGamePageGfx (EndGamePageGfx)
package {
import flash.display.*;
public dynamic class EndGamePageGfx extends BitmapData {
public function EndGamePageGfx(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 56
//Game (Game)
package {
import flash.events.*;
import caurina.transitions.*;
import com.onlinegamestars.ender.xmlui.*;
import flash.display.*;
import flash.filters.*;
import flash.geom.*;
import components.*;
import com.onlinegamestars.ender.*;
import flash.ui.*;
public class Game extends Sprite {
private var btnSndON:Button;
private var messagePane:Dialogue;
private var magicButtons:Array;
private var _lives:int;
private var path:Array;
private var _mana:int;
private var Overlay:Class;
private var bPaused:Boolean;// = false
private var towerButtons:Array;
private var upgradeTooltip:TowerTooltip;
private var _currentWave:int;// = -1
private var startPoint:Point;
private var gold:uint;// = 0
private var levelSelection:LevelSelectionPage;
private var txtLives:Text;
private var level:int;
private var txtWave:Text;
private var score:int;// = 0
private var waves:Array;
private var objectsLayer:Sprite;
private var restrictor:BitmapData;
private var pauseGfx:MovieClip;
private var endGamePage:EndGamePage;
public var difficulty:int;// = 2
private var magicButtonTooltip:MagicTooltip;
private var btnSndOFF:Button;
public var btnMenu:Button;
private var txtMana:Text;
private var overlayLayer:Sprite;
private var towerButtonTooltip:TowerButtonTooltip;
private var txtGold:Text;
private var GUILayer:Sprite;
private var btnPause:Button;
public function Game():void{
overlayLayer = new Sprite();
objectsLayer = new Sprite();
GUILayer = new Sprite();
towerButtons = [];
magicButtons = [];
waves = [];
super();
if (stage){
init();
} else {
addEventListener(Event.ADDED_TO_STAGE, init);
};
}
private function get lives():int{
return (_lives);
}
private function closeGame(_arg1:MouseEvent=null):void{
Tweener.removeAllTweens();
stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, Keyboard.ESCAPE));
while (objectsLayer.numChildren > 0) {
objectsLayer.removeChildAt(0);
};
while (overlayLayer.numChildren > 0) {
overlayLayer.removeChildAt(0);
};
pauseGame();
endGamePage.total = 0;
levelSelection.show(level);
}
private function set lives(_arg1:int):void{
_lives = Math.max(0, _arg1);
txtLives.text = _lives.toString();
}
private function get currentWave():int{
return (_currentWave);
}
private function init(_arg1:Event=null):void{
var _local3:XML;
var _local4:XML;
var _local5:int;
removeEventListener(Event.ADDED_TO_STAGE, init);
levelSelection = new LevelSelectionPage(loadLevel);
addChild(overlayLayer);
addChild(objectsLayer);
addChild(GUILayer);
var _local2:XML = Resources.config;
for each (_local3 in _local2.towers.tower) {
Resources.getInstance()[("params" + _local3.@id)].cost = int(_local3.@cost);
Resources.getInstance()[("params" + _local3.@id)].upgradesCost = _local3.@upgradesCost.split(";");
Resources.getInstance()[("params" + _local3.@id)].range = _local3.@range.split(";");
Resources.getInstance()[("params" + _local3.@id)].damage = _local3.@damage.split(";");
Resources.getInstance()[("params" + _local3.@id)].delay = _local3.@delay.split(";");
};
for each (_local4 in _local2.magics.magic) {
Resources.getInstance()[("params" + _local4.@id)].mana = int(_local4.@mana);
Resources.getInstance()[("params" + _local4.@id)].range = int(_local4.@range);
Resources.getInstance()[("params" + _local4.@id)].damage = int(_local4.@damage);
};
addEventListener(Event.ENTER_FRAME, onUpdate);
GUILayer.addChild(new menuBack());
_local5 = 0;
while (_local5 < 4) {
towerButtons.push(XMLUI.newButton(("btn_tower" + _local5.toString())));
GUILayer.addChild(towerButtons[_local5]).addEventListener(MouseEvent.CLICK, onAddTower);
towerButtons[_local5].addEventListener(MouseEvent.ROLL_OVER, onOverTowerButton);
towerButtons[_local5].addEventListener(MouseEvent.ROLL_OUT, onOutTowerButton);
magicButtons.push(new (Resources.getInstance()[("btnMagic" + _local5.toString())]));
magicButtons[_local5].mouseChildren = false;
GUILayer.addChild(magicButtons[_local5]).addEventListener(MouseEvent.CLICK, onClickMagic);
magicButtons[_local5].x = Resources.getInstance()[("paramsMagic" + _local5.toString())].x;
magicButtons[_local5].y = Resources.getInstance()[("paramsMagic" + _local5.toString())].y;
magicButtons[_local5].addEventListener(MouseEvent.ROLL_OVER, onOverMagicButton);
magicButtons[_local5].addEventListener(MouseEvent.ROLL_OUT, onOutMagicButton);
_local5++;
};
var _local6:Array = [new GlowFilter(16436877, 1, 3, 3, 3), new GlowFilter(7753239, 0.9, 6, 6, 2)];
btnMenu = (GUILayer.addChild(XMLUI.newButton("btn_menu")) as Button);
btnMenu.filtersOver = _local6;
btnMenu.addEventListener(MouseEvent.CLICK, closeGame);
btnSndON = (GUILayer.addChild(XMLUI.newButton("btn_sndON")) as Button);
btnSndON.filtersOver = _local6;
btnSndON.addEventListener(MouseEvent.CLICK, changeMute);
btnSndOFF = (GUILayer.addChild(XMLUI.newButton("btn_sndOFF")) as Button);
btnSndOFF.filtersOver = _local6;
btnSndOFF.addEventListener(MouseEvent.CLICK, changeMute);
btnPause = (GUILayer.addChild(XMLUI.newButton("btn_pause")) as Button);
btnPause.filtersOver = _local6;
btnPause.addEventListener(MouseEvent.CLICK, onPauseClicked);
pauseGfx = new PauseGfx();
pauseGfx.mouseChildren = false;
pauseGfx.addChild(XMLUI.newText("txt_paused"));
pauseGfx.addEventListener(MouseEvent.CLICK, onUnPauseClicked);
txtGold = XMLUI.newText("txt_gold");
GUILayer.addChild(txtGold);
txtMana = XMLUI.newText("txt_mana");
GUILayer.addChild(txtMana);
txtWave = XMLUI.newText("txt_timer");
GUILayer.addChild(txtWave);
txtLives = XMLUI.newText("txt_lives");
GUILayer.addChild(txtLives);
upgradeTooltip = new TowerTooltip();
upgradeTooltip.hide();
GUILayer.addChild(upgradeTooltip);
towerButtonTooltip = new TowerButtonTooltip();
towerButtonTooltip.hide();
GUILayer.addChild(towerButtonTooltip);
magicButtonTooltip = new MagicTooltip();
magicButtonTooltip.hide();
GUILayer.addChild(magicButtonTooltip);
messagePane = (GUILayer.addChild(new Dialogue()) as Dialogue);
messagePane.addEventListener("COMPLETE", onDialogueFinished);
endGamePage = new EndGamePage();
GUILayer.addChild(endGamePage);
endGamePage.addEventListener(MouseEvent.CLICK, nextRound);
addChild(levelSelection);
}
private function pauseGame():void{
Tweener.pauseAllTweens();
Tower.bPaused = true;
bPaused = true;
}
private function set currentWave(_arg1:int):void{
_currentWave = _arg1;
txtWave.text = (((_currentWave + 1).toString() + "/") + waves.length.toString());
}
private function onOutTowerButton(_arg1:MouseEvent):void{
towerButtonTooltip.hide();
}
public function modifyGold(_arg1:int):uint{
gold = Math.max((gold + _arg1), 0);
var _local2:int;
while (_local2 < towerButtons.length) {
if (Resources.getInstance()[("paramsTower" + _local2.toString())].cost > gold){
towerButtons[_local2].filtersOver = [getGrayscaleFilter(0)];
towerButtons[_local2].filtersOut = [getGrayscaleFilter(0)];
towerButtons[_local2].filters = [getGrayscaleFilter(0)];
} else {
if ((((_arg1 > 0)) && (!((towerButtons[_local2].filtersOut == null))))){
MusicLibrary.playSound(MusicLibrary.TowerAvailable, 0.5);
};
towerButtons[_local2].filtersOver = null;
towerButtons[_local2].filtersOut = null;
towerButtons[_local2].filters = null;
};
_local2++;
};
txtGold.text = (gold.toString() + "●");
towerButtonTooltip.update(gold);
if (upgradeTooltip.visible == true){
upgradeTooltip.show(null, gold, true);
};
return (gold);
}
private function onClickMagic(_arg1:MouseEvent):void{
_arg1.stopPropagation();
if (Resources.getInstance()[("paramsMagic" + magicButtons.indexOf(_arg1.target).toString())].mana > mana){
return;
};
overlayLayer.addChild(new MagicPlacer(("paramsMagic" + magicButtons.indexOf(_arg1.target).toString()), objectsLayer)).addEventListener("COMPLETE", onMagicUsed);
}
private function loadLevel(_arg1:int=0):void{
var _local3:XML;
var _local4:XML;
var _local5:int;
var _local6:XML;
var _local7:XML;
var _local8:MovieClip;
var _local9:Object;
MusicLibrary.startBackMusic(MusicLibrary.GameBack);
btnSndON.visible = MusicLibrary.isMute;
btnSndOFF.visible = !(MusicLibrary.isMute);
Soldier.soldiers = [];
var _local2:XML = Resources.config;
Tweener.removeAllTweens();
while (objectsLayer.numChildren > 0) {
objectsLayer.removeChildAt(0);
};
while (overlayLayer.numChildren > 0) {
overlayLayer.removeChildAt(0);
};
gold = 0;
lives = 10;
level = _arg1;
trace("level", level);
mana = 0;
score = 0;
if (level >= _local2.levels.level.length()){
return;
};
path = [];
startPoint = new Point(_local2.levels.level[_arg1].path.@x, _local2.levels.level[_arg1].path.@y);
gold = _local2.levels.level[_arg1].@gold.split(";")[difficulty];
modifyGold(0);
if (_local2.levels.level[_arg1].@lives != undefined){
lives = _local2.levels.level[_arg1].@lives.split(";")[difficulty];
};
if (_local2.levels.level[_arg1].@mana != undefined){
mana = _local2.levels.level[_arg1].@mana.split(";")[difficulty];
};
Overlay = Resources.getInstance()[_local2.levels.level[_arg1].@overlay];
if (Overlay == null){
Overlay = empty;
};
overlayLayer.addChild(new background());
(overlayLayer.getChildAt(0) as MovieClip).gotoAndStop(_local2.levels.level[_arg1].@background);
overlayLayer.addChild(new Bitmap(new Overlay(755, 576)));
for each (_local3 in _local2.levels.level[_arg1].path.step) {
path.push([_local3.@direction.toString(), Number(_local3.@distance.valueOf())]);
};
for each (_local4 in _local2.levels.level[_arg1].objects.object) {
_local8 = new mcObjects();
_local8.gotoAndStop(_local4.@type);
_local8.x = _local4.@x;
_local8.y = _local4.@y;
objectsLayer.addChild(_local8);
};
waves = [];
_local5 = 0;
for each (_local6 in _local2.levels.level[_arg1].waves.wave) {
_local9 = {current:-1, n:_local5, last:-1};
waves.push({start:_local6.@start, delay:_local6.@delay, creeps:_local6.@creeps.split(";"), obj:_local9});
Tweener.addTween(_local9, {current:(waves[_local5].creeps.length - 1), delay:waves[_local5].start, time:(waves[_local5].delay * waves[_local5].creeps.length), onUpdate:addSoldier, onUpdateParams:[_local9], transition:"linear"});
_local5++;
};
for each (_local7 in _local2.levels.level[_arg1].dialogues.dialogue) {
Tweener.addTween({}, {delay:_local7.@delay, time:0, onComplete:startDialog, onCompleteParams:[_local7]});
};
currentWave = -1;
updateRestrictor();
unPauseGame();
}
private function get mana():int{
return (_mana);
}
private function onOverTowerButton(_arg1:MouseEvent):void{
towerButtonTooltip.x = 40;
towerButtonTooltip.y = (_arg1.target.y - 5);
towerButtonTooltip.show(Resources.getInstance()[("paramsTower" + towerButtons.indexOf(_arg1.target).toString())], gold);
}
private function onUnPauseClicked(_arg1:MouseEvent):void{
removeChild(pauseGfx);
unPauseGame();
if (btnSndOFF.visible){
MusicLibrary.changeMute();
};
}
private function updateRestrictor():void{
var _local2:DisplayObject;
var _local1:Shape = new Shape();
restrictor = new Overlay(755, 576);
_local1.graphics.clear();
_local1.graphics.lineStyle(1);
_local1.graphics.beginFill(0);
var _local3:int;
while (_local3 < objectsLayer.numChildren) {
_local2 = objectsLayer.getChildAt(_local3);
if ((_local2 is Tower)){
_local1.graphics.drawEllipse((_local2.x - ((_local2.width + 10) / 2)), (_local2.y - ((_local2.width + 10) / 4)), (_local2.width + 10), ((_local2.width + 10) / 2));
} else {
if ((_local2 is Soldier)){
} else {
_local1.graphics.drawCircle(_local2.x, _local2.y, 20);
};
};
_local3++;
};
restrictor.draw(_local1);
}
private function startDialog(_arg1:XML):void{
pauseGame();
stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, Keyboard.ESCAPE));
messagePane.startDialogue(_arg1);
}
private function onTowerUpgraded(_arg1:Event):void{
modifyGold(-(Resources.getInstance()[("params" + _arg1.target.type)].upgradesCost[(_arg1.target.level - 1)]));
updateRestrictor();
}
private function onTowerPlaced(_arg1:Event):void{
_arg1.target.addEventListener(MouseEvent.CLICK, onTowerClicked);
_arg1.target.addEventListener("UPGRADED", onTowerUpgraded);
_arg1.target.addEventListener("SOLD", onTowerSold);
modifyGold(-(Resources.getInstance()[("params" + _arg1.target.type)].cost));
updateRestrictor();
}
private function nextRound(_arg1:MouseEvent=null):void{
unPauseGame();
levelSelection.show((level + ((lives)>0) ? 1 : 0));
}
private function onTowerClicked(_arg1:MouseEvent):void{
upgradeTooltip.hide();
upgradeTooltip.show((_arg1.target as Tower), gold);
}
private function onTowerSold(_arg1:Event):void{
modifyGold(_arg1.target.sellCost);
_arg1.target.removeEventListener(MouseEvent.CLICK, onTowerClicked);
_arg1.target.removeEventListener("UPGRADED", onTowerUpgraded);
_arg1.target.removeEventListener("SOLD", onTowerSold);
objectsLayer.removeChild((_arg1.target as Tower));
updateRestrictor();
}
private function onDialogueFinished(_arg1:Event):void{
unPauseGame();
}
private function unPauseGame():void{
Tower.bPaused = false;
Tweener.resumeAllTweens();
bPaused = false;
}
private function showEndLevel():void{
pauseGame();
endGamePage.show(lives, gold, mana, (score / 10), (level >= (Resources.config.levels.level.length() - 1)), difficulty);
}
private function onUpdate(_arg1:Event):void{
if (bPaused){
return;
};
var _local2:Array = [];
var _local3:int;
while (_local3 < objectsLayer.numChildren) {
_local2.push(objectsLayer.getChildAt(_local3));
_local3++;
};
_local2.sortOn("y", Array.NUMERIC);
_local3 = _local2.length;
while (_local3--) {
if (objectsLayer.getChildIndex(_local2[_local3]) != _local3){
objectsLayer.setChildIndex(_local2[_local3], _local3);
};
};
}
private function set mana(_arg1:int):void{
_mana = Math.max(0, _arg1);
txtMana.text = (_mana.toString() + "♦");
magicButtonTooltip.update(_mana);
var _local2:int;
while (_local2 < 4) {
magicButtons[_local2].liquid.scaleY = Math.min(1, (_mana / Resources.getInstance()[("paramsMagic" + _local2.toString())].mana));
if (_mana < Resources.getInstance()[("paramsMagic" + _local2.toString())].mana){
magicButtons[_local2].back.filters = [getGrayscaleFilter()];
} else {
magicButtons[_local2].back.filters = null;
};
_local2++;
};
}
private function addSoldier(_arg1:Object):void{
var wave:Object;
var type:String;
var params:XML;
var soldier:Soldier;
var i:int;
var obj = _arg1;
if (Math.floor(obj.current) != obj.last){
obj.last = Math.floor(obj.current);
if (obj.last == 0){
currentWave++;
};
wave = waves[obj.n];
type = wave.creeps[obj.last];
params = Resources.config.soldiers.soldier.(@id == ("Soldier" + type))[0];
soldier = new Soldier(("Soldier" + type), params.@health.split(";")[difficulty], params.@speed.split(";")[difficulty], params.@gold.split(";")[difficulty], params.@mana.split(";")[difficulty], params.@damage.split(";")[difficulty]);
soldier.x = (startPoint.x + ((Math.random() * 13) - 6));
soldier.y = (startPoint.y + ((Math.random() * 13) - 6));
i = 0;
while (i < path.length) {
soldier.plan(path[i][0], path[i][1]);
i = (i + 1);
};
soldier.addEventListener("DEAD", onSoldierDead);
soldier.addEventListener("COMPLETE", looseLife);
objectsLayer.addChild(soldier);
soldier.start();
};
}
public function onSoldierDead(_arg1:Event):void{
var _local2:MovieClip;
if (_arg1.target.type == "Soldier4"){
_local2 = new mcShipSmall_Wreck();
} else {
if (_arg1.target.type == "Soldier5"){
_local2 = new mcShipBig_Wreck();
} else {
_local2 = new mcBlood();
};
};
score = (score + _arg1.target.maxHealth);
_local2.x = _arg1.target.x;
_local2.y = _arg1.target.y;
_arg1.target.removeEventListener("DEAD", onSoldierDead);
_arg1.target.removeEventListener("COMPLETE", looseLife);
objectsLayer.removeChild((_arg1.target as Soldier));
overlayLayer.addChild(_local2);
modifyGold(_arg1.target.gold);
mana = (mana + _arg1.target.mana);
checkLevelEnd();
}
private function looseLife(_arg1:Event):void{
objectsLayer.removeChild((_arg1.target as Soldier));
_arg1.target.removeEventListener("COMPLETE", looseLife);
_arg1.target.removeEventListener("DEAD", onSoldierDead);
_arg1.target.remove();
lives = (lives - _arg1.target._damage);
trace((("LOST " + _arg1.target._damage.toString()) + " LIFE!!!!"));
checkLevelEnd();
}
private function onOutMagicButton(_arg1:MouseEvent):void{
magicButtonTooltip.hide();
}
private function checkLevelEnd():void{
if ((((lives <= 0)) || ((((((currentWave >= (waves.length - 1))) && ((Soldier.soldiers.length == 0)))) && (!(Tweener.isTweening(waves[currentWave].obj))))))){
Tweener.addTween({}, {delay:3, onComplete:showEndLevel});
};
}
private function onAddTower(_arg1:MouseEvent):void{
_arg1.stopPropagation();
var _local2:String = towerButtons.indexOf((_arg1.target as Button)).toString();
if (Resources.getInstance()[("paramsTower" + _local2)].cost > gold){
return;
};
var _local3:Tower = new Tower(("Tower" + _local2), overlayLayer);
objectsLayer.addChild(new TowerPlacer(_local3, objectsLayer, restrictor));
_local3.addEventListener("PLACED", onTowerPlaced);
}
private function changeMute(_arg1:MouseEvent):void{
MusicLibrary.changeMute();
btnSndON.visible = MusicLibrary.isMute;
btnSndOFF.visible = !(MusicLibrary.isMute);
}
private function onMagicUsed(_arg1:Event):void{
trace("magic cost:", _arg1.target.cost);
_arg1.target.removeEventListener("COMPLETE", onMagicUsed);
mana = (mana - _arg1.target.cost);
}
private function onPauseClicked(_arg1:MouseEvent):void{
addChild(pauseGfx);
pauseGame();
if (btnSndOFF.visible){
MusicLibrary.changeMute();
};
}
private function onOverMagicButton(_arg1:MouseEvent):void{
magicButtonTooltip.x = 535;
magicButtonTooltip.y = (_arg1.target.y - 5);
magicButtonTooltip.show(Resources.getInstance()[("paramsMagic" + magicButtons.indexOf(_arg1.target).toString())], mana);
}
}
}//package
Section 57
//healthBar (healthBar)
package {
import flash.display.*;
public dynamic class healthBar extends MovieClip {
}
}//package
Section 58
//KongregateAPI (KongregateAPI)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.system.*;
public class KongregateAPI extends Sprite {
public static var api;
private static var instance:KongregateAPI = null;
public function KongregateAPI(){
addEventListener(Event.ADDED_TO_STAGE, loadAPI);
}
public function loadAPI(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, loadAPI);
var _local2:Object = LoaderInfo(root.loaderInfo).parameters;
var _local3:String = ((_local2.kongregate_api_path) || ("http://www.kongregate.com/flash/API_AS3_Local.swf"));
Security.allowDomain(_local3);
var _local4:URLRequest = new URLRequest(_local3);
var _local5:Loader = new Loader();
_local5.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
_local5.load(_local4);
this.addChild(_local5);
}
private function loadComplete(_arg1:Event):void{
api = _arg1.target.content;
api.services.connect();
}
}
}//package
Section 59
//level_10_overlay (level_10_overlay)
package {
import flash.display.*;
public dynamic class level_10_overlay extends BitmapData {
public function level_10_overlay(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 60
//level1_overlay (level1_overlay)
package {
import flash.display.*;
public dynamic class level1_overlay extends BitmapData {
public function level1_overlay(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 61
//level2_overlay (level2_overlay)
package {
import flash.display.*;
public dynamic class level2_overlay extends BitmapData {
public function level2_overlay(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 62
//level3_overlay (level3_overlay)
package {
import flash.display.*;
public dynamic class level3_overlay extends BitmapData {
public function level3_overlay(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 63
//level4_overlay (level4_overlay)
package {
import flash.display.*;
public dynamic class level4_overlay extends BitmapData {
public function level4_overlay(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 64
//level5_overlay (level5_overlay)
package {
import flash.display.*;
public dynamic class level5_overlay extends BitmapData {
public function level5_overlay(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 65
//level6_overlay (level6_overlay)
package {
import flash.display.*;
public dynamic class level6_overlay extends BitmapData {
public function level6_overlay(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 66
//level7_overlay (level7_overlay)
package {
import flash.display.*;
public dynamic class level7_overlay extends BitmapData {
public function level7_overlay(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 67
//level8_overlay (level8_overlay)
package {
import flash.display.*;
public dynamic class level8_overlay extends BitmapData {
public function level8_overlay(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 68
//level9_overlay (level9_overlay)
package {
import flash.display.*;
public dynamic class level9_overlay extends BitmapData {
public function level9_overlay(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 69
//magic_arrow (magic_arrow)
package {
import flash.display.*;
public dynamic class magic_arrow extends MovieClip {
}
}//package
Section 70
//MagicPlacer (MagicPlacer)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.ui.*;
public class MagicPlacer extends Sprite {
private var type:String;
private var container:DisplayObjectContainer;
private var _parent:DisplayObjectContainer;
public var cost:uint;
private var damage:Number;
private var effect:MovieClip;
private var marker:Sprite;
private var range:Number;
private var _stage:DisplayObjectContainer;
public static var previous:MagicPlacer;
public function MagicPlacer(_arg1:String, _arg2:DisplayObjectContainer){
this.type = _arg1;
if (previous != null){
trace("cancelling...");
previous.cancel();
};
if (TowerPlacer.previous != null){
TowerPlacer.previous.cancel();
};
previous = this;
container = _arg2;
range = Resources.getInstance()[_arg1].range;
damage = Resources.getInstance()[_arg1].damage;
cost = Resources.getInstance()[_arg1].mana;
marker = new Sprite();
marker.graphics.beginFill(16428685, 0.3);
marker.graphics.lineStyle(1, 16428685);
marker.graphics.drawCircle(0, 0, Resources.getInstance()[_arg1].range);
addChild(marker);
marker.startDrag(true);
if (_stage){
init();
} else {
addEventListener(Event.ADDED_TO_STAGE, init);
};
}
public function cancel(_arg1:KeyboardEvent=null):void{
if (((!((_arg1 == null))) && (!((_arg1.charCode == Keyboard.ESCAPE))))){
return;
};
clear();
cost = 0;
dispatchEvent(new Event("COMPLETE"));
}
private function clear():void{
previous = null;
if (parent == null){
_parent = null;
};
if (_stage != null){
_stage.removeEventListener(MouseEvent.CLICK, onClicked);
_stage.removeEventListener(KeyboardEvent.KEY_DOWN, cancel);
};
if (_parent != null){
_parent.removeChild(this);
};
_stage = null;
removeEventListener(Event.REMOVED_FROM_STAGE, onRemoved);
}
private function init(_arg1:Event=null):void{
_stage = stage;
_parent = parent;
removeEventListener(Event.ADDED_TO_STAGE, init);
addEventListener(Event.REMOVED_FROM_STAGE, onRemoved);
_stage.addEventListener(MouseEvent.CLICK, onClicked);
_stage.addEventListener(KeyboardEvent.KEY_DOWN, cancel);
}
private function onClicked(_arg1:MouseEvent):void{
MusicLibrary.playSound(MusicLibrary.Magic);
effect = new (Resources.getInstance()[type].effect);
effect.addEventListener("COMPLETE", onComplete);
effect.x = _arg1.stageX;
effect.y = _arg1.stageY;
container.addChild(effect);
dispatchEvent(new Event("COMPLETE"));
clear();
}
private function onComplete(_arg1:Event):void{
var _local2:Soldier;
var _local3:Number;
var _local4:Point = new Point(effect.x, effect.y);
var _local5:Boolean;
var _local6:Array = [];
effect.removeEventListener("COMPLETE", onComplete);
var _local7:int;
while (_local7 < Soldier.soldiers.length) {
_local2 = Soldier.soldiers[_local7];
_local3 = Point.distance(_local4, new Point(_local2.x, _local2.y));
if (_local3 <= range){
_local6.push(_local2);
};
_local7++;
};
_local7 = 0;
while (_local7 < _local6.length) {
_local6[_local7].damage(damage);
_local7++;
};
if (_local6.length > 0){
effect.gotoAndPlay("blood");
} else {
effect.gotoAndPlay("miss");
};
}
private function onRemoved(_arg1:Event):void{
_parent = null;
cancel();
}
}
}//package
Section 71
//MagicTooltip (MagicTooltip)
package {
import com.onlinegamestars.ender.xmlui.*;
import flash.display.*;
public class MagicTooltip extends Sprite {
private var txtSell:Text;
public var delay:Number;// = 0.4
private var txtRange:Text;
public var damage:Number;// = 15
private var manacost:uint;// = 0
public var range:Number;// = 110
private var txtDamage:Text;
public function MagicTooltip(){
(addChild(new mcMagicTooltip()) as MovieClip).mouseEnabled = false;
(addChildAt(XMLUI.newText("txt_tooltip_label"), 1) as Text).mouseEnabled = false;
txtDamage = (addChild(XMLUI.newText("txt_tooltip_damage")) as Text);
txtRange = (addChild(XMLUI.newText("txt_tooltip_delay")) as Text);
txtSell = (addChild(XMLUI.newText("txt_tooltip_upgrade")) as Text);
mouseChildren = false;
}
public function update(_arg1:uint):void{
if (manacost > _arg1){
txtSell.setColor(XMLUI.getData("fmt_gold_red").color);
} else {
txtSell.setColor(XMLUI.getData("fmt_mana").color);
};
}
public function show(_arg1:Object, _arg2:uint):void{
(getChildAt(1) as Text).text = XMLUI.getString(_arg1.nameID);
visible = true;
txtDamage.text = _arg1.damage.toString();
txtRange.text = _arg1.range.toString();
txtSell.text = (_arg1.mana.toString() + "♦");
manacost = _arg1.mana;
update(_arg2);
}
public function hide():void{
visible = false;
}
}
}//package
Section 72
//Main (Main)
package {
import flash.events.*;
import caurina.transitions.*;
import com.onlinegamestars.ender.xmlui.*;
import flash.display.*;
import flash.filters.*;
import com.greenish.onlinegames.*;
import mochi.as3.*;
public class Main extends MainClass {
private var btnPlayHard:Button;
private var langBar:LangBar;
private var btnMusicOFF:Button;
private var btnMusicON:Button;
private var submenuOpen:Boolean;// = false
private var btnLeaders:Button;
private var btnPlayEasy:Button;
private var btnLeadersNormal:Button;
private var btnLeadersHard:Button;
public var menu:Sprite;
private var intro:MovieClip;
private var btnPlay:Button;
private var leadersOpen:Boolean;// = false
private var txtTutorial:Text;
private var btnPlayNormal:Button;
private var game:Game;
private var btnRules:Button;
private var btnLeadersEasy:Button;
private static var rules:MovieClip;
public static var btnClose:Button;
public static var bHelpShowed:Boolean = false;
public function Main(){
menu = new Sprite();
super();
}
public function onPlayClicked(_arg1:MouseEvent):void{
var _local2:Number = 0.8;
submenuOpen = !(submenuOpen);
leadersOpen = false;
if (submenuOpen){
Tweener.addTween(btnPlayEasy, {y:275, alpha:1, time:_local2});
Tweener.addTween(btnPlayNormal, {y:310, alpha:1, time:_local2});
Tweener.addTween(btnPlayHard, {y:345, alpha:1, time:_local2});
Tweener.addTween(btnRules, {y:385, time:_local2});
Tweener.addTween(btnMusicON, {y:435, time:_local2});
Tweener.addTween(btnMusicOFF, {y:435, time:_local2});
Tweener.addTween(btnLeaders, {y:485, time:_local2});
Tweener.addTween(btnLeadersEasy, {y:485, alpha:0, time:_local2});
Tweener.addTween(btnLeadersNormal, {y:485, alpha:0, time:_local2});
Tweener.addTween(btnLeadersHard, {y:485, alpha:0, time:_local2});
} else {
Tweener.addTween(btnPlayEasy, {y:230, alpha:0, time:_local2});
Tweener.addTween(btnPlayNormal, {y:230, alpha:0, time:_local2});
Tweener.addTween(btnPlayHard, {y:230, alpha:0, time:_local2});
Tweener.addTween(btnRules, {y:280, time:_local2});
Tweener.addTween(btnMusicON, {y:330, time:_local2});
Tweener.addTween(btnMusicOFF, {y:330, time:_local2});
Tweener.addTween(btnLeaders, {y:380, time:_local2});
Tweener.addTween(btnLeadersEasy, {y:380, alpha:0, time:_local2});
Tweener.addTween(btnLeadersNormal, {y:380, alpha:0, time:_local2});
Tweener.addTween(btnLeadersHard, {y:380, alpha:0, time:_local2});
};
}
private function menuPlayed(_arg1:Event):void{
menu.visible = true;
game.visible = false;
addChild(game);
game.btnMenu.addEventListener(MouseEvent.CLICK, returnToMenu);
rules = new RulesGFX();
rules.x = (755 / 2);
rules.y = (576 / 2);
rules.visible = false;
rules.addChild(btnClose).addEventListener(MouseEvent.CLICK, onRulesClicked);
rules.addChild(txtTutorial);
addChild(rules);
}
public function returnToMenu(_arg1:MouseEvent):void{
game.visible = false;
btnMusicON.visible = MusicLibrary.isMute;
btnMusicOFF.visible = !(MusicLibrary.isMute);
}
private function onDifficultyChoosed(_arg1:MouseEvent):void{
switch (_arg1.target){
case btnPlayEasy:
game.difficulty = 0;
break;
case btnPlayNormal:
game.difficulty = 1;
break;
case btnPlayHard:
game.difficulty = 2;
break;
};
startGame();
}
private function waitConnected(_arg1:Event):void{
if (MochiServices.connected){
removeEventListener(Event.ENTER_FRAME, waitConnected);
menu.addChildAt(btnLeadersHard, 0).addEventListener(MouseEvent.CLICK, onDifficultyLeaders);
menu.addChildAt(btnLeadersNormal, 0).addEventListener(MouseEvent.CLICK, onDifficultyLeaders);
menu.addChildAt(btnLeadersEasy, 0).addEventListener(MouseEvent.CLICK, onDifficultyLeaders);
menu.addChild(btnLeaders).addEventListener(MouseEvent.CLICK, onLeadersClicked);
btnLeadersEasy.alpha = 0;
btnLeadersNormal.alpha = 0;
btnLeadersHard.alpha = 0;
btnLeadersEasy.y = 380;
btnLeadersNormal.y = 380;
btnLeadersHard.y = 380;
};
}
override public function startGame():void{
intro = new mcIntro();
addChild(intro);
intro.gotoAndPlay(1);
intro.addEventListener("COMPLETE", onIntroComplete);
MusicLibrary.startBackMusic(MusicLibrary.Drums);
game.visible = true;
}
private function onDifficultyLeaders(_arg1:MouseEvent):void{
var o:Object;
var boardID:String;
var e = _arg1;
switch (e.target){
case btnLeadersEasy:
o = {n:[7, 14, 8, 14, 15, 12, 14, 6, 5, 13, 3, 6, 5, 9, 2, 14], 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});
break;
case btnLeadersNormal:
o = {n:[2, 15, 7, 7, 13, 3, 15, 5, 11, 14, 10, 9, 10, 2, 6, 5], 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});
break;
case btnLeadersHard:
o = {n:[7, 8, 0, 5, 14, 8, 3, 5, 10, 13, 15, 5, 1, 11, 14, 13], 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});
break;
};
}
private function onConfigLoaded(_arg1:Event=null):void{
var _local2:Array = [new GlowFilter(0xFFFFFF, 1, 7, 7, 3), new GlowFilter(7753239, 0.9, 9, 9, 2)];
btnPlay = XMLUI.newButton("btn_play");
btnPlay.filtersOver = _local2;
btnPlayEasy = XMLUI.newButton("btn_play_easy");
btnPlayEasy.filtersOver = _local2;
btnPlayNormal = XMLUI.newButton("btn_play_normal");
btnPlayNormal.filtersOver = _local2;
btnPlayHard = XMLUI.newButton("btn_play_hard");
btnPlayHard.filtersOver = _local2;
btnLeaders = XMLUI.newButton("btn_leaders");
btnLeaders.filtersOver = _local2;
btnLeadersEasy = XMLUI.newButton("btn_play_easy");
btnLeadersEasy.filtersOver = _local2;
btnLeadersNormal = XMLUI.newButton("btn_play_normal");
btnLeadersNormal.filtersOver = _local2;
btnLeadersHard = XMLUI.newButton("btn_play_hard");
btnLeadersHard.filtersOver = _local2;
btnRules = XMLUI.newButton("btn_rules");
btnRules.filtersOver = _local2;
btnClose = XMLUI.newButton("btn_rules_close");
btnClose.filtersOver = _local2;
txtTutorial = XMLUI.newText("txt_rules_header");
btnMusicON = XMLUI.newButton("btn_musicON");
btnMusicON.filtersOver = _local2;
btnMusicOFF = XMLUI.newButton("btn_musicOFF");
btnMusicOFF.filtersOver = _local2;
menu = new Sprite();
var _local3:MovieClip = new MainMenuBack();
_local3.x = (755 / 2);
_local3.y = (576 / 2);
addChild(_local3);
_local3.addEventListener("COMPLETE", menuPlayed);
btnPlayEasy.alpha = 0;
btnPlayNormal.alpha = 0;
btnPlayHard.alpha = 0;
langBar = new LangBar(Resources.langs);
langBar.y = (langBar.y + 75);
menu.addChild(langBar);
menu.addChild(btnPlayHard).addEventListener(MouseEvent.CLICK, onDifficultyChoosed);
menu.addChild(btnPlayNormal).addEventListener(MouseEvent.CLICK, onDifficultyChoosed);
menu.addChild(btnPlayEasy).addEventListener(MouseEvent.CLICK, onDifficultyChoosed);
menu.addChild(btnPlay).addEventListener(MouseEvent.CLICK, onPlayClicked);
menu.addChild(btnRules).addEventListener(MouseEvent.CLICK, onRulesClicked);
menu.addChild(btnMusicON).addEventListener(MouseEvent.CLICK, changeMute);
menu.addChild(btnMusicOFF).addEventListener(MouseEvent.CLICK, changeMute);
btnMusicON.visible = false;
menu.y = -75;
addChild(menu);
menu.visible = false;
MusicLibrary.startBackMusic(MusicLibrary.MenuBack);
}
private function changeMute(_arg1:MouseEvent):void{
MusicLibrary.changeMute();
btnMusicON.visible = MusicLibrary.isMute;
btnMusicOFF.visible = !(MusicLibrary.isMute);
}
private function onIntroComplete(_arg1:Event):void{
intro.removeEventListener("COMPLETE", onIntroComplete);
MusicLibrary.startBackMusic(MusicLibrary.MenuBack);
}
private function onButtonClicked(_arg1:MouseEvent):void{
if ((_arg1.target is Button)){
MusicLibrary.playSound(MusicLibrary.Click);
};
}
override public function showRules():void{
XMLUI.xml = Resources.getInstance().xmlENG;
XMLUI.Resources = Resources.getInstance();
XMLUI.preserveCoordinates = true;
var _local1:String = stage.loaderInfo.loaderURL;
game = new Game();
stage.addEventListener(MouseEvent.CLICK, onButtonClicked);
if (Preloader.isMustMochi){
MochiServices.connect(Preloader.mochiId, this);
addEventListener(Event.ENTER_FRAME, waitConnected);
};
onConfigLoaded();
}
public function onLeadersClicked(_arg1:MouseEvent):void{
var _local2:Number = 0.8;
submenuOpen = false;
leadersOpen = !(leadersOpen);
Tweener.addTween(btnPlayEasy, {y:230, alpha:0, time:_local2});
Tweener.addTween(btnPlayNormal, {y:230, alpha:0, time:_local2});
Tweener.addTween(btnPlayHard, {y:230, alpha:0, time:_local2});
Tweener.addTween(btnRules, {y:280, time:_local2});
Tweener.addTween(btnMusicON, {y:330, time:_local2});
Tweener.addTween(btnMusicOFF, {y:330, time:_local2});
Tweener.addTween(btnLeaders, {y:380, time:_local2});
if (leadersOpen){
Tweener.addTween(btnLeadersEasy, {y:415, alpha:1, time:_local2});
Tweener.addTween(btnLeadersNormal, {y:450, alpha:1, time:_local2});
Tweener.addTween(btnLeadersHard, {y:485, alpha:1, time:_local2});
} else {
Tweener.addTween(btnLeadersEasy, {y:380, alpha:0, time:_local2});
Tweener.addTween(btnLeadersNormal, {y:380, alpha:0, time:_local2});
Tweener.addTween(btnLeadersHard, {y:380, alpha:0, time:_local2});
};
}
public static function onRulesClicked(_arg1:MouseEvent=null):void{
bHelpShowed = true;
rules.gotoAndPlay(2);
rules.visible = !(rules.visible);
}
}
}//package
Section 73
//MainMenuBack (MainMenuBack)
package {
import flash.events.*;
import flash.display.*;
public dynamic class MainMenuBack extends MovieClip {
public function MainMenuBack(){
addFrameScript(100, frame101);
}
function frame101(){
stop();
dispatchEvent(new Event("COMPLETE"));
}
}
}//package
Section 74
//MainPreloader (MainPreloader)
package {
import com.greenish.onlinegames.*;
public class MainPreloader extends Preloader {
public function MainPreloader(){
addChild(new KongregateAPI());
mochiId = "ef90bdefc7f0a816";
newGroundsId = 11406;
super();
}
}
}//package
Section 75
//mcArrow (mcArrow)
package {
import flash.display.*;
public dynamic class mcArrow extends MovieClip {
}
}//package
Section 76
//mcArrow1 (mcArrow1)
package {
import flash.display.*;
public dynamic class mcArrow1 extends MovieClip {
}
}//package
Section 77
//mcArrow2 (mcArrow2)
package {
import flash.display.*;
public dynamic class mcArrow2 extends MovieClip {
}
}//package
Section 78
//mcArrow3 (mcArrow3)
package {
import flash.display.*;
public dynamic class mcArrow3 extends MovieClip {
}
}//package
Section 79
//mcArrowGroup (mcArrowGroup)
package {
import flash.display.*;
public dynamic class mcArrowGroup extends MovieClip {
}
}//package
Section 80
//mcArrows2 (mcArrows2)
package {
import flash.events.*;
import caurina.transitions.*;
import flash.media.*;
import flash.display.*;
import flash.filters.*;
import flash.utils.*;
import flash.geom.*;
import flash.text.*;
import flash.system.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class mcArrows2 extends MovieClip {
public var objects;
public var i:int;
public var a;
public var r;
public var arrowGroup;
public function mcArrows2(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function onComplete():void{
dispatchEvent(new Event("COMPLETE"));
}
function frame3(){
stop();
Tweener.addTween({}, {time:3, onComplete:remove});
}
function frame1(){
objects = new Sprite();
addChild(objects);
stop();
arrowGroup = new mcArrowGroup();
arrowGroup.y = 760;
Tweener.addTween(arrowGroup, {delay:0.21, time:0.5, y:0, transition:"linear", onComplete:onComplete});
i = 0;
while (i < 100) {
arrowGroup = new mcArrowGroup();
r = (Math.random() * 120);
a = ((Math.random() * 2) * Math.PI);
arrowGroup.x = (r * Math.cos(a));
arrowGroup.y = ((r * Math.sin(a)) - 760);
Tweener.addTween(arrowGroup, {delay:(Math.random() * 0.2), time:0.5, y:(arrowGroup.y + 760), transition:"linear"});
objects.addChild(arrowGroup);
i++;
};
}
public function remove():void{
if (parent != null){
parent.removeChild(this);
};
}
function frame2(){
stop();
Tweener.addTween({}, {time:3, onComplete:remove});
}
}
}//package
Section 81
//mcBlood (mcBlood)
package {
import flash.display.*;
public dynamic class mcBlood extends MovieClip {
public function mcBlood(){
addFrameScript(89, frame90, 99, frame100);
}
function frame90(){
stop();
}
function frame100(){
if (parent != null){
parent.removeChild(this);
};
stop();
}
}
}//package
Section 82
//mcBtnTower0 (mcBtnTower0)
package {
import flash.display.*;
public dynamic class mcBtnTower0 extends MovieClip {
}
}//package
Section 83
//mcBtnTower1 (mcBtnTower1)
package {
import flash.display.*;
public dynamic class mcBtnTower1 extends MovieClip {
}
}//package
Section 84
//mcBtnTower2 (mcBtnTower2)
package {
import flash.display.*;
public dynamic class mcBtnTower2 extends MovieClip {
}
}//package
Section 85
//mcBtnTower3 (mcBtnTower3)
package {
import flash.display.*;
public dynamic class mcBtnTower3 extends MovieClip {
}
}//package
Section 86
//mcClock (mcClock)
package {
import flash.display.*;
public dynamic class mcClock extends MovieClip {
}
}//package
Section 87
//mcDialogBack (mcDialogBack)
package {
import flash.display.*;
public dynamic class mcDialogBack extends MovieClip {
}
}//package
Section 88
//mcFireArrows2 (mcFireArrows2)
package {
import flash.events.*;
import caurina.transitions.*;
import flash.media.*;
import flash.display.*;
import flash.filters.*;
import flash.utils.*;
import flash.geom.*;
import flash.text.*;
import flash.system.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class mcFireArrows2 extends MovieClip {
public var objects;
public var i:int;
public var a;
public var r;
public var arrowGroup;
public function mcFireArrows2(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function onComplete():void{
dispatchEvent(new Event("COMPLETE"));
}
function frame3(){
stop();
Tweener.addTween({}, {time:3, onComplete:remove});
}
function frame1(){
objects = new Sprite();
addChild(objects);
stop();
arrowGroup = new burning_arrow();
arrowGroup.y = 760;
Tweener.addTween(arrowGroup, {delay:0.21, time:0.5, y:0, transition:"linear", onComplete:onComplete});
i = 0;
while (i < 100) {
arrowGroup = new burning_arrow();
r = (Math.random() * 110);
a = ((Math.random() * 2) * Math.PI);
arrowGroup.x = (r * Math.cos(a));
arrowGroup.y = ((r * Math.sin(a)) - 760);
Tweener.addTween(arrowGroup, {delay:(Math.random() * 0.2), time:0.5, y:(arrowGroup.y + 760), transition:"linear"});
objects.addChild(arrowGroup);
i++;
};
}
public function remove():void{
if (parent != null){
parent.removeChild(this);
};
}
function frame2(){
stop();
Tweener.addTween({}, {time:3, onComplete:remove});
}
}
}//package
Section 89
//mcFireStone (mcFireStone)
package {
import flash.display.*;
public dynamic class mcFireStone extends MovieClip {
}
}//package
Section 90
//mcIntro (mcIntro)
package {
import flash.events.*;
import com.onlinegamestars.ender.xmlui.*;
import flash.media.*;
import flash.display.*;
import flash.filters.*;
import flash.utils.*;
import flash.geom.*;
import flash.text.*;
import flash.system.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class mcIntro extends MovieClip {
public var movie:mcIntroWindow;
public var txt;
public var skip:SimpleButton;
public function mcIntro(){
addFrameScript(0, frame1, 115, frame116, 229, frame230, 340, frame341);
}
public function onSkip(_arg1:MouseEvent=null):void{
stop();
dispatchEvent(new Event("COMPLETE"));
if (parent != null){
parent.removeChild(this);
};
Soldier.soldiers = [];
}
function frame341(){
onSkip();
}
function frame1(){
skip.addEventListener(MouseEvent.CLICK, onSkip);
addEventListener(MouseEvent.CLICK, onNext);
}
public function onNext(_arg1:MouseEvent=null):void{
if (currentFrame < 98){
gotoAndPlay(98);
return;
};
if (currentFrame < 115){
gotoAndPlay(115);
return;
};
if (currentFrame < 230){
gotoAndPlay(230);
return;
};
onSkip();
}
function frame116(){
txt = XMLUI.newButton("btn_intro");
(txt.text as Text).text = XMLUI.getData("str_intro1").text;
addChild(txt);
}
function frame230(){
(txt.text as Text).text = XMLUI.getData("str_intro2").text;
}
}
}//package
Section 91
//mcIntroWindow (mcIntroWindow)
package {
import flash.events.*;
import caurina.transitions.*;
import flash.media.*;
import flash.display.*;
import flash.filters.*;
import flash.utils.*;
import flash.geom.*;
import flash.text.*;
import com.onlinegamestars.ender.*;
import flash.system.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class mcIntroWindow extends MovieClip {
public var soldat;
public var objects;
public var camera;
public var i;
public function mcIntroWindow(){
addFrameScript(0, frame1);
}
function frame1(){
addEventListener(Event.ENTER_FRAME, sortChildren);
addEventListener(Event.REMOVED_FROM_STAGE, onRemoved);
stop();
camera = new Camera();
camera.y = 345.7;
camera.x = 383.8;
camera.scaleX = (camera.scaleY = 0.6625);
addChild(camera);
Tweener.addTween(camera, {delay:2, time:3, x:439.9, y:289.1, scaleX:0.94, scaleY:0.94, transition:"linear"});
Tweener.addTween(camera, {delay:7, time:2, x:439.9, y:345.7, scaleX:0.6625, scaleY:0.6625, transition:"linear"});
Tweener.addTween(camera, {delay:9, time:3, x:607.9, y:303.1, transition:"linear"});
objects = (addChild(new Sprite()) as Sprite);
soldat = new Soldier("Soldier0", 100, 20, 0, 0, 0);
soldat._healthBar.visible = false;
objects.addChild(soldat);
soldat.x = 50;
soldat.y = 200;
soldat.plan("right", 700);
soldat.start();
soldat = new Soldier("Soldier1", 100, 20, 0, 0, 0);
soldat._healthBar.visible = false;
soldat.x = -50;
soldat.y = 125;
soldat.plan("right", 1500);
soldat.scaleX = (soldat.scaleY = (soldat.scaleX / 1.1));
soldat.start();
objects.addChild(soldat);
soldat = new Soldier("Soldier1", 100, 20, 0, 0, 0);
soldat._healthBar.visible = false;
soldat.x = -50;
soldat.y = 275;
soldat.plan("right", 1500);
soldat.scaleX = (soldat.scaleY = (soldat.scaleX * 1.1));
soldat.start();
objects.addChild(soldat);
i = 0;
while (i < 35) {
soldat = new Soldier("Soldier0", 100, 20, 0, 0, 0);
soldat._healthBar.visible = false;
soldat.x = (-10 - (i * 10));
soldat.y = ((200 + Math.floor((Math.random() * 50))) - 25);
soldat.plan("right", 1500);
soldat.steps = ((soldat.steps + (Math.random() * 0.1)) - 0.05);
soldat.start();
objects.addChild(soldat);
soldat = new Soldier("Soldier1", 100, 20, 0, 0, 0);
soldat._healthBar.visible = false;
soldat.x = (-110 - (i * 10));
soldat.y = ((125 + Math.floor((Math.random() * 50))) - 25);
soldat.plan("right", 1500);
soldat.scaleX = (soldat.scaleY = (soldat.scaleX / 1.1));
soldat.steps = ((soldat.steps + (Math.random() * 0.1)) - 0.05);
soldat.start();
objects.addChild(soldat);
soldat = new Soldier("Soldier1", 100, 20, 0, 0, 0);
soldat._healthBar.visible = false;
soldat.x = (-110 - (i * 10));
soldat.y = ((275 + Math.floor((Math.random() * 50))) - 25);
soldat.plan("right", 1500);
soldat.scaleX = (soldat.scaleY = (soldat.scaleX * 1.1));
soldat.steps = ((soldat.steps + (Math.random() * 0.06)) - 0.02);
soldat.start();
objects.addChild(soldat);
i++;
};
i = 0;
while (i < 20) {
soldat = new Soldier(("Soldier" + (Math.floor((Math.random() * 2)) + 4).toString()), 100, 18, 0, 0, 0);
soldat._healthBar.visible = false;
soldat.x = (-140 - (i * 15));
soldat.y = ((25 + Math.floor((Math.random() * 76))) - 38);
soldat.plan("right", 1500);
soldat.steps = ((soldat.steps + (Math.random() * 0.1)) - 0.05);
soldat.start();
objects.addChild(soldat);
i++;
};
}
public function onRemoved(_arg1:Event):void{
while (objects.numChildren > 0) {
objects.removeChildAt(0);
};
while (numChildren > 0) {
removeChildAt(0);
};
}
public function sortChildren(_arg1:Event):void{
var _local2:Array;
var _local3:int;
_local2 = [];
_local3 = 0;
while (_local3 < objects.numChildren) {
_local2.push(objects.getChildAt(_local3));
_local3++;
};
_local2.sortOn("y", Array.NUMERIC);
_local3 = _local2.length;
while (_local3--) {
if (objects.getChildIndex(_local2[_local3]) != _local3){
objects.setChildIndex(_local2[_local3], _local3);
};
};
}
}
}//package
Section 92
//mcLevel0 (mcLevel0)
package {
import flash.display.*;
public dynamic class mcLevel0 extends MovieClip {
}
}//package
Section 93
//mcLevel1 (mcLevel1)
package {
import flash.display.*;
public dynamic class mcLevel1 extends MovieClip {
}
}//package
Section 94
//mcLevel2 (mcLevel2)
package {
import flash.display.*;
public dynamic class mcLevel2 extends MovieClip {
}
}//package
Section 95
//mcLevel3 (mcLevel3)
package {
import flash.display.*;
public dynamic class mcLevel3 extends MovieClip {
}
}//package
Section 96
//mcLevel4 (mcLevel4)
package {
import flash.display.*;
public dynamic class mcLevel4 extends MovieClip {
}
}//package
Section 97
//mcLevel5 (mcLevel5)
package {
import flash.display.*;
public dynamic class mcLevel5 extends MovieClip {
}
}//package
Section 98
//mcLevel6 (mcLevel6)
package {
import flash.display.*;
public dynamic class mcLevel6 extends MovieClip {
}
}//package
Section 99
//mcLevel7 (mcLevel7)
package {
import flash.display.*;
public dynamic class mcLevel7 extends MovieClip {
}
}//package
Section 100
//mcLevel8 (mcLevel8)
package {
import flash.display.*;
public dynamic class mcLevel8 extends MovieClip {
}
}//package
Section 101
//mcLevel9 (mcLevel9)
package {
import flash.display.*;
public dynamic class mcLevel9 extends MovieClip {
}
}//package
Section 102
//mcMagic0 (mcMagic0)
package {
import flash.display.*;
public dynamic class mcMagic0 extends MovieClip {
public var liquid:MovieClip;
public var back:MovieClip;
}
}//package
Section 103
//mcMagic1 (mcMagic1)
package {
import flash.display.*;
public dynamic class mcMagic1 extends MovieClip {
public var liquid:MovieClip;
public var back:MovieClip;
}
}//package
Section 104
//mcMagic2 (mcMagic2)
package {
import flash.display.*;
public dynamic class mcMagic2 extends MovieClip {
public var liquid:MovieClip;
public var back:MovieClip;
}
}//package
Section 105
//mcMagic3 (mcMagic3)
package {
import flash.display.*;
public dynamic class mcMagic3 extends MovieClip {
public var liquid:MovieClip;
public var back:MovieClip;
}
}//package
Section 106
//mcMagicArrow2 (mcMagicArrow2)
package {
import flash.events.*;
import caurina.transitions.*;
import flash.media.*;
import flash.display.*;
import flash.filters.*;
import flash.utils.*;
import flash.geom.*;
import flash.text.*;
import flash.system.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class mcMagicArrow2 extends MovieClip {
public var objects;
public var i:int;
public var a;
public var r;
public var arrowGroup;
public function mcMagicArrow2(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function onComplete():void{
dispatchEvent(new Event("COMPLETE"));
}
function frame3(){
stop();
Tweener.addTween({}, {time:3, onComplete:remove});
}
function frame1(){
objects = new Sprite();
addChild(objects);
stop();
arrowGroup = new magic_arrow();
arrowGroup.y = 760;
arrowGroup.scaleX = (arrowGroup.scaleY = 0.7);
Tweener.addTween(arrowGroup, {delay:0.21, time:0.5, y:0, transition:"linear", onComplete:onComplete});
i = 0;
while (i < 100) {
arrowGroup = new magic_arrow();
arrowGroup.scaleX = (arrowGroup.scaleY = 0.5);
r = (Math.random() * 100);
a = ((Math.random() * 2) * Math.PI);
arrowGroup.x = (r * Math.cos(a));
arrowGroup.y = ((r * Math.sin(a)) - 760);
Tweener.addTween(arrowGroup, {delay:(Math.random() * 0.2), time:0.5, y:(arrowGroup.y + 760), transition:"linear"});
objects.addChild(arrowGroup);
i++;
};
}
public function remove():void{
if (parent != null){
parent.removeChild(this);
};
}
function frame2(){
stop();
Tweener.addTween({}, {time:3, onComplete:remove});
}
}
}//package
Section 107
//mcMagicTooltip (mcMagicTooltip)
package {
import flash.display.*;
public dynamic class mcMagicTooltip extends MovieClip {
}
}//package
Section 108
//mcObjects (mcObjects)
package {
import flash.display.*;
public dynamic class mcObjects extends MovieClip {
}
}//package
Section 109
//mcPauseButton (mcPauseButton)
package {
import flash.display.*;
public dynamic class mcPauseButton extends MovieClip {
}
}//package
Section 110
//mcPointer (mcPointer)
package {
import flash.display.*;
public dynamic class mcPointer extends MovieClip {
}
}//package
Section 111
//mcProgressMap (mcProgressMap)
package {
import flash.display.*;
public dynamic class mcProgressMap extends MovieClip {
public function mcProgressMap(){
addFrameScript(0, frame1, 8, frame9, 19, frame20);
}
function frame1(){
stop();
}
function frame9(){
stop();
}
function frame20(){
stop();
}
}
}//package
Section 112
//mcShipBig_Wreck (mcShipBig_Wreck)
package {
import flash.display.*;
public dynamic class mcShipBig_Wreck extends MovieClip {
public function mcShipBig_Wreck(){
addFrameScript(99, frame100);
}
function frame100(){
stop();
if (parent != null){
parent.removeChild(this);
};
}
}
}//package
Section 113
//mcShipSmall_Wreck (mcShipSmall_Wreck)
package {
import flash.display.*;
public dynamic class mcShipSmall_Wreck extends MovieClip {
public function mcShipSmall_Wreck(){
addFrameScript(99, frame100);
}
function frame100(){
stop();
if (parent != null){
parent.removeChild(this);
};
}
}
}//package
Section 114
//mcSndOFF (mcSndOFF)
package {
import flash.display.*;
public dynamic class mcSndOFF extends MovieClip {
}
}//package
Section 115
//mcSndON (mcSndON)
package {
import flash.display.*;
public dynamic class mcSndON extends MovieClip {
}
}//package
Section 116
//mcSoldier0 (mcSoldier0)
package {
import flash.display.*;
public dynamic class mcSoldier0 extends MovieClip {
}
}//package
Section 117
//mcSoldier1 (mcSoldier1)
package {
import flash.display.*;
public dynamic class mcSoldier1 extends MovieClip {
}
}//package
Section 118
//mcSoldier2 (mcSoldier2)
package {
import flash.display.*;
public dynamic class mcSoldier2 extends MovieClip {
}
}//package
Section 119
//mcSoldier3 (mcSoldier3)
package {
import flash.display.*;
public dynamic class mcSoldier3 extends MovieClip {
}
}//package
Section 120
//mcSoldier4 (mcSoldier4)
package {
import flash.display.*;
public dynamic class mcSoldier4 extends MovieClip {
}
}//package
Section 121
//mcSoldier5 (mcSoldier5)
package {
import flash.display.*;
public dynamic class mcSoldier5 extends MovieClip {
}
}//package
Section 122
//mcSoldier6 (mcSoldier6)
package {
import flash.display.*;
public dynamic class mcSoldier6 extends MovieClip {
}
}//package
Section 123
//mcSoldier7 (mcSoldier7)
package {
import flash.display.*;
public dynamic class mcSoldier7 extends MovieClip {
}
}//package
Section 124
//mcStones2 (mcStones2)
package {
import flash.events.*;
import caurina.transitions.*;
import flash.media.*;
import flash.display.*;
import flash.filters.*;
import flash.utils.*;
import flash.geom.*;
import flash.text.*;
import flash.system.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class mcStones2 extends MovieClip {
public var objects;
public var i:int;
public var a;
public var r;
public var arrowGroup;
public function mcStones2(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function onComplete():void{
dispatchEvent(new Event("COMPLETE"));
}
function frame3(){
stop();
Tweener.addTween({}, {time:3, onComplete:remove});
}
function frame1(){
objects = new Sprite();
addChild(objects);
stop();
arrowGroup = new stone_center();
arrowGroup.y = 760;
Tweener.addTween(arrowGroup, {delay:0.21, time:0.5, y:0, transition:"linear", onComplete:onComplete});
i = 0;
while (i < 40) {
arrowGroup = new stone_center();
r = (Math.random() * 100);
a = ((Math.random() * 2) * Math.PI);
arrowGroup.x = (r * Math.cos(a));
arrowGroup.y = ((r * Math.sin(a)) - 760);
Tweener.addTween(arrowGroup, {delay:(Math.random() * 0.2), time:0.5, y:(arrowGroup.y + 760), transition:"linear"});
objects.addChild(arrowGroup);
i++;
};
}
public function remove():void{
if (parent != null){
parent.removeChild(this);
};
}
function frame2(){
stop();
Tweener.addTween({}, {time:3, onComplete:remove});
}
}
}//package
Section 125
//mcTooltip (mcTooltip)
package {
import flash.display.*;
public dynamic class mcTooltip extends MovieClip {
}
}//package
Section 126
//mcTower (mcTower)
package {
import flash.display.*;
public dynamic class mcTower extends MovieClip {
}
}//package
Section 127
//mcTower1 (mcTower1)
package {
import flash.display.*;
public dynamic class mcTower1 extends MovieClip {
}
}//package
Section 128
//mcTower2 (mcTower2)
package {
import flash.display.*;
public dynamic class mcTower2 extends MovieClip {
}
}//package
Section 129
//mcTower3 (mcTower3)
package {
import flash.display.*;
public dynamic class mcTower3 extends MovieClip {
}
}//package
Section 130
//menuBack (menuBack)
package {
import flash.display.*;
public dynamic class menuBack extends MovieClip {
}
}//package
Section 131
//MochiGfx (MochiGfx)
package {
import flash.display.*;
public dynamic class MochiGfx extends MovieClip {
}
}//package
Section 132
//MusicLibrary (MusicLibrary)
package {
import flash.media.*;
public class MusicLibrary {
private static var channel:SoundChannel;
public static var MenuBack:Class = MusicLibrary_MenuBack;
public static var Tower01Attack:Class = MusicLibrary_Tower01Attack;
public static var Tower03Attack:Class = MusicLibrary_Tower03Attack;
private static var channelGame:SoundChannel;
public static var GameBack:Class = MusicLibrary_GameBack;
public static var Magic:Class = MusicLibrary_Magic;
public static var GameOver:Class = MusicLibrary_GameOver;
private static var music:Sound;
public static var BackClass:Class;
public static var DeadBigShip:Class = MusicLibrary_DeadBigShip;
public static var TowerBuilding:Class = MusicLibrary_TowerBuilding;
public static var DeadSmallShip:Class = MusicLibrary_DeadSmallShip;
public static var DeadMonstro:Class = MusicLibrary_DeadMonstro;
public static var TowerUpgraded:Class = MusicLibrary_TowerUpgraded;
public static var Tower02Attack:Class = MusicLibrary_Tower02Attack;
public static var Complete:Class = MusicLibrary_Complete;
public static var DeadSoldier:Class = MusicLibrary_DeadSoldier;
public static var TowerAvailable:Class = MusicLibrary_TowerAvailable;
public static var isMute:Boolean = false;
public static var Dialog:Class = MusicLibrary_Dialog;
public static var Drums:Class = MusicLibrary_Drums;
public static var Click:Class = MusicLibrary_Click;
public static function stopBackMusic():void{
if (channel == null){
return;
};
channel.stop();
}
public static function resume():void{
var _local1:Number;
if (isMute){
_local1 = 0;
} else {
_local1 = 0.5;
};
music = new BackClass();
channel = music.play(0, 9999999);
if (channel == null){
return;
};
channel.soundTransform = new SoundTransform(_local1);
}
public static function playSound(_arg1:Class, _arg2:Number=1):SoundChannel{
if (isMute){
_arg2 = 0;
};
var _local3:Sound = new (_arg1);
var _local4:SoundChannel = _local3.play();
if (_local4 == null){
return (_local4);
};
_local4.soundTransform = new SoundTransform(_arg2);
return (_local4);
}
public static function startBackMusic(_arg1:Class):void{
stopBackMusic();
MusicLibrary.BackClass = _arg1;
music = new (_arg1);
channel = music.play(0, 9999999);
if (channel == null){
return;
};
channel.soundTransform = new SoundTransform(0.5);
isMute = !(isMute);
changeMute();
}
public static function changeMute():void{
isMute = !(isMute);
if (channel == null){
return;
};
if (isMute){
channel.soundTransform = new SoundTransform(0);
} else {
channel.soundTransform = new SoundTransform(0.5);
};
}
public static function pause():void{
stopBackMusic();
}
}
}//package
Section 133
//MusicLibrary_Click (MusicLibrary_Click)
package {
import mx.core.*;
public class MusicLibrary_Click extends SoundAsset {
}
}//package
Section 134
//MusicLibrary_Complete (MusicLibrary_Complete)
package {
import mx.core.*;
public class MusicLibrary_Complete extends SoundAsset {
}
}//package
Section 135
//MusicLibrary_DeadBigShip (MusicLibrary_DeadBigShip)
package {
import mx.core.*;
public class MusicLibrary_DeadBigShip extends SoundAsset {
}
}//package
Section 136
//MusicLibrary_DeadMonstro (MusicLibrary_DeadMonstro)
package {
import mx.core.*;
public class MusicLibrary_DeadMonstro extends SoundAsset {
}
}//package
Section 137
//MusicLibrary_DeadSmallShip (MusicLibrary_DeadSmallShip)
package {
import mx.core.*;
public class MusicLibrary_DeadSmallShip extends SoundAsset {
}
}//package
Section 138
//MusicLibrary_DeadSoldier (MusicLibrary_DeadSoldier)
package {
import mx.core.*;
public class MusicLibrary_DeadSoldier extends SoundAsset {
}
}//package
Section 139
//MusicLibrary_Dialog (MusicLibrary_Dialog)
package {
import mx.core.*;
public class MusicLibrary_Dialog extends SoundAsset {
}
}//package
Section 140
//MusicLibrary_Drums (MusicLibrary_Drums)
package {
import mx.core.*;
public class MusicLibrary_Drums extends SoundAsset {
}
}//package
Section 141
//MusicLibrary_GameBack (MusicLibrary_GameBack)
package {
import mx.core.*;
public class MusicLibrary_GameBack extends SoundAsset {
}
}//package
Section 142
//MusicLibrary_GameOver (MusicLibrary_GameOver)
package {
import mx.core.*;
public class MusicLibrary_GameOver extends SoundAsset {
}
}//package
Section 143
//MusicLibrary_Magic (MusicLibrary_Magic)
package {
import mx.core.*;
public class MusicLibrary_Magic extends SoundAsset {
}
}//package
Section 144
//MusicLibrary_MenuBack (MusicLibrary_MenuBack)
package {
import mx.core.*;
public class MusicLibrary_MenuBack extends SoundAsset {
}
}//package
Section 145
//MusicLibrary_Tower01Attack (MusicLibrary_Tower01Attack)
package {
import mx.core.*;
public class MusicLibrary_Tower01Attack extends SoundAsset {
}
}//package
Section 146
//MusicLibrary_Tower02Attack (MusicLibrary_Tower02Attack)
package {
import mx.core.*;
public class MusicLibrary_Tower02Attack extends SoundAsset {
}
}//package
Section 147
//MusicLibrary_Tower03Attack (MusicLibrary_Tower03Attack)
package {
import mx.core.*;
public class MusicLibrary_Tower03Attack extends SoundAsset {
}
}//package
Section 148
//MusicLibrary_TowerAvailable (MusicLibrary_TowerAvailable)
package {
import mx.core.*;
public class MusicLibrary_TowerAvailable extends SoundAsset {
}
}//package
Section 149
//MusicLibrary_TowerBuilding (MusicLibrary_TowerBuilding)
package {
import mx.core.*;
public class MusicLibrary_TowerBuilding extends SoundAsset {
}
}//package
Section 150
//MusicLibrary_TowerUpgraded (MusicLibrary_TowerUpgraded)
package {
import mx.core.*;
public class MusicLibrary_TowerUpgraded extends SoundAsset {
}
}//package
Section 151
//NewgroundsAPI (NewgroundsAPI)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.text.*;
public class NewgroundsAPI {
public static const ADS_APPROVED:Number = 3;
public static const bridge:Sprite = new Sprite();
private static const STAT_NEW_VERSION:Number = 4;
private static const STAT_AUTHOR_SITE:Number = 2;
private static const GATEWAY_URL:String = "http://www.ngads.com/gateway.php";
private static const NEWGROUNDS_URL:String = "http://www.newgrounds.com";
private static const STAT_CUSTOM_STATS:Number = 50;
private static const STAT_MOVIE_VIEWS:Number = 1;
private static const STAT_NEWGROUNDS:Number = 3;
public static const NEW_VERSION:Number = 2;
public static const DENY_HOST:Number = 1;
private static var tracker_id:Number;
private static var movie_options:Object = new Object();
private static var connected:Boolean;
private static var custom_events:Object = new Object();
private static var host:String;
private static var linked:Boolean;
private static var events:Object = new Object();
private static var debug:Boolean;
private static var version:String;
private static var custom_links:Object = new Object();
public static function getNewVersionURL():String{
return (((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + STAT_NEW_VERSION));
}
private static function ReadGatewayData(_arg1:Object):void{
var _local2:String;
var _local3:String;
var _local4:String;
var _local5:URLLoader;
for (_local2 in _arg1) {
_arg1[_local2] = unescape(_arg1[_local2]);
movie_options[_local2] = _arg1[_local2];
};
if (_arg1["settings_loaded"]){
SendMessage("You have successfully connected to the Newgrounds API gateway!");
SendMessage((("Movie Identified as '" + movie_options["movie_name"]) + "'"));
if (movie_options["message"]){
SendMessage(movie_options["message"]);
};
if (movie_options["ad_url"]){
SendMessage("Your movie has been approved to run Flash Ads");
if (events[ADS_APPROVED]){
var _local6 = events;
_local6[ADS_APPROVED](movie_options["ad_url"]);
} else {
onAdsApproved(movie_options["ad_url"]);
};
};
if (((movie_options["movie_version"]) && (!((String(movie_options["movie_version"]) == String(version)))))){
SendMessage("WARNING: The movie version configured in your API settings does not match this movie's version!");
if (events[NEW_VERSION]){
_local6 = events;
_local6[NEW_VERSION]({version:movie_options["movie_version"], real_url:getMovieURL(), redirect_url:getNewVersionURL()});
} else {
onNewVersionAvailable(movie_options["movie_version"], getMovieURL(), getNewVersionURL());
};
};
if (movie_options["deny_host"]){
SendMessage("You have blocked 'localHost' in your API settings.");
SendMessage("If you wish to test your movie you will need to remove this block.");
if (events[DENY_HOST]){
_local6 = events;
_local6[DENY_HOST]({host:host, real_url:getMovieURL(), redirect_url:getNewVersionURL()});
} else {
onDenyHost(host, getMovieURL(), getNewVersionURL());
};
};
if (movie_options["request_portal_url"]){
_local3 = bridge.root.loaderInfo.url;
_local4 = ((((GATEWAY_URL + "?&id=") + tracker_id) + "&portal_url=") + escape(_local3));
_local5 = new URLLoader(new URLRequest(_local4));
};
if (events[69]){
_local6 = events;
_local6[69]();
};
} else {
if (!movie_options["settings_loaded"]){
SendError("Could not establish connection to the API gateway.");
};
};
}
public static function setMovieVersion(_arg1:String):void{
if (!_arg1){
SendError("Missing required 'version' in NewgroundsAPI.setMovieVersion(version:String)");
} else {
version = String(_arg1);
};
}
public static function loadCustomLink(_arg1:String):void{
if (!_arg1){
SendError("Missing required 'link_name' parameter in NewgroundsAPI.loadCustomLink(link_name:String)");
} else {
if (!custom_links[_arg1]){
SendError(("Attempted to open undefined custom link: " + _arg1));
} else {
SendLink(custom_links[_arg1]);
};
};
}
public static function addCustomLink(_arg1:Number, _arg2:String):void{
if (!_arg1){
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
if (!_arg2){
SendError("Missing required 'link_name' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
custom_links[_arg2] = (STAT_CUSTOM_STATS + _arg1);
SendMessage(((("Created custom link " + _arg1) + ": ") + _arg2));
};
};
}
public static function getMovieURL():String{
if (movie_options["movie_url"]){
return (movie_options["movie_url"]);
};
return ("Newgrounds.com");
}
public static function debugMode():void{
debug = true;
}
public static function getAdURL():String{
return (movie_options["ad_url"]);
}
private static function SendStat(_arg1:Number, _arg2:Boolean, _arg3:Object=null):void{
var target_url:String;
var x:String;
var request:URLRequest;
var gateway_loader:URLLoader;
var stat_id = _arg1;
var open_in_browser = _arg2;
var extra = _arg3;
if (!tracker_id){
SendError("You must call NewgroundsAPI.connectMovie() with a valid movie id before using API features!");
} else {
var XML_Loaded:Function = function (_arg1:Event):void{
var _local5:XML;
var _local6:String;
var _local7:Number;
XML.ignoreWhitespace = true;
var _local2:XML = XML(_arg1.target.data);
var _local3:Object = new Object();
var _local4:XMLList = _local2.children();
for each (_local5 in _local4) {
_local6 = _local5.localName();
_local7 = _local5.attribute("value");
if (_local7 == Number(_local7)){
_local7 = Number(_local7);
};
_local3[_local6] = _local7;
};
ReadGatewayData(_local3);
};
target_url = (((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + stat_id) + addSeed());
if (extra){
for (x in extra) {
target_url = (target_url + ((("&" + escape(x)) + "=") + escape(extra[x])));
};
};
if (debug){
target_url = (target_url + "&debug=1");
};
if (open_in_browser){
request = new URLRequest((target_url + addSeed()));
navigateToURL(request, "_blank");
} else {
gateway_loader = new URLLoader(new URLRequest((target_url + addSeed())));
gateway_loader.addEventListener(Event.COMPLETE, XML_Loaded);
};
};
}
public static function onAdsApproved(_arg1:String):void{
}
public static function loadMySite(_arg1:Event=null):void{
SendLink(STAT_AUTHOR_SITE);
}
private static function SendMessage(_arg1:String):void{
trace(("[NEWGROUNDS API] :: " + _arg1));
}
public static function linkAPI(_arg1:DisplayObjectContainer):void{
_arg1.addChild(bridge);
linked = true;
}
public static function loadNewgrounds(_arg1:Event=null, _arg2:String=null):void{
var _local3:URLRequest;
var _local4:Object;
if (!tracker_id){
_local3 = new URLRequest(((NEWGROUNDS_URL + "/") + _arg2));
navigateToURL(_local3, "_blank");
} else {
_local4 = null;
if (_arg2){
_local4 = new Object();
_local4.page = _arg2;
};
SendLink(STAT_NEWGROUNDS, _local4);
};
}
private static function SendLink(_arg1:Number, _arg2:Object=null):void{
SendStat(_arg1, true, _arg2);
}
public static function logCustomEvent(_arg1:String):void{
if (!_arg1){
SendError("Missing required 'event_name' parameter in NewgroundsAPI.logCustomEvent(event_name:String)");
} else {
if (!custom_events[_arg1]){
SendError(("Attempted to log undefined custom event: " + _arg1));
} else {
SendEvent(custom_events[_arg1]);
};
};
}
private static function SendError(_arg1:String):void{
trace(("[NEWGROUNDS API ERROR] :: " + _arg1));
}
public static function addCustomEvent(_arg1:Number, _arg2:String):void{
if (!_arg1){
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
if (!_arg2){
SendError("Missing required 'event_name' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
custom_events[_arg2] = (STAT_CUSTOM_STATS + _arg1);
SendMessage(("Created custom event: " + _arg2));
};
};
}
private static function addSeed():String{
return (("&seed=" + Math.random()));
}
public static function addEventListener(_arg1:Number, _arg2:Function):void{
events[_arg1] = _arg2;
}
private static function SendEvent(_arg1:Number):void{
SendStat(_arg1, false);
}
public static function onNewVersionAvailable(_arg1:String, _arg2:String, _arg3:String):void{
var _root:*;
var overlay:MovieClip;
var version = _arg1;
var movie_url = _arg2;
var redirect_url = _arg3;
var sw:int = bridge.stage.stageWidth;
var sh:int = bridge.stage.stageHeight;
var tw = 350;
var th = 160;
var mg = 20;
_root = bridge.root;
overlay = new MovieClip();
overlay.graphics.beginFill(0, 0.6);
overlay.graphics.lineStyle(0, 0);
overlay.graphics.drawRect(0, 0, sw, sh);
overlay.graphics.endFill();
var overlay_x:int = Math.round(((sw - tw) / 2));
var overlay_y:int = Math.round(((sh - th) / 2));
overlay.graphics.beginFill(102);
overlay.graphics.lineStyle(10, 0);
overlay.graphics.drawRect((overlay_x - mg), (overlay_y - mg), (tw + mg), (th + mg));
overlay.graphics.endFill();
overlay.close = function (_arg1:Event):void{
_root.removeChild(overlay);
};
var close_x:MovieClip = new MovieClip();
close_x.graphics.beginFill(0, 0.1);
close_x.graphics.lineStyle(3, 22015);
close_x.graphics.drawRect(0, 0, 16, 16);
close_x.graphics.endFill();
close_x.graphics.moveTo(4, 4);
close_x.graphics.lineTo(13, 13);
close_x.graphics.moveTo(13, 4);
close_x.graphics.lineTo(4, 13);
close_x.x = ((overlay_x + tw) - 26);
close_x.y = (overlay_y - 10);
close_x.addEventListener(MouseEvent.CLICK, overlay.close);
var blankarea:TextField = new TextField();
blankarea.x = (overlay_x - mg);
blankarea.y = (overlay_y - mg);
blankarea.width = (tw + mg);
blankarea.height = (th + mg);
blankarea.selectable = false;
var header:TextField = new TextField();
header.width = tw;
header.x = overlay_x;
header.y = overlay_y;
header.height = 100;
header.selectable = false;
var header_format:TextFormat = new TextFormat();
header_format.font = "Arial Black";
header_format.color = 0xFFFFFF;
header_format.size = 20;
header.defaultTextFormat = header_format;
header.text = "New Version Available!";
var msgtext:TextField = new TextField();
msgtext.x = overlay_x;
msgtext.y = (overlay_y + 70);
msgtext.width = tw;
msgtext.height = 60;
msgtext.selectable = false;
var msgtext_format:TextFormat = new TextFormat();
msgtext_format.font = "Arial";
msgtext_format.color = 0xFFFFFF;
msgtext_format.size = 12;
msgtext_format.bold = true;
var msgtext_link:TextFormat = new TextFormat();
msgtext_link.font = "Arial";
msgtext_link.color = 0xFFFF00;
msgtext_link.size = 12;
msgtext_link.bold = true;
msgtext_link.url = redirect_url;
msgtext_link.target = "_blank";
if (version){
version = ("Version " + version);
} else {
version = "A new version";
};
msgtext.defaultTextFormat = msgtext_format;
msgtext.appendText((version + " is now available"));
if (movie_url){
msgtext.appendText(" at:\n");
msgtext.defaultTextFormat = msgtext_link;
msgtext.appendText(movie_url);
} else {
msgtext.appendText("!");
};
_root.addChild(overlay);
overlay.addChild(blankarea);
overlay.addChild(header);
overlay.addChild(msgtext);
overlay.addChild(close_x);
}
public static function onDenyHost(_arg1:String, _arg2:String, _arg3:String):void{
var _local4:int = bridge.stage.stageWidth;
var _local5:int = bridge.stage.stageHeight;
var _local6 = 350;
var _local7 = 160;
var _local8:* = bridge.root;
var _local9:MovieClip = new MovieClip();
_local9.graphics.beginFill(0x660000);
_local9.graphics.lineStyle(20, 0);
_local9.graphics.drawRect(0, 0, _local4, _local5);
_local9.graphics.endFill();
var _local10:TextField = new TextField();
_local10.x = 0;
_local10.y = 0;
_local10.width = _local4;
_local10.height = _local5;
_local10.selectable = false;
var _local11:TextField = new TextField();
_local11.x = Math.round(((_local4 - _local6) / 2));
_local11.y = Math.round(((_local5 - _local7) / 2.5));
_local11.width = _local6;
_local11.height = 100;
_local11.selectable = false;
var _local12:TextFormat = new TextFormat();
_local12.font = "Arial Black";
_local12.color = 0xFF0000;
_local12.size = 38;
_local11.defaultTextFormat = _local12;
_local11.text = "ERROR!";
var _local13:TextField = new TextField();
_local13.x = Math.round(((_local4 - _local6) / 2));
_local13.y = (Math.round(((_local5 - _local7) / 2.5)) + 80);
_local13.width = _local6;
_local13.height = 80;
_local13.selectable = false;
var _local14:TextFormat = new TextFormat();
_local14.font = "Arial";
_local14.color = 0xFFFFFF;
_local14.size = 12;
_local14.bold = true;
var _local15:TextFormat = new TextFormat();
_local15.font = "Arial";
_local15.color = 0xFFFF00;
_local15.size = 12;
_local15.bold = true;
_local15.url = _arg3;
_local15.target = "_blank";
_local13.defaultTextFormat = _local14;
_local13.appendText((("This movie has not been approved for use on " + _arg1) + "\n"));
_local13.appendText("For an approved copy, please visit:\n");
_local13.defaultTextFormat = _local15;
_local13.appendText(_arg2);
_local8.addChild(_local9);
_local9.addChild(_local10);
_local9.addChild(_local11);
_local9.addChild(_local13);
}
public static function connectMovie(_arg1:Number):void{
var _local2:String;
var _local3:Object;
if (!_arg1){
SendError("Missing required 'id' parameter in NewgroundsAPI.connectMovie(id:Number)");
} else {
if (!linked){
SendError("Attempted to call MewgroundsAPI.connectMovie() without first calling NewgroundsAPI.linkAPI(this)");
} else {
if (!tracker_id){
SendMessage("Connecting to API gateway...");
tracker_id = _arg1;
_local2 = bridge.root.loaderInfo.url;
host = _local2.split("/")[2].toLowerCase();
if (host.length < 1){
host = "localhost";
};
_local3 = new Object();
SendEvent(STAT_MOVIE_VIEWS);
};
};
};
}
public static function isInstalled():Boolean{
return (true);
}
}
}//package
Section 152
//PauseGfx (PauseGfx)
package {
import flash.display.*;
public dynamic class PauseGfx extends MovieClip {
public var blocker:SimpleButton;
}
}//package
Section 153
//PreloaderGfx (PreloaderGfx)
package {
import flash.display.*;
public dynamic class PreloaderGfx extends MovieClip {
public var progress:MovieClip;
}
}//package
Section 154
//Resources (Resources)
package {
public class Resources {
public var flag_por:Class;
public var Soldier0:Class;
public var Soldier1:Class;
public var Soldier2:Class;
public var Soldier3:Class;
public var Soldier4:Class;
public var Soldier5:Class;
public var Soldier6:Class;
public var Soldier7:Class;
public var Pointer:Class;
public var flag_kor:Class;
public var flag_rus:Class;
public var flag_ita:Class;
public var xmlENG:XML;
public var paramsMagic0:Object;
public var paramsMagic1:Object;
public var paramsMagic2:Object;
public var paramsMagic3:Object;
public var flag_spa:Class;
public var SndOFF:Class;
public var Tower0:Class;
public var Arrow1:Class;
public var Tower2:Class;
public var Tower3:Class;
public var paramsTower0:Object;
public var paramsTower1:Object;
public var Arrow2:Class;
private var _arial_fnt:String;// = "Resources__arial_fnt"
public var flag_chi:Class;
public var paramsTower2:Object;
public var Tower1:Class;
public var Arrow3:Class;
public var paramsTower3:Object;
public var flag_eng:Class;
public var flag_jpn:Class;
public var level01_overlay:Class;
public var level02_overlay:Class;
public var level03_overlay:Class;
public var level04_overlay:Class;
public var level05_overlay:Class;
public var level06_overlay:Class;
public var level07_overlay:Class;
public var level08_overlay:Class;
public var level09_overlay:Class;
public var btnMagic0:Class;
public var btnMagic1:Class;
public var btnMagic2:Class;
public var btnMagic3:Class;
public var btnLevel0:Class;
public var btnLevel1:Class;
public var btnLevel2:Class;
public var btnLevel3:Class;
public var btnLevel4:Class;
public var btnLevel5:Class;
public var btnLevel6:Class;
public var PauseButton:Class;
public var btnLevel8:Class;
public var btnLevel9:Class;
public var flag_heb:Class;
public var level10_overlay:Class;
public var btnLevel7:Class;
public var flag_tur:Class;
public var flag_deu:Class;
public var flag_fra:Class;
public var btnTower0:Class;
public var btnTower1:Class;
public var btnTower2:Class;
public var btnTower3:Class;
public var SndON:Class;
public var Arrow:Class;
private var _arkhive_fnt:String;// = "Resources__arkhive_fnt"
public var xmlRUS:XML;
public var flag_pol:Class;
public var flag_ara:Class;
public static var langs:Array = ["eng", "rus"];
public static var config:XML = <config>
<towers>
<!-- Настройки башен -->
<!-- range - дальность стрельбы на каждом уровне. Разделяется точкойзапятой -->
<!-- delay - задержка между выстрелами на каждом уровне. Разделяется точкойзапятой -->
<!-- damage - урон от выстрела на каждом уровне. Разделяется точкойзапятой -->
<!-- cost - цена постройки башни -->
<!-- upgradesCost - цена апгрейда башни на каждом уровне. Разделяется точкойзапятой -->
<tower id="Tower0" range="100;100;100;105" delay="0.45;0.4;0.35;0.3" damage="7;10;13;17" cost="200" upgradesCost="70;100;190;0"/>
<tower id="Tower1" range="85;90;100;105" delay="0.8;0.7;0.6;0.5" damage="15;18;21;25" cost="250" upgradesCost="80;130;200;0"/>
<tower id="Tower2" range="85;90;100;105" delay="0.7;0.6;0.5;0.4" damage="26;29;32;36" cost="500" upgradesCost="150;200;300;0"/>
<tower id="Tower3" range="100;105;110;115" delay="0.7;0.6;0.5;0.4" damage="33;36;39;42" cost="750" upgradesCost="200;250;350;0"/>
</towers>
<magics>
<!-- Настройки магии -->
<!-- range - радиус поражения. -->
<!-- damage - урон от магии -->
<!-- mana - количество маны на вызов заклинания -->
<magic id="Magic0" range="120" damage="80" mana="100"/>
<magic id="Magic1" range="100" damage="100" mana="150"/>
<magic id="Magic2" range="110" damage="150" mana="200"/>
<magic id="Magic3" range="100" damage="190" mana="350"/>
</magics>
<!-- Виды монстров:
0 - простой солдат
1 - солдат в доспехах
2 - одноглазый монстр
3 - красный монстр
4 - маленький корабль
5 - Большой корабль
6 - синий монстр
7 - зеленый монстр-->
<soldiers>
<soldier id="Soldier0" health="112;117;122" speed="21;22;23" gold="23;21;18" mana="3;3;4" damage="10;10;10"/>
<soldier id="Soldier1" health="215;220;225" speed="17;18;19" gold="27;24;21" mana="5;5;6" damage="15;15;15"/>
<soldier id="Soldier2" health="245;250;255" speed="31;32;33" gold="27;27;25" mana="8;8;10" damage="20;20;20"/>
<soldier id="Soldier3" health="240;245;250" speed="29;31;33" gold="38;38;35" mana="10;10;10" damage="25;28;32"/>
<soldier id="Soldier4" health="190;195;200" speed="21;23;26" gold="25;20;15" mana="7;7;7" damage="25;25;25"/>
<soldier id="Soldier5" health="317;322;327" speed="21;23;24" gold="30;30;30" mana="12;12;12" damage="30;30;30"/>
<soldier id="Soldier6" health="240;245;250" speed="26;27;28" gold="75;75;70" mana="14;14;14" damage="50;50;50"/>
<soldier id="Soldier7" health="340;345;350" speed="31;32;37" gold="110;110;100" mana="17;17;17" damage="75;75;75"/>
</soldiers>
<levels>
<!-- Настройки уровней -->
<!-- gold - золото в начале уровня -->
<!-- overlay - название рисунка с дорогой/рекой. Может быть любым, главное разным для каждого уровня -->
<!-- background - номер подложки. Число в пределах 1-4 -->
<!-- LEVEL 01 -->
<level lives="150;100;100" gold="350;300;300" mana="200;150;100" overlay="level01_overlay" background="1">
<waves>
<!-- Настройки волн -->
<!-- start - задержка начала волны в секундах от начала уровня -->
<!-- delay - задержка между монстрами, секунды -->
<!-- health - здоровье каждого вида монстров, разделяется точкойзапятой -->
<!-- gold - золото, которое падает с каждого вида монстров, разделяется точкойзапятой -->
<!-- mana - золото, которое падает с каждого вида монстров, разделяется точкойзапятой -->
<!-- speed - каждого вида монстров, разделяется точкойзапятой -->
<!-- creeps - последовательность появления монстров, разделяется точкойзапятой. Виды монстров:
0 - простой солдат
1 - солдат в доспехах
2 - одноглазый монстр
3 - красный монстр
4 - маленький корабль
5 - Большой корабль
6 - синий монстр
7 - зеленый монстр-->
<wave start="8" delay="8" creeps="0;0;0;0;0;1;0;0"/>
<wave start="85" delay="7" creeps="0;0;1;0;1;0;1;1"/>
<wave start="140" delay="5" creeps="1;1;0;1;1;2;1;1;0;2;1"/>
<wave start="195" delay="5" creeps="0;1;2;1;1;2;1;2;1;2;2;1;2;1;2;2;2;2"/>
<wave start="315" delay="3.5" creeps="2;2;1;2;1;2;1;2;1;2;1;2;1;2;2;2;2;2;2;2;2"/>
</waves>
<dialogues>
<!-- Описание диалогов на уровне -->
<dialogue delay="0.5">
<!-- описание диалога -->
<!-- delay - задержка в секундвх от начала уровня -->
<!-- message - описание каждой фразы -->
<!-- msgID - ИД строки с фразой -->
<!-- marker - пока только Pointer (мигающая стрелка) -->
<!-- x, y - координаты стрелки -->
<!-- rotation - угол поворота стрелки в градусах. Положительный - по часовой стрелке, отрицательный - против. -->
<!-- если стрелка ненужна, то marker, x, y и rotation не надо писать -->
<message msgID="str_level01_message00" marker="Pointer" x="50" y="120"/>
</dialogue>
<dialogue delay="27">
<message msgID="str_level01_message01" marker="Pointer" x="650" y="50" rotation="90"/>
</dialogue>
<dialogue delay="48">
<message msgID="str_level01_message02" marker="Pointer" x="525" y="50" rotation="90"/>
<message msgID="str_level01_message03" marker="Pointer" x="700" y="120" rotation="180"/>
</dialogue>
</dialogues>
<!-- Описание маршрута монстров -->
<!-- x, y - стартовые координаты маршрута -->
<path x="0" y="215">
<!-- Описание отрезков маршрута -->
<!-- direction - направление маршрута. Возможны следующие значения: up, down, right, left, rightdown, leftdown, rightup, leftup -->
<!-- distance - расстояние отрезка маршрута в пикселах -->
<step direction="right" distance="455"/>
<step direction="rightdown" distance="125"/>
<step direction="down" distance="220"/>
<step direction="rightdown" distance="75"/>
</path>
<objects>
<object type="tree00" x="052" y="116"/>
<object type="bush00" x="062" y="136"/>
<object type="tree01" x="120" y="118"/>
<object type="tree02" x="184" y="122"/>
<object type="tree03" x="268" y="118"/>
<object type="tree04" x="324" y="122"/>
<object type="tree00" x="385" y="121"/>
<object type="tree01" x="443" y="103"/>
<object type="tree02" x="072" y="099"/>
<object type="tree03" x="158" y="098"/>
<object type="tree04" x="249" y="077"/>
<object type="tree00" x="328" y="043"/>
<object type="tree01" x="378" y="079"/>
<object type="tree02" x="452" y="083"/>
<object type="tree03" x="492" y="084"/>
<object type="tree04" x="500" y="064"/>
<object type="tree00" x="554" y="060"/>
<object type="tree01" x="594" y="058"/>
<object type="tree02" x="620" y="063"/>
<object type="tree03" x="543" y="051"/>
<object type="tree04" x="232" y="106"/>
<object type="well" x="648" y="136"/>
<object type="skull02" x="596" y="148"/>
<object type="skull02" x="066" y="358"/>
<object type="dir_right" x="85" y="174"/>
<object type="hill00" x="228" y="336"/>
<object type="hill00" x="258" y="462"/>
<object type="sword" x="594" y="108"/>
<object type="tree02" x="046" y="484"/>
<object type="tree01" x="081" y="503"/>
<object type="tree04" x="141" y="533"/>
<object type="tree02" x="206" y="528"/>
<object type="tree03" x="253" y="542"/>
<object type="tree02" x="318" y="539"/>
<object type="tree03" x="383" y="546"/>
<object type="tree02" x="058" y="502"/>
<object type="tree01" x="102" y="517"/>
<object type="tree04" x="174" y="535"/>
<object type="tree02" x="214" y="546"/>
<object type="tree03" x="304" y="540"/>
<object type="tree02" x="354" y="546"/>
<object type="tree03" x="049" y="531"/>
<object type="tree02" x="085" y="556"/>
<object type="tree01" x="172" y="564"/>
<object type="tree04" x="237" y="567"/>
<object type="tree02" x="303" y="567"/>
<object type="tree03" x="358" y="564"/>
<object type="grass1" x="614" y="390"/>
<object type="grass0" x="666" y="422"/>
<object type="grass1" x="697" y="503"/>
<object type="grass1" x="399" y="523"/>
<object type="grass0" x="371" y="467"/>
<object type="grass1" x="659" y="252"/>
<object type="grass0" x="294" y="413"/>
<object type="grass0" x="211" y="419"/>
<object type="grass1" x="082" y="446"/>
<object type="grass0" x="164" y="565"/>
<object type="grass0" x="318" y="325"/>
<object type="grass1" x="153" y="102"/>
<object type="grass0" x="354" y="092"/>
<object type="plant0" x="654" y="324"/>
<object type="sword" x="047" y="357"/>
</objects>
</level>
<!-- LEVEL 01 -->
<!-- LEVEL 02 -->
<level lives="150;100;100" gold="400;350;350" mana="150;150;100" overlay="level02_overlay" background="1">
<waves>
<wave start="8" delay="8.5" creeps="4;4;4;4;4;5;4;5"/>
<wave start="98" delay="7" creeps="4;4;5;4;5;4;4;5;5"/>
<wave start="180" delay="5" creeps="4;4;5;4;4;4;4;5;4;4;4;5;4"/>
<wave start="270" delay="5" creeps="5;5;4;5;5;5;4;5;4;5;5;4;5;4;5;4;5;5"/>
<wave start="380" delay="4" creeps="5;5;5;5;5;4;4;4;5;5;5;5;5;5;5;5;5;5;5;5;5"/>
<wave start="490" delay="3" creeps="5;5;5;5;5;4;4;4;5;5;5;5;5;5;5;5;5;5;5;5;5"/>
</waves>
<dialogues>
<dialogue delay="0.5">
<message msgID="str_level02_message00"/>
</dialogue>
</dialogues>
<path x="0" y="500">
<step direction="right" distance="180"/>
<step direction="rightup" distance="135"/>
<step direction="up" distance="180"/>
<step direction="rightup" distance="70"/>
<step direction="right" distance="150"/>
<step direction="rightdown" distance="140"/>
<step direction="down" distance="325"/>
</path>
<objects>
<object type="statue" x="504" y="562"/>
<object type="hill06" x="660" y="112"/>
<object type="plant0" x="367" y="472"/>
<object type="tree02" x="043" y="261"/>
<object type="tree01" x="080" y="230"/>
<object type="tree04" x="126" y="201"/>
<object type="tree02" x="108" y="174"/>
<object type="tree03" x="143" y="137"/>
<object type="tree02" x="159" y="111"/>
<object type="tree03" x="198" y="082"/>
<object type="tree02" x="267" y="072"/>
<object type="tree01" x="307" y="055"/>
<object type="tree04" x="165" y="055"/>
<object type="tree02" x="100" y="058"/>
<object type="tree03" x="050" y="054"/>
<object type="tree02" x="026" y="035"/>
<object type="tree03" x="030" y="108"/>
<object type="tree02" x="080" y="108"/>
<object type="tree01" x="065" y="172"/>
<object type="tree04" x="018" y="566"/>
<object type="tree02" x="123" y="567"/>
<object type="tree02" x="088" y="566"/>
<object type="hill08" x="556" y="070"/>
<object type="hill07" x="508" y="065"/>
<object type="hill09" x="406" y="060"/>
<object type="hill08" x="359" y="071"/>
<object type="hill07" x="099" y="311"/>
<object type="hill09" x="110" y="277"/>
<object type="hill08" x="156" y="272"/>
<object type="dir_right" x="065" y="436"/>
<object type="skull01" x="420" y="430"/>
<object type="stone0" x="406" y="396"/>
<object type="grass0" x="110" y="088"/>
<object type="grass1" x="698" y="351"/>
<object type="grass0" x="686" y="450"/>
<object type="grass1" x="738" y="565"/>
<object type="anchor" x="328" y="525"/>
<object type="ship_wreck" x="672" y="192"/>
</objects>
</level>
<!-- LEVEL 02 -->
<!-- LEVEL 03 -->
<level lives="150;100;100" gold="600;550;550" mana="175;175;150" overlay="level03_overlay" background="1">
<waves>
<wave start="8" delay="8" creeps="0;1;0;1;0;1;0;2"/>
<wave start="87" delay="7" creeps="1;1;2;1;1;0;1;1;2"/>
<wave start="155" delay="5" creeps="1;2;1;3;1;2;1;1;3;2;1;3;2"/>
<wave start="235" delay="4" creeps="3;3;3;1;1;3;2;3;2;3;3;2;3;2;3;3;3;3"/>
<wave start="330" delay="3.5" creeps="3;3;1;3;2;3;3;3;2;3;2;3;2;3;3;3;3;3;3;3;3"/>
<wave start="415" delay="3" creeps="3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3"/>
</waves>
<dialogues>
<dialogue delay="0.5">
<message msgID="str_level03_message00"/>
</dialogue>
</dialogues>
<path x="167" y="576">
<step direction="up" distance="172"/>
<step direction="rightup" distance="135"/>
<step direction="up" distance="100"/>
<step direction="rightup" distance="120"/>
<step direction="right" distance="130"/>
<step direction="rightdown" distance="185"/>
<step direction="leftdown" distance="230"/>
<step direction="rightdown" distance="105"/>
<step direction="right" distance="205"/>
</path>
<objects>
<object type="tree02" x="021" y="058"/>
<object type="tree00" x="029" y="098"/>
<object type="tree01" x="080" y="121"/>
<object type="tree03" x="138" y="123"/>
<object type="tree04" x="099" y="171"/>
<object type="tree02" x="214" y="128"/>
<object type="dead_tree02" x="727" y="044"/>
<object type="dead_tree05" x="690" y="083"/>
<object type="dead_tree07" x="632" y="063"/>
<object type="dead_tree02" x="706" y="366"/>
<object type="dead_tree07" x="662" y="349"/>
<object type="magic_tree01" x="404" y="296"/>
<object type="sword" x="405" y="548"/>
<object type="sword" x="651" y="096"/>
<object type="skull02" x="665" y="402"/>
<object type="dir_right" x="405" y="081"/>
<object type="hill03" x="113" y="223"/>
<object type="hill06" x="328" y="557"/>
<object type="hill02" x="402" y="561"/>
<object type="hill06" x="072" y="069"/>
<object type="arka" x="093" y="324"/>
</objects>
</level>
<!-- LEVEL 03 -->
<!-- LEVEL 04 -->
<level lives="150;100;100" gold="600;550;550" mana="175;175;150" overlay="level04_overlay" background="2">
<waves>
<wave start="8" delay="7" creeps="0;1;0;1;0;1;0;2"/>
<wave start="88" delay="5" creeps="1;2;2;2;1;2;2;2;3"/>
<wave start="155" delay="4" creeps="3;2;3;3;2;6;3;2;3;6;2;3;2"/>
<wave start="235" delay="3" creeps="3;6;3;2;6;3;2;3;6;3;3;6;3;2;6;3;3;6"/>
<wave start="324" delay="2" creeps="3;3;6;3;6;3;6;6;2;3;6;3;6;3;6;3;3;3;6;6;3"/>
<wave start="415" delay="1" creeps="3;3;3;6;3;6;3;3;6;3;3;6;6;6;3;3;6;6;6;6;6"/>
</waves>
<dialogues>
<dialogue delay="0.5">
<message msgID="str_level04_message00"/>
</dialogue>
</dialogues>
<path x="0" y="0">
<step direction="rightdown" distance="245"/>
<step direction="down" distance="220"/>
<step direction="rightdown" distance="85"/>
<step direction="right" distance="130"/>
<step direction="rightup" distance="135"/>
<step direction="up" distance="140"/>
<step direction="rightup" distance="135"/>
<step direction="right" distance="165"/>
</path>
<objects>
<object type="dir_rightdown" x="170" y="081"/>
<object type="dead_tree00" x="104" y="552"/>
<object type="fort01" x="630" y="473"/>
<object type="fort00" x="090" y="277"/>
<object type="rocks00" x="704" y="255"/>
<object type="rocks01" x="654" y="270"/>
<object type="rocks02" x="622" y="302"/>
<object type="rocks03" x="540" y="448"/>
<object type="rocks00" x="286" y="175"/>
</objects>
</level>
<!-- LEVEL 04 -->
<!-- LEVEL 05 -->
<level lives="150;100;100" gold="600;550;550" mana="175;175;150" overlay="level05_overlay" background="1">
<waves>
<wave start="8" delay="6" creeps="4;4;4;5;4;5;4;5"/>
<wave start="90" delay="4" creeps="4;4;5;4;5;4;4;5;5"/>
<wave start="180" delay="3" creeps="5;5;5;4;5;5;5;5;4;5;4;5;5"/>
<wave start="270" delay="3" creeps="5;5;4;5;5;5;4;5;4;5;5;4;5;4;5;4;5;5"/>
<wave start="370" delay="3" creeps="5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5"/>
<wave start="480" delay="2" creeps="5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5"/>
</waves>
<dialogues>
<dialogue delay="0.5">
<message msgID="str_level05_message00"/>
</dialogue>
</dialogues>
<path x="0" y="128">
<step direction="right" distance="180"/>
<step direction="rightdown" distance="130"/>
<step direction="down" distance="130"/>
<step direction="rightdown" distance="130"/>
<step direction="right" distance="125"/>
<step direction="rightup" distance="155"/>
<step direction="up" distance="180"/>
<step direction="rightup" distance="115"/>
<step direction="right" distance="80"/>
</path>
<objects>
<object type="dir_right" x="083" y="095"/>
<object type="stone" x="122" y="410"/>
<object type="rocks00" x="225" y="375"/>
<object type="rocks01" x="552" y="467"/>
<object type="tree00" x="344" y="116"/>
<object type="tree01" x="420" y="167"/>
<object type="tree02" x="467" y="124"/>
<object type="tree00" x="428" y="233"/>
<object type="tree04" x="464" y="313"/>
<object type="tree03" x="075" y="286"/>
<object type="tree00" x="531" y="119"/>
<object type="tree03" x="680" y="533"/>
<object type="tree02" x="168" y="555"/>
<object type="home01" x="156" y="432"/>
<object type="house00" x="632" y="524"/>
<object type="house00" x="214" y="072"/>
<object type="house00" x="272" y="084"/>
<object type="house00" x="350" y="150"/>
<object type="home01" x="472" y="160"/>
<object type="hill01" x="112" y="465"/>
<object type="plant0" x="153" y="326"/>
<object type="plant0" x="451" y="573"/>
</objects>
</level>
<!-- LEVEL 05 -->
<!-- LEVEL 06 -->
<level lives="150;100;100" gold="800;750;750" mana="150;150;150" overlay="level06_overlay" background="1">
<waves>
<wave start="8" delay="5" creeps="2;3;3;2;2;3;3;2"/>
<wave start="61" delay="4" creeps="3;2;2;3;3;6;3;2;7"/>
<wave start="140" delay="3" creeps="3;2;6;3;7;7;3;6;3;2;6;3;7"/>
<wave start="215" delay="3" creeps="6;6;3;7;6;3;7;3;2;7;7;6;7;2;7;3;3;7"/>
<wave start="300" delay="2" creeps="3;3;6;7;2;3;6;6;7;3;2;7;7;7;6;7;7;7;6;6;7"/>
<wave start="393" delay="1" creeps="3;7;7;6;3;6;3;3;6;3;3;6;6;6;7;7;7;7;7;7;7"/>
</waves>
<dialogues>
<dialogue delay="0.5">
<message msgID="str_level06_message00"/>
</dialogue>
</dialogues>
<path x="0" y="191">
<step direction="right" distance="195"/>
<step direction="rightdown" distance="125"/>
<step direction="down" distance="200"/>
<step direction="rightdown" distance="70"/>
<step direction="right" distance="130"/>
<step direction="rightup" distance="115"/>
<step direction="up" distance="215"/>
<step direction="rightup" distance="125"/>
<step direction="right" distance="110"/>
</path>
<objects>
<object type="dir_right" x="074" y="148"/>
<object type="tree00" x="102" y="401"/>
<object type="tree01" x="685" y="521"/>
<object type="tree02" x="140" y="475"/>
<object type="tree00" x="053" y="445"/>
<object type="hill00" x="419" y="080"/>
<object type="hill01" x="274" y="065"/>
<object type="hill01" x="060" y="485"/>
<object type="stone0" x="090" y="455"/>
<object type="stone0" x="092" y="538"/>
<object type="stone0" x="165" y="520"/>
<object type="skule00" x="680" y="097"/>
<object type="magic_tree00" x="335" y="168"/>
<object type="magic_tree00" x="439" y="162"/>
<object type="magic_tree01" x="405" y="233"/>
<object type="tree00" x="052" y="116"/>
<object type="tree01" x="120" y="118"/>
<object type="tree02" x="184" y="122"/>
<object type="tree03" x="268" y="118"/>
<object type="tree04" x="324" y="122"/>
<object type="tree00" x="385" y="121"/>
<object type="tree01" x="443" y="103"/>
<object type="tree02" x="072" y="099"/>
<object type="tree03" x="158" y="098"/>
<object type="tree04" x="249" y="077"/>
<object type="tree00" x="328" y="043"/>
<object type="tree01" x="378" y="079"/>
<object type="tree02" x="452" y="083"/>
<object type="tree03" x="492" y="084"/>
<object type="tree04" x="500" y="064"/>
<object type="tree00" x="554" y="060"/>
<object type="tree01" x="594" y="058"/>
<object type="tree02" x="620" y="063"/>
<object type="tree03" x="543" y="051"/>
<object type="tree04" x="232" y="106"/>
</objects>
</level>
<!-- LEVEL 06 -->
<!-- LEVEL 07 -->
<level lives="150;100;100" gold="800;750;750" mana="175;175;150" overlay="level07_overlay" background="1">
<waves>
<wave start="8" delay="5" creeps="4;4;4;5;4;5;4;5"/>
<wave start="88" delay="4" creeps="4;4;5;4;5;4;4;5;5"/>
<wave start="165" delay="3" creeps="5;5;5;5;5;5;5;5;5;5;5;5;5"/>
<wave start="270" delay="2" creeps="5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5"/>
<wave start="358" delay="2" creeps="5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5"/>
<wave start="461" delay="1" creeps="5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5;5"/>
</waves>
<path x="0" y="461">
<step direction="right" distance="510"/>
<step direction="rightup" distance="135"/>
<step direction="up" distance="155"/>
<step direction="leftup" distance="70"/>
<step direction="left" distance="170"/>
<step direction="leftup" distance="178"/>
</path>
<objects>
<object type="tree00" x="269" y="268"/>
<object type="tree04" x="334" y="317"/>
<object type="tree00" x="063" y="310"/>
<object type="tree03" x="137" y="348"/>
<object type="dir_right" x="060" y="402"/>
<object type="rocks00" x="627" y="545"/>
<object type="rocks02" x="679" y="486"/>
<object type="grass0" x="090" y="348"/>
<object type="grass1" x="122" y="070"/>
<object type="grass1" x="537" y="061"/>
<object type="grass1" x="400" y="348"/>
<object type="grass1" x="686" y="537"/>
<object type="grass1" x="615" y="081"/>
<object type="plant0" x="668" y="100"/>
<object type="grass1" x="714" y="078"/>
<object type="grass1" x="711" y="136"/>
<object type="ship_wreck" x="433" y="311"/>
<object type="magic_flower" x="174" y="153"/>
<object type="stolb" x="082" y="526"/>
<object type="stolb" x="122" y="526"/>
<object type="stolb" x="162" y="526"/>
<object type="anchor" x="376" y="338"/>
</objects>
</level>
<!-- LEVEL 07 -->
<!-- LEVEL 08 -->
<level lives="150;100;100" gold="800;750;750" mana="150;150;150" overlay="level08_overlay" background="1">
<waves>
<wave start="8" delay="5" creeps="2;3;3;2;2;3;3;2"/>
<wave start="61" delay="4" creeps="3;2;2;3;3;6;3;2;7"/>
<wave start="139" delay="3" creeps="3;2;6;3;7;7;3;6;3;2;6;3;7"/>
<wave start="210" delay="2" creeps="6;6;3;7;6;3;7;3;2;7;7;6;7;2;7;3;3;7"/>
<wave start="288" delay="2" creeps="3;3;6;7;2;3;6;6;7;3;2;7;7;7;6;7;7;7;6;6;7"/>
<wave start="357" delay="1" creeps="3;7;7;6;3;6;3;3;6;3;3;6;6;6;7;7;7;7;7;7;7"/>
</waves>
<path x="184" y="0">
<step direction="down" distance="223"/>
<step direction="rightdown" distance="138"/>
<step direction="down" distance="100"/>
<step direction="rightdown" distance="130"/>
<step direction="right" distance="115"/>
<step direction="rightup" distance="190"/>
<step direction="leftup" distance="178"/>
<step direction="rightup" distance="115"/>
<step direction="right" distance="130"/>
</path>
<objects>
<object type="dir_rightdown" x="246" y="212"/>
<object type="magic_tree00" x="067" y="538"/>
<object type="magic_tree00" x="113" y="528"/>
<object type="magic_tree00" x="072" y="461"/>
<object type="magic_tree00" x="168" y="530"/>
<object type="magic_tree00" x="140" y="436"/>
<object type="magic_tree00" x="078" y="383"/>
<object type="magic_tree00" x="078" y="383"/>
<object type="magic_tree00" x="030" y="385"/>
<object type="magic_tree00" x="128" y="351"/>
<object type="magic_tree00" x="107" y="571"/>
<object type="magic_tree00" x="038" y="567"/>
<object type="magic_tree00" x="299" y="096"/>
<object type="magic_tree00" x="340" y="074"/>
<object type="magic_tree00" x="425" y="066"/>
<object type="magic_tree00" x="484" y="093"/>
<object type="magic_tree00" x="619" y="075"/>
<object type="magic_tree00" x="683" y="079"/>
<object type="magic_tree00" x="665" y="532"/>
<object type="magic_tree00" x="694" y="532"/>
<object type="magic_flower" x="430" y="395"/>
<object type="crystal" x="389" y="155"/>
</objects>
</level>
<!-- LEVEL 08 -->
<!-- LEVEL 09 -->
<level lives="150;100;100" gold="1000;950;950" mana="150;150;150" overlay="level09_overlay" background="1">
<waves>
<wave start="8" delay="4" creeps="2;3;3;2;2;3;3;2"/>
<wave start="61" delay="3" creeps="3;2;2;3;3;6;3;2;7"/>
<wave start="134" delay="3" creeps="3;2;6;3;7;7;3;6;3;2;6;3;7"/>
<wave start="210" delay="2" creeps="6;6;3;7;6;3;7;3;7;7;7;6;7;2;7;3;3;7"/>
<wave start="288" delay="2" creeps="7;7;6;7;2;7;6;6;7;3;7;7;7;7;6;7;7;7;6;6;7"/>
<wave start="357" delay="1" creeps="7;7;7;7;7;7;7;7;7;7;7;7;7;7;7;7;7;7;7;7;7"/>
</waves>
<path x="0" y="183">
<step direction="rightdown" distance="195"/>
<step direction="down" distance="140"/>
<step direction="rightdown" distance="80"/>
<step direction="right" distance="180"/>
<step direction="rightup" distance="75"/>
<step direction="up" distance="215"/>
<step direction="rightup" distance="219"/>
<step direction="right" distance="138"/>
</path>
<objects>
<object type="dir_rightdown" x="123" y="214"/>
<object type="tree00" x="052" y="116"/>
<object type="tree01" x="120" y="118"/>
<object type="tree02" x="184" y="122"/>
<object type="tree03" x="268" y="118"/>
<object type="tree04" x="324" y="122"/>
<object type="tree00" x="385" y="121"/>
<object type="tree02" x="072" y="099"/>
<object type="tree03" x="158" y="098"/>
<object type="tree04" x="249" y="077"/>
<object type="tree00" x="328" y="043"/>
<object type="tree01" x="378" y="079"/>
<object type="magic_tree00" x="211" y="156"/>
<object type="magic_tree00" x="308" y="155"/>
<object type="magic_tree00" x="063" y="540"/>
<object type="magic_tree00" x="677" y="282"/>
<object type="magic_tree00" x="606" y="320"/>
<object type="magic_tree00" x="681" y="369"/>
<object type="magic_tree01" x="283" y="214"/>
<object type="well" x="280" y="337"/>
<object type="stone0" x="615" y="384"/>
<object type="stone0" x="627" y="226"/>
<object type="skull00" x="533" y="537"/>
<object type="sword" x="240" y="356"/>
<object type="skull02" x="262" y="366"/>
<object type="fort01" x="667" y="517"/>
</objects>
</level>
<!-- LEVEL 09 -->
<!-- LEVEL 10 -->
<level lives="150;100;100" gold="1000;950;950" mana="150;150;150" overlay="level10_overlay" background="1">
<waves>
<wave start="8" delay="4" creeps="2;3;3;2;2;3;3;2"/>
<wave start="61" delay="3" creeps="3;2;2;3;3;6;3;2;7"/>
<wave start="134" delay="3" creeps="3;2;6;3;7;7;3;6;3;2;6;3;7"/>
<wave start="210" delay="2" creeps="6;6;3;7;6;3;7;3;7;7;7;6;7;2;7;3;3;7"/>
<wave start="288" delay="2" creeps="7;7;6;7;2;7;6;6;7;3;7;7;7;7;6;7;7;7;6;6;7"/>
<wave start="357" delay="1" creeps="7;7;7;7;7;7;7;7;7;7;7;7;7;7;7;7;7;7;7;7;7"/>
<wave start="390" delay="0.5" creeps="7;7;7;7;7;7;7;7;7;7;7;7;7;7;7;7;7;7;7;7;7"/>
</waves>
<dialogues>
<dialogue delay="0.5">
<message msgID="str_level10_message00"/>
</dialogue>
</dialogues>
<path x="0" y="523">
<step direction="right" distance="180"/>
<step direction="rightup" distance="60"/>
<step direction="up" distance="227"/>
<step direction="rightup" distance="200"/>
<step direction="right" distance="55"/>
<step direction="rightdown" distance="153"/>
<step direction="down" distance="148"/>
<step direction="rightdown" distance="90"/>
<step direction="right" distance="140"/>
</path>
<objects>
<object type="magic_tree00" x="302" y="559"/>
<object type="magic_tree00" x="550" y="559"/>
<object type="magic_tree00" x="722" y="559"/>
<object type="magic_tree00" x="669" y="559"/>
<object type="magic_tree01" x="681" y="369"/>
<object type="magic_tree01" x="383" y="344"/>
<object type="fort00" x="064" y="242"/>
<object type="crystal" x="401" y="507"/>
<object type="house00" x="675" y="177"/>
<object type="house00" x="634" y="135"/>
<object type="house00" x="608" y="099"/>
<object type="house00" x="539" y="074"/>
<object type="tree01" x="120" y="118"/>
<object type="tree02" x="184" y="122"/>
<object type="tree03" x="268" y="118"/>
<object type="tree04" x="066" y="080"/>
<object type="tree00" x="126" y="083"/>
<object type="tree02" x="057" y="133"/>
<object type="dir_right" x="73" y="463"/>
<object type="skull01" x="80" y="278"/>
</objects>
</level>
<!-- LEVEL 10 -->
</levels>
</config>
;
private static var instance:Resources;
public function Resources(){
Pointer = mcPointer;
PauseButton = mcPauseButton;
SndOFF = mcSndOFF;
SndON = mcSndON;
level01_overlay = level1_overlay;
level02_overlay = level2_overlay;
level03_overlay = level3_overlay;
level04_overlay = level4_overlay;
level05_overlay = level5_overlay;
level06_overlay = level6_overlay;
level07_overlay = level7_overlay;
level08_overlay = level8_overlay;
level09_overlay = level9_overlay;
level10_overlay = level_10_overlay;
btnLevel0 = mcLevel0;
btnLevel1 = mcLevel1;
btnLevel2 = mcLevel2;
btnLevel3 = mcLevel3;
btnLevel4 = mcLevel4;
btnLevel5 = mcLevel5;
btnLevel6 = mcLevel6;
btnLevel7 = mcLevel7;
btnLevel8 = mcLevel8;
btnLevel9 = mcLevel9;
Soldier0 = mcSoldier0;
Soldier1 = mcSoldier1;
Soldier2 = mcSoldier2;
Soldier3 = mcSoldier3;
Soldier4 = mcSoldier4;
Soldier5 = mcSoldier5;
Soldier6 = mcSoldier6;
Soldier7 = mcSoldier7;
Tower0 = mcTower;
Tower1 = mcTower1;
Tower2 = mcTower2;
Tower3 = mcTower3;
btnTower0 = mcBtnTower0;
btnTower1 = mcBtnTower1;
btnTower2 = mcBtnTower2;
btnTower3 = mcBtnTower3;
btnMagic0 = mcMagic0;
btnMagic1 = mcMagic1;
btnMagic2 = mcMagic2;
btnMagic3 = mcMagic3;
Arrow = mcArrow;
Arrow1 = mcArrow1;
Arrow2 = mcArrow2;
Arrow3 = mcArrow3;
paramsTower0 = {nameID:"str_tower0", arrow:mcArrow, range:[100], delay:[0.4], damage:[0], cost:0};
paramsTower1 = {nameID:"str_tower1", arrow:mcArrow1, range:[100], delay:[0.4], damage:[0], cost:0};
paramsTower2 = {nameID:"str_tower2", arrow:mcFireStone, range:[100], delay:[0.4], damage:[0], cost:0};
paramsTower3 = {nameID:"str_tower3", arrow:mcArrow3, range:[100], delay:[0.4], damage:[0], cost:0};
paramsMagic0 = {nameID:"str_magic0", effect:mcArrows2, x:710, y:94};
paramsMagic1 = {nameID:"str_magic1", effect:mcStones2, x:710, y:206};
paramsMagic2 = {nameID:"str_magic2", effect:mcFireArrows2, x:710, y:318};
paramsMagic3 = {nameID:"str_magic3", effect:mcMagicArrow2, x:710, y:430};
flag_eng = Resources_flag_eng;
flag_rus = Resources_flag_rus;
flag_pol = Resources_flag_pol;
flag_fra = Resources_flag_fra;
flag_deu = Resources_flag_deu;
flag_ita = Resources_flag_ita;
flag_spa = Resources_flag_spa;
flag_por = Resources_flag_por;
flag_ara = Resources_flag_ara;
flag_heb = Resources_flag_heb;
flag_tur = Resources_flag_tur;
flag_chi = Resources_flag_chi;
flag_kor = Resources_flag_kor;
flag_jpn = Resources_flag_jpn;
xmlENG = <res>
<fmt id="fmt_small" font="Arkhive" embed="true" size="12" color="0x6E450C"/>
<fmt id="fmt_big" font="Arkhive" embed="true" size="30" color="0x6E450C" autosize="left"/>
<fmt id="fmt_submenu" font="Arkhive" embed="true" size="22" color="0x6E450C" autosize="left"/>
<fmt id="fmt_menu" font="Arkhive" embed="true" size="16" align="center" color="0x6E450C"/>
<fmt id="fmt_tooltip" font="Arkhive" embed="true" size="12" color="0x412607" align="left" glow="0xffffff;1;6;6;2" bold="true"/>
<fmt id="fmt_tooltip_btn" font="Arkhive" embed="true" size="12" color="0x412607" autosize="left" align="left" glow="0xffffff;1;6;6;2" bold="true"/>
<fmt id="fmt_tooltip2" font="Arkhive" embed="true" size="12" color="0x412607" align="left" glow="0xffffff;1;6;6;2" bold="true"/>
<fmt id="fmt_gold" font="Arial" embed="true" size="12" glow="0x412607;1;6;6;2" color="0xFACE8D" align="left" bold="true"/>
<fmt id="fmt_mana" font="Arial" embed="true" size="12" glow="0x412607;1;6;6;2" color="0x35C1FD" align="left" bold="true"/>
<fmt id="fmt_gold_red" font="Arial" embed="true" size="12" glow="0x412607;1;6;6;2" color="0xd82101" align="left" bold="true"/>
<fmt id="fmt_intro" font="Arkhive" embed="true" size="12" color="0x6E450C" multiline="true" autosize="center" width="240"/>
<btn id="btn_tower0" background="btnTower0" x="0" y="94"/>
<btn id="btn_tower1" background="btnTower1" x="0" y="206"/>
<btn id="btn_tower2" background="btnTower2" x="0" y="318"/>
<btn id="btn_tower3" background="btnTower3" x="0" y="430"/>
<btn id="btn_level0" background="btnLevel0" x="148" y="306"/>
<btn id="btn_level1" background="btnLevel1" x="175" y="195"/>
<btn id="btn_level2" background="btnLevel2" x="307" y="144"/>
<btn id="btn_level3" background="btnLevel3" x="436" y="165"/>
<btn id="btn_level4" background="btnLevel4" x="562" y="165"/>
<btn id="btn_level5" background="btnLevel5" x="465" y="264"/>
<btn id="btn_level6" background="btnLevel6" x="307" y="225"/>
<btn id="btn_level7" background="btnLevel7" x="275" y="335"/>
<btn id="btn_level8" background="btnLevel8" x="415" y="360"/>
<btn id="btn_level9" background="btnLevel9" x="550" y="365"/>
<btn id="btn_play" fmtID="fmt_big" width="300" height="40" x="75" y="230">Play</btn>
<btn id="btn_rules" fmtID="fmt_big" width="300" height="40" x="75" y="280">Instructions</btn>
<btn id="btn_musicON" fmtID="fmt_big" width="300" height="40" x="75" y="330">Music ON</btn>
<btn id="btn_musicOFF" fmtID="fmt_big" width="300" height="40" x="75" y="330">Music OFF</btn>
<btn id="btn_leaders" fmtID="fmt_big" width="300" height="40" x="75" y="380">Leaders</btn>
<btn id="btn_upgrade" fmtID="fmt_tooltip_btn" centerText="false" width="45" height="20" x="100" y="104">Buy</btn>
<btn id="btn_play_easy" fmtID="fmt_submenu" width="300" height="35" x="75" y="230">Easy</btn>
<btn id="btn_play_normal" fmtID="fmt_submenu" width="300" height="35" x="75" y="230">Normal</btn>
<btn id="btn_play_hard" fmtID="fmt_submenu" width="300" height="35" x="75" y="230">Hard</btn>
<btn id="btn_sell" fmtID="fmt_tooltip_btn" centerText="false" width="45" height="20" x="100" y="128">Sell</btn>
<btn id="btn_menu" fmtID="fmt_menu" x="50" y="2" width="85" height="25">Menu</btn>
<btn id="btn_pause" x="170" y="7" background="PauseButton"/>
<btn id="btn_sndOFF" x="200" y="3" background="SndOFF"/>
<btn id="btn_sndON" x="200" y="3" background="SndON"/>
<btn id="btn_intro" fmtID="fmt_intro" x="165" y="135" width="240" height="120">intro text</btn>
<btn id="btn_rules_close" fmtID="fmt_big" width="220" height="40" x="-140" y="210">Close</btn>
<txt id="txt_tooltip_label" fmtID="fmt_tooltip" x="35" y="5" width="110"/>
<txt id="txt_tooltip_damage" fmtID="fmt_tooltip2" font="Arial" x="60" y="33" width="40">15</txt>
<txt id="txt_tooltip_delay" fmtID="fmt_tooltip2" font="Arial" x="60" y="57" width="40">0.4</txt>
<txt id="txt_tooltip_range" fmtID="fmt_tooltip2" font="Arial" x="60" y="81" width="40">110</txt>
<txt id="txt_tooltip_upgrade" fmtID="fmt_gold" x="60" y="105" width="40">125●</txt>
<txt id="txt_tooltip_sell" fmtID="fmt_gold" x="60" y="129" width="40">25●</txt>
<txt id="txt_timer" fmtID="fmt_menu" font="Arial" x="285" y="5" width="60">00:00</txt>
<txt id="txt_gold" fmtID="fmt_gold" x="405" size="14" y="5" width="60">25●</txt>
<txt id="txt_mana" fmtID="fmt_mana" x="515" size="14" y="5" width="60">0♦</txt>
<txt id="txt_lives" fmtID="fmt_menu" font="Arial" x="625" y="5" width="60">100</txt>
<txt id="txt_message" fmtID="fmt_small" x="150" y="458" width="525" multiline="true" autosize="center"/>
<txt id="txt_egp_title" fmtID="fmt_menu" size="18" x="225" y="145" width="300" autosize="none"/>
<txt id="txt_egp_stat" fmtID="fmt_menu" align="left" x="225" y="210" width="145" autosize="none"/>
<txt id="txt_egp_value" fmtID="fmt_menu" align="right" font="Arial" x="375" y="214" width="160" autosize="none"/>
<txt id="txt_rules1" fmtID="fmt_small" multiline="false" width="335" height="110" x="-80" y="-95">Test1</txt>
<txt id="txt_rules2" fmtID="fmt_small" multiline="true" autosize="center" width="335" x="-80" y="40">Test2</txt>
<txt id="txt_rules3" fmtID="fmt_small" size="10" multiline="true" autosize="center" width="160" x="-183" y="-205">GUI</txt>
<txt id="txt_paused" fmtID="fmt_big" multiline="true" autosize="center" width="260" x="250" y="215">PAUSED\nClick to continue...</txt>
<txt id="txt_rules_header" fmtID="fmt_big" width="220" autosize="center" height="40" x="-155" y="-260">Tutorial</txt>
<str id="str_egp_title_win">Level complete!</str>
<str id="str_egp_title_loose">Game over!</str>
<str id="str_egp_title_end">Game complete!</str>
<str id="str_egp_score">Score:</str>
<str id="str_egp_lives">Lives:</str>
<str id="str_egp_gold">Gold:</str>
<str id="str_egp_mana">Mana:</str>
<str id="str_egp_total">Total:</str>
<str id="str_tower0">Wooden Tower</str>
<str id="str_tower1">Stone Tower</str>
<str id="str_tower2">Fire Tower</str>
<str id="str_tower3">Magic Tower</str>
<str id="str_magic0">A shower of arrows</str>
<str id="str_magic1">Stone rain</str>
<str id="str_magic2">Fiery Arrows</str>
<str id="str_magic3">Magic blow</str>
<str id="str_descr_tower0">The “Wooden tower” has a high-speed shots and a large radius of the attack, but low damage to the enemy force. It has three levels of upgrade.</str>
<str id="str_descr_tower1">The “Stone tower” does not have large radius of the attack, but has high damage power for the enemy. It has three levels of upgrade.</str>
<str id="str_descr_tower2">“Fire tower” fires burning tar, which gives the maximum damage to the enemy, but has a small radius of action. It has three levels of upgrade.</str>
<str id="str_descr_tower3">Magic Tower is effective against the army of demons, which shoots magic ball. It has three levels of upgrade.</str>
<str id="str_descr_magic0">“A shower of arrows” is prepared from rare species of trees, using the oldest Amazons spells. This potion makes a shower of arrows from the sky and helps to destroy the enemy forces.</str>
<str id="str_descr_magic1">“Stone rain“ is prepared from components of the volcano’s lava, according the recipes that are stored in the ancient Amazons books. This potion makes a stone rain from the sky and helps to destroy the enemy forces.</str>
<str id="str_descr_magic2">“Fiery Arrows“ prepared according a special recipe of the Amazons, that concludes poisons of the most venomous snakes from around the world. This potion makes a fiery arrows rain from the sky and helps to destroy the enemy forces.</str>
<str id="str_descr_magic3">“Magic blow” is prepared on the basis of ancient spells and herbs growing on the Amazons lands. This is the most powerful potion, which will destroy the monsters.</str>
<str id="str_gui_tower">Build towers along roads, as well as in places in which the radius of the towers shoot will be the largest. Do not forget to update the towers so that they become more effective.</str>
<str id="str_gui_gold">Keep track of the amount of gold in the game, which is necessary to build more towers.</str>
<str id="str_gui_waves">The given parametre shows quantity of waves of soldiers and monsters at level, and also how many waves of soldiers or monsters have already passed.</str>
<str id="str_gui_lives">Keep track of the number of lives. Each monster breaking through the defenses, or a soldier, take a little of your blood.</str>
<str id="str_gui_mana">The Killing of every soldier or a monster adds magic to you, which is needed for the old spell.</str>
<str id="str_gui_magic">Use ancient spells in an emergency order when soldiers or monsters have almost broken through your defenses.</str>
<str id="str_intro1">Ares’ Troops have been trying to conquer the Amazons land for a long time. This time Ares gathered a really large army, not only soldiers, but also the demons from the hell !!!</str>
<str id="str_intro2">Ares, though the son of the god of war, is not omnipotent! Amazons never bow to anyone, do not lay down their weapons and do not leave their land! And I, The leader of the Amazons, better die but drive out army of Ares soldiers and the demons out of my possession! FORWARD !!</str>
<str id="str_level01_message00">Enemies are nearby. We must build a wooden tower, which can be modernized during the battle.</str>
<str id="str_level01_message01">Keep the enemies; do not let them go the entire route of the road. You have a limited number of lives!</str>
<str id="str_level01_message02">Destruction of each soldier adds magic to you.</str>
<str id="str_level01_message03">Use ancient spells to destroy enemies.</str>
<str id="str_level02_message00">The Ares Troops used not only infantry, but also ships to grab the land. You should be vigilant and careful!</str>
<str id="str_level03_message00">The enemy is too close. Do not forget the magic that we can use.</str>
<str id="str_level04_message00">We drove the enemy not far enough from our lands. It will be harder to fight monsters in the desert.</str>
<str id="str_level05_message00">Ares's army maneuvering and strengthen it's naval force! Carefully choose tactics to destroy them!</str>
<str id="str_level06_message00">Oh, God! Enemies army almost broke through the defenses at the mouth of a mountain! Gather all the forces to repel!</str>
<str id="str_level10_message00">You must collect the last forces and inflict the final blow to the enemy. Discourage attacks on our land forever!!!</str>
</res>
;
xmlRUS = <res>
<fmt id="fmt_small" font="Arkhive" embed="true" size="12" color="0x6E450C"/>
<fmt id="fmt_big" font="Arkhive" embed="true" size="30" color="0x6E450C" autosize="left"/>
<fmt id="fmt_submenu" font="Arkhive" embed="true" size="22" color="0x6E450C" autosize="left"/>
<fmt id="fmt_menu" font="Arkhive" embed="true" size="16" align="center" color="0x6E450C"/>
<fmt id="fmt_tooltip" font="Arkhive" embed="true" size="12" color="0x412607" align="left" glow="0xffffff;1;6;6;2" bold="true"/>
<fmt id="fmt_tooltip_btn" font="Arkhive" embed="true" size="12" color="0x412607" autosize="left" align="left" glow="0xffffff;1;6;6;2" bold="true"/>
<fmt id="fmt_tooltip2" font="Arkhive" embed="true" size="12" color="0x412607" align="left" glow="0xffffff;1;6;6;2" bold="true"/>
<fmt id="fmt_gold" font="Arial" embed="true" size="12" glow="0x412607;1;6;6;2" color="0xFACE8D" align="left" bold="true"/>
<fmt id="fmt_mana" font="Arial" embed="true" size="12" glow="0x412607;1;6;6;2" color="0x35C1FD" align="left" bold="true"/>
<fmt id="fmt_gold_red" font="Arial" embed="true" size="12" glow="0x412607;1;6;6;2" color="0xd82101" align="left" bold="true"/>
<fmt id="fmt_intro" font="Arkhive" embed="true" size="12" color="0x6E450C" multiline="true" autosize="center" width="240"/>
<btn id="btn_tower0" background="btnTower0" x="0" y="94"/>
<btn id="btn_tower1" background="btnTower1" x="0" y="206"/>
<btn id="btn_tower2" background="btnTower2" x="0" y="318"/>
<btn id="btn_tower3" background="btnTower3" x="0" y="430"/>
<btn id="btn_level0" background="btnLevel0" x="148" y="306"/>
<btn id="btn_level1" background="btnLevel1" x="175" y="195"/>
<btn id="btn_level2" background="btnLevel2" x="307" y="144"/>
<btn id="btn_level3" background="btnLevel3" x="436" y="165"/>
<btn id="btn_level4" background="btnLevel4" x="562" y="165"/>
<btn id="btn_level5" background="btnLevel5" x="465" y="264"/>
<btn id="btn_level6" background="btnLevel6" x="307" y="225"/>
<btn id="btn_level7" background="btnLevel7" x="275" y="335"/>
<btn id="btn_level8" background="btnLevel8" x="415" y="360"/>
<btn id="btn_level9" background="btnLevel9" x="550" y="365"/>
<btn id="btn_play" fmtID="fmt_big" width="300" height="40" x="75" y="230">Играть</btn>
<btn id="btn_rules" fmtID="fmt_big" width="300" height="40" x="75" y="280">Инструкции</btn>
<btn id="btn_musicON" fmtID="fmt_big" width="300" height="40" x="75" y="330">Музыка ВКЛ.</btn>
<btn id="btn_musicOFF" fmtID="fmt_big" width="300" height="40" x="75" y="330">Музыка ВЫКЛ.</btn>
<btn id="btn_leaders" fmtID="fmt_big" width="300" height="40" x="75" y="380">Лидеры</btn>
<btn id="btn_upgrade" fmtID="fmt_tooltip_btn" centerText="false" width="45" height="20" x="100" y="104">Купить</btn>
<btn id="btn_play_easy" fmtID="fmt_submenu" width="300" height="35" x="75" y="230">Легко</btn>
<btn id="btn_play_normal" fmtID="fmt_submenu" width="300" height="35" x="75" y="230">Нормально</btn>
<btn id="btn_play_hard" fmtID="fmt_submenu" width="300" height="35" x="75" y="230">Тяжело</btn>
<btn id="btn_sell" fmtID="fmt_tooltip_btn" centerText="false" width="45" height="20" x="100" y="128">Продать</btn>
<btn id="btn_menu" fmtID="fmt_menu" x="50" y="2" width="85" height="25">Меню</btn>
<btn id="btn_pause" x="170" y="7" background="PauseButton"/>
<btn id="btn_sndOFF" x="200" y="3" background="SndOFF"/>
<btn id="btn_sndON" x="200" y="3" background="SndON"/>
<btn id="btn_intro" fmtID="fmt_intro" x="165" y="135" width="240" height="120">intro text</btn>
<btn id="btn_rules_close" fmtID="fmt_big" width="220" height="40" x="-140" y="210">Закрыть</btn>
<txt id="txt_tooltip_label" fmtID="fmt_tooltip" x="35" y="5" width="110"/>
<txt id="txt_tooltip_damage" fmtID="fmt_tooltip2" font="Arial" x="60" y="33" width="40">15</txt>
<txt id="txt_tooltip_delay" fmtID="fmt_tooltip2" font="Arial" x="60" y="57" width="40">0.4</txt>
<txt id="txt_tooltip_range" fmtID="fmt_tooltip2" font="Arial" x="60" y="81" width="40">110</txt>
<txt id="txt_tooltip_upgrade" fmtID="fmt_gold" x="60" y="105" width="40">125●</txt>
<txt id="txt_tooltip_sell" fmtID="fmt_gold" x="60" y="129" width="40">25●</txt>
<txt id="txt_timer" fmtID="fmt_menu" font="Arial" x="285" y="5" width="60">00:00</txt>
<txt id="txt_gold" fmtID="fmt_gold" x="405" size="14" y="5" width="60">25●</txt>
<txt id="txt_mana" fmtID="fmt_mana" x="515" size="14" y="5" width="60">0♦</txt>
<txt id="txt_lives" fmtID="fmt_menu" font="Arial" x="625" y="5" width="60">100</txt>
<txt id="txt_message" fmtID="fmt_small" x="150" y="458" width="525" multiline="true" autosize="center"/>
<txt id="txt_egp_title" fmtID="fmt_menu" size="18" x="225" y="145" width="300" autosize="none"/>
<txt id="txt_egp_stat" fmtID="fmt_menu" align="left" x="225" y="210" width="145" autosize="none"/>
<txt id="txt_egp_value" fmtID="fmt_menu" align="right" font="Arial" x="375" y="214" width="160" autosize="none"/>
<txt id="txt_rules1" fmtID="fmt_small" multiline="false" width="335" height="110" x="-80" y="-95">Test1</txt>
<txt id="txt_rules2" fmtID="fmt_small" multiline="true" autosize="center" width="335" x="-80" y="40">Test2</txt>
<txt id="txt_rules3" fmtID="fmt_small" size="10" multiline="true" autosize="center" width="160" x="-183" y="-205">GUI</txt>
<txt id="txt_paused" fmtID="fmt_big" multiline="true" autosize="center" width="260" x="250" y="215">ПАУЗА\nНажмите для продолжения...</txt>
<txt id="txt_rules_header" fmtID="fmt_big" width="220" autosize="center" height="40" x="-155" y="-260">Правила</txt>
<str id="str_egp_title_win">Уровень пройден!</str>
<str id="str_egp_title_loose">Вы проиграли!</str>
<str id="str_egp_title_end">Игра закончена!</str>
<str id="str_egp_score">Очки:</str>
<str id="str_egp_lives">Жизни:</str>
<str id="str_egp_gold">Золото:</str>
<str id="str_egp_mana">Мана:</str>
<str id="str_egp_total">Всего:</str>
<str id="str_tower0">Деревянная Башня</str>
<str id="str_tower1">Каменная Башня</str>
<str id="str_tower2">Огненная Башня</str>
<str id="str_tower3">Магическая Башня</str>
<str id="str_magic0">Ливень стрел</str>
<str id="str_magic1">Каменный дождь</str>
<str id="str_magic2">Огненные стрелы</str>
<str id="str_magic3">Магический удар</str>
<str id="str_descr_tower0">Деревянная башня имеет высокую скорость выстрела и большой радиус атаки, но невысокую силу повреждения противника. Имеет три уровня обновления.</str>
<str id="str_descr_tower1">Каменная башня имеет не большой радиус атаки, но высокую силу повреждения противника. Имеет три уровня обновления.</str>
<str id="str_descr_tower2">Огненная башня стреляет горящей смолой, которое дает максимальное повреждение противнику, но имеет небольшой радиус действия. Имеет три уровня обновления.</str>
<str id="str_descr_tower3">Магическая башня эффективна против армии демонов, которая стреляет по противнику магическим шаром. Имеет три уровня обновления.</str>
<str id="str_descr_magic0">“Ливень стрел” приготовлен из редких пород деревьев, с применением самых старых заклинаний Амазонок. Данное зелье вызывает ливень стрел с неба и поможет уничтожить войска противника.</str>
<str id="str_descr_magic1">“Каменный дождь” приготовлен из компонентов лавы вулкана, рецепты которые хранятся в древних книгах Амазонок. . Данное зелье вызывает каменный дождь с неба и поможет уничтожить войска противника.</str>
<str id="str_descr_magic2">“Огненный стрелы “ приготовлено по особой рецептуре Амазонок из ядов самых ядовитых змей со всего мира. Данное зелье вызывает с неба огненные стрелы которые помогут уничтожить войска противника.</str>
<str id="str_descr_magic3">“Магический удар “ приготовлен на основе древних заклинаний и трав растущих на землях Амазонок. Это самое сильное зелье, которое уничтожит монстров.</str>
<str id="str_gui_tower">Стройте башни около дорог, а также в таких местах в которых радиус действия башен будет самым большим. Не забывайте делать обновление башен, для того чтоб они становились более эффективней.</str>
<str id="str_gui_gold">Следите за количеством золота в игре, которая необходима для строительства башен.</str>
<str id="str_gui_waves">Данный параметр показывает количество волн на уровней, а также сколько волн солдат или монстров уже прошло.</str>
<str id="str_gui_lives">Следите за количеством жизни. Каждый прорвавший оборону монстр или солдат, делает меньше ваши шансы пройти игру.</str>
<str id="str_gui_mana">Уничтожение каждого солдата или монстра прибавляет Вам магии, которая нужна для старинных заклинаний.</str>
<str id="str_gui_magic">Используйте старинные заклинания в экстренных целях, когда солдаты или монстры почти прорвали Вашу оборону.</str>
<str id="str_intro1">Войска Ареса давно пытались отвоевать замели Амазонок. В этот раз Арес собрал поистенне большую армию не только солдат, но и демонов с ада.</str>
<str id="str_intro2">Никогда земли на которых живут и процветают женщины Амазонки не склонят свои головы над Аресом – сыном бога войны. И я предводительница Амазонок любой ценой прогоним армию солдат и демонов от своих владений! Вперед!</str>
<str id="str_level01_message00">Враги совсем рядом. Мы должны построить деревянную башню, которую можем модернизировать во время сражения. </str>
<str id="str_level01_message01">Любой ценой нужно сдержать натиск врага, не дав пройти весь маршрут дороги. У тебя ограниченное количество жизней!</str>
<str id="str_level01_message02">Уничтожение каждого солдата дает прибавляет Вам магии.</str>
<str id="str_level01_message03">Воспользуйтесь старинными заклинаниями для уничтожения врагов.</str>
<str id="str_level02_message00">Войска Ареса используют не только пехоту, но и корабли для захвата земли. Нужно быть бдительным и внимательным!</str>
<str id="str_level03_message00">Войска противника слишком близко. Нельзя забывать про магию которую мы можем использовать.</str>
<str id="str_level04_message00">Мы отогнали противника не достаточно далеко от своих в земель. В пустыне будет сложней сражаться с монстрами. </str>
<str id="str_level05_message00">Армия Ареса маневрирует усиливая свои войска кораблей! Для уничтожение кораблей выберете самую правильную тактику!</str>
<str id="str_level06_message00">О, боже! Армия врагов практически прорвало оборону на у устье гор! Соберите все силы чтоб дать отпор! </str>
<str id="str_level10_message00">Необходимо собрать последние силы И нанести окончательный удар по противнику. Раз и навсегда отбить желание нападать на наши земли! </str>
</res>
;
super();
}
public static function getInstance():Resources{
if (instance == null){
instance = new (Resources);
};
return (instance);
}
}
}//package
Section 155
//Resources__arial_fnt (Resources__arial_fnt)
package {
import mx.core.*;
public class Resources__arial_fnt extends FontAsset {
}
}//package
Section 156
//Resources__arkhive_fnt (Resources__arkhive_fnt)
package {
import mx.core.*;
public class Resources__arkhive_fnt extends FontAsset {
}
}//package
Section 157
//Resources_flag_ara (Resources_flag_ara)
package {
import mx.core.*;
public class Resources_flag_ara extends BitmapAsset {
}
}//package
Section 158
//Resources_flag_chi (Resources_flag_chi)
package {
import mx.core.*;
public class Resources_flag_chi extends BitmapAsset {
}
}//package
Section 159
//Resources_flag_deu (Resources_flag_deu)
package {
import mx.core.*;
public class Resources_flag_deu extends BitmapAsset {
}
}//package
Section 160
//Resources_flag_eng (Resources_flag_eng)
package {
import mx.core.*;
public class Resources_flag_eng extends BitmapAsset {
}
}//package
Section 161
//Resources_flag_fra (Resources_flag_fra)
package {
import mx.core.*;
public class Resources_flag_fra extends BitmapAsset {
}
}//package
Section 162
//Resources_flag_heb (Resources_flag_heb)
package {
import mx.core.*;
public class Resources_flag_heb extends BitmapAsset {
}
}//package
Section 163
//Resources_flag_ita (Resources_flag_ita)
package {
import mx.core.*;
public class Resources_flag_ita extends BitmapAsset {
}
}//package
Section 164
//Resources_flag_jpn (Resources_flag_jpn)
package {
import mx.core.*;
public class Resources_flag_jpn extends BitmapAsset {
}
}//package
Section 165
//Resources_flag_kor (Resources_flag_kor)
package {
import mx.core.*;
public class Resources_flag_kor extends BitmapAsset {
}
}//package
Section 166
//Resources_flag_pol (Resources_flag_pol)
package {
import mx.core.*;
public class Resources_flag_pol extends BitmapAsset {
}
}//package
Section 167
//Resources_flag_por (Resources_flag_por)
package {
import mx.core.*;
public class Resources_flag_por extends BitmapAsset {
}
}//package
Section 168
//Resources_flag_rus (Resources_flag_rus)
package {
import mx.core.*;
public class Resources_flag_rus extends BitmapAsset {
}
}//package
Section 169
//Resources_flag_spa (Resources_flag_spa)
package {
import mx.core.*;
public class Resources_flag_spa extends BitmapAsset {
}
}//package
Section 170
//Resources_flag_tur (Resources_flag_tur)
package {
import mx.core.*;
public class Resources_flag_tur extends BitmapAsset {
}
}//package
Section 171
//RulesGFX (RulesGFX)
package {
import flash.events.*;
import com.onlinegamestars.ender.xmlui.*;
import flash.media.*;
import flash.display.*;
import flash.filters.*;
import flash.utils.*;
import flash.geom.*;
import flash.text.*;
import flash.system.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class RulesGFX extends MovieClip {
public var magic2:mcMagic1;
public var magic1:mcMagic0;
public var magic3:mcMagic2;
public var magic4:mcMagic3;
public var btnNext:SimpleButton;
public var text2:MovieClip;
public var btnPrev:SimpleButton;
public var txtRules1;
public var text1:MovieClip;
public var txtRules2;
public var txtGUI1;
public var txtGUI2;
public function RulesGFX(){
addFrameScript(0, frame1, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9);
}
function frame3(){
stop();
txtGUI1.text = XMLUI.getData("str_gui_tower").text;
txtGUI2.text = XMLUI.getData("str_gui_gold").text;
txtRules1.visible = false;
txtRules2.visible = false;
text1.visible = true;
text2.visible = true;
}
function frame6(){
stop();
txtRules1.text = XMLUI.getData("str_descr_tower0").text;
txtRules2.text = XMLUI.getData("str_descr_tower1").text;
txtRules1.visible = true;
txtRules2.visible = true;
text1.visible = false;
text2.visible = false;
}
function frame7(){
stop();
txtRules1.text = XMLUI.getData("str_descr_tower2").text;
txtRules2.text = XMLUI.getData("str_descr_tower3").text;
txtRules1.visible = true;
txtRules2.visible = true;
text1.visible = false;
text2.visible = false;
}
function frame1(){
btnPrev.addEventListener(MouseEvent.CLICK, onPrev);
btnNext.addEventListener(MouseEvent.CLICK, onNext);
txtRules1 = XMLUI.newText("txt_rules1");
txtRules2 = XMLUI.newText("txt_rules2");
txtGUI1 = XMLUI.newText("txt_rules3");
txtGUI2 = XMLUI.newText("txt_rules3");
addChild(txtRules1);
addChild(txtRules2);
text1.addChild(txtGUI1);
text2.addChild(txtGUI2);
}
function frame9(){
stop();
magic3.back.visible = false;
magic4.back.visible = false;
txtRules1.text = XMLUI.getData("str_descr_magic2").text;
txtRules2.text = XMLUI.getData("str_descr_magic3").text;
txtRules1.visible = true;
txtRules2.visible = true;
text1.visible = false;
text2.visible = false;
}
function frame4(){
stop();
txtGUI1.text = XMLUI.getData("str_gui_waves").text;
txtGUI2.text = XMLUI.getData("str_gui_lives").text;
txtRules1.visible = false;
txtRules2.visible = false;
text1.visible = true;
text2.visible = true;
}
public function onNext(_arg1:MouseEvent):void{
nextFrame();
}
function frame5(){
stop();
txtGUI1.text = XMLUI.getData("str_gui_mana").text;
txtGUI2.text = XMLUI.getData("str_gui_magic").text;
txtRules1.visible = false;
txtRules2.visible = false;
text1.visible = true;
text2.visible = true;
}
function frame8(){
stop();
magic1.back.visible = false;
magic2.back.visible = false;
txtRules1.text = XMLUI.getData("str_descr_magic0").text;
txtRules2.text = XMLUI.getData("str_descr_magic1").text;
txtRules1.visible = true;
txtRules2.visible = true;
text1.visible = false;
text2.visible = false;
}
public function onPrev(_arg1:MouseEvent):void{
if (currentFrame > 3){
gotoAndPlay((currentFrame - 1));
};
}
}
}//package
Section 172
//Soldier (Soldier)
package {
import flash.events.*;
import caurina.transitions.*;
import flash.display.*;
import flash.utils.*;
public class Soldier extends Sprite {
private var soldier:MovieClip;
private var rightdownFrames:Array;
private var leftFrames:Array;
private var _plan:Array;
public var _healthBar:healthBar;
public var id:uint;
public var _damage:int;
private var upFrames:Array;
public var steps:Number;// = 0.1
private var leftupFrames:Array;
private var _time:Number;
private var leftdownFrames:Array;
public var potential_damage:Number;// = 0
public var type:String;
private var rightupFrames:Array;
public var speed:Number;// = 30
private var scale:Number;// = 0.3
public var mana:Number;
private var skips:Number;
public var health:Number;// = 100
public var maxHealth:Number;// = 100
private var rightFrames:Array;
public var gold:Number;
private var downFrames:Array;
public var frame:Number;
public var distance:Number;// = 0
public var lastFrame:int;
public static var soldiers:Array = [];
private static var nextID:uint = 0;
public function Soldier(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:int, _arg7:Number=0){
downFrames = [3, 4];
upFrames = [1, 2];
leftFrames = [9, 10, 11, 12, 13, 14, 15, 16];
rightFrames = [9, 10, 11, 12, 13, 14, 15, 16];
rightdownFrames = [7, 8];
leftdownFrames = [7, 8];
rightupFrames = [5, 6];
leftupFrames = [5, 6];
_healthBar = new healthBar();
super();
_plan = [];
this.speed = _arg3;
this.health = _arg2;
this.gold = _arg4;
this.mana = _arg5;
this._damage = _arg6;
this.skips = _arg7;
this.type = _arg1;
id = nextID;
nextID++;
soldiers.push(this);
maxHealth = _arg2;
soldier = new (Resources.getInstance()[_arg1]);
soldier.stop();
scaleY = scale;
scaleX = scale;
if (_arg1 == "Soldier2"){
soldier.scaleX = (soldier.scaleY = 1.1);
};
if ((((_arg1 == "Soldier6")) || ((_arg1 == "Soldier7")))){
soldier.scaleX = (soldier.scaleY = 1.15);
};
if (_arg1 == "Soldier3"){
soldier.scaleX = (soldier.scaleY = 1.25);
};
if ((((_arg1 == "Soldier4")) || ((_arg1 == "Soldier5")))){
soldier.scaleX = (soldier.scaleY = 1.3);
};
addChild(soldier);
addChild(_healthBar);
}
public function remove():void{
Tweener.removeTweens(this);
_plan = [];
var _local1:int = soldiers.indexOf(this);
if (_local1 >= 0){
soldiers.splice(_local1, 1);
};
}
public function plan(_arg1:String="down", _arg2:Number=200):void{
_plan.push([_arg1, _arg2]);
}
private function onComplete():void{
if (_plan.length > 0){
_plan.shift();
};
if (_plan.length > 0){
move(_plan[0][0], _plan[0][1]);
} else {
dispatchEvent(new Event("COMPLETE"));
_plan = [];
Tweener.removeTweens(this);
};
}
private function update(_arg1:String="down"):void{
var _local2:Array;
distance = ((getTimer() - _time) * speed);
if (int(frame) != lastFrame){
lastFrame = int(frame);
_local2 = this[(_arg1 + "Frames")];
soldier.gotoAndStop(_local2[(lastFrame % _local2.length)]);
};
_healthBar.scaleX = ((soldier.scaleX * health) / maxHealth);
_healthBar.y = (-180 * soldier.scaleY);
if ((((((type == "Soldier4")) || ((type == "Soldier5")))) && ((((_arg1 == "down")) || ((_arg1 == "up")))))){
_healthBar.y = (_healthBar.y + 60);
};
}
public function move(_arg1:String="down", _arg2:Number=200, _arg3:int=0):void{
var _local4:Object;
lastFrame = (frame = Math.floor((Math.random() * this[(_arg1 + "Frames")].length)));
_local4 = {delay:_arg3, time:(_arg2 / speed), frame:((this[(_arg1 + "Frames")].length * steps) * _arg2), onUpdateParams:[_arg1], onUpdate:update, skipUpdates:skips, transition:"linear", onComplete:onComplete};
soldier.gotoAndStop(this[(_arg1 + "Frames")][0]);
soldier.scaleX = Math.abs(soldier.scaleX);
switch (_arg1){
case "down":
_local4.y = (y + _arg2);
break;
case "up":
_local4.y = (y - _arg2);
break;
case "left":
soldier.scaleX = (-1 * Math.abs(soldier.scaleX));
_local4.frame = (_local4.frame / 2.5);
_local4.x = (x - _arg2);
break;
case "right":
_local4.frame = (_local4.frame / 2.5);
_local4.x = (x + _arg2);
break;
case "rightdown":
_local4.x = (x + (_arg2 * Math.SQRT1_2));
_local4.y = (y + (_arg2 * Math.SQRT1_2));
break;
case "leftdown":
soldier.scaleX = (-1 * Math.abs(soldier.scaleX));
_local4.x = (x - (_arg2 * Math.SQRT1_2));
_local4.y = (y + (_arg2 * Math.SQRT1_2));
break;
case "rightup":
_local4.x = (x + (_arg2 * Math.SQRT1_2));
_local4.y = (y - (_arg2 * Math.SQRT1_2));
break;
case "leftup":
soldier.scaleX = (-1 * Math.abs(soldier.scaleX));
_local4.x = (x - (_arg2 * Math.SQRT1_2));
_local4.y = (y - (_arg2 * Math.SQRT1_2));
break;
};
Tweener.addTween(this, _local4);
}
public function start():void{
if (_plan.length > 0){
move(_plan[0][0], _plan[0][1]);
};
_time = getTimer();
}
public function damage(_arg1:Number=0):void{
var _local3:Class;
health = (health - _arg1);
potential_damage = (potential_damage - _arg1);
var _local2:int;
while (numChildren > 2) {
if ((((getChildAt(_local2) == soldier)) || ((getChildAt(_local2) == _healthBar)))){
_local2++;
} else {
removeChildAt(_local2);
};
};
if (health <= 0){
remove();
dispatchEvent(new Event("DEAD"));
switch (type){
case "Soldier0":
case "Soldier1":
_local3 = MusicLibrary.DeadMonstro;
break;
case "Soldier4":
_local3 = MusicLibrary.DeadSmallShip;
break;
case "Soldier5":
_local3 = MusicLibrary.DeadBigShip;
break;
case "Soldier2":
case "Soldier3":
case "Soldier6":
case "Soldier7":
_local3 = MusicLibrary.DeadSoldier;
break;
};
MusicLibrary.playSound(_local3);
};
}
}
}//package
Section 173
//stone_center (stone_center)
package {
import flash.display.*;
public dynamic class stone_center extends MovieClip {
}
}//package
Section 174
//Tower (Tower)
package {
import flash.events.*;
import caurina.transitions.*;
import flash.display.*;
import flash.geom.*;
import com.onlinegamestars.ender.*;
public class Tower extends Sprite {
public var type:String;
public var delay:Number;
public var level:int;// = 0
private var tower:MovieClip;
private var bReadyToShoot:Boolean;// = false
private var clock:MovieClip;
private var ArrowClass:Class;
private var overlay:DisplayObjectContainer;
private var scale:Number;// = 0.35
private var rangeMarker:Shape;
public var cost:int;
public var nameID:String;
public var damage:Number;
public var range:Number;
private var bEnabled:Boolean;// = false
public static var bPaused:Boolean = false;
public function Tower(_arg1:String="Tower0", _arg2:DisplayObjectContainer=null){
clock = new mcClock();
super();
this.overlay = _arg2;
this.type = _arg1;
rangeMarker = new Shape();
tower = new (Resources.getInstance()[_arg1]);
tower.gotoAndStop((level + 1));
range = Resources.getInstance()[("params" + _arg1)].range[0];
delay = Resources.getInstance()[("params" + _arg1)].delay[0];
damage = Resources.getInstance()[("params" + _arg1)].damage[0];
nameID = Resources.getInstance()[("params" + _arg1)].nameID;
cost = Resources.getInstance()[("params" + _arg1)].cost;
ArrowClass = Resources.getInstance()[("params" + _arg1)].arrow;
addChild(tower);
mouseChildren = false;
scaleX = scale;
scaleY = scale;
addEventListener(Event.ENTER_FRAME, onUpdate);
clock.visible = false;
clock.stop();
clock.y = (-(height) / (scale * 2));
clock.x = ((-(clock.width) / 2) - (width / (scale * 2)));
clock.scaleX = 0.5;
clock.scaleY = 0.5;
addChild(clock);
}
public function isUpgradable():Boolean{
return ((level < 3));
}
public function sell(_arg1:Boolean=false):void{
if (_arg1){
cost = 0;
};
hideRadius();
removeEventListener(Event.ENTER_FRAME, onUpdate);
dispatchEvent(new Event("SOLD"));
}
private function finishBuild():void{
mouseEnabled = true;
bReadyToShoot = true;
bEnabled = true;
tower.filters = null;
clock.stop();
clock.visible = false;
MusicLibrary.playSound(MusicLibrary.TowerUpgraded, 0.7);
}
public function init(_arg1:Event=null):void{
hideRadius();
_arg1 = new Event("PLACED");
dispatchEvent(_arg1);
addEventListener(Event.REMOVED_FROM_STAGE, onRemove);
startBuild();
}
public function get sellCost():int{
return (Math.floor((0.75 * cost)));
}
private function onUpdate(_arg1:Event):void{
var obj:Soldier;
var targetDist:Number;
var dist:Number;
var i:int;
var arrow:MovieClip;
var p:Point;
var p2:Point;
var dx:Number;
var dy:Number;
var k:int;
var e = _arg1;
var target:Soldier;
var self:Point = new Point(x, y);
rangeMarker.x = localToGlobal(new Point(0, 0)).x;
rangeMarker.y = localToGlobal(new Point(0, 0)).y;
rangeMarker.filters = filters;
if (!bEnabled){
return;
};
if (bPaused){
return;
};
if (bReadyToShoot){
i = 0;
while (i < Soldier.soldiers.length) {
obj = Soldier.soldiers[i];
dist = Point.distance(self, new Point(obj.x, obj.y));
if ((((obj.potential_damage < obj.health)) && ((dist < range)))){
if ((((target == null)) || ((targetDist < obj.distance)))){
target = obj;
targetDist = obj.distance;
};
};
i = (i + 1);
};
if (target != null){
switch (type){
case "Tower0":
MusicLibrary.playSound(MusicLibrary.Tower02Attack);
break;
case "Tower2":
case "Tower1":
MusicLibrary.playSound(MusicLibrary.Tower01Attack, 0.3);
break;
case "Tower3":
MusicLibrary.playSound(MusicLibrary.Tower03Attack, 0.5);
break;
};
bReadyToShoot = false;
Tweener.addTween({}, {time:delay, onComplete:function ():void{
bReadyToShoot = true;
}});
arrow = new ArrowClass();
p = target.globalToLocal(localToGlobal(new Point(0, ((25 - height) / scale))));
arrow.x = p.x;
arrow.y = p.y;
p2 = new Point(0, (-15 - target.height));
dx = (p2.x - p.x);
dy = (p2.y - p.y);
k = ((dx)<0) ? 0 : 1;
arrow.rotation = ((180 * k) + ((180 * Math.atan((dy / dx))) / Math.PI));
Tweener.addTween(arrow, {time:0.2, x:p2.x, y:p2.y, onComplete:target.damage, onCompleteParams:[damage], transition:"linear"});
target.addChildAt(arrow, 0);
target.potential_damage = (target.potential_damage + damage);
};
};
}
public function upgrade():void{
if (!bEnabled){
return;
};
if (!isUpgradable()){
return;
};
cost = (cost + int(Resources.getInstance()[("params" + type)].upgradesCost[level]));
level++;
tower.gotoAndStop((level + 1));
range = Resources.getInstance()[("params" + type)].range[level];
damage = Resources.getInstance()[("params" + type)].damage[level];
delay = Resources.getInstance()[("params" + type)].delay[level];
hideRadius();
showRadius();
dispatchEvent(new Event("UPGRADED"));
startBuild();
}
private function startBuild():void{
mouseEnabled = false;
bReadyToShoot = false;
bEnabled = false;
tower.filters = [getGrayscaleFilter(0)];
clock.visible = true;
clock.gotoAndPlay(1);
Tweener.addTween({}, {time:5, onComplete:finishBuild, transition:"linear"});
MusicLibrary.playSound(MusicLibrary.TowerBuilding, 0.5);
}
private function onRemove(_arg1:Event):void{
hideRadius();
removeEventListener(Event.ENTER_FRAME, onUpdate);
removeEventListener(Event.REMOVED_FROM_STAGE, onRemove);
}
public function showRadius():void{
var _local1:DisplayObjectContainer = ((overlay)!=null) ? overlay : this;
rangeMarker.graphics.lineStyle(1, 0xBFBFBF, 1, true);
rangeMarker.graphics.beginFill(0xFFFFFF, 0.3);
rangeMarker.graphics.drawCircle(0, 0, range);
rangeMarker.graphics.endFill();
_local1.addChildAt(rangeMarker, 2);
}
public function hideRadius():void{
rangeMarker.graphics.clear();
var obj:DisplayObjectContainer = ((overlay)!=null) ? overlay : this;
try {
obj.removeChild(rangeMarker);
} catch(e:Error) {
};
}
}
}//package
Section 175
//TowerButtonTooltip (TowerButtonTooltip)
package {
import com.onlinegamestars.ender.xmlui.*;
import flash.display.*;
public class TowerButtonTooltip extends Sprite {
private var txtSell:Text;
public var delay:Number;// = 0.4
private var goldcost:uint;// = 0
public var damage:Number;// = 15
private var txtDelay:Text;
private var txtRange:Text;
public var range:Number;// = 110
private var txtDamage:Text;
public function TowerButtonTooltip(){
(addChild(new ButtonTooltip()) as MovieClip).mouseEnabled = false;
(addChildAt(XMLUI.newText("txt_tooltip_label"), 1) as Text).mouseEnabled = false;
txtDamage = (addChild(XMLUI.newText("txt_tooltip_damage")) as Text);
txtDelay = (addChild(XMLUI.newText("txt_tooltip_delay")) as Text);
txtRange = (addChild(XMLUI.newText("txt_tooltip_range")) as Text);
txtSell = (addChild(XMLUI.newText("txt_tooltip_upgrade")) as Text);
mouseChildren = false;
}
public function show(_arg1:Object, _arg2:uint):void{
(getChildAt(1) as Text).text = XMLUI.getString(_arg1.nameID);
visible = true;
txtDamage.text = _arg1.damage[0].toString();
txtDelay.text = _arg1.delay[0].toString();
txtRange.text = _arg1.range[0].toString();
txtSell.text = (_arg1.cost.toString() + "●");
goldcost = _arg1.cost;
update(_arg2);
}
public function update(_arg1:uint):void{
if (goldcost > _arg1){
txtSell.setColor(XMLUI.getData("fmt_gold_red").color);
} else {
txtSell.setColor(XMLUI.getData("fmt_gold").color);
};
}
public function hide():void{
visible = false;
}
}
}//package
Section 176
//TowerPlacer (TowerPlacer)
package {
import flash.events.*;
import flash.display.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public class TowerPlacer extends Sprite {
private var wrongFilter:ColorMatrixFilter;
private var _parent:DisplayObjectContainer;
private var tower_container:DisplayObjectContainer;
private var rest:BitmapData;
private var obj:Tower;
private var _stage:DisplayObjectContainer;
public static var previous:TowerPlacer;
public function TowerPlacer(_arg1:Tower, _arg2:DisplayObjectContainer, _arg3:BitmapData){
if (previous != null){
previous.cancel();
};
if (MagicPlacer.previous != null){
trace("cancelling from tower...");
MagicPlacer.previous.cancel();
};
previous = this;
this.obj = _arg1;
this.tower_container = _arg2;
rest = _arg3;
if (stage){
init();
} else {
addEventListener(Event.ADDED_TO_STAGE, init);
};
}
private function onUpdate(_arg1:Event):void{
if (rest.hitTest(new Point(0, 0), 0, new Point(x, y))){
obj.filters = [wrongFilter];
} else {
obj.filters = null;
};
}
private function onRemoved(_arg1:Event):void{
_parent = null;
cancel();
}
private function clear():void{
previous = null;
if (parent == null){
_parent = null;
};
if (_stage != null){
_stage.removeEventListener(MouseEvent.CLICK, onClicked);
_stage.removeEventListener(KeyboardEvent.KEY_DOWN, cancel);
_stage.removeEventListener(Event.ENTER_FRAME, onUpdate);
};
_stage = null;
removeEventListener(Event.REMOVED_FROM_STAGE, onRemoved);
if (_parent != null){
_parent.removeChild(this);
};
stopDrag();
obj = null;
}
private function onClicked(_arg1:MouseEvent):void{
if (((!((obj.filters == null))) && ((obj.filters.length > 0)))){
return;
};
obj.x = x;
obj.y = y;
tower_container.addChild(obj);
obj.init();
stopDrag();
clear();
}
private function init(_arg1:Event=null):void{
_stage = stage;
_parent = parent;
removeEventListener(Event.ADDED_TO_STAGE, init);
_stage.addEventListener(MouseEvent.CLICK, onClicked);
_stage.addEventListener(Event.ENTER_FRAME, onUpdate);
_stage.addEventListener(KeyboardEvent.KEY_DOWN, cancel);
addChild(obj);
obj.showRadius();
wrongFilter = new ColorMatrixFilter([1, 0.7, 0.5, 0, 0, 0, 0.3, 0, 0, 0, 0, 0, 0.3, 0, 0, 0, 0, 0, 1, 0]);
addEventListener(Event.REMOVED_FROM_STAGE, onRemoved);
startDrag(true);
}
public function cancel(_arg1:KeyboardEvent=null):void{
if (((!((_arg1 == null))) && (!((_arg1.charCode == Keyboard.ESCAPE))))){
return;
};
if (obj != null){
obj.sell(true);
};
clear();
}
}
}//package
Section 177
//TowerTooltip (TowerTooltip)
package {
import flash.events.*;
import com.onlinegamestars.ender.xmlui.*;
import flash.display.*;
import flash.filters.*;
import com.onlinegamestars.ender.*;
public class TowerTooltip extends Sprite {
private var txtDelay:Text;
public var delay:Number;// = 0.4
private var tower:Tower;// = null
private var txtUpgrade:Text;
public var btnSell:Button;
public var btnUpgrade:Button;
private var txtSell:Text;
private var txtRange:Text;
public var damage:Number;// = 15
public var range:Number;// = 110
private var txtDamage:Text;
public function TowerTooltip(){
(addChild(new mcTooltip()) as MovieClip).mouseEnabled = false;
(addChildAt(XMLUI.newText("txt_tooltip_label"), 1) as Text).mouseEnabled = false;
btnUpgrade = (addChild(XMLUI.newButton("btn_upgrade")) as Button);
btnSell = (addChild(XMLUI.newButton("btn_sell")) as Button);
txtDamage = (addChild(XMLUI.newText("txt_tooltip_damage")) as Text);
txtDelay = (addChild(XMLUI.newText("txt_tooltip_delay")) as Text);
txtRange = (addChild(XMLUI.newText("txt_tooltip_range")) as Text);
txtUpgrade = (addChild(XMLUI.newText("txt_tooltip_upgrade")) as Text);
txtSell = (addChild(XMLUI.newText("txt_tooltip_sell")) as Text);
txtDamage.mouseEnabled = false;
txtDelay.mouseEnabled = false;
txtRange.mouseEnabled = false;
txtUpgrade.mouseEnabled = false;
txtSell.mouseEnabled = false;
addEventListener(MouseEvent.MOUSE_DOWN, onStartDrag);
addEventListener(MouseEvent.MOUSE_UP, onStopDrag);
btnUpgrade.filtersOver = [new GlowFilter(3407667, 1, 3, 3, 2)];
btnUpgrade.filtersDisable = [getGrayscaleFilter(45)];
btnSell.filtersOver = [new GlowFilter(16724787, 1, 3, 3, 2)];
if (stage){
init();
} else {
addEventListener(Event.ADDED_TO_STAGE, init);
};
}
private function onStageClicked(_arg1:MouseEvent):void{
if (((((!((_arg1.target == this))) && (!((_arg1.target.parent == this))))) && (!((_arg1.target is Tower))))){
hide();
};
}
private function init(_arg1:Event=null):void{
stage.addEventListener(MouseEvent.CLICK, onStageClicked);
btnUpgrade.addEventListener(MouseEvent.CLICK, onUpgradeClicked);
btnSell.addEventListener(MouseEvent.CLICK, onSellClicked);
}
public function hide():void{
visible = false;
if (tower != null){
tower.hideRadius();
};
tower = null;
stopDrag();
}
private function onStopDrag(_arg1:MouseEvent):void{
stopDrag();
}
private function onSellClicked(_arg1:MouseEvent):void{
if (tower != null){
tower.sell();
};
hide();
}
private function onStartDrag(_arg1:MouseEvent):void{
startDrag();
}
public function show(_arg1:Tower, _arg2:uint, _arg3:Boolean=false):void{
if (_arg1 != null){
this.tower = _arg1;
} else {
_arg1 = this.tower;
};
(getChildAt(1) as Text).text = XMLUI.getString(_arg1.nameID);
if (!_arg3){
_arg1.showRadius();
x = (_arg1.x + (_arg1.width / 1.75));
y = (_arg1.y - _arg1.height);
if (x < 0){
x = 5;
};
if ((x + width) > 750){
x = (750 - width);
};
if (y < 0){
y = 5;
};
if ((y + height) > 570){
y = (570 - height);
};
};
visible = true;
txtDamage.text = _arg1.damage.toString();
txtDelay.text = _arg1.delay.toString();
txtRange.text = _arg1.range.toString();
txtSell.text = (_arg1.sellCost.toString() + "●");
if (!_arg1.isUpgradable()){
btnUpgrade.disable();
txtUpgrade.text = "";
} else {
btnUpgrade.enable();
txtUpgrade.text = (Resources.getInstance()[("params" + _arg1.type)].upgradesCost[_arg1.level].toString() + "●");
};
if (Resources.getInstance()[("params" + _arg1.type)].upgradesCost[_arg1.level] > _arg2){
btnUpgrade.disable();
txtUpgrade.setColor(XMLUI.getData("fmt_gold_red").color);
} else {
txtUpgrade.setColor(XMLUI.getData("fmt_gold").color);
};
}
private function onUpgradeClicked(_arg1:MouseEvent):void{
if (tower != null){
tower.upgrade();
};
hide();
}
}
}//package