Section 1
//AuxFunctions (caurina.transitions.AuxFunctions)
package caurina.transitions {
public class AuxFunctions {
public static function getObjectLength(_arg1:Object):uint{
var _local2:uint;
var _local3:String;
_local2 = 0;
for (_local3 in _arg1) {
_local2++;
};
return (_local2);
}
public static function numberToG(_arg1:Number):Number{
return (((_arg1 & 0xFF00) >> 8));
}
public static function numberToB(_arg1:Number):Number{
return ((_arg1 & 0xFF));
}
public static function numberToR(_arg1:Number):Number{
return (((_arg1 & 0xFF0000) >> 16));
}
public static function concatObjects(... _args):Object{
var _local2:Object;
var _local3:Object;
var _local4:int;
var _local5:String;
_local2 = {};
_local4 = 0;
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);
}
}
}//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 _local6:Number;
var _local7:Number;
var _local8:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * (0.3 * 1.5)) : _arg5.period;
_local8 = (((!(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;
_local6 = (((!(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;
_local6 = (((!(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;
_local6 = (((!(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 _local6:Number;
var _local7:Number;
var _local8:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
_local8 = (((!(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 _local6:Number;
var _local7:Number;
var _local8:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
_local8 = (((!(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 originalValueComplete:Object;
public var modifierParameters:Array;
public var isSpecialProperty:Boolean;
public var hasModifier:Boolean;
public var valueComplete:Number;
public var extra:Object;
public var valueStart:Number;
public var modifierFunction:Function;
public var arrayIndex:Number;
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:String;
_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;
_local1 = 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 preProcess:Function;
public var setValue:Function;
public var getValue: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:String;
_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:String;
_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:String;
_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;
public static var autoOverwrite:Boolean = true;
private static var _engineExists:Boolean = false;
private static var _currentTime:Number;
private static var _tweenList:Array;
private static var _specialPropertyModifierList:Object;
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{
var _local4:SpecialPropertyModifier;
if (!_inited){
init();
};
_local4 = new SpecialPropertyModifier(_arg2, _arg3);
_specialPropertyModifierList[_arg1] = _local4;
}
public static function registerSpecialProperty(_arg1:String, _arg2:Function, _arg3:Function, _arg4:Array=null, _arg5:Function=null):void{
var _local6:SpecialProperty;
if (!_inited){
init();
};
_local6 = new SpecialProperty(_arg2, _arg3, _arg4, _arg5);
_specialPropertyList[_arg1] = _local6;
}
public static function init(... _args):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 _local5:Object;
var _local6:Number;
var _local7:Number;
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];
};
_local5 = _arg2;
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
_local6 = (isNaN(_local5.time)) ? 0 : _local5.time;
_local7 = (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 _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_local2 = 0;
while (_local2 < _tweenList.length) {
pauseTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function removeTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
var _local5:SpecialPropertySplitter;
var _local6:Array;
var _local7:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){
if (_specialPropertySplitterList[_args[_local4]]){
_local5 = _specialPropertySplitterList[_args[_local4]];
_local6 = _local5.splitValues(_arg1, null);
_local7 = 0;
while (_local7 < _local6.length) {
_local3.push(_local6[_local7].name);
_local7++;
};
} else {
_local3.push(_args[_local4]);
};
};
_local4++;
};
return (affectTweens(removeTweenByIndex, _arg1, _local3));
}
public static function updateFrame():void{
_currentTimeFrame++;
}
public static function splitTweens(_arg1:Number, _arg2:Array):uint{
var _local3:TweenListObj;
var _local4:TweenListObj;
var _local5:uint;
var _local6:String;
var _local7:Boolean;
_local3 = _tweenList[_arg1];
_local4 = _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 resumeTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj;
var _local3:Number;
_local2 = _tweenList[_arg1];
if ((((_local2 == null)) || (!(_local2.isPaused)))){
return (false);
};
_local3 = 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.33.74");
}
public static function onEnterFrame(_arg1:Event):void{
var _local2:Boolean;
updateTime();
updateFrame();
_local2 = false;
_local2 = updateTweens();
if (!_local2){
stopEngine();
};
}
public static function updateTime():void{
_currentTime = getTimer();
}
private static function updateTweenByIndex(_arg1:Number):Boolean{
var tTweening:TweenListObj;
var isOver:Boolean;
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 cTime:Number;
var tProperty:Object;
var pv:Number;
var i = _arg1;
tTweening = _tweenList[i];
if ((((tTweening == null)) || (!(Boolean(tTweening.scope))))){
return (false);
};
isOver = false;
cTime = 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(e2:Error) {
handleError(tTweening, e2, "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(e3:Error) {
handleError(tTweening, e3, "onUpdate");
};
};
} else {
tTweening.updatesSkipped++;
};
};
if (((isOver) && (Boolean(tTweening.onComplete)))){
eventScope = (Boolean(tTweening.onCompleteScope)) ? tTweening.onCompleteScope : tScope;
try {
tTweening.onComplete.apply(eventScope, tTweening.onCompleteParams);
} catch(e4:Error) {
handleError(tTweening, e4, "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 _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_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(eventScope, [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 _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_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 _local3:Number;
var _local4:Number;
var _local5:String;
var _local6:Array;
var _local7:Object;
var _local8:Number;
var _local9:Number;
var _local10:Array;
var _local11:Object;
var _local12:Object;
var _local13:Function;
var _local14:Object;
var _local15:TweenListObj;
var _local16:Number;
var _local17:Array;
var _local18:Array;
var _local19:Array;
var _local20:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local6 = _arg1.concat();
} else {
_local6 = [_arg1];
};
_local7 = TweenListObj.makePropertiesChain(_arg2);
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
_local8 = (isNaN(_local7.time)) ? 0 : _local7.time;
_local9 = (isNaN(_local7.delay)) ? 0 : _local7.delay;
_local10 = new Array();
_local11 = {overwrite:true, 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};
_local12 = new Object();
for (_local5 in _local7) {
if (!_local11[_local5]){
if (_specialPropertySplitterList[_local5]){
_local17 = _specialPropertySplitterList[_local5].splitValues(_local7[_local5], _specialPropertySplitterList[_local5].parameters);
_local3 = 0;
while (_local3 < _local17.length) {
if (_specialPropertySplitterList[_local17[_local3].name]){
_local18 = _specialPropertySplitterList[_local17[_local3].name].splitValues(_local17[_local3].value, _specialPropertySplitterList[_local17[_local3].name].parameters);
_local4 = 0;
while (_local4 < _local18.length) {
_local10[_local18[_local4].name] = {valueStart:undefined, valueComplete:_local18[_local4].value, arrayIndex:_local18[_local4].arrayIndex, isSpecialProperty:false};
_local4++;
};
} else {
_local10[_local17[_local3].name] = {valueStart:undefined, valueComplete:_local17[_local3].value, arrayIndex:_local17[_local3].arrayIndex, isSpecialProperty:false};
};
_local3++;
};
} else {
if (_specialPropertyModifierList[_local5] != undefined){
_local19 = _specialPropertyModifierList[_local5].modifyValues(_local7[_local5]);
_local3 = 0;
while (_local3 < _local19.length) {
_local12[_local19[_local3].name] = {modifierParameters:_local19[_local3].parameters, modifierFunction:_specialPropertyModifierList[_local5].getValue};
_local3++;
};
} else {
_local10[_local5] = {valueStart:undefined, valueComplete:_local7[_local5]};
};
};
};
};
for (_local5 in _local10) {
if (_specialPropertyList[_local5] != undefined){
_local10[_local5].isSpecialProperty = true;
} else {
if (_local6[0][_local5] == undefined){
printError((((("The property '" + _local5) + "' doesn't seem to be a normal object property of ") + String(_local6[0])) + " or a registered special property."));
};
};
};
for (_local5 in _local12) {
if (_local10[_local5] != undefined){
_local10[_local5].modifierParameters = _local12[_local5].modifierParameters;
_local10[_local5].modifierFunction = _local12[_local5].modifierFunction;
};
};
if (typeof(_local7.transition) == "string"){
_local20 = _local7.transition.toLowerCase();
_local13 = _transitionList[_local20];
} else {
_local13 = _local7.transition;
};
if (!Boolean(_local13)){
_local13 = _transitionList["easeoutexpo"];
};
_local3 = 0;
while (_local3 < _local6.length) {
_local14 = new Object();
for (_local5 in _local10) {
_local14[_local5] = new PropertyInfoObj(_local10[_local5].valueStart, _local10[_local5].valueComplete, _local10[_local5].valueComplete, _local10[_local5].arrayIndex, {}, _local10[_local5].isSpecialProperty, _local10[_local5].modifierFunction, _local10[_local5].modifierParameters);
};
if (_local7.useFrames == true){
_local15 = new TweenListObj(_local6[_local3], (_currentTimeFrame + (_local9 / _timeScale)), (_currentTimeFrame + ((_local9 + _local8) / _timeScale)), true, _local13, _local7.transitionParams);
} else {
_local15 = new TweenListObj(_local6[_local3], (_currentTime + ((_local9 * 1000) / _timeScale)), (_currentTime + (((_local9 * 1000) + (_local8 * 1000)) / _timeScale)), false, _local13, _local7.transitionParams);
};
_local15.properties = _local14;
_local15.onStart = _local7.onStart;
_local15.onUpdate = _local7.onUpdate;
_local15.onComplete = _local7.onComplete;
_local15.onOverwrite = _local7.onOverwrite;
_local15.onError = _local7.onError;
_local15.onStartParams = _local7.onStartParams;
_local15.onUpdateParams = _local7.onUpdateParams;
_local15.onCompleteParams = _local7.onCompleteParams;
_local15.onOverwriteParams = _local7.onOverwriteParams;
_local15.onStartScope = _local7.onStartScope;
_local15.onUpdateScope = _local7.onUpdateScope;
_local15.onCompleteScope = _local7.onCompleteScope;
_local15.onOverwriteScope = _local7.onOverwriteScope;
_local15.onErrorScope = _local7.onErrorScope;
_local15.rounded = _local7.rounded;
_local15.skipUpdates = _local7.skipUpdates;
if (((_local7.overwrite == undefined)) ? autoOverwrite : _local7.overwrite){
removeTweensByTime(_local15.scope, _local15.properties, _local15.timeStart, _local15.timeComplete);
};
_tweenList.push(_local15);
if ((((_local8 == 0)) && ((_local9 == 0)))){
_local16 = (_tweenList.length - 1);
updateTweenByIndex(_local16);
removeTweenByIndex(_local16);
};
_local3++;
};
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 _local4:Boolean;
var _local5:uint;
var _local6:Array;
var _local7:uint;
var _local8:uint;
var _local9:uint;
_local4 = false;
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;
var _local4:Array;
if (!Boolean(_tweenList)){
return ([]);
};
_local4 = 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;
_local2 = _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;
var _local3:Number;
if (!Boolean(_tweenList)){
return (0);
};
_local3 = 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 removed:Boolean;
var removedLocally:Boolean;
var i:uint;
var tl:uint;
var pName:String;
var eventScope:Object;
var p_scope = _arg1;
var p_properties = _arg2;
var p_timeStart = _arg3;
var p_timeComplete = _arg4;
removed = false;
tl = _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{
var _local4:SpecialPropertySplitter;
if (!_inited){
init();
};
_local4 = 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 _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(resumeTweenByIndex, _arg1, _local3));
}
public static function pauseTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){
_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 onUpdate:Function;
public var useFrames:Boolean;
public var hasStarted:Boolean;
public var onOverwriteParams:Array;
public var timeStart:Number;
public var count: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 transition:Function;
public var timePaused:Number;
public var onCompleteParams:Array;
public var timesCalled:Number;
public var isCaller:Boolean;
public var onError:Function;
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 _local2:TweenListObj;
var _local3:String;
_local2 = 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 _local1:String;
var _local2:Boolean;
var _local3:String;
_local1 = "\n[TweenListObj ";
_local1 = (_local1 + ("scope:" + String(scope)));
_local1 = (_local1 + ", properties:");
_local2 = true;
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 _local2:Object;
var _local3:Object;
var _local4:Object;
var _local5:Object;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local2 = _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
//CachedBitmapGoal (core.cache.CachedBitmapGoal)
package core.cache {
import core.*;
import core.goal.*;
import flash.display.*;
import flash.geom.*;
public class CachedBitmapGoal extends Bitmap implements IGoal {
private var _assigned_routines:Array;
private var _stop_at_end:Boolean;// = false
private var _do_update:Boolean;// = true
private var _active:Boolean;// = true
private var _clip_position:Point;// = null
private var _frame_number:int;// = 0
private var _frames:Array;// = null
private var _clone:Boolean;// = false
public function CachedBitmapGoal(_arg1:Array, _arg2:Point, _arg3:Boolean):void{
_frames = null;
_clone = false;
_clip_position = null;
_frame_number = 0;
_assigned_routines = [];
_active = true;
_stop_at_end = false;
_do_update = true;
super();
_frames = _arg1;
_clone = _arg3;
_clip_position = _arg2.clone();
if (_frames.length > 0){
update();
_assigned_routines.length = _frames.length;
} else {
deactivate();
};
}
public function assignRoutine(_arg1:int, _arg2:Function):void{
_assigned_routines[_arg1] = _arg2;
}
public function clearAssignedRoutines():void{
var _local1:int;
_local1 = 0;
while (_local1 < _assigned_routines.length) {
_assigned_routines[_local1] = null;
_local1++;
};
}
public function advance():void{
if (!_do_update){
return;
};
update();
if (_assigned_routines[_frame_number] != null){
var _local1 = _assigned_routines;
_local1[_frame_number](_clip_position);
};
_frame_number++;
if (_frame_number >= _frames.length){
if (!_stop_at_end){
deactivate();
} else {
_do_update = false;
};
};
}
public function setStopAtEnd(_arg1:Boolean=true):void{
_stop_at_end = _arg1;
}
private function update():void{
var _local1:BitmapData;
x = (_clip_position.x - _frames[_frame_number].offset_x);
y = (_clip_position.y - _frames[_frame_number].offset_y);
_local1 = null;
if (_clone){
_local1 = _frames[_frame_number].bitmap_data.clone();
} else {
_local1 = _frames[_frame_number].bitmap_data;
};
bitmapData = _local1;
}
public function deactivate():void{
_active = false;
if (_frames){
_frames = null;
if (this.parent){
this.parent.removeChild(this);
};
if (_clone){
bitmapData.dispose();
};
};
}
public function get alive():Boolean{
return (_active);
}
public static function draw(_arg1:CachedMovieClip, _arg2:Point, _arg3:DisplayObjectContainer, _arg4:Boolean=true):CachedBitmapGoal{
var _local5:CachedBitmapGoal;
_local5 = new CachedBitmapGoal(_arg1.cachedFrames, _arg2, _arg4);
_arg3.addChild(_local5);
Global.top.engine.goalSystem.add(_local5);
return (_local5);
}
}
}//package core.cache
Section 10
//CachedMovieClip (core.cache.CachedMovieClip)
package core.cache {
public class CachedMovieClip {
private var _renderer:MovieClipRenderGoal;// = null
private var _already_cached:Boolean;// = false
private var _cached_frames:Array;// = null
public function CachedMovieClip(){
_already_cached = false;
_renderer = null;
_cached_frames = null;
super();
}
public function get renderer():MovieClipRenderGoal{
return (_renderer);
}
public function set renderer(_arg1:MovieClipRenderGoal):void{
_renderer = _arg1;
}
public function set alreadyCached(_arg1:Boolean):void{
_already_cached = _arg1;
}
public function get cachedFrames():Array{
return (_cached_frames);
}
public function get alreadyCached():Boolean{
return (_already_cached);
}
public function set cachedFrames(_arg1:Array):void{
_cached_frames = _arg1;
}
}
}//package core.cache
Section 11
//FrameInfo (core.cache.FrameInfo)
package core.cache {
import flash.display.*;
import flash.geom.*;
public class FrameInfo {
public var bitmap_bounds:Rectangle;// = null
public var bitmap_data:BitmapData;// = null
public var offset_x:Number;// = 0
public var offset_y:Number;// = 0
public function FrameInfo(_arg1:BitmapData, _arg2:Rectangle){
bitmap_data = null;
bitmap_bounds = null;
offset_x = 0;
offset_y = 0;
super();
bitmap_data = _arg1;
bitmap_bounds = _arg2;
}
}
}//package core.cache
Section 12
//MovieClipCache (core.cache.MovieClipCache)
package core.cache {
import flash.utils.*;
public class MovieClipCache {
private static var _cache:Dictionary = new Dictionary();
public function MovieClipCache():void{
}
public static function getCached(_arg1:String):CachedMovieClip{
return (_cache[_arg1]);
}
public static function saveCached(_arg1:String, _arg2:CachedMovieClip):void{
_cache[_arg1] = _arg2;
}
}
}//package core.cache
Section 13
//MovieClipRenderGoal (core.cache.MovieClipRenderGoal)
package core.cache {
import core.goal.*;
import flash.display.*;
import flash.geom.*;
public class MovieClipRenderGoal extends Goal {
private var _cache:CachedMovieClip;// = null
private var _frames:Array;
private var _final_params:Object;// = null
private var _final_condition:int;// = 0
private var _cache_id:String;
private var _overhead_x:int;// = 0
private var _clip_bounds:Rectangle;// = null
private var _sprite;// = null
private var _overhead_y:int;// = 0
public static const TOTAL_FRAMES:int = 1;
public static const HAS_PARENT:int = 0;
public function MovieClipRenderGoal(_arg1, _arg2:String, _arg3:int=0, _arg4:int=0):void{
_frames = new Array();
_sprite = null;
_cache = null;
_clip_bounds = null;
_final_condition = 0;
_final_params = null;
_overhead_x = 0;
_overhead_y = 0;
super();
_sprite = _arg1;
_cache_id = _arg2;
_overhead_x = _arg3;
_overhead_y = _arg4;
_cache = new CachedMovieClip();
_cache.renderer = this;
MovieClipCache.saveCached(_cache_id, _cache);
checkClipBounds();
}
override public function advance():void{
var _local1:FrameInfo;
if (!isFinalCondition()){
if (_sprite.currentFrame < (_frames.length + 1)){
return;
};
_local1 = snapClip(_sprite);
if (_local1){
_frames.push(_local1);
};
} else {
_cache.cachedFrames = _frames;
_cache.renderer = null;
_cache.alreadyCached = true;
deactivate();
};
}
private function isFinalCondition():Boolean{
if (HAS_PARENT == _final_condition){
return ((_sprite.parent == null));
};
if (TOTAL_FRAMES == _final_condition){
return ((_frames.length >= _final_params.total_frames));
};
return (true);
}
public function setFinalCondition(_arg1:int, _arg2:Object=null):void{
_final_condition = _arg1;
switch (_arg1){
case HAS_PARENT:
break;
case TOTAL_FRAMES:
_final_params = new Object();
if (!_arg2){
_final_params.total_frames = _sprite.totalFrames;
} else {
_final_params.total_frames = _arg2.totalFrames;
};
break;
};
}
public function get frames():Array{
return (_frames);
}
private function checkClipBounds():void{
if (_sprite.clip_bounds){
_clip_bounds = new Rectangle(_sprite.clip_bounds.x, _sprite.clip_bounds.y, _sprite.clip_bounds.width, _sprite.clip_bounds.height);
cleanScaffolds(_sprite);
};
}
public function snapClip(_arg1):FrameInfo{
var _local2:Rectangle;
var _local3:BitmapData;
var _local4:Matrix;
var _local5:FrameInfo;
_local2 = null;
if (_clip_bounds){
_local2 = _clip_bounds.clone();
} else {
_local2 = _arg1.getBounds(_arg1);
if ((((_local2.width == 0)) || ((_local2.height == 0)))){
return (null);
};
};
_local2.x = (_local2.x * Math.abs(_arg1.scaleX));
_local2.y = (_local2.y * Math.abs(_arg1.scaleY));
_local2.width = (_local2.width * Math.abs(_arg1.scaleX));
_local2.height = (_local2.height * Math.abs(_arg1.scaleY));
_local2.x = (_local2.x - _overhead_x);
_local2.y = (_local2.y - _overhead_x);
_local2.width = (_local2.width + (_overhead_x * 2));
_local2.height = (_local2.height + (_overhead_y * 2));
_local3 = new BitmapData(int((_local2.width + 1)), int((_local2.height + 1)), true, 0);
_local4 = new Matrix();
_local4.scale(_arg1.scaleX, _arg1.scaleY);
_local4.rotate((_arg1.rotation * (Math.PI / 180)));
_local4.translate(-(_local2.x), -(_local2.y));
_local3.draw(_arg1, _local4, null, BlendMode.NORMAL);
_local5 = new FrameInfo(_local3, _local2);
_local5.offset_x = -(_local2.x);
_local5.offset_y = -(_local2.y);
return (_local5);
}
public static function cleanScaffolds(_arg1):void{
if (_arg1.clip_bounds){
_arg1.removeChild(_arg1.clip_bounds);
_arg1.clip_bounds = null;
};
}
}
}//package core.cache
Section 14
//ArrayUtils (core.common.ArrayUtils)
package core.common {
public class ArrayUtils {
public static function shuffle(_arg1:Array):void{
var _local2:int;
if (_arg1.length <= 1){
return;
};
_local2 = 0;
while (_local2 < (_arg1.length + 1)) {
exchangeElements(_arg1, ((Math.random() - 0.001) * _arg1.length), ((Math.random() - 0.001) * _arg1.length));
_local2++;
};
}
public static function exchangeElements(_arg1:Array, _arg2:int, _arg3:int):void{
var _local4:*;
if (_arg2 == _arg3){
return;
};
_local4 = _arg1[_arg2];
_arg1[_arg2] = _arg1[_arg3];
_arg1[_arg3] = _local4;
}
}
}//package core.common
Section 15
//KeyboardKeys (core.common.KeyboardKeys)
package core.common {
import flash.events.*;
public class KeyboardKeys {
public static const A_KEY:int = 65;
public static const D_KEY:int = 68;
public static const S_KEY:int = 83;
public static const W_KEY:int = 87;
public static const a_KEY:int = 97;
public static const d_KEY:int = 100;
public static const s_KEY:int = 115;
public static const w_KEY:int = 119;
private static var initialized:Boolean = false;
private static var keys:Object = new Object();
private static function keyPressed(_arg1:KeyboardEvent):void{
keys[_arg1.keyCode] = true;
}
public static function init(_arg1):void{
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
initialized = true;
}
public static function stop(_arg1):void{
_arg1.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
_arg1.removeEventListener(KeyboardEvent.KEY_UP, keyReleased);
initialized = false;
}
public static function isDown(_arg1:uint):Boolean{
if (!initialized){
return (false);
};
if (Boolean((_arg1 in keys))){
return (keys[_arg1]);
};
return (false);
}
private static function keyReleased(_arg1:KeyboardEvent):void{
keys[_arg1.keyCode] = false;
}
}
}//package core.common
Section 16
//Map (core.common.Map)
package core.common {
public class Map {
public var values:Array;
protected var index_:int;// = 0
public var keys:Array;
public function Map(){
keys = new Array();
values = new Array();
index_ = 0;
super();
}
public function add(_arg1:Object, _arg2):void{
index_ = 0;
find(_arg1);
keys.splice(index_, 0, _arg1);
values.splice(index_, 0, _arg2);
}
public function empty():Boolean{
return ((keys.length == 0));
}
public function shift(){
var _local1:*;
_local1 = values.shift();
keys.shift();
return (_local1);
}
public function remove(_arg1:Object):void{
if (find(_arg1)){
keys.splice(index_, 1);
values.splice(index_, 1);
};
}
public function size():int{
return (keys.length);
}
public function pop(){
var _local1:*;
_local1 = values.pop();
keys.pop();
return (_local1);
}
public function get(_arg1:Object){
if (!find(_arg1)){
return (null);
};
return (values[index_]);
}
public function getout(_arg1:Object){
var _local2:*;
if (!find(_arg1)){
return (null);
};
_local2 = values[index_];
values.splice(index_, 1);
keys.splice(index_, 1);
return (_local2);
}
public function find(_arg1:Object):Boolean{
var _local2:int;
var _local3:int;
_local2 = 0;
_local3 = (keys.length - 1);
while (_local2 <= _local3) {
index_ = ((_local2 + _local3) >> 1);
if (_arg1 < keys[index_]){
_local3 = (index_ - 1);
} else {
if (_arg1 > keys[index_]){
_local2 = (index_ + 1);
} else {
return (true);
};
};
};
index_ = _local2;
return (false);
}
public function clear():void{
keys.length = 0;
values.length = 0;
index_ = 0;
}
}
}//package core.common
Section 17
//ObjectList (core.common.ObjectList)
package core.common {
import flash.utils.*;
public class ObjectList extends Proxy {
private var objects:Array;
public function ObjectList():void{
objects = [];
super();
}
public function shift(){
return (objects.shift());
}
public function makeCopy():ObjectList{
var _local1:ObjectList;
_local1 = new ObjectList();
_local1.objects = objects.concat();
return (_local1);
}
public function remove(_arg1):void{
var _local2:int;
_local2 = objects.indexOf(_arg1);
if (_local2 >= 0){
delete objects[_local2];
objects.splice(_local2, 1);
};
}
public function get length():uint{
return (objects.length);
}
public function push(_arg1):void{
objects.push(_arg1);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
return (objects[_arg1]);
}
public function clear():void{
if (((objects) && ((objects.length > 0)))){
objects.length = 0;
objects = new Array();
};
}
public function buildFromArray(_arg1:Array):void{
objects = _arg1.concat();
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function isAttribute(_arg1):Boolean{
return (false);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function callProperty(_arg1, ... _args){
if ((objects[_arg1] is Function)){
return (objects[_arg1].apply(null, _args));
};
return (null);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(_arg1:int):int{
return (((_arg1)<objects.length) ? (_arg1 + 1) : 0);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
objects[_arg1] = _arg2;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getDescendants(_arg1){
return (null);
}
public function hasItem(_arg1):Boolean{
return (!((objects.indexOf(_arg1) == -1)));
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextValue(_arg1:int){
return (objects[(_arg1 - 1)]);
}
}
}//package core.common
Section 18
//Position (core.common.Position)
package core.common {
public final class Position {
public var x:Number;// = 0
public var y:Number;// = 0
public function Position(_arg1:Number=0, _arg2:Number=0):void{
x = 0;
y = 0;
super();
set(_arg1, _arg2);
}
public function copy(_arg1:Position):void{
x = _arg1.x;
y = _arg1.y;
}
public function set(_arg1:Number, _arg2:Number):void{
x = _arg1;
y = _arg2;
}
public function isEqualXY(_arg1:Number, _arg2:Number):Boolean{
return ((((x == _arg1)) && ((y == _arg2))));
}
public function isEqual(_arg1:Position):Boolean{
return ((((x == _arg1.x)) && ((y == _arg1.y))));
}
}
}//package core.common
Section 19
//sprintf (core.common.sprintf)
package core.common {
public function sprintf(_arg1:String, ... _args):String{
var _local3:String;
var _local4:int;
var _local5:int;
var _local6:String;
var _local7:*;
var _local8:String;
var _local9:Boolean;
var _local10:Boolean;
var _local11:Boolean;
var _local12:Boolean;
var _local13:Boolean;
var _local14:Boolean;
var _local15:Boolean;
var _local16:String;
var _local17:String;
var _local18:Boolean;
var _local19:Boolean;
_local3 = "";
_local4 = _arg1.length;
_local5 = 0;
while (_local5 < _local4) {
_local6 = _arg1.charAt(_local5);
if (_local6 == "%"){
_local9 = false;
_local10 = false;
_local11 = false;
_local12 = false;
_local13 = false;
_local14 = false;
_local15 = false;
_local16 = "";
_local17 = "";
++_local5;
_local6 = _arg1.charAt(_local5);
while (((((((((((((((((((((!((_local6 == "d"))) && (!((_local6 == "i"))))) && (!((_local6 == "o"))))) && (!((_local6 == "u"))))) && (!((_local6 == "x"))))) && (!((_local6 == "X"))))) && (!((_local6 == "f"))))) && (!((_local6 == "F"))))) && (!((_local6 == "c"))))) && (!((_local6 == "s"))))) && (!((_local6 == "%"))))) {
if (!_local10){
if (((!(_local11)) && ((_local6 == "#")))){
_local11 = true;
} else {
if (((!(_local12)) && ((_local6 == "0")))){
_local12 = true;
} else {
if (((!(_local13)) && ((_local6 == "-")))){
_local13 = true;
} else {
if (((!(_local14)) && ((_local6 == " ")))){
_local14 = true;
} else {
if (((!(_local15)) && ((_local6 == "+")))){
_local15 = true;
} else {
_local10 = true;
};
};
};
};
};
};
if (((!(_local9)) && ((_local6 == ".")))){
_local10 = true;
_local9 = true;
++_local5;
_local6 = _arg1.charAt(_local5);
} else {
if (_local10){
if (!_local9){
_local16 = (_local16 + _local6);
} else {
_local17 = (_local17 + _local6);
};
};
++_local5;
_local6 = _arg1.charAt(_local5);
};
};
switch (_local6){
case "d":
case "i":
_local7 = _args.shift();
_local8 = String(Math.abs(int(_local7)));
if (_local17 != ""){
_local8 = leftPad(_local8, int(_local17), "0");
};
if (int(_local7) < 0){
_local8 = ("-" + _local8);
} else {
if (((_local15) && ((int(_local7) >= 0)))){
_local8 = ("+" + _local8);
};
};
if (_local16 != ""){
if (_local13){
_local8 = rightPad(_local8, int(_local16));
} else {
if (((_local12) && ((_local17 == "")))){
_local8 = leftPad(_local8, int(_local16), "0");
} else {
_local8 = leftPad(_local8, int(_local16));
};
};
};
_local3 = (_local3 + _local8);
break;
case "o":
_local7 = _args.shift();
_local8 = uint(_local7).toString(8);
if (((_local11) && (!((_local8 == "0"))))){
_local8 = ("0" + _local8);
};
if (_local17 != ""){
_local8 = leftPad(_local8, int(_local17), "0");
};
if (_local16 != ""){
if (_local13){
_local8 = rightPad(_local8, int(_local16));
} else {
if (((_local12) && ((_local17 == "")))){
_local8 = leftPad(_local8, int(_local16), "0");
} else {
_local8 = leftPad(_local8, int(_local16));
};
};
};
_local3 = (_local3 + _local8);
break;
case "u":
_local7 = _args.shift();
_local8 = uint(_local7).toString(10);
if (_local17 != ""){
_local8 = leftPad(_local8, int(_local17), "0");
};
if (_local16 != ""){
if (_local13){
_local8 = rightPad(_local8, int(_local16));
} else {
if (((_local12) && ((_local17 == "")))){
_local8 = leftPad(_local8, int(_local16), "0");
} else {
_local8 = leftPad(_local8, int(_local16));
};
};
};
_local3 = (_local3 + _local8);
break;
case "X":
_local18 = true;
case "x":
_local7 = _args.shift();
_local8 = uint(_local7).toString(16);
if (_local17 != ""){
_local8 = leftPad(_local8, int(_local17), "0");
};
_local19 = ((_local11) && (!((uint(_local7) == 0))));
if (((((((!((_local16 == ""))) && (!(_local13)))) && (_local12))) && ((_local17 == "")))){
_local8 = leftPad(_local8, (_local19) ? (int(_local16) - 2) : int(_local16), "0");
};
if (_local19){
_local8 = ("0x" + _local8);
};
if (_local16 != ""){
if (_local13){
_local8 = rightPad(_local8, int(_local16));
} else {
_local8 = leftPad(_local8, int(_local16));
};
};
if (_local18){
_local8 = _local8.toUpperCase();
};
_local3 = (_local3 + _local8);
break;
case "f":
case "F":
_local7 = _args.shift();
_local8 = Math.abs(Number(_local7)).toFixed(((_local17)!="") ? int(_local17) : 6);
if (int(_local7) < 0){
_local8 = ("-" + _local8);
} else {
if (((_local15) && ((int(_local7) >= 0)))){
_local8 = ("+" + _local8);
};
};
if (((_local11) && ((_local8.indexOf(".") == -1)))){
_local8 = (_local8 + ".");
};
if (_local16 != ""){
if (_local13){
_local8 = rightPad(_local8, int(_local16));
} else {
if (((_local12) && ((_local17 == "")))){
_local8 = leftPad(_local8, int(_local16), "0");
} else {
_local8 = leftPad(_local8, int(_local16));
};
};
};
_local3 = (_local3 + _local8);
break;
case "c":
_local7 = _args.shift();
_local8 = String.fromCharCode(int(_local7));
if (_local16 != ""){
if (_local13){
_local8 = rightPad(_local8, int(_local16));
} else {
_local8 = leftPad(_local8, int(_local16));
};
};
_local3 = (_local3 + _local8);
break;
case "s":
_local7 = _args.shift();
_local8 = String(_local7);
if (_local17 != ""){
_local8 = _local8.substring(0, int(_local17));
};
if (_local16 != ""){
if (_local13){
_local8 = rightPad(_local8, int(_local16));
} else {
_local8 = leftPad(_local8, int(_local16));
};
};
_local3 = (_local3 + _local8);
break;
case "%":
_local3 = (_local3 + "%");
};
} else {
_local3 = (_local3 + _local6);
};
_local5++;
};
return (_local3);
}
}//package core.common
private const leftPad:Function = function (_arg1:String, _arg2:int, _arg3:String=" "):String{
var _local4:String;
if (_arg1.length < _arg2){
_local4 = "";
while ((_local4.length + _arg1.length) < _arg2) {
_local4 = (_local4 + _arg3);
};
return ((_local4 + _arg1));
};
return (_arg1);
};
private const rightPad:Function = function (_arg1:String, _arg2:int, _arg3:String=" "):String{
while (_arg1.length < _arg2) {
_arg1 = (_arg1 + _arg3);
};
return (_arg1);
};
Section 20
//Goal (core.goal.Goal)
package core.goal {
public class Goal implements IGoal {
protected var active:Boolean;// = true
public function Goal(){
active = true;
super();
}
public function advance():void{
}
public function deactivate():void{
active = false;
}
public function get alive():Boolean{
return (active);
}
}
}//package core.goal
Section 21
//GoalSystem (core.goal.GoalSystem)
package core.goal {
public class GoalSystem extends Goal {
public var goals:Array;
private var counter:int;// = 0
private var active_count:int;// = 0
private static const GOALS_CLEAN_PAUSE:uint = 10;
public function GoalSystem(){
goals = [];
counter = 0;
active_count = 0;
super();
}
override public function advance():void{
var _local1:uint;
_local1 = 0;
active_count = 0;
while (_local1 < goals.length) {
if (goals[_local1].alive){
goals[_local1].advance();
active_count++;
};
_local1++;
};
if (!counter){
cleanGoals();
counter = GOALS_CLEAN_PAUSE;
} else {
counter--;
};
}
public function add(_arg1:IGoal):void{
goals.push(_arg1);
}
public function activeCount():int{
return (active_count);
}
override public function deactivate():void{
deactivateChildren();
super.deactivate();
}
private function cleanGoals():void{
var _local1:int;
_local1 = 0;
while (_local1 < goals.length) {
if (!goals[_local1].alive){
delete goals[_local1];
goals.splice(_local1, 1);
} else {
_local1++;
};
};
}
public function deactivateChildren():void{
var _local1:int;
_local1 = 0;
while (_local1 < goals.length) {
if (goals[_local1].alive){
goals[_local1].deactivate();
};
_local1++;
};
goals.length = 0;
}
}
}//package core.goal
Section 22
//IGoal (core.goal.IGoal)
package core.goal {
public interface IGoal {
function advance():void;
function deactivate():void;
function get alive():Boolean;
}
}//package core.goal
Section 23
//PausedGoal (core.goal.PausedGoal)
package core.goal {
public class PausedGoal extends Goal {
private var PAUSE:int;// = 5
private var _pause:int;// = 0
public function PausedGoal(_arg1:int):void{
PAUSE = 5;
_pause = 0;
super();
PAUSE = _arg1;
}
override public function advance():void{
if (_pause > 0){
_pause--;
return;
};
pausedAdvance();
_pause = PAUSE;
}
protected function pausedAdvance():void{
}
}
}//package core.goal
Section 24
//Global (core.Global)
package core {
import flash.display.*;
import flash.ui.*;
public class Global {
private static var _top = null;
private static var _main:Sprite = null;
public static function hideMenu():void{
var _local1:ContextMenu;
if (!isStarted()){
throw (new Error("Cannot retrieve the global stage instance (_main == null)"));
};
_local1 = new ContextMenu();
_local1.hideBuiltInItems();
_main.contextMenu = _local1;
}
public static function get top(){
return (_top);
}
public static function get mainStage():Stage{
if (null == _main){
throw (new Error("Cannot retrieve the global stage instance (_main == null)"));
};
return (_main.stage);
}
public static function isStarted():Boolean{
return (!((_main == null)));
}
public static function startup(_arg1:Sprite, _arg2):void{
_main = _arg1;
_top = _arg2;
}
public static function getCurrentDomain():String{
var _local1:String;
var _local2:int;
var _local3:int;
var _local4:String;
var _local5:int;
var _local6:int;
_local1 = _main.root.loaderInfo.loaderURL;
_local2 = (_local1.indexOf("://") + 3);
_local3 = _local1.indexOf("/", _local2);
_local4 = _local1.substring(_local2, _local3);
_local5 = (_local4.lastIndexOf(".") - 1);
_local6 = (_local4.lastIndexOf(".", _local5) + 1);
return (_local4.substring(_local6, _local4.length).toLocaleLowerCase());
}
public static function get mainClass():Sprite{
return (_main);
}
}
}//package core
Section 25
//ProcessManager (core.ProcessManager)
package core {
import core.goal.*;
import flash.events.*;
import flash.utils.*;
public class ProcessManager {
private var _started:Boolean;// = false
private var _schedule_events:Array;
private var _elapsed:Number;// = 0
private var _last_time:Number;// = -1
private var _goal_system:GoalSystem;// = null
private var _ticked_objects:Array;
private var _time_scale:Number;// = 1
public static const TICK_RATE:Number = 0.0333333333333333;
public static const TICK_RATE_MS:Number = 33.3333333333333;
public static const MAX_TICKS_PER_FRAME:int = 10;
public static const TICKS_PER_SECOND:int = 30;
private static var _instance:ProcessManager = null;
public function ProcessManager(){
_started = false;
_time_scale = 1;
_last_time = -1;
_elapsed = 0;
_ticked_objects = new Array();
_schedule_events = new Array();
_goal_system = null;
super();
}
private function _advance(_arg1:Number):void{
var _local2:int;
var _local3:int;
var _local4:ScheduleObject;
var _local5:ProcessObject;
_elapsed = (_elapsed + _arg1);
_local2 = 0;
while (_local2 < _schedule_events.length) {
_local4 = _schedule_events[_local2];
_schedule_events[_local2].TimeRemaining = (_local4.TimeRemaining - _arg1);
if (_local4.TimeRemaining <= 0){
_local4.Callback.apply(_local4.ThisObject, _local4.Arguments);
_schedule_events.splice(_local2, 1);
} else {
_local2++;
};
};
_local3 = 0;
while ((((_elapsed >= TICK_RATE_MS)) && ((_local3 < MAX_TICKS_PER_FRAME)))) {
for each (_local5 in _ticked_objects) {
_local5.Listener.advance();
};
_elapsed = (_elapsed - TICK_RATE_MS);
_local3++;
};
if (_local3 >= MAX_TICKS_PER_FRAME){
_elapsed = 0;
};
}
private function _addObject(_arg1, _arg2:Number, _arg3:Array):void{
var _local4:int;
var _local5:int;
var _local6:ProcessObject;
if (!_started){
start();
};
_local4 = -1;
_local5 = 0;
while (_local5 < _arg3.length) {
if (_arg3[_local5].Listener == _arg1){
return;
};
if (_arg3[_local5].Priority < _arg2){
_local4 = _local5;
break;
};
_local5++;
};
_local6 = new ProcessObject();
_local6.Listener = _arg1;
_local6.Priority = _arg2;
if ((((_local4 < 0)) || ((_local4 >= _arg3.length)))){
_arg3.push(_local6);
} else {
_arg3.splice(_local4, 0, _local6);
};
}
public function stop():void{
if (!_started){
return;
};
removeTickedObject(_goal_system);
_started = false;
Global.mainStage.removeEventListener(Event.ENTER_FRAME, _onEnterFrame);
}
private function _onEnterFrame(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
_local2 = getTimer();
if (_last_time < 0){
_last_time = _local2;
return;
};
_local3 = ((_local2 - _last_time) * _time_scale);
_advance(_local3);
_last_time = _local2;
}
public function schedule(_arg1:Number, _arg2:Object, _arg3:Function, ... _args):void{
var _local5:ScheduleObject;
if (!_started){
start();
};
_local5 = new ScheduleObject();
_local5.TimeRemaining = _arg1;
_local5.ThisObject = _arg2;
_local5.Callback = _arg3;
_local5.Arguments = _args;
_schedule_events.push(_local5);
}
private function _removeObject(_arg1, _arg2:Array):void{
var _local3:int;
_local3 = 0;
while (_local3 < _arg2.length) {
if (_arg2[_local3].Listener == _arg1){
_arg2.splice(_local3, 1);
return;
};
_local3++;
};
}
public function addTickedObject(_arg1, _arg2:Number=0):void{
_addObject(_arg1, _arg2, _ticked_objects);
}
public function start():void{
if (_started){
return;
};
_last_time = -1;
_elapsed = 0;
Global.mainStage.addEventListener(Event.ENTER_FRAME, _onEnterFrame);
_started = true;
if (!_goal_system){
_goal_system = new GoalSystem();
};
addTickedObject(_goal_system);
}
public function get tickedObjectCount():int{
return (_ticked_objects.length);
}
public function get isRunning():Boolean{
return (_started);
}
public function set timeScale(_arg1:Number):void{
_time_scale = _arg1;
}
public function get timeScale():Number{
return (_time_scale);
}
public function removeTickedObject(_arg1):void{
_removeObject(_arg1, _ticked_objects);
}
public static function get goalSystem():GoalSystem{
return (instance._goal_system);
}
public static function get instance():ProcessManager{
if (null == _instance){
_instance = new (ProcessManager);
};
return (_instance);
}
}
}//package core
class ScheduleObject {
public var Callback:Function;// = null
public var TimeRemaining:Number;// = 0
public var Arguments:Array;// = null
public var ThisObject:Object;// = null
private function ScheduleObject(){
TimeRemaining = 0;
ThisObject = null;
Callback = null;
Arguments = null;
super();
}
}
class ProcessObject {
public var Priority:Number;// = 0
public var Listener;// = null
private function ProcessObject(){
Listener = null;
Priority = 0;
super();
}
}
Section 26
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import flash.events.*;
import flash.display.*;
import fl.core.*;
import fl.events.*;
import flash.utils.*;
public class BaseButton extends UIComponent {
protected var _selected:Boolean;// = false
private var unlockedMouseState:String;
protected var pressTimer:Timer;
protected var mouseState:String;
protected var background:DisplayObject;
private var _mouseStateLocked:Boolean;// = false
protected var _autoRepeat:Boolean;// = false
private static var defaultStyles:Object = {upSkin:"Button_upSkin", downSkin:"Button_downSkin", overSkin:"Button_overSkin", disabledSkin:"Button_disabledSkin", selectedDisabledSkin:"Button_selectedDisabledSkin", selectedUpSkin:"Button_selectedUpSkin", selectedDownSkin:"Button_selectedDownSkin", selectedOverSkin:"Button_selectedOverSkin", focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35};
public function BaseButton(){
_selected = false;
_autoRepeat = false;
_mouseStateLocked = false;
super();
buttonMode = true;
mouseChildren = false;
useHandCursor = false;
setupMouseEvents();
setMouseState("up");
pressTimer = new Timer(1, 0);
pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true);
}
protected function endPress():void{
pressTimer.reset();
}
public function set mouseStateLocked(_arg1:Boolean):void{
_mouseStateLocked = _arg1;
if (_arg1 == false){
setMouseState(unlockedMouseState);
} else {
unlockedMouseState = mouseState;
};
}
public function get autoRepeat():Boolean{
return (_autoRepeat);
}
public function set autoRepeat(_arg1:Boolean):void{
_autoRepeat = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
mouseEnabled = _arg1;
}
public function get selected():Boolean{
return (_selected);
}
protected function mouseEventHandler(_arg1:MouseEvent):void{
if (_arg1.type == MouseEvent.MOUSE_DOWN){
setMouseState("down");
startPress();
} else {
if ((((_arg1.type == MouseEvent.ROLL_OVER)) || ((_arg1.type == MouseEvent.MOUSE_UP)))){
setMouseState("over");
endPress();
} else {
if (_arg1.type == MouseEvent.ROLL_OUT){
setMouseState("up");
endPress();
};
};
};
}
public function setMouseState(_arg1:String):void{
if (_mouseStateLocked){
unlockedMouseState = _arg1;
return;
};
if (mouseState == _arg1){
return;
};
mouseState = _arg1;
invalidate(InvalidationType.STATE);
}
protected function startPress():void{
if (_autoRepeat){
pressTimer.delay = Number(getStyleValue("repeatDelay"));
pressTimer.start();
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
protected function buttonDown(_arg1:TimerEvent):void{
if (!_autoRepeat){
endPress();
return;
};
if (pressTimer.currentCount == 1){
pressTimer.delay = Number(getStyleValue("repeatInterval"));
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
public function set selected(_arg1:Boolean):void{
if (_selected == _arg1){
return;
};
_selected = _arg1;
invalidate(InvalidationType.STATE);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function setupMouseEvents():void{
addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false, 0, true);
}
protected function drawLayout():void{
background.width = width;
background.height = height;
}
protected function drawBackground():void{
var _local1:String;
var _local2:DisplayObject;
_local1 = (enabled) ? mouseState : "disabled";
if (selected){
_local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1));
};
_local1 = (_local1 + "Skin");
_local2 = background;
background = getDisplayObjectInstance(getStyleValue(_local1));
addChildAt(background, 0);
if (((!((_local2 == null))) && (!((_local2 == background))))){
removeChild(_local2);
};
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 27
//Button (fl.controls.Button)
package fl.controls {
import flash.display.*;
import fl.core.*;
import fl.managers.*;
public class Button extends LabelButton implements IFocusManagerComponent {
protected var emphasizedBorder:DisplayObject;
protected var _emphasized:Boolean;// = false
private static var defaultStyles:Object = {emphasizedSkin:"Button_emphasizedSkin", emphasizedPadding:2};
public static var createAccessibilityImplementation:Function;
public function Button(){
_emphasized = false;
super();
}
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
var _local3:*;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("emphasizedPadding"));
if ((((_local2 < 0)) || (!(_emphasized)))){
_local2 = 0;
};
_local3 = getStyleValue("focusRectPadding");
_local3 = ((_local3)==null) ? 2 : _local3;
_local3 = (_local3 + _local2);
uiFocusRect.x = -(_local3);
uiFocusRect.y = -(_local3);
uiFocusRect.width = (width + (_local3 * 2));
uiFocusRect.height = (height + (_local3 * 2));
};
}
public function set emphasized(_arg1:Boolean):void{
_emphasized = _arg1;
invalidate(InvalidationType.STYLES);
}
override protected function draw():void{
if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){
drawEmphasized();
};
super.draw();
if (emphasizedBorder != null){
setChildIndex(emphasizedBorder, (numChildren - 1));
};
}
public function get emphasized():Boolean{
return (_emphasized);
}
override protected function initializeAccessibility():void{
if (Button.createAccessibilityImplementation != null){
Button.createAccessibilityImplementation(this);
};
}
protected function drawEmphasized():void{
var _local1:Object;
var _local2:Number;
if (emphasizedBorder != null){
removeChild(emphasizedBorder);
};
emphasizedBorder = null;
if (!_emphasized){
return;
};
_local1 = getStyleValue("emphasizedSkin");
if (_local1 != null){
emphasizedBorder = getDisplayObjectInstance(_local1);
};
if (emphasizedBorder != null){
addChildAt(emphasizedBorder, 0);
_local2 = Number(getStyleValue("emphasizedPadding"));
emphasizedBorder.x = (emphasizedBorder.y = -(_local2));
emphasizedBorder.width = (width + (_local2 * 2));
emphasizedBorder.height = (height + (_local2 * 2));
};
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles));
}
}
}//package fl.controls
Section 28
//ButtonLabelPlacement (fl.controls.ButtonLabelPlacement)
package fl.controls {
public class ButtonLabelPlacement {
public static const TOP:String = "top";
public static const LEFT:String = "left";
public static const BOTTOM:String = "bottom";
public static const RIGHT:String = "right";
}
}//package fl.controls
Section 29
//LabelButton (fl.controls.LabelButton)
package fl.controls {
import flash.events.*;
import flash.display.*;
import fl.core.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.ui.*;
public class LabelButton extends BaseButton implements IFocusManagerComponent {
protected var _labelPlacement:String;// = "right"
protected var _toggle:Boolean;// = false
protected var icon:DisplayObject;
protected var oldMouseState:String;
protected var mode:String;// = "center"
public var textField:TextField;
protected var _label:String;// = "Label"
private static var defaultStyles:Object = {icon:null, upIcon:null, downIcon:null, overIcon:null, disabledIcon:null, selectedDisabledIcon:null, selectedUpIcon:null, selectedDownIcon:null, selectedOverIcon:null, textFormat:null, disabledTextFormat:null, textPadding:5, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function LabelButton(){
_labelPlacement = ButtonLabelPlacement.RIGHT;
_toggle = false;
_label = "Label";
mode = "center";
super();
}
protected function toggleSelected(_arg1:MouseEvent):void{
selected = !(selected);
dispatchEvent(new Event(Event.CHANGE, true));
}
public function get labelPlacement():String{
return (_labelPlacement);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
if (oldMouseState == null){
oldMouseState = mouseState;
};
setMouseState("down");
startPress();
};
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
override protected function keyUpHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
setMouseState(oldMouseState);
oldMouseState = null;
endPress();
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
}
override public function get selected():Boolean{
return ((_toggle) ? _selected : false);
}
public function set labelPlacement(_arg1:String):void{
_labelPlacement = _arg1;
invalidate(InvalidationType.SIZE);
}
public function set toggle(_arg1:Boolean):void{
if (((!(_arg1)) && (super.selected))){
selected = false;
};
_toggle = _arg1;
if (_toggle){
addEventListener(MouseEvent.CLICK, toggleSelected, false, 0, true);
} else {
removeEventListener(MouseEvent.CLICK, toggleSelected);
};
invalidate(InvalidationType.STATE);
}
public function get label():String{
return (_label);
}
override public function set selected(_arg1:Boolean):void{
_selected = _arg1;
if (_toggle){
invalidate(InvalidationType.STATE);
};
}
override protected function draw():void{
if (textField.text != _label){
label = _label;
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
drawIcon();
drawTextFormat();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
public function get toggle():Boolean{
return (_toggle);
}
override protected function configUI():void{
super.configUI();
textField = new TextField();
textField.type = TextFieldType.DYNAMIC;
textField.selectable = false;
addChild(textField);
}
override protected function drawLayout():void{
var _local1:Number;
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local1 = Number(getStyleValue("textPadding"));
_local2 = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement;
textField.height = (textField.textHeight + 4);
_local3 = (textField.textWidth + 4);
_local4 = (textField.textHeight + 4);
_local5 = ((icon)==null) ? 0 : (icon.width + _local1);
_local6 = ((icon)==null) ? 0 : (icon.height + _local1);
textField.visible = (label.length > 0);
if (icon != null){
icon.x = Math.round(((width - icon.width) / 2));
icon.y = Math.round(((height - icon.height) / 2));
};
if (textField.visible == false){
textField.width = 0;
textField.height = 0;
} else {
if ((((_local2 == ButtonLabelPlacement.BOTTOM)) || ((_local2 == ButtonLabelPlacement.TOP)))){
_local7 = Math.max(0, Math.min(_local3, (width - (2 * _local1))));
if ((height - 2) > _local4){
_local8 = _local4;
} else {
_local8 = (height - 2);
};
_local3 = _local7;
textField.width = _local3;
_local4 = _local8;
textField.height = _local4;
textField.x = Math.round(((width - _local3) / 2));
textField.y = Math.round(((((height - textField.height) - _local6) / 2) + ((_local2)==ButtonLabelPlacement.BOTTOM) ? _local6 : 0));
if (icon != null){
icon.y = Math.round(((_local2)==ButtonLabelPlacement.BOTTOM) ? (textField.y - _local6) : ((textField.y + textField.height) + _local1));
};
} else {
_local7 = Math.max(0, Math.min(_local3, ((width - _local5) - (2 * _local1))));
_local3 = _local7;
textField.width = _local3;
textField.x = Math.round(((((width - _local3) - _local5) / 2) + ((_local2)!=ButtonLabelPlacement.LEFT) ? _local5 : 0));
textField.y = Math.round(((height - textField.height) / 2));
if (icon != null){
icon.x = Math.round(((_local2)!=ButtonLabelPlacement.LEFT) ? (textField.x - _local5) : ((textField.x + _local3) + _local1));
};
};
};
super.drawLayout();
}
override protected function initializeAccessibility():void{
if (LabelButton.createAccessibilityImplementation != null){
LabelButton.createAccessibilityImplementation(this);
};
}
protected function drawIcon():void{
var _local1:DisplayObject;
var _local2:String;
var _local3:Object;
_local1 = icon;
_local2 = (enabled) ? mouseState : "disabled";
if (selected){
_local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1));
};
_local2 = (_local2 + "Icon");
_local3 = getStyleValue(_local2);
if (_local3 == null){
_local3 = getStyleValue("icon");
};
if (_local3 != null){
icon = getDisplayObjectInstance(_local3);
};
if (icon != null){
addChildAt(icon, 1);
};
if (((!((_local1 == null))) && (!((_local1 == icon))))){
removeChild(_local1);
};
}
public function set label(_arg1:String):void{
_label = _arg1;
if (textField.text != _label){
textField.text = _label;
dispatchEvent(new ComponentEvent(ComponentEvent.LABEL_CHANGE));
};
invalidate(InvalidationType.SIZE);
invalidate(InvalidationType.STYLES);
}
protected function drawTextFormat():void{
var _local1:Object;
var _local2:TextFormat;
var _local3:TextFormat;
_local1 = UIComponent.getStyleDefinition();
_local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
_local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition()));
}
}
}//package fl.controls
Section 30
//Slider (fl.controls.Slider)
package fl.controls {
import flash.events.*;
import flash.display.*;
import fl.core.*;
import fl.managers.*;
import fl.events.*;
import flash.ui.*;
public class Slider extends UIComponent implements IFocusManagerComponent {
protected var _direction:String;
protected var _liveDragging:Boolean;// = false
protected var _value:Number;// = 0
protected var _snapInterval:Number;// = 0
protected var _minimum:Number;// = 0
protected var _maximum:Number;// = 10
protected var track:BaseButton;
protected var _tickInterval:Number;// = 0
protected var tickContainer:Sprite;
protected var thumb:BaseButton;
protected static const TICK_STYLES:Object = {upSkin:"tickSkin"};
protected static const TRACK_STYLES:Object = {upSkin:"sliderTrackSkin", overSkin:"sliderTrackSkin", downSkin:"sliderTrackSkin", disabledSkin:"sliderTrackDisabledSkin"};
protected static const THUMB_STYLES:Object = {upSkin:"thumbUpSkin", overSkin:"thumbOverSkin", downSkin:"thumbDownSkin", disabledSkin:"thumbDisabledSkin"};
protected static var defaultStyles:Object = {thumbUpSkin:"SliderThumb_upSkin", thumbOverSkin:"SliderThumb_overSkin", thumbDownSkin:"SliderThumb_downSkin", thumbDisabledSkin:"SliderThumb_disabledSkin", sliderTrackSkin:"SliderTrack_skin", sliderTrackDisabledSkin:"SliderTrack_disabledSkin", tickSkin:"SliderTick_skin", focusRectSkin:null, focusRectPadding:null};
public function Slider(){
_direction = SliderDirection.HORIZONTAL;
_minimum = 0;
_maximum = 10;
_value = 0;
_tickInterval = 0;
_snapInterval = 0;
_liveDragging = false;
super();
setStyles();
}
public function get minimum():Number{
return (_minimum);
}
public function set minimum(_arg1:Number):void{
_minimum = _arg1;
this.value = Math.max(_arg1, this.value);
invalidate(InvalidationType.DATA);
}
public function get maximum():Number{
return (_maximum);
}
protected function positionThumb():void{
thumb.x = ((((_direction)==SliderDirection.VERTICAL) ? ((maximum - minimum) - value) : (value - minimum) / (maximum - minimum)) * _width);
}
protected function clearTicks():void{
if (((!(tickContainer)) || (!(tickContainer.parent)))){
return;
};
removeChild(tickContainer);
}
protected function onTrackClick(_arg1:MouseEvent):void{
calculateValue(track.mouseX, InteractionInputType.MOUSE, SliderEventClickTarget.TRACK);
if (!liveDragging){
dispatchEvent(new SliderEvent(SliderEvent.CHANGE, value, SliderEventClickTarget.TRACK, InteractionInputType.MOUSE));
};
}
public function set maximum(_arg1:Number):void{
_maximum = _arg1;
this.value = Math.min(_arg1, this.value);
invalidate(InvalidationType.DATA);
}
public function get liveDragging():Boolean{
return (_liveDragging);
}
protected function doDrag(_arg1:MouseEvent):void{
var _local2:Number;
var _local3:Number;
_local2 = (_width / snapInterval);
_local3 = track.mouseX;
calculateValue(_local3, InteractionInputType.MOUSE, SliderEventClickTarget.THUMB);
dispatchEvent(new SliderEvent(SliderEvent.THUMB_DRAG, value, SliderEventClickTarget.THUMB, InteractionInputType.MOUSE));
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:uint;
var _local3:Number;
var _local4:Boolean;
if (!enabled){
return;
};
_local2 = ((snapInterval)>0) ? snapInterval : 1;
_local4 = (direction == SliderDirection.HORIZONTAL);
if ((((((_arg1.keyCode == Keyboard.DOWN)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.LEFT)) && (_local4))))){
_local3 = (value - _local2);
} else {
if ((((((_arg1.keyCode == Keyboard.UP)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.RIGHT)) && (_local4))))){
_local3 = (value + _local2);
} else {
if ((((((_arg1.keyCode == Keyboard.PAGE_DOWN)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.HOME)) && (_local4))))){
_local3 = minimum;
} else {
if ((((((_arg1.keyCode == Keyboard.PAGE_UP)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.END)) && (_local4))))){
_local3 = maximum;
};
};
};
};
if (!isNaN(_local3)){
_arg1.stopPropagation();
doSetValue(_local3, InteractionInputType.KEYBOARD, null, _arg1.keyCode);
};
}
override public function set enabled(_arg1:Boolean):void{
if (enabled == _arg1){
return;
};
super.enabled = _arg1;
track.enabled = (thumb.enabled = _arg1);
}
protected function thumbPressHandler(_arg1:MouseEvent):void{
stage.addEventListener(MouseEvent.MOUSE_MOVE, doDrag, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler, false, 0, true);
dispatchEvent(new SliderEvent(SliderEvent.THUMB_PRESS, value, InteractionInputType.MOUSE, SliderEventClickTarget.THUMB));
}
public function get snapInterval():Number{
return (_snapInterval);
}
protected function thumbReleaseHandler(_arg1:MouseEvent):void{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, doDrag);
stage.removeEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler);
dispatchEvent(new SliderEvent(SliderEvent.THUMB_RELEASE, value, InteractionInputType.MOUSE, SliderEventClickTarget.THUMB));
dispatchEvent(new SliderEvent(SliderEvent.CHANGE, value, SliderEventClickTarget.THUMB, InteractionInputType.MOUSE));
}
public function set liveDragging(_arg1:Boolean):void{
_liveDragging = _arg1;
}
public function set value(_arg1:Number):void{
doSetValue(_arg1);
}
public function set direction(_arg1:String):void{
var _local2:Boolean;
_direction = _arg1;
_local2 = (_direction == SliderDirection.VERTICAL);
if (isLivePreview){
if (_local2){
setScaleY(-1);
y = track.height;
} else {
setScaleY(1);
y = 0;
};
positionThumb();
return;
};
if (((_local2) && (componentInspectorSetting))){
if ((rotation % 90) == 0){
setScaleY(-1);
};
};
if (!componentInspectorSetting){
rotation = (_local2) ? 90 : 0;
};
}
public function set tickInterval(_arg1:Number):void{
_tickInterval = _arg1;
invalidate(InvalidationType.SIZE);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES)){
setStyles();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
track.setSize(_width, track.height);
track.drawNow();
thumb.drawNow();
};
if (tickInterval > 0){
drawTicks();
} else {
clearTicks();
};
positionThumb();
super.draw();
}
override protected function configUI():void{
super.configUI();
thumb = new BaseButton();
thumb.setSize(13, 13);
thumb.autoRepeat = false;
addChild(thumb);
thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbPressHandler, false, 0, true);
track = new BaseButton();
track.move(0, 0);
track.setSize(80, 4);
track.autoRepeat = false;
track.useHandCursor = false;
track.addEventListener(MouseEvent.CLICK, onTrackClick, false, 0, true);
addChildAt(track, 0);
}
public function set snapInterval(_arg1:Number):void{
_snapInterval = _arg1;
}
public function get value():Number{
return (_value);
}
public function get direction():String{
return (_direction);
}
public function get tickInterval():Number{
return (_tickInterval);
}
override public function setSize(_arg1:Number, _arg2:Number):void{
if ((((_direction == SliderDirection.VERTICAL)) && (!(isLivePreview)))){
super.setSize(_arg2, _arg1);
} else {
super.setSize(_arg1, _arg2);
};
invalidate(InvalidationType.SIZE);
}
protected function drawTicks():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:uint;
var _local5:DisplayObject;
clearTicks();
tickContainer = new Sprite();
_local1 = ((maximum)<1) ? (tickInterval / 100) : tickInterval;
_local2 = ((maximum - minimum) / _local1);
_local3 = (_width / _local2);
_local4 = 0;
while (_local4 <= _local2) {
_local5 = getDisplayObjectInstance(getStyleValue("tickSkin"));
_local5.x = (_local3 * _local4);
_local5.y = ((track.y - _local5.height) - 2);
tickContainer.addChild(_local5);
_local4++;
};
addChild(tickContainer);
}
protected function calculateValue(_arg1:Number, _arg2:String, _arg3:String, _arg4:int=undefined):void{
var _local5:Number;
_local5 = ((_arg1 / _width) * (maximum - minimum));
if (_direction == SliderDirection.VERTICAL){
_local5 = (maximum - _local5);
} else {
_local5 = (minimum + _local5);
};
doSetValue(_local5, _arg2, _arg3, _arg4);
}
protected function getPrecision(_arg1:Number):Number{
var _local2:String;
_local2 = _arg1.toString();
if (_local2.indexOf(".") == -1){
return (0);
};
return (_local2.split(".").pop().length);
}
protected function doSetValue(_arg1:Number, _arg2:String=null, _arg3:String=null, _arg4:int=undefined):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local5 = _value;
if (((!((_snapInterval == 0))) && (!((_snapInterval == 1))))){
_local6 = Math.pow(10, getPrecision(snapInterval));
_local7 = (_snapInterval * _local6);
_local8 = Math.round((_arg1 * _local6));
_local9 = (Math.round((_local8 / _local7)) * _local7);
_arg1 = (_local9 / _local6);
_value = Math.max(minimum, Math.min(maximum, _arg1));
} else {
_value = Math.max(minimum, Math.min(maximum, Math.round(_arg1)));
};
if (((!((_local5 == _value))) && (((((liveDragging) && (!((_arg3 == null))))) || ((_arg2 == InteractionInputType.KEYBOARD)))))){
dispatchEvent(new SliderEvent(SliderEvent.CHANGE, value, _arg3, _arg2, _arg4));
};
positionThumb();
}
protected function setStyles():void{
copyStylesToChild(thumb, THUMB_STYLES);
copyStylesToChild(track, TRACK_STYLES);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 31
//SliderDirection (fl.controls.SliderDirection)
package fl.controls {
public class SliderDirection {
public static var HORIZONTAL:String = "horizontal";
public static var VERTICAL:String = "vertical";
}
}//package fl.controls
Section 32
//ComponentShim (fl.core.ComponentShim)
package fl.core {
import flash.display.*;
public dynamic class ComponentShim extends MovieClip {
}
}//package fl.core
Section 33
//InvalidationType (fl.core.InvalidationType)
package fl.core {
public class InvalidationType {
public static const SIZE:String = "size";
public static const ALL:String = "all";
public static const DATA:String = "data";
public static const SCROLL:String = "scroll";
public static const STATE:String = "state";
public static const STYLES:String = "styles";
public static const SELECTED:String = "selected";
public static const RENDERER_STYLES:String = "rendererStyles";
}
}//package fl.core
Section 34
//UIComponent (fl.core.UIComponent)
package fl.core {
import flash.events.*;
import flash.display.*;
import fl.managers.*;
import fl.events.*;
import flash.utils.*;
import flash.text.*;
import flash.system.*;
public class UIComponent extends Sprite {
protected var _enabled:Boolean;// = true
private var _mouseFocusEnabled:Boolean;// = true
protected var startHeight:Number;
protected var _height:Number;
protected var _oldIMEMode:String;// = null
protected var startWidth:Number;
public var focusTarget:IFocusManagerComponent;
protected var errorCaught:Boolean;// = false
protected var uiFocusRect:DisplayObject;
protected var _width:Number;
public var version:String;// = "3.0.0.15"
protected var isFocused:Boolean;// = false
protected var callLaterMethods:Dictionary;
private var _focusEnabled:Boolean;// = true
private var tempText:TextField;
protected var invalidateFlag:Boolean;// = false
protected var _inspector:Boolean;// = false
protected var sharedStyles:Object;
protected var invalidHash:Object;
protected var isLivePreview:Boolean;// = false
protected var _imeMode:String;// = null
protected var instanceStyles:Object;
protected var _x:Number;
protected var _y:Number;
public static var inCallLaterPhase:Boolean = false;
private static var defaultStyles:Object = {focusRectSkin:"focusRectSkin", focusRectPadding:2, textFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), disabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultTextFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultDisabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0)};
public static var createAccessibilityImplementation:Function;
private static var focusManagers:Dictionary = new Dictionary(false);
public function UIComponent(){
version = "3.0.0.15";
isLivePreview = false;
invalidateFlag = false;
_enabled = true;
isFocused = false;
_focusEnabled = true;
_mouseFocusEnabled = true;
_imeMode = null;
_oldIMEMode = null;
errorCaught = false;
_inspector = false;
super();
instanceStyles = {};
sharedStyles = {};
invalidHash = {};
callLaterMethods = new Dictionary();
StyleManager.registerInstance(this);
configUI();
invalidate(InvalidationType.ALL);
tabEnabled = (this is IFocusManagerComponent);
focusRect = false;
if (tabEnabled){
addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
};
initializeFocusManager();
addEventListener(Event.ENTER_FRAME, hookAccessibility, false, 0, true);
}
public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
isFocused = _arg1;
if (((!((uiFocusRect == null))) && (contains(uiFocusRect)))){
removeChild(uiFocusRect);
uiFocusRect = null;
};
if (_arg1){
uiFocusRect = (getDisplayObjectInstance(getStyleValue("focusRectSkin")) as Sprite);
if (uiFocusRect == null){
return;
};
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.x = -(_local2);
uiFocusRect.y = -(_local2);
uiFocusRect.width = (width + (_local2 * 2));
uiFocusRect.height = (height + (_local2 * 2));
addChildAt(uiFocusRect, 0);
};
}
private function callLaterDispatcher(_arg1:Event):void{
var _local2:Dictionary;
var _local3:Object;
if (_arg1.type == Event.ADDED_TO_STAGE){
removeEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher);
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
return;
};
_arg1.target.removeEventListener(Event.RENDER, callLaterDispatcher);
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
return;
};
inCallLaterPhase = true;
_local2 = callLaterMethods;
for (_local3 in _local2) {
_local3();
delete _local2[_local3];
};
inCallLaterPhase = false;
}
private function addedHandler(_arg1:Event):void{
removeEventListener("addedToStage", addedHandler);
initializeFocusManager();
}
protected function getStyleValue(_arg1:String):Object{
return (((instanceStyles[_arg1])==null) ? sharedStyles[_arg1] : instanceStyles[_arg1]);
}
protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((_arg1 == this));
}
override public function get scaleX():Number{
return ((width / startWidth));
}
override public function get scaleY():Number{
return ((height / startHeight));
}
override public function set height(_arg1:Number):void{
if (_height == _arg1){
return;
};
setSize(width, _arg1);
}
protected function keyDownHandler(_arg1:KeyboardEvent):void{
}
protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
if (isOurFocus((_arg1.target as DisplayObject))){
_local2 = focusManager;
if (((_local2) && (_local2.showFocusIndicator))){
drawFocus(true);
isFocused = true;
};
};
}
public function setStyle(_arg1:String, _arg2:Object):void{
if ((((instanceStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
instanceStyles[_arg1] = _arg2;
invalidate(InvalidationType.STYLES);
}
override public function get visible():Boolean{
return (super.visible);
}
public function get componentInspectorSetting():Boolean{
return (_inspector);
}
override public function get x():Number{
return ((isNaN(_x)) ? super.x : _x);
}
override public function get y():Number{
return ((isNaN(_y)) ? super.y : _y);
}
protected function setIMEMode(_arg1:Boolean){
var enabled = _arg1;
if (_imeMode != null){
if (enabled){
IME.enabled = true;
_oldIMEMode = IME.conversionMode;
try {
if (((!(errorCaught)) && (!((IME.conversionMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _imeMode;
};
errorCaught = false;
} catch(e:Error) {
errorCaught = true;
throw (new Error(("IME mode not supported: " + _imeMode)));
};
} else {
if (((!((IME.conversionMode == IMEConversionMode.UNKNOWN))) && (!((_oldIMEMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _oldIMEMode;
};
IME.enabled = false;
};
};
}
public function set enabled(_arg1:Boolean):void{
if (_arg1 == _enabled){
return;
};
_enabled = _arg1;
invalidate(InvalidationType.STATE);
}
public function setSharedStyle(_arg1:String, _arg2:Object):void{
if ((((sharedStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
sharedStyles[_arg1] = _arg2;
if (instanceStyles[_arg1] == null){
invalidate(InvalidationType.STYLES);
};
}
protected function keyUpHandler(_arg1:KeyboardEvent):void{
}
public function set focusEnabled(_arg1:Boolean):void{
_focusEnabled = _arg1;
}
override public function set scaleX(_arg1:Number):void{
setSize((startWidth * _arg1), height);
}
public function get mouseFocusEnabled():Boolean{
return (_mouseFocusEnabled);
}
override public function set scaleY(_arg1:Number):void{
setSize(width, (startHeight * _arg1));
}
protected function getDisplayObjectInstance(_arg1:Object):DisplayObject{
var classDef:Object;
var skin = _arg1;
classDef = null;
if ((skin is Class)){
return ((new (skin) as DisplayObject));
};
if ((skin is DisplayObject)){
(skin as DisplayObject).x = 0;
(skin as DisplayObject).y = 0;
return ((skin as DisplayObject));
};
try {
classDef = getDefinitionByName(skin.toString());
} catch(e:Error) {
try {
classDef = (loaderInfo.applicationDomain.getDefinition(skin.toString()) as Object);
} catch(e:Error) {
};
};
if (classDef == null){
return (null);
};
return ((new (classDef) as DisplayObject));
}
protected function copyStylesToChild(_arg1:UIComponent, _arg2:Object):void{
var _local3:String;
for (_local3 in _arg2) {
_arg1.setStyle(_local3, getStyleValue(_arg2[_local3]));
};
}
protected function beforeComponentParameters():void{
}
protected function callLater(_arg1:Function):void{
if (inCallLaterPhase){
return;
};
callLaterMethods[_arg1] = true;
if (stage != null){
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
} else {
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
};
}
protected function createFocusManager():void{
if (focusManagers[stage] == null){
focusManagers[stage] = new FocusManager(stage);
};
}
override public function set visible(_arg1:Boolean):void{
var _local2:String;
if (super.visible == _arg1){
return;
};
super.visible = _arg1;
_local2 = (_arg1) ? ComponentEvent.SHOW : ComponentEvent.HIDE;
dispatchEvent(new ComponentEvent(_local2, true));
}
protected function hookAccessibility(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, hookAccessibility);
initializeAccessibility();
}
public function set componentInspectorSetting(_arg1:Boolean):void{
_inspector = _arg1;
if (_inspector){
beforeComponentParameters();
} else {
afterComponentParameters();
};
}
override public function set x(_arg1:Number):void{
move(_arg1, _y);
}
public function drawNow():void{
draw();
}
override public function set y(_arg1:Number):void{
move(_x, _arg1);
}
protected function checkLivePreview():Boolean{
var className:String;
if (parent == null){
return (false);
};
try {
className = getQualifiedClassName(parent);
} catch(e:Error) {
};
return ((className == "fl.livepreview::LivePreviewParent"));
}
protected function focusOutHandler(_arg1:FocusEvent):void{
if (isOurFocus((_arg1.target as DisplayObject))){
drawFocus(false);
isFocused = false;
};
}
public function set mouseFocusEnabled(_arg1:Boolean):void{
_mouseFocusEnabled = _arg1;
}
public function getFocus():InteractiveObject{
if (stage){
return (stage.focus);
};
return (null);
}
protected function validate():void{
invalidHash = {};
}
override public function get height():Number{
return (_height);
}
public function invalidate(_arg1:String="all", _arg2:Boolean=true):void{
invalidHash[_arg1] = true;
if (_arg2){
this.callLater(draw);
};
}
public function get enabled():Boolean{
return (_enabled);
}
protected function getScaleX():Number{
return (super.scaleX);
}
protected function getScaleY():Number{
return (super.scaleY);
}
public function get focusEnabled():Boolean{
return (_focusEnabled);
}
protected function afterComponentParameters():void{
}
protected function draw():void{
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
protected function configUI():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
isLivePreview = checkLivePreview();
_local1 = rotation;
rotation = 0;
_local2 = super.width;
_local3 = super.height;
var _local4 = 1;
super.scaleY = _local4;
super.scaleX = _local4;
setSize(_local2, _local3);
move(super.x, super.y);
rotation = _local1;
startWidth = _local2;
startHeight = _local3;
if (numChildren > 0){
removeChildAt(0);
};
}
protected function setScaleX(_arg1:Number):void{
super.scaleX = _arg1;
}
protected function setScaleY(_arg1:Number):void{
super.scaleY = _arg1;
}
private function initializeFocusManager():void{
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true);
} else {
createFocusManager();
};
}
public function set focusManager(_arg1:IFocusManager):void{
UIComponent.focusManagers[this] = _arg1;
}
public function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
protected function isInvalid(_arg1:String, ... _args):Boolean{
if (((invalidHash[_arg1]) || (invalidHash[InvalidationType.ALL]))){
return (true);
};
while (_args.length > 0) {
if (invalidHash[_args.pop()]){
return (true);
};
};
return (false);
}
public function setSize(_arg1:Number, _arg2:Number):void{
_width = _arg1;
_height = _arg2;
invalidate(InvalidationType.SIZE);
dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, false));
}
override public function set width(_arg1:Number):void{
if (_width == _arg1){
return;
};
setSize(_arg1, height);
}
public function setFocus():void{
if (stage){
stage.focus = this;
};
}
protected function initializeAccessibility():void{
if (UIComponent.createAccessibilityImplementation != null){
UIComponent.createAccessibilityImplementation(this);
};
}
public function get focusManager():IFocusManager{
var _local1:DisplayObject;
_local1 = this;
while (_local1) {
if (UIComponent.focusManagers[_local1] != null){
return (IFocusManager(UIComponent.focusManagers[_local1]));
};
_local1 = _local1.parent;
};
return (null);
}
override public function get width():Number{
return (_width);
}
public function move(_arg1:Number, _arg2:Number):void{
_x = _arg1;
_y = _arg2;
super.x = Math.round(_arg1);
super.y = Math.round(_arg2);
dispatchEvent(new ComponentEvent(ComponentEvent.MOVE));
}
public function validateNow():void{
invalidate(InvalidationType.ALL, false);
draw();
}
public function getStyle(_arg1:String):Object{
return (instanceStyles[_arg1]);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
public static function mergeStyles(... _args):Object{
var _local2:Object;
var _local3:uint;
var _local4:uint;
var _local5:Object;
var _local6:String;
_local2 = {};
_local3 = _args.length;
_local4 = 0;
while (_local4 < _local3) {
_local5 = _args[_local4];
for (_local6 in _local5) {
if (_local2[_local6] != null){
} else {
_local2[_local6] = _args[_local4][_local6];
};
};
_local4++;
};
return (_local2);
}
}
}//package fl.core
Section 35
//ComponentEvent (fl.events.ComponentEvent)
package fl.events {
import flash.events.*;
public class ComponentEvent extends Event {
public static const HIDE:String = "hide";
public static const BUTTON_DOWN:String = "buttonDown";
public static const MOVE:String = "move";
public static const RESIZE:String = "resize";
public static const ENTER:String = "enter";
public static const LABEL_CHANGE:String = "labelChange";
public static const SHOW:String = "show";
public function ComponentEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function toString():String{
return (formatToString("ComponentEvent", "type", "bubbles", "cancelable"));
}
override public function clone():Event{
return (new ComponentEvent(type, bubbles, cancelable));
}
}
}//package fl.events
Section 36
//InteractionInputType (fl.events.InteractionInputType)
package fl.events {
public class InteractionInputType {
public static const MOUSE:String = "mouse";
public static const KEYBOARD:String = "keyboard";
}
}//package fl.events
Section 37
//SliderEvent (fl.events.SliderEvent)
package fl.events {
import flash.events.*;
public class SliderEvent extends Event {
protected var _triggerEvent:String;
protected var _keyCode:Number;
protected var _value:Number;
protected var _clickTarget:String;
public static const CHANGE:String = "change";
public static const THUMB_PRESS:String = "thumbPress";
public static const THUMB_DRAG:String = "thumbDrag";
public static const THUMB_RELEASE:String = "thumbRelease";
public function SliderEvent(_arg1:String, _arg2:Number, _arg3:String, _arg4:String, _arg5:int=0){
_value = _arg2;
_keyCode = _arg5;
_triggerEvent = _arg4;
_clickTarget = _arg3;
super(_arg1);
}
public function get clickTarget():String{
return (_clickTarget);
}
override public function clone():Event{
return (new SliderEvent(type, _value, _clickTarget, _triggerEvent, _keyCode));
}
override public function toString():String{
return (formatToString("SliderEvent", "type", "value", "bubbles", "cancelable", "keyCode", "triggerEvent", "clickTarget"));
}
public function get triggerEvent():String{
return (_triggerEvent);
}
public function get value():Number{
return (_value);
}
public function get keyCode():Number{
return (_keyCode);
}
}
}//package fl.events
Section 38
//SliderEventClickTarget (fl.events.SliderEventClickTarget)
package fl.events {
public class SliderEventClickTarget {
public static const TRACK:String = "track";
public static const THUMB:String = "thumb";
}
}//package fl.events
Section 39
//FocusManager (fl.managers.FocusManager)
package fl.managers {
import flash.events.*;
import flash.display.*;
import fl.controls.*;
import fl.core.*;
import flash.utils.*;
import flash.text.*;
import flash.ui.*;
public class FocusManager implements IFocusManager {
private var focusableObjects:Dictionary;
private var _showFocusIndicator:Boolean;// = true
private var defButton:Button;
private var focusableCandidates:Array;
private var _form:DisplayObjectContainer;
private var _defaultButtonEnabled:Boolean;// = true
private var activated:Boolean;// = false
private var _defaultButton:Button;
private var calculateCandidates:Boolean;// = true
private var lastFocus:InteractiveObject;
private var lastAction:String;
public function FocusManager(_arg1:DisplayObjectContainer){
activated = false;
calculateCandidates = true;
_showFocusIndicator = true;
_defaultButtonEnabled = true;
super();
focusableObjects = new Dictionary(true);
if (_arg1 != null){
_form = _arg1;
addFocusables(DisplayObject(_arg1));
_arg1.addEventListener(Event.ADDED, addedHandler);
_arg1.addEventListener(Event.REMOVED, removedHandler);
activate();
};
}
public function get showFocusIndicator():Boolean{
return (_showFocusIndicator);
}
private function getIndexOfNextObject(_arg1:int, _arg2:Boolean, _arg3:Boolean, _arg4:String):int{
var _local5:int;
var _local6:int;
var _local7:DisplayObject;
var _local8:IFocusManagerGroup;
var _local9:int;
var _local10:DisplayObject;
var _local11:IFocusManagerGroup;
_local5 = focusableCandidates.length;
_local6 = _arg1;
while (true) {
if (_arg2){
_arg1--;
} else {
_arg1++;
};
if (_arg3){
if (((_arg2) && ((_arg1 < 0)))){
break;
};
if (((!(_arg2)) && ((_arg1 == _local5)))){
break;
};
} else {
_arg1 = ((_arg1 + _local5) % _local5);
if (_local6 == _arg1){
break;
};
};
if (isValidFocusCandidate(focusableCandidates[_arg1], _arg4)){
_local7 = DisplayObject(findFocusManagerComponent(focusableCandidates[_arg1]));
if ((_local7 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local7);
_local9 = 0;
while (_local9 < focusableCandidates.length) {
_local10 = focusableCandidates[_local9];
if ((_local10 is IFocusManagerGroup)){
_local11 = IFocusManagerGroup(_local10);
if ((((_local11.groupName == _local8.groupName)) && (_local11.selected))){
_arg1 = _local9;
break;
};
};
_local9++;
};
};
return (_arg1);
};
};
return (_arg1);
}
public function set form(_arg1:DisplayObjectContainer):void{
_form = _arg1;
}
private function addFocusables(_arg1:DisplayObject, _arg2:Boolean=false):void{
var focusable:IFocusManagerComponent;
var io:InteractiveObject;
var doc:DisplayObjectContainer;
var i:int;
var child:DisplayObject;
var o = _arg1;
var skipTopLevel = _arg2;
if (!skipTopLevel){
if ((o is IFocusManagerComponent)){
focusable = IFocusManagerComponent(o);
if (focusable.focusEnabled){
if (((focusable.tabEnabled) && (isTabVisible(o)))){
focusableObjects[o] = true;
calculateCandidates = true;
};
o.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
o.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
} else {
if ((o is InteractiveObject)){
io = (o as InteractiveObject);
if (((((io) && (io.tabEnabled))) && ((findFocusManagerComponent(io) == io)))){
focusableObjects[io] = true;
calculateCandidates = true;
};
io.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
io.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
};
};
if ((o is DisplayObjectContainer)){
doc = DisplayObjectContainer(o);
o.addEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
if ((((((doc is Stage)) || ((doc.parent is Stage)))) || (doc.tabChildren))){
i = 0;
while (i < doc.numChildren) {
try {
child = doc.getChildAt(i);
if (child != null){
addFocusables(doc.getChildAt(i));
};
} catch(error:SecurityError) {
};
i = (i + 1);
};
};
};
}
private function getChildIndex(_arg1:DisplayObjectContainer, _arg2:DisplayObject):int{
return (_arg1.getChildIndex(_arg2));
}
private function mouseFocusChangeHandler(_arg1:FocusEvent):void{
if ((_arg1.relatedObject is TextField)){
return;
};
_arg1.preventDefault();
}
private function focusOutHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
_local2 = (_arg1.target as InteractiveObject);
}
private function isValidFocusCandidate(_arg1:DisplayObject, _arg2:String):Boolean{
var _local3:IFocusManagerGroup;
if (!isEnabledAndVisible(_arg1)){
return (false);
};
if ((_arg1 is IFocusManagerGroup)){
_local3 = IFocusManagerGroup(_arg1);
if (_arg2 == _local3.groupName){
return (false);
};
};
return (true);
}
public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{
var _local2:InteractiveObject;
_local2 = _arg1;
while (_arg1) {
if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
};
return (_local2);
}
private function sortFocusableObjectsTabIndex():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))){
focusableCandidates.push(_local2);
};
};
focusableCandidates.sort(sortByTabIndex);
}
private function removeFocusables(_arg1:DisplayObject):void{
var _local2:Object;
var _local3:DisplayObject;
if ((_arg1 is DisplayObjectContainer)){
_arg1.removeEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
_arg1.removeEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
for (_local2 in focusableObjects) {
_local3 = DisplayObject(_local2);
if (DisplayObjectContainer(_arg1).contains(_local3)){
if (_local3 == lastFocus){
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local2];
calculateCandidates = true;
};
};
};
}
private function addedHandler(_arg1:Event):void{
var _local2:DisplayObject;
_local2 = DisplayObject(_arg1.target);
if (_local2.stage){
addFocusables(DisplayObject(_arg1.target));
};
}
private function getTopLevelFocusTarget(_arg1:InteractiveObject):InteractiveObject{
while (_arg1 != InteractiveObject(form)) {
if ((((((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))) && (IFocusManagerComponent(_arg1).mouseFocusEnabled))) && (UIComponent(_arg1).enabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
if (_arg1 == null){
break;
};
};
return (null);
}
private function tabChildrenChangeHandler(_arg1:Event):void{
var _local2:DisplayObjectContainer;
if (_arg1.target != _arg1.currentTarget){
return;
};
calculateCandidates = true;
_local2 = DisplayObjectContainer(_arg1.target);
if (_local2.tabChildren){
addFocusables(_local2, true);
} else {
removeFocusables(_local2);
};
}
public function sendDefaultButtonEvent():void{
defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
public function getFocus():InteractiveObject{
var _local1:InteractiveObject;
_local1 = form.stage.focus;
return (findFocusManagerComponent(_local1));
}
private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
var _local3:TextField;
var _local4:SimpleButton;
_local2 = DisplayObject(form).parent;
while (_arg1 != _local2) {
if ((_arg1 is UIComponent)){
if (!UIComponent(_arg1).enabled){
return (false);
};
} else {
if ((_arg1 is TextField)){
_local3 = TextField(_arg1);
if ((((_local3.type == TextFieldType.DYNAMIC)) || (!(_local3.selectable)))){
return (false);
};
} else {
if ((_arg1 is SimpleButton)){
_local4 = SimpleButton(_arg1);
if (!_local4.enabled){
return (false);
};
};
};
};
if (!_arg1.visible){
return (false);
};
_arg1 = _arg1.parent;
};
return (true);
}
public function set defaultButton(_arg1:Button):void{
var _local2:Button;
_local2 = (_arg1) ? Button(_arg1) : null;
if (_local2 != _defaultButton){
if (_defaultButton){
_defaultButton.emphasized = false;
};
if (defButton){
defButton.emphasized = false;
};
_defaultButton = _local2;
defButton = _local2;
if (_local2){
_local2.emphasized = true;
};
};
}
private function deactivateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
}
public function setFocus(_arg1:InteractiveObject):void{
if ((_arg1 is IFocusManagerComponent)){
IFocusManagerComponent(_arg1).setFocus();
} else {
form.stage.focus = _arg1;
};
}
private function setFocusToNextObject(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
if (!hasFocusableObjects()){
return;
};
_local2 = getNextFocusManagerComponent(_arg1.shiftKey);
if (_local2){
setFocus(_local2);
};
}
private function hasFocusableObjects():Boolean{
var _local1:Object;
for (_local1 in focusableObjects) {
return (true);
};
return (false);
}
private function tabIndexChangeHandler(_arg1:Event):void{
calculateCandidates = true;
}
private function sortFocusableObjects():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))) && ((_local2.tabIndex > 0)))){
sortFocusableObjectsTabIndex();
return;
};
focusableCandidates.push(_local2);
};
focusableCandidates.sort(sortByDepth);
}
private function keyFocusChangeHandler(_arg1:FocusEvent):void{
showFocusIndicator = true;
if ((((((_arg1.keyCode == Keyboard.TAB)) || ((_arg1.keyCode == 0)))) && (!(_arg1.isDefaultPrevented())))){
setFocusToNextObject(_arg1);
_arg1.preventDefault();
};
}
private function getIndexOfFocusedObject(_arg1:DisplayObject):int{
var _local2:int;
var _local3:int;
_local2 = focusableCandidates.length;
_local3 = 0;
_local3 = 0;
while (_local3 < _local2) {
if (focusableCandidates[_local3] == _arg1){
return (_local3);
};
_local3++;
};
return (-1);
}
public function hideFocus():void{
}
private function removedHandler(_arg1:Event):void{
var _local2:int;
var _local3:DisplayObject;
var _local4:InteractiveObject;
_local3 = DisplayObject(_arg1.target);
if ((((_local3 is IFocusManagerComponent)) && ((focusableObjects[_local3] == true)))){
if (_local3 == lastFocus){
IFocusManagerComponent(lastFocus).drawFocus(false);
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local3];
calculateCandidates = true;
} else {
if ((((_local3 is InteractiveObject)) && ((focusableObjects[_local3] == true)))){
_local4 = (_local3 as InteractiveObject);
if (_local4){
if (_local4 == lastFocus){
lastFocus = null;
};
delete focusableObjects[_local4];
calculateCandidates = true;
};
_local3.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
};
};
removeFocusables(_local3);
}
private function sortByDepth(_arg1:InteractiveObject, _arg2:InteractiveObject):Number{
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:String;
var _local7:String;
var _local8:String;
var _local9:DisplayObject;
var _local10:DisplayObject;
_local3 = "";
_local4 = "";
_local8 = "0000";
_local9 = DisplayObject(_arg1);
_local10 = DisplayObject(_arg2);
while (((!((_local9 == DisplayObject(form)))) && (_local9.parent))) {
_local5 = getChildIndex(_local9.parent, _local9);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local3 = (_local7 + _local3);
_local9 = _local9.parent;
};
while (((!((_local10 == DisplayObject(form)))) && (_local10.parent))) {
_local5 = getChildIndex(_local10.parent, _local10);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local4 = (_local7 + _local4);
_local10 = _local10.parent;
};
return (((_local3 > _local4)) ? 1 : ((_local3 < _local4)) ? -1 : 0);
}
public function get defaultButton():Button{
return (_defaultButton);
}
private function activateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
if (lastFocus){
if ((lastFocus is IFocusManagerComponent)){
IFocusManagerComponent(lastFocus).setFocus();
} else {
form.stage.focus = lastFocus;
};
};
lastAction = "ACTIVATE";
}
public function showFocus():void{
}
public function set defaultButtonEnabled(_arg1:Boolean):void{
_defaultButtonEnabled = _arg1;
}
public function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject{
var _local2:DisplayObject;
var _local3:String;
var _local4:int;
var _local5:Boolean;
var _local6:int;
var _local7:int;
var _local8:IFocusManagerGroup;
if (!hasFocusableObjects()){
return (null);
};
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
_local2 = form.stage.focus;
_local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2)));
_local3 = "";
if ((_local2 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local2);
_local3 = _local8.groupName;
};
_local4 = getIndexOfFocusedObject(_local2);
_local5 = false;
_local6 = _local4;
if (_local4 == -1){
if (_arg1){
_local4 = focusableCandidates.length;
};
_local5 = true;
};
_local7 = getIndexOfNextObject(_local4, _arg1, _local5, _local3);
return (findFocusManagerComponent(focusableCandidates[_local7]));
}
private function mouseDownHandler(_arg1:MouseEvent):void{
var _local2:InteractiveObject;
if (_arg1.isDefaultPrevented()){
return;
};
_local2 = getTopLevelFocusTarget(InteractiveObject(_arg1.target));
if (!_local2){
return;
};
showFocusIndicator = false;
if (((((!((_local2 == lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((_local2 is TextField))))){
setFocus(_local2);
};
lastAction = "MOUSEDOWN";
}
private function isTabVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
_local2 = _arg1.parent;
while (((((_local2) && (!((_local2 is Stage))))) && (!(((_local2.parent) && ((_local2.parent is Stage))))))) {
if (!_local2.tabChildren){
return (false);
};
_local2 = _local2.parent;
};
return (true);
}
public function get nextTabIndex():int{
return (0);
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.TAB){
lastAction = "KEY";
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
};
if (((((((defaultButtonEnabled) && ((_arg1.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){
sendDefaultButtonEvent();
};
}
private function focusInHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
var _local3:Button;
_local2 = InteractiveObject(_arg1.target);
if (form.contains(_local2)){
lastFocus = findFocusManagerComponent(InteractiveObject(_local2));
if ((lastFocus is Button)){
_local3 = Button(lastFocus);
if (defButton){
defButton.emphasized = false;
defButton = _local3;
_local3.emphasized = true;
};
} else {
if (((defButton) && (!((defButton == _defaultButton))))){
defButton.emphasized = false;
defButton = _defaultButton;
_defaultButton.emphasized = true;
};
};
};
}
private function tabEnabledChangeHandler(_arg1:Event):void{
var _local2:InteractiveObject;
var _local3:Boolean;
calculateCandidates = true;
_local2 = InteractiveObject(_arg1.target);
_local3 = (focusableObjects[_local2] == true);
if (_local2.tabEnabled){
if (((!(_local3)) && (isTabVisible(_local2)))){
if (!(_local2 is IFocusManagerComponent)){
_local2.focusRect = false;
};
focusableObjects[_local2] = true;
};
} else {
if (_local3){
delete focusableObjects[_local2];
};
};
}
public function set showFocusIndicator(_arg1:Boolean):void{
_showFocusIndicator = _arg1;
}
public function get form():DisplayObjectContainer{
return (_form);
}
private function sortByTabIndex(_arg1:InteractiveObject, _arg2:InteractiveObject):int{
return (((_arg1.tabIndex > _arg2.tabIndex)) ? 1 : ((_arg1.tabIndex < _arg2.tabIndex)) ? -1 : sortByDepth(_arg1, _arg2));
}
public function activate():void{
if (activated){
return;
};
form.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true);
form.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true);
form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true);
form.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = true;
if (lastFocus){
setFocus(lastFocus);
};
}
public function deactivate():void{
form.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler);
form.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.removeEventListener(Event.ACTIVATE, activateHandler);
form.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler);
form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = false;
}
public function get defaultButtonEnabled():Boolean{
return (_defaultButtonEnabled);
}
}
}//package fl.managers
Section 40
//IFocusManager (fl.managers.IFocusManager)
package fl.managers {
import flash.display.*;
import fl.controls.*;
public interface IFocusManager {
function getFocus():InteractiveObject;
function deactivate():void;
function set defaultButton(_arg1:Button):void;
function set showFocusIndicator(_arg1:Boolean):void;
function get defaultButtonEnabled():Boolean;
function get nextTabIndex():int;
function get defaultButton():Button;
function get showFocusIndicator():Boolean;
function setFocus(_arg1:InteractiveObject):void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(_arg1:Boolean):void;
function hideFocus():void;
function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject;
function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject;
}
}//package fl.managers
Section 41
//IFocusManagerComponent (fl.managers.IFocusManagerComponent)
package fl.managers {
public interface IFocusManagerComponent {
function set focusEnabled(_arg1:Boolean):void;
function drawFocus(_arg1:Boolean):void;
function setFocus():void;
function get focusEnabled():Boolean;
function get tabEnabled():Boolean;
function get tabIndex():int;
function get mouseFocusEnabled():Boolean;
}
}//package fl.managers
Section 42
//IFocusManagerGroup (fl.managers.IFocusManagerGroup)
package fl.managers {
public interface IFocusManagerGroup {
function set groupName(_arg1:String):void;
function set selected(_arg1:Boolean):void;
function get groupName():String;
function get selected():Boolean;
}
}//package fl.managers
Section 43
//StyleManager (fl.managers.StyleManager)
package fl.managers {
import fl.core.*;
import flash.utils.*;
import flash.text.*;
public class StyleManager {
private var globalStyles:Object;
private var classToDefaultStylesDict:Dictionary;
private var styleToClassesHash:Object;
private var classToStylesDict:Dictionary;
private var classToInstancesDict:Dictionary;
private static var _instance:StyleManager;
public function StyleManager(){
styleToClassesHash = {};
classToInstancesDict = new Dictionary(true);
classToStylesDict = new Dictionary(true);
classToDefaultStylesDict = new Dictionary(true);
globalStyles = UIComponent.getStyleDefinition();
}
public static function clearComponentStyle(_arg1:Object, _arg2:String):void{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
if (((!((_local4 == null))) && (!((_local4[_arg2] == null))))){
delete _local4[_arg2];
invalidateComponentStyle(_local3, _arg2);
};
}
private static function getClassDef(_arg1:Object):Class{
var component = _arg1;
if ((component is Class)){
return ((component as Class));
};
try {
return ((getDefinitionByName(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
if ((component is UIComponent)){
try {
return ((component.loaderInfo.applicationDomain.getDefinition(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
};
};
};
return (null);
}
public static function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
public static function setComponentStyle(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Class;
var _local5:Object;
_local4 = getClassDef(_arg1);
_local5 = getInstance().classToStylesDict[_local4];
if (_local5 == null){
_local5 = (getInstance().classToStylesDict[_local4] = {});
};
if (_local5 == _arg3){
return;
};
_local5[_arg2] = _arg3;
invalidateComponentStyle(_local4, _arg2);
}
private static function setSharedStyles(_arg1:UIComponent):void{
var _local2:StyleManager;
var _local3:Class;
var _local4:Object;
var _local5:String;
_local2 = getInstance();
_local3 = getClassDef(_arg1);
_local4 = _local2.classToDefaultStylesDict[_local3];
for (_local5 in _local4) {
_arg1.setSharedStyle(_local5, getSharedStyle(_arg1, _local5));
};
}
public static function getComponentStyle(_arg1:Object, _arg2:String):Object{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
return (((_local4)==null) ? null : _local4[_arg2]);
}
private static function getInstance(){
if (_instance == null){
_instance = new (StyleManager);
};
return (_instance);
}
private static function invalidateComponentStyle(_arg1:Class, _arg2:String):void{
var _local3:Dictionary;
var _local4:Object;
var _local5:UIComponent;
_local3 = getInstance().classToInstancesDict[_arg1];
if (_local3 == null){
return;
};
for (_local4 in _local3) {
_local5 = (_local4 as UIComponent);
if (_local5 == null){
} else {
_local5.setSharedStyle(_arg2, getSharedStyle(_local5, _arg2));
};
};
}
private static function invalidateStyle(_arg1:String):void{
var _local2:Dictionary;
var _local3:Object;
_local2 = getInstance().styleToClassesHash[_arg1];
if (_local2 == null){
return;
};
for (_local3 in _local2) {
invalidateComponentStyle(Class(_local3), _arg1);
};
}
public static function registerInstance(_arg1:UIComponent):void{
var inst:StyleManager;
var classDef:Class;
var target:Class;
var defaultStyles:Object;
var styleToClasses:Object;
var n:String;
var instance = _arg1;
inst = getInstance();
classDef = getClassDef(instance);
if (classDef == null){
return;
};
if (inst.classToInstancesDict[classDef] == null){
inst.classToInstancesDict[classDef] = new Dictionary(true);
target = classDef;
while (defaultStyles == null) {
if (target["getStyleDefinition"] != null){
defaultStyles = target["getStyleDefinition"]();
break;
};
try {
target = (instance.loaderInfo.applicationDomain.getDefinition(getQualifiedSuperclassName(target)) as Class);
} catch(err:Error) {
try {
target = (getDefinitionByName(getQualifiedSuperclassName(target)) as Class);
} catch(e:Error) {
defaultStyles = UIComponent.getStyleDefinition();
break;
};
};
};
styleToClasses = inst.styleToClassesHash;
for (n in defaultStyles) {
if (styleToClasses[n] == null){
styleToClasses[n] = new Dictionary(true);
};
styleToClasses[n][classDef] = true;
};
inst.classToDefaultStylesDict[classDef] = defaultStyles;
inst.classToStylesDict[classDef] = {};
};
inst.classToInstancesDict[classDef][instance] = true;
setSharedStyles(instance);
}
public static function getStyle(_arg1:String):Object{
return (getInstance().globalStyles[_arg1]);
}
private static function getSharedStyle(_arg1:UIComponent, _arg2:String):Object{
var _local3:Class;
var _local4:StyleManager;
var _local5:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance();
_local5 = _local4.classToStylesDict[_local3][_arg2];
if (_local5 != null){
return (_local5);
};
_local5 = _local4.globalStyles[_arg2];
if (_local5 != null){
return (_local5);
};
return (_local4.classToDefaultStylesDict[_local3][_arg2]);
}
public static function setStyle(_arg1:String, _arg2:Object):void{
var _local3:Object;
_local3 = getInstance().globalStyles;
if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
_local3[_arg1] = _arg2;
invalidateStyle(_arg1);
}
}
}//package fl.managers
Section 44
//None (fl.transitions.easing.None)
package fl.transitions.easing {
public class None {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package fl.transitions.easing
Section 45
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
public var begin:Number;// = NAN
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var change:Number;// = NAN
private var _finish:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
isPlaying = false;
obj = null;
prop = "";
func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
begin = NaN;
change = NaN;
useSeconds = false;
prevTime = NaN;
prevPos = NaN;
looping = false;
_duration = NaN;
_time = NaN;
_fps = NaN;
_position = NaN;
_startTime = NaN;
_intervalID = 0;
_finish = NaN;
_timer = null;
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean;
_local2 = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 46
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var time:Number;// = NAN
public var position:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
time = NaN;
position = NaN;
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 47
//AISelectButtonGoal (game.goals.AISelectButtonGoal)
package game.goals {
import core.*;
import core.goal.*;
import game.logic.*;
public class AISelectButtonGoal extends Goal {
private var _direction:Boolean;// = false
private var _thinker:AIThinker;// = null
private var _engine:Engine;// = null
private var _button_type:String;
private var _method:Function;// = null
private var _pause:int;// = 0
private var _args:Array;// = null
private static const PAUSE:int = 5;
public function AISelectButtonGoal(_arg1:String, _arg2:AIThinker, _arg3:Function, ... _args){
_thinker = null;
_method = null;
_args = null;
_pause = 0;
_direction = false;
_engine = null;
super();
_engine = Global.top.engine;
_button_type = _arg1;
_thinker = _arg2;
_method = _arg3;
_args = _args;
_direction = ((Math.random() > 0.5)) ? true : false;
}
override public function advance():void{
if (_pause > 0){
_pause--;
if (_pause == 0){
nextStep();
};
return;
};
_pause = PAUSE;
}
private function nextStep():void{
var _local1:*;
_local1 = _engine.playWindowUI.enemyButons.getCurrentButton();
if (_local1.unit_type == _button_type){
makeTheCall();
deactivate();
return;
};
if (_direction){
_engine.playWindowUI.enemyButons.moveSelectionLeft();
} else {
_engine.playWindowUI.enemyButons.moveSelectionRight();
};
}
private function makeTheCall():void{
_method.apply(_thinker, _args);
}
}
}//package game.goals
Section 48
//ArtilleryStrikeGoal (game.goals.ArtilleryStrikeGoal)
package game.goals {
import core.*;
import core.goal.*;
import game.logic.*;
import flash.geom.*;
import game.*;
public class ArtilleryStrikeGoal extends Goal {
private var drop_point:Point;// = null
private var _engine:Engine;// = null
private var _road_index:int;// = 0
private var pause:int;// = 0
private var drop_count:int;// = 0
private static const DROP_PAUSE:int = 15;
public function ArtilleryStrikeGoal(_arg1:int, _arg2:Point, _arg3:int):void{
drop_point = null;
drop_count = 0;
pause = 0;
_engine = null;
_road_index = 0;
super();
_road_index = _arg1;
drop_point = _arg2;
drop_count = _arg3;
_engine = Global.top.engine;
}
override public function advance():void{
var _local1:Point;
if (pause > 0){
pause--;
return;
};
drop_count--;
_local1 = new Point(((drop_point.x + (Math.random() * 120)) - 50), ((drop_point.y + (Math.random() * 30)) - 15));
EffectFactory.makeExplosion(EffectFactory.ASTRIKE_DROP, _local1, 0.5, _engine.gameBoard.getRoadUnitLayer(_road_index));
applyDamage(_local1);
pause = DROP_PAUSE;
if (0 == drop_count){
deactivate();
};
}
private function applyDamage(_arg1:Point):void{
var _local2:Engine;
_local2 = Global.top.engine;
_local2.gameBoard.enemyUnits.applyDamageNear(Consts.ARTILLERY_DAMAGE, _arg1, Consts.ARTILLERY_RANGE, DieMarineGoal.DEATH_BY_EXPLOSION);
_local2.gameBoard.allyUnits.applyDamageNear(Consts.ARTILLERY_DAMAGE, _arg1, Consts.ARTILLERY_RANGE, DieMarineGoal.DEATH_BY_EXPLOSION);
_local2.gameBoard.mines.applyDamageNear(Consts.ARTILLERY_DAMAGE, _arg1, Consts.ARTILLERY_RANGE, DieMarineGoal.DEATH_BY_EXPLOSION);
}
}
}//package game.goals
Section 49
//AttackCaterpillarGoal (game.goals.AttackCaterpillarGoal)
package game.goals {
import core.*;
import game.ui.*;
import game.logic.*;
import game.units.*;
import game.*;
public class AttackCaterpillarGoal extends AttackGoal {
private var inner_was;// = null
private var ready_ticks:int;// = 0
private var recharging_ticks:int;// = 0
private var ready_for_attack:Boolean;// = false
public function AttackCaterpillarGoal(_arg1:Engine, _arg2:Unit):void{
ready_for_attack = false;
recharging_ticks = 0;
ready_ticks = 0;
inner_was = null;
super(_arg1, _arg2);
}
override public function advance():void{
if (recharging_ticks > 0){
recharging_ticks--;
return;
};
if (unit.currentState != Unit.ATTACK){
return;
};
if (StringConsts.WALKING == unit.sprite.currentLabel){
if (!unit.sprite.inner){
return;
};
if (!unit.sprite.inner.stopMoving){
unit.sprite.inner.stopMoving = true;
};
};
if (((attack_target) && ((false == attack_target.isAlive)))){
if (!hasAnotherTarget()){
stopAttack();
};
return;
};
if (!ready_for_attack){
if (unit.sprite.inner.currentlyStopped){
ready_for_attack = true;
unit.sprite.gotoAndStop("attack");
recharging_ticks = (1 + ProcessManager.instance.timeScale);
} else {
return;
};
} else {
doAttack();
recharging_ticks = unit.weapon.recharge_time;
};
}
override public function setTarget(_arg1:Unit):void{
super.setTarget(_arg1);
}
private function doAttack():void{
if (unit.sprite.inner_shooting){
unit.sprite.inner_shooting.gotoAndPlay("shot");
};
runBullet();
}
private function stopAttack():void{
unit.currentState = Unit.WALKING;
unit.sprite.gotoAndStop("walking");
ready_for_attack = false;
attack_target = null;
}
override protected function runBullet():void{
var _local1:LaserBeamGoal;
attack_target.updateBar();
_local1 = new LaserBeamGoal(engine, unit, attack_target, 30);
engine.goalSystem.add(_local1);
}
}
}//package game.goals
Section 50
//AttackGoal (game.goals.AttackGoal)
package game.goals {
import core.goal.*;
import game.logic.*;
import game.units.*;
public class AttackGoal extends Goal {
private var sitting_ticks:int;// = 0
protected var unit:Unit;// = null
protected var engine:Engine;// = null
private var ready_for_attack:Boolean;// = false
private var recharging_ticks:int;// = 0
protected var attack_target:Unit;// = null
public function AttackGoal(_arg1:Engine, _arg2:Unit):void{
engine = null;
unit = null;
attack_target = null;
ready_for_attack = false;
sitting_ticks = 0;
recharging_ticks = 0;
super();
engine = _arg1;
unit = _arg2;
}
public function setTarget(_arg1:Unit):void{
unit.currentState = Unit.ATTACK;
attack_target = _arg1;
}
protected function runBullet():void{
var _local1:BulletGoal;
_local1 = new BulletGoal(engine, unit, attack_target);
engine.goalSystem.add(_local1);
}
protected function hasAnotherTarget():Boolean{
unit.currentState = Unit.WALKING;
unit.life.enemyDetector.advance();
if (Unit.ATTACK == unit.currentState){
return (true);
};
unit.currentState = Unit.ATTACK;
return (false);
}
}
}//package game.goals
Section 51
//AttackGrenadierGoal (game.goals.AttackGrenadierGoal)
package game.goals {
import game.logic.*;
import game.units.*;
public class AttackGrenadierGoal extends AttackRobotGoal {
public function AttackGrenadierGoal(_arg1:Engine, _arg2:Unit):void{
super(_arg1, _arg2);
}
override public function setTarget(_arg1:Unit):void{
ready_for_attack = true;
super.setTarget(_arg1);
recharging_ticks = unit.weapon.recharge_time;
}
override protected function doAttack():void{
engine.gameBoard.killUnit(unit);
deactivate();
}
}
}//package game.goals
Section 52
//AttackMarineGoal (game.goals.AttackMarineGoal)
package game.goals {
import game.ui.*;
import game.logic.*;
import game.units.*;
import game.*;
public class AttackMarineGoal extends AttackGoal {
private var sitting_ticks:int;// = 0
private var ready_for_attack:Boolean;// = false
private var recharging_ticks:int;// = 0
protected var attack_finish_ticks:int;// = 0
public function AttackMarineGoal(_arg1:Engine, _arg2:Unit):void{
ready_for_attack = false;
sitting_ticks = 0;
recharging_ticks = 0;
attack_finish_ticks = 0;
super(_arg1, _arg2);
}
override public function advance():void{
if (attack_finish_ticks > 0){
attack_finish_ticks--;
if (attack_finish_ticks == 0){
if (((attack_target) && ((false == attack_target.isAlive)))){
if (!hasAnotherTarget()){
stopAttack();
};
return;
};
};
};
if (recharging_ticks > 0){
recharging_ticks--;
return;
};
if (unit.currentState != Unit.ATTACK){
return;
};
if (((attack_target) && ((false == attack_target.isAlive)))){
if (!hasAnotherTarget()){
stopAttack();
};
return;
};
if (!ready_for_attack){
if (sitting_ticks > 0){
sitting_ticks--;
if (0 == sitting_ticks){
ready_for_attack = true;
} else {
return;
};
};
} else {
doAttack();
recharging_ticks = unit.weapon.recharge_time;
};
}
override public function setTarget(_arg1:Unit):void{
super.setTarget(_arg1);
if (unit.sitting_ticks > 0){
if (((!(ready_for_attack)) && ((sitting_ticks == 0)))){
sitting_ticks = unit.sitting_ticks;
unit.sprite.gotoAndStop("attack");
};
} else {
if (!ready_for_attack){
unit.sprite.gotoAndStop("attack");
};
ready_for_attack = true;
};
}
private function doAttack():void{
if (unit.sitting_ticks > 0){
if (!unit.sprite.inner.shooting_inner){
return;
};
unit.sprite.inner.shooting_inner.gotoAndPlay("shot");
attack_finish_ticks = (unit.sprite.inner.totalFrames - 1);
} else {
unit.sprite.inner.gotoAndPlay("shot");
attack_finish_ticks = (unit.sprite.inner.totalFrames - 1);
};
runBullet();
}
private function stopAttack():void{
unit.currentState = Unit.WALKING;
unit.sprite.gotoAndStop("walking");
ready_for_attack = false;
sitting_ticks = 0;
attack_target = null;
}
}
}//package game.goals
Section 53
//AttackRobotGoal (game.goals.AttackRobotGoal)
package game.goals {
import core.*;
import game.ui.*;
import game.logic.*;
import game.units.*;
import game.*;
public class AttackRobotGoal extends AttackGoal {
protected var ready_for_attack:Boolean;// = false
protected var recharging_ticks:int;// = 0
protected var attack_finish_ticks:int;// = 0
public function AttackRobotGoal(_arg1:Engine, _arg2:Unit):void{
ready_for_attack = false;
recharging_ticks = 0;
attack_finish_ticks = 0;
super(_arg1, _arg2);
}
override public function advance():void{
if (attack_finish_ticks > 0){
attack_finish_ticks--;
if (attack_finish_ticks == 0){
if (((attack_target) && ((false == attack_target.isAlive)))){
if (!hasAnotherTarget()){
stopAttack();
};
return;
};
};
};
if (recharging_ticks > 0){
recharging_ticks--;
return;
};
if (unit.currentState != Unit.ATTACK){
return;
};
if (((attack_target) && ((false == attack_target.isAlive)))){
if (!hasAnotherTarget()){
stopAttack();
};
return;
};
doAttack();
recharging_ticks = unit.weapon.recharge_time;
}
override public function setTarget(_arg1:Unit):void{
super.setTarget(_arg1);
if (!ready_for_attack){
unit.sprite.gotoAndStop("attack");
recharging_ticks = (recharging_ticks + (3 + ProcessManager.instance.timeScale));
};
ready_for_attack = true;
}
protected function doAttack():void{
if (unit.sprite.inner){
unit.sprite.inner.gotoAndPlay("shot");
attack_finish_ticks = (unit.sprite.inner.totalFrames - 1);
} else {
attack_finish_ticks = 10;
};
runBullet();
}
protected function stopAttack():void{
unit.currentState = Unit.WALKING;
unit.sprite.gotoAndStop("walking");
attack_target = null;
ready_for_attack = false;
}
}
}//package game.goals
Section 54
//AutoSendCheckGoal (game.goals.AutoSendCheckGoal)
package game.goals {
import core.*;
import core.goal.*;
import game.logic.*;
public class AutoSendCheckGoal extends PausedGoal {
private var _engine:Engine;// = null
public function AutoSendCheckGoal(){
_engine = null;
super(6);
_engine = Global.top.engine;
}
override protected function pausedAdvance():void{
if (!_engine.autoSend){
return;
};
_engine.events.sendUnitAction(true);
}
}
}//package game.goals
Section 55
//BackgroundCacherGoal (game.goals.BackgroundCacherGoal)
package game.goals {
import core.goal.*;
import flash.display.*;
import game.logic.*;
import flash.geom.*;
import core.common.*;
import core.cache.*;
import game.*;
public class BackgroundCacherGoal extends Goal {
private var delay:int;// = 0
private var _engine:Engine;// = null
private var _hidden_layer:Sprite;// = null
private var _cache_sequence:ObjectList;
private static const MAX_DELAY:int = 50;
public function BackgroundCacherGoal(_arg1:Engine){
var _local2:String;
_engine = null;
_hidden_layer = null;
_cache_sequence = new ObjectList();
delay = 0;
super();
_engine = _arg1;
_hidden_layer = new Sprite();
_engine.gameBoard.addChild(_hidden_layer);
_hidden_layer.visible = false;
for each (_local2 in _engine.cards) {
if (StringConsts.CATERPILLAR == _local2){
addTest(BLUE_CATERPILLAR_DEATH);
addTest(CATERPILLAR_IMPACT);
} else {
if (StringConsts.STORM_TANK == _local2){
addTest(BLUE_STORM_TANK_DEATH);
addTest(STORM_TANK_IMPACT);
} else {
if (StringConsts.MISSILE_MAN == _local2){
addTest(MM_IMPACT);
} else {
if (StringConsts.SPECIALIST == _local2){
addTest(SF_IMPACT);
} else {
if (StringConsts.GRENADIER_DROID == _local2){
addTest(GRENADIER_DEATH);
} else {
if (StringConsts.MINER_DROID == _local2){
addTest(MINER_EXPLOSION);
addTest(MINE_EXPLOSION);
};
};
};
};
};
};
};
for each (_local2 in _engine.enemyCards) {
if (StringConsts.CATERPILLAR == _local2){
addTest(RED_CATERPILLAR_DEATH);
addTest(CATERPILLAR_IMPACT);
} else {
if (StringConsts.STORM_TANK == _local2){
addTest(RED_STORM_TANK_DEATH);
addTest(STORM_TANK_IMPACT);
} else {
if (StringConsts.MISSILE_MAN == _local2){
addTest(MM_IMPACT);
} else {
if (StringConsts.SPECIALIST == _local2){
addTest(SF_IMPACT);
} else {
if (StringConsts.GRENADIER_DROID == _local2){
addTest(GRENADIER_DEATH);
} else {
if (StringConsts.MINER_DROID == _local2){
addTest(MINER_EXPLOSION);
addTest(MINE_EXPLOSION);
};
};
};
};
};
};
};
for each (_local2 in _engine.specials) {
if (StringConsts.ARTILLERY_STRIKE == _local2){
addTest(ASTRIKE_DROP1);
addTest(ASTRIKE_DROP2);
addTest(ASTRIKE_DROP3);
};
};
for each (_local2 in _engine.enemySpecials) {
if (StringConsts.ARTILLERY_STRIKE == _local2){
addTest(ASTRIKE_DROP1);
addTest(ASTRIKE_DROP2);
addTest(ASTRIKE_DROP3);
};
};
}
override public function advance():void{
if (delay > 0){
delay--;
return;
};
if (0 == _cache_sequence.length){
deactivate();
return;
};
runNextTest();
}
private function addTest(_arg1:Function):void{
if (!_cache_sequence.hasItem(_arg1)){
_cache_sequence.push(_arg1);
};
}
public function get hiddenLayer():Sprite{
return (_hidden_layer);
}
private function runNextTest():void{
var _local1:Function;
var _local2:*;
_local1 = _cache_sequence.shift();
_local2 = _local1(_hidden_layer);
if (_local2){
if ((_local2 is CachedBitmapGoal)){
_local2.clearAssignedRoutines();
} else {
if (!_local2.params){
_local2.params = new Object();
};
_local2.params.skipCrater = true;
};
};
if (((((_local2) && ((_local2 is Object)))) && (_local2.hasOwnProperty("totalFrames")))){
delay = _local2.totalFrames;
} else {
delay = MAX_DELAY;
};
}
private static function RED_STORM_TANK_DEATH(_arg1){
return (EffectFactory.makeDeath(EffectFactory.RED_STORM_TANK_DEATH, new Point(200, 300), (62.3 / 1308.2), (19.5 / 409.9), _arg1));
}
private static function STORM_TANK_IMPACT(_arg1){
return (EffectFactory.makeImpact(EffectFactory.STORM_TANK_IMPACT, new Point(200, 300), 0.25, _arg1));
}
private static function MINE_EXPLOSION(_arg1){
return (EffectFactory.makeExplosion(EffectFactory.MINE_EXPLOSION, new Point(200, 300), 0.2, _arg1));
}
private static function MM_IMPACT(_arg1){
return (EffectFactory.makeImpact(EffectFactory.MM_IMPACT, new Point(200, 300), 0.25, _arg1));
}
private static function SF_IMPACT(_arg1){
return (EffectFactory.makeImpact(EffectFactory.SF_IMPACT, new Point(200, 300), 0.25, _arg1));
}
private static function RED_CATERPILLAR_DEATH(_arg1){
return (EffectFactory.makeDeath(EffectFactory.RED_CATERPILLAR_DEATH, new Point(200, 300), (98.4 / 655.7), (34.2 / 228), _arg1));
}
private static function MINER_EXPLOSION(_arg1){
return (EffectFactory.makeDeath(EffectFactory.MINER_EXPLOSION, new Point(200, 300), 1, 1, _arg1));
}
private static function ASTRIKE_DROP1(_arg1){
var _local2:*;
_local2 = EffectFactory.makeExplosion(EffectFactory.ASTRIKE_DROP, new Point(200, 300), 0.5, _arg1, 1);
return (_local2);
}
private static function ASTRIKE_DROP2(_arg1){
var _local2:*;
_local2 = EffectFactory.makeExplosion(EffectFactory.ASTRIKE_DROP, new Point(200, 300), 0.5, _arg1, 2);
return (_local2);
}
private static function CATERPILLAR_IMPACT(_arg1){
return (EffectFactory.makeImpact(EffectFactory.CATERPILLAR_IMPACT, new Point(200, 300), 0.3, _arg1));
}
private static function BLUE_STORM_TANK_DEATH(_arg1){
return (EffectFactory.makeDeath(EffectFactory.BLUE_STORM_TANK_DEATH, new Point(200, 300), (-62.1 / 1135.6), (19.9 / 364.6), _arg1));
}
private static function GRENADIER_DEATH(_arg1){
return (EffectFactory.makeExplosion(EffectFactory.GRENADIER_DEATH, new Point(200, 300), 0.4, _arg1));
}
private static function BLUE_CATERPILLAR_DEATH(_arg1){
return (EffectFactory.makeDeath(EffectFactory.BLUE_CATERPILLAR_DEATH, new Point(200, 300), (-98.4 / 655.7), (34.2 / 228), _arg1));
}
private static function ASTRIKE_DROP3(_arg1){
var _local2:*;
_local2 = EffectFactory.makeExplosion(EffectFactory.ASTRIKE_DROP, new Point(200, 300), 0.5, _arg1, 3);
return (_local2);
}
}
}//package game.goals
Section 56
//BulletGoal (game.goals.BulletGoal)
package game.goals {
import core.goal.*;
import flash.display.*;
import game.logic.*;
import game.units.*;
import flash.geom.*;
import core.common.*;
import game.*;
public class BulletGoal extends Goal {
private var sprite:Sprite;
private var fly_away_mode:Boolean;// = false
private var gip:int;// = 0
private var engine:Engine;// = null
private var explosion_ticks:int;// = 0
private var hit_position:Point;// = null
private var bullet;// = null
private var shot_position:Point;// = null
private var _assauler_is_under_field:Boolean;// = false
private var assaulter:Unit;// = null
private var subject:Unit;// = null
private var _force_fields:ObjectList;// = null
private var _kill_type:String;
public function BulletGoal(_arg1:Engine, _arg2:Unit, _arg3:Unit):void{
var _local4:Number;
var _local5:Number;
engine = null;
assaulter = null;
subject = null;
bullet = null;
gip = 0;
hit_position = null;
shot_position = null;
sprite = new Sprite();
explosion_ticks = 0;
fly_away_mode = false;
_force_fields = null;
_assauler_is_under_field = false;
super();
engine = _arg1;
assaulter = _arg2;
subject = _arg3;
_kill_type = DieMarineGoal.DEATH_BY_BULLET;
switch (assaulter.type){
case StringConsts.CATERPILLAR:
case StringConsts.STORM_TANK:
case StringConsts.GRENADIER_DROID:
case StringConsts.MINER_DROID:
_kill_type = DieMarineGoal.DEATH_BY_EXPLOSION;
break;
};
switch (assaulter.type){
case StringConsts.MARINE:
engine.playSound(SoundConsts.hit1);
break;
case StringConsts.MISSILE_MAN:
engine.playSound(SoundConsts.mm_shot);
break;
case StringConsts.SPECIALIST:
engine.playSound(SoundConsts.specialist_attack);
break;
case StringConsts.STORM_TANK:
engine.playSound(SoundConsts.hit1);
break;
};
bullet = UnitCreator.getBullet(assaulter.type, assaulter.isEnemy);
sprite.addChild(bullet);
bullet.x = (bullet.x - (bullet.width / 2));
bullet.y = (bullet.y - (bullet.height / 2));
hit_position = new Point((subject.sprite.x + (subject.hit_point.x * subject.sprite.scaleX)), (subject.sprite.y + (subject.hit_point.y * subject.sprite.scaleY)));
determineShotPosition();
sprite.x = shot_position.x;
sprite.y = shot_position.y;
sprite.rotation = (((Math.atan2((hit_position.y - shot_position.y), (hit_position.x - shot_position.x)) / Math.PI) * 180) - 90);
_local4 = (hit_position.x - shot_position.x);
_local5 = (hit_position.y - shot_position.y);
gip = Math.sqrt(((_local4 * _local4) + (_local5 * _local5)));
engine.gameBoard.bulletLayer.addChild(sprite);
_force_fields = engine.gameBoard.forceFields[subject.life.getCurrentRoad().index][1];
}
override public function advance():void{
var _local1:Number;
if (fly_away_mode){
bullet.y = (bullet.y + assaulter.weapon.bullet_speed);
checkForceField();
if (bullet.y > Consts.ScreenWidth){
deactivate();
};
return;
};
gip = (gip - assaulter.weapon.bullet_speed);
if (gip <= 0){
if (!subject.isAlive){
fly_away_mode = true;
} else {
bullet.y = (bullet.y + (assaulter.weapon.bullet_speed + gip));
_local1 = 1;
if (assaulter.type == StringConsts.MISSILE_MAN){
if ((((subject.type == StringConsts.STORM_TANK)) || ((StringConsts.MINER_DROID == subject.type)))){
_local1 = 1.5;
} else {
if (StringConsts.GRENADIER_DROID == subject.type){
_local1 = 1.5;
} else {
if ((((subject.type == StringConsts.MARINE)) || ((subject.type == StringConsts.SPECIALIST)))){
_local1 = 0.5;
} else {
if (StringConsts.MISSILE_MAN == subject.type){
_local1 = 0.82;
};
};
};
};
} else {
if (assaulter.type == StringConsts.STORM_TANK){
if (subject.type == StringConsts.MISSILE_MAN){
_local1 = 0.7;
} else {
if ((((subject.type == StringConsts.GRENADIER_DROID)) || ((subject.type == StringConsts.MARINE)))){
_local1 = 1.25;
};
};
} else {
if (assaulter.type == StringConsts.SPECIALIST){
if (StringConsts.CATERPILLAR == subject.type){
_local1 = 1.35;
} else {
_local1 = 0.6;
};
} else {
if (assaulter.type == StringConsts.MARINE){
if (StringConsts.MISSILE_MAN == subject.type){
_local1 = 1.25;
} else {
if (StringConsts.STORM_TANK == subject.type){
_local1 = 0.9;
};
};
};
};
};
};
switch (assaulter.type){
case StringConsts.MARINE:
engine.playSound(SoundConsts.marine_shot);
break;
case StringConsts.MISSILE_MAN:
engine.playSound(SoundConsts.explosion1);
break;
case StringConsts.STORM_TANK:
engine.playSound(SoundConsts.hit);
break;
};
engine.hitUnit((assaulter.weapon.damage * _local1), subject, _kill_type);
setToExplosion();
};
} else {
bullet.y = (bullet.y + assaulter.weapon.bullet_speed);
checkForceField();
};
}
public function setToFlyAway():void{
fly_away_mode = true;
}
private function setToExplosion():void{
var _local1:int;
var _local2:Number;
var _local3:Point;
var _local4:Point;
bullet.visible = false;
_local1 = EffectFactory.MARINE_IMPACT;
_local2 = 1;
switch (assaulter.type){
case StringConsts.MISSILE_MAN:
_local1 = EffectFactory.MM_IMPACT;
_local2 = 0.25;
break;
case StringConsts.SPECIALIST:
_local1 = EffectFactory.SF_IMPACT;
_local2 = 0.25;
break;
case StringConsts.STORM_TANK:
_local1 = EffectFactory.STORM_TANK_IMPACT;
_local2 = 0.25;
break;
};
if (gip <= 0){
EffectFactory.makeImpact(_local1, hit_position, _local2, engine.gameBoard.unitMaskLayer);
} else {
_local3 = sprite.localToGlobal(new Point(bullet.x, bullet.y));
_local4 = engine.gameBoard.unitMaskLayer.globalToLocal(_local3);
EffectFactory.makeImpact(_local1, _local4, _local2, engine.gameBoard.unitMaskLayer);
};
deactivate();
}
override public function deactivate():void{
super.deactivate();
if (sprite){
sprite.removeChild(bullet);
engine.gameBoard.bulletLayer.removeChild(sprite);
assaulter = (subject = null);
sprite = null;
};
}
private function determineShotPosition():void{
shot_position = new Point();
switch (assaulter.type){
default:
shot_position.x = (assaulter.sprite.x + (assaulter.shot_point.x * assaulter.sprite.scaleX));
shot_position.y = (assaulter.sprite.y + (assaulter.shot_point.y * assaulter.sprite.scaleY));
break;
};
}
private function checkForceField():void{
var _local1:int;
var _local2:MovieClip;
if (engine.gameBoard.forceFields[subject.life.getCurrentRoad().index][0] <= 0){
return;
};
_local1 = 0;
_local1 = 0;
while (_local1 < _force_fields.length) {
_local2 = (_force_fields[_local1].forceField as MovieClip);
if (((!((assaulter.coverForceField() == _local2))) && (_local2.hitTestObject(bullet)))){
fly_away_mode = false;
setToExplosion();
return;
};
_local1++;
};
}
}
}//package game.goals
Section 57
//ButtonSetGoal (game.goals.ButtonSetGoal)
package game.goals {
import core.goal.*;
public class ButtonSetGoal extends GoalSystem {
public function ButtonSetGoal():void{
}
override public function advance():void{
super.advance();
}
public function addButton(_arg1, _arg2:String, _arg3:int, _arg4:Boolean):void{
var _local5:ButtonTicksGoal;
_local5 = new ButtonTicksGoal(_arg1, _arg2, _arg3);
add(_local5);
_arg1.ticks_goal = _local5;
}
public function resetAll():void{
var _local1:int;
_local1 = 0;
while (_local1 < goals.length) {
goals[_local1].reset();
_local1++;
};
}
public function setPaused(_arg1:Boolean):void{
var _local2:int;
_local2 = 0;
while (_local2 < goals.length) {
goals[_local2].paused = _arg1;
_local2++;
};
}
public function setReadyAll():void{
var _local1:int;
_local1 = 0;
while (_local1 < goals.length) {
goals[_local1].setReady();
_local1++;
};
}
}
}//package game.goals
Section 58
//ButtonTicksGoal (game.goals.ButtonTicksGoal)
package game.goals {
import core.*;
import core.goal.*;
import flash.display.*;
public class ButtonTicksGoal extends Goal {
private var _paused:Boolean;// = false
private var _show_messages:Boolean;// = false
private var _type:String;
private var _ready:Boolean;// = false
private var _tick_time:int;// = 0
private var _button_sprite:MovieClip;// = null
private var _ticks:int;// = 0
public function ButtonTicksGoal(_arg1, _arg2:String, _arg3:int, _arg4:Boolean=false):void{
_button_sprite = null;
_tick_time = 0;
_ticks = 0;
_ready = false;
_paused = false;
_show_messages = false;
super();
_show_messages = _arg4;
_button_sprite = _arg1;
_type = _arg2;
_tick_time = _arg3;
_ready = true;
hideFilling();
setFilling(0);
}
override public function advance():void{
if (((_ready) || (_paused))){
return;
};
_ticks--;
if (_ticks <= 0){
_ready = true;
if (_show_messages){
Global.top.engine.playWindowUI.logMessage((_type + " is ready!"));
};
hideFilling();
} else {
setFilling((1 - (_ticks / _tick_time)));
};
}
private function showFilling():void{
_button_sprite.filling.visible = true;
}
private function hideFilling():void{
_button_sprite.filling.visible = false;
}
public function setReady():void{
if (!_ready){
_ticks = 0;
};
}
public function get ready():Boolean{
return (_ready);
}
public function reset():void{
_ticks = _tick_time;
_ready = false;
showFilling();
setFilling(0);
}
public function get ticksRest():int{
return (_ticks);
}
public function set paused(_arg1:Boolean):void{
_paused = _arg1;
}
public function get paused():Boolean{
return (_paused);
}
private function setFilling(_arg1:Number):void{
_button_sprite.filling.gotoAndStop(int((_arg1 * 200)));
}
}
}//package game.goals
Section 59
//DieExplodeGoal (game.goals.DieExplodeGoal)
package game.goals {
import core.goal.*;
import game.logic.*;
import game.units.*;
import flash.geom.*;
import core.cache.*;
import game.*;
public class DieExplodeGoal extends Goal {
private var unit:Unit;// = null
private var final_ticks:int;// = 0
private var engine:Engine;// = null
private var _clip;// = null
public static const FINAL_TICKS:int = 50;
public function DieExplodeGoal(_arg1:Engine, _arg2:Unit):void{
unit = null;
engine = null;
final_ticks = 0;
_clip = null;
super();
unit = _arg2;
engine = _arg1;
unit.destroy();
unit.currentState = Unit.DYING;
final_ticks = FINAL_TICKS;
if (StringConsts.MINER_DROID == unit.type){
_clip = EffectFactory.makeDeath(EffectFactory.MINER_EXPLOSION, new Point((unit.sprite.x - 7.3), (unit.sprite.y - 15.2)), 1, 1, unit.sprite.parent);
engine.gameBoard.wipeUnit(unit);
engine.playSound(SoundConsts.victory);
} else {
unit.sprite.gotoAndStop("death");
_clip = unit.sprite;
};
unit.life.deactivate();
}
override public function advance():void{
if (final_ticks > 0){
final_ticks--;
return;
};
deactivate();
}
override public function deactivate():void{
super.deactivate();
if ((_clip is CachedBitmapGoal)){
_clip.deactivate();
} else {
EffectFactory.effectFinished(_clip);
};
engine.gameBoard.wipeUnit(unit);
}
}
}//package game.goals
Section 60
//DieGrenadierGoal (game.goals.DieGrenadierGoal)
package game.goals {
import core.goal.*;
import game.logic.*;
import game.units.*;
import flash.geom.*;
import core.common.*;
import game.*;
public class DieGrenadierGoal extends Goal {
private var unit:Unit;// = null
private var final_ticks:int;// = 0
private var engine:Engine;// = null
public static const FINAL_TICKS:int = 55;
public function DieGrenadierGoal(_arg1:Engine, _arg2:Unit):void{
unit = null;
engine = null;
final_ticks = 0;
super();
unit = _arg2;
engine = _arg1;
unit.destroy();
unit.currentState = Unit.DYING;
final_ticks = FINAL_TICKS;
if (StringConsts.GRENADIER_DROID == unit.type){
EffectFactory.makeExplosion(EffectFactory.GRENADIER_DEATH, new Point(unit.sprite.x, unit.sprite.y), 0.4, unit.sprite.parent);
engine.playSound(SoundConsts.explosion);
} else {
EffectFactory.makeExplosion(EffectFactory.MINE_EXPLOSION, new Point(unit.sprite.x, unit.sprite.y), 0.2, unit.sprite.parent);
engine.playSound(SoundConsts.victory);
};
engine.gameBoard.wipeUnit(unit);
checkNearTargets();
unit.life.deactivate();
}
override public function advance():void{
if (final_ticks > 0){
final_ticks--;
return;
};
deactivate();
}
private function checkNearTargets():void{
var _local1:Array;
var _local2:Array;
var _local3:int;
var _local4:Array;
var _local5:Unit;
_local1 = engine.gameBoard.allyUnits.getNearUnits(unit.life.getCurrentRoad(), new Position(unit.sprite.x, unit.sprite.y), (unit.weapon.eyerange * 1.1));
_local2 = engine.gameBoard.enemyUnits.getNearUnits(unit.life.getCurrentRoad(), new Position(unit.sprite.x, unit.sprite.y), (unit.weapon.eyerange * 1.1));
_local2 = _local2.concat(_local1);
if (unit.type != StringConsts.MINE){
_local4 = engine.gameBoard.mines.getNearUnits(unit.life.getCurrentRoad(), new Position(unit.sprite.x, unit.sprite.y), (unit.weapon.eyerange * 2));
_local2 = _local2.concat(_local4);
};
_local3 = 0;
while (_local3 < _local2.length) {
_local5 = _local2[_local3];
if (!_local5.coverForceField()){
engine.hitUnit(unit.weapon.damage, _local5, DieMarineGoal.DEATH_BY_EXPLOSION);
};
_local3++;
};
}
override public function deactivate():void{
super.deactivate();
engine.gameBoard.wipeUnit(unit);
}
}
}//package game.goals
Section 61
//DieMarineGoal (game.goals.DieMarineGoal)
package game.goals {
import core.goal.*;
import game.logic.*;
import game.units.*;
import game.*;
public class DieMarineGoal extends Goal {
private var unit:Unit;// = null
private var leave_ticks:int;// = 0
private var engine:Engine;// = null
private var final_ticks:int;// = 0
private var blood_ticks:int;// = 0
private var disappear_ticks:int;// = 0
public static const DISAPPEAR_TICKS:int = 40;
public static const FINAL_TICKS:int = 90;
public static const LEAVE_TICKS:int = 1700;
public static const BLOOD_TICKS:int = 320;
public static const DEATH_BY_EXPLOSION:String = "explosion";
public static const DEATH_BY_BULLET:String = "bullet";
public function DieMarineGoal(_arg1:Engine, _arg2:Unit, _arg3:String):void{
unit = null;
engine = null;
leave_ticks = 0;
disappear_ticks = 0;
blood_ticks = 0;
final_ticks = 0;
super();
unit = _arg2;
engine = _arg1;
unit.destroy();
unit.currentState = Unit.DYING;
leave_ticks = LEAVE_TICKS;
disappear_ticks = DISAPPEAR_TICKS;
blood_ticks = BLOOD_TICKS;
final_ticks = FINAL_TICKS;
if (_arg3 == DEATH_BY_EXPLOSION){
unit.sprite.gotoAndStop("death_by_explosion");
engine.playSound(SoundConsts.marine_death_expl);
} else {
unit.sprite.gotoAndStop("death_by_bullet");
engine.playSound(SoundConsts.marine_death);
};
unit.moveSpriteToBackLayer();
unit.life.deactivate();
}
override public function advance():void{
if (leave_ticks > 0){
leave_ticks--;
if (0 == leave_ticks){
unit.sprite.inner.gotoAndPlay("disappearing");
};
return;
};
if (disappear_ticks > 0){
disappear_ticks--;
return;
};
if (blood_ticks > 0){
blood_ticks--;
return;
};
if (final_ticks > 0){
final_ticks--;
unit.sprite.alpha = (final_ticks / FINAL_TICKS);
return;
};
deactivate();
}
override public function deactivate():void{
super.deactivate();
engine.gameBoard.wipeUnit(unit);
}
}
}//package game.goals
Section 62
//DieRobotGoal (game.goals.DieRobotGoal)
package game.goals {
import core.goal.*;
import game.logic.*;
import game.units.*;
import flash.geom.*;
import core.cache.*;
import game.*;
public class DieRobotGoal extends Goal {
private var unit:Unit;// = null
private var final_ticks:int;// = 0
private var leave_ticks:int;// = 0
private var engine:Engine;// = null
private var _clip;// = null
public static const FINAL_TICKS:int = 90;
public static const LEAVE_TICKS:int = 1700;
public function DieRobotGoal(_arg1:Engine, _arg2:Unit):void{
unit = null;
engine = null;
leave_ticks = 0;
final_ticks = 0;
_clip = null;
super();
unit = _arg2;
engine = _arg1;
unit.destroy();
unit.currentState = Unit.DYING;
leave_ticks = LEAVE_TICKS;
final_ticks = FINAL_TICKS;
unit.moveSpriteToBackLayer();
if (StringConsts.CATERPILLAR == unit.type){
if (unit.isEnemy){
_clip = EffectFactory.makeDeath(EffectFactory.RED_CATERPILLAR_DEATH, new Point((unit.sprite.x - 3.5), (unit.sprite.y - 8.9)), (98.4 / 655.7), (34.2 / 228), unit.sprite.parent);
} else {
_clip = EffectFactory.makeDeath(EffectFactory.BLUE_CATERPILLAR_DEATH, new Point((unit.sprite.x - 2.5), (unit.sprite.y - 8.8)), (-98.4 / 655.7), (34.2 / 228), unit.sprite.parent);
};
engine.gameBoard.wipeUnit(unit);
engine.playSound(SoundConsts.caterpillar_death);
} else {
if (StringConsts.STORM_TANK == unit.type){
if (unit.isEnemy){
_clip = EffectFactory.makeDeath(EffectFactory.RED_STORM_TANK_DEATH, new Point((unit.sprite.x - 1.1), (unit.sprite.y - 14.9)), (62.3 / 1308.2), (19.5 / 409.9), unit.sprite.parent);
} else {
_clip = EffectFactory.makeDeath(EffectFactory.BLUE_STORM_TANK_DEATH, new Point((unit.sprite.x + 3.9), (unit.sprite.y - 15.1)), (-62.1 / 1135.6), (19.9 / 364.6), unit.sprite.parent);
};
engine.gameBoard.wipeUnit(unit);
engine.playSound(SoundConsts.explosion);
} else {
unit.sprite.gotoAndStop("death");
_clip = unit.sprite;
};
};
if ((_clip is CachedBitmapGoal)){
(_clip as CachedBitmapGoal).setStopAtEnd();
};
unit.life.deactivate();
}
override public function advance():void{
if (leave_ticks > 0){
leave_ticks--;
return;
};
if (final_ticks > 0){
final_ticks--;
_clip.alpha = (final_ticks / FINAL_TICKS);
return;
};
deactivate();
}
override public function deactivate():void{
super.deactivate();
if ((_clip is CachedBitmapGoal)){
_clip.deactivate();
} else {
EffectFactory.effectFinished(_clip);
};
engine.gameBoard.wipeUnit(unit);
}
}
}//package game.goals
Section 63
//EnemyDetectorGoal (game.goals.EnemyDetectorGoal)
package game.goals {
import core.goal.*;
import game.logic.*;
import game.units.*;
import core.common.*;
import game.*;
public class EnemyDetectorGoal extends Goal {
private var check_back_units:Boolean;// = false
private var engine:Engine;// = null
private var owner:Unit;// = null
private var enemy_camp:UnitCamp;// = null
public function EnemyDetectorGoal(_arg1:Engine, _arg2:Unit):void{
engine = null;
owner = null;
enemy_camp = null;
check_back_units = false;
super();
owner = _arg2;
engine = _arg1;
enemy_camp = (_arg2.enemy_unit) ? engine.gameBoard.allyUnits : engine.gameBoard.enemyUnits;
}
public function checkBackUnits(_arg1:Boolean):void{
check_back_units = _arg1;
}
override public function advance():void{
var _local1:Unit;
if (Unit.WALKING != owner.currentState){
return;
};
if (null != owner.life.getCurrentRoad()){
_local1 = null;
if (check_back_units){
_local1 = enemy_camp.getNearestUnit(owner.life.getCurrentRoad(), new Position(owner.sprite.x, owner.sprite.y), owner.weapon.eyerange);
} else {
_local1 = enemy_camp.getNearestForwardUnit(owner.life.getCurrentRoad(), owner, owner.weapon.eyerange);
};
if (_local1 != null){
owner.life.startAttack(_local1);
};
};
}
override public function deactivate():void{
super.deactivate();
}
}
}//package game.goals
Section 64
//FinalBalanceCheckingGoal (game.goals.FinalBalanceCheckingGoal)
package game.goals {
import core.*;
import core.goal.*;
import game.logic.*;
public class FinalBalanceCheckingGoal extends PausedGoal {
private var _scale_changed:Boolean;// = false
private var _smooth_pause:int;// = 90
private var _engine:Engine;// = null
public function FinalBalanceCheckingGoal():void{
_engine = null;
_scale_changed = false;
_smooth_pause = 90;
super(5);
_engine = Global.top.engine;
}
override public function advance():void{
super.advance();
if (_scale_changed){
if (_smooth_pause > 0){
_smooth_pause--;
if (0 == _smooth_pause){
ProcessManager.instance.timeScale = 3;
};
};
};
}
override public function deactivate():void{
super.deactivate();
ProcessManager.instance.timeScale = 1;
}
override protected function pausedAdvance():void{
var _local1:int;
var _local2:int;
if (_scale_changed){
return;
};
_local1 = _engine.gameBoard.enemyUnits.aliveCount();
_local2 = _engine.gameBoard.allyUnits.aliveCount();
if ((((((_local1 == 0)) && (!((_local2 == 0))))) || ((((_local2 == 0)) && (!((_local1 == 0))))))){
_scale_changed = true;
};
}
}
}//package game.goals
Section 65
//ForceFieldGoal (game.goals.ForceFieldGoal)
package game.goals {
import core.*;
import core.goal.*;
import game.logic.*;
import flash.geom.*;
import game.*;
public class ForceFieldGoal extends Goal {
private var field_point:Point;// = null
private var _force_field;// = null
private var engine:Engine;// = null
private var _road_index:int;// = 0
private var ticks:int;// = 600
private static const TICKS:int = 600;
public function ForceFieldGoal(_arg1:Point, _arg2:int, _arg3:Boolean=false):void{
field_point = null;
_force_field = null;
engine = null;
_road_index = 0;
ticks = TICKS;
super();
engine = Global.top.engine;
field_point = _arg1.clone();
_road_index = _arg2;
if (_arg3){
_force_field = new RedForceField();
} else {
_force_field = new ForceField();
};
_force_field.x = field_point.x;
_force_field.y = field_point.y;
_force_field.scaleX = 1.25;
engine.levelMap.force_field_mask_layer.addChild(_force_field);
engine.gameBoard.forceFields[_arg2][0] = (engine.gameBoard.forceFields[_arg2][0] + 1);
engine.gameBoard.forceFields[_arg2][1].push(this);
engine.playSound(SoundConsts.stun);
}
override public function advance():void{
if (ticks > 0){
ticks--;
return;
};
deactivate();
}
override public function deactivate():void{
if (!_force_field){
return;
};
engine.gameBoard.forceFields[_road_index][0] = (engine.gameBoard.forceFields[_road_index][0] - 1);
engine.gameBoard.forceFields[_road_index][1].remove(this);
engine.levelMap.force_field_mask_layer.removeChild(_force_field);
_force_field = null;
}
public function get forceField(){
return (_force_field);
}
}
}//package game.goals
Section 66
//GrandStormGoal (game.goals.GrandStormGoal)
package game.goals {
import core.*;
import core.goal.*;
import game.logic.*;
import game.*;
public class GrandStormGoal extends Goal {
private var engine:Engine;// = null
private var _enemy_send_index:int;// = 0
private var send_index:int;// = 0
private var _working:Boolean;// = false
private var pause:int;// = 0
private var _ticks:int;// = 0
private static var PAUSE = 75;
public function GrandStormGoal():void{
pause = 0;
send_index = 0;
_enemy_send_index = 0;
engine = null;
_working = false;
_ticks = 0;
super();
engine = Global.top.engine;
}
override public function advance():void{
if (!_working){
return;
};
if (pause > 0){
pause--;
return;
};
sendNext();
pause = PAUSE;
}
private function getNextEnemyCard():String{
var _local1:String;
_local1 = engine.enemyCards[_enemy_send_index];
if (StringConsts.EMPTY == _local1){
_enemy_send_index = 0;
_local1 = engine.enemyCards[_enemy_send_index];
};
_enemy_send_index++;
if (_enemy_send_index >= 4){
_enemy_send_index = 0;
};
return (_local1);
}
private function sendNext():void{
var _local1:String;
var _local2:String;
_local1 = getNextPlayersCard();
_local2 = getNextEnemyCard();
if ((((StringConsts.GRENADIER_DROID == _local1)) && (!((engine.cards.length == 1))))){
_local1 = getNextPlayersCard();
};
if (StringConsts.GRENADIER_DROID == _local2){
_local2 = getNextEnemyCard();
};
engine.gameBoard.sendFromAllHatches(_local1, false);
engine.gameBoard.sendFromAllHatches(_local2, true);
_ticks++;
if (_ticks >= 4){
engine.goalSystem.add(new FinalBalanceCheckingGoal());
deactivate();
};
}
public function get isWorking():Boolean{
return (_working);
}
public function set working(_arg1:Boolean):void{
_working = _arg1;
engine.playWindowUI.buttons.buttonSetGoal.setPaused(true);
engine.playWindowUI.enemyButons.buttonSetGoal.setPaused(true);
engine.playWindowUI.buttons.pauseSpecials();
engine.playWindowUI.enemyButons.pauseSpecials();
engine.stormGoal.deactivate();
engine.enemyStormGoal.deactivate();
engine.playWindowUI.game_menu.storm_label.gotoAndStop("grand_storm_label");
engine.playWindowUI.game_menu.enemy_storm_label.gotoAndStop("grand_storm_label");
}
private function getNextPlayersCard():String{
var _local1:String;
_local1 = engine.cards[send_index];
if (StringConsts.EMPTY == _local1){
send_index = 0;
_local1 = engine.cards[send_index];
};
send_index++;
if (send_index >= 4){
send_index = 0;
};
return (_local1);
}
}
}//package game.goals
Section 67
//HelloMessagesGoal (game.goals.HelloMessagesGoal)
package game.goals {
import core.*;
import core.goal.*;
import game.logic.*;
public class HelloMessagesGoal extends Goal {
private var _engine:Engine;// = null
private var _messages:Array;
private var _ticks:int;// = 0
private var _last_phase:Boolean;// = false
public function HelloMessagesGoal(){
_messages = [[0, "Greetings Commander"], [30, "Connection with space support established..."], [45, "Waiting for command..."]];
_ticks = 0;
_engine = null;
_last_phase = false;
super();
_engine = Global.top.engine;
_engine.playWindowUI.buttons.buttonSetGoal.setPaused(true);
_engine.playWindowUI.enemyButons.buttonSetGoal.setPaused(true);
}
override public function advance():void{
var _local1:int;
if (_last_phase){
_ticks--;
if ((_ticks % 30) == 0){
_engine.playWindowUI.logMessage(("Battle starts in: " + (_ticks / 30).toString()), true);
};
if (0 == _ticks){
if ((((0 == _engine.lastLevelIndex)) && ((0 == _engine.lastZone)))){
_engine.playWindowUI.logMessage("HINT: Press SPACE or CONTROL in order to send a unit.");
} else {
_engine.playWindowUI.logMessage("GO!");
};
unblockAll();
deactivate();
};
return;
};
_local1 = 0;
while (_local1 < _messages.length) {
if (_messages[_local1][0] == _ticks){
_engine.playWindowUI.logMessage(_messages[_local1][1]);
if (_local1 == (_messages.length - 1)){
_last_phase = true;
_ticks = ((30 * 3) + 1);
};
break;
};
_local1++;
};
_ticks++;
}
private function unblockAll():void{
_engine.playWindowUI.buttons.buttonSetGoal.setPaused(false);
_engine.playWindowUI.enemyButons.buttonSetGoal.setPaused(false);
_engine.playWindowUI.buttons.buttonSetGoal.setReadyAll();
_engine.playWindowUI.enemyButons.buttonSetGoal.setReadyAll();
}
}
}//package game.goals
Section 68
//IndicateRoadGoal (game.goals.IndicateRoadGoal)
package game.goals {
import core.goal.*;
import game.ui.*;
public class IndicateRoadGoal extends Goal {
private var road:RoadPath;// = null
public function IndicateRoadGoal(_arg1:RoadPath):void{
road = null;
super();
road = _arg1;
}
public function theRoad(){
return (road);
}
}
}//package game.goals
Section 69
//LaserBeamGoal (game.goals.LaserBeamGoal)
package game.goals {
import core.goal.*;
import flash.display.*;
import game.logic.*;
import game.units.*;
import flash.geom.*;
import core.common.*;
import game.*;
public class LaserBeamGoal extends Goal {
private var sprite:Sprite;
private var gip:int;// = 0
private var engine:Engine;// = null
private var hit_position:Point;// = null
private var bullet;// = null
private var shot_position:Point;// = null
private var _force_field_impact:Boolean;// = false
private var laser_ticks:int;// = 0
private var assaulter:Unit;// = null
private var subject:Unit;// = null
private var _force_fields:ObjectList;// = null
public function LaserBeamGoal(_arg1:Engine, _arg2:Unit, _arg3:Unit, _arg4:int):void{
engine = null;
assaulter = null;
subject = null;
bullet = null;
gip = 0;
hit_position = null;
shot_position = null;
sprite = new Sprite();
laser_ticks = 0;
_force_field_impact = false;
_force_fields = null;
super();
engine = _arg1;
assaulter = _arg2;
subject = _arg3;
laser_ticks = _arg4;
calculateHitPosition();
create(hit_position);
_force_fields = engine.gameBoard.forceFields[subject.life.getCurrentRoad().index][1];
}
override public function advance():void{
var _local1:Number;
if (!subject.isAlive){
deactivate();
return;
};
if (laser_ticks > 0){
laser_ticks--;
if (laser_ticks == 15){
EffectFactory.makeImpact(EffectFactory.CATERPILLAR_IMPACT, hit_position, 0.3, engine.gameBoard.unitMaskLayer);
};
if (0 == laser_ticks){
if (false == _force_field_impact){
engine.playSound(SoundConsts.caterpillar_hit);
engine.playSound(SoundConsts.explosion1);
_local1 = 1;
if (subject.type == StringConsts.SPECIALIST){
_local1 = 0.5;
};
engine.hitUnit((assaulter.weapon.damage * _local1), subject);
};
deactivate();
};
};
}
private function create(_arg1:Point):void{
hit_position.x = _arg1.x;
hit_position.y = _arg1.y;
bullet = UnitCreator.getBullet(assaulter.type, assaulter.isEnemy);
sprite.addChild(bullet);
determineShotPosition();
sprite.x = shot_position.x;
sprite.y = shot_position.y;
calculateBeam();
engine.gameBoard.bulletLayer.addChild(sprite);
}
private function calculateHitPosition():void{
hit_position = new Point((subject.sprite.x + (subject.hit_point.x * subject.sprite.scaleX)), (subject.sprite.y + (subject.hit_point.y * subject.sprite.scaleY)));
}
private function cleanup():void{
sprite.removeChild(bullet);
engine.gameBoard.bulletLayer.removeChild(sprite);
}
private function checkForceFields():void{
var _local1:MovieClip;
var _local2:Point;
if (engine.gameBoard.forceFields[subject.life.getCurrentRoad().index][0] <= 0){
return;
};
_local1 = subject.coverForceField();
if (!_local1){
return;
};
if (!assaulter.isEnemy){
if (!_force_field_impact){
_force_field_impact = true;
_local2 = getCenterOfForceField(_local1);
cleanup();
create(new Point((_local2.x - (_local1.width / 2)), _local2.y));
return;
};
} else {
if (!_force_field_impact){
_force_field_impact = true;
_local2 = getCenterOfForceField(_local1);
cleanup();
create(new Point((_local2.x + (_local1.width / 2)), _local2.y));
return;
};
};
}
override public function deactivate():void{
super.deactivate();
if (sprite){
cleanup();
assaulter = (subject = null);
sprite = null;
};
}
private function calculateBeam():void{
var _local1:Number;
var _local2:Number;
_local1 = (hit_position.x - shot_position.x);
_local2 = (hit_position.y - shot_position.y);
gip = Math.sqrt(((_local1 * _local1) + (_local2 * _local2)));
bullet.scaleX = ((gip / bullet.width) * assaulter.sprite.scaleX);
bullet.x = ((bullet.width / 2) * assaulter.sprite.scaleX);
}
private function determineShotPosition():void{
shot_position = new Point();
switch (assaulter.type){
default:
shot_position.x = (assaulter.sprite.x + (assaulter.shot_point.x * assaulter.sprite.scaleX));
shot_position.y = (assaulter.sprite.y + (assaulter.shot_point.y * assaulter.sprite.scaleY));
break;
};
}
private function getCenterOfForceField(_arg1:MovieClip):Point{
var _local2:Point;
_local2 = new Point((engine.levelMap.force_field_mask_layer.x + _arg1.x), (engine.levelMap.force_field_mask_layer.y + _arg1.y));
return (new Point((_local2.x - engine.gameBoard.unitMaskLayer.x), (_local2.y - engine.gameBoard.unitMaskLayer.y)));
}
}
}//package game.goals
Section 70
//LifeGoal (game.goals.LifeGoal)
package game.goals {
import core.goal.*;
import game.ui.*;
import game.logic.*;
import game.units.*;
import game.*;
public class LifeGoal extends GoalSystem {
private var engine:Engine;// = null
private var mover_goal;// = null
private var enemy_detector:EnemyDetectorGoal;// = null
private var attack_goal;// = null
private var owner:Unit;// = null
public function LifeGoal(_arg1:Engine, _arg2:Unit):void{
engine = null;
owner = null;
mover_goal = null;
enemy_detector = null;
attack_goal = null;
super();
owner = _arg2;
engine = _arg1;
}
public function getCurrentRoad():RoadPath{
if (!mover_goal){
return (null);
};
return (mover_goal.theRoad());
}
public function breathe():void{
if (!owner.isPeaceful){
enemy_detector = new EnemyDetectorGoal(engine, owner);
add(enemy_detector);
};
switch (owner.type){
case StringConsts.MARINE:
case StringConsts.MISSILE_MAN:
case StringConsts.SPECIALIST:
attack_goal = new AttackMarineGoal(engine, owner);
break;
case StringConsts.CATERPILLAR:
attack_goal = new AttackCaterpillarGoal(engine, owner);
break;
case StringConsts.GRENADIER_DROID:
case StringConsts.MINE:
attack_goal = new AttackGrenadierGoal(engine, owner);
enemy_detector.checkBackUnits(true);
break;
case StringConsts.MINER_DROID:
attack_goal = new MinePlacingGoal(engine, owner);
break;
default:
attack_goal = new AttackRobotGoal(engine, owner);
break;
};
add(attack_goal);
}
public function startAttack(_arg1:Unit):void{
attack_goal.setTarget(_arg1);
}
public function get isAttacking():Boolean{
return ((owner.currentState == Unit.ATTACK));
}
public function resetWeapon():void{
}
public function startMoving(_arg1:RoadPath):void{
if (owner.isEnemy){
mover_goal = new RoadViceVersaMoverGoal(engine, owner, _arg1);
} else {
mover_goal = new RoadMoverGoal(engine, owner, _arg1);
};
add(mover_goal);
owner.currentState = Unit.WALKING;
}
public function getMover(){
return (mover_goal);
}
public function get attackGoal():AttackGoal{
return (attack_goal);
}
public function get enemyDetector():EnemyDetectorGoal{
return (enemy_detector);
}
public function addToInfos():void{
var _local1:RoadInfo;
_local1 = engine.gameBoard.roadInfos[getCurrentRoad().index];
if (owner.isEnemy){
_local1.enemy_units++;
_local1.enemy_synergy = (_local1.enemy_synergy + owner.getSynergy());
} else {
_local1.player_units++;
_local1.player_synergy = (_local1.player_synergy + owner.getSynergy());
};
}
override public function deactivate():void{
var _local1:RoadInfo;
if (owner){
_local1 = engine.gameBoard.roadInfos[getCurrentRoad().index];
if (owner.isEnemy){
_local1.enemy_units--;
_local1.enemy_synergy = (_local1.enemy_synergy - owner.getSynergy());
} else {
_local1.player_units--;
_local1.player_synergy = (_local1.player_synergy - owner.getSynergy());
};
owner = null;
};
super.deactivate();
}
public function setMover(_arg1):void{
mover_goal = _arg1;
}
}
}//package game.goals
Section 71
//MapGoal (game.goals.MapGoal)
package game.goals {
import core.goal.*;
import game.ui.*;
import fl.transitions.easing.*;
import fl.transitions.*;
public class MapGoal extends GoalSystem {
private var level:LevelSelection;// = null
private var star_x:Number;
private var planet_x:Number;
private var TweenOutX0:Tween;// = null
private var TweenOutX1:Tween;// = null
private var TweenOutX2:Tween;// = null
private var TweenOutX3:Tween;// = null
private var map_speed:Number;// = 5
private var nebula_x:Number;
public function MapGoal(_arg1:LevelSelection):void{
level = null;
map_speed = 5;
TweenOutX0 = null;
TweenOutX1 = null;
TweenOutX2 = null;
TweenOutX3 = null;
super();
level = _arg1;
}
override public function advance():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
if (!level.visible){
return;
};
_local1 = -1467;
_local2 = ((-((level.mouseX - 100)) * (level.planets_back.width - 700)) / 500);
if (level.mouseX < 100){
_local2 = 0;
};
if (level.mouseX > 600){
_local2 = _local1;
};
TweenOutX1 = new Tween(level.planets_back, "x", None.easeOut, level.planets_back.x, _local2, 15, false);
TweenOutX0 = new Tween(level.planets_back_star, "x", None.easeOut, level.planets_back_star.x, _local2, 12, false);
_local3 = ((-((level.mouseX - 100)) * (level.planets_back.width - 700)) / 500);
if (level.mouseX < 100){
_local3 = 0;
};
if (level.mouseX > 600){
_local3 = _local1;
};
TweenOutX2 = new Tween(level.planets_star, "x", None.easeOut, level.planets_star.x, _local3, 18, false);
_local4 = ((-((level.mouseX - 100)) * (level.planets_back.width - 700)) / 500);
if (level.mouseX < 100){
_local4 = 0;
};
if (level.mouseX > 600){
_local4 = _local1;
};
TweenOutX3 = new Tween(level.planets_nebula, "x", None.easeOut, level.planets_nebula.x, _local4, 21, false);
}
override public function deactivate():void{
super.deactivate();
}
}
}//package game.goals
Section 72
//MineGoal (game.goals.MineGoal)
package game.goals {
import core.goal.*;
import game.logic.*;
import game.units.*;
public class MineGoal extends Goal {
private var mine_unit:Unit;// = null
private var engine:Engine;// = null
private var enemy_detector:EnemyDetectorGoal;// = null
public function MineGoal(_arg1:Engine, _arg2:Unit):void{
engine = null;
mine_unit = null;
enemy_detector = null;
super();
engine = _arg1;
mine_unit = _arg2;
engine.gameBoard.mines.push(mine_unit);
}
override public function advance():void{
}
override public function deactivate():void{
if (mine_unit){
engine.gameBoard.mines.remove(mine_unit);
mine_unit = null;
};
super.deactivate();
}
}
}//package game.goals
Section 73
//MinePlacingGoal (game.goals.MinePlacingGoal)
package game.goals {
import core.goal.*;
import game.ui.*;
import game.logic.*;
import game.units.*;
import game.*;
public class MinePlacingGoal extends Goal {
private var pause_ticks:int;// = 200
private var PLACING_TICKS:int;// = 16
protected var unit:Unit;// = null
protected var engine:Engine;// = null
private var placing_ticks:int;// = 0
public function MinePlacingGoal(_arg1:Engine, _arg2:Unit):void{
engine = null;
unit = null;
pause_ticks = 200;
PLACING_TICKS = 16;
placing_ticks = 0;
super();
engine = _arg1;
unit = _arg2;
}
override public function advance():void{
if (pause_ticks > 0){
pause_ticks--;
return;
};
if (placing_ticks > 0){
placing_ticks--;
if (0 == placing_ticks){
PLACING_TICKS = unit.sprite.inner.totalFrames;
placeMine();
resetState();
};
return;
};
startPlacingMine();
}
protected function placeMine():void{
var _local1:Unit;
var _local2:*;
var _local3:MineGoal;
_local1 = UnitCreator.create(StringConsts.MINE, unit.isEnemy);
_local1.sprite.alpha = 0.75;
_local1.sprite.x = (unit.sprite.x + (unit.sprite.shot_point.x * unit.sprite.scaleX));
_local1.sprite.y = (unit.sprite.y + (unit.sprite.shot_point.y * unit.sprite.scaleX));
engine.gameBoard.unitMaskLayer.addChild(_local1.sprite);
_local1.activate(engine);
_local1.life.breathe();
_local2 = new IndicateRoadGoal(unit.life.getCurrentRoad());
_local1.life.setMover(_local2);
_local1.currentState = Unit.WALKING;
_local3 = new MineGoal(engine, _local1);
_local1.life.add(_local3);
engine.playSound(SoundConsts.mine_set);
}
private function startPlacingMine():void{
unit.currentState = Unit.ATTACK;
unit.sprite.gotoAndStop("attack");
placing_ticks = PLACING_TICKS;
}
private function resetState():void{
unit.currentState = Unit.WALKING;
unit.sprite.gotoAndStop("walking");
pause_ticks = unit.weapon.recharge_time;
}
}
}//package game.goals
Section 74
//MoveSimpleGoal (game.goals.MoveSimpleGoal)
package game.goals {
import core.goal.*;
import game.ui.*;
import game.logic.*;
import game.units.*;
import flash.geom.*;
import core.common.*;
import game.*;
public class MoveSimpleGoal extends Goal {
private var end_steps:int;// = 0
private var unit:Unit;// = null
private var engine:Engine;// = null
private var max_steps:Number;// = 0
private var dx:Number;// = 0
private var dy:Number;// = 0
private var target:Position;// = null
private var initial:Position;// = null
private var steps:Number;// = 0
public function MoveSimpleGoal(_arg1:Engine, _arg2:Unit):void{
engine = null;
unit = null;
steps = 0;
end_steps = 0;
max_steps = 0;
dx = 0;
dy = 0;
target = null;
initial = null;
super();
engine = _arg1;
unit = _arg2;
}
override public function advance():void{
if (steps < 1){
unit.sprite.x = target.x;
unit.sprite.y = target.y;
steps = 0;
} else {
end_steps++;
unit.sprite.x = (initial.x + (dx * end_steps));
unit.sprite.y = (initial.y + (dy * end_steps));
steps--;
};
if (steps <= 0){
deactivate();
};
}
public function moveOn(_arg1:Number):void{
end_steps = (max_steps * _arg1);
steps = (max_steps - end_steps);
unit.sprite.x = (initial.x + (dx * end_steps));
unit.sprite.y = (initial.y + (dy * end_steps));
}
public function moveTo(_arg1:Position):void{
moveToXY(_arg1.x, _arg1.y);
}
public function moveToXY(_arg1:Number, _arg2:Number):void{
var _local3:Number;
var _local4:Number;
target = new Position(_arg1, _arg2);
initial = new Position(unit.sprite.x, unit.sprite.y);
_local3 = (target.x - unit.sprite.x);
_local4 = (target.y - unit.sprite.y);
max_steps = (steps = (Math.sqrt(((_local3 * _local3) + (_local4 * _local4))) / unit.velocity));
dx = (_local3 / steps);
dy = (_local4 / steps);
end_steps = 0;
}
public function resetParams():void{
moveToXY(target.x, target.y);
}
}
}//package game.goals
Section 75
//RandomArtilleryStrike (game.goals.RandomArtilleryStrike)
package game.goals {
import core.*;
import core.goal.*;
import game.logic.*;
import flash.geom.*;
public class RandomArtilleryStrike extends Goal {
private var _engine:Engine;// = null
private var _pause:int;// = 0
private var PAUSE_NEAR:int;// = 270
public function RandomArtilleryStrike():void{
_pause = 0;
_engine = null;
PAUSE_NEAR = (9 * 30);
super();
_engine = Global.top.engine;
}
override public function advance():void{
var _local1:int;
var _local2:Point;
if (_pause > 0){
_pause--;
return;
};
_local1 = (5 * (Math.random() - 0.01));
_local2 = new Point((85 + (Math.random() * 490)), (250 + (Math.random() * 200)));
_engine.goalSystem.add(new ArtilleryStrikeGoal(_local1, _local2, 1));
_pause = (((PAUSE_NEAR / 2) + (PAUSE_NEAR * Math.random())) - (PAUSE_NEAR * Math.random()));
}
}
}//package game.goals
Section 76
//RoadMoverGoal (game.goals.RoadMoverGoal)
package game.goals {
import core.goal.*;
import game.ui.*;
import game.logic.*;
import game.units.*;
import core.common.*;
import game.*;
public class RoadMoverGoal extends Goal {
private var unit:Unit;// = null
private var engine:Engine;// = null
private var node:RoadPoint;// = null
private var road:RoadPath;// = null
private var road_enum:RoadGraph;// = null
private var simple_move:MoveSimpleGoal;// = null
public function RoadMoverGoal(_arg1:Engine, _arg2:Unit, _arg3:RoadPath):void{
engine = null;
unit = null;
road = null;
road_enum = null;
node = null;
simple_move = null;
super();
engine = _arg1;
unit = _arg2;
road = _arg3;
gotoNext();
}
override public function advance():void{
if (unit.currentState != Unit.WALKING){
return;
};
if (simple_move){
simple_move.advance();
if (!simple_move.alive){
simple_move = null;
gotoNext();
};
};
}
public function reset():void{
if (simple_move){
simple_move.deactivate();
simple_move = null;
};
gotoNext();
advance();
}
public function currentNode(){
return (node);
}
public function get simpleMoveGoal():MoveSimpleGoal{
return (simple_move);
}
public function theRoad(){
return (road);
}
public function resetParams():void{
simple_move.resetParams();
}
public function gotoNext():void{
var _local1:RoadPoint;
if (!road_enum){
road_enum = new RoadGraph(road);
_local1 = road_enum.getFirst();
unit.sprite.x = (road.x + _local1.x);
unit.sprite.y = (((road.y + _local1.y) + (Math.random() * 5)) - (Math.random() * 5));
if (unit.type == StringConsts.VULTURE){
unit.sprite.x = (unit.sprite.x - unit.sprite.width);
};
};
node = road_enum.getNext();
if (node){
if (((simple_move) && (simple_move.alive))){
simple_move.deactivate();
simple_move = null;
};
simple_move = new MoveSimpleGoal(engine, unit);
simple_move.moveToXY((road.x + node.x), (road.y + node.y));
} else {
finishReached();
deactivate();
};
}
public function anyNextNodePos():Position{
var _local1:RoadPoint;
_local1 = road_enum.lookAnyNext();
return (new Position((road.x + _local1.x), (road.y + _local1.y)));
}
private function finishReached():void{
engine.baseReached(unit, road);
}
}
}//package game.goals
Section 77
//RoadViceVersaMoverGoal (game.goals.RoadViceVersaMoverGoal)
package game.goals {
import core.goal.*;
import game.ui.*;
import game.logic.*;
import game.units.*;
import game.*;
public class RoadViceVersaMoverGoal extends Goal {
private var unit:Unit;// = null
private var engine:Engine;// = null
private var node:RoadPoint;// = null
private var road:RoadPath;// = null
private var road_enum:RoadGraph;// = null
private var simple_move:MoveSimpleGoal;// = null
public function RoadViceVersaMoverGoal(_arg1:Engine, _arg2:Unit, _arg3:RoadPath):void{
engine = null;
unit = null;
road = null;
road_enum = null;
node = null;
simple_move = null;
super();
engine = _arg1;
unit = _arg2;
road = _arg3;
gotoPrev();
}
override public function advance():void{
if (unit.currentState != Unit.WALKING){
return;
};
if (simple_move){
simple_move.advance();
if (!simple_move.alive){
simple_move = null;
gotoPrev();
};
};
}
public function reset():void{
if (simple_move){
simple_move.deactivate();
simple_move = null;
};
gotoPrev();
advance();
}
public function currentNode(){
return (node);
}
public function get simpleMoveGoal():MoveSimpleGoal{
return (simple_move);
}
public function theRoad(){
return (road);
}
public function resetParams():void{
simple_move.resetParams();
}
public function gotoPrev():void{
var _local1:RoadPoint;
if (!road_enum){
road_enum = new RoadGraph(road);
_local1 = road_enum.getLast();
unit.sprite.x = (road.x + _local1.x);
unit.sprite.y = (road.y + _local1.y);
if (unit.type == StringConsts.VULTURE){
unit.sprite.x = (unit.sprite.x + unit.sprite.width);
};
};
node = road_enum.getPrev();
if (node){
if (((simple_move) && (simple_move.alive))){
simple_move.deactivate();
simple_move = null;
};
simple_move = new MoveSimpleGoal(engine, unit);
simple_move.moveToXY((road.x + node.x), (road.y + node.y));
} else {
engine.baseReached(unit, road);
deactivate();
};
}
}
}//package game.goals
Section 78
//ScenarioGoal (game.goals.ScenarioGoal)
package game.goals {
import core.*;
import core.goal.*;
import game.logic.*;
import flash.geom.*;
import caurina.transitions.*;
import core.common.*;
import game.*;
public class ScenarioGoal extends Goal {
private var engine:Engine;// = null
private var _ai_thinking_pause:int;// = 0
private var grand_went:Boolean;// = false
private var level_time:int;// = 0
private var _think_pause:int;// = 0
private var _ai_thinker:AIThinker;// = null
private var time_spent:int;// = 0
private static var frame_rate:int = 0;
public function ScenarioGoal(_arg1:Engine):void{
engine = null;
time_spent = 0;
level_time = 0;
grand_went = false;
_ai_thinker = null;
_think_pause = 0;
_ai_thinking_pause = 0;
super();
frame_rate = Global.mainStage.frameRate;
engine = _arg1;
_ai_thinker = new AIThinker();
LevelSelector.initializeAI(_ai_thinker);
}
public function get grandWent():Boolean{
return (grand_went);
}
override public function advance():void{
if (engine.gameFinished){
return;
};
time_spent++;
if (((((((grand_went) && (!(engine.grandStormGoal.alive)))) && ((engine.gameBoard.allyUnits.aliveCount() == 0)))) && ((engine.gameBoard.enemyUnits.aliveCount() == 0)))){
calculateVictoryByBalance();
return;
};
if (isGoalFailed()){
engine.gameOver();
return;
};
if (isGoalDone()){
engine.victory();
return;
};
if (level_time <= 0){
if (!grand_went){
grandStorm();
};
} else {
level_time--;
engine.playWindowUI.balanceBar.grandStormBar.setProgress(((engine.levelMap.level_time - (level_time / frame_rate)) / engine.levelMap.level_time));
updateCountdown();
};
if (_think_pause > 0){
_think_pause--;
if (_think_pause == 0){
_think_pause = frame_rate;
} else {
return;
};
};
if (_ai_thinking_pause > 0){
_ai_thinking_pause--;
return;
};
if (!grand_went){
_ai_thinker.think();
_ai_thinking_pause = frame_rate;
};
}
private function calculateVictoryByBalance():void{
if (engine.playWindowUI.balanceBar.isFartherOfCenter()){
engine.victory();
} else {
engine.gameOver();
};
}
public function get timeSpent():int{
return ((time_spent / frame_rate));
}
public function setLevelTime(_arg1:int):void{
level_time = (_arg1 * frame_rate);
updateCountdown();
}
public function get levelTime():int{
return (level_time);
}
private function updateCountdown():void{
var _local1:int;
var _local2:int;
var _local3:int;
_local1 = ((level_time / frame_rate) / 60);
_local2 = (int((level_time / frame_rate)) % 60);
_local3 = (level_time % 10);
engine.playWindowUI.countdown_txt.text = sprintf("%02d:%02d:%02d", _local1, _local2, _local3);
}
public function isGoalFailed():Boolean{
return (engine.playWindowUI.balanceBar.isLeftPointReached);
}
private function grandStorm():void{
engine.playSound(SoundConsts.final_attack);
grand_went = true;
engine.grandStormGoal.working = true;
Tweener.addTween(engine.playWindowUI.countdown_txt, {alpha:0, time:1, transition:"easeOutQuad"});
EffectFactory.makeExplosion(EffectFactory.GRAND_STORM, new Point(343, 155), 1, engine.playWindowUI);
}
public function isGoalDone():Boolean{
return (engine.playWindowUI.balanceBar.isRightPointReached);
}
}
}//package game.goals
Section 79
//StormGoal (game.goals.StormGoal)
package game.goals {
import core.*;
import core.goal.*;
import game.logic.*;
import caurina.transitions.*;
import game.*;
public class StormGoal extends Goal {
private var _storm_bar;// = null
private var _waiting:Boolean;// = false
private var _show_messages:Boolean;// = true
private var engine:Engine;// = null
public var PAUSE:int;// = 1920
private var _storm_label;// = null
private var pause:int;// = 0
public function StormGoal(_arg1, _arg2, _arg3:int, _arg4:Boolean):void{
PAUSE = 1920;
pause = 0;
engine = null;
_waiting = false;
_storm_bar = null;
_storm_label = null;
_show_messages = true;
super();
_show_messages = _arg4;
PAUSE = _arg3;
_storm_bar = _arg1;
_storm_label = _arg2;
_storm_label.stop();
engine = Global.top.engine;
pause = PAUSE;
stormBar.setProgress(0);
}
override public function advance():void{
if (_waiting){
return;
};
if (pause > 0){
pause--;
stormBar.setProgress((1 - (pause / PAUSE)));
return;
};
setStormWaiting();
}
public function get isWaiting():Boolean{
return (_waiting);
}
public function get stormLabel(){
return (_storm_label);
}
public function hideStormHatchArrows():void{
engine.levelMap.storm_hatch_arrows.visible = false;
}
public function increaseCharge(_arg1:int):void{
if ((pause - _arg1) <= 0){
pause = 0;
} else {
pause = (pause - _arg1);
};
}
private function setStormWaiting():void{
_waiting = true;
stormLabel.gotoAndStop("waiting_label");
if (_show_messages){
engine.levelMap.storm_hatch_arrows.alpha = 1;
engine.levelMap.storm_hatch_arrows.visible = true;
Tweener.removeTweens(engine.levelMap.storm_hatch_arrows);
engine.playWindowUI.logMessage("Storm attack is ready!");
};
engine.playSound(SoundConsts.storm_attack);
}
public function reset():void{
stormBar.setProgress(0);
stormLabel.gotoAndStop("normal_label");
_waiting = false;
pause = PAUSE;
if (_show_messages){
Tweener.addTween(engine.levelMap.storm_hatch_arrows, {alpha:0, time:2, transition:"easeOutQuad", onComplete:hideStormHatchArrows});
};
}
public function get stormBar(){
return (_storm_bar);
}
}
}//package game.goals
Section 80
//VultureGoal (game.goals.VultureGoal)
package game.goals {
import core.goal.*;
import game.ui.*;
import game.logic.*;
import game.units.*;
import game.*;
public class VultureGoal extends Goal {
private var unit:Unit;// = null
private var landing_ticks:int;// = 0
private var landing_forces_type:String;
private var engine:Engine;// = null
private var road:RoadPath;// = null
private var LANDING_FORCES_TYPE:String;// = "Marine"
private static const LANDING_FORCES_COUNT:int = 3;
private static const LANDING_TICKS:int = 25;
public function VultureGoal(_arg1:Engine, _arg2:Unit, _arg3:RoadPath):void{
engine = null;
unit = null;
road = null;
landing_ticks = 0;
LANDING_FORCES_TYPE = StringConsts.MARINE;
super();
engine = _arg1;
unit = _arg2;
road = _arg3;
landing_forces_type = LANDING_FORCES_TYPE;
unit.sprite.y = ((road.y + road.points.values[0].y) - (unit.sprite.height / 1.2));
if (unit.isEnemy){
unit.sprite.x = 1018;
} else {
unit.sprite.x = -324;
};
unit.sprite.setGoal(this);
engine.levelMap.addChild(unit.sprite);
unit.sprite.play();
}
override public function advance():void{
if (landing_ticks > 0){
landing_ticks--;
if (0 == landing_ticks){
landForces();
flyAway();
};
};
if (unit.sprite.isFinished){
deactivate();
};
}
public function vehicleLanded():void{
landing_ticks = LANDING_TICKS;
}
private function flyAway():void{
unit.sprite.gotoAndPlay("departure");
}
override public function deactivate():void{
if (!unit){
return;
};
engine.gameBoard.wipeUnit(unit);
unit = null;
super.deactivate();
}
private function landForces():void{
var _local1:Unit;
var _local2:Number;
var _local3:int;
var _local4:MoveSimpleGoal;
_local1 = null;
_local2 = 0.37;
_local3 = 0;
while (_local3 < LANDING_FORCES_COUNT) {
if (_local3 == 0){
_local1 = engine.gameBoard.createUnit(StringConsts.MISSILE_MAN, road.index, unit.isEnemy);
} else {
_local1 = engine.gameBoard.createUnit(landing_forces_type, road.index, unit.isEnemy);
};
if (null == _local1.life.getMover().currentNode()){
if (_local1.isEnemy){
_local1.life.getMover().gotoPrev();
} else {
_local1.life.getMover().gotoNext();
};
};
_local4 = _local1.life.getMover().simpleMoveGoal;
_local4.moveOn(_local2);
_local2 = (_local2 + 0.016);
_local3++;
};
}
}
}//package game.goals
Section 81
//AIThinker (game.logic.AIThinker)
package game.logic {
import core.*;
import game.units.*;
import game.goals.*;
import flash.geom.*;
import core.common.*;
import game.*;
public class AIThinker {
private var _buttons:Map;
private var _selection_button_goal:AISelectButtonGoal;// = null
private var _level_complexity:Number;// = 0
private var _wait_for_target_unit:Unit;// = null
private var PAUSE:int;// = 0
private var _wait_times:int;// = 0
private var _engine:Engine;// = null
private var _wait_for_road:int;// = 0
private var _wait_for_send_type:String;
private var _pause_likelihood:Number;// = 0
private var _specials:Map;
private var _pause:int;// = 0
public function AIThinker(){
var _local1:String;
var _local2:String;
_engine = null;
_buttons = new Map();
_specials = new Map();
_selection_button_goal = null;
PAUSE = 0;
_pause = 0;
_pause_likelihood = 0;
_level_complexity = 0;
_wait_times = 0;
_wait_for_target_unit = null;
_wait_for_road = 0;
super();
_engine = Global.top.engine;
for each (_local1 in _engine.enemyCards) {
if (_local1 != StringConsts.EMPTY){
_buttons.add(_local1, _engine.playWindowUI.enemyButons.getButtonByType(_local1));
if (StringConsts.MINER_DROID == _local1){
_wait_times = 5;
_wait_for_send_type = StringConsts.MINER_DROID;
_wait_for_target_unit = null;
_wait_for_road = anyRoad();
};
};
};
for each (_local2 in _engine.enemySpecials) {
if (_local2 != StringConsts.EMPTY){
_specials.add(_local2, _engine.playWindowUI.enemyButons.getButtonByType(_local2));
};
};
}
private function doAStrike(_arg1:int, _arg2:Point, _arg3:int):void{
_engine.goalSystem.add(new ArtilleryStrikeGoal(_arg1, _arg2, _arg3));
_engine.playWindowUI.enemyButons.getButtonByType(StringConsts.ARTILLERY_STRIKE).ticks_goal.reset();
}
private function dropFFStrike():void{
var _local1:Unit;
var _local2:Point;
if ((((_engine.gameBoard.enemyUnits.length == 0)) || (((_selection_button_goal) && (_selection_button_goal.alive))))){
return;
};
_local1 = getStrongestAttackingUnit();
if (_local1){
_local2 = new Point(_local1.sprite.x, _local1.sprite.y);
_selection_button_goal = new AISelectButtonGoal(StringConsts.FORCE_FIELD, this, doFF, _local2, _local1.life.getCurrentRoad().index);
_engine.goalSystem.add(_selection_button_goal);
};
}
public function think():void{
var _local1:Number;
var _local2:int;
if (((_selection_button_goal) && (_selection_button_goal.alive))){
return;
};
if (PAUSE > 0){
if (_pause > 0){
_pause--;
return;
};
};
checkSpecials();
if (((_selection_button_goal) && (_selection_button_goal.alive))){
return;
};
if (_wait_times > 0){
if (((_wait_for_target_unit) && (!(_wait_for_target_unit.isAlive)))){
_wait_for_target_unit = null;
_wait_times = 0;
} else {
_wait_times--;
if (0 == _wait_times){
_wait_for_target_unit = null;
_selection_button_goal = new AISelectButtonGoal(_wait_for_send_type, this, createUnit, _wait_for_send_type, _wait_for_road);
_engine.goalSystem.add(_selection_button_goal);
};
return;
};
};
_local1 = Math.random();
_local2 = 0;
if (_local1 > (_level_complexity / 2)){
_local2 = weakestRoad();
} else {
_local2 = getMaxSynergyGapRoad();
};
sendUnit(_local2);
if (PAUSE > 0){
if (Math.random() < _pause_likelihood){
_pause = ((PAUSE - ((Math.random() * PAUSE) / 2)) + 1);
};
};
}
private function doFF(_arg1, _arg2:int):void{
_engine.goalSystem.add(new ForceFieldGoal(_arg1, _arg2, true));
_engine.playWindowUI.enemyButons.getButtonByType(StringConsts.FORCE_FIELD).ticks_goal.reset();
}
private function doNuke():void{
_engine.playWindowUI.enemyButons.getButtonByType(StringConsts.NUCLEAR_MISSILE).ticks_goal.reset();
_engine.makeSpecialEffect(StringConsts.NUCLEAR_MISSILE);
}
public function set level_complexity(_arg1:Number):void{
_level_complexity = _arg1;
if ((((Global.top.engine.lastLevelIndex > 0)) || ((Global.top.engine.lastZone > 0)))){
if (_level_complexity < 0.4){
_level_complexity = 0.4;
};
};
}
private function weakestRoad():int{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
_local1 = anyRoad();
_local2 = 99999999;
_local3 = 0;
while (_local3 < _engine.gameBoard.roadInfos.length) {
_local4 = (_engine.gameBoard.roadInfos[_local3] as RoadInfo).player_synergy;
if ((((_local4 > 0)) && ((_local4 < _local2)))){
_local1 = _local3;
_local2 = _local4;
};
_local3++;
};
return (_local1);
}
private function sendUnit(_arg1:int):void{
var _local2:Unit;
var _local3:String;
var _local4:Boolean;
var _local5:Number;
var _local6:*;
_local2 = getFarthestUnit(_arg1);
_local4 = false;
_local5 = Math.random();
if (((_local2) && ((_local5 <= _level_complexity)))){
_local3 = findBestResitance(_local2.type);
} else {
_local3 = anyCard();
_local4 = true;
};
_local6 = _buttons.get(_local3);
if (_local6){
if (_local6.ticks_goal.ready){
_selection_button_goal = new AISelectButtonGoal(_local3, this, createUnit, _local3, _arg1);
_engine.goalSystem.add(_selection_button_goal);
} else {
if (((_local4) && (_local2))){
_wait_times = (_local6.ticks_goal.ticksRest / Global.mainStage.frameRate);
_wait_for_send_type = _local3;
_wait_for_target_unit = _local2;
_wait_for_road = _arg1;
};
};
};
}
private function dropNukeLogic():void{
var _local1:Number;
var _local2:Number;
var _local3:int;
var _local4:Boolean;
if ((((_engine.gameBoard.allyUnits.length == 0)) || (((_selection_button_goal) && (_selection_button_goal.alive))))){
return;
};
_local1 = 0;
_local2 = 0;
_local3 = 0;
while (_local3 < _engine.gameBoard.roadInfos.length) {
_local1 = (_local1 + (_engine.gameBoard.roadInfos[_local3] as RoadInfo).player_synergy);
_local2 = (_local2 + (_engine.gameBoard.roadInfos[_local3] as RoadInfo).enemy_synergy);
_local3++;
};
_local4 = (((_engine.playWindowUI.balanceBar.balance > 0.5)) && (((5 - int((((1 - _engine.playWindowUI.balanceBar.balance) * 5) / 0.5))) > 3)));
if ((((_local1 > (_local2 * 1.2))) || (_local4))){
_selection_button_goal = new AISelectButtonGoal(StringConsts.NUCLEAR_MISSILE, this, doNuke);
_engine.goalSystem.add(_selection_button_goal);
};
}
private function checkMinerLogic(_arg1:int):String{
var _local2:Unit;
if ((_engine.gameBoard.roadInfos[_arg1] as RoadInfo).player_synergy > 0){
_local2 = getFarthestUnit(_arg1);
if (_local2){
return (findBestResitance(_local2.type));
};
};
return (StringConsts.MINER_DROID);
}
private function anyCard():String{
var _local1:int;
_local1 = int(((Math.random() - 0.01) * _buttons.size()));
return (_buttons.values[_local1].unit_type);
}
public function setThinkingPause(_arg1:int, _arg2:Number):void{
PAUSE = _arg1;
_pause = 0;
_pause_likelihood = _arg2;
}
private function getStrongestAttackingUnit():Unit{
var _local1:Number;
var _local2:Unit;
var _local3:int;
var _local4:Unit;
var _local5:Array;
_local1 = 0;
_local2 = null;
_local3 = 0;
while (_local3 < _engine.gameBoard.enemyUnits.length) {
_local4 = _engine.gameBoard.enemyUnits[_local3];
_local5 = _engine.specialTargeting.getRangeFor(_local4.life.getCurrentRoad().index);
if (_local4.life.isAttacking){
if (((_local5) && ((((_local4.sprite.x < _local5[0])) || ((_local4.sprite.x > _local5[1])))))){
} else {
if ((((_local4.health < _local4.full_health)) && ((_local4.full_health > _local1)))){
_local1 = _local4.full_health;
_local2 = _local4;
};
};
};
_local3++;
};
return (_local2);
}
private function createUnit(_arg1:String, _arg2:int):void{
if (_engine.enemyStormGoal.isWaiting){
_engine.gameBoard.sendFromAllHatches(_arg1, true);
_engine.enemyStormGoal.reset();
} else {
_engine.gameBoard.createUnit(_arg1, _arg2, true);
};
_engine.playWindowUI.enemyButons.buttonSetGoal.resetAll();
}
private function dropArtilleryStrike():void{
var _local1:int;
var _local2:Unit;
if ((((_engine.gameBoard.allyUnits.length == 0)) || (((_selection_button_goal) && (_selection_button_goal.alive))))){
return;
};
_local1 = getMaxSynergyGapRoad();
_local2 = getFarthestUnit(_local1, _engine.specialTargeting.getRangeFor(_local1));
if (_local2){
_selection_button_goal = new AISelectButtonGoal(StringConsts.ARTILLERY_STRIKE, this, doAStrike, _local1, new Point(_local2.sprite.x, _local2.sprite.y), _engine.astrikeDropCount);
_engine.goalSystem.add(_selection_button_goal);
};
}
private function checkSpecials():void{
var _local1:*;
_local1 = null;
_local1 = _specials.get(StringConsts.ARTILLERY_STRIKE);
if (((_local1) && (_local1.ticks_goal.ready))){
dropArtilleryStrike();
};
_local1 = _specials.get(StringConsts.FORCE_FIELD);
if (((_local1) && (_local1.ticks_goal.ready))){
dropFFStrike();
};
_local1 = _specials.get(StringConsts.NUCLEAR_MISSILE);
if (((_local1) && (_local1.ticks_goal.ready))){
dropNukeLogic();
};
}
public function get level_complexity():Number{
return (_level_complexity);
}
private function findBestResitance(_arg1:String):String{
var _local2:*;
_local2 = null;
if (StringConsts.MARINE == _arg1){
_local2 = _buttons.get(StringConsts.STORM_TANK);
if (_local2){
return (_local2.unit_type);
};
};
if (StringConsts.MISSILE_MAN == _arg1){
_local2 = _buttons.get(StringConsts.MARINE);
if (_local2){
return (_local2.unit_type);
};
};
if (StringConsts.SPECIALIST == _arg1){
_local2 = _buttons.get(StringConsts.STORM_TANK);
if (_local2){
return (_local2.unit_type);
};
};
if (StringConsts.STORM_TANK == _arg1){
_local2 = _buttons.get(StringConsts.MISSILE_MAN);
if (_local2){
return (_local2.unit_type);
};
};
if (StringConsts.VULTURE == _arg1){
_local2 = _buttons.get(StringConsts.STORM_TANK);
if (_local2){
return (_local2.unit_type);
};
};
if (StringConsts.CATERPILLAR == _arg1){
_local2 = _buttons.get(StringConsts.SPECIALIST);
if (_local2){
return (_local2.unit_type);
};
};
if (StringConsts.GRENADIER_DROID == _arg1){
_local2 = _buttons.get(StringConsts.SPECIALIST);
if (_local2){
return (_local2.unit_type);
};
};
if (StringConsts.MINER_DROID == _arg1){
_local2 = _buttons.get(StringConsts.MISSILE_MAN);
if (_local2){
return (_local2.unit_type);
};
_local2 = _buttons.get(StringConsts.VULTURE);
if (_local2){
return (_local2.unit_type);
};
_local2 = _buttons.get(StringConsts.MARINE);
if (_local2){
return (_local2.unit_type);
};
_local2 = _buttons.get(StringConsts.STORM_TANK);
if (_local2){
return (_local2.unit_type);
};
};
if ((((Math.random() < 0.25)) && (_buttons.get(StringConsts.CATERPILLAR)))){
return (_local2.unit_type);
};
if ((((Math.random() < 0.5)) && (_buttons.get(StringConsts.VULTURE)))){
return (_local2.unit_type);
};
if ((((Math.random() < 0.75)) && (_buttons.get(StringConsts.MARINE)))){
return (_local2.unit_type);
};
if ((((Math.random() < 0.85)) && (_buttons.get(StringConsts.GRENADIER_DROID)))){
return (_local2.unit_type);
};
return (anyCard());
}
private function anyRoad():int{
return (((Math.random() - 0.01) * 5));
}
private function getFarthestUnit(_arg1:int, _arg2:Array=null):Unit{
var _local3:Number;
var _local4:Unit;
var _local5:int;
var _local6:Unit;
_local3 = 0;
_local4 = null;
_local5 = 0;
while (_local5 < _engine.gameBoard.allyUnits.length) {
_local6 = _engine.gameBoard.allyUnits[_local5];
if (_local6.life.getCurrentRoad().index == _arg1){
if (((_arg2) && ((((_local6.sprite.x < _arg2[0])) || ((_local6.sprite.x > _arg2[1])))))){
} else {
if (_local6.sprite.x > _local3){
_local3 = _local6.sprite.x;
_local4 = _local6;
};
};
};
_local5++;
};
return (_local4);
}
private function getMaxSynergyGapRoad():int{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
_local1 = ((Math.random() - 0.01) * 5);
_local2 = -1;
_local3 = 0;
while (_local3 < _engine.gameBoard.roadInfos.length) {
_local4 = ((_engine.gameBoard.roadInfos[_local3] as RoadInfo).player_synergy - (_engine.gameBoard.roadInfos[_local3] as RoadInfo).enemy_synergy);
if (_local4 > _local2){
_local1 = _local3;
_local2 = _local4;
};
_local3++;
};
return (_local1);
}
}
}//package game.logic
Section 82
//EffectFactory (game.logic.EffectFactory)
package game.logic {
import core.*;
import core.goal.*;
import flash.geom.*;
import core.common.*;
import core.cache.*;
import game.*;
public class EffectFactory {
public static const BLUE_STORM_TANK_DEATH:int = 15;
public static const MM_IMPACT:int = 6;
public static const MINE_EXPLOSION:int = 1;
public static const STORM_TANK_IMPACT:int = 8;
public static const NUCLEAR_MISSILE:int = 5;
public static const GRAND_STORM:int = 19;
public static const RED_CATERPILLAR_DEATH:int = 12;
public static const MINER_EXPLOSION:int = 14;
public static const HATCH_EXPLOSION:int = 2;
public static const RED_STORM_TANK_DEATH:int = 16;
public static const MARINE_IMPACT:int = 4;
public static const NUCLEAR_MISSILE_COUNTING:int = 18;
public static const SF_IMPACT:int = 7;
public static const GRENADIER_DEATH:int = 10;
public static const CATERPILLAR_IMPACT:int = 9;
public static const ASTRIKE_DROP:int = 3;
public static const BLUE_CATERPILLAR_DEATH:int = 11;
public static const HATCH_EXPLOSION_ENEMY:int = 17;
private static var pool:ObjectList = new ObjectList();
public static function setPause(_arg1:Boolean):void{
var _local2:*;
for each (_local2 in pool) {
if (_arg1){
_local2.stop();
} else {
_local2.play();
};
};
}
private static function cacheHelper(_arg1:String, _arg2:Point, _arg3:Number, _arg4:Number, _arg5, _arg6:Function, _arg7:Function=null, _arg8:Function=null, _arg9:int=0, _arg10:int=0){
var _local11:CachedMovieClip;
var _local12:*;
var _local13:CachedBitmapGoal;
var _local14:MovieClipRenderGoal;
_local11 = null;
_local12 = null;
_local11 = MovieClipCache.getCached(_arg1);
if (((_local11) && (_local11.alreadyCached))){
_local13 = CachedBitmapGoal.draw(_local11, _arg2, _arg5);
if (_arg7){
_arg7(_local13);
};
return (_local13);
} else {
_local12 = _arg6();
if (!_local11){
_local14 = new MovieClipRenderGoal(_local12, _arg1, _arg9, _arg10);
if (_arg8){
_arg8(_local14, _local12);
};
Global.top.engine.goalSystem.add(_local14);
} else {
MovieClipRenderGoal.cleanScaffolds(_local12);
};
createEffect(_local12, _arg2, _arg3, _arg4, _arg5);
};
return (_local12);
}
public static function cleanPool():void{
var _local1:*;
for each (_local1 in pool) {
if ((_local1 is IGoal)){
_local1.deactivate();
} else {
_local1.stop();
};
};
pool.clear();
}
public static function makeExplosion(_arg1:int, _arg2:Point, _arg3:Number=1, _arg4=null, _arg5:int=0){
var cache_id:String;
var cached:CachedMovieClip;
var clip:*;
var rand_value:Number;
var cbg:CachedBitmapGoal;
var type = _arg1;
var point = _arg2;
var scale_factor = _arg3;
var layer = _arg4;
var res = _arg5;
if (null == layer){
layer = Global.top.engine.gameBoard;
};
cached = null;
clip = null;
switch (type){
case GRENADIER_DEATH:
return (cacheHelper("GRENADIER_DEATH", point, scale_factor, scale_factor, layer, function (){
return (new GrenadierExplosion());
}, function (_arg1){
_arg1.assignRoutine(5, EffectRoutines.AddGrenadierCrater);
}, null, 30, 30));
case MINE_EXPLOSION:
return (cacheHelper("MINE_EXPLOSION", point, scale_factor, scale_factor, layer, function (){
return (new MineExplosion());
}, function (_arg1){
_arg1.assignRoutine(3, EffectRoutines.AddMineCrater);
}, null, 30, 30));
case HATCH_EXPLOSION:
return (cacheHelper("HATCH_EXPLOSION", point, scale_factor, scale_factor, layer, function (){
return (new HatchExplosion());
}, null, null, 40, 15));
case HATCH_EXPLOSION_ENEMY:
return (cacheHelper("HATCH_EXPLOSION_ENEMY", point, scale_factor, scale_factor, layer, function (){
return (new HatchExplosion());
}, null, null, 50, 15));
case ASTRIKE_DROP:
rand_value = Math.random();
cache_id = ASTRIKE_DROP.toString();
if (res != 0){
if (1 == res){
cache_id = (cache_id + "1");
} else {
if (2 == res){
cache_id = (cache_id + "2");
} else {
if (3 == res){
cache_id = (cache_id + "3");
};
};
};
} else {
if (rand_value <= 0.33){
cache_id = (cache_id + "1");
} else {
if (rand_value <= 0.66){
cache_id = (cache_id + "2");
} else {
cache_id = (cache_id + "3");
};
};
Global.top.engine.playSound(SoundConsts.artillery_strike);
};
cached = MovieClipCache.getCached(cache_id);
if (((cached) && (cached.alreadyCached))){
cbg = CachedBitmapGoal.draw(cached, point, layer);
cbg.assignRoutine(6, EffectRoutines.AddCrater);
return (cbg);
};
if (res != 0){
if (1 == res){
clip = new AStrike1();
} else {
if (2 == res){
clip = new AStrike2();
} else {
if (3 == res){
clip = new AStrike3();
};
};
};
} else {
if (rand_value <= 0.33){
clip = new AStrike1();
} else {
if (rand_value <= 0.66){
clip = new AStrike2();
} else {
clip = new AStrike3();
};
};
};
if (!cached){
Global.top.engine.goalSystem.add(new MovieClipRenderGoal(clip, cache_id, 40, 30));
} else {
MovieClipRenderGoal.cleanScaffolds(clip);
};
createEffect(clip, point, scale_factor, scale_factor, layer);
return (clip);
case NUCLEAR_MISSILE:
Global.top.engine.playSound(SoundConsts.artillery_strike);
Global.top.engine.playSound(SoundConsts.explosion);
Global.top.engine.playSound(SoundConsts.explosion1);
Global.top.engine.playSound(SoundConsts.hit1);
Global.top.engine.playSound(SoundConsts.hit1);
Global.top.engine.playSound(SoundConsts.hit1);
Global.top.engine.playSound(SoundConsts.hit1);
Global.top.engine.playSound(SoundConsts.hit1);
Global.top.engine.playSound(SoundConsts.hit1);
createEffect(new Nuke(), point, scale_factor, scale_factor, layer);
break;
case NUCLEAR_MISSILE_COUNTING:
Global.top.engine.playSound(SoundConsts.nuclear_counting);
createEffect(new NukeCounting(), point, scale_factor, scale_factor, layer);
break;
case GRAND_STORM:
createEffect(new GrandStormMessage(), point, scale_factor, scale_factor, layer);
break;
};
return (null);
}
public static function addCraterFrom(_arg1, _arg2:Number=0.3, _arg3:Number=0.5):Crater{
var _local4:Engine;
var _local5:Crater;
if (((_arg1.hasOwnProperty("params")) && (_arg1.params.skipCrater))){
return (null);
};
_local4 = Global.top.engine;
_local5 = new Crater();
_local5.x = _arg1.x;
_local5.y = _arg1.y;
_local5.scaleX = (_local5.scaleY = _arg2);
_local5.alpha = _arg3;
_local4.gameBoard.unitMaskLayer.masked_layer.crater_layer.addChild(_local5);
_local4.gameBoard.unitMaskLayer.masked_layer.crater_layer.cacheAsBitmap = true;
return (_local5);
}
public static function makeDeath(_arg1:int, _arg2:Point, _arg3:Number=1, _arg4:Number=1, _arg5=null){
var type = _arg1;
var point = _arg2;
var scale_x = _arg3;
var scale_y = _arg4;
var layer = _arg5;
if (null == layer){
layer = Global.top.engine.gameBoard;
};
switch (type){
case BLUE_CATERPILLAR_DEATH:
return (cacheHelper("BLUE_CATERPILLAR_DEATH", point, scale_x, scale_y, layer, function (){
return (new BlueCaterpilarDeath());
}, null, function (_arg1, _arg2){
_arg1.setFinalCondition(MovieClipRenderGoal.TOTAL_FRAMES, {totalFrames:_arg2.totalFrames});
}, 30, 20));
case RED_CATERPILLAR_DEATH:
return (cacheHelper("RED_CATERPILLAR_DEATH", point, scale_x, scale_y, layer, function (){
return (new RedCaterpilarDeath());
}, null, function (_arg1, _arg2){
_arg1.setFinalCondition(MovieClipRenderGoal.TOTAL_FRAMES, {totalFrames:_arg2.totalFrames});
}, 20, 30));
case BLUE_STORM_TANK_DEATH:
return (cacheHelper("BLUE_STORM_TANK_DEATH", point, scale_x, scale_y, layer, function (){
return (new BlueStormTankDeath());
}, null, function (_arg1, _arg2){
_arg1.setFinalCondition(MovieClipRenderGoal.TOTAL_FRAMES, {totalFrames:_arg2.totalFrames});
}, 25, 20));
case RED_STORM_TANK_DEATH:
return (cacheHelper("RED_STORM_TANK_DEATH", point, scale_x, scale_y, layer, function (){
return (new RedStormTankDeath());
}, null, function (_arg1, _arg2){
_arg1.setFinalCondition(MovieClipRenderGoal.TOTAL_FRAMES, {totalFrames:_arg2.totalFrames});
}, 25, 20));
case MINER_EXPLOSION:
return (cacheHelper("MINER_EXPLOSION", point, scale_x, scale_y, layer, function (){
return (new MinerExplosion());
}, null, function (_arg1, _arg2){
_arg1.setFinalCondition(MovieClipRenderGoal.TOTAL_FRAMES, {totalFrames:17});
}, 40, 40));
};
return (null);
}
public static function effectFinished(_arg1):void{
_arg1.parent.removeChild(_arg1);
pool.remove(_arg1);
}
private static function createEffect(_arg1, _arg2:Point, _arg3:Number, _arg4:Number, _arg5):void{
_arg1.x = _arg2.x;
_arg1.y = _arg2.y;
_arg1.scaleX = _arg3;
_arg1.scaleY = _arg4;
_arg5.addChild(_arg1);
_arg1.play();
pool.push(_arg1);
}
public static function makeImpact(_arg1:int, _arg2:Point, _arg3:Number=1, _arg4=null):void{
var type = _arg1;
var point = _arg2;
var scale_factor = _arg3;
var layer = _arg4;
if (null == layer){
layer = Global.top.engine.gameBoard;
};
switch (type){
case MARINE_IMPACT:
cacheHelper("MARINE_IMPACT", point, scale_factor, scale_factor, layer, function (){
return (new MarineBulletImpact());
}, null, null, 5, 5);
break;
case MM_IMPACT:
cacheHelper("MM_IMPACT", point, scale_factor, scale_factor, layer, function (){
return (new MMImpact());
}, null, null, 20, 20);
break;
case SF_IMPACT:
cacheHelper("SF_IMPACT", point, scale_factor, scale_factor, layer, function (){
return (new SFImpact());
}, null, null, 5, 5);
break;
case STORM_TANK_IMPACT:
cacheHelper("STORM_TANK_IMPACT", point, scale_factor, scale_factor, layer, function (){
return (new StormTankImpact());
}, null, null, 35, 25);
break;
case CATERPILLAR_IMPACT:
cacheHelper("CATERPILLAR_IMPACT", point, scale_factor, scale_factor, layer, function (){
return (new CaterpillarImpact());
}, null, null, 40, 30);
break;
};
}
}
}//package game.logic
Section 83
//EffectRoutines (game.logic.EffectRoutines)
package game.logic {
import core.*;
import game.goals.*;
import flash.geom.*;
import game.*;
public class EffectRoutines {
public static function AddCrater(_arg1):void{
EffectFactory.addCraterFrom(_arg1);
}
public static function AddNukeCrater(_arg1):void{
var _local2:Crater;
_local2 = EffectFactory.addCraterFrom(_arg1, 1.2, 1.2);
_local2.y = (_local2.y - 50);
}
public static function AddMineCrater(_arg1):void{
EffectFactory.addCraterFrom(_arg1, 0.2, 0.5);
}
public static function doNuke():void{
var _local1:Engine;
_local1 = Global.top.engine;
EffectFactory.makeExplosion(EffectFactory.NUCLEAR_MISSILE, new Point(348, 410), 0.8, _local1.gameBoard);
_local1.gameBoard.allyUnits.applyDamage(Consts.NUCLEAR_DAMAGE, DieMarineGoal.DEATH_BY_EXPLOSION);
_local1.gameBoard.enemyUnits.applyDamage(Consts.NUCLEAR_DAMAGE, DieMarineGoal.DEATH_BY_EXPLOSION);
_local1.gameBoard.mines.applyDamage(Consts.NUCLEAR_DAMAGE, DieMarineGoal.DEATH_BY_EXPLOSION);
}
public static function AddGrenadierCrater(_arg1):void{
EffectFactory.addCraterFrom(_arg1, 0.35, 0.8);
}
}
}//package game.logic
Section 84
//Engine (game.logic.Engine)
package game.logic {
import core.*;
import core.goal.*;
import flash.events.*;
import flash.display.*;
import game.ui.*;
import game.units.*;
import flash.media.*;
import game.goals.*;
import flash.geom.*;
import caurina.transitions.*;
import core.common.*;
import flash.utils.*;
import game.*;
public class Engine {
private var _lost:int;// = 0
private var game_events:GameEvents;// = null
public var musicOff:Boolean;// = false
public var volume:Number;// = 1
private var _grand_storm_goal:GrandStormGoal;// = null
private var _enemy_storm_goal:StormGoal;// = null
private var level_map;// = null
private var game_finished:Boolean;// = false
private var _enemy_cards:Array;
private var paused:Boolean;// = false
private var _specials:Array;
private var _storm_goal:StormGoal;// = null
private var _last_zone:int;// = 0
private var game_board:GameBoard;// = null
private var scenario_goal:ScenarioGoal;// = null
private var _cards:Array;
private var vd_timer:Timer;// = null
private var music_sound:Sound;// = null
private var _map_holder;// = null
private var score:int;// = 0
private var _auto_send:Boolean;// = false
private var last_level:int;// = 0
private var special_targeting:SpecialTargeting;// = null
private var _hatches:Hatches;// = null
private var ui_holder:Sprite;// = null
private var _astrike_drop_count:int;// = 10
private var _enemy_specials:Array;
private var _kills:int;// = 0
private var goal_system:GoalSystem;// = null
private var _creds:int;// = 0
private var music_channel:SoundChannel;// = null
public var volumeOff:Boolean;// = false
private var play_window_ui:PlayWindowUI;// = null
public function Engine():void{
game_events = null;
ui_holder = null;
level_map = null;
play_window_ui = null;
game_board = null;
_map_holder = null;
score = 0;
paused = false;
vd_timer = null;
last_level = 0;
goal_system = null;
scenario_goal = null;
_hatches = null;
special_targeting = null;
_astrike_drop_count = 10;
_storm_goal = null;
_enemy_storm_goal = null;
_grand_storm_goal = null;
_kills = 0;
_lost = 0;
_auto_send = false;
_cards = [StringConsts.MARINE, StringConsts.EMPTY, StringConsts.EMPTY, StringConsts.EMPTY];
_enemy_cards = [StringConsts.MARINE, StringConsts.EMPTY, StringConsts.EMPTY, StringConsts.EMPTY];
_specials = [StringConsts.ARTILLERY_STRIKE, StringConsts.EMPTY, StringConsts.EMPTY];
_enemy_specials = [StringConsts.EMPTY, StringConsts.EMPTY, StringConsts.EMPTY];
volume = 1;
volumeOff = false;
musicOff = false;
music_sound = null;
music_channel = null;
game_finished = false;
_last_zone = 0;
_creds = 0;
super();
}
private function destroyUI():void{
play_window_ui.destroy();
ui_holder.removeChild(play_window_ui);
play_window_ui = null;
ui_holder.removeChild(game_board);
game_board.destroy();
game_board = null;
Tweener.removeAllTweens();
ui_holder.removeChild(_map_holder);
Global.top.playHolder.removeChild(ui_holder);
ui_holder = null;
_map_holder = null;
level_map = null;
}
public function victory():void{
var _local1:VictoryMessage;
var _local2:*;
var _local3:LevelSelection;
if (game_finished){
return;
};
ProcessManager.instance.timeScale = 1;
game_finished = true;
playWindowUI.logMessage("The enemy mothership is defeated. VICTORY!");
playWindowUI.buttons.buttonSetGoal.setPaused(true);
playWindowUI.enemyButons.buttonSetGoal.setPaused(true);
gameBoard.enemyUnits.applyDamage(99999);
_local1 = new VictoryMessage();
_local1.x = 244.4;
_local1.y = 104.4;
_local1.kills_txt.text = _kills.toString();
_local2 = LevelSelection.translate(lastLevelIndex, lastZone);
_local1.money_earned_txt.text = Global.top.levelSelection.planetInfos[lastLevelIndex][lastZone][1].toString();
_local1.conquered_txt.text = Global.top.levelSelection.planetInfos[_local2.level][_local2.zone][0];
creds = (creds + Global.top.levelSelection.planetInfos[lastLevelIndex][lastZone][1]);
playWindowUI.addChild(_local1);
Global.top.allKills = (Global.top.allKills + _kills);
_local3 = null;
_local3 = Global.top.levelSelection;
_local3.levelFinished(lastLevelIndex, lastZone);
_local3.updateLevels();
Global.top.saveLevels();
if (LevelSelector.checkForNewUnits(lastLevelIndex, lastZone)){
vd_timer = new Timer(5000, 1);
} else {
vd_timer = new Timer(3500, 1);
};
playSound(SoundConsts.victory_sound);
vd_timer.addEventListener(TimerEvent.TIMER, victoryHandler);
vd_timer.start();
}
public function get gameBoard():GameBoard{
return (game_board);
}
public function get events():GameEvents{
return (game_events);
}
public function get goalSystem():GoalSystem{
return (goal_system);
}
public function get mapHolder(){
return (_map_holder);
}
public function clearAll():void{
if (!game_events){
return;
};
stopMusic();
music_sound = null;
_kills = 0;
_lost = 0;
_hatches = null;
game_events.unregister();
game_events = null;
score = 0;
scenario_goal.deactivate();
scenario_goal = null;
goal_system.deactivate();
ProcessManager.instance.removeTickedObject(goal_system);
goal_system = null;
destroyUI();
EffectFactory.cleanPool();
special_targeting = null;
paused = false;
game_finished = false;
}
public function get levelMap(){
return (level_map);
}
private function stormGoalTicks(_arg1:Boolean):int{
var _local2:int;
var _local3:Number;
var _local4:Number;
_local2 = 1500;
_local3 = 0;
_local4 = 0;
if (_arg1){
_local4 = UnitCreator.enemyStormAttackChargeLevel(lastLevelIndex, lastZone);
} else {
_local4 = Global.top.upgrades.stormAttackChargeLevel();
};
_local3 = (1 - ((_local4 - 1) * 0.1));
if (_local3 < 0.4){
_local3 = 0.4;
};
_local2 = (_local2 * _local3);
return (_local2);
}
public function playSound(_arg1:int):void{
switch (_arg1){
case SoundConsts.victory:
playSoundData(new Sound_victory());
break;
case SoundConsts.defeat:
playSoundData(new Sound_defeat());
break;
case SoundConsts.camera:
playSoundData(new Sound_camera());
break;
case SoundConsts.doors_open:
playSoundData(new Sound_doors_open());
break;
case SoundConsts.click:
playSoundData(new Sound_click());
break;
case SoundConsts.pause:
break;
case SoundConsts.unpause:
break;
case SoundConsts.final_attack:
playSoundData(new Sound_final_attack());
break;
case SoundConsts.menu_appear:
playSoundData(new Sound_menu_appear());
break;
case SoundConsts.mine_set:
playSoundData(new Sound_mine_set());
break;
case SoundConsts.vulture:
playSoundData(new Sound_vulture());
break;
case SoundConsts.artillery_strike:
playSoundData(new Sound_artillery_strike());
break;
case SoundConsts.caterpillar_hit:
playSoundData(new Sound_caterpillar_hit());
break;
case SoundConsts.explosion:
playSoundData(new Sound_explosion());
break;
case SoundConsts.explosion1:
playSoundData(new Sound_explosion1());
break;
case SoundConsts.hit:
playSoundData(new Sound_hit());
break;
case SoundConsts.hit3:
playSoundData(new Sound_hit3());
break;
case SoundConsts.marine_shot:
playSoundData(new Sound_marine_shot());
break;
case SoundConsts.mm_shot:
playSoundData(new Sound_mm_shot());
break;
case SoundConsts.specialist_attack:
playSoundData(new Sound_specialist_attack());
break;
case SoundConsts.storm_attack:
playSoundData(new Sound_storm_attack());
break;
case SoundConsts.storm_tank_shot:
playSoundData(new Sound_storm_tank_shot());
break;
case SoundConsts.caterpillar_death:
playSoundData(new Sound_caterpillar_death());
break;
case SoundConsts.marine_death:
playSoundData(new Sound_marine_death());
break;
case SoundConsts.marine_death_expl:
playSoundData(new Sound_marine_death_expl());
break;
case SoundConsts.victory_sound:
playSoundData(new Sound_victory_music());
break;
case SoundConsts.hit1:
playSoundData(new Sound_hit1());
break;
case SoundConsts.nuclear_counting:
playSoundData(new Sound_nuclear_counting());
break;
case SoundConsts.stun:
playSoundData(new Sound_stun());
break;
case SoundConsts.door_reach:
playSoundData(new Sound_door_reach());
break;
};
}
public function baseReached(_arg1:Unit, _arg2:RoadPath):void{
var _local3:Point;
_local3 = null;
if (_arg1.isEnemy){
_local3 = new Point((_arg2.x + _arg2.firstNode().x), (_arg2.y + _arg2.firstNode().y));
playWindowUI.balanceBar.subHealth(_arg1.death_cost);
} else {
_local3 = new Point((_arg2.x + _arg2.lastNode().x), (_arg2.y + _arg2.lastNode().y));
playWindowUI.balanceBar.addHealth(_arg1.death_cost);
};
playSound(SoundConsts.door_reach);
playWindowUI.updateShipIcons();
gameBoard.destroyUnit(_arg1);
gameBoard.wipeUnit(_arg1);
if (_arg1.isEnemy){
enemyStormGoal.increaseCharge((enemyStormGoal.PAUSE / 30));
EffectFactory.makeExplosion(EffectFactory.HATCH_EXPLOSION_ENEMY, _local3, 0.7, gameBoard.getHatchMaskByRoad(_arg2));
} else {
stormGoal.increaseCharge((stormGoal.PAUSE / 30));
EffectFactory.makeExplosion(EffectFactory.HATCH_EXPLOSION, _local3, 0.7, gameBoard.getHatchMaskByRoad(_arg2));
};
}
public function stopMusic():void{
if (music_channel){
music_channel.stop();
music_channel = null;
};
}
public function specialTicks(_arg1:String, _arg2:Boolean):int{
var _local3:int;
var _local4:Number;
var _local5:Number;
_local3 = 1500;
_local4 = 1;
_local5 = 0;
if (_arg2){
_local5 = UnitCreator.enemySpecialTicksMultiplier(lastLevelIndex, lastZone);
} else {
_local5 = Global.top.upgrades.orbitalSupportSpeedLevel();
};
_local4 = (1 - ((_local5 - 1) * 0.05));
if (_local4 < 0){
_local4 = 0.1;
};
switch (_arg1){
case StringConsts.ARTILLERY_STRIKE:
_local3 = 1750;
break;
case StringConsts.NUCLEAR_MISSILE:
_local3 = 4000;
break;
case StringConsts.FORCE_FIELD:
_local3 = 1100;
break;
};
_local3 = (_local3 * _local4);
return (_local3);
}
public function get astrikeDropCount():int{
return (_astrike_drop_count);
}
public function showUI():void{
ui_holder.visible = (levelMap.visible = (playWindowUI.visible = true));
}
public function unitTicks(_arg1:String, _arg2:Boolean):int{
var _local3:int;
var _local4:Number;
var _local5:Number;
_local3 = 500;
_local4 = 0;
_local5 = 0;
if (_arg2){
_local5 = UnitCreator.enemySpeedBuildingMultiplier(lastLevelIndex, lastZone);
} else {
_local5 = Global.top.upgrades.speedBuildingLevel();
};
_local4 = (1 - ((_local5 - 1) * 0.05));
if (_local4 < 0.2){
_local4 = 0.2;
};
switch (_arg1){
case StringConsts.MARINE:
_local3 = 150;
break;
case StringConsts.MISSILE_MAN:
_local3 = 200;
break;
case StringConsts.SPECIALIST:
_local3 = 250;
break;
case StringConsts.VULTURE:
_local3 = 890;
break;
case StringConsts.STORM_TANK:
_local3 = 375;
break;
case StringConsts.CATERPILLAR:
_local3 = 1200;
break;
case StringConsts.MINER_DROID:
_local3 = 500;
break;
case StringConsts.GRENADIER_DROID:
_local3 = 400;
break;
};
_local3 = (_local3 * _local4);
return (_local3);
}
public function specialButtonPressed(_arg1:MovieClip):void{
if (((!(_arg1.ticks_goal.ready)) || (((specialTargeting.enabled) && ((specialTargeting.currentType == _arg1.unit_type)))))){
return;
};
switch (_arg1.unit_type){
case StringConsts.NUCLEAR_MISSILE:
if (specialTargeting.enabled){
specialTargeting.disable();
};
makeSpecialEffect(StringConsts.NUCLEAR_MISSILE);
_arg1.ticks_goal.reset();
break;
case StringConsts.ARTILLERY_STRIKE:
case StringConsts.FORCE_FIELD:
special_targeting.enable(_arg1.unit_type);
playWindowUI.logMessage(("Select target spot to perform " + _arg1.unit_type));
break;
};
}
public function playMusic():void{
var _local1:SoundTransform;
stopMusic();
if (((((!(volumeOff)) && (!(musicOff)))) && (music_sound))){
_local1 = new SoundTransform();
_local1.volume = volume;
music_channel = music_sound.play(0, 999, _local1);
};
}
public function hideUI():void{
ui_holder.visible = (levelMap.visible = (playWindowUI.visible = false));
}
private function get uniqueLevelIndex():int{
return ((lastLevelIndex + (lastZone * 12)));
}
public function makeSpecialEffect(_arg1:String):void{
switch (_arg1){
case StringConsts.NUCLEAR_MISSILE:
EffectFactory.makeExplosion(EffectFactory.NUCLEAR_MISSILE_COUNTING, new Point(348, 150), 0.8, gameBoard);
break;
case StringConsts.ARTILLERY_STRIKE:
goalSystem.add(new ArtilleryStrikeGoal(hatches.roadIndex, specialTargeting.getDropPoint(), _astrike_drop_count));
playWindowUI.buttons.getButtonByType(StringConsts.ARTILLERY_STRIKE).ticks_goal.reset();
break;
case StringConsts.FORCE_FIELD:
goalSystem.add(new ForceFieldGoal(specialTargeting.getDropPoint(), hatches.roadIndex));
playWindowUI.buttons.getButtonByType(StringConsts.FORCE_FIELD).ticks_goal.reset();
break;
};
}
public function get lastZone():int{
return (_last_zone);
}
public function get cards():Array{
return (_cards);
}
public function addScore(_arg1:int):void{
score = (score + _arg1);
}
public function unitButtonPressed(_arg1:MovieClip):void{
if (!_arg1.ticks_goal.ready){
return;
};
if (specialTargeting.enabled){
specialTargeting.disable();
};
if (stormGoal.isWaiting){
gameBoard.sendFromAllHatches(_arg1.unit_type, _arg1.is_enemy);
stormGoal.reset();
} else {
gameBoard.createUnit(_arg1.unit_type, hatches.roadIndex, _arg1.is_enemy);
};
levelMap.hatch_arrows.alpha = 0.1;
Tweener.addTween(levelMap.hatch_arrows, {alpha:1, time:2, transition:"linear"});
playWindowUI.buttons.buttonSetGoal.resetAll();
}
private function startRandomStrikes():void{
if ((((lastLevelIndex == 2)) && ((lastZone == 0)))){
goalSystem.add(new RandomArtilleryStrike());
playWindowUI.logMessage("Look sharp! We are under bombardment...");
};
}
private function setPlayersEquipment():void{
var _local1:Array;
var _local2:Array;
var _local3:int;
_local1 = Global.top.gameShop.orbitalWeapons;
_local2 = Global.top.gameShop.getEquipment();
_local3 = 0;
_local3 = 0;
while (_local3 < _specials.length) {
_specials[_local3] = StringConsts.EMPTY;
_local3++;
};
_local3 = 0;
while (_local3 < _local1.length) {
_specials[_local3] = _local1[_local3];
_local3++;
};
_local3 = 0;
while (_local3 < _cards.length) {
_cards[_local3] = StringConsts.EMPTY;
_local3++;
};
_local3 = 0;
while (_local3 < _local2.length) {
_cards[_local3] = _local2[_local3];
_local3++;
};
}
public function set gameScore(_arg1:int):void{
score = _arg1;
}
public function get enemySpecials():Array{
return (_enemy_specials);
}
public function get gameFinished():Boolean{
return (game_finished);
}
public function playSoundData(_arg1:Sound):void{
var _local2:SoundTransform;
if (volumeOff){
return;
};
_local2 = new SoundTransform();
_local2.volume = volume;
_arg1.play(0, 0, _local2);
}
private function defeatHandler(_arg1:TimerEvent):void{
game_finished = true;
vd_timer.stop();
vd_timer.removeEventListener(TimerEvent.TIMER, defeatHandler);
vd_timer = null;
if (!paused){
pause();
playWindowUI.pause_mc.visible = false;
};
clearAll();
Global.top.showGameShop();
}
public function get stormGoal():StormGoal{
return (_storm_goal);
}
public function set autoSend(_arg1:Boolean):void{
_auto_send = _arg1;
}
public function playLevel(_arg1:int, _arg2:int):void{
var _local3:HelloMessagesGoal;
clearAll();
Global.top.stopMusic();
last_level = _arg1;
_last_zone = _arg2;
setPlayersEquipment();
setEnemyEquipment();
game_events = new GameEvents(this);
goal_system = new GoalSystem();
constructUI(_arg1, _arg2);
_hatches = new Hatches(levelMap.hatch_arrows);
playWindowUI.update();
ProcessManager.instance.addTickedObject(goal_system);
_local3 = new HelloMessagesGoal();
goalSystem.add(_local3);
scenario_goal = new ScenarioGoal(this);
goalSystem.add(scenario_goal);
scenario_goal.setLevelTime(levelMap.level_time);
special_targeting = new SpecialTargeting();
_storm_goal = new StormGoal(playWindowUI.stormBar, playWindowUI.game_menu.storm_label, stormGoalTicks(false), true);
goalSystem.add(_storm_goal);
_enemy_storm_goal = new StormGoal(playWindowUI.enemyStormBar, playWindowUI.game_menu.enemy_storm_label, stormGoalTicks(true), false);
goalSystem.add(_enemy_storm_goal);
_grand_storm_goal = new GrandStormGoal();
goalSystem.add(_grand_storm_goal);
goalSystem.add(new BackgroundCacherGoal(this));
goalSystem.add(new AutoSendCheckGoal());
if ((((0 == lastLevelIndex)) && ((0 == lastZone)))){
};
switch (_arg1){
case 0:
music_sound = new Sound_WindLoop();
break;
case 1:
music_sound = new Sound_ArcticWind();
break;
case 2:
music_sound = new Sound_WindLoop();
break;
case 3:
music_sound = new Sound_ArcticWind();
break;
case 4:
music_sound = new Sound_WindLoop();
break;
case 5:
music_sound = new Sound_ArcticWind();
break;
case 6:
music_sound = new Sound_WindLoop();
break;
case 7:
music_sound = new Sound_ArcticWind();
break;
case 8:
music_sound = new Sound_WindLoop();
break;
case 9:
music_sound = new Sound_ArcticWind();
break;
case 10:
music_sound = new Sound_WindLoop();
break;
case 11:
music_sound = new Sound_ArcticWind();
break;
};
playMusic();
game_events.register();
}
private function constructUI(_arg1:int, _arg2:int):void{
var _local3:*;
ui_holder = new Sprite();
Global.top.playHolder.addChild(ui_holder);
_map_holder = LevelSelector.getLevelUI(_arg1, _arg2);
level_map = _map_holder.level_map;
_local3 = LevelSelection.translate(lastLevelIndex, lastZone);
level_map.level_back.gotoAndStop((_local3.level + 1));
level_map.hatch_arrows.stop();
_map_holder.x = 350;
_map_holder.y = 262;
_map_holder.scaleX = (700 / _map_holder.width);
_map_holder.scaleY = (525 / _map_holder.height);
Tweener.addTween(_map_holder, {scaleX:1, scaleY:1, time:3, delay:2, transition:"easeOutQuad", onStart:playSound, onStartParams:[SoundConsts.camera], onComplete:startRandomStrikes});
ui_holder.addChild(_map_holder);
game_board = new GameBoard(this);
ui_holder.addChild(game_board);
game_board.create();
play_window_ui = new PlayWindowUI();
play_window_ui.initialize(this);
ui_holder.addChild(play_window_ui);
playWindowUI.balanceBar.setTitle(level_map.title);
}
public function get enemyCards():Array{
return (_enemy_cards);
}
public function finalVictory():void{
var _local1:FinalClip;
_local1 = new FinalClip(this);
Global.top.playHolder.addChild(_local1);
}
public function hitUnit(_arg1:int, _arg2:Unit, _arg3:String=null):void{
var _local4:int;
if (!_arg2.isAlive){
return;
};
_local4 = (_arg1 - _arg2.armor);
if (_local4 <= 0){
_local4 = 1;
};
_arg2.health = (_arg2.health - _local4);
_arg2.updateBar();
if (!_arg2.isAlive){
if (!_arg2.isEnemy){
_kills++;
} else {
_lost++;
};
gameBoard.killUnit(_arg2, _arg3);
};
}
public function get gamePaused():Boolean{
return (paused);
}
public function get scenarioGoal():ScenarioGoal{
return (scenario_goal);
}
public function get gameScore():int{
return (score);
}
public function get playUI():PlayWindowUI{
return (play_window_ui);
}
public function set creds(_arg1:int):void{
_creds = _arg1;
}
public function get autoSend():Boolean{
return (_auto_send);
}
public function get playWindowUI():PlayWindowUI{
return (play_window_ui);
}
public function get specials():Array{
return (_specials);
}
private function victoryHandler(_arg1:TimerEvent):void{
vd_timer.stop();
vd_timer.removeEventListener(TimerEvent.TIMER, victoryHandler);
vd_timer = null;
game_finished = true;
if (!paused){
pause();
playWindowUI.pause_mc.visible = false;
};
if ((((11 == lastLevelIndex)) && ((2 == lastZone)))){
finalVictory();
};
clearAll();
Global.top.showGameShop();
}
public function get lastLevelIndex():int{
return (last_level);
}
public function get creds():int{
return (_creds);
}
public function gameOver():void{
var _local1:DefeatMessage;
if (game_finished){
return;
};
ProcessManager.instance.timeScale = 1;
game_finished = true;
playWindowUI.logMessage("Our mothership has been destroyed.");
_local1 = new DefeatMessage();
_local1.x = 244.4;
_local1.y = 104.4;
_local1.kills_txt.text = _kills.toString();
_local1.lost_txt.text = _lost.toString();
playWindowUI.addChild(_local1);
Global.top.allKills = (Global.top.allKills + _kills);
Global.top.saveLevels();
playSound(SoundConsts.defeat);
vd_timer = new Timer(3500, 1);
vd_timer.addEventListener(TimerEvent.TIMER, defeatHandler);
vd_timer.start();
}
public function get hatches():Hatches{
return (_hatches);
}
private function setEnemyEquipment():void{
var _local1:Array;
var _local2:Array;
var _local3:int;
var _local4:int;
_local1 = LevelSelector.enemySpecials[lastLevelIndex][lastZone];
_local2 = LevelSelector.enemySets[lastLevelIndex][lastZone].concat();
_local3 = 0;
_local3 = 0;
while (_local3 < _enemy_specials.length) {
_enemy_specials[_local3] = StringConsts.EMPTY;
_local3++;
};
_local3 = 0;
while (_local3 < _local1.length) {
_enemy_specials[_local3] = _local1[_local3];
_local3++;
};
_local3 = 0;
while (_local3 < _enemy_cards.length) {
_enemy_cards[_local3] = StringConsts.EMPTY;
_local3++;
};
ArrayUtils.shuffle(_local2);
_local4 = Math.min(_enemy_cards.length, _local2.length);
_local3 = 0;
while (_local3 < _local4) {
_enemy_cards[_local3] = _local2[_local3];
_local3++;
};
}
public function get enemyStormGoal():StormGoal{
return (_enemy_storm_goal);
}
public function pause():void{
if (!paused){
stopMusic();
playSound(SoundConsts.pause);
playWindowUI.pause_mc.visible = true;
playWindowUI.pause_mc.gotoAndPlay("pause");
ProcessManager.instance.removeTickedObject(goalSystem);
playWindowUI.balanceBar.pause();
game_events.unregister();
Tweener.pauseTweens(_map_holder);
Tweener.pauseTweens(levelMap.hatch_arrows);
Tweener.addTween(_map_holder, {scaleX:(700 / _map_holder.width), scaleY:(525 / _map_holder.height), time:2, transition:"easeOutQuad"});
Tweener.addTween(playWindowUI.game_menu, {alpha:0, time:1, transition:"easeOutQuad"});
Tweener.addTween(playWindowUI.menu_button, {alpha:0, time:1, transition:"easeOutQuad"});
Tweener.addTween(playWindowUI.pause_button, {alpha:0, time:1, transition:"easeOutQuad"});
Tweener.addTween(playWindowUI.end_mission_button, {alpha:0, time:1, transition:"easeOutQuad"});
Tweener.addTween(playWindowUI.help_button, {alpha:0, time:1, transition:"easeOutQuad"});
} else {
playWindowUI.pause_mc.stop();
playWindowUI.pause_mc.visible = false;
playSound(SoundConsts.unpause);
playMusic();
playWindowUI.balanceBar.resume();
ProcessManager.instance.addTickedObject(goalSystem);
game_events.register();
Tweener.resumeTweens(_map_holder);
Tweener.resumeTweens(levelMap.hatch_arrows);
Tweener.addTween(_map_holder, {scaleX:1, scaleY:1, time:2, transition:"easeOutQuad"});
Tweener.addTween(playWindowUI.game_menu, {alpha:1, time:1, transition:"easeOutQuad"});
Tweener.addTween(playWindowUI.menu_button, {alpha:1, time:1, transition:"easeOutQuad"});
Tweener.addTween(playWindowUI.pause_button, {alpha:1, time:1, transition:"easeOutQuad"});
Tweener.addTween(playWindowUI.end_mission_button, {alpha:1, time:1, transition:"easeOutQuad"});
Tweener.addTween(playWindowUI.help_button, {alpha:1, time:1, transition:"easeOutQuad"});
};
paused = !(paused);
EffectFactory.setPause(paused);
gameBoard.updateUnits();
}
public function get grandStormGoal():GrandStormGoal{
return (_grand_storm_goal);
}
public function get specialTargeting():SpecialTargeting{
return (special_targeting);
}
}
}//package game.logic
Section 85
//GameBoard (game.logic.GameBoard)
package game.logic {
import flash.display.*;
import game.ui.*;
import game.units.*;
import game.goals.*;
import core.common.*;
import game.*;
public class GameBoard extends Sprite {
private var road_layers:Array;
private var _road_infos:Array;
private var hatch_masks:Array;
private var engine:Engine;// = null
private var roads:Array;
private var layers:Array;
private var ally_units:UnitCamp;
private var _force_fields:Array;
private var _send_all_counter:int;// = 0
private var _mines:UnitCamp;
private var bullet_layer:Sprite;// = null
private var enemy_roads:Array;
private var enemy_units:UnitCamp;
public function GameBoard(_arg1:Engine):void{
engine = null;
layers = [];
roads = [];
hatch_masks = [];
road_layers = [];
_road_infos = [];
enemy_roads = [];
_force_fields = [];
ally_units = new UnitCamp();
enemy_units = new UnitCamp();
_mines = new UnitCamp();
bullet_layer = null;
_send_all_counter = 0;
super();
engine = _arg1;
}
public function destroy():void{
engine.levelMap.removeChild(bullet_layer);
bullet_layer = null;
}
public function sendFromAllHatches(_arg1:String, _arg2:Boolean):void{
var _local3:int;
var _local4:String;
if (StringConsts.VULTURE == _arg1){
engine.playSound(SoundConsts.vulture);
} else {
engine.playSound(SoundConsts.doors_open);
};
if (_arg2){
engine.playWindowUI.logMessage((("Enemy has sent Storm Attack of " + _arg1.replace("Droid", "Robot")) + "s"));
} else {
_local4 = StringConsts.PHONETIC_ALPHABET[_send_all_counter];
_send_all_counter++;
if (_send_all_counter >= StringConsts.PHONETIC_ALPHABET.length){
_send_all_counter = 0;
};
engine.playWindowUI.logMessage((((_arg1.replace("Droid", "Robot") + " ") + _local4) + " Group Attack!"));
};
_local3 = 0;
while (_local3 < Hatches.ROAD_NUMBER) {
createUnit(_arg1, _local3, _arg2, false);
_local3++;
};
}
public function create():void{
var _local1:*;
var _local2:int;
var _local3:int;
var _local4:*;
_local1 = engine.levelMap;
_local2 = 0;
_local3 = _local1.numChildren;
_local2 = 0;
while (_local2 < _local3) {
_local4 = _local1.getChildAt(_local2);
if ((_local4 is RoadPath)){
_local4.initialize();
_local4.visible = false;
(_local4 as RoadPath).index = roads.length;
roads.push(_local4);
_force_fields.push([0, new ObjectList()]);
_road_infos.push(new RoadInfo());
};
_local2++;
};
hatch_masks.push(engine.levelMap.hatch0_mask_layer);
hatch_masks.push(engine.levelMap.hatch1_mask_layer);
hatch_masks.push(engine.levelMap.hatch2_mask_layer);
hatch_masks.push(engine.levelMap.hatch3_mask_layer);
hatch_masks.push(engine.levelMap.hatch4_mask_layer);
road_layers = [unitMaskLayer.masked_layer.road1, unitMaskLayer.masked_layer.road2, unitMaskLayer.masked_layer.road3, unitMaskLayer.masked_layer.road4, unitMaskLayer.masked_layer.road5];
_local1.storm_hatch_arrows.visible = false;
bullet_layer = new Sprite();
engine.levelMap.addChild(bullet_layer);
}
public function get roadArray():Array{
return (roads);
}
public function killUnit(_arg1:Unit, _arg2:String=null):void{
destroyUnit(_arg1);
switch (_arg1.type){
case StringConsts.MARINE:
case StringConsts.MISSILE_MAN:
case StringConsts.SPECIALIST:
engine.goalSystem.add(new DieMarineGoal(engine, _arg1, _arg2));
break;
case StringConsts.STORM_TANK:
case StringConsts.CATERPILLAR:
engine.goalSystem.add(new DieRobotGoal(engine, _arg1));
break;
case StringConsts.MINER_DROID:
engine.goalSystem.add(new DieExplodeGoal(engine, _arg1));
break;
case StringConsts.GRENADIER_DROID:
case StringConsts.MINE:
engine.goalSystem.add(new DieGrenadierGoal(engine, _arg1));
break;
};
}
public function updateUnits():void{
var _local1:int;
_local1 = 0;
_local1 = 0;
while (_local1 < ally_units.length) {
ally_units[_local1].setPause(engine.gamePaused);
_local1++;
};
}
public function getRoadUnitLayer(_arg1:int){
return (road_layers[_arg1]);
}
public function get roadInfos():Array{
return (_road_infos);
}
public function get allyUnits():UnitCamp{
return (ally_units);
}
public function wipeUnit(_arg1:Unit):void{
if (_arg1.sprite.parent){
_arg1.sprite.parent.removeChild(_arg1.sprite);
};
}
public function get bulletLayer():Sprite{
return (bullet_layer);
}
public function get mines():UnitCamp{
return (_mines);
}
public function getHatchMaskByRoad(_arg1:RoadPath):Sprite{
return (hatch_masks[_arg1.index]);
}
public function createUnit(_arg1:String, _arg2:int, _arg3:Boolean, _arg4:Boolean=true):Unit{
var _local5:Unit;
var _local6:RoadPath;
if (_arg4){
if (StringConsts.VULTURE == _arg1){
engine.playSound(SoundConsts.vulture);
} else {
engine.playSound(SoundConsts.doors_open);
};
};
_local5 = UnitCreator.create(_arg1, _arg3);
_local6 = null;
if (_arg3){
_local5.sprite.scaleX = -1;
};
_local6 = roads[_arg2];
if (StringConsts.VULTURE == _arg1){
engine.goalSystem.add(new VultureGoal(engine, _local5, _local6));
return (_local5);
};
getRoadUnitLayer(_arg2).front_layer.addChild(_local5.sprite);
_local5.activate(engine);
_local5.life.breathe();
_local5.life.startMoving(_local6);
_local5.life.addToInfos();
if (_arg3){
enemy_units.push(_local5);
} else {
ally_units.push(_local5);
};
return (_local5);
}
public function get unitMaskLayer():MovieClip{
return (engine.levelMap.unit_mask_layer);
}
public function get specialTarget():Sprite{
return (engine.levelMap.special_target);
}
public function get unitCard():MovieClip{
return (engine.levelMap.unit_card_icon);
}
public function get forceFields():Array{
return (_force_fields);
}
public function get enemyUnits():UnitCamp{
return (enemy_units);
}
public function destroyUnit(_arg1:Unit):void{
_arg1.life.deactivate();
if (_arg1.enemy_unit){
enemy_units.remove(_arg1);
} else {
ally_units.remove(_arg1);
};
}
}
}//package game.logic
Section 86
//GameEvents (game.logic.GameEvents)
package game.logic {
import core.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import core.common.*;
import game.*;
import flash.ui.*;
public class GameEvents {
private var engine:Engine;// = null
public function GameEvents(_arg1:Engine):void{
engine = null;
super();
engine = _arg1;
}
public function register():void{
var _local1:int;
Global.mainStage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
Global.mainStage.addEventListener(Event.DEACTIVATE, focusOutHandler);
Global.mainStage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
Global.mainStage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
Global.mainStage.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
_local1 = 0;
_local1 = 0;
while (_local1 < engine.playWindowUI.buttons.all.length) {
engine.playWindowUI.buttons.all[_local1].addEventListener(MouseEvent.MOUSE_DOWN, unitButtonDownHanlder);
engine.playWindowUI.buttons.all[_local1].addEventListener(MouseEvent.MOUSE_OVER, unitButtonOverHanlder);
engine.playWindowUI.buttons.all[_local1].addEventListener(MouseEvent.MOUSE_OUT, unitButtonOutHanlder);
_local1++;
};
}
private function unitButtonDownHanlder(_arg1:MouseEvent):void{
var _local2:MovieClip;
_local2 = (_arg1.currentTarget as MovieClip);
if (((!(_local2.unit_type)) && ((_local2.unit_type == StringConsts.EMPTY)))){
return;
};
if (((engine.specialTargeting.enabled) && (!((engine.specialTargeting.currentType == _local2.unit_type))))){
engine.specialTargeting.disable();
};
if (_local2.is_special){
engine.specialButtonPressed(_local2);
} else {
if (engine.scenarioGoal.grandWent){
return;
};
if (engine.stormGoal.isWaiting){
engine.unitButtonPressed(_local2);
} else {
if (_local2.ticks_goal.ready){
engine.specialTargeting.enable(_local2.unit_type, true);
};
};
};
_arg1.stopPropagation();
}
private function mouseDownHandler(_arg1:MouseEvent):void{
if (engine.specialTargeting.enabled){
if (engine.specialTargeting.isUnitSendAction){
engine.unitButtonPressed(engine.playWindowUI.buttons.getButtonByType(engine.specialTargeting.currentType));
} else {
engine.makeSpecialEffect(engine.specialTargeting.currentType);
};
engine.specialTargeting.disable();
};
}
private function unitButtonOverHanlder(_arg1:MouseEvent):void{
if (_arg1.currentTarget.buttons_holder){
_arg1.currentTarget.buttons_holder.setButtonIndexOn(_arg1.currentTarget);
};
}
private function unitButtonOutHanlder(_arg1:MouseEvent):void{
engine.playWindowUI.buttons.updateSelection();
}
private function mouseMoveHandler(_arg1:MouseEvent):void{
if (engine.specialTargeting.enabled){
engine.specialTargeting.interpolatePoint(new Point(engine.levelMap.mouseX, engine.levelMap.mouseY));
};
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
if ((((_arg1.keyCode == Keyboard.SPACE)) || ((_arg1.keyCode == Keyboard.CONTROL)))){
if (engine.specialTargeting.enabled){
if (engine.specialTargeting.isUnitSendAction){
sendUnitAction();
} else {
engine.makeSpecialEffect(engine.specialTargeting.currentType);
engine.specialTargeting.disable();
};
} else {
sendUnitAction();
};
} else {
if (_arg1.keyCode == Keyboard.ESCAPE){
if (engine.specialTargeting.enabled){
engine.specialTargeting.disable();
};
};
};
if (_arg1.keyCode == Keyboard.NUMPAD_0){
};
if ((((((Keyboard.DOWN == _arg1.keyCode)) || ((KeyboardKeys.S_KEY == _arg1.keyCode)))) || ((KeyboardKeys.s_KEY == _arg1.keyCode)))){
engine.hatches.moveDown();
engine.specialTargeting.update();
};
if ((((((Keyboard.UP == _arg1.keyCode)) || ((KeyboardKeys.W_KEY == _arg1.keyCode)))) || ((KeyboardKeys.w_KEY == _arg1.keyCode)))){
engine.hatches.moveUp();
engine.specialTargeting.update();
};
if ((((((Keyboard.LEFT == _arg1.keyCode)) || ((KeyboardKeys.A_KEY == _arg1.keyCode)))) || ((KeyboardKeys.a_KEY == _arg1.keyCode)))){
if (((engine.specialTargeting.enabled) && (engine.specialTargeting.isUnitSendAction))){
engine.specialTargeting.disable();
};
if (engine.specialTargeting.enabled){
engine.specialTargeting.moveLeft();
} else {
engine.playWindowUI.buttons.moveSelectionLeft();
};
};
if ((((((Keyboard.RIGHT == _arg1.keyCode)) || ((KeyboardKeys.D_KEY == _arg1.keyCode)))) || ((KeyboardKeys.d_KEY == _arg1.keyCode)))){
if (((engine.specialTargeting.enabled) && (engine.specialTargeting.isUnitSendAction))){
engine.specialTargeting.disable();
};
if (engine.specialTargeting.enabled){
engine.specialTargeting.moveRight();
} else {
engine.playWindowUI.buttons.moveSelectionRight();
};
};
}
private function mouseUpHandler(_arg1:MouseEvent):void{
}
public function sendUnitAction(_arg1:Boolean=false):void{
var _local2:MovieClip;
_local2 = engine.playWindowUI.buttons.getCurrentButton();
if (_local2.is_special){
if (_arg1){
return;
};
engine.specialButtonPressed(_local2);
} else {
if (engine.scenarioGoal.grandWent){
return;
};
engine.unitButtonPressed(_local2);
};
}
private function focusOutHandler(_arg1:Event):void{
}
public function unregister():void{
var _local1:int;
Global.mainStage.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
Global.mainStage.removeEventListener(Event.DEACTIVATE, focusOutHandler);
Global.mainStage.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
Global.mainStage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
Global.mainStage.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
_local1 = 0;
_local1 = 0;
while (_local1 < engine.playWindowUI.buttons.all.length) {
engine.playWindowUI.buttons.all[_local1].removeEventListener(MouseEvent.MOUSE_DOWN, unitButtonDownHanlder);
engine.playWindowUI.buttons.all[_local1].removeEventListener(MouseEvent.MOUSE_OVER, unitButtonOverHanlder);
engine.playWindowUI.buttons.all[_local1].removeEventListener(MouseEvent.MOUSE_OUT, unitButtonOutHanlder);
_local1++;
};
}
}
}//package game.logic
Section 87
//Hatches (game.logic.Hatches)
package game.logic {
import flash.display.*;
public class Hatches {
private var _arrows:MovieClip;// = null
private var _road_index:int;// = 0
public static const ROAD_NUMBER:int = 5;
public function Hatches(_arg1){
_arrows = null;
_road_index = 0;
super();
_arrows = _arg1;
}
private function updateArrow():void{
_arrows.gotoAndStop((1 + _road_index));
}
public function get roadIndex():int{
return (_road_index);
}
public function moveUp():void{
_road_index++;
if (_road_index >= ROAD_NUMBER){
_road_index = 0;
};
updateArrow();
}
public function setIndex(_arg1:int):void{
_road_index = _arg1;
if (_road_index < 0){
_road_index = (ROAD_NUMBER - 1);
};
if (_road_index >= ROAD_NUMBER){
_road_index = 0;
};
updateArrow();
}
public function moveDown():void{
_road_index--;
if (_road_index < 0){
_road_index = (ROAD_NUMBER - 1);
};
updateArrow();
}
}
}//package game.logic
Section 88
//LevelSelector (game.logic.LevelSelector)
package game.logic {
import core.*;
import game.ui.*;
import caurina.transitions.*;
import core.common.*;
import game.*;
public class LevelSelector {
private static const _enemy_sets:Array = [[[StringConsts.MARINE], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR]], [[StringConsts.MARINE, StringConsts.MISSILE_MAN], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR]], [[StringConsts.MARINE, StringConsts.MISSILE_MAN], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR]], [[StringConsts.MARINE, StringConsts.MISSILE_MAN, StringConsts.MINER_DROID], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR]], [[StringConsts.MARINE, StringConsts.MISSILE_MAN, StringConsts.MINER_DROID, StringConsts.STORM_TANK], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR]], [[StringConsts.MARINE, StringConsts.MISSILE_MAN, StringConsts.MINER_DROID, StringConsts.STORM_TANK], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR]], [[StringConsts.MARINE, StringConsts.MISSILE_MAN, StringConsts.MINER_DROID, StringConsts.STORM_TANK, StringConsts.GRENADIER_DROID], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR]], [[StringConsts.MARINE, StringConsts.MISSILE_MAN, StringConsts.MINER_DROID, StringConsts.STORM_TANK, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR]], [[StringConsts.MARINE, StringConsts.MISSILE_MAN, StringConsts.MINER_DROID, StringConsts.STORM_TANK, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR]], [[StringConsts.MARINE, StringConsts.MISSILE_MAN, StringConsts.MINER_DROID, StringConsts.STORM_TANK, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR]], [[StringConsts.MARINE, StringConsts.MISSILE_MAN, StringConsts.MINER_DROID, StringConsts.STORM_TANK, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR]], [[StringConsts.MARINE, StringConsts.MISSILE_MAN, StringConsts.MINER_DROID, StringConsts.STORM_TANK, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR], [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.VULTURE, StringConsts.CATERPILLAR]]];
private static const _enemy_specials:Array = [[[StringConsts.EMPTY], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE]], [[StringConsts.EMPTY], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE]], [[StringConsts.EMPTY], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE]], [[StringConsts.EMPTY], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE]], [[StringConsts.EMPTY], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE]], [[StringConsts.ARTILLERY_STRIKE], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE]], [[StringConsts.ARTILLERY_STRIKE], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE]], [[StringConsts.ARTILLERY_STRIKE], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE]], [[StringConsts.ARTILLERY_STRIKE], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE]], [[StringConsts.ARTILLERY_STRIKE], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE]], [[StringConsts.ARTILLERY_STRIKE], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE]], [[StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE], [StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE]]];
public function LevelSelector():void{
}
public static function checkUnitAvailability(_arg1:Array):Boolean{
var _local2:Engine;
var _local3:ObjectList;
var _local4:String;
var _local5:NewFacility;
var _local6:int;
_local2 = Global.top.engine;
_local3 = Global.top.gameShop.getAvailableUnits();
for each (_local4 in _arg1) {
if (!_local3.hasItem(_local4)){
_local5 = new NewFacility();
_local5.card.slot_frame.gotoAndStop(_local4);
_local5.x = 275.9;
_local5.y = 285.6;
_local2.playWindowUI.addChild(_local5);
_local5.scaleX = (_local5.scaleY = 0.01);
Tweener.addTween(_local5, {scaleX:1, scaleY:1, time:1, transition:"linear"});
_local6 = Global.top.gameShop.getBlockIndexByName(_local4);
if (_local6 >= 0){
Global.top.gameShop.arrayBlock[_local6] = 1;
Global.top.gameShop.updateBlock();
Global.top.gameShop.setDefaultCards();
Global.top.saveLevels();
};
return (true);
};
};
return (false);
}
public static function getLevelUI(_arg1:int, _arg2:int){
var _local3:*;
_local3 = null;
_local3 = new ALlMapHolder();
if ((((0 == _arg1)) && ((0 == _arg2)))){
(_local3.level_map as LevelData).health = 20;
} else {
if (_arg2 == 0){
(_local3.level_map as LevelData).health = 30;
} else {
if (_arg2 == 1){
(_local3.level_map as LevelData).health = 40;
} else {
if (_arg2 == 2){
(_local3.level_map as LevelData).health = 50;
};
};
};
};
if ((((0 == _arg1)) && ((0 == _arg2)))){
(_local3.level_map as LevelData).level_time = 91;
} else {
(_local3.level_map as LevelData).level_time = 181;
};
(_local3.level_map as LevelData).title = ((Global.top.levelSelection.planetInfos[_arg1][_arg2][0] + ". Zone ") + (_arg2 + 1).toString());
(_local3.level_map as LevelData).best_counteraction_likelihood = bestCounteractionLikelihood(_arg1, _arg2);
return (_local3);
}
public static function levelCount():int{
return (12);
}
public static function get enemySpecials():Array{
return (_enemy_specials);
}
public static function checkForNewUnits(_arg1:int, _arg2:int):Boolean{
if (_arg2 > 0){
return (((checkUnitAvailability([StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.VULTURE, StringConsts.CATERPILLAR, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST])) || (checkWeaponAvailability([StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE]))));
};
switch (_arg1){
case 0:
return (checkUnitAvailability([StringConsts.MARINE, StringConsts.STORM_TANK]));
case 1:
return (checkWeaponAvailability([StringConsts.ARTILLERY_STRIKE, StringConsts.EMPTY, StringConsts.EMPTY]));
case 2:
return (checkUnitAvailability([StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID]));
case 3:
return (checkUnitAvailability([StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN]));
case 4:
break;
case 5:
return (checkUnitAvailability([StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.VULTURE]));
case 6:
return (checkUnitAvailability([StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.VULTURE, StringConsts.CATERPILLAR]));
case 7:
return (checkUnitAvailability([StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.VULTURE, StringConsts.CATERPILLAR, StringConsts.GRENADIER_DROID]));
case 8:
return (((checkUnitAvailability([StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.VULTURE, StringConsts.CATERPILLAR, StringConsts.GRENADIER_DROID])) || (checkWeaponAvailability([StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.EMPTY]))));
case 9:
return (checkUnitAvailability([StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.VULTURE, StringConsts.CATERPILLAR, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST]));
case 10:
return (checkUnitAvailability([StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.VULTURE, StringConsts.CATERPILLAR, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST]));
case 11:
return (((checkUnitAvailability([StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MINER_DROID, StringConsts.MISSILE_MAN, StringConsts.VULTURE, StringConsts.CATERPILLAR, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST])) || (checkWeaponAvailability([StringConsts.ARTILLERY_STRIKE, StringConsts.FORCE_FIELD, StringConsts.NUCLEAR_MISSILE]))));
};
return (false);
}
public static function initializeAI(_arg1:AIThinker):void{
_arg1.level_complexity = bestCounteractionLikelihood(Global.top.engine.lastLevelIndex, Global.top.engine.lastZone);
if (0 == Global.top.engine.lastZone){
if (Global.top.engine.lastLevelIndex == 0){
_arg1.setThinkingPause(2, 0.8);
};
};
}
public static function get enemySets():Array{
return (_enemy_sets);
}
public static function bestCounteractionLikelihood(_arg1:int, _arg2:int):Number{
switch (_arg2){
case 0:
return ((0.05 + ((0.45 / 12) * _arg1)));
case 1:
return ((0.5 + ((0.25 / 12) * _arg1)));
case 2:
return ((0.75 + ((0.25 / 12) * _arg1)));
};
return (0.5);
}
public static function checkWeaponAvailability(_arg1:Array):Boolean{
var _local2:Engine;
var _local3:ObjectList;
var _local4:String;
var _local5:NewFacility;
_local2 = Global.top.engine;
_local3 = new ObjectList();
_local3.buildFromArray(Global.top.gameShop.orbitalWeapons);
for each (_local4 in _arg1) {
if (((!((_local4 == StringConsts.EMPTY))) && (!(_local3.hasItem(_local4))))){
_local5 = new NewFacility();
_local5.card.slot_frame.gotoAndStop(_local4);
_local5.x = 275.9;
_local5.y = 285.6;
_local2.playWindowUI.addChild(_local5);
_local5.scaleX = (_local5.scaleY = 0.01);
Tweener.addTween(_local5, {scaleX:1, scaleY:1, time:1, transition:"linear"});
Global.top.gameShop.setObritalWeapons(_arg1);
Global.top.saveLevels();
return (true);
};
};
return (false);
}
}
}//package game.logic
Section 89
//RoadGraph (game.logic.RoadGraph)
package game.logic {
import game.ui.*;
public class RoadGraph {
private var road:RoadPath;// = null
private var vice_versa_counter:int;// = 0
private var counter:int;// = 0
public function RoadGraph(_arg1:RoadPath):void{
road = null;
counter = 0;
vice_versa_counter = 0;
super();
road = _arg1;
}
public function lookAnyNext():RoadPoint{
if (counter >= road.points.size()){
return (road.points.values[(road.points.size() - 1)]);
};
return (road.points.values[counter]);
}
public function getNext():RoadPoint{
if ((counter + 1) >= road.points.size()){
return (null);
};
counter++;
return (road.points.values[counter]);
}
public function getLast():RoadPoint{
vice_versa_counter = (road.points.size() - 1);
return (road.lastNode());
}
public function getPrev():RoadPoint{
if ((vice_versa_counter - 1) < 0){
return (null);
};
vice_versa_counter--;
return (road.points.values[vice_versa_counter]);
}
public function getFirst():RoadPoint{
counter = 0;
return (road.firstNode());
}
}
}//package game.logic
Section 90
//RoadInfo (game.logic.RoadInfo)
package game.logic {
import game.units.*;
public class RoadInfo {
public var player_synergy:int;// = 0
public var closest_unit:Unit;// = null
public var player_units:int;// = 0
public var enemy_synergy:int;// = 0
public var enemy_units:int;// = 0
public function RoadInfo(){
player_units = 0;
enemy_units = 0;
player_synergy = 0;
enemy_synergy = 0;
closest_unit = null;
super();
}
}
}//package game.logic
Section 91
//SpecialTargeting (game.logic.SpecialTargeting)
package game.logic {
import core.*;
import flash.display.*;
import game.ui.*;
import flash.geom.*;
public class SpecialTargeting {
private var engine:Engine;// = null
private var _enabled:Boolean;// = false
private var target;// = null
private var _current_type:String;
private var road_offsets:Array;
private var _unit_card_icon:MovieClip;// = null
private var _target_offsets:Array;
private var road_gap:Number;// = 0
private var _unit_send_action:Boolean;// = false
private var _y_offset:int;// = 0
private static const MOVE_CHUNK:int = 5;
private static const MOTION_LENGTH:int = 50;
public function SpecialTargeting(){
var _local1:*;
var _local2:Number;
engine = null;
_enabled = false;
target = null;
_unit_card_icon = null;
_y_offset = 0;
road_offsets = [];
road_gap = 0;
_target_offsets = [];
_unit_send_action = false;
super();
engine = Global.top.engine;
target = engine.gameBoard.specialTarget;
_unit_card_icon = engine.gameBoard.unitCard;
target.visible = false;
_unit_card_icon.visible = false;
_target_offsets = [[(target.x + -295.1), (target.x + 249.8)], [(target.x + -284.1), (target.x + 243.8)], [(target.x + -265.1), (target.x + 225.8)], [(target.x + -256.2), (target.x + 215.8)], [(target.x + -241.1), (target.x + 203.8)]];
for each (_local1 in engine.gameBoard.roadArray) {
road_offsets.push((_local1.y + (_local1 as RoadPath).firstNode().y));
_local2 = Math.abs((road_offsets[0] - road_offsets[1]));
if (_local2 > road_gap){
road_gap = _local2;
};
};
}
public function enable(_arg1:String, _arg2:Boolean=false):void{
_enabled = true;
_unit_send_action = _arg2;
_current_type = _arg1;
if (!_unit_send_action){
target.visible = true;
} else {
_unit_card_icon.visible = true;
_unit_card_icon.gotoAndStop(("blue_" + _arg1));
_unit_card_icon.x = ((engine.levelMap.mouseX + _unit_card_icon.width) + 1);
_unit_card_icon.y = ((engine.levelMap.mouseY + _unit_card_icon.height) + 1);
_unit_card_icon.cacheAsBitmap = true;
_unit_card_icon.startDrag();
};
_y_offset = 0;
update();
}
public function get enabled():Boolean{
return (_enabled);
}
public function get isUnitSendAction():Boolean{
return (_unit_send_action);
}
public function moveLeft():void{
if ((_y_offset - MOVE_CHUNK) < 0){
_y_offset = 0;
} else {
_y_offset = (_y_offset - MOVE_CHUNK);
};
update();
}
public function moveRight():void{
if ((_y_offset + MOVE_CHUNK) > (MOTION_LENGTH - 1)){
_y_offset = (MOTION_LENGTH - 1);
} else {
_y_offset = (_y_offset + MOVE_CHUNK);
};
update();
}
private function roadOffset():int{
return ((1 + (engine.hatches.roadIndex * MOTION_LENGTH)));
}
public function interpolatePoint(_arg1:Point):void{
var _local2:int;
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:Array;
var _local7:Number;
_local2 = 0;
_local3 = -1;
_local4 = 9999999;
_local2 = 0;
while (_local2 < road_offsets.length) {
_local5 = road_offsets[_local2];
if (Math.abs((_local5 - _arg1.y)) < _local4){
_local4 = Math.abs((_local5 - _arg1.y));
_local3 = _local2;
};
_local2++;
};
engine.hatches.setIndex(_local3);
if (!_unit_send_action){
_local6 = _target_offsets[_local3];
if (_arg1.x < _local6[0]){
_y_offset = 0;
} else {
if (_arg1.x > _local6[1]){
_y_offset = (MOTION_LENGTH - 1);
} else {
_local7 = ((_arg1.x - _local6[0]) / (_local6[1] - _local6[0]));
_y_offset = (MOTION_LENGTH * _local7);
};
};
};
update();
}
public function getRangeFor(_arg1:int):Array{
return (_target_offsets[_arg1]);
}
public function disable():void{
_enabled = false;
_unit_send_action = false;
target.visible = false;
_unit_card_icon.visible = false;
}
public function update():void{
if (!target.visible){
return;
};
target.gotoAndStop((roadOffset() + _y_offset));
}
public function getDropPoint():Point{
return (new Point((target.x + target.target_circle.x), (target.y + target.target_circle.y)));
}
public function get currentType():String{
return (_current_type);
}
}
}//package game.logic
Section 92
//Upgrades (game.logic.Upgrades)
package game.logic {
import core.*;
import flash.display.*;
public class Upgrades {
private var fire_support_level:int;// = 1
private var speed_uilding_cost:int;// = 0
private var accuracy_cost:int;// = 0
private var upgrades_cost_array:Array;
private var ballistics_level:int;// = 1
private var counter_attack_cost:int;// = 0
private var speed_uilding_level:int;// = 1
private var ballistics_cost:int;// = 0
private var armor_boost_level:int;// = 1
private var armor_boost_cost:int;// = 0
private var fire_support_cost:int;// = 0
private var counter_attack_level:int;// = 1
private var upgrades_level_array:Array;
private var _engine:Engine;// = null
private var accuracy_level:int;// = 1
public static const ARMOR_BOOST:String = "Armor Boost";
public static const FIRE_SUPPORT:String = "Fire Support";
public static const COUNTER_ATTACK:String = "Counter Attack";
public static const SPEED_BUILDING:String = "Speed Building";
public static const BALLISTICS:String = "Ballistics";
public static const ACCURACY:String = "Accuracy";
public function Upgrades():void{
speed_uilding_cost = 0;
accuracy_cost = 0;
ballistics_cost = 0;
armor_boost_cost = 0;
counter_attack_cost = 0;
fire_support_cost = 0;
upgrades_cost_array = [speed_uilding_cost, accuracy_cost, ballistics_cost, armor_boost_cost, counter_attack_cost, fire_support_cost];
speed_uilding_level = 1;
accuracy_level = 1;
ballistics_level = 1;
armor_boost_level = 1;
counter_attack_level = 1;
fire_support_level = 1;
upgrades_level_array = [speed_uilding_level, accuracy_level, ballistics_level, armor_boost_level, counter_attack_level, fire_support_level];
_engine = null;
super();
_engine = Global.top.engine;
upgrades_cost_array = getDefaultCosts();
}
public function armorBoostLevel():int{
return (upgrades_level_array[3]);
}
public function getUpgradeLevel():Array{
return (upgrades_level_array);
}
public function droidFirepowerLevel():int{
return (upgrades_level_array[2]);
}
public function humanFirepowerLevel():int{
return (upgrades_level_array[1]);
}
public function set costArray(_arg1:Array):void{
upgrades_cost_array = _arg1;
}
public function get costArray():Array{
return (upgrades_cost_array);
}
public function getUpgradeCreds():String{
var _local1:String;
_local1 = _engine.creds.toString();
return (_local1);
}
public function getUpgradeCost():Array{
return (upgrades_cost_array);
}
public function get upgradeArray():Array{
return (upgrades_level_array);
}
public function stormAttackChargeLevel():int{
return (upgrades_level_array[4]);
}
public function orbitalSupportSpeedLevel():int{
return (upgrades_level_array[5]);
}
public function speedBuildingLevel():int{
return (upgrades_level_array[0]);
}
public function set upgradeArray(_arg1:Array):void{
upgrades_level_array = _arg1;
}
public function getDefaultCosts():Array{
return ([1100, 400, 1200, 800, 1800, 2500]);
}
public function buyUpgrade(_arg1:int):void{
if (_arg1 < 0){
return;
};
if (_engine.creds >= upgrades_cost_array[_arg1]){
_engine.creds = (_engine.creds - upgrades_cost_array[_arg1]);
upgrades_cost_array[_arg1] = (upgrades_cost_array[_arg1] + Math.round((1 * upgrades_cost_array[_arg1])));
var _local2 = upgrades_level_array;
var _local3 = _arg1;
var _local4 = (_local2[_local3] + 1);
_local2[_local3] = _local4;
Global.top.saveLevels();
};
}
}
}//package game.logic
Section 93
//LevelButton (game.ui.controls.LevelButton)
package game.ui.controls {
import flash.display.*;
import game.logic.*;
import flash.filters.*;
public class LevelButton extends MovieClip {
public var filter_back:MovieClip;
private var engine:Engine;// = null
public var green_back:MovieClip;
private var level_id:int;// = 0
public var red_back:MovieClip;
public var won_back:MovieClip;
public function LevelButton():void{
engine = null;
level_id = 0;
super();
}
public function select(_arg1:Boolean):void{
var _local2:BitmapFilter;
var _local3:Array;
if (_arg1){
_local2 = getBitmapFilter();
_local3 = new Array();
_local3.push(_local2);
filter_back.filters = _local3;
} else {
filter_back.filters = new Array();
};
}
public function levelClosed():void{
clear();
red_back.visible = true;
won_back.visible = false;
green_back.visible = false;
}
public function levelCurrent():void{
clear();
green_back.visible = true;
red_back.visible = false;
won_back.visible = false;
startAnimation();
}
public function levelWon():void{
clear();
won_back.visible = true;
red_back.visible = false;
green_back.visible = false;
}
public function initialize(_arg1:Engine, _arg2:int):void{
engine = _arg1;
level_id = _arg2;
buttonMode = true;
tabEnabled = false;
mouseChildren = false;
}
public function clear():void{
stopAnimation();
}
public function stopAnimation():void{
}
public function startAnimation():void{
stopAnimation();
}
public function get levelId():int{
return (level_id);
}
private function getBitmapFilter():BitmapFilter{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Boolean;
var _local7:Boolean;
var _local8:Number;
_local1 = 9540095;
_local2 = 1;
_local3 = 35;
_local4 = 35;
_local5 = 3;
_local6 = false;
_local7 = false;
_local8 = BitmapFilterQuality.HIGH;
return (new GlowFilter(_local1, _local2, _local3, _local4, _local5, _local8, _local6, _local7));
}
}
}//package game.ui.controls
Section 94
//LevelInfoPanel (game.ui.controls.LevelInfoPanel)
package game.ui.controls {
import flash.display.*;
import flash.text.*;
public class LevelInfoPanel extends MovieClip {
public var resume_game_button:SimpleButton;
public var title:TextField;
public var desc:TextField;
public var days_txt:TextField;
public var play_button:SimpleButton;
public var goal_amount_txt:TextField;
public function showLevelInfo(_arg1):void{
if (_arg1){
};
}
}
}//package game.ui.controls
Section 95
//SoundControlMC (game.ui.controls.SoundControlMC)
package game.ui.controls {
import core.*;
import flash.display.*;
import game.logic.*;
import flash.media.*;
import fl.controls.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
public class SoundControlMC extends MovieClip {
private var sound_slider:Slider;// = null
private var parent_ls;// = null
public var engine:Engine;// = null
public function SoundControlMC():void{
engine = null;
sound_slider = null;
parent_ls = null;
super();
sound_slider = new Slider();
sound_slider.liveDragging = true;
sound_slider.setSize(100, 0);
sound_slider.maximum = 100;
sound_slider.minimum = 0;
sound_slider.tickInterval = 5;
sound_slider.addEventListener(SliderEvent.CHANGE, musicChange);
sound_slider.x = 60;
sound_slider.y = -10;
addChild(sound_slider);
tabEnabled = false;
sound_slider.value = 100;
}
public function destroy():void{
sound_slider.removeEventListener(SliderEvent.CHANGE, musicChange);
removeChild(sound_slider);
sound_slider = null;
}
private function musicChange(_arg1:SliderEvent):void{
var _local2:FocusManager;
var _local3:SoundTransform;
engine.volume = (sound_slider.value / 100);
if (Global.top.music_channel){
_local3 = Global.top.music_channel.soundTransform;
_local3.volume = engine.volume;
Global.top.music_channel.soundTransform = _local3;
};
_local2 = new FocusManager(Global.mainStage);
_local2.setFocus(Global.mainStage);
}
public function setEngine(_arg1:Engine, _arg2):void{
engine = _arg1;
parent_ls = _arg2;
sound_slider.value = (engine.volume * 100);
}
}
}//package game.ui.controls
Section 96
//SpriteBar (game.ui.controls.SpriteBar)
package game.ui.controls {
import flash.display.*;
import caurina.transitions.*;
public class SpriteBar extends MovieClip {
private var initial_scale:Number;// = 0
public var inner_bar:MovieClip;// = null
public function SpriteBar(){
inner_bar = null;
initial_scale = 0;
super();
initial_scale = inner_bar.scaleX;
}
public function resume():void{
Tweener.resumeTweens(inner_bar);
}
public function setProgress(_arg1:Number):void{
inner_bar.scaleX = (_arg1 * initial_scale);
}
public function setProgressEasing(_arg1:Number):void{
if (Tweener.isTweening(inner_bar)){
Tweener.removeTweens(inner_bar);
};
Tweener.addTween(inner_bar, {scaleX:(_arg1 * initial_scale), time:3});
}
public function pause():void{
Tweener.pauseTweens(inner_bar);
}
}
}//package game.ui.controls
Section 97
//BalanceBar (game.ui.BalanceBar)
package game.ui {
import flash.display.*;
import game.logic.*;
import game.ui.controls.*;
import flash.text.*;
public class BalanceBar extends SpriteBar {
public var title_txt:TextField;
private var range:Number;// = 0
private var chunk:Number;// = 0
public var grand_storm_bar:MovieClip;
private var engine:Engine;// = null
private var _balance:Number;// = 0
private static const LEFT_POINT:Number = 0;
private static const RIGHT_POINT:Number = 1;
public function BalanceBar():void{
engine = null;
range = 0;
chunk = 0;
_balance = 0;
super();
}
override public function resume():void{
super.resume();
grandStormBar.resume();
}
public function setTitle(_arg1:String):void{
title_txt.text = _arg1;
}
public function get balance():Number{
return (_balance);
}
public function addHealth(_arg1:Number):void{
if ((_balance + (_arg1 * chunk)) >= 1){
_balance = 1;
} else {
_balance = (_balance + (_arg1 * chunk));
};
update();
}
public function isFartherOfCenter():Boolean{
return ((_balance > ((RIGHT_POINT - LEFT_POINT) / 2)));
}
public function initialize(_arg1:Number):void{
chunk = ((RIGHT_POINT - LEFT_POINT) / _arg1);
_balance = ((RIGHT_POINT - LEFT_POINT) / 2);
setProgress(_balance);
}
public function get isLeftPointReached():Boolean{
return ((_balance <= LEFT_POINT));
}
public function subHealth(_arg1:Number):void{
if ((_balance - (_arg1 * chunk)) <= 0){
_balance = 0;
} else {
_balance = (_balance - (_arg1 * chunk));
};
update();
}
private function update():void{
setProgressEasing(_balance);
}
public function get grandStormBar():SpriteBar{
return ((grand_storm_bar as SpriteBar));
}
public function get isRightPointReached():Boolean{
return ((_balance >= RIGHT_POINT));
}
override public function pause():void{
super.pause();
grandStormBar.pause();
}
}
}//package game.ui
Section 98
//CaterpillarMoving (game.ui.CaterpillarMoving)
package game.ui {
import flash.display.*;
public class CaterpillarMoving extends MovieClip {
private var stop_moving:Boolean;// = false
private var currently_stopped:Boolean;// = false
public function CaterpillarMoving(){
stop_moving = false;
currently_stopped = false;
super();
}
public function get currentlyStopped():Boolean{
return (currently_stopped);
}
public function set currentlyStopped(_arg1:Boolean):void{
currently_stopped = _arg1;
}
public function set stopMoving(_arg1:Boolean):void{
stop_moving = _arg1;
}
public function get stopMoving():Boolean{
return (stop_moving);
}
}
}//package game.ui
Section 99
//Effect (game.ui.Effect)
package game.ui {
import flash.display.*;
public class Effect extends MovieClip {
private var parent_layer;// = null
public function Effect(){
parent_layer = null;
super();
}
public function set parentLayer(_arg1):void{
parent_layer = _arg1;
}
public function get parentLayer(){
return (parent_layer);
}
}
}//package game.ui
Section 100
//EnemyRoadPath (game.ui.EnemyRoadPath)
package game.ui {
public dynamic class EnemyRoadPath extends RoadPath {
public function EnemyRoadPath():void{
}
}
}//package game.ui
Section 101
//FinalClip (game.ui.FinalClip)
package game.ui {
import flash.events.*;
import flash.display.*;
import game.logic.*;
public class FinalClip extends MovieClip {
private var engine:Engine;// = null
public function FinalClip(_arg1:Engine=null):void{
engine = null;
super();
if (_arg1){
this.addEventListener(MouseEvent.MOUSE_DOWN, hereClickHandler);
};
}
public function destroy():void{
this.removeEventListener(MouseEvent.MOUSE_DOWN, hereClickHandler);
}
public function hereClickHandler(_arg1:MouseEvent):void{
if (this.parent){
this.removeEventListener(MouseEvent.MOUSE_DOWN, hereClickHandler);
this.parent.removeChild(this);
};
}
private function pandaClickHandler(_arg1:MouseEvent):void{
}
}
}//package game.ui
Section 102
//GameButtons (game.ui.GameButtons)
package game.ui {
import core.*;
import flash.display.*;
import game.logic.*;
import game.goals.*;
import game.*;
public class GameButtons {
private var engine:Engine;// = null
private var _is_enemy:Boolean;// = false
private var _all:Array;
private var _button_index:int;// = 0
private var buttons_holder:MovieClip;// = null
private var _units:Array;
private var _prefix:String;
private var _specials:Array;
private var _button_set_goal:ButtonSetGoal;// = null
public function GameButtons(_arg1, _arg2:Boolean):void{
buttons_holder = null;
engine = null;
_units = [];
_button_set_goal = null;
_button_index = 0;
_all = [];
_specials = [];
_is_enemy = false;
super();
engine = Global.top.engine;
buttons_holder = _arg1;
_is_enemy = _arg2;
_prefix = (_is_enemy) ? "red_" : "blue_";
initialize();
}
public function getButtonByType(_arg1:String){
var _local2:*;
for each (_local2 in _all) {
if (_local2.unit_type == _arg1){
return (_local2);
};
};
return (null);
}
public function updateSelection():void{
var _local1:String;
_all[_button_index].unit_icon.button_back.gotoAndStop("highlighted_state");
_local1 = _all[_button_index].unit_type;
buttons_holder.screen_txt.text = _local1.replace("Droid", "Robot");
}
public function get buttonSetGoal():ButtonSetGoal{
return (_button_set_goal);
}
private function initialize():void{
var _local1:Array;
var _local2:int;
var _local3:Array;
var _local4:ButtonTicksGoal;
_units = [buttons_holder.button1, buttons_holder.button2, buttons_holder.button3, buttons_holder.button4];
_button_set_goal = new ButtonSetGoal();
_local1 = (_is_enemy) ? engine.enemyCards : engine.cards;
_local2 = 0;
_local2 = 0;
while (_local2 < _local1.length) {
if (StringConsts.EMPTY == _local1[_local2]){
_units[_local2].unit_icon.gotoAndStop("empty_slot_label");
_units[_local2].filling.stop();
_units[_local2].filling.visible = false;
_units[_local2].unit_type = StringConsts.EMPTY;
} else {
_units[_local2].unit_icon.gotoAndStop((_prefix + _local1[_local2]));
_units[_local2].filling.stop();
_units[_local2].unit_type = _local1[_local2];
_units[_local2].is_enemy = _is_enemy;
_units[_local2].is_special = false;
_units[_local2].buttons_holder = this;
_button_set_goal.addButton(_units[_local2], _local1[_local2], engine.unitTicks(_local1[_local2], _is_enemy), false);
};
_local2++;
};
engine.goalSystem.add(_button_set_goal);
_button_set_goal.resetAll();
_local3 = (_is_enemy) ? engine.enemySpecials : engine.specials;
_specials = [buttons_holder.special_button1, buttons_holder.special_button2, buttons_holder.special_button3];
_local2 = 0;
while (_local2 < _local3.length) {
if (StringConsts.EMPTY == _local3[_local2]){
_specials[_local2].unit_icon.gotoAndStop("empty_slot_label");
_specials[_local2].filling.stop();
_specials[_local2].filling.visible = false;
_specials[_local2].unit_type = StringConsts.EMPTY;
} else {
_specials[_local2].unit_icon.gotoAndStop((_prefix + _local3[_local2]));
_specials[_local2].filling.stop();
_specials[_local2].unit_type = _local3[_local2];
_specials[_local2].is_enemy = _is_enemy;
_specials[_local2].is_special = true;
_specials[_local2].buttons_holder = this;
_local4 = new ButtonTicksGoal(_specials[_local2], _local3[_local2], engine.specialTicks(_local3[_local2], _is_enemy), true);
engine.goalSystem.add(_local4);
_local4.reset();
_specials[_local2].ticks_goal = _local4;
};
_local2++;
};
_all = _units.concat(_specials);
updateSelection();
}
public function getCurrentButton(){
return (_all[_button_index]);
}
public function moveSelectionRight():void{
_all[_button_index].unit_icon.button_back.gotoAndStop("normal_state");
_button_index++;
if (_button_index >= _all.length){
_button_index = 0;
};
if (_all[_button_index].unit_type == StringConsts.EMPTY){
moveSelectionRight();
return;
};
updateSelection();
}
public function get all():Array{
return (_all);
}
public function get units():Array{
return (_units);
}
public function pauseSpecials():void{
var _local1:int;
_local1 = 0;
while (_local1 < _specials.length) {
if (_specials[_local1].ticks_goal){
_specials[_local1].ticks_goal.paused = true;
};
_local1++;
};
}
public function moveSelectionLeft():void{
_all[_button_index].unit_icon.button_back.gotoAndStop("normal_state");
_button_index--;
if (_button_index < 0){
_button_index = (_all.length - 1);
};
if (_all[_button_index].unit_type == StringConsts.EMPTY){
moveSelectionLeft();
return;
};
updateSelection();
}
public function setButtonIndexOn(_arg1):void{
var _local2:int;
_local2 = 0;
while (_local2 < _all.length) {
if (_all[_local2] == _arg1){
_all[_button_index].unit_icon.button_back.gotoAndStop("normal_state");
_button_index = _local2;
};
_local2++;
};
updateSelection();
}
}
}//package game.ui
Section 103
//GameShop (game.ui.GameShop)
package game.ui {
import core.*;
import flash.events.*;
import flash.display.*;
import game.logic.*;
import game.units.*;
import core.common.*;
import game.*;
import flash.text.*;
public class GameShop extends MovieClip {
private var _dragging_card:int;// = -1
public var card_slot1:MovieClip;
public var card_slot2:MovieClip;
public var card_slot3:MovieClip;
public var card_slot4:MovieClip;
public var card_slot6:MovieClip;
public var card_slot8:MovieClip;
public var kills_txt:TextField;
public var card_slot5:MovieClip;
public var accuracy_buy_button:SimpleButton;
public var creds_txt:TextField;
public var card_slot7:MovieClip;
public var fire_support_buy_button:SimpleButton;
public var slot_frame:MovieClip;
private var upgrades_info:Upgrades;// = null
public var speed_building_cost_txt:TextField;
private var buy_button_array:Array;
public var level_msg:MovieClip;
public var fire_support_cost_txt:TextField;
private var current_equipment:Array;
public var speed_building_level_txt:TextField;
private var card_slot_array_name:Array;
public var next_battle_button:SimpleButton;
public var armo_boost_cost_txt:TextField;
public var armo_boost_buy_button:SimpleButton;
private var number_orbital_card_slot:int;// = -1
public var main_menu_button:SimpleButton;
public var flongabot_button:SimpleButton;
private var duplicate_slot_array:Array;// = null
private var _dragging_duplicate:MovieClip;
public var ballistics_level_txt:TextField;
private var flag_buy_button_load;// = 0
private var level_txt_array:Array;
public var counter_attack_cost_txt:TextField;
private var slot_array:Array;
private var flag_delite;// = 0
public var armo_boost_level_txt:TextField;
public var fire_support_level_txt:TextField;
public var units_screen_txt:TextField;
public var orbital_slot1:MovieClip;
public var orbital_slot2:MovieClip;
public var orbital_slot3:MovieClip;
private var array_block:Array;
private var number_orbital_slot:int;// = -1
private var orbital_slot_array:Array;
public var ballistics_buy_button:SimpleButton;
private var card_slot_array:Array;
public var accuracy_level_txt:TextField;
public var accuracy_cost_txt:TextField;
public var upgrades_screen_txt:TextField;
public var ballistics_cost_txt:TextField;
public var speed_building_buy_button:SimpleButton;
private var number_buy_button;// = -1
private var orbital_block:Array;
private var array_orbital_equipmen:Array;
private var flag_load;// = 0
public var counter_attack_buy_button:SimpleButton;
public var counter_attack_level_txt:TextField;
public var slot1:MovieClip;
public var slot2:MovieClip;
public var slot3:MovieClip;
private var cost_txt_array:Array;
public var slot4:MovieClip;
public function GameShop():void{
current_equipment = [-1, -1, -1, -1];
_dragging_card = -1;
flag_load = 0;
array_orbital_equipmen = [-1, -1, -1];
number_orbital_card_slot = -1;
number_orbital_slot = -1;
upgrades_info = null;
flag_buy_button_load = 0;
number_buy_button = -1;
_dragging_duplicate = new MovieClip();
duplicate_slot_array = null;
flag_delite = 0;
array_block = [0, 0, 0, 0, 0, 0, 0, 0];
orbital_block = [StringConsts.EMPTY, StringConsts.EMPTY, StringConsts.EMPTY];
super();
flongabot_button.addEventListener(MouseEvent.MOUSE_DOWN, GameStage.sponsorClick);
}
public function destroy():void{
var _local1:int;
var _local2:int;
var _local3:int;
flongabot_button.removeEventListener(MouseEvent.MOUSE_DOWN, GameStage.sponsorClick);
_local1 = 0;
while (_local1 < card_slot_array.length) {
card_slot_array[_local1].removeEventListener(MouseEvent.MOUSE_DOWN, cardClickHandler);
card_slot_array[_local1].removeEventListener(MouseEvent.MOUSE_OVER, onCardOverHandler);
_local1++;
};
_local2 = 0;
while (_local2 < slot_array.length) {
slot_array[_local2].removeEventListener(MouseEvent.MOUSE_DOWN, slotClickHandler);
_local2++;
};
_local3 = 0;
while (_local3 < buy_button_array.length) {
buy_button_array[_local3].removeEventListener(MouseEvent.MOUSE_DOWN, FnBuyButton);
_local3++;
};
main_menu_button.removeEventListener(MouseEvent.MOUSE_DOWN, FnMain);
next_battle_button.removeEventListener(MouseEvent.MOUSE_DOWN, FnNext);
removeEventListener(MouseEvent.MOUSE_DOWN, shopClickHandler);
}
private function FnNext(_arg1:MouseEvent):void{
var _local2:Array;
Global.top.engine.playSound(SoundConsts.click);
Global.top.engine.playSound(SoundConsts.menu_appear);
_local2 = getEquipment();
if (0 == _local2.length){
showMessage("You must be equipped with at least one unit type.");
return;
};
Global.top.showLevelSelection();
}
private function cardInSlotClickHandler(_arg1:MouseEvent):void{
var _local2:int;
if (_arg1.currentTarget.currently_in_slot >= 0){
_local2 = _arg1.currentTarget.currently_in_slot;
removeCardFromEquipment(_local2);
if (_dragging_card >= 0){
setCardIntoSlot(_local2);
};
};
}
public function get orbitalWeapons():Array{
return (orbital_block);
}
public function setUpgrades(_arg1:Upgrades):void{
upgrades_info = _arg1;
_arg1.buyUpgrade(number_buy_button);
updateView();
}
private function onWeaponCardOverHandler(_arg1:MouseEvent):void{
switch (_arg1.currentTarget.slot_frame.currentLabel){
case "locked_state":
units_screen_txt.text = "This weapon is locked. Advance through levels to unlock it.";
break;
case StringConsts.ARTILLERY_STRIKE:
units_screen_txt.text = "Orbital artillery strike.\n10 bombs fall near the specified spot. It may not be very accurate.";
break;
case StringConsts.NUCLEAR_MISSILE:
units_screen_txt.text = "Nuclear rocket strike.\nDamages heavily all the units on the battlefield.";
break;
case StringConsts.FORCE_FIELD:
units_screen_txt.text = "Force Field.\nDefenses units that are inside the field. It does not work with Caterpillars.";
break;
};
}
private function showMessage(_arg1:String):void{
level_msg.msg.text = _arg1;
level_msg.visible = true;
level_msg.play();
}
private function stopDragCard():void{
if (_dragging_card >= 0){
_dragging_duplicate.stopDrag();
removeChild(_dragging_duplicate);
_dragging_card = -1;
};
}
public function getOrbitalEquipment():Array{
var _local1:Array;
var _local2:int;
var _local3:int;
_local1 = new Array();
_local2 = 0;
while (_local2 < array_orbital_equipmen.length) {
_local1[_local2] = array_orbital_equipmen[_local2];
_local2++;
};
_local3 = 0;
while (_local3 < _local1.length) {
if (_local1[_local3] == -1){
_local1.splice(_local3, 1);
_local3--;
};
_local3++;
};
return (_local1);
}
public function Create1():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
addEventListener(MouseEvent.MOUSE_DOWN, shopClickHandler);
card_slot_array = [card_slot1, card_slot2, card_slot3, card_slot4, card_slot5, card_slot6, card_slot7, card_slot8];
card_slot_array_name = [StringConsts.MARINE, StringConsts.STORM_TANK, StringConsts.MISSILE_MAN, StringConsts.VULTURE, StringConsts.MINER_DROID, StringConsts.GRENADIER_DROID, StringConsts.SPECIALIST, StringConsts.CATERPILLAR];
slot_array = [slot1, slot2, slot3, slot4];
duplicate_slot_array = new Array();
duplicate_slot_array.length = slot_array.length;
orbital_slot_array = [orbital_slot1, orbital_slot2, orbital_slot3];
level_txt_array = [speed_building_level_txt, accuracy_level_txt, ballistics_level_txt, armo_boost_level_txt, counter_attack_level_txt, fire_support_level_txt];
cost_txt_array = [speed_building_cost_txt, accuracy_cost_txt, ballistics_cost_txt, armo_boost_cost_txt, counter_attack_cost_txt, fire_support_cost_txt];
buy_button_array = [speed_building_buy_button, accuracy_buy_button, ballistics_buy_button, armo_boost_buy_button, fire_support_buy_button, counter_attack_buy_button];
if (flag_load == 0){
_local1 = 0;
while (_local1 < card_slot_array.length) {
card_slot_array[_local1].addEventListener(MouseEvent.MOUSE_DOWN, cardClickHandler);
card_slot_array[_local1].addEventListener(MouseEvent.MOUSE_OVER, onCardOverHandler);
card_slot_array[_local1].slot_frame.gotoAndStop((_local1 + 1));
_local1++;
};
_local2 = 0;
while (_local2 < slot_array.length) {
slot_array[_local2].addEventListener(MouseEvent.MOUSE_DOWN, slotClickHandler);
slot_array[_local2].addEventListener(MouseEvent.MOUSE_OVER, onSlotOverHandler);
slot_array[_local2].slot_frame.gotoAndStop(15);
_local2++;
};
_local3 = 0;
while (_local3 < orbital_slot_array.length) {
orbital_slot_array[_local3].addEventListener(MouseEvent.MOUSE_OVER, onWeaponCardOverHandler);
_local3++;
};
_local4 = 0;
while (_local4 < buy_button_array.length) {
buy_button_array[_local4].addEventListener(MouseEvent.MOUSE_DOWN, FnBuyButton);
buy_button_array[_local4].addEventListener(MouseEvent.MOUSE_OVER, onBuyButtonOverHandler);
_local4++;
};
main_menu_button.addEventListener(MouseEvent.MOUSE_DOWN, FnMain);
next_battle_button.addEventListener(MouseEvent.MOUSE_DOWN, FnNext);
};
flag_load = 1;
updateBlock();
setDefaultCards();
updateWeapons();
level_msg.visible = false;
}
private function shopClickHandler(_arg1:MouseEvent):void{
if (_dragging_card >= 0){
stopDragCard();
};
}
private function FnMain(_arg1:MouseEvent):void{
Global.top.engine.playSound(SoundConsts.click);
Global.top.showWelcome();
}
private function updateWeapons():void{
var _local1:int;
_local1 = 0;
while (_local1 < orbital_slot_array.length) {
if (orbital_block[_local1] != StringConsts.EMPTY){
orbital_slot_array[_local1].slot_frame.gotoAndStop(orbital_block[_local1]);
orbital_slot_array[_local1].alpha = 1;
} else {
orbital_slot_array[_local1].slot_frame.gotoAndStop("locked_state");
orbital_slot_array[_local1].alpha = 0.5;
};
_local1++;
};
}
private function onCardOverHandler(_arg1:MouseEvent):void{
var _local2:Unit;
if (_arg1.currentTarget.slot_frame){
_local2 = null;
switch (_arg1.currentTarget.slot_frame.currentFrame){
case 1:
_local2 = UnitCreator.create(StringConsts.MARINE, false, true);
units_screen_txt.text = (((("Marine. Most cheap and weak unit. Best against Missile Man and Grenadier Robot.\n" + "Attack: ") + _local2.weapon.damage.toString()) + "\nArmor: ") + _local2.armor.toString());
break;
case 2:
_local2 = UnitCreator.create(StringConsts.STORM_TANK, false, true);
units_screen_txt.text = (((("Storm Tank. Best against Marine, Specialist, Grenadier and Miner robots. Strong collateral damage.\n" + "Attack: ") + _local2.weapon.damage.toString()) + "\nArmor: ") + _local2.armor.toString());
break;
case 3:
_local2 = UnitCreator.create(StringConsts.MISSILE_MAN, false, true);
units_screen_txt.text = (((("Missile Man. Long range attacking unit. Best against Storm Tank, Miner and Grenadier.\n" + "Attack: ") + _local2.weapon.damage.toString()) + "\nArmor: ") + _local2.armor.toString());
break;
case 4:
units_screen_txt.text = "Vulture.\nThis is a landing transport. It carries 2 Marines and 1 Missile Man to the center of the road.";
break;
case 5:
units_screen_txt.text = "Miner Robot.\nThis unit moves along the road and mines it. The mines explode automatically near enemy units.";
break;
case 6:
units_screen_txt.text = "Grenadier Robot.\nThis unit explodes heavily near enemy units or after being destroyed. Needs some time to be activated.";
break;
case 7:
_local2 = UnitCreator.create(StringConsts.CATERPILLAR, false, true);
units_screen_txt.text = (((("Specialist. Special Forces trained to deal with the most dangerous enemies like Caterpillar.\n" + "Attack: ") + _local2.weapon.damage.toString()) + "\nArmor: ") + _local2.armor.toString());
break;
case 8:
_local2 = UnitCreator.create(StringConsts.CATERPILLAR, false, true);
units_screen_txt.text = (((("Caterpillar. Most heavy and strong unit. It has ability to pierce the Force Fields. Best against all except Specialist.\n" + "Attack: ") + _local2.weapon.damage.toString()) + "\nArmor: ") + _local2.armor.toString());
break;
case 17:
units_screen_txt.text = "This unit is locked. Advance through more levels to unlock it.";
break;
};
};
}
private function startDragCard(_arg1:int):void{
var _local2:Class;
stopDragCard();
if (card_slot_array[_arg1].alpha == 1){
_dragging_card = _arg1;
_local2 = Object(card_slot_array[_dragging_card].slot_frame).constructor;
_dragging_duplicate = new (_local2);
_dragging_duplicate.gotoAndStop((_dragging_card + 1));
_dragging_duplicate.x = (mouseX + 5);
_dragging_duplicate.y = (mouseY + 5);
_dragging_duplicate.scaleX = (_dragging_duplicate.scaleY = card_slot_array[0].scaleX);
addChild(_dragging_duplicate);
_dragging_duplicate.startDrag();
};
}
public function show():void{
visible = true;
updateView();
}
public function setObritalWeapons(_arg1:Array):void{
var _local2:int;
_local2 = 0;
while (_local2 < 3) {
orbital_block[_local2] = _arg1[_local2];
_local2++;
};
updateWeapons();
}
public function updateView():void{
var _local1:int;
upgrades_info.getUpgradeLevel();
upgrades_info.getUpgradeCost();
creds_txt.text = Global.top.engine.creds.toString();
kills_txt.text = Global.top.allKills.toString();
_local1 = 0;
while (_local1 < upgrades_info.getUpgradeLevel().length) {
level_txt_array[_local1].text = upgrades_info.getUpgradeLevel()[_local1];
cost_txt_array[_local1].text = upgrades_info.getUpgradeCost()[_local1];
if (upgrades_info.getUpgradeCost()[_local1] <= upgrades_info.getUpgradeCreds()){
buy_button_array[_local1].alpha = 1;
} else {
buy_button_array[_local1].alpha = 0.25;
};
_local1++;
};
}
public function Create():void{
Create1();
updateBlock();
setDefaultCards();
}
private function onSlotOverHandler(_arg1:MouseEvent):void{
units_screen_txt.text = "Place units here you want to use in the next battle.";
}
public function getAvailableUnits():ObjectList{
var _local1:ObjectList;
var _local2:int;
_local1 = new ObjectList();
_local2 = 0;
while (_local2 < array_block.length) {
if (array_block[_local2] != 0){
_local1.push(card_slot_array_name[_local2]);
};
_local2++;
};
return (_local1);
}
public function getEquipment():Array{
var _local1:Array;
var _local2:int;
_local1 = new Array();
_local2 = 0;
while (_local2 < current_equipment.length) {
if (current_equipment[_local2] != -1){
_local1.push(current_equipment[_local2]);
};
_local2++;
};
return (_local1);
}
public function setDefaultCards():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < current_equipment.length) {
if (current_equipment[_local1] == -1){
_local2 = 0;
while (_local2 < card_slot_array.length) {
if (card_slot_array[_local2].alpha == 1){
startDragCard(_local2);
setCardIntoSlot(_local1);
break;
};
_local2++;
};
};
_local1++;
};
}
private function setCardIntoSlot(_arg1:int):void{
var _local2:int;
var _local3:Class;
var _local4:MovieClip;
_local2 = _arg1;
if (current_equipment[_local2] != -1){
removeCardFromEquipment(_local2);
};
if (_dragging_card < 0){
return;
};
if (card_slot_array[_dragging_card].alpha == 1){
current_equipment[_local2] = card_slot_array_name[_dragging_card];
_local3 = Object(card_slot_array[_dragging_card].slot_frame).constructor;
_local4 = new (_local3);
_local4.gotoAndStop((_dragging_card + 1));
_local4.currently_in_slot = _local2;
_local4.parent_card_slot_number = _dragging_card;
_local4.scaleX = slot_array[_local2].scaleX;
_local4.scaleY = slot_array[_local2].scaleY;
addChild(_local4);
_local4.x = slot_array[_local2].x;
_local4.y = slot_array[_local2].y;
card_slot_array[_dragging_card].alpha = 0.5;
_local4.addEventListener(MouseEvent.MOUSE_DOWN, cardInSlotClickHandler);
duplicate_slot_array[_local2] = _local4;
stopDragCard();
};
}
public function updateBlock():void{
var _local1:Array;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
stopDragCard();
_local1 = current_equipment.concat();
_local2 = 0;
while (_local2 < duplicate_slot_array.length) {
if (duplicate_slot_array[_local2] != null){
removeCardFromEquipment(_local2);
};
_local2++;
};
_local3 = 0;
while (_local3 < array_block.length) {
if (array_block[_local3] == 0){
card_slot_array[_local3].alpha = 0.5;
};
if (array_block[_local3] == 1){
card_slot_array[_local3].alpha = 1;
};
_local3++;
};
_local4 = 0;
while (_local4 < _local1.length) {
if (_local1[_local4] != -1){
_local5 = getBlockIndexByName(_local1[_local4]);
if (array_block[_local5]){
startDragCard(_local5);
setCardIntoSlot(_local4);
};
};
_local4++;
};
updateIcons();
}
private function FnBuyButton(_arg1:MouseEvent):void{
var _local2:int;
Global.top.engine.playSound(SoundConsts.click);
number_buy_button = -1;
_local2 = 0;
while (_local2 < buy_button_array.length) {
if (buy_button_array[_local2] == _arg1.currentTarget){
number_buy_button = _local2;
};
_local2++;
};
setUpgrades(upgrades_info);
}
public function set arrayBlock(_arg1:Array):void{
array_block = _arg1;
updateBlock();
setDefaultCards();
}
public function getBlockIndexByName(_arg1:String):int{
var _local2:int;
_local2 = 0;
while (_local2 < card_slot_array_name.length) {
if (card_slot_array_name[_local2] == _arg1){
return (_local2);
};
_local2++;
};
return (-1);
}
public function get arrayBlock():Array{
return (array_block);
}
private function slotClickHandler(_arg1:MouseEvent):void{
var _local2:int;
Global.top.engine.playSound(SoundConsts.click);
_local2 = 0;
while (_local2 < slot_array.length) {
if (slot_array[_local2] == _arg1.currentTarget){
setCardIntoSlot(_local2);
break;
};
_local2++;
};
_arg1.stopPropagation();
}
private function removeCardFromEquipment(_arg1:int):void{
var _local2:*;
_local2 = duplicate_slot_array[_arg1];
removeChild(_local2);
_local2.removeEventListener(MouseEvent.MOUSE_DOWN, cardInSlotClickHandler);
card_slot_array[_local2.parent_card_slot_number].alpha = 1;
duplicate_slot_array[_arg1] = null;
current_equipment[_arg1] = -1;
}
private function updateIcons():void{
var _local1:int;
_local1 = 0;
while (_local1 < card_slot_array.length) {
if (0 == array_block[_local1]){
card_slot_array[_local1].slot_frame.gotoAndStop("locked_state");
} else {
card_slot_array[_local1].slot_frame.gotoAndStop((_local1 + 1));
};
_local1++;
};
}
private function cardClickHandler(_arg1:MouseEvent):void{
var _local2:int;
Global.top.engine.playSound(SoundConsts.click);
_local2 = 0;
while (_local2 < card_slot_array.length) {
if (card_slot_array[_local2] == _arg1.currentTarget){
startDragCard(_local2);
number_orbital_card_slot = -1;
break;
};
_local2++;
};
_arg1.stopPropagation();
}
private function onBuyButtonOverHandler(_arg1:MouseEvent):void{
switch (_arg1.currentTarget){
case speed_building_buy_button:
upgrades_screen_txt.text = "Increase the speed of unit building.";
break;
case accuracy_buy_button:
upgrades_screen_txt.text = "Increase the firepower of human units (increases attack). ";
break;
case ballistics_buy_button:
upgrades_screen_txt.text = "Increase the firepower of robots (increases attack or explosion damage).";
break;
case armo_boost_buy_button:
upgrades_screen_txt.text = "Boost the armor value of all units.";
break;
case fire_support_buy_button:
upgrades_screen_txt.text = "Increase the speed of the Storm Attack preparing. ";
break;
case counter_attack_buy_button:
upgrades_screen_txt.text = "Increase the speed of the Orbital Support recharging.";
break;
};
}
private function FnDestroy():void{
var _local1:int;
var _local2:int;
var _local3:int;
_local1 = 0;
while (_local1 < card_slot_array.length) {
card_slot_array[_local1].removeEventListener(MouseEvent.MOUSE_DOWN, cardClickHandler);
_local1++;
};
_local2 = 0;
while (_local2 < slot_array.length) {
slot_array[_local2].removeEventListener(MouseEvent.MOUSE_DOWN, slotClickHandler);
_local2++;
};
_local3 = 0;
while (_local3 < buy_button_array.length) {
buy_button_array[_local3].removeEventListener(MouseEvent.MOUSE_DOWN, FnBuyButton);
_local3++;
};
main_menu_button.removeEventListener(MouseEvent.MOUSE_DOWN, FnMain);
next_battle_button.removeEventListener(MouseEvent.MOUSE_DOWN, FnNext);
flag_load = 0;
}
}
}//package game.ui
Section 104
//Instructions (game.ui.Instructions)
package game.ui {
import core.*;
import flash.events.*;
import flash.display.*;
import game.*;
public class Instructions extends MovieClip {
public var options_button:SimpleButton;
public var resume_button:SimpleButton;
public var start_game_button:SimpleButton;
public function Instructions(){
start_game_button.addEventListener(MouseEvent.MOUSE_DOWN, startButtonHandler);
resume_button.addEventListener(MouseEvent.MOUSE_DOWN, resumeButtonHandler);
options_button.addEventListener(MouseEvent.MOUSE_DOWN, optionsButtonHandler);
resume_button.tabEnabled = false;
options_button.tabEnabled = false;
start_game_button.tabEnabled = false;
resume_button.visible = false;
options_button.visible = false;
}
private function startButtonHandler(_arg1:MouseEvent):void{
visible = false;
Global.top.startGameHandler(null);
_arg1.stopPropagation();
}
private function resumeButtonHandler(_arg1:MouseEvent):void{
visible = false;
Global.top.resumeGameHandler(null);
}
private function nextButtonHandler(_arg1:MouseEvent):void{
Global.top.engine.playSound(SoundConsts.click);
visible = false;
}
private function optionsButtonHandler(_arg1:MouseEvent):void{
visible = false;
Global.top.optionsHandler(null);
}
public function show():void{
visible = true;
if (Global.top.engine.playWindowUI != null){
start_game_button.visible = false;
resume_button.visible = true;
options_button.visible = true;
} else {
start_game_button.visible = true;
resume_button.visible = false;
options_button.visible = false;
};
}
}
}//package game.ui
Section 105
//LevelData (game.ui.LevelData)
package game.ui {
import flash.display.*;
public class LevelData extends Sprite {
public var title:String;
public var health:Number;// = 0
public var best_counteraction_likelihood:Number;// = 0
public var level_time:int;// = 0
public function LevelData(){
health = 0;
level_time = 0;
best_counteraction_likelihood = 0;
super();
}
}
}//package game.ui
Section 106
//LevelSelection (game.ui.LevelSelection)
package game.ui {
import core.*;
import core.goal.*;
import flash.events.*;
import flash.display.*;
import game.logic.*;
import flash.media.*;
import game.goals.*;
import flash.filters.*;
import fl.managers.*;
import game.*;
import flash.text.*;
public class LevelSelection extends Sprite {
private var zone_array:Array;
public var options_dialog:MovieClip;
public var map_goal:MapGoal;// = null
private var planet_infos:Array;
public var planets_nebula:MovieClip;
private var color_matrix:Array;// = null
public var planets_star:MovieClip;
private var conquered_percents:int;// = 0
private var music_sound:Sound;// = null
public var conquered_bar:MovieClip;
public var main_menu_button:SimpleButton;
public var flonga_button:SimpleButton;
public var planets_back:MovieClip;
private var goal_system:GoalSystem;// = null
private var number_zone:int;// = -1
public var conquered_txt:TextField;
public var music_channel:SoundChannel;// = null
private var _current_glow_clip;// = null
private var revenue_creds:int;// = 0
public var planets_back_star:MovieClip;
private var number_planet:int;// = -1
private var _engine:Engine;// = null
public var play_next_button:SimpleButton;
private var level:LevelSelection;// = null
private var level_array:Array;
public var planet_data:MovieClip;
public var options_button:SimpleButton;
private var pm:ProcessManager;// = null
public static const LEVEL_OPENED:int = 1;
public static const LEVEL_CLOSED:int = 0;
public static const LEVEL_WON:int = 2;
public function LevelSelection():void{
pm = null;
level = null;
goal_system = null;
map_goal = null;
_engine = null;
music_sound = null;
music_channel = null;
level_array = [[LEVEL_OPENED, LEVEL_CLOSED, LEVEL_CLOSED], [LEVEL_CLOSED, LEVEL_CLOSED, LEVEL_CLOSED], [LEVEL_CLOSED, LEVEL_CLOSED, LEVEL_CLOSED], [LEVEL_CLOSED, LEVEL_CLOSED, LEVEL_CLOSED], [LEVEL_CLOSED, LEVEL_CLOSED, LEVEL_CLOSED], [LEVEL_CLOSED, LEVEL_CLOSED, LEVEL_CLOSED], [LEVEL_CLOSED, LEVEL_CLOSED, LEVEL_CLOSED], [LEVEL_CLOSED, LEVEL_CLOSED, LEVEL_CLOSED], [LEVEL_CLOSED, LEVEL_CLOSED, LEVEL_CLOSED], [LEVEL_CLOSED, LEVEL_CLOSED, LEVEL_CLOSED], [LEVEL_CLOSED, LEVEL_CLOSED, LEVEL_CLOSED], [LEVEL_CLOSED, LEVEL_CLOSED, LEVEL_CLOSED]];
planet_infos = [[["Volcano", 200], ["Volcano", 1100], ["Volcano", 3300]], [["Ariola", 300], ["Ariola", 1045], ["Ariola", 4100]], [["Kasheta", 375], ["Kasheta", 1250], ["Kasheta", 4900]], [["Rhandaran", 450], ["Rhandaran", 1400], ["Rhandaran", 5100]], [["Xelacia", 600], ["Xelacia", 1560], ["Xelacia", 5125]], [["Acturus", 550], ["Acturus", 1640], ["Acturus", 5410]], [["Betazedd", 580], ["Betazedd", 1780], ["Betazedd", 5960]], [["Yohada", 670], ["Yohada", 1890], ["Yohada", 6070]], [["Arcad", 750], ["Arcad", 1950], ["Arcad", 6300]], [["Grazerit", 800], ["Grazerit", 2100], ["Grazerit", 6900]], [["Zakdern", 930], ["Zakdern", 2400], ["Zakdern", 7800]], [["Kespryt", 1000], ["Kespryt", 2800], ["Kespryt", 9000]]];
number_planet = -1;
number_zone = -1;
revenue_creds = 0;
conquered_percents = 0;
_current_glow_clip = null;
color_matrix = null;
super();
_engine = Global.top.engine;
color_matrix = new Array();
color_matrix = color_matrix.concat([0, 0, 0, 0, 0]);
color_matrix = color_matrix.concat([1, 0, 0, 0, 0]);
color_matrix = color_matrix.concat([0, 0, 0, 0, 0]);
color_matrix = color_matrix.concat([0, 0, 0, 1, 0]);
main_menu_button.tabEnabled = false;
options_button.tabEnabled = false;
play_next_button.tabEnabled = false;
}
public function destroy():void{
stopMusic();
main_menu_button.removeEventListener(MouseEvent.MOUSE_DOWN, mainMenuClickHanler);
play_next_button.removeEventListener(MouseEvent.MOUSE_DOWN, playNextClickHanler);
options_button.removeEventListener(MouseEvent.MOUSE_DOWN, optionsDialogClickHanler);
options_dialog.close_button.removeEventListener(MouseEvent.MOUSE_DOWN, optionsDialogClose);
options_dialog.music_on_button.removeEventListener(MouseEvent.MOUSE_DOWN, musicOnHandler);
options_dialog.music_off_button.removeEventListener(MouseEvent.MOUSE_DOWN, musicOffHandler);
options_dialog.reset_saved_button.removeEventListener(MouseEvent.MOUSE_DOWN, resetSavedHandler);
options_dialog.main_menu_button.removeEventListener(MouseEvent.MOUSE_DOWN, optionsMainMenuButtonHandler);
options_dialog.low_quality_button.removeEventListener(MouseEvent.MOUSE_DOWN, qualityButtonHandler);
options_dialog.medium_quality_button.removeEventListener(MouseEvent.MOUSE_DOWN, qualityButtonHandler);
options_dialog.high_quality_button.removeEventListener(MouseEvent.MOUSE_DOWN, qualityButtonHandler);
map_goal.deactivate();
}
private function getNextLevelAndZone():Array{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < 3) {
_local2 = 0;
while (_local2 < levelArray.length) {
if (levelArray[_local2][_local1] == LEVEL_OPENED){
return ([_local2, _local1]);
};
_local2++;
};
_local1++;
};
return (null);
}
private function autoSendOffHandler(_arg1:MouseEvent):void{
var _local2:FocusManager;
Global.top.engine.playSound(SoundConsts.click);
_engine.autoSend = true;
updateControls();
_local2 = new FocusManager(Global.mainStage);
_local2.setFocus(Global.mainStage);
}
private function FnPlanetShow3(_arg1:Event):void{
var _local2:*;
var _local3:int;
_local2 = null;
_local3 = 0;
while (_local3 < level_array.length) {
if (planets_back.getPlanetsArray()[_local3].button_one == _arg1.currentTarget){
number_planet = _local3;
number_zone = 1;
_local2 = planets_back.getPlanetsArray()[_local3].button_one;
};
if (planets_back.getPlanetsArray()[_local3].button_two == _arg1.currentTarget){
number_planet = _local3;
number_zone = 2;
_local2 = planets_back.getPlanetsArray()[_local3].button_two;
};
if (planets_back.getPlanetsArray()[_local3].button_three == _arg1.currentTarget){
number_planet = _local3;
number_zone = 3;
_local2 = planets_back.getPlanetsArray()[_local3].button_three;
};
_local3++;
};
showPlanetInfoOver(number_planet, number_zone, _local2);
}
private function optionsDialogClose(_arg1:Event):void{
Global.top.engine.playSound(SoundConsts.click);
options_dialog.visible = false;
options_dialog.close_button.removeEventListener(MouseEvent.MOUSE_DOWN, optionsDialogClose);
options_dialog.music_on_button.removeEventListener(MouseEvent.MOUSE_DOWN, musicOnHandler);
options_dialog.music_off_button.removeEventListener(MouseEvent.MOUSE_DOWN, musicOffHandler);
options_dialog.reset_saved_button.removeEventListener(MouseEvent.MOUSE_DOWN, resetSavedHandler);
options_dialog.main_menu_button.removeEventListener(MouseEvent.MOUSE_DOWN, optionsMainMenuButtonHandler);
}
public function levelFinished(_arg1:int, _arg2:int):void{
if (0 == _arg2){
if (0 == _arg1){
checkAndOpen([1, 0], [2, 0]);
} else {
if (1 == _arg1){
checkAndOpen([2, 0], [3, 0]);
} else {
if (2 == _arg1){
checkAndOpen([3, 0], [4, 0], [5, 0]);
} else {
if (3 == _arg1){
checkAndOpen([4, 0], [5, 0], [6, 0]);
} else {
if (4 == _arg1){
checkAndOpen([6, 0], [7, 0]);
} else {
if (5 == _arg1){
checkAndOpen([6, 0], [7, 0]);
} else {
if (6 == _arg1){
checkAndOpen([7, 0], [8, 0], [9, 0]);
} else {
if (7 == _arg1){
checkAndOpen([7, 0], [8, 0], [9, 0]);
} else {
if (8 == _arg1){
checkAndOpen([9, 0], [10, 0], [11, 0]);
} else {
if (9 == _arg1){
checkAndOpen([9, 0], [10, 0], [11, 0], [0, 1], [1, 1]);
} else {
if (10 == _arg1){
checkAndOpen([9, 0], [10, 0], [11, 0], [0, 1], [1, 1]);
} else {
if (11 == _arg1){
checkAndOpen([0, 1], [1, 1], [2, 1], [3, 1]);
};
};
};
};
};
};
};
};
};
};
};
};
} else {
if (1 == _arg2){
if (0 == _arg1){
checkAndOpen([0, 1], [1, 1], [2, 1], [3, 1]);
} else {
if (1 == _arg1){
checkAndOpen([4, 1], [1, 1], [2, 1], [3, 1]);
} else {
if (2 == _arg1){
checkAndOpen([3, 1], [4, 1], [5, 1]);
} else {
if (3 == _arg1){
checkAndOpen([4, 1], [5, 1], [6, 1], [7, 1]);
} else {
if (4 == _arg1){
checkAndOpen([6, 1], [7, 1]);
} else {
if (5 == _arg1){
checkAndOpen([6, 1], [7, 1]);
} else {
if (6 == _arg1){
checkAndOpen([7, 1], [8, 1], [9, 1]);
} else {
if (7 == _arg1){
checkAndOpen([7, 1], [8, 1], [9, 1]);
} else {
if (8 == _arg1){
checkAndOpen([9, 1], [10, 1], [11, 1]);
} else {
if (9 == _arg1){
checkAndOpen([9, 1], [10, 1], [11, 1], [0, 2], [1, 2]);
} else {
if (10 == _arg1){
checkAndOpen([9, 1], [10, 1], [11, 1], [0, 2], [1, 2]);
} else {
if (11 == _arg1){
checkAndOpen([0, 2], [1, 2], [2, 2], [3, 2]);
};
};
};
};
};
};
};
};
};
};
};
};
} else {
if (2 == _arg2){
if (0 == _arg1){
checkAndOpen([0, 2], [1, 2], [2, 2], [3, 2]);
} else {
if (1 == _arg1){
checkAndOpen([4, 2], [1, 2], [2, 2], [3, 2]);
} else {
if (2 == _arg1){
checkAndOpen([3, 2], [4, 2], [5, 2]);
} else {
if (3 == _arg1){
checkAndOpen([4, 2], [5, 2], [6, 2]);
} else {
if (4 == _arg1){
checkAndOpen([6, 2], [7, 2]);
} else {
if (5 == _arg1){
checkAndOpen([6, 2], [7, 2]);
} else {
if (6 == _arg1){
checkAndOpen([7, 2], [8, 2], [9, 2]);
} else {
if (7 == _arg1){
checkAndOpen([7, 2], [8, 2], [9, 2]);
} else {
if (8 == _arg1){
checkAndOpen([9, 2], [10, 2], [11, 2]);
} else {
if (9 == _arg1){
checkAndOpen([9, 2], [10, 2], [11, 2]);
} else {
if (10 == _arg1){
checkAndOpen([9, 2], [10, 2], [11, 2]);
} else {
if (11 == _arg1){
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
levelArray[_arg1][_arg2] = LEVEL_WON;
updateLevels();
}
private function setQuality(_arg1):void{
switch (_arg1){
case options_dialog.low_quality_button:
Global.mainStage.quality = "low";
removeFilters(options_dialog.medium_quality_button);
removeFilters(options_dialog.high_quality_button);
applyFilter(options_dialog.low_quality_button);
break;
case options_dialog.medium_quality_button:
Global.mainStage.quality = "medium";
removeFilters(options_dialog.low_quality_button);
removeFilters(options_dialog.high_quality_button);
applyFilter(options_dialog.medium_quality_button);
break;
case options_dialog.high_quality_button:
Global.mainStage.quality = "high";
removeFilters(options_dialog.low_quality_button);
removeFilters(options_dialog.medium_quality_button);
applyFilter(options_dialog.high_quality_button);
break;
};
}
private function playNextClickHanler(_arg1:MouseEvent):void{
var _local2:Array;
_local2 = getNextLevelAndZone();
if (_local2){
playLevel(_local2[0], _local2[1]);
} else {
playLevel(0, 0);
};
}
private function resumeGameButtonHandler(_arg1:MouseEvent):void{
visible = false;
stopMusic();
optionsDialogClose(null);
Global.top.resumeGameHandler(null);
}
private function autoSendOnHandler(_arg1:MouseEvent):void{
var _local2:FocusManager;
Global.top.engine.playSound(SoundConsts.click);
_engine.autoSend = false;
updateControls();
_local2 = new FocusManager(Global.mainStage);
_local2.setFocus(Global.mainStage);
}
public function clear():void{
}
public function set levelArray(_arg1:Array):void{
level_array = _arg1;
}
public function applyFilter(_arg1:DisplayObject):void{
var _local2:ColorMatrixFilter;
var _local3:Array;
_local2 = new ColorMatrixFilter(color_matrix);
_local3 = new Array();
_local3.push(_local2);
_arg1.filters = _local3;
}
private function checkAndOpen(... _args):void{
var _local2:Array;
for each (_local2 in _args) {
if (levelArray[_local2[0]][_local2[1]] != LEVEL_WON){
levelArray[_local2[0]][_local2[1]] = LEVEL_OPENED;
};
};
}
private function updateControls():void{
options_dialog.music_on_button.visible = !(_engine.musicOff);
options_dialog.music_off_button.visible = _engine.musicOff;
options_dialog.auto_send_on_button.visible = _engine.autoSend;
options_dialog.auto_send_off_button.visible = !(_engine.autoSend);
}
public function playLevel(_arg1:int, _arg2:int):void{
Global.top.engine.playSound(SoundConsts.click);
visible = false;
stopMusic();
if (_arg1 < LevelSelector.levelCount()){
_engine.playLevel(_arg1, _arg2);
} else {
_engine.playLevel(0, 0);
};
}
private function showPlanetInfoOver(_arg1:int, _arg2:int, _arg3):void{
var _local4:BitmapFilter;
var _local5:Array;
removeGlowClip();
_local4 = getGlowFilter();
_local5 = new Array();
_local5.push(_local4);
_arg3.filters = _local5;
_current_glow_clip = _arg3;
if (_arg2){
_arg2--;
};
}
public function get planetInfos():Array{
return (planet_infos);
}
public function removeFilters(_arg1:DisplayObject):void{
var _local2:Array;
_local2 = new Array();
_arg1.filters = _local2;
}
private function musicOffHandler(_arg1:Event):void{
var _local2:FocusManager;
_engine.musicOff = false;
updateControls();
playMusic();
Global.top.playMusic();
Global.top.engine.playSound(SoundConsts.click);
_local2 = new FocusManager(Global.mainStage);
_local2.setFocus(Global.mainStage);
}
public function setConqueredRate(_arg1:int):void{
conquered_percents = _arg1;
conquered_bar.scaleX = (0.01 * conquered_percents);
conquered_txt.text = (conquered_percents + "%");
}
private function qualityButtonHandler(_arg1:MouseEvent):void{
Global.top.engine.playSound(SoundConsts.click);
setQuality(_arg1.currentTarget);
}
private function zoneAttackButtonHandler(_arg1:MouseEvent):void{
var _local2:int;
var _local3:LevelZone;
_local2 = 0;
while (_local2 < planets_back.panels.length) {
if (planets_back.panels[_local2].zone1.attack_button == _arg1.currentTarget){
number_planet = _local2;
number_zone = 0;
};
if (planets_back.panels[_local2].zone2.attack_button == _arg1.currentTarget){
number_planet = _local2;
number_zone = 1;
};
if (planets_back.panels[_local2].zone3.attack_button == _arg1.currentTarget){
number_planet = _local2;
number_zone = 2;
};
_local2++;
};
_local3 = translateBack(number_planet, number_zone);
playLevel(_local3.level, _local3.zone);
}
public function show():void{
updateLevels();
Global.top.saveLevels();
playMusic();
options_dialog.sound_control.setEngine(_engine, this);
if (Global.top.engine.playWindowUI != null){
options_dialog.resume_button.visible = true;
} else {
options_dialog.resume_button.visible = false;
};
visible = true;
showDefaultInfo();
calcConquered();
}
private function mainMenuClickHanler(_arg1:Event):void{
Global.top.engine.playSound(SoundConsts.click);
visible = false;
stopMusic();
Global.top.showWelcome();
optionsDialogClose(null);
}
public function get levelArray():Array{
return (level_array);
}
private function removeGlowClip():void{
if (_current_glow_clip){
_current_glow_clip.filters = new Array();
};
}
public function stopMusic():void{
if (music_channel){
music_channel.stop();
music_channel = null;
};
}
private function showDefaultInfo():void{
var _local1:Array;
var _local2:*;
_local1 = getNextLevelAndZone();
if (_local1){
_local2 = null;
switch (_local1[1]){
case 0:
_local2 = planets_back.getPlanetsArray()[_local1[0]].button_one;
break;
case 1:
_local2 = planets_back.getPlanetsArray()[_local1[0]].button_two;
break;
case 2:
_local2 = planets_back.getPlanetsArray()[_local1[0]].button_three;
break;
};
showPlanetInfoOver(_local1[0], _local1[1], _local2);
};
}
public function playMusic():void{
var _local1:SoundTransform;
stopMusic();
if (((((!(_engine.volumeOff)) && (!(_engine.musicOff)))) && (music_sound))){
_local1 = new SoundTransform();
_local1.volume = _engine.volume;
music_channel = music_sound.play(0, 99999, _local1);
};
}
public function setRevenue(_arg1:int):void{
}
private function getGlowFilter():BitmapFilter{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Boolean;
var _local7:Boolean;
var _local8:Number;
_local1 = 3394815;
_local2 = 0.8;
_local3 = 35;
_local4 = 35;
_local5 = 2;
_local6 = false;
_local7 = false;
_local8 = BitmapFilterQuality.LOW;
return (new GlowFilter(_local1, _local2, _local3, _local4, _local5, _local8, _local6, _local7));
}
private function calcConquered():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
_local1 = 0;
_local2 = 0;
while (_local2 < levelArray.length) {
_local4 = 0;
while (_local4 < 3) {
if (levelArray[_local2][_local4] == LEVEL_WON){
_local1++;
};
_local4++;
};
_local2++;
};
_local3 = (((_local1 * 100) / (levelArray.length * 3)) + 0.5);
setConqueredRate(_local3);
}
private function getXPanel(_arg1:LevelZone){
var _local2:*;
_local2 = null;
switch (_arg1.zone){
case 0:
_local2 = planets_back.panels[_arg1.level].zone1;
break;
case 1:
_local2 = planets_back.panels[_arg1.level].zone2;
break;
case 2:
_local2 = planets_back.panels[_arg1.level].zone3;
break;
};
return (_local2);
}
private function FnPlanetShow3_OUT(_arg1:MouseEvent):void{
removeGlowClip();
showDefaultInfo();
}
public function initialize():void{
options_dialog.visible = false;
options_dialog.close_button.addEventListener(MouseEvent.MOUSE_DOWN, optionsDialogClose);
options_dialog.close_button.tabEnabled = false;
cacheAsBitmap = true;
main_menu_button.addEventListener(MouseEvent.MOUSE_DOWN, mainMenuClickHanler);
play_next_button.addEventListener(MouseEvent.MOUSE_DOWN, playNextClickHanler);
options_button.addEventListener(MouseEvent.MOUSE_DOWN, optionsDialogClickHanler);
options_dialog.reset_saved_button.addEventListener(MouseEvent.MOUSE_DOWN, resetSavedHandler);
options_dialog.reset_saved_button.tabEnabled = false;
options_dialog.main_menu_button.addEventListener(MouseEvent.MOUSE_DOWN, optionsMainMenuButtonHandler);
options_dialog.main_menu_button.tabEnabled = false;
options_dialog.resume_button.addEventListener(MouseEvent.MOUSE_DOWN, resumeGameButtonHandler);
options_dialog.resume_button.tabEnabled = false;
options_dialog.music_on_button.addEventListener(MouseEvent.MOUSE_DOWN, musicOnHandler);
options_dialog.music_off_button.addEventListener(MouseEvent.MOUSE_DOWN, musicOffHandler);
options_dialog.music_on_button.tabEnabled = false;
options_dialog.music_off_button.tabEnabled = false;
options_dialog.auto_send_on_button.addEventListener(MouseEvent.MOUSE_DOWN, autoSendOnHandler);
options_dialog.auto_send_off_button.addEventListener(MouseEvent.MOUSE_DOWN, autoSendOffHandler);
options_dialog.low_quality_button.addEventListener(MouseEvent.MOUSE_DOWN, qualityButtonHandler);
options_dialog.medium_quality_button.addEventListener(MouseEvent.MOUSE_DOWN, qualityButtonHandler);
options_dialog.high_quality_button.addEventListener(MouseEvent.MOUSE_DOWN, qualityButtonHandler);
flonga_button.addEventListener(MouseEvent.MOUSE_DOWN, GameStage.sponsorClick);
options_dialog.auto_send_on_button.tabEnabled = false;
options_dialog.auto_send_off_button.tabEnabled = false;
options_dialog.low_quality_button.tabEnabled = false;
options_dialog.medium_quality_button.tabEnabled = false;
options_dialog.high_quality_button.tabEnabled = false;
flonga_button.tabEnabled = false;
level = this;
level.planets_back.x = (-((level.planets_back.width - 700)) / 2);
level.planets_back_star.x = (-((level.planets_back_star.width - 700)) / 2);
level.planets_star.x = (-((level.planets_back_star.width - 700)) / 2);
level.planets_nebula.x = (-((level.planets_back_star.width - 700)) / 2);
map_goal = new MapGoal(level);
ProcessManager.goalSystem.add(map_goal);
updateLevels();
calcConquered();
options_dialog.sound_control.setEngine(_engine, this);
updateControls();
cacheAsBitmap = true;
setQuality(options_dialog.high_quality_button);
}
public function updateLevels():void{
var _local1:int;
var _local2:LevelZone;
var _local3:*;
var _local4:Boolean;
var _local5:int;
destroyLevel();
setRevenue(_engine.creds);
_local1 = 0;
_local1 = 0;
while (_local1 < level_array.length) {
planets_back.getIconArray()[_local1].gotoAndStop("inactive_state");
_local1++;
};
_local1 = 0;
while (_local1 < level_array.length) {
_local2 = null;
_local3 = null;
_local4 = false;
_local5 = 0;
while (_local5 < 3) {
_local2 = translate(_local1, _local5);
_local3 = getXPanel(_local2);
_local3.dif_txt.text = planet_infos[_local1][_local5][1].toString();
_local3.treasure_txt.text = (int((LevelSelector.bestCounteractionLikelihood(_local1, _local5) * 100)) + "%");
if (level_array[_local1][_local5] == LEVEL_OPENED){
_local4 = true;
planets_back.getIconArray()[_local2.level].gotoAndStop("active_state");
updatePlanet(_local2.level, _local2.zone, 2, true, 1);
};
if (level_array[_local1][_local5] == LEVEL_CLOSED){
updatePlanet(_local2.level, _local2.zone, 1, false, 1);
};
if (level_array[_local1][_local5] == LEVEL_WON){
updatePlanet(_local2.level, _local2.zone, 3, true, 0.5);
};
_local5++;
};
_local1++;
};
}
public function optionsDialogClickHanler(_arg1:Event):void{
Global.top.engine.playSound(SoundConsts.click);
updateControls();
options_dialog.visible = true;
options_dialog.close_button.addEventListener(MouseEvent.MOUSE_DOWN, optionsDialogClose);
options_dialog.music_on_button.addEventListener(MouseEvent.MOUSE_DOWN, musicOnHandler);
options_dialog.music_off_button.addEventListener(MouseEvent.MOUSE_DOWN, musicOffHandler);
options_dialog.reset_saved_button.addEventListener(MouseEvent.MOUSE_DOWN, resetSavedHandler);
options_dialog.main_menu_button.addEventListener(MouseEvent.MOUSE_DOWN, optionsMainMenuButtonHandler);
}
public function destroyLevel():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < level_array.length) {
_local2 = 0;
while (_local2 < 3) {
if (_local2 == 0){
planets_back.getPlanetsArray()[_local1].button_one.removeEventListener(MouseEvent.MOUSE_DOWN, FnPlanetSelect);
planets_back.getPlanetsArray()[_local1].button_one.removeEventListener(MouseEvent.MOUSE_OVER, FnPlanetShow3);
planets_back.getPlanetsArray()[_local1].button_one.removeEventListener(MouseEvent.MOUSE_OUT, FnPlanetShow3_OUT);
planets_back.panels[_local1].zone1.attack_button.removeEventListener(MouseEvent.MOUSE_DOWN, zoneAttackButtonHandler);
planets_back.getPlanetsArray()[_local1].button_one.listener_added = false;
planets_back.getPlanetsArray()[_local1].button_one.buttonMode = true;
planets_back.getPlanetsArray()[_local1].button_one.tabEnabled = false;
planets_back.getPlanetsArray()[_local1].button_one.mouseChildren = false;
};
if (_local2 == 1){
planets_back.getPlanetsArray()[_local1].button_two.removeEventListener(MouseEvent.MOUSE_DOWN, FnPlanetSelect);
planets_back.getPlanetsArray()[_local1].button_two.removeEventListener(MouseEvent.MOUSE_OVER, FnPlanetShow3);
planets_back.getPlanetsArray()[_local1].button_two.removeEventListener(MouseEvent.MOUSE_OUT, FnPlanetShow3_OUT);
planets_back.panels[_local1].zone2.attack_button.removeEventListener(MouseEvent.MOUSE_DOWN, zoneAttackButtonHandler);
planets_back.getPlanetsArray()[_local1].button_two.listener_added = false;
planets_back.getPlanetsArray()[_local1].button_two.buttonMode = true;
planets_back.getPlanetsArray()[_local1].button_two.tabEnabled = false;
planets_back.getPlanetsArray()[_local1].button_two.mouseChildren = false;
};
if (_local2 == 2){
planets_back.getPlanetsArray()[_local1].button_three.removeEventListener(MouseEvent.MOUSE_DOWN, FnPlanetSelect);
planets_back.getPlanetsArray()[_local1].button_three.removeEventListener(MouseEvent.MOUSE_OVER, FnPlanetShow3);
planets_back.getPlanetsArray()[_local1].button_three.removeEventListener(MouseEvent.MOUSE_OUT, FnPlanetShow3_OUT);
planets_back.panels[_local1].zone2.attack_button.removeEventListener(MouseEvent.MOUSE_DOWN, zoneAttackButtonHandler);
planets_back.getPlanetsArray()[_local1].button_three.listener_added = false;
planets_back.getPlanetsArray()[_local1].button_three.buttonMode = true;
planets_back.getPlanetsArray()[_local1].button_three.tabEnabled = false;
planets_back.getPlanetsArray()[_local1].button_three.mouseChildren = false;
};
_local2++;
};
_local1++;
};
}
private function resetSavedHandler(_arg1:Event):void{
Global.top.engine.playSound(SoundConsts.click);
Global.top.resetSaved();
updateLevels();
}
private function updatePlanet(_arg1:int, _arg2:int, _arg3:int, _arg4:Boolean, _arg5:Number):void{
if (_arg2 == 0){
planets_back.getPlanetsArray()[_arg1].button_one.gotoAndStop(_arg3);
if (!planets_back.getPlanetsArray()[_arg1].button_one.listener_added){
planets_back.getPlanetsArray()[_arg1].button_one.addEventListener(MouseEvent.MOUSE_DOWN, FnPlanetSelect);
planets_back.getPlanetsArray()[_arg1].button_one.addEventListener(MouseEvent.MOUSE_OVER, FnPlanetShow3);
planets_back.getPlanetsArray()[_arg1].button_one.addEventListener(MouseEvent.MOUSE_OUT, FnPlanetShow3_OUT);
planets_back.panels[_arg1].zone1.attack_button.addEventListener(MouseEvent.MOUSE_DOWN, zoneAttackButtonHandler);
planets_back.getPlanetsArray()[_arg1].button_one.listener_added = true;
};
planets_back.panels[_arg1].zone1.attack_button.visible = _arg4;
planets_back.panels[_arg1].zone1.attack_button.alpha = _arg5;
};
if (_arg2 == 1){
planets_back.getPlanetsArray()[_arg1].button_two.gotoAndStop(_arg3);
if (!planets_back.getPlanetsArray()[_arg1].button_two.listener_added){
planets_back.getPlanetsArray()[_arg1].button_two.addEventListener(MouseEvent.MOUSE_DOWN, FnPlanetSelect);
planets_back.getPlanetsArray()[_arg1].button_two.addEventListener(MouseEvent.MOUSE_OVER, FnPlanetShow3);
planets_back.getPlanetsArray()[_arg1].button_two.addEventListener(MouseEvent.MOUSE_OUT, FnPlanetShow3_OUT);
planets_back.panels[_arg1].zone2.attack_button.addEventListener(MouseEvent.MOUSE_DOWN, zoneAttackButtonHandler);
planets_back.getPlanetsArray()[_arg1].button_two.listener_added = true;
};
planets_back.panels[_arg1].zone2.attack_button.visible = _arg4;
planets_back.panels[_arg1].zone2.attack_button.alpha = _arg5;
};
if (_arg2 == 2){
planets_back.getPlanetsArray()[_arg1].button_three.gotoAndStop(_arg3);
if (!planets_back.getPlanetsArray()[_arg1].button_three.listener_added){
planets_back.getPlanetsArray()[_arg1].button_three.addEventListener(MouseEvent.MOUSE_DOWN, FnPlanetSelect);
planets_back.getPlanetsArray()[_arg1].button_three.addEventListener(MouseEvent.MOUSE_OVER, FnPlanetShow3);
planets_back.getPlanetsArray()[_arg1].button_three.addEventListener(MouseEvent.MOUSE_OUT, FnPlanetShow3_OUT);
planets_back.panels[_arg1].zone3.attack_button.addEventListener(MouseEvent.MOUSE_DOWN, zoneAttackButtonHandler);
planets_back.getPlanetsArray()[_arg1].button_three.listener_added = true;
};
planets_back.panels[_arg1].zone3.attack_button.visible = _arg4;
planets_back.panels[_arg1].zone3.attack_button.alpha = _arg5;
};
}
private function FnPlanetSelect(_arg1:Event):void{
var _local2:int;
var _local3:LevelZone;
_local2 = 0;
while (_local2 < level_array.length) {
if (planets_back.getPlanetsArray()[_local2].button_one == _arg1.currentTarget){
number_planet = _local2;
number_zone = 0;
};
if (planets_back.getPlanetsArray()[_local2].button_two == _arg1.currentTarget){
number_planet = _local2;
number_zone = 1;
};
if (planets_back.getPlanetsArray()[_local2].button_three == _arg1.currentTarget){
number_planet = _local2;
number_zone = 2;
};
_local2++;
};
_local3 = translateBack(number_planet, number_zone);
if (level_array[_local3.level][_local3.zone] == LEVEL_OPENED){
playLevel(_local3.level, _local3.zone);
};
}
private function musicOnHandler(_arg1:Event):void{
var _local2:FocusManager;
_engine.musicOff = true;
updateControls();
playMusic();
Global.top.stopMusic();
_local2 = new FocusManager(Global.mainStage);
_local2.setFocus(Global.mainStage);
}
private function optionsMainMenuButtonHandler(_arg1:MouseEvent):void{
mainMenuClickHanler(null);
}
public static function translate(_arg1:int, _arg2:int):LevelZone{
var _local3:LevelZone;
var _local4:int;
_local3 = new LevelZone();
_local4 = (_arg1 + (_arg2 * 12));
_local3.level = int((_local4 / 3));
_local3.zone = (_local4 % 3);
return (_local3);
}
public static function translateBack(_arg1:int, _arg2:int):LevelZone{
var _local3:LevelZone;
var _local4:int;
_local3 = new LevelZone();
_local4 = ((_arg1 * 3) + _arg2);
_local3.level = (_local4 % 12);
_local3.zone = int((_local4 / 12));
return (_local3);
}
}
}//package game.ui
class LevelZone {
public var level:int;// = 0
public var zone:int;// = 0
private function LevelZone(){
level = 0;
zone = 0;
super();
}
}
Section 107
//PlanetsBackground (game.ui.PlanetsBackground)
package game.ui {
import flash.display.*;
public class PlanetsBackground extends MovieClip {
public var icon_7:MovieClip;
public var icon_8:MovieClip;
public var arcad:MovieClip;
public var icon_6:MovieClip;
public var grazerit:MovieClip;
private var planets_array:Array;
private var icon_array:Array;
public var icon_9:MovieClip;
private var _panels:Array;
public var icon_1:MovieClip;
public var icon_2:MovieClip;
public var yohada:MovieClip;
public var xelacia:MovieClip;
public var kespryt:MovieClip;
public var rhandaran:MovieClip;
public var kasheta:MovieClip;
public var zakdern:MovieClip;
public var icon_11:MovieClip;
public var icon_12:MovieClip;
public var vulcano:MovieClip;
public var acturus:MovieClip;
public var all_panels:MovieClip;
public var ariola:MovieClip;
public var icon_10:MovieClip;
public var betazedd:MovieClip;
public var icon_3:MovieClip;
public var icon_4:MovieClip;
public var icon_5:MovieClip;
public function PlanetsBackground():void{
_panels = [];
super();
planets_array = [vulcano, ariola, kasheta, rhandaran, xelacia, acturus, betazedd, yohada, arcad, grazerit, zakdern, kespryt];
icon_array = [icon_1, icon_2, icon_3, icon_4, icon_5, icon_6, icon_7, icon_8, icon_9, icon_10, icon_11, icon_12];
_panels = [all_panels.planet_panel1, all_panels.planet_panel2, all_panels.planet_panel3, all_panels.planet_panel4, all_panels.planet_panel5, all_panels.planet_panel6, all_panels.planet_panel7, all_panels.planet_panel8, all_panels.planet_panel9, all_panels.planet_panel10, all_panels.planet_panel11, all_panels.planet_panel12];
}
public function get panels():Array{
return (_panels);
}
public function getIconArray():Array{
return (icon_array);
}
public function getPlanetsArray():Array{
return (planets_array);
}
}
}//package game.ui
Section 108
//PlayWindowUI (game.ui.PlayWindowUI)
package game.ui {
import core.*;
import flash.events.*;
import flash.display.*;
import game.logic.*;
import game.ui.controls.*;
import game.*;
import flash.text.*;
public class PlayWindowUI extends Sprite {
public var menu_button:SimpleButton;
public var end_mission_button:SimpleButton;
private var engine:Engine;// = null
public var countdown_txt:TextField;
private var _buttons:GameButtons;// = null
public var pause_mc:MovieClip;
public var game_menu:MovieClip;
public var pause_button:SimpleButton;
private var _enemy_butons:GameButtons;// = null
public var help_button:SimpleButton;
public function PlayWindowUI():void{
engine = null;
_buttons = null;
_enemy_butons = null;
super();
menu_button.tabEnabled = false;
pause_button.tabEnabled = false;
end_mission_button.tabEnabled = false;
help_button.tabEnabled = false;
}
public function get enemyButons():GameButtons{
return (_enemy_butons);
}
public function get enemyStormBar():SpriteBar{
return ((game_menu.enemy_storm_bar as SpriteBar));
}
public function logMessage(_arg1:String, _arg2:Boolean=false):void{
var _local3:String;
var _local4:int;
var _local5:int;
var _local6:String;
if (_arg1.length == 0){
return;
};
if (_arg2){
_local3 = game_menu.message_box.text;
_local4 = _local3.lastIndexOf("\r");
if (_local4 > 0){
_local5 = _local3.lastIndexOf("\r", (_local4 - 1));
if (_local5 < 0){
_local5 = 0;
} else {
_local5++;
};
_local6 = ((_local3.substr(0, _local5) + _arg1) + "\r");
game_menu.message_box.text = _local6;
return;
};
};
game_menu.message_box.text = (game_menu.message_box.text + (_arg1 + "\r"));
game_menu.message_box.scrollV = (game_menu.message_box.scrollV + 1);
}
private function uimenuClickHandler(_arg1:MouseEvent):void{
if (engine.gameFinished){
return;
};
engine.playSound(SoundConsts.click);
engine.pause();
engine.hideUI();
Global.top.showWelcome();
}
public function get stormBar():SpriteBar{
return ((game_menu.storm_bar as SpriteBar));
}
public function updateShipIcons():void{
var _local1:int;
if (balanceBar.balance == 0.5){
game_menu.red_ship_icon.gotoAndStop(1);
game_menu.blue_ship_icon.gotoAndStop(1);
return;
};
_local1 = 0;
if (balanceBar.balance < 0.5){
_local1 = (5 - int(((balanceBar.balance * 5) / 0.5)));
game_menu.blue_ship_icon.gotoAndStop(_local1);
game_menu.red_ship_icon.gotoAndStop(1);
} else {
if (balanceBar.balance > 0.5){
_local1 = (5 - int((((1 - balanceBar.balance) * 5) / 0.5)));
game_menu.red_ship_icon.gotoAndStop(_local1);
game_menu.blue_ship_icon.gotoAndStop(1);
};
};
}
private function endMissionClickHandler(_arg1:MouseEvent):void{
if (engine.gameFinished){
return;
};
Global.top.engine.playSound(SoundConsts.click);
engine.gameOver();
}
private function helpClickHandler(_arg1:MouseEvent):void{
if (engine.gameFinished){
return;
};
engine.playSound(SoundConsts.click);
engine.pause();
engine.hideUI();
Global.top.showWelcome();
Global.top.instructions.show();
}
public function initialize(_arg1:Engine):void{
engine = _arg1;
pause_mc.addEventListener(MouseEvent.MOUSE_DOWN, unpauseHandler);
menu_button.addEventListener(MouseEvent.MOUSE_DOWN, uimenuClickHandler);
pause_button.addEventListener(MouseEvent.MOUSE_DOWN, uipauseClickHandler);
end_mission_button.addEventListener(MouseEvent.MOUSE_DOWN, endMissionClickHandler);
help_button.addEventListener(MouseEvent.MOUSE_DOWN, helpClickHandler);
pause_mc.stop();
pause_mc.visible = false;
balanceBar.initialize(engine.levelMap.health);
_buttons = new GameButtons(game_menu.player_buttons, false);
_enemy_butons = new GameButtons(game_menu.ai_buttons, true);
game_menu.blue_ship_icon.stop();
game_menu.red_ship_icon.stop();
}
public function get balanceBar():BalanceBar{
return ((game_menu.balance_bar as BalanceBar));
}
private function unpauseHandler(_arg1:MouseEvent):void{
engine.pause();
_arg1.stopPropagation();
}
public function get buttons():GameButtons{
return (_buttons);
}
public function update():void{
}
private function uipauseClickHandler(_arg1:MouseEvent):void{
if (engine.gameFinished){
return;
};
engine.playSound(SoundConsts.click);
engine.pause();
}
public function destroy():void{
pause_mc.removeEventListener(MouseEvent.MOUSE_DOWN, unpauseHandler);
menu_button.removeEventListener(MouseEvent.MOUSE_DOWN, uimenuClickHandler);
pause_button.removeEventListener(MouseEvent.MOUSE_DOWN, uipauseClickHandler);
end_mission_button.removeEventListener(MouseEvent.MOUSE_DOWN, endMissionClickHandler);
help_button.removeEventListener(MouseEvent.MOUSE_DOWN, helpClickHandler);
}
}
}//package game.ui
Section 109
//RoadPath (game.ui.RoadPath)
package game.ui {
import flash.display.*;
import core.common.*;
public dynamic class RoadPath extends MovieClip {
public var points:Map;// = null
private var road_index:int;// = 0
public function RoadPath():void{
points = null;
road_index = 0;
super();
}
public function isBackDirection():Boolean{
return (((points.values[0].x - points.values[1].x) > 0));
}
public function initialize():void{
var _local1:int;
var _local2:int;
var _local3:*;
points = new Map();
_local1 = numChildren;
_local2 = 0;
_local2 = 0;
while (_local2 < _local1) {
_local3 = getChildAt(_local2);
if ((_local3 is RoadPoint)){
points.add(_local3.name, _local3);
};
_local2++;
};
}
public function set index(_arg1:int):void{
road_index = _arg1;
}
public function lastNode():RoadPoint{
return (points.values[(points.size() - 1)]);
}
public function firstNode():RoadPoint{
return (points.values[0]);
}
public function get index():int{
return (road_index);
}
}
}//package game.ui
Section 110
//Statistics (game.ui.Statistics)
package game.ui {
import core.*;
import flash.events.*;
import flash.display.*;
import game.logic.*;
import flash.media.*;
import flash.utils.*;
import game.*;
import flash.text.*;
public class Statistics extends Sprite {
public var time_txt:TextField;
public var stat_caption:MovieClip;
public var monsters_txt:TextField;
public var bonus:int;// = 0
public var score_txt:TextField;
private var engine:Engine;// = null
public var bonus_txt:TextField;
private var level_won:Boolean;// = false
public var final_victory:MovieClip;
private var music_sound:Sound;// = null
private var times:int;// = 0
private var score:int;// = 0
private var counterTimer:Timer;// = null
public var main_menu_button:SimpleButton;
public var continue_button:SimpleButton;
public var monsters:int;// = 0
public var music_channel:SoundChannel;// = null
public function Statistics():void{
bonus = 0;
score = 0;
times = 0;
monsters = 0;
engine = null;
counterTimer = null;
music_sound = null;
music_channel = null;
level_won = false;
super();
}
public function victory():void{
level_won = true;
stat_caption.innerc.stat_title.text = "Well Done!";
continue_button.visible = true;
}
private function counter(_arg1, _arg2:int):int{
var _local3:int;
if (_arg2 > 0){
_local3 = ((_arg2 > 30)) ? (_arg2 / 30) : _arg2;
_arg1.text = (int(_arg1.text) + _local3).toString();
return (_local3);
};
return (0);
}
public function setEngine(_arg1:Engine):void{
engine = _arg1;
main_menu_button.addEventListener(MouseEvent.MOUSE_DOWN, mainMenu);
continue_button.addEventListener(MouseEvent.MOUSE_DOWN, continueButtonHandler);
}
public function start():void{
playMusic();
monsters_txt.text = "0";
time_txt.text = "0";
bonus_txt.text = "0";
score_txt.text = "0";
score = engine.gameScore;
counterTimer = new Timer(30, 0);
counterTimer.addEventListener(TimerEvent.TIMER, counterTick);
counterTimer.start();
}
private function replayHandler(_arg1:MouseEvent):void{
visible = false;
engine.playSound(SoundConsts.click);
engine.playLevel(engine.lastLevelIndex, engine.lastZone);
}
private function submitScore(_arg1:MouseEvent):void{
var _local2:int;
_local2 = engine.gameScore;
engine.gameScore = 0;
}
public function stopMusic():void{
if (music_channel){
music_channel.stop();
music_channel = null;
};
}
public function defeat():void{
level_won = false;
stat_caption.innerc.stat_title.text = "Failed. Try Again!";
}
private function continueButtonHandler(_arg1:MouseEvent):void{
visible = false;
engine.playSound(SoundConsts.click);
engine.clearAll();
if (((level_won) && ((engine.lastLevelIndex >= (LevelSelector.levelCount() - 1))))){
Global.top.showWelcome();
} else {
if (level_won){
engine.playLevel((engine.lastLevelIndex + 1), engine.lastZone);
} else {
engine.playLevel(engine.lastLevelIndex, engine.lastZone);
};
};
_arg1.stopPropagation();
}
public function playMusic():void{
var _local1:SoundTransform;
stopMusic();
if (((((!(engine.volumeOff)) && (!(engine.musicOff)))) && (music_sound))){
_local1 = new SoundTransform();
_local1.volume = engine.volume;
music_channel = music_sound.play(0, 1, _local1);
};
}
private function mainMenu(_arg1:MouseEvent):void{
visible = false;
engine.playSound(SoundConsts.click);
engine.clearAll();
Global.top.showWelcome();
}
private function counterTick(_arg1:TimerEvent):void{
monsters = (monsters - counter(monsters_txt, monsters));
bonus = (bonus - counter(bonus_txt, bonus));
score = (score - counter(score_txt, score));
times = (times - counter(time_txt, times));
if ((((times + monsters) + bonus) + score) == 0){
counterTimer.stop();
counterTimer.removeEventListener(TimerEvent.TIMER, counterTick);
counterTimer = null;
};
}
public function destroy():void{
if (counterTimer){
counterTimer.stop();
counterTimer.removeEventListener(TimerEvent.TIMER, counterTick);
counterTimer = null;
};
stopMusic();
continue_button.removeEventListener(MouseEvent.MOUSE_DOWN, continueButtonHandler);
main_menu_button.removeEventListener(MouseEvent.MOUSE_DOWN, mainMenu);
}
}
}//package game.ui
Section 111
//Story (game.ui.Story)
package game.ui {
import core.*;
import flash.events.*;
import flash.display.*;
import game.*;
public class Story extends MovieClip {
public var next_button:SimpleButton;
private var _shown:Boolean;// = false
public function Story(){
_shown = false;
super();
addFrameScript(224, frame225);
next_button.tabEnabled = false;
next_button.addEventListener(MouseEvent.MOUSE_DOWN, nextButtonHandler);
}
public function get shown():Boolean{
return (_shown);
}
function frame225(){
stop();
}
private function nextButtonHandler(_arg1:MouseEvent):void{
next_button.removeEventListener(MouseEvent.MOUSE_DOWN, nextButtonHandler);
Global.top.story = null;
this.parent.removeChild(this);
Global.top.engine.playSound(SoundConsts.click);
Global.top.instructions.show();
}
public function show():void{
visible = true;
_shown = true;
gotoAndPlay(1);
}
}
}//package game.ui
Section 112
//WelcomeScreen (game.ui.WelcomeScreen)
package game.ui {
import core.*;
import flash.events.*;
import flash.display.*;
import game.logic.*;
import flash.media.*;
import game.*;
import flash.text.*;
import flash.net.*;
public dynamic class WelcomeScreen extends MovieClip {
private const _game_version:int = 30;
public var music_channel:SoundChannel;// = null
public var options_button:SimpleButton;
private var play_holder;// = null
private var _upgrades:Upgrades;// = null
private var _all_kills:int;// = 0
private var music_sound:Sound;// = null
public var engine:Engine;// = null
private var level_selection:LevelSelection;// = null
private var _available_units:Array;
public var resume_button:SimpleButton;
private var _game_shop:GameShop;// = null
public var flonga_button:SimpleButton;
private var _instructions:Instructions;// = null
public var start_game_button:SimpleButton;
private var _available_weapons:Array;
private var _story:Story;// = null
public function WelcomeScreen():void{
play_holder = null;
level_selection = null;
engine = null;
_upgrades = null;
_game_shop = null;
_story = null;
_instructions = null;
_all_kills = 0;
_available_units = [];
_available_weapons = [];
music_sound = null;
music_channel = null;
super();
start_game_button.tabEnabled = false;
options_button.tabEnabled = false;
resume_button.tabEnabled = false;
flonga_button.tabEnabled = false;
}
public function get playHolder():Sprite{
return (play_holder);
}
public function loadLevels():void{
var _local1:*;
_local1 = SharedObject.getLocal(("mothership_wars_" + _game_version.toString()), "/");
if (_local1.data.levels){
level_selection.levelArray = _local1.data.levels;
allKills = _local1.data.kills;
engine.creds = _local1.data.creds;
if (_local1.data.arrayBlock){
gameShop.arrayBlock = _local1.data.arrayBlock;
};
if (_local1.data.orbitalWeapons){
gameShop.setObritalWeapons(_local1.data.orbitalWeapons);
};
if (_local1.data.upgrades){
_upgrades.upgradeArray = _local1.data.upgrades;
_upgrades.costArray = _local1.data.upgradeCosts;
gameShop.updateView();
};
};
}
private function updateView():void{
if (engine.playWindowUI != null){
resume_button.visible = true;
} else {
resume_button.visible = false;
};
}
private function createShop():void{
_upgrades = new Upgrades();
_game_shop = new GameShop();
_game_shop.visible = false;
play_holder.addChild(_game_shop);
_game_shop.Create();
_game_shop.setUpgrades(_upgrades);
_game_shop.arrayBlock = [1, 0, 0, 0, 0, 0, 0, 0];
_game_shop.setDefaultCards();
}
public function showGameShop():void{
playMusic();
gameShop.show();
}
public function stopMusic():void{
if (music_channel){
music_channel.stop();
music_channel = null;
};
}
public function startGameHandler(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
if (_story){
_story.show();
} else {
showGameShop();
};
}
public function saveLevels():void{
var _local1:*;
_local1 = SharedObject.getLocal(("mothership_wars_" + _game_version.toString()), "/");
_local1.data.levels = level_selection.levelArray;
_local1.data.creds = engine.creds;
_local1.data.kills = allKills;
_local1.data.arrayBlock = gameShop.arrayBlock;
_local1.data.orbitalWeapons = gameShop.orbitalWeapons;
_local1.data.upgrades = _upgrades.upgradeArray;
_local1.data.upgradeCosts = _upgrades.costArray;
_local1.flush();
}
public function playMusic():void{
var _local1:SoundTransform;
if (music_channel){
return;
};
stopMusic();
if (((!(engine.volumeOff)) && (music_sound))){
_local1 = new SoundTransform();
_local1.volume = engine.volume;
music_channel = music_sound.play(0, 99999, _local1);
};
}
private function createStory():void{
_story = new Story();
playHolder.addChild(_story);
_story.visible = false;
}
public function get levelSelection():LevelSelection{
return (level_selection);
}
public function resetSaved():void{
level_selection.levelArray = [[LevelSelection.LEVEL_OPENED, LevelSelection.LEVEL_CLOSED, LevelSelection.LEVEL_CLOSED], [LevelSelection.LEVEL_CLOSED, LevelSelection.LEVEL_CLOSED, LevelSelection.LEVEL_CLOSED], [LevelSelection.LEVEL_CLOSED, LevelSelection.LEVEL_CLOSED, LevelSelection.LEVEL_CLOSED], [LevelSelection.LEVEL_CLOSED, LevelSelection.LEVEL_CLOSED, LevelSelection.LEVEL_CLOSED], [LevelSelection.LEVEL_CLOSED, LevelSelection.LEVEL_CLOSED, LevelSelection.LEVEL_CLOSED], [LevelSelection.LEVEL_CLOSED, LevelSelection.LEVEL_CLOSED, LevelSelection.LEVEL_CLOSED], [LevelSelection.LEVEL_CLOSED, LevelSelection.LEVEL_CLOSED, LevelSelection.LEVEL_CLOSED], [LevelSelection.LEVEL_CLOSED, LevelSelection.LEVEL_CLOSED, LevelSelection.LEVEL_CLOSED], [LevelSelection.LEVEL_CLOSED, LevelSelection.LEVEL_CLOSED, LevelSelection.LEVEL_CLOSED], [LevelSelection.LEVEL_CLOSED, LevelSelection.LEVEL_CLOSED, LevelSelection.LEVEL_CLOSED], [LevelSelection.LEVEL_CLOSED, LevelSelection.LEVEL_CLOSED, LevelSelection.LEVEL_CLOSED], [LevelSelection.LEVEL_CLOSED, LevelSelection.LEVEL_CLOSED, LevelSelection.LEVEL_CLOSED]];
engine.creds = 0;
allKills = 0;
gameShop.arrayBlock = [1, 0, 0, 0, 0, 0, 0, 0];
gameShop.setObritalWeapons([StringConsts.EMPTY, StringConsts.EMPTY, StringConsts.EMPTY]);
_upgrades.upgradeArray = [1, 1, 1, 1, 1, 1];
_upgrades.costArray = _upgrades.getDefaultCosts();
gameShop.updateView();
saveLevels();
}
public function set allKills(_arg1:int):void{
_all_kills = _arg1;
}
public function initialize():void{
ProcessManager.instance.start();
start_game_button.addEventListener(MouseEvent.MOUSE_DOWN, startGameHandler);
resume_button.addEventListener(MouseEvent.MOUSE_DOWN, resumeGameHandler);
options_button.addEventListener(MouseEvent.MOUSE_DOWN, optionsHandler);
flonga_button.addEventListener(MouseEvent.MOUSE_DOWN, GameStage.sponsorClick);
play_holder = new Sprite();
addChild(play_holder);
engine = new Engine();
createStory();
createShop();
_instructions = new Instructions();
playHolder.addChild(_instructions);
_instructions.visible = false;
level_selection = new LevelSelection();
level_selection.initialize();
level_selection.visible = false;
play_holder.addChild(level_selection);
loadLevels();
level_selection.updateLevels();
updateView();
music_sound = new Sound_levels_music();
}
public function resumeGameHandler(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
stopMusic();
engine.showUI();
engine.pause();
if (_arg1){
_arg1.stopPropagation();
};
}
public function clear():void{
if (engine){
stopMusic();
level_selection.destroy();
play_holder.removeChild(level_selection);
removeChild(play_holder);
engine.clearAll();
start_game_button.removeEventListener(MouseEvent.MOUSE_DOWN, startGameHandler);
resume_button.removeEventListener(MouseEvent.MOUSE_DOWN, resumeGameHandler);
options_button.removeEventListener(MouseEvent.MOUSE_DOWN, optionsHandler);
engine = null;
};
}
public function get instructions():Instructions{
return (_instructions);
}
public function get allKills():int{
return (_all_kills);
}
public function get gameShop():GameShop{
return (_game_shop);
}
public function optionsHandler(_arg1:MouseEvent):void{
Global.top.engine.playSound(SoundConsts.click);
showLevelSelection();
levelSelection.optionsDialogClickHanler(null);
}
public function get upgrades():Upgrades{
return (_upgrades);
}
public function showLevelSelection():void{
if (!level_selection){
return;
};
playMusic();
level_selection.show();
}
public function showWelcome():void{
visible = true;
level_selection.visible = false;
_game_shop.visible = false;
updateView();
}
public function set story(_arg1:Story):void{
_story = _arg1;
}
}
}//package game.ui
Section 113
//Vulture (game.ui.Vulture)
package game.ui {
import flash.display.*;
import game.goals.*;
public class Vulture extends MovieClip {
private var assigned_goal:VultureGoal;// = null
public var inner:MovieClip;
private var _finished:Boolean;// = false
public function Vulture(){
_finished = false;
assigned_goal = null;
super();
}
protected function vehicleLanded():void{
assigned_goal.vehicleLanded();
}
public function setGoal(_arg1:VultureGoal):void{
assigned_goal = _arg1;
}
protected function tripFinished():void{
_finished = true;
}
public function get isFinished():Boolean{
return (_finished);
}
}
}//package game.ui
Section 114
//Unit (game.units.Unit)
package game.units {
import core.*;
import flash.display.*;
import game.ui.*;
import game.logic.*;
import game.goals.*;
import core.common.*;
import game.*;
public final class Unit {
public var description:String;
public var shot_point:Position;// = null
public var full_health:int;// = 100
private var bar:Shape;// = null
private var last_frontier:int;// = -1
public var weapon:Weapon;// = null
public var upgrade_level:int;// = 0
public var build_steps:int;// = 300
public var armor:uint;// = 1
public var type:String;
public var sitting_ticks:int;// = 0
public var sprite;// = null
private var current_state:int;// = 0
private var sprite_width:int;// = 0
public var peaceful:Boolean;// = false
public var death_cost:int;// = 1
public var enemy_unit:Boolean;// = false
public var health:int;// = 0
public var velocity:Number;// = 5
public var hit_point:Position;// = null
public var life:LifeGoal;// = null
public static const SITTING:int = 5;
public static const WAITING:int = 4;
public static const ATTACK:int = 2;
public static const WALKING:int = 1;
public static const DYING:int = 3;
public function Unit(_arg1:String, _arg2:Boolean):void{
sprite = null;
bar = null;
last_frontier = -1;
weapon = null;
sitting_ticks = 0;
armor = 1;
health = 0;
upgrade_level = 0;
full_health = 100;
death_cost = 1;
enemy_unit = false;
peaceful = false;
velocity = 5;
build_steps = 300;
life = null;
shot_point = null;
hit_point = null;
current_state = 0;
sprite_width = 0;
super();
type = _arg1;
enemy_unit = _arg2;
}
public function updateBar():void{
var sqcount:*;
var hpercent:*;
var frontier:*;
var diameter:*;
var rsize:*;
var startx:*;
var i:*;
createUIElements();
if (!isAlive){
bar.visible = false;
};
if (!sprite_width){
sprite_width = sprite.width;
};
var _local2 = bar;
with (_local2) {
sqcount = 6;
hpercent = ((health * 100) / full_health);
frontier = ((hpercent * sqcount) / 100);
if (frontier != last_frontier){
last_frontier = frontier;
diameter = (Math.max(sprite_width, sprite.height) + 8);
graphics.clear();
rsize = 4;
startx = (((-(rsize) * sqcount) / 2) + (sprite_width / 2));
graphics.lineStyle(1, 0, 0.5);
i = 0;
i = 0;
while (i < sqcount) {
if (i < frontier){
if (isEnemy){
graphics.beginFill(0xFF0000);
} else {
graphics.beginFill(0xFF00);
};
};
graphics.drawRect(startx, -(rsize), rsize, rsize);
if (i < frontier){
graphics.endFill();
};
startx = (startx + rsize);
i++;
};
};
};
}
public function moveSpriteToBackLayer():void{
sprite.parent.removeChild(sprite);
Global.top.engine.gameBoard.getRoadUnitLayer(life.getCurrentRoad().index).back_layer.addChild(sprite);
}
public function get isPeaceful():Boolean{
return (peaceful);
}
public function get currentState():int{
return (current_state);
}
public function setWeapon(_arg1:Weapon):void{
weapon = _arg1;
if (life){
life.resetWeapon();
};
}
public function set currentState(_arg1:int):void{
current_state = _arg1;
}
public function setPause(_arg1:Boolean):void{
if (((sprite) && (sprite.inner))){
if (_arg1){
sprite.inner.stop();
} else {
sprite.inner.play();
};
};
}
public function setSprite(_arg1):void{
if (!_arg1){
return;
};
sprite = _arg1;
if (sprite.shot_point){
shot_point = new Position(sprite.shot_point.x, sprite.shot_point.y);
sprite.shot_point.visible = false;
};
if (sprite.hit_point){
hit_point = new Position(sprite.hit_point.x, sprite.hit_point.y);
sprite.hit_point.visible = false;
};
}
private function createUIElements():void{
if (bar){
return;
};
bar = new Shape();
sprite.addChild(bar);
bar.x = (bar.x - (sprite.width / 2));
bar.y = (bar.y - (sprite.height * 1.1));
switch (type){
case StringConsts.MARINE:
case StringConsts.MISSILE_MAN:
case StringConsts.SPECIALIST:
case StringConsts.STORM_TANK:
bar.y = -40;
break;
case StringConsts.MINER_DROID:
bar.y = -32;
break;
case StringConsts.CATERPILLAR:
bar.y = -30;
break;
};
}
public function get isAlive():Boolean{
return ((health > 0));
}
public function hasSameRoad(_arg1:RoadPath):Boolean{
return ((life.getCurrentRoad() == _arg1));
}
public function coverForceField(){
var _local1:Engine;
var _local2:ObjectList;
var _local3:int;
var _local4:MovieClip;
_local1 = Global.top.engine;
if (_local1.gameBoard.forceFields[life.getCurrentRoad().index][0] > 0){
_local2 = _local1.gameBoard.forceFields[life.getCurrentRoad().index][1];
_local3 = 0;
_local3 = 0;
while (_local3 < _local2.length) {
_local4 = (_local2[_local3].forceField as MovieClip);
if (((((_local1.gameBoard.unitMaskLayer.x + sprite.x) > (_local4.x - (_local4.width / 2)))) && (((_local1.gameBoard.unitMaskLayer.x + sprite.x) < (_local4.x + (_local4.width / 2)))))){
return (_local4);
};
_local3++;
};
};
return (null);
}
public function getSynergy():int{
if (full_health < 0){
trace("ALARM!!!");
};
return (full_health);
}
public function activate(_arg1:Engine):void{
health = full_health;
life = new LifeGoal(_arg1, this);
_arg1.goalSystem.add(life);
}
public function destroy():void{
health = 0;
}
public function get isEnemy():Boolean{
return (enemy_unit);
}
}
}//package game.units
Section 115
//UnitCamp (game.units.UnitCamp)
package game.units {
import core.*;
import game.ui.*;
import core.common.*;
public class UnitCamp extends ObjectList {
public function applyDamageNear(_arg1:Number, _arg2, _arg3:Number, _arg4:String=null):void{
var _local5:ObjectList;
var _local6:int;
var _local7:Unit;
var _local8:int;
_local5 = makeCopy();
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6];
if (((_local7.isAlive) && (!(_local7.coverForceField())))){
_local8 = distanceFromPosition(_arg2, _local7);
if (_local8 <= _arg3){
Global.top.engine.hitUnit(_arg1, _local7, _arg4);
};
};
_local6++;
};
}
public function aliveCount():int{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
while (_local2 < length) {
if (this[_local2].isAlive){
_local1++;
};
_local2++;
};
return (_local1);
}
public function getNearestUnit(_arg1:RoadPath, _arg2:Position, _arg3:int):Unit{
var _local4:Unit;
var _local5:Unit;
var _local6:int;
var _local7:int;
var _local8:int;
_local4 = null;
_local5 = null;
_local6 = 9999999;
_local7 = 0;
while (_local7 < length) {
_local4 = this[_local7];
if (((_local4.isAlive) && ((_local4.life.getCurrentRoad() == _arg1)))){
_local8 = distanceFromPosition(_arg2, _local4);
if ((((_local8 <= _arg3)) && ((_local8 < _local6)))){
_local5 = _local4;
_local6 = _local8;
};
};
_local7++;
};
return (_local5);
}
protected function isUnitInFront(_arg1:Unit, _arg2:Unit):Boolean{
if (_arg2.isEnemy){
if (_arg2.sprite.x > _arg1.sprite.x){
return (true);
};
} else {
if (_arg2.sprite.x < _arg1.sprite.x){
return (true);
};
};
return (false);
}
public function getNearestForwardUnit(_arg1:RoadPath, _arg2:Unit, _arg3:int):Unit{
var _local4:Unit;
var _local5:Unit;
var _local6:int;
var _local7:int;
var _local8:int;
_local4 = null;
_local5 = null;
_local6 = 9999999;
_local7 = 0;
while (_local7 < length) {
_local4 = this[_local7];
if (((((_local4.isAlive) && ((_local4.life.getCurrentRoad() == _arg1)))) && (isUnitInFront(_local4, _arg2)))){
_local8 = distanceFromPosition(_arg2.sprite, _local4);
if ((((_local8 <= _arg3)) && ((_local8 < _local6)))){
_local5 = _local4;
_local6 = _local8;
};
};
_local7++;
};
return (_local5);
}
public function getNearUnits(_arg1:RoadPath, _arg2:Position=null, _arg3:Number=0):Array{
var _local4:Array;
var _local5:int;
var _local6:Unit;
var _local7:int;
_local4 = new Array();
_local5 = 0;
_local5 = 0;
while (_local5 < length) {
_local6 = this[_local5];
if (((_local6.isAlive) && ((_local6.life.getCurrentRoad() == _arg1)))){
if (_arg2){
_local7 = distanceFromPosition(_arg2, _local6);
if (_local7 <= _arg3){
_local4.push(_local6);
};
} else {
_local4.push(_local6);
};
};
_local5++;
};
return (_local4);
}
public function applyDamage(_arg1:Number, _arg2:String=null):void{
var _local3:ObjectList;
var _local4:int;
var _local5:Unit;
_local3 = makeCopy();
_local4 = 0;
while (_local4 < _local3.length) {
_local5 = _local3[_local4];
if (((_local5.isAlive) && (!(_local5.coverForceField())))){
Global.top.engine.hitUnit(_arg1, _local5, _arg2);
};
_local4++;
};
}
public static function distanceFromPosition(_arg1, _arg2:Unit):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg2.sprite.x - _arg1.x);
_local4 = (_arg2.sprite.y - _arg1.y);
return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4))));
}
}
}//package game.units
Section 116
//UnitCreator (game.units.UnitCreator)
package game.units {
import core.*;
import game.logic.*;
import game.*;
public class UnitCreator {
public static function enemySpeedBuildingMultiplier(_arg1:int, _arg2:int):Number{
switch (_arg2){
case 0:
if (_arg1 >= 6){
return (2);
};
if (_arg1 >= 10){
return (3);
};
break;
case 1:
return (3);
case 2:
if (_arg1 > 10){
return (5);
};
return (4);
};
return (1);
}
public static function enemySpecialTicksMultiplier(_arg1:int, _arg2:int):Number{
switch (_arg2){
case 0:
return (1);
case 1:
if (_arg1 > 8){
return (3);
};
return (2);
case 2:
if (_arg1 >= 11){
return (5);
};
if (_arg1 > 6){
return (4);
};
return (3);
};
return (1);
}
public static function enemyStormAttackChargeLevel(_arg1:int, _arg2:int):Number{
switch (_arg2){
case 0:
return (1);
case 1:
if (_arg1 >= 11){
return (3);
};
return (2);
case 2:
if (_arg1 > 10){
return (4);
};
return (3);
};
return (1);
}
private static function enemyArmorBoostLevel():int{
var _local1:Engine;
_local1 = Global.top.engine;
if (_local1.lastZone == 0){
if (_local1.lastLevelIndex >= 11){
return (4);
};
if (_local1.lastLevelIndex >= 5){
return (3);
};
if (_local1.lastLevelIndex > 1){
return (2);
};
} else {
if (_local1.lastZone == 1){
if (_local1.lastLevelIndex >= 10){
return (6);
};
if (_local1.lastLevelIndex >= 6){
return (5);
};
return (4);
} else {
if (_local1.lastLevelIndex >= 10){
return (7);
};
return (6);
};
};
return (1);
}
private static function enemyDroidFirepowerLevel():int{
var _local1:Engine;
_local1 = Global.top.engine;
if (_local1.lastZone == 0){
if (_local1.lastLevelIndex > 7){
return (3);
};
if (_local1.lastLevelIndex >= 6){
return (2);
};
if (_local1.lastLevelIndex > 0){
return (1);
};
} else {
if (_local1.lastZone == 1){
if (_local1.lastLevelIndex >= 5){
return (5);
};
return (4);
} else {
if (_local1.lastLevelIndex > 10){
return (8);
};
if (_local1.lastLevelIndex > 8){
return (7);
};
if (_local1.lastLevelIndex > 4){
return (6);
};
return (5);
};
};
return (1);
}
private static function enemyHumanFirepowerLevel():int{
var _local1:Engine;
_local1 = Global.top.engine;
if (_local1.lastZone == 0){
if (_local1.lastLevelIndex >= 7){
return (3);
};
if (_local1.lastLevelIndex == 6){
return (2);
};
if (_local1.lastLevelIndex > 0){
return (1);
};
} else {
if (1 == _local1.lastZone){
if (_local1.lastLevelIndex >= 5){
return (4);
};
return (3);
} else {
if (_local1.lastLevelIndex >= 11){
return (10);
};
if (_local1.lastLevelIndex >= 10){
return (8);
};
return (7);
};
};
return (0);
}
public static function create(_arg1:String, _arg2:Boolean, _arg3:Boolean=false):Unit{
var _local4:Unit;
var _local5:*;
var _local6:Weapon;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:Number;
_local4 = new Unit(_arg1, _arg2);
_local5 = null;
_local6 = new Weapon();
_local7 = Global.top.upgrades.humanFirepowerLevel();
_local8 = (Global.top.upgrades.droidFirepowerLevel() - 1);
_local9 = Global.top.upgrades.armorBoostLevel();
_local10 = enemyHumanFirepowerLevel();
_local11 = (enemyDroidFirepowerLevel() - 1);
_local12 = enemyArmorBoostLevel();
switch (_arg1){
case StringConsts.MARINE:
_local4.velocity = 1;
_local4.full_health = 50;
_local4.enemy_unit = _arg2;
_local4.sitting_ticks = 22;
_local6.eyerange = 300;
_local6.damage = 7;
_local6.likelihood = 0.25;
_local6.recharge_time = 22;
_local6.bullet_speed = 40;
_local4.setWeapon(_local6);
if (_arg2){
_local4.armor = (_local4.armor + _local12);
_local6.damage = (_local6.damage + (2 * _local10));
if (!_arg3){
_local5 = new RedMarine();
};
} else {
_local4.armor = (_local4.armor + _local9);
_local6.damage = (_local6.damage + (2 * _local7));
if (!_arg3){
_local5 = new BlueMarine();
};
};
_local4.setSprite(_local5);
break;
case StringConsts.MISSILE_MAN:
_local4.velocity = 1;
_local4.full_health = 80;
_local4.enemy_unit = _arg2;
_local4.sitting_ticks = 22;
_local6.eyerange = 400;
_local6.damage = 15;
_local6.likelihood = 0.25;
_local6.recharge_time = 50;
_local6.bullet_speed = 40;
_local4.setWeapon(_local6);
if (_arg2){
_local4.armor = (_local4.armor + _local12);
_local6.damage = (_local6.damage + (2 * _local10));
if (!_arg3){
_local5 = new RedMissileMan();
};
} else {
_local4.armor = (_local4.armor + _local9);
_local6.damage = (_local6.damage + (2 * _local7));
if (!_arg3){
_local5 = new BlueMissileMan();
};
};
_local4.setSprite(_local5);
break;
case StringConsts.SPECIALIST:
_local4.velocity = 0.6;
_local4.full_health = 64;
_local4.enemy_unit = _arg2;
_local4.armor = 3;
_local4.sitting_ticks = 22;
_local6.eyerange = 350;
_local6.damage = 24;
_local6.likelihood = 0.25;
_local6.recharge_time = 30;
_local6.bullet_speed = 50;
_local4.setWeapon(_local6);
if (_arg2){
_local4.armor = (_local4.armor + _local12);
_local6.damage = (_local6.damage + (2 * _local10));
if (!_arg3){
_local5 = new RedSpecialist();
};
} else {
_local4.armor = (_local4.armor + _local9);
_local6.damage = (_local6.damage + (2 * _local7));
if (!_arg3){
_local5 = new BlueSpecialist();
};
};
_local4.setSprite(_local5);
break;
case StringConsts.STORM_TANK:
_local4.velocity = 0.8;
_local4.full_health = 240;
_local4.enemy_unit = _arg2;
_local4.armor = 2;
_local6.eyerange = 325;
_local6.damage = 20;
_local6.likelihood = 0.75;
_local6.recharge_time = 48;
_local6.bullet_speed = 70;
_local4.setWeapon(_local6);
if (_arg2){
_local4.armor = (_local4.armor + _local12);
_local6.damage = (_local6.damage + (2 * _local11));
if (!_arg3){
_local5 = new RedStormTank();
};
} else {
_local4.armor = (_local4.armor + _local9);
_local6.damage = (_local6.damage + (2 * _local8));
if (!_arg3){
_local5 = new BlueStormTank();
};
};
_local4.setSprite(_local5);
break;
case StringConsts.MINER_DROID:
_local4.velocity = 0.6;
_local4.full_health = 100;
_local4.enemy_unit = _arg2;
_local4.armor = 1;
_local4.peaceful = true;
_local6.eyerange = 100;
_local6.damage = 200;
_local6.likelihood = 0.75;
_local6.recharge_time = 80;
_local6.bullet_speed = 190;
_local4.setWeapon(_local6);
if (_arg2){
_local4.armor = (_local4.armor + _local12);
_local6.damage = (_local6.damage + (2 * _local11));
if (!_arg3){
_local5 = new RedMinerDroid();
};
} else {
_local4.armor = (_local4.armor + _local9);
_local6.damage = (_local6.damage + (2 * _local8));
if (!_arg3){
_local5 = new BlueMinerDroid();
};
};
_local4.setSprite(_local5);
break;
case StringConsts.MINE:
_local4.velocity = 1;
_local4.full_health = 50;
_local4.enemy_unit = _arg2;
_local6.eyerange = 50;
_local6.damage = 250;
_local6.likelihood = 1;
_local6.recharge_time = 1;
_local6.bullet_speed = 1;
_local4.setWeapon(_local6);
if (_arg2){
if (!_arg3){
_local5 = new RedMine();
};
} else {
if (!_arg3){
_local5 = new BlueMine();
};
};
_local4.setSprite(_local5);
break;
case StringConsts.GRENADIER_DROID:
_local4.velocity = 0.75;
_local4.full_health = 250;
_local4.enemy_unit = _arg2;
_local4.armor = 2;
_local6.eyerange = 100;
_local6.damage = 500;
_local6.likelihood = 0.75;
_local6.recharge_time = 90;
_local6.bullet_speed = 190;
_local4.setWeapon(_local6);
if (_arg2){
_local4.armor = (_local4.armor + _local12);
_local6.damage = (_local6.damage + (2 * _local11));
if (!_arg3){
_local5 = new RedGrenadier();
};
} else {
_local4.armor = (_local4.armor + _local9);
_local6.damage = (_local6.damage + (2 * _local8));
if (!_arg3){
_local5 = new BlueGrenadier();
};
};
_local4.setSprite(_local5);
break;
case StringConsts.CATERPILLAR:
_local4.velocity = 0.34;
_local4.full_health = 500;
_local4.enemy_unit = _arg2;
_local4.armor = 4;
_local6.eyerange = 350;
_local6.damage = 75;
_local6.likelihood = 0.75;
_local6.recharge_time = 130;
_local6.bullet_speed = 190;
_local4.setWeapon(_local6);
if (_arg2){
_local4.armor = (_local4.armor + _local12);
_local6.damage = (_local6.damage + (2 * _local11));
if (!_arg3){
_local5 = new RedCaterpillar();
};
} else {
_local4.armor = (_local4.armor + _local9);
_local6.damage = (_local6.damage + (2 * _local8));
if (!_arg3){
_local5 = new BlueCaterpillar();
};
};
_local4.setSprite(_local5);
break;
case StringConsts.VULTURE:
_local4.velocity = 4.6;
_local4.full_health = 120;
_local4.enemy_unit = _arg2;
_local4.peaceful = true;
_local6.eyerange = 100;
_local6.damage = 0;
_local6.likelihood = 0;
_local4.setWeapon(_local6);
if (_arg2){
if (!_arg3){
_local5 = new RedVulture();
};
} else {
if (!_arg3){
_local5 = new BlueVulture();
};
};
_local4.setSprite(_local5);
break;
};
if (((!((_local4.type == StringConsts.GRENADIER_DROID))) && (!((_local4.type == StringConsts.MINE))))){
_local4.weapon.eyerange = (_local4.weapon.eyerange + (Math.random() * 55));
};
if (_local12 > 0){
_local4.armor = (_local4.armor + _local12);
};
return (_local4);
}
public static function getBullet(_arg1:String, _arg2:Boolean){
switch (_arg1){
case StringConsts.MARINE:
return (new MarineBullet());
case StringConsts.SPECIALIST:
return (new SFBullet());
case StringConsts.MISSILE_MAN:
return (new MMBullet());
case StringConsts.CATERPILLAR:
if (!_arg2){
return (new LaserBeam());
};
return (new RedLaserBeam());
case StringConsts.STORM_TANK:
return (new StormTankBullet());
};
return (new MarineBullet());
}
}
}//package game.units
Section 117
//Weapon (game.units.Weapon)
package game.units {
public class Weapon {
public var recharge_time:int;// = 0
public var bullet_speed:int;// = 0
public var eyerange:int;// = 0
public var likelihood:Number;// = 0
public var damage:int;// = 0
public function Weapon():void{
eyerange = 0;
damage = 0;
likelihood = 0;
recharge_time = 0;
bullet_speed = 0;
super();
}
public function copyProperties(_arg1:Weapon):void{
eyerange = _arg1.eyerange;
damage = _arg1.damage;
recharge_time = _arg1.recharge_time;
bullet_speed = _arg1.bullet_speed;
}
}
}//package game.units
Section 118
//Consts (game.Consts)
package game {
public class Consts {
public static const ScreenHeight:int = 525;
public static const NUCLEAR_DAMAGE:Number = 3000;
public static const ScreenWidth:int = 700;
public static const ARTILLERY_RANGE:Number = 35;
public static const ARTILLERY_DAMAGE:Number = 1000;
}
}//package game
Section 119
//SoundConsts (game.SoundConsts)
package game {
public final class SoundConsts {
public static var hit3:int = 15;
public static var vulture:int = 9;
public static var pause:int = 5;
public static var click:int = 4;
public static var victory:int = 0;
public static var hit:int = 14;
public static var explosion:int = 12;
public static var specialist_attack:int = 18;
public static var caterpillar_death:int = 21;
public static var camera:int = 2;
public static var final_attack:int = 27;
public static var defeat:int = 1;
public static var marine_death:int = 22;
public static var mm_shot:int = 17;
public static var victory_sound:int = 28;
public static var nuclear_counting:int = 30;
public static var caterpillar_hit:int = 11;
public static var explosion1:int = 13;
public static var doors_open:int = 3;
public static var stun:int = 31;
public static var artillery_strike:int = 10;
public static var door_reach:int = 32;
public static var marine_shot:int = 16;
public static var storm_tank_shot:int = 20;
public static var storm_attack:int = 19;
public static var mine_set:int = 8;
public static var marine_death_expl:int = 23;
public static var menu_appear:int = 7;
public static var unpause:int = 6;
public static var hit1:int = 29;
}
}//package game
Section 120
//StringConsts (game.StringConsts)
package game {
public class StringConsts {
public static const MISSILE_MAN:String = "Missile Man";
public static const MARINE:String = "Marine";
public static const GRENADIER_DROID:String = "Grenadier Droid";
public static const PHONETIC_ALPHABET:Array = ["ALPHA", "BRAVO", "CHARLIE", "DELTA", "ECHO", "FOXTROT", "GOLF", "HOTEL", "INDIA", "JULIET", "KILO", "LIMA", "MIKE", "NOVEMBER", "OSCAR", "PAPA", "QUEBEC", "ROMEO", "SIERRA", "TANGO", "UNIFORM", "VICTOR", "WHISKY", "X-RAY", "YANKEE", "ZULU"];
public static const CATERPILLAR:String = "Caterpillar";
public static const MINE:String = "Mine";
public static const NUCLEAR_MISSILE:String = "Nuclear Missile";
public static const WALKING:String = "walking";
public static const STORM_TANK:String = "Storm Tank";
public static const VULTURE:String = "Vulture";
public static const ARTILLERY_STRIKE:String = "Artillery Strike";
public static const FORCE_FIELD:String = "Force Field";
public static const SPECIALIST:String = "Specialist";
public static const EMPTY:String = "";
public static const MINER_DROID:String = "Miner Droid";
}
}//package game
Section 121
//Acturus_251 (mw_fla.Acturus_251)
package mw_fla {
import flash.display.*;
public dynamic class Acturus_251 extends MovieClip {
public var button_three:MovieClip;
public var button_two:MovieClip;
public var button_one:MovieClip;
}
}//package mw_fla
Section 122
//Acturus_a_252 (mw_fla.Acturus_a_252)
package mw_fla {
import flash.display.*;
public dynamic class Acturus_a_252 extends MovieClip {
public function Acturus_a_252(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 123
//Acturus_b_254 (mw_fla.Acturus_b_254)
package mw_fla {
import flash.display.*;
public dynamic class Acturus_b_254 extends MovieClip {
public function Acturus_b_254(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 124
//Acturus_c_256 (mw_fla.Acturus_c_256)
package mw_fla {
import flash.display.*;
public dynamic class Acturus_c_256 extends MovieClip {
public function Acturus_c_256(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 125
//AllPanels_306 (mw_fla.AllPanels_306)
package mw_fla {
import flash.display.*;
public dynamic class AllPanels_306 extends MovieClip {
public var planet_panel2:MovieClip;
public var planet_panel3:MovieClip;
public var planet_panel5:MovieClip;
public var planet_panel8:MovieClip;
public var planet_panel9:MovieClip;
public var planet_panel4:MovieClip;
public var planet_panel1:MovieClip;
public var planet_panel6:MovieClip;
public var planet_panel10:MovieClip;
public var planet_panel11:MovieClip;
public var planet_panel7:MovieClip;
public var planet_panel12:MovieClip;
}
}//package mw_fla
Section 126
//Arcad_265 (mw_fla.Arcad_265)
package mw_fla {
import flash.display.*;
public dynamic class Arcad_265 extends MovieClip {
public var button_three:MovieClip;
public var button_two:MovieClip;
public var button_one:MovieClip;
}
}//package mw_fla
Section 127
//Arcad_a_266 (mw_fla.Arcad_a_266)
package mw_fla {
import flash.display.*;
public dynamic class Arcad_a_266 extends MovieClip {
public function Arcad_a_266(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 128
//Arcad_b_268 (mw_fla.Arcad_b_268)
package mw_fla {
import flash.display.*;
public dynamic class Arcad_b_268 extends MovieClip {
public function Arcad_b_268(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 129
//Arcad_c_270 (mw_fla.Arcad_c_270)
package mw_fla {
import flash.display.*;
public dynamic class Arcad_c_270 extends MovieClip {
public function Arcad_c_270(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 130
//Ariola_223 (mw_fla.Ariola_223)
package mw_fla {
import flash.display.*;
public dynamic class Ariola_223 extends MovieClip {
public var button_three:MovieClip;
public var button_two:MovieClip;
public var button_one:MovieClip;
}
}//package mw_fla
Section 131
//Ariola_a_224 (mw_fla.Ariola_a_224)
package mw_fla {
import flash.display.*;
public dynamic class Ariola_a_224 extends MovieClip {
public function Ariola_a_224(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 132
//Ariola_b_226 (mw_fla.Ariola_b_226)
package mw_fla {
import flash.display.*;
public dynamic class Ariola_b_226 extends MovieClip {
public function Ariola_b_226(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 133
//Ariola_c_228 (mw_fla.Ariola_c_228)
package mw_fla {
import flash.display.*;
public dynamic class Ariola_c_228 extends MovieClip {
public function Ariola_c_228(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 134
//Betazedd_272 (mw_fla.Betazedd_272)
package mw_fla {
import flash.display.*;
public dynamic class Betazedd_272 extends MovieClip {
public var button_three:MovieClip;
public var button_two:MovieClip;
public var button_one:MovieClip;
}
}//package mw_fla
Section 135
//Betazedd_a_273 (mw_fla.Betazedd_a_273)
package mw_fla {
import flash.display.*;
public dynamic class Betazedd_a_273 extends MovieClip {
public function Betazedd_a_273(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 136
//Betazedd_b_275 (mw_fla.Betazedd_b_275)
package mw_fla {
import flash.display.*;
public dynamic class Betazedd_b_275 extends MovieClip {
public function Betazedd_b_275(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 137
//Betazedd_c_277 (mw_fla.Betazedd_c_277)
package mw_fla {
import flash.display.*;
public dynamic class Betazedd_c_277 extends MovieClip {
public function Betazedd_c_277(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 138
//BlueMinerIcon_126 (mw_fla.BlueMinerIcon_126)
package mw_fla {
import flash.display.*;
public dynamic class BlueMinerIcon_126 extends MovieClip {
public var fbHead:MovieClip;
}
}//package mw_fla
Section 139
//BlueShipIcon_197 (mw_fla.BlueShipIcon_197)
package mw_fla {
import flash.display.*;
public dynamic class BlueShipIcon_197 extends MovieClip {
public function BlueShipIcon_197(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 140
//Bluestormtankattackcanon_451 (mw_fla.Bluestormtankattackcanon_451)
package mw_fla {
import flash.display.*;
public dynamic class Bluestormtankattackcanon_451 extends MovieClip {
public function Bluestormtankattackcanon_451(){
addFrameScript(0, frame1, 20, frame21);
}
function frame1(){
stop();
}
function frame21(){
stop();
}
}
}//package mw_fla
Section 141
//Bluevtolgoingup_445 (mw_fla.Bluevtolgoingup_445)
package mw_fla {
import flash.display.*;
public dynamic class Bluevtolgoingup_445 extends MovieClip {
public function Bluevtolgoingup_445(){
addFrameScript(35, frame36);
}
function frame36(){
stop();
}
}
}//package mw_fla
Section 142
//Bluevtollanding_443 (mw_fla.Bluevtollanding_443)
package mw_fla {
import flash.display.*;
public dynamic class Bluevtollanding_443 extends MovieClip {
public function Bluevtollanding_443(){
addFrameScript(0, frame1, 36, frame37);
}
function frame1(){
stop();
}
function frame37(){
stop();
}
}
}//package mw_fla
Section 143
//BuildButtons_193 (mw_fla.BuildButtons_193)
package mw_fla {
import flash.display.*;
import flash.text.*;
public dynamic class BuildButtons_193 extends MovieClip {
public var screen_txt:TextField;
public var button1:MovieClip;
public var button3:MovieClip;
public var button2:MovieClip;
public var button4:MovieClip;
public var special_button1:MovieClip;
public var special_button2:MovieClip;
public var special_button3:MovieClip;
}
}//package mw_fla
Section 144
//Caterpilarshooting_359 (mw_fla.Caterpilarshooting_359)
package mw_fla {
import flash.display.*;
public dynamic class Caterpilarshooting_359 extends MovieClip {
public function Caterpilarshooting_359(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package mw_fla
Section 145
//Caterpilarshooting_365 (mw_fla.Caterpilarshooting_365)
package mw_fla {
import flash.display.*;
public dynamic class Caterpilarshooting_365 extends MovieClip {
public function Caterpilarshooting_365(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package mw_fla
Section 146
//Deathbybullet_382 (mw_fla.Deathbybullet_382)
package mw_fla {
import flash.display.*;
public dynamic class Deathbybullet_382 extends MovieClip {
public function Deathbybullet_382(){
addFrameScript(79, frame80, 110, frame111);
}
function frame80(){
stop();
}
function frame111(){
stop();
}
}
}//package mw_fla
Section 147
//Deathbybulletmm_424 (mw_fla.Deathbybulletmm_424)
package mw_fla {
import flash.display.*;
public dynamic class Deathbybulletmm_424 extends MovieClip {
public function Deathbybulletmm_424(){
addFrameScript(79, frame80, 111, frame112);
}
function frame80(){
stop();
}
function frame112(){
stop();
}
}
}//package mw_fla
Section 148
//Deathbybulletmmred_438 (mw_fla.Deathbybulletmmred_438)
package mw_fla {
import flash.display.*;
public dynamic class Deathbybulletmmred_438 extends MovieClip {
public function Deathbybulletmmred_438(){
addFrameScript(79, frame80, 110, frame111);
}
function frame80(){
stop();
}
function frame111(){
stop();
}
}
}//package mw_fla
Section 149
//Deathbybulletred_400 (mw_fla.Deathbybulletred_400)
package mw_fla {
import flash.display.*;
public dynamic class Deathbybulletred_400 extends MovieClip {
public function Deathbybulletred_400(){
addFrameScript(79, frame80, 111, frame112);
}
function frame80(){
stop();
}
function frame112(){
stop();
}
}
}//package mw_fla
Section 150
//DeathbybulletSF_467 (mw_fla.DeathbybulletSF_467)
package mw_fla {
import flash.display.*;
public dynamic class DeathbybulletSF_467 extends MovieClip {
public function DeathbybulletSF_467(){
addFrameScript(79, frame80, 110, frame111);
}
function frame80(){
stop();
}
function frame111(){
stop();
}
}
}//package mw_fla
Section 151
//DeathbybulletSF_481 (mw_fla.DeathbybulletSF_481)
package mw_fla {
import flash.display.*;
public dynamic class DeathbybulletSF_481 extends MovieClip {
public function DeathbybulletSF_481(){
addFrameScript(79, frame80, 110, frame111);
}
function frame80(){
stop();
}
function frame111(){
stop();
}
}
}//package mw_fla
Section 152
//Deathbytank_385 (mw_fla.Deathbytank_385)
package mw_fla {
import flash.display.*;
public dynamic class Deathbytank_385 extends MovieClip {
public function Deathbytank_385(){
addFrameScript(93, frame94, 125, frame126);
}
function frame94(){
stop();
}
function frame126(){
stop();
}
}
}//package mw_fla
Section 153
//Deathbytank_402 (mw_fla.Deathbytank_402)
package mw_fla {
import flash.display.*;
public dynamic class Deathbytank_402 extends MovieClip {
public function Deathbytank_402(){
addFrameScript(93, frame94, 125, frame126);
}
function frame94(){
stop();
}
function frame126(){
stop();
}
}
}//package mw_fla
Section 154
//Deathbytank_426 (mw_fla.Deathbytank_426)
package mw_fla {
import flash.display.*;
public dynamic class Deathbytank_426 extends MovieClip {
public function Deathbytank_426(){
addFrameScript(93, frame94, 125, frame126);
}
function frame94(){
stop();
}
function frame126(){
stop();
}
}
}//package mw_fla
Section 155
//Deathbytank_440 (mw_fla.Deathbytank_440)
package mw_fla {
import flash.display.*;
public dynamic class Deathbytank_440 extends MovieClip {
public function Deathbytank_440(){
addFrameScript(93, frame94, 125, frame126);
}
function frame94(){
stop();
}
function frame126(){
stop();
}
}
}//package mw_fla
Section 156
//Deathbytank_469 (mw_fla.Deathbytank_469)
package mw_fla {
import flash.display.*;
public dynamic class Deathbytank_469 extends MovieClip {
public function Deathbytank_469(){
addFrameScript(93, frame94, 125, frame126);
}
function frame94(){
stop();
}
function frame126(){
stop();
}
}
}//package mw_fla
Section 157
//Deathbytank_483 (mw_fla.Deathbytank_483)
package mw_fla {
import flash.display.*;
public dynamic class Deathbytank_483 extends MovieClip {
public function Deathbytank_483(){
addFrameScript(93, frame94, 125, frame126);
}
function frame94(){
stop();
}
function frame126(){
stop();
}
}
}//package mw_fla
Section 158
//DustEffect_444 (mw_fla.DustEffect_444)
package mw_fla {
import flash.display.*;
public dynamic class DustEffect_444 extends MovieClip {
public function DustEffect_444(){
addFrameScript(34, frame35);
}
function frame35(){
stop();
}
}
}//package mw_fla
Section 159
//EquipmentSlot_172 (mw_fla.EquipmentSlot_172)
package mw_fla {
import flash.display.*;
public dynamic class EquipmentSlot_172 extends MovieClip {
public var slot_frame:SlotFrame;
}
}//package mw_fla
Section 160
//fb_head_mc_127 (mw_fla.fb_head_mc_127)
package mw_fla {
import flash.display.*;
public dynamic class fb_head_mc_127 extends MovieClip {
public function fb_head_mc_127(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 161
//fb_head_mc_130 (mw_fla.fb_head_mc_130)
package mw_fla {
import flash.display.*;
public dynamic class fb_head_mc_130 extends MovieClip {
public function fb_head_mc_130(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 162
//fb_head_mc_169 (mw_fla.fb_head_mc_169)
package mw_fla {
import flash.display.*;
public dynamic class fb_head_mc_169 extends MovieClip {
public function fb_head_mc_169(){
addFrameScript(0, frame1, 12, frame13, 22, frame23);
}
function frame1(){
stop();
}
function frame13(){
stop();
}
function frame23(){
gotoAndStop("turnhead_stop");
}
}
}//package mw_fla
Section 163
//flag_button_base_304 (mw_fla.flag_button_base_304)
package mw_fla {
import flash.display.*;
public dynamic class flag_button_base_304 extends MovieClip {
public function flag_button_base_304(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package mw_fla
Section 164
//flongabot_167 (mw_fla.flongabot_167)
package mw_fla {
import flash.display.*;
public dynamic class flongabot_167 extends MovieClip {
public var fbHead:MovieClip;
public function flongabot_167(){
addFrameScript(0, frame1, 75, frame76, 88, frame89, 99, frame100);
}
public function doEndFly(){
this.gotoAndPlay("flying_end");
}
function frame76(){
gotoAndPlay("normal");
}
function frame89(){
gotoAndPlay("flying");
}
public function doNormal(){
this.gotoAndPlay("normal");
}
function frame1(){
}
function frame100(){
gotoAndPlay("normal");
}
public function doTurnhead(){
this.fbHead.gotoAndPlay("turnhead");
}
public function doNormalHead(){
this.fbHead.gotoAndPlay("normal");
}
public function doWink(){
this.fbHead.gotoAndPlay("wink_start");
}
public function doFly(){
this.gotoAndPlay("flying_start");
}
}
}//package mw_fla
Section 165
//flongabot_492 (mw_fla.flongabot_492)
package mw_fla {
import flash.display.*;
public dynamic class flongabot_492 extends MovieClip {
public var fbHead:MovieClip;
public function flongabot_492(){
addFrameScript(0, frame1, 75, frame76, 88, frame89, 99, frame100);
}
public function doEndFly(){
this.gotoAndPlay("flying_end");
}
function frame76(){
gotoAndPlay("normal");
}
function frame89(){
gotoAndPlay("flying");
}
public function doNormal(){
this.gotoAndPlay("normal");
}
function frame1(){
}
function frame100(){
gotoAndPlay("normal");
}
public function doTurnhead(){
this.fbHead.gotoAndPlay("turnhead");
}
public function doNormalHead(){
this.fbHead.gotoAndPlay("normal");
}
public function doWink(){
this.fbHead.gotoAndPlay("wink_start");
}
public function doFly(){
this.gotoAndPlay("flying_start");
}
}
}//package mw_fla
Section 166
//FlongaIntro_490 (mw_fla.FlongaIntro_490)
package mw_fla {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.text.*;
import flash.ui.*;
import flash.system.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class FlongaIntro_490 extends MovieClip {
public var inner:MovieClip;
public var flobot:MovieClip;
public function FlongaIntro_490(){
addFrameScript(0, frame1, 29, frame30, 62, frame63, 72, frame73, 92, frame93, 200, frame201, 299, frame300);
}
function frame73(){
flobot.doTurnhead();
}
function frame201(){
flobot.doWink();
}
function frame93(){
flobot.doWink();
}
function frame1(){
}
function frame30(){
flobot.doFly();
}
function frame300(){
stop();
GameStage.itself.flongaFinished();
}
function frame63(){
flobot.doEndFly();
}
}
}//package mw_fla
Section 167
//GameMenu_192 (mw_fla.GameMenu_192)
package mw_fla {
import flash.display.*;
import game.ui.*;
import flash.text.*;
public dynamic class GameMenu_192 extends MovieClip {
public var blue_ship_icon:MovieClip;
public var storm_label:MovieClip;
public var player_buttons:MovieClip;
public var balance_bar:BalanceBar;
public var ai_buttons:MovieClip;
public var red_ship_icon:MovieClip;
public var message_box:TextField;
public var storm_bar:StormBar;
public var enemy_storm_bar:StormBar;
public var enemy_storm_label:MovieClip;
}
}//package mw_fla
Section 168
//Grazerit_279 (mw_fla.Grazerit_279)
package mw_fla {
import flash.display.*;
public dynamic class Grazerit_279 extends MovieClip {
public var button_three:MovieClip;
public var button_two:MovieClip;
public var button_one:MovieClip;
}
}//package mw_fla
Section 169
//Grazerit_a_280 (mw_fla.Grazerit_a_280)
package mw_fla {
import flash.display.*;
public dynamic class Grazerit_a_280 extends MovieClip {
public function Grazerit_a_280(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 170
//Grazerit_b_282 (mw_fla.Grazerit_b_282)
package mw_fla {
import flash.display.*;
public dynamic class Grazerit_b_282 extends MovieClip {
public function Grazerit_b_282(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 171
//Grazerit_c_284 (mw_fla.Grazerit_c_284)
package mw_fla {
import flash.display.*;
public dynamic class Grazerit_c_284 extends MovieClip {
public function Grazerit_c_284(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 172
//HatchArrows_57 (mw_fla.HatchArrows_57)
package mw_fla {
import flash.display.*;
public dynamic class HatchArrows_57 extends MovieClip {
public function HatchArrows_57(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 173
//Kasheta_230 (mw_fla.Kasheta_230)
package mw_fla {
import flash.display.*;
public dynamic class Kasheta_230 extends MovieClip {
public var button_three:MovieClip;
public var button_two:MovieClip;
public var button_one:MovieClip;
}
}//package mw_fla
Section 174
//Kasheta_a_231 (mw_fla.Kasheta_a_231)
package mw_fla {
import flash.display.*;
public dynamic class Kasheta_a_231 extends MovieClip {
public function Kasheta_a_231(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 175
//Kasheta_b_233 (mw_fla.Kasheta_b_233)
package mw_fla {
import flash.display.*;
public dynamic class Kasheta_b_233 extends MovieClip {
public function Kasheta_b_233(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 176
//Kasheta_c_235 (mw_fla.Kasheta_c_235)
package mw_fla {
import flash.display.*;
public dynamic class Kasheta_c_235 extends MovieClip {
public function Kasheta_c_235(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 177
//Kespryt_297 (mw_fla.Kespryt_297)
package mw_fla {
import flash.display.*;
public dynamic class Kespryt_297 extends MovieClip {
public var button_three:MovieClip;
public var button_two:MovieClip;
public var button_one:MovieClip;
}
}//package mw_fla
Section 178
//Kespryt_a_298 (mw_fla.Kespryt_a_298)
package mw_fla {
import flash.display.*;
public dynamic class Kespryt_a_298 extends MovieClip {
public function Kespryt_a_298(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 179
//Kespryt_b_300 (mw_fla.Kespryt_b_300)
package mw_fla {
import flash.display.*;
public dynamic class Kespryt_b_300 extends MovieClip {
public function Kespryt_b_300(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 180
//Kespryt_c_302 (mw_fla.Kespryt_c_302)
package mw_fla {
import flash.display.*;
public dynamic class Kespryt_c_302 extends MovieClip {
public function Kespryt_c_302(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 181
//LevelBack1_51 (mw_fla.LevelBack1_51)
package mw_fla {
import flash.display.*;
public dynamic class LevelBack1_51 extends MovieClip {
public function LevelBack1_51(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 182
//LevelClosedMessageMC_175 (mw_fla.LevelClosedMessageMC_175)
package mw_fla {
import flash.display.*;
import flash.text.*;
public dynamic class LevelClosedMessageMC_175 extends MovieClip {
public var msg:TextField;
public function LevelClosedMessageMC_175(){
addFrameScript(0, frame1, 69, frame70);
}
function frame70(){
visible = false;
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 183
//MarineBigBlood_386 (mw_fla.MarineBigBlood_386)
package mw_fla {
import flash.display.*;
public dynamic class MarineBigBlood_386 extends MovieClip {
public function MarineBigBlood_386(){
addFrameScript(93, frame94);
}
function frame94(){
stop();
}
}
}//package mw_fla
Section 184
//MarineSmallBlood_383 (mw_fla.MarineSmallBlood_383)
package mw_fla {
import flash.display.*;
public dynamic class MarineSmallBlood_383 extends MovieClip {
public function MarineSmallBlood_383(){
addFrameScript(56, frame57);
}
function frame57(){
stop();
}
}
}//package mw_fla
Section 185
//Movingandplacingminesred_408 (mw_fla.Movingandplacingminesred_408)
package mw_fla {
import flash.display.*;
public dynamic class Movingandplacingminesred_408 extends MovieClip {
public var fbHead:MovieClip;
public function Movingandplacingminesred_408(){
addFrameScript(15, frame16);
}
function frame16(){
stop();
}
}
}//package mw_fla
Section 186
//Movingandplacingminesred_413 (mw_fla.Movingandplacingminesred_413)
package mw_fla {
import flash.display.*;
public dynamic class Movingandplacingminesred_413 extends MovieClip {
public var fbHead:MovieClip;
}
}//package mw_fla
Section 187
//Movingred_407 (mw_fla.Movingred_407)
package mw_fla {
import flash.display.*;
public dynamic class Movingred_407 extends MovieClip {
public var fbHead:MovieClip;
}
}//package mw_fla
Section 188
//Movingred_412 (mw_fla.Movingred_412)
package mw_fla {
import flash.display.*;
public dynamic class Movingred_412 extends MovieClip {
public var fbHead:MovieClip;
}
}//package mw_fla
Section 189
//OptionsDialog_315 (mw_fla.OptionsDialog_315)
package mw_fla {
import flash.display.*;
import game.ui.controls.*;
public dynamic class OptionsDialog_315 extends MovieClip {
public var music_on_button:SimpleButton;
public var auto_send_on_button:SimpleButton;
public var sound_control:SoundControlMC;
public var music_off_button:SimpleButton;
public var close_button:CloseButton;
public var medium_quality_button:SimpleButton;
public var resume_button:SimpleButton;
public var auto_send_off_button:SimpleButton;
public var high_quality_button:SimpleButton;
public var main_menu_button:MainMenuButton;
public var low_quality_button:SimpleButton;
public var reset_saved_button:SimpleButton;
}
}//package mw_fla
Section 190
//PauseMC_204 (mw_fla.PauseMC_204)
package mw_fla {
import flash.display.*;
public dynamic class PauseMC_204 extends MovieClip {
public function PauseMC_204(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package mw_fla
Section 191
//PlanetInfoSinglePanel_308 (mw_fla.PlanetInfoSinglePanel_308)
package mw_fla {
import flash.display.*;
import flash.text.*;
public dynamic class PlanetInfoSinglePanel_308 extends MovieClip {
public var attack_button:SimpleButton;
public var dif_txt:TextField;
public var treasure_txt:TextField;
}
}//package mw_fla
Section 192
//PreloadingStuff_13 (mw_fla.PreloadingStuff_13)
package mw_fla {
import flash.display.*;
public dynamic class PreloadingStuff_13 extends MovieClip {
public function PreloadingStuff_13(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 193
//Redminedroidexplotion_42 (mw_fla.Redminedroidexplotion_42)
package mw_fla {
import flash.display.*;
public dynamic class Redminedroidexplotion_42 extends MovieClip {
public function Redminedroidexplotion_42(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package mw_fla
Section 194
//RedMinerIcon_129 (mw_fla.RedMinerIcon_129)
package mw_fla {
import flash.display.*;
public dynamic class RedMinerIcon_129 extends MovieClip {
public var fbHead:MovieClip;
}
}//package mw_fla
Section 195
//RedShipIcon_198 (mw_fla.RedShipIcon_198)
package mw_fla {
import flash.display.*;
public dynamic class RedShipIcon_198 extends MovieClip {
public function RedShipIcon_198(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 196
//Redstormtankattack_455 (mw_fla.Redstormtankattack_455)
package mw_fla {
import flash.display.*;
public dynamic class Redstormtankattack_455 extends MovieClip {
public function Redstormtankattack_455(){
addFrameScript(0, frame1, 20, frame21);
}
function frame1(){
stop();
}
function frame21(){
stop();
}
}
}//package mw_fla
Section 197
//Redvtolgoingup_448 (mw_fla.Redvtolgoingup_448)
package mw_fla {
import flash.display.*;
public dynamic class Redvtolgoingup_448 extends MovieClip {
public function Redvtolgoingup_448(){
addFrameScript(35, frame36);
}
function frame36(){
stop();
}
}
}//package mw_fla
Section 198
//Redvtollanding_447 (mw_fla.Redvtollanding_447)
package mw_fla {
import flash.display.*;
public dynamic class Redvtollanding_447 extends MovieClip {
public function Redvtollanding_447(){
addFrameScript(0, frame1, 36, frame37);
}
function frame1(){
stop();
}
function frame37(){
stop();
}
}
}//package mw_fla
Section 199
//Rhandaran_237 (mw_fla.Rhandaran_237)
package mw_fla {
import flash.display.*;
public dynamic class Rhandaran_237 extends MovieClip {
public var button_three:MovieClip;
public var button_two:MovieClip;
public var button_one:MovieClip;
}
}//package mw_fla
Section 200
//Rhandaran_a_238 (mw_fla.Rhandaran_a_238)
package mw_fla {
import flash.display.*;
public dynamic class Rhandaran_a_238 extends MovieClip {
public function Rhandaran_a_238(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 201
//Rhandaran_b_240 (mw_fla.Rhandaran_b_240)
package mw_fla {
import flash.display.*;
public dynamic class Rhandaran_b_240 extends MovieClip {
public function Rhandaran_b_240(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 202
//Rhandaran_c_242 (mw_fla.Rhandaran_c_242)
package mw_fla {
import flash.display.*;
public dynamic class Rhandaran_c_242 extends MovieClip {
public function Rhandaran_c_242(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 203
//RoadHolder_55 (mw_fla.RoadHolder_55)
package mw_fla {
import flash.display.*;
public dynamic class RoadHolder_55 extends MovieClip {
public var front_layer:MovieClip;
public var back_layer:MovieClip;
}
}//package mw_fla
Section 204
//Screenshots_1 (mw_fla.Screenshots_1)
package mw_fla {
import flash.display.*;
public dynamic class Screenshots_1 extends MovieClip {
public function Screenshots_1(){
addFrameScript(342, frame343);
}
function frame343(){
gotoAndPlay(32);
}
}
}//package mw_fla
Section 205
//Shooting_379 (mw_fla.Shooting_379)
package mw_fla {
import flash.display.*;
public dynamic class Shooting_379 extends MovieClip {
public var shooting_inner:MovieClip;
public function Shooting_379(){
addFrameScript(20, frame21);
}
function frame21(){
stop();
}
}
}//package mw_fla
Section 206
//Shootingaction_380 (mw_fla.Shootingaction_380)
package mw_fla {
import flash.display.*;
public dynamic class Shootingaction_380 extends MovieClip {
public function Shootingaction_380(){
addFrameScript(0, frame1, 14, frame15);
}
function frame15(){
stop();
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 207
//Shootingactionred_398 (mw_fla.Shootingactionred_398)
package mw_fla {
import flash.display.*;
public dynamic class Shootingactionred_398 extends MovieClip {
public function Shootingactionred_398(){
addFrameScript(0, frame1, 14, frame15);
}
function frame15(){
stop();
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 208
//ShootingactionSF_464 (mw_fla.ShootingactionSF_464)
package mw_fla {
import flash.display.*;
public dynamic class ShootingactionSF_464 extends MovieClip {
public function ShootingactionSF_464(){
addFrameScript(8, frame9);
}
function frame9(){
stop();
}
}
}//package mw_fla
Section 209
//ShootingactionSFred_478 (mw_fla.ShootingactionSFred_478)
package mw_fla {
import flash.display.*;
public dynamic class ShootingactionSFred_478 extends MovieClip {
public function ShootingactionSFred_478(){
addFrameScript(8, frame9);
}
function frame9(){
stop();
}
}
}//package mw_fla
Section 210
//ShootingactionwhitRL_421 (mw_fla.ShootingactionwhitRL_421)
package mw_fla {
import flash.display.*;
public dynamic class ShootingactionwhitRL_421 extends MovieClip {
public function ShootingactionwhitRL_421(){
addFrameScript(12, frame13);
}
function frame13(){
stop();
}
}
}//package mw_fla
Section 211
//ShootingactionwhitRL_435 (mw_fla.ShootingactionwhitRL_435)
package mw_fla {
import flash.display.*;
public dynamic class ShootingactionwhitRL_435 extends MovieClip {
public function ShootingactionwhitRL_435(){
addFrameScript(12, frame13);
}
function frame13(){
stop();
}
}
}//package mw_fla
Section 212
//Shootingmm_420 (mw_fla.Shootingmm_420)
package mw_fla {
import flash.display.*;
public dynamic class Shootingmm_420 extends MovieClip {
public var shooting_inner:MovieClip;
public function Shootingmm_420(){
addFrameScript(20, frame21);
}
function frame21(){
stop();
}
}
}//package mw_fla
Section 213
//Shootingmmred_434 (mw_fla.Shootingmmred_434)
package mw_fla {
import flash.display.*;
public dynamic class Shootingmmred_434 extends MovieClip {
public var shooting_inner:MovieClip;
public function Shootingmmred_434(){
addFrameScript(20, frame21);
}
function frame21(){
stop();
}
}
}//package mw_fla
Section 214
//Shootingred_397 (mw_fla.Shootingred_397)
package mw_fla {
import flash.display.*;
public dynamic class Shootingred_397 extends MovieClip {
public var shooting_inner:MovieClip;
public function Shootingred_397(){
addFrameScript(20, frame21);
}
function frame21(){
stop();
}
}
}//package mw_fla
Section 215
//ShootingSF_463 (mw_fla.ShootingSF_463)
package mw_fla {
import flash.display.*;
public dynamic class ShootingSF_463 extends MovieClip {
public var shooting_inner:MovieClip;
public function ShootingSF_463(){
addFrameScript(20, frame21);
}
function frame21(){
stop();
}
}
}//package mw_fla
Section 216
//ShootingSFred_477 (mw_fla.ShootingSFred_477)
package mw_fla {
import flash.display.*;
public dynamic class ShootingSFred_477 extends MovieClip {
public var shooting_inner:MovieClip;
public function ShootingSFred_477(){
addFrameScript(20, frame21);
}
function frame21(){
stop();
}
}
}//package mw_fla
Section 217
//SinglePlanetZones_307 (mw_fla.SinglePlanetZones_307)
package mw_fla {
import flash.display.*;
public dynamic class SinglePlanetZones_307 extends MovieClip {
public var zone1:MovieClip;
public var zone2:MovieClip;
public var zone3:MovieClip;
}
}//package mw_fla
Section 218
//SoundStubs_485 (mw_fla.SoundStubs_485)
package mw_fla {
import flash.display.*;
public dynamic class SoundStubs_485 extends MovieClip {
public function SoundStubs_485(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 219
//SpecialTarget_60 (mw_fla.SpecialTarget_60)
package mw_fla {
import flash.display.*;
public dynamic class SpecialTarget_60 extends MovieClip {
public var target_circle:MovieClip;
public function SpecialTarget_60(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 220
//StatCaption_327 (mw_fla.StatCaption_327)
package mw_fla {
import flash.display.*;
public dynamic class StatCaption_327 extends MovieClip {
public var innerc:MovieClip;
}
}//package mw_fla
Section 221
//StatCaptionInner_328 (mw_fla.StatCaptionInner_328)
package mw_fla {
import flash.display.*;
import flash.text.*;
public dynamic class StatCaptionInner_328 extends MovieClip {
public var stat_title:TextField;
}
}//package mw_fla
Section 222
//StormHatchArrows_142 (mw_fla.StormHatchArrows_142)
package mw_fla {
import flash.display.*;
public dynamic class StormHatchArrows_142 extends MovieClip {
public var hatch_arrow3:MovieClip;
public var hatch_arrow5:MovieClip;
public var hatch_arrow1:MovieClip;
public var hatch_arrow4:MovieClip;
public var hatch_arrow2:MovieClip;
public function StormHatchArrows_142(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
hatch_arrow1.gotoAndStop(1);
hatch_arrow2.gotoAndStop(2);
hatch_arrow3.gotoAndStop(3);
hatch_arrow4.gotoAndStop(4);
hatch_arrow5.gotoAndStop(5);
}
}
}//package mw_fla
Section 223
//StormMessage_199 (mw_fla.StormMessage_199)
package mw_fla {
import flash.display.*;
public dynamic class StormMessage_199 extends MovieClip {
public function StormMessage_199(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 224
//UnitButton_194 (mw_fla.UnitButton_194)
package mw_fla {
import flash.display.*;
public dynamic class UnitButton_194 extends MovieClip {
public var unit_icon:MovieClip;
public var filling:MovieClip;
}
}//package mw_fla
Section 225
//UnitIcon_62 (mw_fla.UnitIcon_62)
package mw_fla {
import flash.display.*;
public dynamic class UnitIcon_62 extends MovieClip {
public var button_back:MovieClip;
public function UnitIcon_62(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 226
//UnitIconBack_63 (mw_fla.UnitIconBack_63)
package mw_fla {
import flash.display.*;
public dynamic class UnitIconBack_63 extends MovieClip {
public function UnitIconBack_63(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 227
//UnitLayerHolder_54 (mw_fla.UnitLayerHolder_54)
package mw_fla {
import flash.display.*;
public dynamic class UnitLayerHolder_54 extends MovieClip {
public var road2:MovieClip;
public var road3:MovieClip;
public var road4:MovieClip;
public var road5:MovieClip;
public var road1:MovieClip;
public var crater_layer:MovieClip;
}
}//package mw_fla
Section 228
//UnitMaskLayer_53 (mw_fla.UnitMaskLayer_53)
package mw_fla {
import flash.display.*;
public dynamic class UnitMaskLayer_53 extends MovieClip {
public var masked_layer:MovieClip;
}
}//package mw_fla
Section 229
//Vilcano_b_215 (mw_fla.Vilcano_b_215)
package mw_fla {
import flash.display.*;
public dynamic class Vilcano_b_215 extends MovieClip {
public function Vilcano_b_215(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 230
//Vulcano_214 (mw_fla.Vulcano_214)
package mw_fla {
import flash.display.*;
public dynamic class Vulcano_214 extends MovieClip {
public var button_three:MovieClip;
public var button_two:MovieClip;
public var button_one:MovieClip;
}
}//package mw_fla
Section 231
//Vulcano_a_219 (mw_fla.Vulcano_a_219)
package mw_fla {
import flash.display.*;
public dynamic class Vulcano_a_219 extends MovieClip {
public function Vulcano_a_219(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 232
//Vulcano_c_221 (mw_fla.Vulcano_c_221)
package mw_fla {
import flash.display.*;
public dynamic class Vulcano_c_221 extends MovieClip {
public function Vulcano_c_221(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 233
//Xelacia_244 (mw_fla.Xelacia_244)
package mw_fla {
import flash.display.*;
public dynamic class Xelacia_244 extends MovieClip {
public var button_three:MovieClip;
public var button_two:MovieClip;
public var button_one:MovieClip;
}
}//package mw_fla
Section 234
//Xelacia_a_245 (mw_fla.Xelacia_a_245)
package mw_fla {
import flash.display.*;
public dynamic class Xelacia_a_245 extends MovieClip {
public function Xelacia_a_245(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 235
//Xelacia_b_247 (mw_fla.Xelacia_b_247)
package mw_fla {
import flash.display.*;
public dynamic class Xelacia_b_247 extends MovieClip {
public function Xelacia_b_247(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 236
//Xelacia_c_249 (mw_fla.Xelacia_c_249)
package mw_fla {
import flash.display.*;
public dynamic class Xelacia_c_249 extends MovieClip {
public function Xelacia_c_249(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 237
//Yohada_258 (mw_fla.Yohada_258)
package mw_fla {
import flash.display.*;
public dynamic class Yohada_258 extends MovieClip {
public var button_three:MovieClip;
public var button_two:MovieClip;
public var button_one:MovieClip;
}
}//package mw_fla
Section 238
//Yohada_a_259 (mw_fla.Yohada_a_259)
package mw_fla {
import flash.display.*;
public dynamic class Yohada_a_259 extends MovieClip {
public function Yohada_a_259(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 239
//Yohada_b_261 (mw_fla.Yohada_b_261)
package mw_fla {
import flash.display.*;
public dynamic class Yohada_b_261 extends MovieClip {
public function Yohada_b_261(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 240
//Yohada_c_263 (mw_fla.Yohada_c_263)
package mw_fla {
import flash.display.*;
public dynamic class Yohada_c_263 extends MovieClip {
public function Yohada_c_263(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 241
//Zakdern_286 (mw_fla.Zakdern_286)
package mw_fla {
import flash.display.*;
public dynamic class Zakdern_286 extends MovieClip {
public var button_three:MovieClip;
public var button_two:MovieClip;
public var button_one:MovieClip;
}
}//package mw_fla
Section 242
//Zakdern_a_291 (mw_fla.Zakdern_a_291)
package mw_fla {
import flash.display.*;
public dynamic class Zakdern_a_291 extends MovieClip {
public function Zakdern_a_291(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 243
//Zakdern_b_293 (mw_fla.Zakdern_b_293)
package mw_fla {
import flash.display.*;
public dynamic class Zakdern_b_293 extends MovieClip {
public function Zakdern_b_293(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 244
//Zakdern_c_295 (mw_fla.Zakdern_c_295)
package mw_fla {
import flash.display.*;
public dynamic class Zakdern_c_295 extends MovieClip {
public function Zakdern_c_295(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mw_fla
Section 245
//ALlMapHolder (ALlMapHolder)
package {
import game.ui.*;
public dynamic class ALlMapHolder extends LevelData {
}
}//package
Section 246
//AStrike1 (AStrike1)
package {
import flash.display.*;
import game.logic.*;
public dynamic class AStrike1 extends MovieClip {
public function AStrike1(){
addFrameScript(5, frame6, 40, frame41);
}
function frame6(){
EffectFactory.addCraterFrom(this);
}
function frame41(){
stop();
EffectFactory.effectFinished(this);
}
}
}//package
Section 247
//AStrike2 (AStrike2)
package {
import flash.display.*;
import game.logic.*;
public dynamic class AStrike2 extends MovieClip {
public function AStrike2(){
addFrameScript(5, frame6, 40, frame41);
}
function frame6(){
EffectFactory.addCraterFrom(this);
}
function frame41(){
stop();
EffectFactory.effectFinished(this);
}
}
}//package
Section 248
//AStrike3 (AStrike3)
package {
import flash.display.*;
import game.logic.*;
public dynamic class AStrike3 extends MovieClip {
public function AStrike3(){
addFrameScript(5, frame6, 40, frame41);
}
function frame6(){
EffectFactory.addCraterFrom(this);
}
function frame41(){
stop();
EffectFactory.effectFinished(this);
}
}
}//package
Section 249
//BlueCaterpilarDeath (BlueCaterpilarDeath)
package {
import flash.display.*;
public dynamic class BlueCaterpilarDeath extends MovieClip {
public function BlueCaterpilarDeath(){
addFrameScript(24, frame25);
}
function frame25(){
stop();
}
}
}//package
Section 250
//BlueCaterpillar (BlueCaterpillar)
package {
import flash.display.*;
public dynamic class BlueCaterpillar extends MovieClip {
public var hit_point:RoadPoint;
public var shot_point:RoadPoint;
public var inner_shooting:MovieClip;
public var inner:BlueCaterpillarMoving;
public var innerd:BlueCaterpilarDeath;
public function BlueCaterpillar(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
inner_shooting.stop();
}
}
}//package
Section 251
//BlueCaterpillarMoving (BlueCaterpillarMoving)
package {
import game.ui.*;
public dynamic class BlueCaterpillarMoving extends CaterpillarMoving {
public function BlueCaterpillarMoving(){
addFrameScript(0, frame1);
}
function frame1(){
if (stopMoving){
stop();
currentlyStopped = true;
};
}
}
}//package
Section 252
//BlueGrenadier (BlueGrenadier)
package {
import flash.display.*;
public dynamic class BlueGrenadier extends MovieClip {
public var hit_point:RoadPoint;
public var inner:MovieClip;
public function BlueGrenadier(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 253
//BlueMarine (BlueMarine)
package {
import flash.display.*;
public dynamic class BlueMarine extends MovieClip {
public var hit_point:RoadPoint;
public var shot_point:RoadPoint;
public var inner:MovieClip;
public function BlueMarine(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 254
//BlueMine (BlueMine)
package {
import flash.display.*;
public dynamic class BlueMine extends MovieClip {
public function BlueMine(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 255
//BlueMinerDroid (BlueMinerDroid)
package {
import flash.display.*;
public dynamic class BlueMinerDroid extends MovieClip {
public var hit_point:RoadPoint;
public var shot_point:RoadPoint;
public var inner:MovieClip;
public function BlueMinerDroid(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 256
//BlueMissileMan (BlueMissileMan)
package {
import flash.display.*;
public dynamic class BlueMissileMan extends MovieClip {
public var hit_point:RoadPoint;
public var shot_point:RoadPoint;
public var inner:MovieClip;
public function BlueMissileMan(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 257
//BlueSpecialist (BlueSpecialist)
package {
import flash.display.*;
public dynamic class BlueSpecialist extends MovieClip {
public var hit_point:RoadPoint;
public var shot_point:RoadPoint;
public var inner:MovieClip;
public function BlueSpecialist(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 258
//BlueStormTank (BlueStormTank)
package {
import flash.display.*;
public dynamic class BlueStormTank extends MovieClip {
public var hit_point:RoadPoint;
public var shot_point:RoadPoint;
public var inner:MovieClip;
public function BlueStormTank(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
inner.stop();
}
}
}//package
Section 259
//BlueStormTankDeath (BlueStormTankDeath)
package {
import flash.display.*;
public dynamic class BlueStormTankDeath extends MovieClip {
public function BlueStormTankDeath(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package
Section 260
//BlueVulture (BlueVulture)
package {
import game.ui.*;
public dynamic class BlueVulture extends Vulture {
public function BlueVulture(){
addFrameScript(38, frame39, 68, frame69, 141, frame142);
}
function frame39(){
inner.gotoAndPlay("landing");
}
function frame142(){
stop();
tripFinished();
}
function frame69(){
stop();
vehicleLanded();
}
}
}//package
Section 261
//CaterpilarMoving (CaterpilarMoving)
package {
import game.ui.*;
public dynamic class CaterpilarMoving extends CaterpillarMoving {
public function CaterpilarMoving(){
addFrameScript(0, frame1);
}
function frame1(){
if (stopMoving){
stop();
currentlyStopped = true;
};
}
}
}//package
Section 262
//CaterpillarImpact (CaterpillarImpact)
package {
import flash.display.*;
import game.logic.*;
public dynamic class CaterpillarImpact extends MovieClip {
public function CaterpillarImpact(){
addFrameScript(45, frame46);
}
function frame46(){
stop();
EffectFactory.effectFinished(this);
}
}
}//package
Section 263
//CloseButton (CloseButton)
package {
import flash.display.*;
public dynamic class CloseButton extends SimpleButton {
}
}//package
Section 264
//Crater (Crater)
package {
import flash.display.*;
public dynamic class Crater extends MovieClip {
}
}//package
Section 265
//DefeatMessage (DefeatMessage)
package {
import flash.display.*;
import flash.text.*;
public dynamic class DefeatMessage extends MovieClip {
public var kills_txt:TextField;
public var lost_txt:TextField;
}
}//package
Section 266
//EnemyRoadPath1 (EnemyRoadPath1)
package {
import game.ui.*;
public dynamic class EnemyRoadPath1 extends EnemyRoadPath {
}
}//package
Section 267
//EnemyRoadPath2 (EnemyRoadPath2)
package {
import game.ui.*;
public dynamic class EnemyRoadPath2 extends EnemyRoadPath {
}
}//package
Section 268
//EnemyRoadPath3 (EnemyRoadPath3)
package {
import game.ui.*;
public dynamic class EnemyRoadPath3 extends EnemyRoadPath {
}
}//package
Section 269
//EnemyRoadPath4 (EnemyRoadPath4)
package {
import game.ui.*;
public dynamic class EnemyRoadPath4 extends EnemyRoadPath {
}
}//package
Section 270
//EnemyRoadPath5 (EnemyRoadPath5)
package {
import game.ui.*;
public dynamic class EnemyRoadPath5 extends EnemyRoadPath {
}
}//package
Section 271
//focusRectSkin (focusRectSkin)
package {
import flash.display.*;
public dynamic class focusRectSkin extends MovieClip {
}
}//package
Section 272
//ForceField (ForceField)
package {
import flash.display.*;
public dynamic class ForceField extends MovieClip {
}
}//package
Section 273
//GameStage (GameStage)
package {
import flash.display.*;
import flash.events.*;
import core.*;
import flash.ui.*;
import flash.net.*;
import flash.system.*;
public class GameStage extends MovieClip {
public var flonga_clip:MovieClip;
public var loadingMC:MovieClip;
public var welcome_screen:MovieClip;
public static var itself = null;
public function GameStage():void{
addFrameScript(0, frame1, 4, frame5);
Security.allowDomain("*");
itself = this;
}
public function progressUpdate(_arg1:Event):void{
var _local2:Number;
_local2 = Math.round(((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal) * 100));
if ((loadingMC is MovieClip)){
loadingMC.progress_mc.gotoAndStop(_local2);
loadingMC.loaded_txt.text = (("The game is loading... " + _local2.toString()) + "%");
};
if (!!((this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal))){
loadingMC.removeEventListener(Event.ENTER_FRAME, progressUpdate);
loadingMC.progress_mc.stop();
loadingMC.progress_mc.visible = false;
removeChild(loadingMC);
loadingMC = null;
gotoAndStop(5);
};
}
private function handleUnload(_arg1:Event):void{
root.loaderInfo.removeEventListener(Event.UNLOAD, handleUnload);
Global.top.clear();
}
public function flongaFinished():void{
if (!flonga_clip){
return;
};
flonga_clip.stop();
flonga_clip.visible = false;
this.removeChild(flonga_clip);
flonga_clip.stop();
flonga_clip = null;
welcome_screen.playMusic();
}
function frame1(){
loadingMC.addEventListener(Event.ENTER_FRAME, progressUpdate);
stop();
}
public function initAll():void{
if (Global.isStarted()){
return;
};
Global.startup(this, welcome_screen);
Global.hideMenu();
Global.top.initialize();
root.loaderInfo.addEventListener(Event.UNLOAD, handleUnload);
}
function frame5(){
flonga_clip.addEventListener(MouseEvent.MOUSE_DOWN, sponsorClick);
flonga_clip.tabEnabled = false;
this.initAll();
stop();
}
public static function sponsorClick(_arg1:MouseEvent):void{
var urlRequest:URLRequest;
var evt = _arg1;
try {
urlRequest = new URLRequest("http://www.flonga.com/");
navigateToURL(urlRequest, "_blank");
} catch(e:Error) {
};
}
}
}//package
Section 274
//GrandStormBar (GrandStormBar)
package {
import game.ui.controls.*;
public dynamic class GrandStormBar extends SpriteBar {
}
}//package
Section 275
//GrandStormMessage (GrandStormMessage)
package {
import flash.display.*;
import game.logic.*;
public dynamic class GrandStormMessage extends MovieClip {
public function GrandStormMessage(){
addFrameScript(89, frame90);
}
function frame90(){
stop();
EffectFactory.effectFinished(this);
}
}
}//package
Section 276
//GrenadierExplosion (GrenadierExplosion)
package {
import flash.display.*;
import game.logic.*;
public dynamic class GrenadierExplosion extends MovieClip {
public function GrenadierExplosion(){
addFrameScript(4, frame5, 49, frame50);
}
function frame5(){
EffectFactory.addCraterFrom(this, 0.35, 0.8);
}
function frame50(){
stop();
EffectFactory.effectFinished(this);
}
}
}//package
Section 277
//HatchExplosion (HatchExplosion)
package {
import game.ui.*;
import game.logic.*;
public dynamic class HatchExplosion extends Effect {
public function HatchExplosion(){
addFrameScript(15, frame16);
}
function frame16(){
stop();
EffectFactory.effectFinished(this);
}
}
}//package
Section 278
//LaserBeam (LaserBeam)
package {
import flash.display.*;
public dynamic class LaserBeam extends MovieClip {
}
}//package
Section 279
//LevelMap0 (LevelMap0)
package {
import game.ui.*;
public dynamic class LevelMap0 extends LevelData {
}
}//package
Section 280
//LoadingMC (LoadingMC)
package {
import flash.display.*;
import flash.text.*;
public dynamic class LoadingMC extends MovieClip {
public var loaded_txt:TextField;
public var error_txt:TextField;
public var progress_mc:MovieClip;
}
}//package
Section 281
//MainMenuButton (MainMenuButton)
package {
import flash.display.*;
public dynamic class MainMenuButton extends SimpleButton {
}
}//package
Section 282
//MarineBullet (MarineBullet)
package {
import flash.display.*;
public dynamic class MarineBullet extends MovieClip {
}
}//package
Section 283
//MarineBulletImpact (MarineBulletImpact)
package {
import flash.display.*;
import game.logic.*;
public dynamic class MarineBulletImpact extends MovieClip {
public function MarineBulletImpact(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
EffectFactory.effectFinished(this);
}
}
}//package
Section 284
//MineExplosion (MineExplosion)
package {
import game.ui.*;
import game.logic.*;
public dynamic class MineExplosion extends Effect {
public function MineExplosion(){
addFrameScript(2, frame3, 36, frame37);
}
function frame3(){
EffectRoutines.AddMineCrater(this);
}
function frame37(){
stop();
EffectFactory.effectFinished(this);
}
}
}//package
Section 285
//MinerExplosion (MinerExplosion)
package {
import flash.display.*;
public dynamic class MinerExplosion extends MovieClip {
public var inner:MovieClip;
public var clip_bounds:MovieClip;
public function MinerExplosion(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package
Section 286
//MMBullet (MMBullet)
package {
import flash.display.*;
public dynamic class MMBullet extends MovieClip {
}
}//package
Section 287
//MMImpact (MMImpact)
package {
import flash.display.*;
import game.logic.*;
public dynamic class MMImpact extends MovieClip {
public function MMImpact(){
addFrameScript(30, frame31);
}
function frame31(){
stop();
EffectFactory.effectFinished(this);
}
}
}//package
Section 288
//NewFacility (NewFacility)
package {
import flash.display.*;
public dynamic class NewFacility extends MovieClip {
public var card:MovieClip;
}
}//package
Section 289
//Nuke (Nuke)
package {
import flash.display.*;
import game.logic.*;
public dynamic class Nuke extends MovieClip {
public var c:Crater;
public function Nuke(){
addFrameScript(28, frame29, 157, frame158);
}
function frame158(){
stop();
EffectFactory.effectFinished(this);
}
function frame29(){
c = EffectFactory.addCraterFrom(this, 1.2, 1.5);
c.y = (c.y - 50);
}
}
}//package
Section 290
//NukeCounting (NukeCounting)
package {
import flash.display.*;
import game.logic.*;
public dynamic class NukeCounting extends MovieClip {
public function NukeCounting(){
addFrameScript(139, frame140);
}
function frame140(){
stop();
EffectRoutines.doNuke();
EffectFactory.effectFinished(this);
}
}
}//package
Section 291
//OptionsButton (OptionsButton)
package {
import flash.display.*;
public dynamic class OptionsButton extends SimpleButton {
}
}//package
Section 292
//RedCaterpilarDeath (RedCaterpilarDeath)
package {
import flash.display.*;
public dynamic class RedCaterpilarDeath extends MovieClip {
public function RedCaterpilarDeath(){
addFrameScript(24, frame25);
}
function frame25(){
stop();
}
}
}//package
Section 293
//RedCaterpillar (RedCaterpillar)
package {
import flash.display.*;
public dynamic class RedCaterpillar extends MovieClip {
public var hit_point:RoadPoint;
public var shot_point:RoadPoint;
public var inner_shooting:MovieClip;
public var inner:CaterpilarMoving;
public var innerd:RedCaterpilarDeath;
public function RedCaterpillar(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
inner_shooting.stop();
}
}
}//package
Section 294
//RedForceField (RedForceField)
package {
import flash.display.*;
public dynamic class RedForceField extends MovieClip {
}
}//package
Section 295
//RedGrenadier (RedGrenadier)
package {
import flash.display.*;
public dynamic class RedGrenadier extends MovieClip {
public var hit_point:RoadPoint;
public var inner:MovieClip;
public function RedGrenadier(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 296
//RedLaserBeam (RedLaserBeam)
package {
import flash.display.*;
public dynamic class RedLaserBeam extends MovieClip {
}
}//package
Section 297
//RedMarine (RedMarine)
package {
import flash.display.*;
public dynamic class RedMarine extends MovieClip {
public var hit_point:RoadPoint;
public var shot_point:RoadPoint;
public var inner:MovieClip;
public function RedMarine(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 298
//RedMine (RedMine)
package {
import flash.display.*;
public dynamic class RedMine extends MovieClip {
public function RedMine(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 299
//RedMinerDroid (RedMinerDroid)
package {
import flash.display.*;
public dynamic class RedMinerDroid extends MovieClip {
public var hit_point:RoadPoint;
public var shot_point:RoadPoint;
public var inner:MovieClip;
public function RedMinerDroid(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 300
//RedMissileMan (RedMissileMan)
package {
import flash.display.*;
public dynamic class RedMissileMan extends MovieClip {
public var hit_point:RoadPoint;
public var shot_point:RoadPoint;
public var inner:MovieClip;
public function RedMissileMan(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 301
//RedSpecialist (RedSpecialist)
package {
import flash.display.*;
public dynamic class RedSpecialist extends MovieClip {
public var hit_point:RoadPoint;
public var shot_point:RoadPoint;
public var inner:MovieClip;
public function RedSpecialist(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 302
//RedStormTank (RedStormTank)
package {
import flash.display.*;
public dynamic class RedStormTank extends MovieClip {
public var hit_point:RoadPoint;
public var shot_point:RoadPoint;
public var inner:MovieClip;
public function RedStormTank(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
inner.stop();
}
}
}//package
Section 303
//RedStormTankDeath (RedStormTankDeath)
package {
import flash.display.*;
public dynamic class RedStormTankDeath extends MovieClip {
public function RedStormTankDeath(){
addFrameScript(18, frame19);
}
function frame19(){
stop();
cacheAsBitmap = true;
}
}
}//package
Section 304
//RedVulture (RedVulture)
package {
import game.ui.*;
public dynamic class RedVulture extends Vulture {
public function RedVulture(){
addFrameScript(40, frame41, 68, frame69, 141, frame142);
}
function frame41(){
inner.gotoAndPlay("landing");
}
function frame142(){
stop();
tripFinished();
}
function frame69(){
stop();
vehicleLanded();
}
}
}//package
Section 305
//RoadPath1 (RoadPath1)
package {
import game.ui.*;
public dynamic class RoadPath1 extends RoadPath {
}
}//package
Section 306
//RoadPath2 (RoadPath2)
package {
import game.ui.*;
public dynamic class RoadPath2 extends RoadPath {
}
}//package
Section 307
//RoadPath3 (RoadPath3)
package {
import game.ui.*;
public dynamic class RoadPath3 extends RoadPath {
}
}//package
Section 308
//RoadPath4 (RoadPath4)
package {
import game.ui.*;
public dynamic class RoadPath4 extends RoadPath {
}
}//package
Section 309
//RoadPath5 (RoadPath5)
package {
import game.ui.*;
public dynamic class RoadPath5 extends RoadPath {
}
}//package
Section 310
//RoadPoint (RoadPoint)
package {
import flash.display.*;
public dynamic class RoadPoint extends Sprite {
}
}//package
Section 311
//SFBullet (SFBullet)
package {
import flash.display.*;
public dynamic class SFBullet extends MovieClip {
}
}//package
Section 312
//SFImpact (SFImpact)
package {
import flash.display.*;
import game.logic.*;
public dynamic class SFImpact extends MovieClip {
public function SFImpact(){
addFrameScript(30, frame31);
}
function frame31(){
stop();
EffectFactory.effectFinished(this);
}
}
}//package
Section 313
//SliderThumb_disabledSkin (SliderThumb_disabledSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_disabledSkin extends MovieClip {
}
}//package
Section 314
//SliderThumb_downSkin (SliderThumb_downSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_downSkin extends MovieClip {
}
}//package
Section 315
//SliderThumb_overSkin (SliderThumb_overSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_overSkin extends MovieClip {
}
}//package
Section 316
//SliderThumb_upSkin (SliderThumb_upSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_upSkin extends MovieClip {
}
}//package
Section 317
//SliderTick_skin (SliderTick_skin)
package {
import flash.display.*;
public dynamic class SliderTick_skin extends MovieClip {
}
}//package
Section 318
//SliderTrack_disabledSkin (SliderTrack_disabledSkin)
package {
import flash.display.*;
public dynamic class SliderTrack_disabledSkin extends MovieClip {
}
}//package
Section 319
//SliderTrack_skin (SliderTrack_skin)
package {
import flash.display.*;
public dynamic class SliderTrack_skin extends MovieClip {
}
}//package
Section 320
//SlotFrame (SlotFrame)
package {
import flash.display.*;
public dynamic class SlotFrame extends MovieClip {
public function SlotFrame(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 321
//Sound_ArcticWind (Sound_ArcticWind)
package {
import flash.media.*;
public dynamic class Sound_ArcticWind extends Sound {
}
}//package
Section 322
//Sound_artillery_strike (Sound_artillery_strike)
package {
import flash.media.*;
public dynamic class Sound_artillery_strike extends Sound {
}
}//package
Section 323
//Sound_camera (Sound_camera)
package {
import flash.media.*;
public dynamic class Sound_camera extends Sound {
}
}//package
Section 324
//Sound_caterpillar_death (Sound_caterpillar_death)
package {
import flash.media.*;
public dynamic class Sound_caterpillar_death extends Sound {
}
}//package
Section 325
//Sound_caterpillar_hit (Sound_caterpillar_hit)
package {
import flash.media.*;
public dynamic class Sound_caterpillar_hit extends Sound {
}
}//package
Section 326
//Sound_click (Sound_click)
package {
import flash.media.*;
public dynamic class Sound_click extends Sound {
}
}//package
Section 327
//Sound_defeat (Sound_defeat)
package {
import flash.media.*;
public dynamic class Sound_defeat extends Sound {
}
}//package
Section 328
//Sound_door_reach (Sound_door_reach)
package {
import flash.media.*;
public dynamic class Sound_door_reach extends Sound {
}
}//package
Section 329
//Sound_doors_open (Sound_doors_open)
package {
import flash.media.*;
public dynamic class Sound_doors_open extends Sound {
}
}//package
Section 330
//Sound_explosion (Sound_explosion)
package {
import flash.media.*;
public dynamic class Sound_explosion extends Sound {
}
}//package
Section 331
//Sound_explosion1 (Sound_explosion1)
package {
import flash.media.*;
public dynamic class Sound_explosion1 extends Sound {
}
}//package
Section 332
//Sound_final_attack (Sound_final_attack)
package {
import flash.media.*;
public dynamic class Sound_final_attack extends Sound {
}
}//package
Section 333
//Sound_hit (Sound_hit)
package {
import flash.media.*;
public dynamic class Sound_hit extends Sound {
}
}//package
Section 334
//Sound_hit1 (Sound_hit1)
package {
import flash.media.*;
public dynamic class Sound_hit1 extends Sound {
}
}//package
Section 335
//Sound_hit3 (Sound_hit3)
package {
import flash.media.*;
public dynamic class Sound_hit3 extends Sound {
}
}//package
Section 336
//Sound_levels_music (Sound_levels_music)
package {
import flash.media.*;
public dynamic class Sound_levels_music extends Sound {
}
}//package
Section 337
//Sound_marine_death (Sound_marine_death)
package {
import flash.media.*;
public dynamic class Sound_marine_death extends Sound {
}
}//package
Section 338
//Sound_marine_death_expl (Sound_marine_death_expl)
package {
import flash.media.*;
public dynamic class Sound_marine_death_expl extends Sound {
}
}//package
Section 339
//Sound_marine_shot (Sound_marine_shot)
package {
import flash.media.*;
public dynamic class Sound_marine_shot extends Sound {
}
}//package
Section 340
//Sound_menu_appear (Sound_menu_appear)
package {
import flash.media.*;
public dynamic class Sound_menu_appear extends Sound {
}
}//package
Section 341
//Sound_mine_set (Sound_mine_set)
package {
import flash.media.*;
public dynamic class Sound_mine_set extends Sound {
}
}//package
Section 342
//Sound_mm_shot (Sound_mm_shot)
package {
import flash.media.*;
public dynamic class Sound_mm_shot extends Sound {
}
}//package
Section 343
//Sound_nuclear_counting (Sound_nuclear_counting)
package {
import flash.media.*;
public dynamic class Sound_nuclear_counting extends Sound {
}
}//package
Section 344
//Sound_specialist_attack (Sound_specialist_attack)
package {
import flash.media.*;
public dynamic class Sound_specialist_attack extends Sound {
}
}//package
Section 345
//Sound_storm_attack (Sound_storm_attack)
package {
import flash.media.*;
public dynamic class Sound_storm_attack extends Sound {
}
}//package
Section 346
//Sound_storm_tank_shot (Sound_storm_tank_shot)
package {
import flash.media.*;
public dynamic class Sound_storm_tank_shot extends Sound {
}
}//package
Section 347
//Sound_stun (Sound_stun)
package {
import flash.media.*;
public dynamic class Sound_stun extends Sound {
}
}//package
Section 348
//Sound_victory (Sound_victory)
package {
import flash.media.*;
public dynamic class Sound_victory extends Sound {
}
}//package
Section 349
//Sound_victory_music (Sound_victory_music)
package {
import flash.media.*;
public dynamic class Sound_victory_music extends Sound {
}
}//package
Section 350
//Sound_WindLoop (Sound_WindLoop)
package {
import flash.media.*;
public dynamic class Sound_WindLoop extends Sound {
}
}//package
Section 351
//Sound_vulture (Sound_vulture)
package {
import flash.media.*;
public dynamic class Sound_vulture extends Sound {
}
}//package
Section 352
//StormBar (StormBar)
package {
import game.ui.controls.*;
public dynamic class StormBar extends SpriteBar {
}
}//package
Section 353
//StormTankBullet (StormTankBullet)
package {
import flash.display.*;
public dynamic class StormTankBullet extends MovieClip {
}
}//package
Section 354
//StormTankImpact (StormTankImpact)
package {
import flash.display.*;
import game.logic.*;
public dynamic class StormTankImpact extends MovieClip {
public function StormTankImpact(){
addFrameScript(35, frame36);
}
function frame36(){
stop();
EffectFactory.effectFinished(this);
}
}
}//package
Section 355
//VictoryMessage (VictoryMessage)
package {
import flash.display.*;
import flash.text.*;
public dynamic class VictoryMessage extends MovieClip {
public var conquered_txt:TextField;
public var kills_txt:TextField;
public var money_earned_txt:TextField;
}
}//package