Section 1
//AuxFunctions (caurina.transitions.AuxFunctions)
package caurina.transitions {
public class AuxFunctions {
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);
}
public static function numberToG(_arg1:Number):Number{
return (((_arg1 & 0xFF00) >> 8));
}
public static function numberToR(_arg1:Number):Number{
return (((_arg1 & 0xFF0000) >> 16));
}
public static function isInArray(_arg1:String, _arg2:Array):Boolean{
var _local3:uint;
var _local4:uint;
_local3 = _arg2.length;
_local4 = 0;
while (_local4 < _local3) {
if (_arg2[_local4] == _arg1){
return (true);
};
_local4++;
};
return (false);
}
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 numberToB(_arg1:Number):Number{
return ((_arg1 & 0xFF));
}
}
}//package caurina.transitions
Section 2
//Equations (caurina.transitions.Equations)
package caurina.transitions {
public class Equations {
public function Equations(){
trace("Equations is a static class and should not be instantiated.");
}
public static function easeOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):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:Number=NaN, _arg6:Number=NaN):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * (0.3 * 1.5));
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
};
--_arg1;
return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) * 0.5) + _arg3) + _arg2));
}
public static function easeInOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
public static function easeInOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):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:Number=NaN):Number{
if (!_arg5){
_arg5 = 1.70158;
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5))) + _arg2));
};
_arg1 = (_arg1 - 2);
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 2)) + _arg2));
}
public static function easeOutInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCubic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInCubic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN):Number{
if (!_arg5){
_arg5 = 1.70158;
};
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
}
public static function easeInOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):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:Number=NaN):Number{
if (!_arg5){
_arg5 = 1.70158;
};
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2));
}
public static function easeInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeOutInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuint((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInQuint(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeOutInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBounce((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInBounce(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
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):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:Number=NaN):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):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):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):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):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 - easeOutBounce((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeOutInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutExpo((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInExpo(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):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):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2));
}
public static function easeInOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):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):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeOutInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN, _arg6:Number=NaN):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutElastic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5, _arg6));
};
return (easeInElastic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5, _arg6));
}
public static function easeInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN, _arg6:Number=NaN):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
--_arg1;
return ((-(((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
}
public static function easeOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuad((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInQuad(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2));
}
public static function easeInOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):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):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):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):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutSine((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInSine(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeInOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):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:Number=NaN, _arg6:Number=NaN):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) + _arg3) + _arg2));
}
public static function easeOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):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):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuart((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInQuart(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeOutInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCirc((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInCirc(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
}
}//package caurina.transitions
Section 3
//PropertyInfoObj (caurina.transitions.PropertyInfoObj)
package caurina.transitions {
public class PropertyInfoObj {
public var modifierParameters:Array;
public var valueComplete:Number;
public var modifierFunction:Function;
public var hasModifier:Boolean;
public var valueStart:Number;
public function PropertyInfoObj(_arg1:Number, _arg2:Number, _arg3:Function, _arg4:Array){
valueStart = _arg1;
valueComplete = _arg2;
hasModifier = Boolean(_arg3);
modifierFunction = _arg3;
modifierParameters = _arg4;
}
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 + ("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, modifierFunction, modifierParameters);
return (_local1);
}
}
}//package caurina.transitions
Section 4
//SpecialPropertiesDefault (caurina.transitions.SpecialPropertiesDefault)
package caurina.transitions {
import flash.filters.*;
import flash.media.*;
import flash.geom.*;
public class SpecialPropertiesDefault {
public function SpecialPropertiesDefault(){
trace("SpecialProperties is a static class and should not be instantiated.");
}
public static function _sound_volume_get(_arg1:Object):Number{
return (_arg1.soundTransform.volume);
}
public static function _color_splitter(_arg1, _arg2:Array):Array{
var _local3:Array;
_local3 = new Array();
if (_arg1 == null){
_local3.push({name:"_color_ra", value:1});
_local3.push({name:"_color_rb", value:0});
_local3.push({name:"_color_ga", value:1});
_local3.push({name:"_color_gb", value:0});
_local3.push({name:"_color_ba", value:1});
_local3.push({name:"_color_bb", value:0});
} else {
_local3.push({name:"_color_ra", value:0});
_local3.push({name:"_color_rb", value:AuxFunctions.numberToR(_arg1)});
_local3.push({name:"_color_ga", value:0});
_local3.push({name:"_color_gb", value:AuxFunctions.numberToG(_arg1)});
_local3.push({name:"_color_ba", value:0});
_local3.push({name:"_color_bb", value:AuxFunctions.numberToB(_arg1)});
};
return (_local3);
}
public static function frame_get(_arg1:Object):Number{
return (_arg1.currentFrame);
}
public static function _sound_pan_get(_arg1:Object):Number{
return (_arg1.soundTransform.pan);
}
public static function _color_property_get(_arg1:Object, _arg2:Array):Number{
return (_arg1.transform.colorTransform[_arg2[0]]);
}
public static function _sound_volume_set(_arg1:Object, _arg2:Number):void{
var _local3:SoundTransform;
_local3 = _arg1.soundTransform;
_local3.volume = _arg2;
_arg1.soundTransform = _local3;
}
public static function _autoAlpha_get(_arg1:Object):Number{
return (_arg1.alpha);
}
public static function _filter_splitter(_arg1:BitmapFilter, _arg2:Array):Array{
var _local3:Array;
_local3 = new Array();
if ((_arg1 is BlurFilter)){
_local3.push({name:"_blur_blurX", value:BlurFilter(_arg1).blurX});
_local3.push({name:"_blur_blurY", value:BlurFilter(_arg1).blurY});
_local3.push({name:"_blur_quality", value:BlurFilter(_arg1).quality});
} else {
trace("??");
};
return (_local3);
}
public static function init():void{
Tweener.registerSpecialProperty("_frame", frame_get, frame_set);
Tweener.registerSpecialProperty("_sound_volume", _sound_volume_get, _sound_volume_set);
Tweener.registerSpecialProperty("_sound_pan", _sound_pan_get, _sound_pan_set);
Tweener.registerSpecialProperty("_color_ra", _color_property_get, _color_property_set, ["redMultiplier"]);
Tweener.registerSpecialProperty("_color_rb", _color_property_get, _color_property_set, ["redOffset"]);
Tweener.registerSpecialProperty("_color_ga", _color_property_get, _color_property_set, ["greenMultiplier"]);
Tweener.registerSpecialProperty("_color_gb", _color_property_get, _color_property_set, ["greenOffset"]);
Tweener.registerSpecialProperty("_color_ba", _color_property_get, _color_property_set, ["blueMultiplier"]);
Tweener.registerSpecialProperty("_color_bb", _color_property_get, _color_property_set, ["blueOffset"]);
Tweener.registerSpecialProperty("_color_aa", _color_property_get, _color_property_set, ["alphaMultiplier"]);
Tweener.registerSpecialProperty("_color_ab", _color_property_get, _color_property_set, ["alphaOffset"]);
Tweener.registerSpecialProperty("_autoAlpha", _autoAlpha_get, _autoAlpha_set);
Tweener.registerSpecialPropertySplitter("_color", _color_splitter);
Tweener.registerSpecialPropertySplitter("_colorTransform", _colorTransform_splitter);
Tweener.registerSpecialPropertySplitter("_scale", _scale_splitter);
Tweener.registerSpecialProperty("_blur_blurX", _filter_property_get, _filter_property_set, [BlurFilter, "blurX"]);
Tweener.registerSpecialProperty("_blur_blurY", _filter_property_get, _filter_property_set, [BlurFilter, "blurY"]);
Tweener.registerSpecialProperty("_blur_quality", _filter_property_get, _filter_property_set, [BlurFilter, "quality"]);
Tweener.registerSpecialPropertySplitter("_filter", _filter_splitter);
Tweener.registerSpecialPropertyModifier("_bezier", _bezier_modifier, _bezier_get);
}
public static function _sound_pan_set(_arg1:Object, _arg2:Number):void{
var _local3:SoundTransform;
_local3 = _arg1.soundTransform;
_local3.pan = _arg2;
_arg1.soundTransform = _local3;
}
public static function _color_property_set(_arg1:Object, _arg2:Number, _arg3:Array):void{
var _local4:ColorTransform;
_local4 = _arg1.transform.colorTransform;
_local4[_arg3[0]] = _arg2;
_arg1.transform.colorTransform = _local4;
}
public static function _filter_property_get(_arg1:Object, _arg2:Array):Number{
var _local3:Array;
var _local4:uint;
var _local5:Object;
var _local6:String;
var _local7:Object;
_local3 = _arg1.filters;
_local5 = _arg2[0];
_local6 = _arg2[1];
_local4 = 0;
while (_local4 < _local3.length) {
if ((((_local3[_local4] is BlurFilter)) && ((_local5 == BlurFilter)))){
return (_local3[_local4][_local6]);
};
_local4++;
};
switch (_local5){
case BlurFilter:
_local7 = {blurX:0, blurY:0, quality:NaN};
break;
};
return (_local7[_local6]);
}
public static function _bezier_get(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Array):Number{
var _local5:uint;
var _local6:Number;
var _local7:Number;
var _local8:Number;
if (_arg4.length == 1){
return ((_arg1 + (_arg3 * (((2 * (1 - _arg3)) * (_arg4[0] - _arg1)) + (_arg3 * (_arg2 - _arg1))))));
};
_local5 = Math.floor((_arg3 * _arg4.length));
_local6 = ((_arg3 - (_local5 * (1 / _arg4.length))) * _arg4.length);
if (_local5 == 0){
_local7 = _arg1;
_local8 = ((_arg4[0] + _arg4[1]) / 2);
} else {
if (_local5 == (_arg4.length - 1)){
_local7 = ((_arg4[(_local5 - 1)] + _arg4[_local5]) / 2);
_local8 = _arg2;
} else {
_local7 = ((_arg4[(_local5 - 1)] + _arg4[_local5]) / 2);
_local8 = ((_arg4[_local5] + _arg4[(_local5 + 1)]) / 2);
};
};
return ((_local7 + (_local6 * (((2 * (1 - _local6)) * (_arg4[_local5] - _local7)) + (_local6 * (_local8 - _local7))))));
}
public static function frame_set(_arg1:Object, _arg2:Number):void{
_arg1.gotoAndStop(Math.round(_arg2));
}
public static function _filter_property_set(_arg1:Object, _arg2:Number, _arg3:Array):void{
var _local4:Array;
var _local5:uint;
var _local6:Object;
var _local7:String;
var _local8:BitmapFilter;
_local4 = _arg1.filters;
_local6 = _arg3[0];
_local7 = _arg3[1];
_local5 = 0;
while (_local5 < _local4.length) {
if ((((_local4[_local5] is BlurFilter)) && ((_local6 == BlurFilter)))){
_local4[_local5][_local7] = _arg2;
_arg1.filters = _local4;
return;
};
_local5++;
};
if (_local4 == null){
_local4 = new Array();
};
switch (_local6){
case BlurFilter:
_local8 = new BlurFilter(0, 0);
break;
};
_local8[_local7] = _arg2;
_local4.push(_local8);
_arg1.filters = _local4;
}
public static function _autoAlpha_set(_arg1:Object, _arg2:Number):void{
_arg1.alpha = _arg2;
_arg1.visible = (_arg2 > 0);
}
public static function _scale_splitter(_arg1:Number, _arg2:Array):Array{
var _local3:Array;
_local3 = new Array();
_local3.push({name:"scaleX", value:_arg1});
_local3.push({name:"scaleY", value:_arg1});
return (_local3);
}
public static function _colorTransform_splitter(_arg1, _arg2:Array):Array{
var _local3:Array;
_local3 = new Array();
if (_arg1 == null){
_local3.push({name:"_color_ra", value:1});
_local3.push({name:"_color_rb", value:0});
_local3.push({name:"_color_ga", value:1});
_local3.push({name:"_color_gb", value:0});
_local3.push({name:"_color_ba", value:1});
_local3.push({name:"_color_bb", value:0});
} else {
if (_arg1.ra != undefined){
_local3.push({name:"_color_ra", value:_arg1.ra});
};
if (_arg1.rb != undefined){
_local3.push({name:"_color_rb", value:_arg1.rb});
};
if (_arg1.ga != undefined){
_local3.push({name:"_color_ba", value:_arg1.ba});
};
if (_arg1.gb != undefined){
_local3.push({name:"_color_bb", value:_arg1.bb});
};
if (_arg1.ba != undefined){
_local3.push({name:"_color_ga", value:_arg1.ga});
};
if (_arg1.bb != undefined){
_local3.push({name:"_color_gb", value:_arg1.gb});
};
if (_arg1.aa != undefined){
_local3.push({name:"_color_aa", value:_arg1.aa});
};
if (_arg1.ab != undefined){
_local3.push({name:"_color_ab", value:_arg1.ab});
};
};
return (_local3);
}
public static function _bezier_modifier(_arg1):Array{
var _local2:Array;
var _local3:Array;
var _local4:uint;
var _local5:String;
var _local6:Object;
_local2 = [];
if ((_arg1 is Array)){
_local3 = _arg1;
} else {
_local3 = [_arg1];
};
_local6 = {};
_local4 = 0;
while (_local4 < _local3.length) {
for (_local5 in _local3[_local4]) {
if (_local6[_local5] == undefined){
_local6[_local5] = [];
};
_local6[_local5].push(_local3[_local4][_local5]);
};
_local4++;
};
for (_local5 in _local6) {
_local2.push({name:_local5, parameters:_local6[_local5]});
};
return (_local2);
}
}
}//package caurina.transitions
Section 5
//SpecialProperty (caurina.transitions.SpecialProperty)
package caurina.transitions {
public class SpecialProperty {
public var parameters:Array;
public var getValue:Function;
public var setValue:Function;
public function SpecialProperty(_arg1:Function, _arg2:Function, _arg3:Array=null){
getValue = _arg1;
setValue = _arg2;
parameters = _arg3;
}
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 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 6
//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 7
//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;
}
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 8
//Tweener (caurina.transitions.Tweener)
package caurina.transitions {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Tweener {
private static var _timeScale:Number = 1;
private static var _specialPropertySplitterList:Object;
private static var _engineExists:Boolean = false;
private static var _specialPropertyModifierList:Object;
private static var _currentTime:Number;
private static var _tweenList:Array;
private static var _specialPropertyList:Object;
private static var _transitionList:Object;
private static var _inited:Boolean = false;
private static var __tweener_controller__:MovieClip;
public function Tweener(){
trace("Tweener is a static class and should not be instantiated.");
}
public static function registerSpecialPropertyModifier(_arg1:String, _arg2:Function, _arg3:Function):void{
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):void{
var _local5:SpecialProperty;
if (!_inited){
init();
};
_local5 = new SpecialProperty(_arg2, _arg3, _arg4);
_specialPropertyList[_arg1] = _local5;
}
public static function addCaller(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local4:Array;
var _local5:Number;
var _local6:Number;
var _local7:Object;
var _local8:Number;
var _local9:Number;
var _local10:Function;
var _local11:TweenListObj;
var _local12:Number;
var _local13:String;
if ((((arguments.length < 2)) || ((arguments[0] == undefined)))){
return (false);
};
_local4 = new Array();
if ((arguments[0] is Array)){
_local5 = 0;
while (_local5 < arguments[0].length) {
_local4.push(arguments[0][_local5]);
_local5++;
};
} else {
_local5 = 0;
while (_local5 < (arguments.length - 1)) {
_local4.push(arguments[_local5]);
_local5++;
};
};
_local7 = arguments[(arguments.length - 1)];
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
_local8 = (isNaN(_local7.time)) ? 0 : _local7.time;
_local9 = (isNaN(_local7.delay)) ? 0 : _local7.delay;
if (typeof(_local7.transition) == "string"){
_local13 = _local7.transition.toLowerCase();
_local10 = _transitionList[_local13];
} else {
_local10 = _local7.transition;
};
if (!Boolean(_local10)){
_local10 = _transitionList["easeoutexpo"];
};
_local5 = 0;
while (_local5 < _local4.length) {
_local11 = new TweenListObj(_local4[_local5], (_currentTime + ((_local9 * 1000) / _timeScale)), (_currentTime + (((_local9 * 1000) + (_local8 * 1000)) / _timeScale)), (_local7.useFrames == true), _local10);
_local11.properties = null;
_local11.onStart = _local7.onStart;
_local11.onUpdate = _local7.onUpdate;
_local11.onComplete = _local7.onComplete;
_local11.onOverwrite = _local7.onOverwrite;
_local11.onStartParams = _local7.onStartParams;
_local11.onUpdateParams = _local7.onUpdateParams;
_local11.onCompleteParams = _local7.onCompleteParams;
_local11.onOverwriteParams = _local7.onOverwriteParams;
_local11.isCaller = true;
_local11.count = _local7.count;
_local11.waitFrames = _local7.waitFrames;
_tweenList.push(_local11);
if ((((_local8 == 0)) && ((_local9 == 0)))){
_local12 = (_tweenList.length - 1);
updateTweenByIndex(_local12);
removeTweenByIndex(_local12);
};
_local5++;
};
return (true);
}
public static function init(_arg1=null):void{
_inited = true;
_transitionList = new Object();
Equations.init();
_specialPropertyList = new Object();
_specialPropertyModifierList = new Object();
_specialPropertySplitterList = new Object();
SpecialPropertiesDefault.init();
}
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 removeTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(removeTweenByIndex, _arg1, _local3));
}
public static function 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 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;
_local2 = _tweenList[_arg1];
if ((((_local2 == null)) || (!(_local2.isPaused)))){
return (false);
};
_local2.timeStart = (_local2.timeStart + (_currentTime - _local2.timePaused));
_local2.timeComplete = (_local2.timeComplete + (_currentTime - _local2.timePaused));
_local2.timePaused = undefined;
_local2.isPaused = false;
return (true);
}
public static function debug_getList():String{
var _local1:String;
var _local2:uint;
var _local3:uint;
_local1 = "";
_local2 = 0;
while (_local2 < _tweenList.length) {
_local1 = (_local1 + (("[" + _local2) + "] ::\n"));
_local3 = 0;
while (_local3 < _tweenList[_local2].properties.length) {
_local1 = (_local1 + ((((" " + _tweenList[_local2].properties[_local3].name) + " -> ") + _tweenList[_local2].properties[_local3].valueComplete) + "\n"));
_local3++;
};
_local2++;
};
return (_local1);
}
public static function getVersion():String{
return ("AS3 1.26.62");
}
public static function onEnterFrame(_arg1:Event):void{
var _local2:Boolean;
updateTime();
_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 tScope:Object;
var tProperty:Object;
var pv:Number;
var i = _arg1;
tTweening = _tweenList[i];
if ((((tTweening == null)) || (!(Boolean(tTweening.scope))))){
return (false);
};
isOver = false;
if (_currentTime >= 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 (!(_currentTime >= nv));
} else {
mustUpdate = (((((tTweening.skipUpdates < 1)) || (!(tTweening.skipUpdates)))) || ((tTweening.updatesSkipped >= tTweening.skipUpdates)));
if (_currentTime >= tTweening.timeComplete){
isOver = true;
mustUpdate = true;
};
if (!tTweening.hasStarted){
if (Boolean(tTweening.onStart)){
try {
tTweening.onStart.apply(tScope, tTweening.onStartParams);
} catch(e:Error) {
handleError(tTweening, e, "onStart");
};
};
for (pName in tTweening.properties) {
pv = getPropertyValue(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 = (_currentTime - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, 0, 1, d);
nv = tProperty.modifierFunction(tProperty.valueStart, tProperty.valueComplete, nv, tProperty.modifierParameters);
} else {
t = (_currentTime - tTweening.timeStart);
b = tProperty.valueStart;
c = (tProperty.valueComplete - tProperty.valueStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d);
};
};
if (tTweening.rounded){
nv = Math.round(nv);
};
setPropertyValue(tScope, pName, nv);
};
tTweening.updatesSkipped = 0;
if (Boolean(tTweening.onUpdate)){
try {
tTweening.onUpdate.apply(tScope, tTweening.onUpdateParams);
} catch(e:Error) {
handleError(tTweening, e, "onUpdate");
};
};
} else {
tTweening.updatesSkipped++;
};
};
if (((isOver) && (Boolean(tTweening.onComplete)))){
try {
tTweening.onComplete.apply(tScope, tTweening.onCompleteParams);
} catch(e:Error) {
handleError(tTweening, e, "onComplete");
};
};
return (!(isOver));
};
return (true);
}
public static function setTimeScale(_arg1:Number):void{
var _local2: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) {
_tweenList[_local2].timeStart = (_currentTime - (((_currentTime - _tweenList[_local2].timeStart) * _timeScale) / _arg1));
_tweenList[_local2].timeComplete = (_currentTime - (((_currentTime - _tweenList[_local2].timeComplete) * _timeScale) / _arg1));
if (_tweenList[_local2].timePaused != undefined){
_tweenList[_local2].timePaused = (_currentTime - (((_currentTime - _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 pTweening = _arg1;
var pError = _arg2;
var pCallBackName = _arg3;
if (((Boolean(pTweening.onError)) && ((pTweening.onError is Function)))){
try {
pTweening.onError.apply(pTweening.scope, [pTweening.scope, pError]);
} catch(metaError:Error) {
trace("## [Tweener] Error:", pTweening.scope, "raised an error while executing the 'onError' handler. Original error:\n", pError.getStackTrace(), "\nonError error:", metaError.getStackTrace());
};
} else {
if (!Boolean(pTweening.onError)){
trace("## [Tweener] Error: :", 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);
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 _local4:Array;
var _local5:Number;
var _local6:Number;
var _local7:String;
var _local8:String;
var _local9:Object;
var _local10:Number;
var _local11:Number;
var _local12:Array;
var _local13:Object;
var _local14:Object;
var _local15:Function;
var _local16:Object;
var _local17:TweenListObj;
var _local18:Number;
var _local19:Array;
var _local20:Array;
var _local21:String;
if ((((arguments.length < 2)) || ((arguments[0] == undefined)))){
return (false);
};
_local4 = new Array();
if ((arguments[0] is Array)){
_local5 = 0;
while (_local5 < arguments[0].length) {
_local4.push(arguments[0][_local5]);
_local5++;
};
} else {
_local5 = 0;
while (_local5 < (arguments.length - 1)) {
_local4.push(arguments[_local5]);
_local5++;
};
};
_local9 = TweenListObj.makePropertiesChain(arguments[(arguments.length - 1)]);
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
_local10 = (isNaN(_local9.time)) ? 0 : _local9.time;
_local11 = (isNaN(_local9.delay)) ? 0 : _local9.delay;
_local12 = new Array();
_local13 = {time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams:true};
_local14 = new Object();
for (_local7 in _local9) {
if (!_local13[_local7]){
if (_specialPropertySplitterList[_local7]){
_local19 = _specialPropertySplitterList[_local7].splitValues(_local9[_local7], _specialPropertySplitterList[_local7].parameters);
_local5 = 0;
while (_local5 < _local19.length) {
_local12[_local19[_local5].name] = {valueStart:undefined, valueComplete:_local19[_local5].value};
_local5++;
};
} else {
if (_specialPropertyModifierList[_local7] != undefined){
_local20 = _specialPropertyModifierList[_local7].modifyValues(_local9[_local7]);
_local5 = 0;
while (_local5 < _local20.length) {
_local14[_local20[_local5].name] = {modifierParameters:_local20[_local5].parameters, modifierFunction:_specialPropertyModifierList[_local7].getValue};
_local5++;
};
} else {
_local12[_local7] = {valueStart:undefined, valueComplete:_local9[_local7]};
};
};
};
};
for (_local7 in _local14) {
if (_local12[_local7] != undefined){
_local12[_local7].modifierParameters = _local14[_local7].modifierParameters;
_local12[_local7].modifierFunction = _local14[_local7].modifierFunction;
};
};
if (typeof(_local9.transition) == "string"){
_local21 = _local9.transition.toLowerCase();
_local15 = _transitionList[_local21];
} else {
_local15 = _local9.transition;
};
if (!Boolean(_local15)){
_local15 = _transitionList["easeoutexpo"];
};
_local5 = 0;
while (_local5 < _local4.length) {
_local16 = new Object();
for (_local7 in _local12) {
_local16[_local7] = new PropertyInfoObj(_local12[_local7].valueStart, _local12[_local7].valueComplete, _local12[_local7].modifierFunction, _local12[_local7].modifierParameters);
};
_local17 = new TweenListObj(_local4[_local5], (_currentTime + ((_local11 * 1000) / _timeScale)), (_currentTime + (((_local11 * 1000) + (_local10 * 1000)) / _timeScale)), (_local9.useFrames == true), _local15);
_local17.properties = _local16;
_local17.onStart = _local9.onStart;
_local17.onUpdate = _local9.onUpdate;
_local17.onComplete = _local9.onComplete;
_local17.onOverwrite = _local9.onOverwrite;
_local17.onError = _local9.onError;
_local17.onStartParams = _local9.onStartParams;
_local17.onUpdateParams = _local9.onUpdateParams;
_local17.onCompleteParams = _local9.onCompleteParams;
_local17.onOverwriteParams = _local9.onOverwriteParams;
_local17.rounded = _local9.rounded;
_local17.skipUpdates = _local9.skipUpdates;
removeTweensByTime(_local17.scope, _local17.properties, _local17.timeStart, _local17.timeComplete);
_tweenList.push(_local17);
if ((((_local10 == 0)) && ((_local11 == 0)))){
_local18 = (_tweenList.length - 1);
updateTweenByIndex(_local18);
removeTweenByIndex(_local18);
};
_local5++;
};
return (true);
}
public static function registerTransition(_arg1:String, _arg2:Function):void{
if (!_inited){
init();
};
_transitionList[_arg1] = _arg2;
}
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 (_tweenList[_local2].scope == _arg1){
for (_local3 in _tweenList[_local2].properties) {
_local4.push(_local3);
};
};
_local2++;
};
return (_local4);
}
private static function setPropertyValue(_arg1:Object, _arg2:String, _arg3:Number):void{
if (_specialPropertyList[_arg2] != undefined){
if (Boolean(_specialPropertyList[_arg2].parameters)){
_specialPropertyList[_arg2].setValue(_arg1, _arg3, _specialPropertyList[_arg2].parameters);
} else {
_specialPropertyList[_arg2].setValue(_arg1, _arg3);
};
} else {
_arg1[_arg2] = _arg3;
};
}
private static function getPropertyValue(_arg1:Object, _arg2:String):Number{
if (_specialPropertyList[_arg2] != undefined){
if (Boolean(_specialPropertyList[_arg2].parameters)){
return (_specialPropertyList[_arg2].getValue(_arg1, _specialPropertyList[_arg2].parameters));
};
return (_specialPropertyList[_arg2].getValue(_arg1));
} else {
};
return (!NULL!);
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local2 = 0;
while (_local2 < _tweenList.length) {
if (_tweenList[_local2].scope == _arg1){
return (true);
};
_local2++;
};
return (false);
}
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 (_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;
__tweener_controller__.removeEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
__tweener_controller__ = null;
}
public static function pauseTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj;
_local2 = _tweenList[_arg1];
if ((((_local2 == null)) || (_local2.isPaused))){
return (false);
};
_local2.timePaused = _currentTime;
_local2.isPaused = true;
return (true);
}
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 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)){
try {
_tweenList[i].onOverwrite.apply(_tweenList[i].scope, _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")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_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")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(pauseTweenByIndex, _arg1, _local3));
}
}
}//package caurina.transitions
Section 9
//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 auxProperties:Object;
public var timeComplete:Number;
public var onStartParams:Array;
public var rounded:Boolean;
public var properties:Object;
public var onUpdateParams:Array;
public var onComplete:Function;
public var updatesSkipped:Number;
public var onStart:Function;
public var skipUpdates:Number;
public var scope:Object;
public var isCaller:Boolean;
public var timePaused:Number;
public var transition:Function;
public var onCompleteParams:Array;
public var onError:Function;
public var timesCalled:Number;
public var onOverwrite:Function;
public var isPaused:Boolean;
public var waitFrames:Boolean;
public function TweenListObj(_arg1:Object, _arg2:Number, _arg3:Number, _arg4:Boolean, _arg5:Function){
scope = _arg1;
timeStart = _arg2;
timeComplete = _arg3;
useFrames = _arg4;
transition = _arg5;
auxProperties = new Object();
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);
_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.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:uint;
_local1 = "\n[TweenListObj ";
_local1 = (_local1 + ("scope:" + String(scope)));
_local1 = (_local1 + ", properties:");
_local2 = 0;
while (_local2 < properties.length) {
if (_local2 > 0){
_local1 = (_local1 + ",");
};
_local1 = (_local1 + ("[name:" + properties[_local2].name));
_local1 = (_local1 + (",valueStart:" + properties[_local2].valueStart));
_local1 = (_local1 + (",valueComplete:" + properties[_local2].valueComplete));
_local1 = (_local1 + "]");
_local2++;
};
_local1 = (_local1 + (", timeStart:" + String(timeStart)));
_local1 = (_local1 + (", timeComplete:" + String(timeComplete)));
_local1 = (_local1 + (", useFrames:" + String(useFrames)));
_local1 = (_local1 + (", transition:" + String(transition)));
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 (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 10
//ArrayUtil (com.adobe.utils.ArrayUtil)
package com.adobe.utils {
import com.util.*;
public class ArrayUtil {
public static function removeValueFromArray(_arg1:Array, _arg2:Object):void{
var _local3:uint;
var _local4:Number;
_local3 = _arg1.length;
_local4 = _local3;
while (_local4 > -1) {
if (_arg1[_local4] === _arg2){
_arg1.splice(_local4, 1);
};
_local4--;
};
}
public static function copyArray(_arg1:Array):Array{
return (_arg1.slice());
}
private static function randomSort(_arg1:Object, _arg2:Object):Number{
return (Rndm.bit());
}
public static function arrayContainsValue(_arg1:Array, _arg2:Object):Boolean{
return (!((_arg1.indexOf(_arg2) == -1)));
}
public static function arraysAreEqual(_arg1:Array, _arg2:Array):Boolean{
var _local3:Number;
var _local4:Number;
if (_arg1.length != _arg2.length){
return (false);
};
_local3 = _arg1.length;
_local4 = 0;
while (_local4 < _local3) {
if (_arg1[_local4] !== _arg2[_local4]){
return (false);
};
_local4++;
};
return (true);
}
public static function ranomizeArray(_arg1:Array):Array{
return (_arg1.sort(randomSort));
}
public static function createUniqueCopy(_arg1:Array):Array{
var _local2:Array;
var _local3:Number;
var _local4:Object;
var _local5:uint;
_local2 = new Array();
_local3 = _arg1.length;
_local5 = 0;
while (_local5 < _local3) {
_local4 = _arg1[_local5];
if (ArrayUtil.arrayContainsValue(_local2, _local4)){
} else {
_local2.push(_local4);
};
_local5++;
};
return (_local2);
}
}
}//package com.adobe.utils
Section 11
//GameEvent (com.game.events.GameEvent)
package com.game.events {
import flash.events.*;
import com.game.*;
public class GameEvent extends Event {
public var who:Actor;
public static const DIE:String = "bot_die";
public static const GAME_OVER:String = "game_over";
public static const HIT:String = "bot_hit";
public static const PARAMETER_BREACH:String = "bot_breach";
public function GameEvent(_arg1:String, _arg2:Actor=null){
super(_arg1, true);
this.who = _arg2;
}
override public function clone():Event{
return (new GameEvent(type, who));
}
}
}//package com.game.events
Section 12
//Actor (com.game.Actor)
package com.game {
import flash.display.*;
import com.util.*;
import com.game.events.*;
public class Actor extends MovieClip {
public var depthSort:Boolean;// = false
public var hitCount:Number;// = 0
public var scaleAdjustment:Number;// = 0
public var health:Number;// = 100
public var hitable:Boolean;// = true
public var skin:Class;
public var allowScale:Boolean;// = true
public var parallax:Boolean;// = true
public var currentState:String;
public var z:Number;// = 0
public var context:Engine;
public var isDead:Boolean;// = false
public var activeSkin:MovieClip;
public var shotsFired:Number;// = 0
public var velocity:Vector;
public var isDucking:Boolean;// = false
public function Actor(_arg1:Engine, _arg2:Class=null){
z = 0;
velocity = new Vector();
allowScale = true;
health = 100;
isDead = false;
hitable = true;
hitCount = 0;
shotsFired = 0;
depthSort = false;
parallax = true;
scaleAdjustment = 0;
isDucking = false;
this.context = _arg1;
this.skin = _arg2;
if (_arg2){
this.activeSkin = new (_arg2);
this.addChild(activeSkin);
};
super();
}
public function exist():void{
move();
if ((((health <= 0)) && (!(isDead)))){
die();
};
}
public function get position():Vector{
return (new Vector(x, y, z));
}
public function get hitRadius():Number{
return (this.width);
}
public function set position(_arg1:Vector):void{
x = _arg1.x;
y = _arg1.y;
z = _arg1.z;
}
public function die():void{
if (!this.isDead){
this.isDead = true;
dispatchEvent(new GameEvent(GameEvent.DIE, this));
onDeath();
};
}
public function move():void{
x = (x + velocity.x);
y = (y + velocity.y);
z = (z + velocity.z);
}
protected function onDeath():void{
context.removeActor(this);
}
}
}//package com.game
Section 13
//BossBot (com.game.BossBot)
package com.game {
import flash.display.*;
import com.util.*;
import flash.media.*;
public class BossBot extends Robot {
public function BossBot(_arg1:Engine){
super(_arg1, "BossBotSkin");
fireAnimation = true;
rateOfFire = 3;
pointValue = 50;
scaleAdjustment = 0.3;
maxShotSpace = (5 * 1000);
minShotSpace = (2 * 1000);
velocity = new Vector(0, 0, -1);
this.health = 1000;
weapon = new Weapon(this, null, {soundClass:"Laser", bulletSkin:"PlasmaBullet", bulletDamage:25, rateOfFire:0.2, bulletSpeed:6, unlimitedAmmo:true});
weapon.unlimitedAmmo = true;
}
public function fire():void{
trace("FIRE");
sayRandom();
shootAt(context.hero);
}
public function walk():void{
activeSkin.gotoAndPlay("walk");
}
override protected function onDeath():void{
var _local1:Sound;
_local1 = Main(context).getSoundByClass("ExplosionSound");
_local1.play(0, 1, new SoundTransform(0.5));
this.blendMode = BlendMode.NORMAL;
activeSkin.gotoAndPlay("die");
}
}
}//package com.game
Section 14
//Button (com.game.Button)
package com.game {
import flash.display.*;
import flash.events.*;
import caurina.transitions.*;
import flash.text.*;
public class Button extends MovieClip {
public var txtLabel:TextField;
public var bgOver:MovieClip;
public function Button(){
this.buttonMode = true;
super();
}
public function get label():String{
return (TextField(this["txtLabel"]).text);
}
private function onOver(_arg1:MouseEvent):void{
var _local2:MovieClip;
_local2 = MovieClip(this["bgOver"]);
Tweener.addTween(_local2, {alpha:1, time:1});
}
public function set label(_arg1:String):void{
TextField(this["txtLabel"]).text = _arg1;
}
private function onOut(_arg1:MouseEvent):void{
var _local2:MovieClip;
_local2 = MovieClip(this["bgOver"]);
Tweener.addTween(_local2, {alpha:0, time:1});
}
}
}//package com.game
Section 15
//Camera (com.game.Camera)
package com.game {
public class Camera extends Actor {
public var focalLength:Number;// = 80
public function Camera(_arg1:Engine){
focalLength = 80;
super(_arg1);
}
}
}//package com.game
Section 16
//Engine (com.game.Engine)
package com.game {
import flash.display.*;
import flash.events.*;
import com.util.*;
import com.game.events.*;
import flash.utils.*;
import com.adobe.utils.*;
public class Engine extends MovieClip {
public var hero:Hero;
public var actors:Array;
protected var camera:Camera;
public var key:KeyPoll;
protected var actorLayer:MovieClip;// = null
protected var gameTimer:Timer;
protected var frameRate:Number;// = 30
public function Engine(){
actors = new Array();
frameRate = 30;
actorLayer = null;
camera = new Camera(this);
camera.focalLength = 60;
key = new KeyPoll(this.stage);
addEventListener(GameEvent.DIE, onActorDeath);
super();
}
protected function setScale(_arg1:MovieClip):void{
var _local2:Number;
_local2 = (camera.focalLength / (camera.focalLength + _arg1.z));
if ((((_arg1 is Actor)) && (Actor(_arg1).allowScale))){
_arg1.scaleX = (_arg1.scaleY = (_local2 + Actor(_arg1).scaleAdjustment));
};
if (_arg1.parallax){
_arg1.x = (_arg1.x + -((camera.velocity.x * _local2)));
};
}
protected function sortDisplayList():void{
var _local1:int;
var _local2:int;
var _local3:MovieClip;
var _local4:uint;
_local1 = 0;
_local2 = 0;
_local3 = (actorLayer) ? actorLayer : this;
_local4 = _local3.numChildren;
_local1 = 0;
while (_local1 < (_local4 - 1)) {
_local2 = (_local1 + 1);
while (_local2 < _local4) {
if ((((((_local3.getChildAt(_local1) is Robot)) && (!(Robot(_local3.getChildAt(_local1)).isDead)))) && ((MovieClip(_local3.getChildAt(_local1)).z < MovieClip(_local3.getChildAt(_local2)).z)))){
_local3.swapChildrenAt(_local1, _local2);
};
_local2++;
};
_local1++;
};
}
public function get currentTime():Number{
return (new Date().time);
}
public function start():void{
gameTimer = new Timer((1000 / frameRate));
gameTimer.addEventListener(TimerEvent.TIMER, run);
gameTimer.start();
}
protected function run(_arg1:TimerEvent):void{
var _local2:MovieClip;
for each (_local2 in actors) {
setScale(_local2);
if ((((_local2 is Actor)) && (!(_local2.isDead)))){
_local2.exist();
};
};
sortDisplayList();
}
public function getScale(_arg1:Actor):Number{
var _local2:Number;
_local2 = (camera.focalLength / (camera.focalLength + _arg1.z));
return (_local2);
}
private function onActorDeath(_arg1:GameEvent):void{
}
public function removeActor(_arg1:MovieClip):void{
var _local2:Sprite;
_local2 = Sprite(_arg1.parent);
if (_local2){
_local2.removeChild(_arg1);
};
ArrayUtil.removeValueFromArray(actors, _arg1);
}
public function addActor(_arg1:MovieClip, _arg2:MovieClip=null):void{
if (_arg2){
_arg2.addChild(_arg1);
} else {
addChild(_arg1);
};
_arg1.cacheAsBitmap = true;
setScale(_arg1);
actors.push(_arg1);
}
}
}//package com.game
Section 17
//Hero (com.game.Hero)
package com.game {
import caurina.transitions.*;
import com.util.*;
import com.game.events.*;
import flash.utils.*;
import flash.geom.*;
import flash.ui.*;
public class Hero extends Actor {
private var moveFriction:Number;// = 0.9
private var deathBomb:Boolean;// = false
public var target:Actor;
public var shooting:Boolean;// = false
public var selectedWeapon:Weapon;
private var boost:Number;// = 2
public var weapons:Array;
public function Hero(_arg1:Engine, _arg2:String="HeroSkin"){
weapons = new Array();
deathBomb = false;
moveFriction = 0.9;
boost = 2;
shooting = false;
super(_arg1, (getDefinitionByName(_arg2) as Class));
weapons.push(new Weapon(this, null, {bulletDamage:35, unlimitedAmmo:true, rateOfFire:0.1, soundClass:"HeroGun", bulletSpeed:15}));
selectedWeapon = weapons[0];
selectedWeapon.volume = 0.4;
this.parallax = false;
}
public function shake():void{
if (shooting){
x = (x + (Rndm.integer(1, 4) * Rndm.sign()));
};
}
public function shoot():void{
var _local1:Boolean;
if (((!(isDucking)) && ((Main(context).cursorPosition.y < 280)))){
_local1 = false;
if (this.target){
_local1 = selectedWeapon.shootAt(target);
} else {
_local1 = selectedWeapon.shoot(Main(context).cursorPosition);
};
};
}
public function stopShooting():void{
shooting = false;
target = null;
}
override public function move():void{
var _local1:Point;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:String;
var _local8:Number;
if (((context.key.isDown(Keyboard.LEFT)) || (context.key.isDown(65)))){
velocity.x = (velocity.x + -(boost));
};
if (((context.key.isDown(Keyboard.RIGHT)) || (context.key.isDown(68)))){
velocity.x = (velocity.x + boost);
};
duck();
if ((((((x > 20)) && ((velocity.x < 0)))) || ((((x < 720)) && ((velocity.x > 0)))))){
velocity.x = (velocity.x * moveFriction);
x = (x + velocity.x);
} else {
velocity.x = 0;
};
_local1 = new Point(x, y);
_local2 = (_local1.x - context.mouseX);
_local3 = (_local1.y - context.mouseY);
_local4 = Math.atan2(_local3, _local2);
_local5 = (Math.abs((_local4 / Math.PI)) * 180);
_local6 = 0;
_local7 = "center";
if (_local5 < 60){
_local6 = ((3 - Math.round((_local5 / 20))) + 1);
_local7 = ("l" + _local6);
} else {
if (_local5 > 120){
_local8 = (_local5 - 100);
_local6 = (Math.round((_local8 / 20)) + 1);
if (_local6 > 3){
_local6 = 3;
};
_local7 = ("r" + _local6);
};
};
shake();
activeSkin.gotoAndStop(_local7);
}
override protected function onDeath():void{
this.dispatchEvent(new GameEvent(GameEvent.GAME_OVER, this));
}
public function startShooting():void{
shooting = true;
}
public function duck():void{
if (((!(isDucking)) && (((context.key.isDown(Keyboard.DOWN)) || (context.key.isDown(83)))))){
isDucking = true;
Tweener.addTween(this, {y:((y + height) - 50), time:0.5});
} else {
if (((isDucking) && (((context.key.isUp(Keyboard.DOWN)) && (context.key.isUp(83)))))){
isDucking = false;
Tweener.addTween(this, {y:(stage.stageHeight - 50), time:0.5});
};
};
}
override public function exist():void{
if (shooting){
shoot();
};
super.exist();
}
}
}//package com.game
Section 18
//HighScores (com.game.HighScores)
package com.game {
import flash.display.*;
import flash.events.*;
import caurina.transitions.*;
import flash.utils.*;
public class HighScores extends MovieClip {
private var saving:Boolean;// = false
private var newScoreItem:Object;// = null
protected var scores:Scores;
public var scoreList:MovieClip;
protected var scoreItems:Array;
public var frmHighScores:HighScoreForm;
private var newScore:Number;// = 0
public function HighScores(){
scoreItems = new Array();
newScore = 0;
newScoreItem = null;
saving = false;
super();
}
public function get scoreListContainer():MovieClip{
return ((this["scoreList"] as MovieClip));
}
private function onSaveScores(_arg1:Event):void{
trace("HighScores.saved");
saving = false;
scoreForm.visible = false;
listScores();
}
public function listScores():void{
var _local1:int;
var _local2:Class;
var _local3:MovieClip;
var _local4:Object;
clearScores();
_local1 = 0;
while (_local1 < scores.scores.length) {
_local2 = (getDefinitionByName("ScoreListItem") as Class);
_local3 = (new (_local2) as MovieClip);
_local4 = scores.scores[_local1];
_local3.txtRank.text = ((_local1 + 1) + ".");
_local3.txtName.text = _local4.name;
_local3.txtScore.text = _local4.score;
_local3.y = ((_local1 * _local3.height) + 2);
scoreListContainer.addChild(_local3);
scoreItems.push(_local3);
if (_local4 == newScoreItem){
Tweener.addTween(_local3, {_color:0xFF9100, time:2});
};
_local1++;
};
}
public function get scoreForm():MovieClip{
return ((this["frmHighScores"] as MovieClip));
}
public function loadScores(_arg1:Number):void{
var newScore = _arg1;
this.newScore = newScore;
scoreForm.visible = false;
scores = new Scores("http://portlandstudios.com/PARG/scores.db", "http://portlandstudios.com/PARG/scoreProxy.php");
scores.addEventListener(Scores.SCORES_SAVED, onSaveScores);
scores.addEventListener(Scores.SCORES_LOADED, function (_arg1:Event):void{
if (scores.isHighScore(newScore)){
trace((newScore + " is a high score"));
showScoreForm();
} else {
trace((newScore + " is NOT a high score"));
listScores();
};
});
scores.loadScores();
}
public function clearScores():void{
var _local1:MovieClip;
for each (_local1 in scoreItems) {
scoreListContainer.removeChild(_local1);
};
scoreItems = new Array();
}
private function showScoreForm():void{
var _local1:Button;
scoreForm.visible = true;
scoreForm.txtMessage.visible = false;
scoreForm.txtName.text = "";
_local1 = Button(scoreForm.btnSubmit);
_local1.label = "Submit Score";
if (_local1.hasEventListener(MouseEvent.CLICK)){
_local1.removeEventListener(MouseEvent.CLICK, onSaveScore);
};
_local1.addEventListener(MouseEvent.CLICK, onSaveScore);
}
private function onSaveScore(_arg1:MouseEvent):void{
var _local2:String;
if (!saving){
_local2 = scoreForm.txtName.text;
if (_local2 != ""){
scoreForm.txtMessage.visible = false;
newScoreItem = scores.addScore(_local2, newScore);
Button(scoreForm.btnSubmit).label = "Saving...";
saving = true;
scores.saveScores();
} else {
saving = false;
scoreForm.txtMessage.visible = true;
scoreForm.txtMessage.text = "Please enter a name.";
};
};
}
}
}//package com.game
Section 19
//LoadingBar (com.game.LoadingBar)
package com.game {
import flash.display.*;
import flash.text.*;
public class LoadingBar extends MovieClip {
public var nameLabel:String;// = ""
public var progressBar:MovieClip;
public var txtPercent:TextField;
public function LoadingBar(){
nameLabel = "";
super();
}
private function get bar():MovieClip{
return (MovieClip(this["progressBar"]));
}
public function get label():TextField{
return (TextField(this["txtPercent"]));
}
public function setProgress(_arg1:Number):void{
bar.width = (this.width * (_arg1 / 100));
label.text = ((nameLabel + _arg1) + "%");
}
}
}//package com.game
Section 20
//Projectile (com.game.Projectile)
package com.game {
import flash.display.*;
import com.util.*;
import com.game.events.*;
public class Projectile extends Actor {
public var destination:Vector;
public var shooter:Actor;
public var origion:Vector;
public var _speed:Number;// = 10
public var damage:Number;// = 20
public var target:Actor;
public var impactExplosion:String;// = "BulletHit"
public function Projectile(_arg1:Actor, _arg2:Class){
_speed = 10;
damage = 20;
impactExplosion = "BulletHit";
this.shooter = _arg1;
super(_arg1.context, _arg2);
parallax = false;
hitable = false;
velocity = new Vector(_speed, _speed, _speed);
}
public function set speed(_arg1:Number):void{
this._speed = _arg1;
velocity = new Vector(_arg1, _arg1, _arg1);
}
override public function set position(_arg1:Vector):void{
if (!origion){
origion = _arg1;
};
super.position = _arg1;
}
public function hitTest():void{
var _local1:MovieClip;
var _local2:MovieClip;
var _local3:Vector;
for each (_local1 in context.actors) {
if ((((((((_local1 is Actor)) && (_local1.hitable))) && (!(_local1.isDead)))) && (!((_local1 == this.shooter))))){
if ((((_local1 is Robot)) && ((shooter is Robot)))){
break;
};
_local2 = (_local1.activeSkin["hitBox"]) ? MovieClip(_local1.activeSkin["hitBox"]) : _local1;
if (this.hitTestObject(_local2)){
if (!Actor(_local1).isDucking){
_local1.health = (_local1.health - damage);
shooter.hitCount++;
dispatchEvent(new GameEvent(GameEvent.HIT, Actor(_local1)));
_local3 = Main(context).cursorPosition;
_local3.z = this.z;
Main(context).explosion(_local3, impactExplosion);
};
die();
};
};
};
}
override public function move():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Boolean;
var _local11:Boolean;
var _local12:Boolean;
var _local13:Boolean;
_local1 = (destination.x - x);
_local2 = (destination.y - y);
_local3 = (destination.z - z);
_local4 = Math.atan2(_local2, _local1);
_local5 = Math.atan2(_local3, _local2);
rotation = ((_local4 / Math.PI) * 180);
x = (x + (Math.cos(_local4) * velocity.x));
y = (y + (Math.sin(_local4) * velocity.y));
_local6 = ((_local1 + _local2) / 2);
_local7 = (((destination.x - origion.x) + (destination.y - origion.y)) / 2);
_local8 = Math.abs((1 - (_local6 / _local7)));
_local9 = -((origion.z - destination.z));
z = (origion.z + (_local9 * _local8));
_local10 = (Math.abs(_local1) <= 10);
_local11 = (Math.abs(_local2) <= 10);
_local12 = (Math.abs(_local3) <= 30);
_local13 = ((((_local10) && (_local11))) || ((z < 0)));
if (_local13){
die();
};
}
override public function exist():void{
super.exist();
hitTest();
}
}
}//package com.game
Section 21
//Robot (com.game.Robot)
package com.game {
import flash.display.*;
import com.util.*;
import flash.media.*;
import flash.utils.*;
public class Robot extends Actor {
public var weapon:Weapon;
public var breached:Boolean;// = false
public var availableWeapons:Array;
public var dialogByName:Dictionary;
public var power:Number;// = 10
public var nextShotTime:Number;// = 0
public var maxShotSpace:Number;// = 1000
public var dialog:Array;
public var target:Actor;
public var lastShotTime:Number;// = 0
public var rateOfFire:Number;// = 3
public var pointValue:Number;// = 10
public var weaponContainer:MovieClip;
public var accuracyRange:Number;// = 100
public var weapons:Array;
public var fireAnimation:Boolean;// = false
public var minShotSpace:Number;// = 0
public function Robot(_arg1:Engine, _arg2:String="RobotSkin"){
var _local3:Class;
power = 10;
weapons = new Array();
rateOfFire = 3;
lastShotTime = 0;
nextShotTime = 0;
accuracyRange = 100;
maxShotSpace = (1 * 1000);
minShotSpace = 0;
availableWeapons = new Array();
fireAnimation = false;
breached = false;
pointValue = 10;
dialog = new Array();
dialogByName = new Dictionary();
_local3 = (getDefinitionByName(_arg2) as Class);
super(_arg1, _local3);
weapon = new Weapon(this, null, {soundClass:"Laser", bulletSkin:"LaserBullet", bulletDamage:5, rateOfFire:1, bulletSpeed:6, unlimitedAmmo:false});
weapon.clipSize = 2;
setNextShotTime();
depthSort = true;
addDialog("DialogDanger");
addDialog("DialogGameover");
addDialog("DialogStop");
addDialog("DialogTerror");
}
public function addWeapon(_arg1:Weapon):void{
MovieClip(activeSkin["weaponContainer"]).addChild(_arg1);
weapons.push(_arg1);
}
public function get canFire():Boolean{
return ((((((((rateOfFire > 0)) && ((context.currentTime >= nextShotTime)))) && (!(context.hero.isDead)))) && (!(breached))));
}
private function setNextShotTime():void{
nextShotTime = (context.currentTime + ((rateOfFire * 1000) + Rndm.integer(minShotSpace, maxShotSpace)));
}
public function sayRandom():void{
var _local1:Number;
var _local2:Sound;
if (dialog.length > 0){
_local1 = Rndm.integer(0, (dialog.length - 1));
_local2 = dialog[_local1];
_local2.play();
};
}
public function shootAt(_arg1:Actor, _arg2:Number=0):void{
this.target = _arg1;
weapon.shootAt(_arg1, _arg2);
}
override public function exist():void{
super.exist();
if (canFire){
if (!fireAnimation){
shootAt(context.hero, accuracyRange);
} else {
activeSkin.gotoAndPlay("shoot");
};
lastShotTime = context.currentTime;
setNextShotTime();
};
}
public function addDialog(_arg1:String):void{
var _local2:Class;
var _local3:Sound;
_local2 = (getDefinitionByName(_arg1) as Class);
_local3 = (new (_local2) as Sound);
this.dialog.push(_local3);
this.dialogByName[_arg1.toLowerCase()] = _local3;
}
override protected function onDeath():void{
var _local1:Sound;
if (Rndm.bit(0.2)){
sayRandom();
};
_local1 = Main(context).getSoundByClass("ExplosionSound");
_local1.play(0, 1, new SoundTransform(0.5));
activeSkin.gotoAndPlay("die");
}
public function say(_arg1:String):void{
if (dialogByName[_arg1.toLowerCase()]){
Sound(dialogByName[_arg1.toLowerCase()]).play();
};
}
public static function CreateRandomBot(_arg1:Engine, _arg2:Object):Robot{
var _local3:Robot;
var _local4:Number;
_local3 = new Robot(_arg1, "RobotSkin");
_local4 = (_arg2.minBotSpeed) ? _arg2.minBotSpeed : 1;
_local3.velocity = new Vector(0, 0, -(Rndm.integer(_local4, _arg2.maxBotSpeed)));
_local3.rateOfFire = _arg2.botFireRate;
return (_local3);
}
}
}//package com.game
Section 22
//Scores (com.game.Scores)
package com.game {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class Scores extends EventDispatcher {
public var resourceUrl:String;
public var totalScoresStored:Number;// = 10
public var scores:Array;
public var saveProxy:String;
public static const SCORES_LOADED:String = "scores_loaded";
public static const SCORES_SAVED:String = "scores_saved";
public static const SCORES_ERROR:String = "scores_error";
public function Scores(_arg1:String, _arg2:String){
scores = new Array();
totalScoresStored = 10;
super();
this.resourceUrl = _arg1;
this.saveProxy = _arg2;
}
private function saveError(_arg1:Event):void{
trace(("Error saving scores: " + _arg1));
}
public function isHighScore(_arg1:Number):Boolean{
var _local2:Number;
_local2 = getScorePosition(_arg1);
return ((((_local2 < totalScoresStored)) && (!((_local2 == -1)))));
}
public function sortScores():void{
scores = scores.sortOn("score", (Array.NUMERIC | Array.DESCENDING));
}
public function getScorePosition(_arg1:Number):int{
var _local2:Number;
var _local3:int;
_local2 = -1;
_local3 = 0;
while (_local3 < scores.length) {
if (_arg1 > scores[_local3].score){
_local2 = _local3;
};
_local3++;
};
if (scores.length < totalScoresStored){
_local2 = scores.length;
};
return (_local2);
}
public function loadScores():void{
var url:String;
var recordBytes:ByteArray;
var urlStream:URLLoader;
url = resourceUrl;
url = (url + ("?nocache=" + new Date().getTime()));
recordBytes = new ByteArray();
urlStream = new URLLoader();
urlStream.dataFormat = URLLoaderDataFormat.BINARY;
urlStream.addEventListener(IOErrorEvent.IO_ERROR, function (_arg1:Event):void{
trace(("error loading scores: " + _arg1));
dispatchEvent(new Event(SCORES_LOADED));
});
urlStream.addEventListener(Event.COMPLETE, function (_arg1:Event):void{
var recordBytes:ByteArray;
var record:Object;
var e = _arg1;
recordBytes = URLLoader(e.target).data;
try {
record = recordBytes.readObject();
if (record){
scores = (record as Array);
sortScores();
};
} catch(e:Error) {
trace(("score data corrupt: " + e));
scores = new Array();
};
trace(("loaded data success: " + scores));
dispatchEvent(new Event(SCORES_LOADED));
});
trace(("loading data from: " + url));
urlStream.load(new URLRequest(url));
}
public function traceScores():void{
var _local1:Object;
for each (_local1 in scores) {
trace(((_local1.name + ": ") + _local1.score));
};
}
public function addScore(_arg1:String, _arg2:Number):Object{
var _local3:Object;
_local3 = {name:_arg1, score:_arg2};
scores.push(_local3);
sortScores();
if (scores.length > totalScoresStored){
scores.pop();
};
return (_local3);
}
private function onSaveScores(_arg1:Event):void{
var _local2:String;
_local2 = _arg1.target.data;
trace(("saved scores: " + _local2));
dispatchEvent(new Event(SCORES_SAVED));
}
public function saveScores():void{
var _local1:ByteArray;
var _local2:URLRequest;
var _local3:URLLoader;
sortScores();
_local1 = new ByteArray();
_local1.writeObject(scores);
_local2 = new URLRequest(saveProxy);
_local3 = new URLLoader();
_local3.addEventListener(Event.COMPLETE, onSaveScores);
_local3.addEventListener(ProgressEvent.PROGRESS, saveError);
_local3.addEventListener(IOErrorEvent.IO_ERROR, saveError);
_local3.addEventListener(SecurityErrorEvent.SECURITY_ERROR, saveError);
_local2.contentType = "application/octet-stream";
_local2.method = URLRequestMethod.POST;
_local2.data = _local1;
trace(("sending save request to: " + saveProxy));
_local3.load(_local2);
}
}
}//package com.game
Section 23
//Weapon (com.game.Weapon)
package com.game {
import flash.display.*;
import com.util.*;
import flash.media.*;
import flash.utils.*;
import flash.geom.*;
public class Weapon extends MovieClip {
public var volume:Number;// = 1
public var muzzleFlash:String;// = "MuzzleFlash"
public var bulletDamage:Number;// = 10
public var automatic:Boolean;// = false
public var origion:MovieClip;
public var sound:Sound;
public var bulletExplosion:String;// = "BulletHit"
public var soundChannel:SoundChannel;
public var clipSize:Number;// = 12
public var unlimitedAmmo:Boolean;// = false
public var skin:MovieClip;// = null
public var bulletSpeed:Number;// = 10
public var bulletSkin:String;// = "Bullet"
public var soundClass:String;// = "PistolShot"
public var rateOfFire:Number;// = 1
public var owner:Actor;
public var ammo:Number;// = 0
public var lastFireTime:Number;// = 0
public function Weapon(_arg1:Actor, _arg2:String=null, _arg3:Object=null){
var _local4:Class;
var _local5:Class;
var _local6:String;
bulletDamage = 10;
bulletSkin = "Bullet";
bulletExplosion = "BulletHit";
muzzleFlash = "MuzzleFlash";
bulletSpeed = 10;
rateOfFire = 1;
automatic = false;
clipSize = 12;
ammo = 0;
unlimitedAmmo = false;
soundClass = "PistolShot";
skin = null;
lastFireTime = 0;
volume = 1;
if (_arg2){
_local5 = (getDefinitionByName(_arg2) as Class);
if (_local5){
skin = (new (_local5) as MovieClip);
addChild(skin);
};
};
if (_arg3){
for (_local6 in _arg3) {
if (this.hasOwnProperty(_local6)){
this[_local6] = _arg3[_local6];
};
};
};
_local4 = (getDefinitionByName(soundClass) as Class);
sound = (new (_local4) as Sound);
reload();
this.owner = _arg1;
super();
}
public function get canFire():Boolean{
return (((!(outOfAmmo)) && (((owner.context.currentTime - lastFireTime) > (1000 * rateOfFire)))));
}
public function shoot(_arg1:Vector, _arg2:Number=0):Boolean{
var _local3:Projectile;
var _local4:Point;
if (canFire){
soundChannel = sound.play(0, 1, new SoundTransform(volume));
_local3 = new Projectile(owner, (getDefinitionByName(bulletSkin) as Class));
origion = (((owner.activeSkin) && (owner.activeSkin["origion"]))) ? (owner.activeSkin["origion"] as MovieClip) : owner;
_local4 = new Point();
if (((owner.activeSkin) && (owner.activeSkin["origion"]))){
_local4 = origion.localToGlobal(new Point(origion.x, origion.y));
if (!(owner is BossBot)){
_local4.x = (_local4.x + -(origion.x));
_local4.y = (_local4.y + -(origion.y));
};
} else {
_local4 = localToGlobal(new Point(owner.x, owner.y));
};
_local3.position = new Vector(_local4.x, _local4.y, owner.z);
_local3.damage = bulletDamage;
_local3.impactExplosion = bulletExplosion;
if (_arg2 > 0){
_arg1.x = (_arg1.x + (Rndm.integer(0, _arg2) * Rndm.sign()));
_arg1.y = (_arg1.y + (Rndm.integer(0, _arg2) * Rndm.sign()));
_arg1.z = (_arg1.z + (Rndm.integer(0, _arg2) * Rndm.sign()));
};
if ((owner is Robot)){
_local3.parallax = true;
};
_local3.destination = _arg1;
_local3.speed = bulletSpeed;
Main(owner.context).addProjectile(_local3);
_local3.move();
ammo--;
lastFireTime = owner.context.currentTime;
owner.shotsFired++;
Main(owner.context).explosion(_local3.position, "MuzzleFlash", Main(owner.context).getMC("projectileContainer"));
return (true);
};
return (false);
}
public function reload():void{
ammo = clipSize;
}
public function get outOfAmmo():Boolean{
return ((((ammo <= 0)) && (!(unlimitedAmmo))));
}
public function shootAt(_arg1:Actor, _arg2:Number=0):Boolean{
return (shoot(_arg1.position, _arg2));
}
}
}//package com.game
Section 24
//KeyPoll (com.util.KeyPoll)
package com.util {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class KeyPoll {
private var states:ByteArray;
private var dispObj:DisplayObject;
public function KeyPoll(_arg1:DisplayObject){
states = new ByteArray();
states.writeUnsignedInt(0);
states.writeUnsignedInt(0);
states.writeUnsignedInt(0);
states.writeUnsignedInt(0);
states.writeUnsignedInt(0);
states.writeUnsignedInt(0);
states.writeUnsignedInt(0);
states.writeUnsignedInt(0);
dispObj = _arg1;
dispObj.addEventListener(KeyboardEvent.KEY_DOWN, keyDownListener, false, 0, true);
dispObj.addEventListener(KeyboardEvent.KEY_UP, keyUpListener, false, 0, true);
dispObj.addEventListener(Event.ACTIVATE, activateListener, false, 0, true);
dispObj.addEventListener(Event.DEACTIVATE, deactivateListener, false, 0, true);
}
public function isUp(_arg1:uint):Boolean{
return (((states[(_arg1 >>> 3)] & (1 << (_arg1 & 7))) == 0));
}
private function activateListener(_arg1:Event):void{
var _local2:int;
_local2 = 0;
while (_local2 < 8) {
states[_local2] = 0;
_local2++;
};
}
private function deactivateListener(_arg1:Event):void{
var _local2:int;
_local2 = 0;
while (_local2 < 8) {
states[_local2] = 0;
_local2++;
};
}
public function isDown(_arg1:uint):Boolean{
return (!(((states[(_arg1 >>> 3)] & (1 << (_arg1 & 7))) == 0)));
}
private function keyDownListener(_arg1:KeyboardEvent):void{
states[(_arg1.keyCode >>> 3)] = (states[(_arg1.keyCode >>> 3)] | (1 << (_arg1.keyCode & 7)));
}
private function keyUpListener(_arg1:KeyboardEvent):void{
states[(_arg1.keyCode >>> 3)] = (states[(_arg1.keyCode >>> 3)] & ~((1 << (_arg1.keyCode & 7))));
}
}
}//package com.util
Section 25
//Rndm (com.util.Rndm)
package com.util {
public class Rndm {
protected var _currentSeed:uint;// = 0
protected var _seed:uint;// = 0
protected static var _instance:Rndm;
public function Rndm(_arg1:uint=1){
_seed = 0;
_currentSeed = 0;
super();
_seed = (_currentSeed = _arg1);
}
public function set seed(_arg1:uint):void{
_seed = (_currentSeed = _arg1);
}
public function random():Number{
return ((((_currentSeed = ((_currentSeed * 16807) % 2147483647)) / 2147483647) + 2.33E-10));
}
public function boolean(_arg1:Number=0.5):Boolean{
return ((random() < _arg1));
}
public function get currentSeed():uint{
return (_currentSeed);
}
public function bit(_arg1:Number=0.5):int{
return (((random())<_arg1) ? 1 : 0);
}
public function get seed():uint{
return (_seed);
}
public function reset():void{
_seed = _currentSeed;
}
public function float(_arg1:Number, _arg2:Number=NaN):Number{
if (isNaN(_arg2)){
_arg2 = _arg1;
_arg1 = 0;
};
return (((random() * (_arg2 - _arg1)) + _arg1));
}
public function sign(_arg1:Number=0.5):int{
return (((random())<_arg1) ? 1 : -1);
}
public function integer(_arg1:Number, _arg2:Number=NaN):int{
if (isNaN(_arg2)){
_arg2 = _arg1;
_arg1 = 0;
};
return (Math.floor(float(_arg1, _arg2)));
}
public static function random():Number{
return (instance.random());
}
public static function set seed(_arg1:uint):void{
instance.seed = _arg1;
}
public static function get currentSeed():uint{
return (instance.currentSeed);
}
public static function bit(_arg1:Number=0.5):int{
return (instance.bit(_arg1));
}
public static function boolean(_arg1:Number=0.5):Boolean{
return (instance.boolean(_arg1));
}
public static function get seed():uint{
return (instance.seed);
}
public static function get instance():Rndm{
if (_instance == null){
_instance = new (Rndm);
};
return (_instance);
}
public static function reset():void{
instance.reset();
}
public static function float(_arg1:Number, _arg2:Number=NaN):Number{
return (instance.float(_arg1, _arg2));
}
public static function sign(_arg1:Number=0.5):int{
return (instance.sign(_arg1));
}
public static function integer(_arg1:Number, _arg2:Number=NaN):int{
return (instance.integer(_arg1, _arg2));
}
}
}//package com.util
Section 26
//Vector (com.util.Vector)
package com.util {
public class Vector {
public var x:Number;
public var y:Number;
public var z:Number;
public function Vector(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
}
public function toString():String{
return ((((((("(" + this.x) + ", ") + this.y) + ", ") + this.z) + ")"));
}
}
}//package com.util
Section 27
//HallieBot (com.HallieBot)
package com {
import com.util.*;
import com.game.*;
public class HallieBot extends Robot {
private var dir:Number;// = 1
private var nextDirChange:Number;// = 0
public function HallieBot(_arg1:Engine){
dir = 1;
nextDirChange = 0;
super(_arg1, "HallieBotSkin");
rateOfFire = 0;
scaleAdjustment = 0.1;
pointValue = 20;
power = 30;
velocity = new Vector(0, 0, -(Rndm.integer(6, 12)));
}
public function changeDirection():void{
dir = -(dir);
velocity.z = -(Rndm.integer(6, 12));
nextDirChange = (context.currentTime + Rndm.integer(300, 2000));
}
override public function move():void{
if (context.currentTime >= nextDirChange){
changeDirection();
};
this.velocity.x = (Rndm.integer(1, 5) * dir);
if (velocity.x <= 0){
activeSkin.gotoAndPlay("left");
} else {
activeSkin.gotoAndPlay("right");
};
super.move();
}
override protected function onDeath():void{
Main(context).removeBot(this);
Main(context).nuclearExplosion();
}
}
}//package com
Section 28
//AssetHolder_9 (parg_fla.AssetHolder_9)
package parg_fla {
import flash.display.*;
public dynamic class AssetHolder_9 extends MovieClip {
public function AssetHolder_9(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package parg_fla
Section 29
//FlashMessage_47 (parg_fla.FlashMessage_47)
package parg_fla {
import flash.display.*;
public dynamic class FlashMessage_47 extends MovieClip {
public var message:MovieClip;
}
}//package parg_fla
Section 30
//flashTxt_48 (parg_fla.flashTxt_48)
package parg_fla {
import flash.display.*;
import flash.text.*;
public dynamic class flashTxt_48 extends MovieClip {
public var txtMessage:TextField;
}
}//package parg_fla
Section 31
//HealthMeter_45 (parg_fla.HealthMeter_45)
package parg_fla {
import flash.display.*;
import com.game.*;
public dynamic class HealthMeter_45 extends MovieClip {
public var barCity:LoadingBar;
public var barHealth:LoadingBar;
}
}//package parg_fla
Section 32
//ScoreScreen_46 (parg_fla.ScoreScreen_46)
package parg_fla {
import flash.display.*;
import com.game.*;
import flash.text.*;
public dynamic class ScoreScreen_46 extends MovieClip {
public var txtScore:TextField;
public var txtKills:TextField;
public var txtBreaches:TextField;
public var btnNext:Button;
public var txtAccuracy:TextField;
public var txtTitle:TextField;
}
}//package parg_fla
Section 33
//ScreenGameOver_40 (parg_fla.ScreenGameOver_40)
package parg_fla {
import flash.display.*;
import com.game.*;
import flash.text.*;
public dynamic class ScreenGameOver_40 extends MovieClip {
public var txtScore:TextField;
public var highScores:HighScores;
public var btnAgain:Button;
public var gameBy:MovieClip;
}
}//package parg_fla
Section 34
//AirExplosion (AirExplosion)
package {
import flash.display.*;
public dynamic class AirExplosion extends MovieClip {
public function AirExplosion(){
addFrameScript(11, frame12);
}
function frame12(){
Main(root).killSelf(this);
stop();
}
}
}//package
Section 35
//BossBotSkin (BossBotSkin)
package {
import flash.display.*;
import com.game.*;
public dynamic class BossBotSkin extends MovieClip {
public var origion:MovieClip;
public var hitBox:MovieClip;
public function BossBotSkin(){
addFrameScript(14, frame15, 43, frame44, 88, frame89, 105, frame106);
}
function frame89(){
stop();
BossBot(parent).walk();
}
function frame15(){
gotoAndPlay("walk");
}
function frame106(){
stop();
}
function frame44(){
BossBot(parent).fire();
}
}
}//package
Section 36
//BreachSiren (BreachSiren)
package {
import flash.media.*;
public dynamic class BreachSiren extends Sound {
}
}//package
Section 37
//Bullet (Bullet)
package {
import flash.display.*;
public dynamic class Bullet extends MovieClip {
}
}//package
Section 38
//BulletHit (BulletHit)
package {
import flash.display.*;
public dynamic class BulletHit extends MovieClip {
public function BulletHit(){
addFrameScript(5, frame6);
}
function frame6(){
Main(root).killSelf(this);
stop();
}
}
}//package
Section 39
//Circle (Circle)
package {
import flash.display.*;
public dynamic class Circle extends MovieClip {
}
}//package
Section 40
//DialogDanger (DialogDanger)
package {
import flash.media.*;
public dynamic class DialogDanger extends Sound {
}
}//package
Section 41
//DialogGameover (DialogGameover)
package {
import flash.media.*;
public dynamic class DialogGameover extends Sound {
}
}//package
Section 42
//DialogStop (DialogStop)
package {
import flash.media.*;
public dynamic class DialogStop extends Sound {
}
}//package
Section 43
//DialogTerror (DialogTerror)
package {
import flash.media.*;
public dynamic class DialogTerror extends Sound {
}
}//package
Section 44
//DramaticBoom (DramaticBoom)
package {
import flash.media.*;
public dynamic class DramaticBoom extends Sound {
}
}//package
Section 45
//ExplosionSound (ExplosionSound)
package {
import flash.media.*;
public dynamic class ExplosionSound extends Sound {
}
}//package
Section 46
//GunCursor (GunCursor)
package {
import flash.display.*;
public dynamic class GunCursor extends MovieClip {
}
}//package
Section 47
//HallieBotSkin (HallieBotSkin)
package {
import flash.display.*;
public dynamic class HallieBotSkin extends MovieClip {
public function HallieBotSkin(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 48
//HallieTwinkle (HallieTwinkle)
package {
import flash.media.*;
public dynamic class HallieTwinkle extends Sound {
}
}//package
Section 49
//HeroGun (HeroGun)
package {
import flash.media.*;
public dynamic class HeroGun extends Sound {
}
}//package
Section 50
//HeroSkin (HeroSkin)
package {
import flash.display.*;
public dynamic class HeroSkin extends MovieClip {
public var origion:MovieClip;
public var hitBox:MovieClip;
public function HeroSkin(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7);
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 51
//HighScoreForm (HighScoreForm)
package {
import flash.display.*;
import com.game.*;
import flash.text.*;
public dynamic class HighScoreForm extends MovieClip {
public var txtName:TextField;
public var txtMessage:TextField;
public var btnSubmit:Button;
}
}//package
Section 52
//Laser (Laser)
package {
import flash.media.*;
public dynamic class Laser extends Sound {
}
}//package
Section 53
//LaserBullet (LaserBullet)
package {
import flash.display.*;
public dynamic class LaserBullet extends MovieClip {
}
}//package
Section 54
//Main (Main)
package {
import flash.display.*;
import flash.events.*;
import caurina.transitions.*;
import com.util.*;
import flash.filters.*;
import com.game.*;
import com.game.events.*;
import flash.media.*;
import flash.utils.*;
import com.adobe.utils.*;
import com.*;
import flash.net.*;
import flash.ui.*;
public class Main extends Engine {
private var deadBots:Array;
public var music:Sound;
private var botCounter:Number;// = 0
private var playCount:Number;// = 0
public var bgFor:MovieClip;
public var bg:MovieClip;
public var bgForClouds:MovieClip;
public var healthTimer:Timer;
public var dramaticBoom:Sound;
public var hallieTwinkle:Sound;
private var stageEnded:Boolean;// = false
public var redOverlay:MovieClip;
public var loadingBG:MovieClip;
public var screenGameOver:MovieClip;
public var projectileContainer:MovieClip;
private var score:Number;// = 0
public var whiteOver:MovieClip;
public var healthMeter:MovieClip;
public var botContainer:MovieClip;
public var breachSiren:Sound;
private var breaches:Number;// = 0
public var musicTransform:SoundTransform;
private var currentStageIndex:Number;// = 0
private var kills:Number;// = 0
private var currentStage:Object;
public var musicGameOver:Sound;
public var musicChannel:SoundChannel;
private var paused:Boolean;// = true
public var loadingBar:LoadingBar;
private var isFlashing:Boolean;// = false
private var stages:Array;
public var flashTimer:Timer;
private var cursor:MovieClip;
public var musicGameOverChannel:SoundChannel;
public var btnStart:Button;
public var breathingDude:MovieClip;
private var blurDistance:Number;// = 680
private var maxBodyCount:Number;// = 10
public var adContainer:MovieClip;
private var globalSoundTransform:SoundTransform;
private var horizon:Vector;
private var bots:Array;
public var heroContainer:MovieClip;
private var parameter:Vector;
public var breachSirenChannel:SoundChannel;
private var cityHealth:Number;// = 100
private var botsCreated:Number;// = 0
private var botTimer:Timer;
public var bgMid:MovieClip;
public var expiredBotCount:Number;// = 0
private var bossCounter:Number;// = 0
public var statScreen:MovieClip;
public var whiteOverlay:MovieClip;
public var flashMessage:MovieClip;
private var gameOver:Boolean;// = false
public function Main(){
var startButton:Button;
horizon = new Vector(0, 120, 900);
parameter = new Vector(0, 0, 50);
bots = new Array();
deadBots = new Array();
maxBodyCount = 10;
blurDistance = 680;
paused = true;
cityHealth = 100;
stages = new Array();
currentStageIndex = 0;
botCounter = 0;
botsCreated = 0;
score = 0;
kills = 0;
breaches = 0;
playCount = 0;
gameOver = false;
musicTransform = new SoundTransform(1);
healthTimer = new Timer((9 * 1000));
expiredBotCount = 0;
bossCounter = 0;
stageEnded = false;
isFlashing = false;
globalSoundTransform = new SoundTransform();
super();
addFrameScript(0, frame1, 2, frame3);
LoadingBar(this["loadingBar"]).nameLabel = "LOADING...";
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, loadingProgress);
this.loaderInfo.addEventListener(Event.COMPLETE, loadingComplete);
startButton = Button(this["btnStart"]);
startButton.label = "START GAME!";
startButton.addEventListener(MouseEvent.CLICK, function (_arg1:Event):void{
play();
});
}
protected function onClickBot(_arg1:MouseEvent):void{
var _local2:MovieClip;
_local2 = _arg1.target.parent.parent;
if ((_local2 is Robot)){
hero.target = Robot(_local2);
};
}
private function onDie(_arg1:GameEvent):void{
var _local2:Robot;
if ((((((_arg1.who is Robot)) || ((_arg1.who is BossBot)))) && (!((_arg1.who is HallieBot))))){
botCounter++;
_local2 = Robot(_arg1.who);
_local2.mouseEnabled = false;
_local2.mouseChildren = false;
_local2.removeEventListener(MouseEvent.MOUSE_OVER, onOverBot);
_local2.removeEventListener(MouseEvent.CLICK, onClickBot);
if (hero.target == _local2){
hero.target = null;
};
deadBots.push(_local2);
if (deadBots.length > maxBodyCount){
removeBot((deadBots.shift() as Robot));
};
score = (score + _local2.pointValue);
kills++;
expiredBotCount++;
trace(((("expiredBotCount: " + expiredBotCount) + " of ") + totalBotsInStage));
};
}
private function genBot(_arg1:TimerEvent):void{
var _local2:Boolean;
var _local3:Robot;
if (botsCreated < Number(currentStage.totalBots)){
botsCreated++;
_local3 = Robot.CreateRandomBot(this, currentStage);
_local3.position = new Vector(Rndm.integer(0, stage.stageWidth), horizon.y, horizon.z);
_local3.filters = [new BlurFilter(2, 2)];
_local3.alpha = 0;
addActor(_local3, actorLayer);
_local3.addEventListener(MouseEvent.MOUSE_OVER, onOverBot);
_local3.addEventListener(MouseEvent.CLICK, onClickBot);
bots.push(_local3);
dramaticBoom.play();
Tweener.addTween(_local3, {alpha:1, time:4});
};
_local2 = (((bossCounter < currentStage.bossBots)) && ((botsCreated == (Math.floor((currentStage.totalBots / currentStage.bossBots)) * (bossCounter + 1)))));
if (_local2){
createBoss();
};
if (Rndm.bit(currentStage.hallieChance)){
createHallieBot();
};
}
function frame3(){
stop();
Main(this).initGame();
}
private function cleanupBots():void{
var _local1:Number;
var _local2:int;
var _local3:Number;
var _local4:MovieClip;
_local1 = bots.length;
_local2 = 0;
_local2 = 0;
while (_local2 < _local1) {
removeBot((bots.shift() as Robot));
_local2++;
};
_local3 = deadBots.length;
_local2 = 0;
while (_local2 < _local3) {
removeBot((deadBots.shift() as Robot));
_local2++;
};
for each (_local4 in actors) {
if ((((_local4 is Actor)) && ((Actor(_local4) is Projectile)))){
removeActor(_local4);
};
};
bots = new Array();
deadBots = new Array();
}
private function addHealth(_arg1:TimerEvent):void{
if (((!(paused)) && (!(gameOver)))){
if (hero.health < (100 - 5)){
hero.health = (hero.health + 5);
};
if (cityHealth < (100 - 5)){
cityHealth = (cityHealth + 5);
};
};
}
private function showGameOverScreen():void{
var screen:MovieClip;
var hscores:HighScores;
var xto:Number;
var yto:Number;
globalSoundTransform = new SoundTransform();
SoundMixer.soundTransform = globalSoundTransform;
getMC("healthMeter").visible = false;
hideCursor();
botTimer.stop();
gameOver = true;
camera.velocity.x = 0;
hero.velocity.x = 0;
hero.isDead = true;
screen = getMC("screenGameOver");
MovieClip(screen.gameBy).buttonMode = true;
if (!MovieClip(screen.gameBy).hasEventListener(MouseEvent.CLICK)){
MovieClip(screen.gameBy).addEventListener(MouseEvent.CLICK, function (_arg1:Event):void{
navigateToURL(new URLRequest("http://www.portlandstudios.com"), "_blank");
});
};
Button(screen.btnAgain).label = "Play Again!";
Button(screen.btnAgain).addEventListener(MouseEvent.CLICK, function (_arg1:Event):void{
playAgain();
});
screen.txtScore.text = score;
hscores = HighScores(screen.highScores);
hscores.loadScores(score);
xto = ((stage.stageWidth / 2) - (screen.width / 2));
yto = ((stage.stageHeight / 2) - (screen.height / 2));
Tweener.addTween(screen, {x:xto, y:yto, time:1});
musicChannel.stop();
musicGameOverChannel = musicGameOver.play(0, 1);
}
private function moveCamera():void{
camera.x = hero.x;
camera.velocity.x = hero.velocity.x;
}
function frame1(){
}
private function loadingComplete(_arg1:Event):void{
Tweener.addTween(Button(this["btnStart"]), {alpha:1, time:1});
}
private function resetStats():void{
botCounter = 0;
expiredBotCount = 0;
botsCreated = 0;
kills = 0;
breaches = 0;
score = 0;
cityHealth = 100;
hero.health = 100;
hero.isDead = false;
hero.hitCount = 0;
hero.shotsFired = 0;
}
override protected function run(_arg1:TimerEvent):void{
if (((!(paused)) && (!(gameOver)))){
updateCursor();
detectBreach();
gameState();
moveCamera();
super.run(_arg1);
};
}
private function playAgain():void{
musicGameOverChannel.stop();
gameOver = false;
paused = true;
cleanupBots();
resetStats();
getMC("healthMeter").visible = true;
showCursor();
Tweener.addTween(getMC("screenGameOver"), {x:-(stage.stageWidth), time:1});
Tweener.addTween(getMC("redOverlay"), {alpha:0, time:1});
Tweener.addTween(hero, {rotation:0, y:(stage.stageHeight - 40), time:1});
paused = false;
playCount++;
initGame();
}
public function get cursorPosition():Vector{
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local1 = (mouseY - horizon.y);
_local2 = (horizon.z - ((_local1 / (stage.stageHeight - horizon.y)) * horizon.z));
_local3 = ((_local1)>0) ? _local2 : horizon.z;
return (new Vector(mouseX, mouseY, _local3));
}
public function removeBot(_arg1:Robot):void{
ArrayUtil.removeValueFromArray(bots, _arg1);
removeActor(_arg1);
}
private function createBoss():void{
var _local1:BossBot;
_local1 = new BossBot(this);
_local1.position = new Vector(Rndm.integer(0, stage.stageWidth), (horizon.y - 30), horizon.z);
_local1.alpha = 0;
_local1.filters = [new BlurFilter(2, 2)];
addActor(_local1, actorLayer);
_local1.cacheAsBitmap = true;
_local1.blendMode = BlendMode.MULTIPLY;
_local1.addEventListener(MouseEvent.MOUSE_OVER, onOverBot);
_local1.addEventListener(MouseEvent.CLICK, onClickBot);
bots.push(_local1);
bossCounter++;
botCounter++;
dramaticBoom.play();
Tweener.addTween(_local1, {alpha:1, time:4});
}
private function showCursor():void{
Mouse.hide();
cursor.visible = true;
}
public function bossShoot(_arg1:MovieClip):void{
var _local2:Robot;
_local2 = (_arg1.parent as Robot);
_local2.shootAt(hero);
}
private function addEnvironment(_arg1:String, _arg2:Number):void{
var _local3:MovieClip;
_local3 = getMC(_arg1);
_local3.z = _arg2;
_local3.parallax = true;
actors.push(_local3);
}
public function nuclearExplosion():void{
var _local1:Number;
var _local2:int;
Tweener.addTween(whiteOver, {alpha:1, time:1});
Tweener.addTween(whiteOver, {alpha:0, delay:1, time:5});
_local1 = bots.length;
_local2 = 0;
while (_local2 < _local1) {
Robot(bots.shift()).die();
_local2++;
};
}
private function detectBreach():void{
var bot:Robot;
for each (bot in bots) {
if ((((bot.z <= parameter.z)) && (!(bot.breached)))){
bot.breached = true;
if (hero.target == bot){
hero.target = null;
};
breaches++;
botCounter++;
if (!(bot is HallieBot)){
expiredBotCount++;
};
trace(((("expiredBotCount: " + expiredBotCount) + " of ") + totalBotsInStage));
if (!isFlashing){
breachSirenChannel = breachSiren.play(0, 3);
flash("BREACH DETECTED", 6);
};
cityHealth = (cityHealth - bot.power);
score = (score - bot.pointValue);
Tweener.addTween(bot, {y:-(bot.height), z:0, alpha:0, time:1, onComplete:function ():void{
Main(this.context).removeBot(this);
}});
};
if (bot.z < blurDistance){
bot.filters = null;
};
};
}
private function createHallieBot():void{
var _local1:HallieBot;
_local1 = new HallieBot(this);
_local1.position = new Vector(Rndm.integer(0, stage.stageWidth), horizon.y, horizon.z);
_local1.filters = [new BlurFilter(2, 2)];
addActor(_local1, actorLayer);
bots.push(_local1);
hallieTwinkle.play();
flash("HALLIE BOT DETECTED", 4);
}
private function onUp(_arg1:MouseEvent):void{
hero.stopShooting();
}
private function onGameOver(_arg1:GameEvent):void{
var msg:String;
var e = _arg1;
if (!gameOver){
gameOver = true;
msg = ((hero.health)<=0) ? "GAME OVER: YOU DIED" : "GAME OVER: YOUR CITY WAS DESTROYED";
if (hero.isDead){
Tweener.addTween(hero, {rotation:90, y:420, time:1});
};
flash(msg, 3);
Tweener.addTween(getMC("redOverlay"), {alpha:1, time:1});
Tweener.addTween(this, {time:3, onComplete:showGameOverScreen});
SoundMixer.soundTransform = globalSoundTransform;
Tweener.addTween(globalSoundTransform, {volume:0, time:2, onUpdate:function ():void{
SoundMixer.soundTransform = globalSoundTransform;
}});
};
}
public function explosion(_arg1:Vector, _arg2:String, _arg3:MovieClip=null):void{
var _local4:Class;
var _local5:Actor;
_local4 = Class(getDefinitionByName(_arg2));
_local5 = new Actor(this, _local4);
_local5.position = _arg1;
setScale(_local5);
if (!_arg3){
_arg3 = MovieClip(this);
};
_arg3.addChild(_local5);
}
private function initGame():void{
var levelsSoFar:Number;
var i:int;
var redover:MovieClip;
var healthMeter:MovieClip;
Tweener.addTween(MovieClip(this["loadingBG"]), {alpha:0, time:1, onComplete:function ():void{
this.visible = false;
}});
Rndm.seed = new Date().time;
if (playCount == 0){
cursor = new ((getDefinitionByName("GunCursor") as Class));
cursor.mouseEnabled = false;
addChild(cursor);
actorLayer = getMC("botContainer");
hero = new Hero(this);
hero.position = new Vector((stage.stageWidth / 2), (stage.stageHeight - 50), 0);
addActor(hero, getMC("heroContainer"));
hero.isDead = false;
hero.health = 100;
cityHealth = 100;
camera.focalLength = 90;
camera.position = hero.position;
healthTimer.addEventListener(TimerEvent.TIMER, addHealth);
stage.addEventListener(MouseEvent.MOUSE_DOWN, onDown);
stage.addEventListener(MouseEvent.MOUSE_UP, onUp);
stage.addEventListener(GameEvent.DIE, onDie);
stage.addEventListener(GameEvent.HIT, onHit);
stage.addEventListener(GameEvent.GAME_OVER, onGameOver);
stages = new Array();
stages.push({totalBots:10, bossBots:0, bps:0.5, maxBotSpeed:5, botFireRate:0, hallieChance:0});
stages.push({totalBots:12, bossBots:0, bps:0.5, minBotSpeed:4, maxBotSpeed:6, botFireRate:0, hallieChance:0});
stages.push({totalBots:12, bossBots:0, bps:0.8, minBotSpeed:5, maxBotSpeed:7, botFireRate:20, hallieChance:0});
stages.push({totalBots:10, bossBots:1, bps:0.5, minBotSpeed:6, maxBotSpeed:7, botFireRate:20, hallieChance:0.04});
stages.push({totalBots:15, bossBots:1, bps:0.8, minBotSpeed:6, maxBotSpeed:8, botFireRate:15, hallieChance:0.03});
stages.push({totalBots:16, bossBots:1, bps:0.8, minBotSpeed:6, maxBotSpeed:9, botFireRate:15, hallieChance:0.03});
stages.push({totalBots:18, bossBots:2, bps:1, minBotSpeed:4, maxBotSpeed:9, botFireRate:10, hallieChance:0.03});
stages.push({totalBots:22, bossBots:2, bps:1.25, minBotSpeed:4, maxBotSpeed:9, botFireRate:8, hallieChance:0.05});
stages.push({totalBots:22, bossBots:3, bps:1.25, minBotSpeed:7, maxBotSpeed:9, botFireRate:5, hallieChance:0.05});
stages.push({totalBots:25, bossBots:3, bps:1.5, minBotSpeed:7, maxBotSpeed:9, botFireRate:5, hallieChance:0.05});
stages.push({totalBots:27, bossBots:5, bps:2, minBotSpeed:6, maxBotSpeed:9, botFireRate:4, hallieChance:0.05});
stages.push({totalBots:30, bossBots:5, bps:2.5, minBotSpeed:7, maxBotSpeed:10, botFireRate:4, hallieChance:0.06});
stages.push({totalBots:30, bossBots:5, bps:2.5, minBotSpeed:6, maxBotSpeed:10, botFireRate:3, hallieChance:0.06});
stages.push({totalBots:35, bossBots:5, bps:2.5, minBotSpeed:6, maxBotSpeed:10, botFireRate:3, hallieChance:0.06});
stages.push({totalBots:35, bossBots:6, bps:3, minBotSpeed:6, maxBotSpeed:10, botFireRate:3, hallieChance:0.06});
levelsSoFar = stages.length;
i = 0;
while (i < 100) {
stages.push({totalBots:(40 + i), bossBots:(7 + Math.round((i / 10))), bps:(3 + (i / 50)), maxBotSpeed:(12 + (i / 30)), botFireRate:(3 + (i / 30)), hallieChance:0.06});
i = (i + 1);
};
addEnvironment("bg", 550);
addEnvironment("bgMid", 280);
addEnvironment("bgFor", 10);
addEnvironment("bgForClouds", 250);
dramaticBoom = getSoundByClass("DramaticBoom");
music = getSoundByClass("MusicTheme");
musicGameOver = getSoundByClass("MusicGameOver");
breachSiren = getSoundByClass("BreachSiren");
hallieTwinkle = getSoundByClass("HallieTwinkle");
redover = getMC("redOverlay");
redover.mouseEnabled = false;
redover.mouseChildren = false;
whiteOver = getMC("whiteOverlay");
whiteOver.mouseEnabled = false;
whiteOver.mouseChildren = false;
healthMeter = getMC("healthMeter");
LoadingBar(healthMeter.barHealth).nameLabel = "HEALTH:";
LoadingBar(healthMeter.barCity).nameLabel = "CITY:";
healthTimer.start();
start();
};
showCursor();
if (musicChannel){
musicChannel.stop();
};
musicChannel = music.play(0, 999);
currentStageIndex = 0;
nextStage();
}
private function hideCursor():void{
Mouse.show();
cursor.visible = false;
}
private function onDown(_arg1:MouseEvent):void{
if (((hero.target) && (!(MovieClip(hero.target).hitTestPoint(cursorPosition.x, cursorPosition.y))))){
hero.target = null;
};
hero.target = null;
hero.startShooting();
}
protected function onHit(_arg1:GameEvent):void{
if ((_arg1.who is Hero)){
Tweener.addTween(getMC("redOverlay"), {alpha:1, time:0.3});
Tweener.addTween(getMC("redOverlay"), {alpha:0, delay:0.3, time:0.3});
};
}
public function addProjectile(_arg1:Projectile):void{
this.addActor(_arg1, MovieClip(this["projectileContainer"]));
}
public function getMC(_arg1:String):MovieClip{
return ((this[_arg1] as MovieClip));
}
private function updateCursor():void{
cursor.x = mouseX;
cursor.y = mouseY;
}
private function loadingProgress(_arg1:ProgressEvent):void{
var _local2:Number;
_local2 = Math.round(((_arg1.bytesLoaded / _arg1.bytesTotal) * 100));
LoadingBar(this["loadingBar"]).setProgress(_local2);
}
private function startGame():void{
showCursor();
paused = false;
}
public function showStats():void{
var screen:MovieClip;
var tox:Number;
var toy:Number;
var hitPerc:Number;
camera.velocity.x = 0;
hero.velocity.x = 0;
pause();
getMC("breathingDude").alpha = 1;
hero.alpha = 0;
screen = getMC("statScreen");
tox = (((stage.stageWidth / 2) - (screen.width / 2)) + 200);
toy = ((stage.stageHeight / 2) - (screen.height / 2));
Tweener.addTween(screen, {x:tox, y:toy, time:1});
Button(screen["btnNext"]).label = "Next Wave!";
hitPerc = Math.round(((hero.hitCount / hero.shotsFired) * 100));
score = (score + hitPerc);
screen.txtTitle.text = (("WAVE " + currentStageIndex) + " COMPLETE!");
screen.txtScore.text = (score + "");
screen.txtKills.text = (kills + "");
screen.txtBreaches.text = (breaches + "");
screen.txtAccuracy.text = (hitPerc + "%");
if (!MovieClip(screen.btnNext).hasEventListener(MouseEvent.CLICK)){
MovieClip(screen.btnNext).addEventListener(MouseEvent.CLICK, function ():void{
Tweener.addTween(screen, {x:-(screen.width), time:1});
Tweener.addTween(getMC("breathingDude"), {alpha:0, time:1});
hero.alpha = 1;
nextStage();
});
};
}
private function fadeOutTheme():void{
Tweener.addTween(musicTransform, {volume:0, time:1, onUpdate:function ():void{
musicChannel.soundTransform = musicTransform;
}});
}
protected function onOverBot(_arg1:MouseEvent):void{
var _local2:MovieClip;
_local2 = _arg1.target.parent.parent;
if ((((_local2 is Robot)) && (hero.shooting))){
hero.target = Robot(_local2);
};
}
private function getClass(_arg1:String):Class{
return ((getDefinitionByName(_arg1) as Class));
}
public function getSoundByClass(_arg1:String):Sound{
var _local2:Class;
_local2 = (getDefinitionByName(_arg1) as Class);
return ((new (_local2) as Sound));
}
public function get totalBotsInStage():Number{
return ((currentStage.totalBots + currentStage.bossBots));
}
public function killSelf(_arg1:MovieClip):void{
if (((_arg1.parent) && ((_arg1.parent is Actor)))){
removeActor((_arg1.parent as Actor));
} else {
_arg1.parent.removeChild(_arg1);
};
}
private function nextStage():void{
stageEnded = false;
showCursor();
botCounter = 0;
bossCounter = 0;
expiredBotCount = 0;
botsCreated = 0;
startGame();
hero.health = (hero.health + 20);
if (hero.health > 100){
hero.health = 100;
};
currentStageIndex++;
currentStage = stages[(currentStageIndex - 1)];
if (botTimer){
botTimer.removeEventListener(TimerEvent.TIMER, genBot);
};
botTimer = new Timer((1000 / currentStage.bps));
botTimer.addEventListener(TimerEvent.TIMER, genBot);
botTimer.start();
}
private function hideFlash(_arg1:TimerEvent):void{
getMC("flashMessage").alpha = 0;
isFlashing = false;
}
private function gameState():void{
var _local1:MovieClip;
var _local2:Number;
var _local3:Boolean;
_local1 = getMC("healthMeter");
if (hero.health < 0){
hero.health = 0;
};
if (cityHealth < 0){
cityHealth = 0;
};
LoadingBar(_local1.barHealth).setProgress(hero.health);
LoadingBar(_local1.barCity).setProgress(cityHealth);
if (cityHealth <= 0){
flash("CITY DESTROYED", 3);
dispatchEvent(new GameEvent(GameEvent.GAME_OVER));
} else {
_local2 = (currentStage.totalBots + currentStage.bossBots);
_local3 = (((expiredBotCount >= _local2)) && (!(gameOver)));
if (_local3){
stageEnded = true;
flash((("WAVE " + currentStageIndex) + " COMPLETE!"));
camera.velocity.x = 0;
hero.velocity.x = 0;
showStats();
};
};
}
private function flash(_arg1:String, _arg2:int=2):void{
isFlashing = true;
getMC("flashMessage").message.txtMessage.text = _arg1;
getMC("flashMessage").alpha = 1;
flashTimer = new Timer((_arg2 * 1000));
if (flashTimer.hasEventListener(TimerEvent.TIMER)){
flashTimer.removeEventListener(TimerEvent.TIMER, hideFlash);
};
flashTimer.addEventListener(TimerEvent.TIMER, hideFlash);
flashTimer.start();
}
public function pause():void{
botTimer.stop();
paused = true;
hideCursor();
}
}
}//package
Section 55
//MusicGameOver (MusicGameOver)
package {
import flash.media.*;
public dynamic class MusicGameOver extends Sound {
}
}//package
Section 56
//MusicTheme (MusicTheme)
package {
import flash.media.*;
public dynamic class MusicTheme extends Sound {
}
}//package
Section 57
//MuzzleFlash (MuzzleFlash)
package {
import flash.display.*;
public dynamic class MuzzleFlash extends MovieClip {
public function MuzzleFlash(){
addFrameScript(4, frame5);
}
function frame5(){
Main(root).killSelf(this);
stop();
}
}
}//package
Section 58
//PistolShot (PistolShot)
package {
import flash.media.*;
public dynamic class PistolShot extends Sound {
}
}//package
Section 59
//PlasmaBullet (PlasmaBullet)
package {
import flash.display.*;
public dynamic class PlasmaBullet extends MovieClip {
}
}//package
Section 60
//RobotSkin (RobotSkin)
package {
import flash.display.*;
public dynamic class RobotSkin extends MovieClip {
public var hitBox:MovieClip;
public function RobotSkin(){
addFrameScript(31, frame32, 63, frame64);
}
function frame64(){
stop();
}
function frame32(){
gotoAndPlay("walk");
}
}
}//package
Section 61
//ScoreListItem (ScoreListItem)
package {
import flash.display.*;
import flash.text.*;
public dynamic class ScoreListItem extends MovieClip {
public var txtScore:TextField;
public var txtName:TextField;
public var txtRank:TextField;
}
}//package