Section 1
//AuxFunctions (caurina.transitions.AuxFunctions)
package caurina.transitions {
public class AuxFunctions {
public static function getObjectLength(_arg1:Object):uint{
var _local3:String;
var _local2:uint;
for (_local3 in _arg1) {
_local2++;
};
return (_local2);
}
public static function numberToG(_arg1:Number):Number{
return (((_arg1 & 0xFF00) >> 8));
}
public static function numberToB(_arg1:Number):Number{
return ((_arg1 & 0xFF));
}
public static function numberToR(_arg1:Number):Number{
return (((_arg1 & 0xFF0000) >> 16));
}
public static function concatObjects(... _args):Object{
var _local3:Object;
var _local5:String;
var _local2:Object = {};
var _local4:int;
while (_local4 < _args.length) {
_local3 = _args[_local4];
for (_local5 in _local3) {
if (_local3[_local5] == null){
delete _local2[_local5];
} else {
_local2[_local5] = _local3[_local5];
};
};
_local4++;
};
return (_local2);
}
}
}//package caurina.transitions
Section 2
//Equations (caurina.transitions.Equations)
package caurina.transitions {
public class Equations {
public function Equations(){
trace("Equations is a static class and should not be instantiated.");
}
public static function easeOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeInOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * (0.3 * 1.5)) : _arg5.period;
var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2));
};
--_arg1;
return ((((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) * 0.5) + _arg3) + _arg2));
}
public static function easeInOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
public static function easeInOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeInBounce((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOutBounce(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
public static function easeInOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_local6 = (_local6 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_local6 + 1) * _arg1) - _local6))) + _arg2));
};
_arg1 = (_arg1 - 2);
_local6 = (_local6 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 2)) + _arg2));
}
public static function easeOutInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCubic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInCubic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 1)) + _arg2));
}
public static function easeInOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
public static function easeInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_local6 + 1) * _arg1) - _local6)) + _arg2));
}
public static function easeInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeOutInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuint((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuint(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBounce((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBounce(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function init():void{
Tweener.registerTransition("easenone", easeNone);
Tweener.registerTransition("linear", easeNone);
Tweener.registerTransition("easeinquad", easeInQuad);
Tweener.registerTransition("easeoutquad", easeOutQuad);
Tweener.registerTransition("easeinoutquad", easeInOutQuad);
Tweener.registerTransition("easeoutinquad", easeOutInQuad);
Tweener.registerTransition("easeincubic", easeInCubic);
Tweener.registerTransition("easeoutcubic", easeOutCubic);
Tweener.registerTransition("easeinoutcubic", easeInOutCubic);
Tweener.registerTransition("easeoutincubic", easeOutInCubic);
Tweener.registerTransition("easeinquart", easeInQuart);
Tweener.registerTransition("easeoutquart", easeOutQuart);
Tweener.registerTransition("easeinoutquart", easeInOutQuart);
Tweener.registerTransition("easeoutinquart", easeOutInQuart);
Tweener.registerTransition("easeinquint", easeInQuint);
Tweener.registerTransition("easeoutquint", easeOutQuint);
Tweener.registerTransition("easeinoutquint", easeInOutQuint);
Tweener.registerTransition("easeoutinquint", easeOutInQuint);
Tweener.registerTransition("easeinsine", easeInSine);
Tweener.registerTransition("easeoutsine", easeOutSine);
Tweener.registerTransition("easeinoutsine", easeInOutSine);
Tweener.registerTransition("easeoutinsine", easeOutInSine);
Tweener.registerTransition("easeincirc", easeInCirc);
Tweener.registerTransition("easeoutcirc", easeOutCirc);
Tweener.registerTransition("easeinoutcirc", easeInOutCirc);
Tweener.registerTransition("easeoutincirc", easeOutInCirc);
Tweener.registerTransition("easeinexpo", easeInExpo);
Tweener.registerTransition("easeoutexpo", easeOutExpo);
Tweener.registerTransition("easeinoutexpo", easeInOutExpo);
Tweener.registerTransition("easeoutinexpo", easeOutInExpo);
Tweener.registerTransition("easeinelastic", easeInElastic);
Tweener.registerTransition("easeoutelastic", easeOutElastic);
Tweener.registerTransition("easeinoutelastic", easeInOutElastic);
Tweener.registerTransition("easeoutinelastic", easeOutInElastic);
Tweener.registerTransition("easeinback", easeInBack);
Tweener.registerTransition("easeoutback", easeOutBack);
Tweener.registerTransition("easeinoutback", easeInOutBack);
Tweener.registerTransition("easeoutinback", easeOutInBack);
Tweener.registerTransition("easeinbounce", easeInBounce);
Tweener.registerTransition("easeoutbounce", easeOutBounce);
Tweener.registerTransition("easeinoutbounce", easeInOutBounce);
Tweener.registerTransition("easeoutinbounce", easeOutInBounce);
}
public static function easeOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg1)==_arg4) ? (_arg2 + _arg3) : (((_arg3 * 1.001) * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2));
}
public static function easeOutInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBack((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBack(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg1)==0) ? _arg2 : (((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2) - (_arg3 * 0.001)));
}
public static function easeInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2));
}
public static function easeInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg3 - easeOutBounce((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeOutInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutExpo((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInExpo(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((-(_arg3) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2));
}
public static function easeInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2));
}
public static function easeInOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 2)) + _arg2));
}
public static function easeOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeOutInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutElastic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInElastic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
--_arg1;
return ((-(((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2));
}
public static function easeOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuad((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuad(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2));
}
public static function easeInOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
}
public static function easeOutInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutSine((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInSine(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 == 0){
return (_arg2);
};
if (_arg1 == _arg4){
return ((_arg2 + _arg3));
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2) - (_arg3 * 0.0005)));
};
--_arg1;
return (((((_arg3 / 2) * 1.0005) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2));
}
public static function easeOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
return (((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) + _arg3) + _arg2));
}
public static function easeOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
}
public static function easeOutInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuart((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuart(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCirc((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInCirc(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
}
}//package caurina.transitions
Section 3
//PropertyInfoObj (caurina.transitions.PropertyInfoObj)
package caurina.transitions {
public class PropertyInfoObj {
public var modifierParameters:Array;
public var isSpecialProperty:Boolean;
public var valueComplete:Number;
public var modifierFunction:Function;
public var extra:Object;
public var valueStart:Number;
public var hasModifier:Boolean;
public var arrayIndex:Number;
public var originalValueComplete:Object;
public function PropertyInfoObj(_arg1:Number, _arg2:Number, _arg3:Object, _arg4:Number, _arg5:Object, _arg6:Boolean, _arg7:Function, _arg8:Array){
valueStart = _arg1;
valueComplete = _arg2;
originalValueComplete = _arg3;
arrayIndex = _arg4;
extra = _arg5;
isSpecialProperty = _arg6;
hasModifier = Boolean(_arg7);
modifierFunction = _arg7;
modifierParameters = _arg8;
}
public function toString():String{
var _local1 = "\n[PropertyInfoObj ";
_local1 = (_local1 + ("valueStart:" + String(valueStart)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("valueComplete:" + String(valueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("originalValueComplete:" + String(originalValueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("arrayIndex:" + String(arrayIndex)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("extra:" + String(extra)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("isSpecialProperty:" + String(isSpecialProperty)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("hasModifier:" + String(hasModifier)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierFunction:" + String(modifierFunction)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierParameters:" + String(modifierParameters)));
_local1 = (_local1 + "]\n");
return (_local1);
}
public function clone():PropertyInfoObj{
var _local1:PropertyInfoObj = new PropertyInfoObj(valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, modifierFunction, modifierParameters);
return (_local1);
}
}
}//package caurina.transitions
Section 4
//SpecialProperty (caurina.transitions.SpecialProperty)
package caurina.transitions {
public class SpecialProperty {
public var parameters:Array;
public var getValue:Function;
public var preProcess:Function;
public var setValue:Function;
public function SpecialProperty(_arg1:Function, _arg2:Function, _arg3:Array=null, _arg4:Function=null){
getValue = _arg1;
setValue = _arg2;
parameters = _arg3;
preProcess = _arg4;
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + "[SpecialProperty ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("setValue:" + String(setValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("preProcess:" + String(preProcess)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 5
//SpecialPropertyModifier (caurina.transitions.SpecialPropertyModifier)
package caurina.transitions {
public class SpecialPropertyModifier {
public var getValue:Function;
public var modifyValues:Function;
public function SpecialPropertyModifier(_arg1:Function, _arg2:Function){
modifyValues = _arg1;
getValue = _arg2;
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + "[SpecialPropertyModifier ");
_local1 = (_local1 + ("modifyValues:" + String(modifyValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 6
//SpecialPropertySplitter (caurina.transitions.SpecialPropertySplitter)
package caurina.transitions {
public class SpecialPropertySplitter {
public var parameters:Array;
public var splitValues:Function;
public function SpecialPropertySplitter(_arg1:Function, _arg2:Array){
splitValues = _arg1;
parameters = _arg2;
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + "[SpecialPropertySplitter ");
_local1 = (_local1 + ("splitValues:" + String(splitValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 7
//Tweener (caurina.transitions.Tweener)
package caurina.transitions {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Tweener {
private static var _timeScale:Number = 1;
private static var _currentTimeFrame:Number;
private static var _specialPropertySplitterList:Object;
private static var _engineExists:Boolean = false;
private static var _specialPropertyModifierList:Object;
private static var _currentTime:Number;
private static var _tweenList:Array;
private static var _specialPropertyList:Object;
private static var _transitionList:Object;
private static var _inited:Boolean = false;
private static var __tweener_controller__:MovieClip;
public function Tweener(){
trace("Tweener is a static class and should not be instantiated.");
}
public static function registerSpecialPropertyModifier(_arg1:String, _arg2:Function, _arg3:Function):void{
if (!_inited){
init();
};
var _local4:SpecialPropertyModifier = new SpecialPropertyModifier(_arg2, _arg3);
_specialPropertyModifierList[_arg1] = _local4;
}
public static function registerSpecialProperty(_arg1:String, _arg2:Function, _arg3:Function, _arg4:Array=null, _arg5:Function=null):void{
if (!_inited){
init();
};
var _local6:SpecialProperty = new SpecialProperty(_arg2, _arg3, _arg4, _arg5);
_specialPropertyList[_arg1] = _local6;
}
public static function init(... _args):void{
_inited = true;
_transitionList = new Object();
Equations.init();
_specialPropertyList = new Object();
_specialPropertyModifierList = new Object();
_specialPropertySplitterList = new Object();
}
private static function updateTweens():Boolean{
var _local1:int;
if (_tweenList.length == 0){
return (false);
};
_local1 = 0;
while (_local1 < _tweenList.length) {
if ((((_tweenList[_local1] == undefined)) || (!(_tweenList[_local1].isPaused)))){
if (!updateTweenByIndex(_local1)){
removeTweenByIndex(_local1);
};
if (_tweenList[_local1] == null){
removeTweenByIndex(_local1, true);
_local1--;
};
};
_local1++;
};
return (true);
}
public static function addCaller(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local3:Number;
var _local4:Array;
var _local8:Function;
var _local9:TweenListObj;
var _local10:Number;
var _local11:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local4 = _arg1.concat();
} else {
_local4 = [_arg1];
};
var _local5:Object = _arg2;
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
var _local6:Number = (isNaN(_local5.time)) ? 0 : _local5.time;
var _local7:Number = (isNaN(_local5.delay)) ? 0 : _local5.delay;
if (typeof(_local5.transition) == "string"){
_local11 = _local5.transition.toLowerCase();
_local8 = _transitionList[_local11];
} else {
_local8 = _local5.transition;
};
if (!Boolean(_local8)){
_local8 = _transitionList["easeoutexpo"];
};
_local3 = 0;
while (_local3 < _local4.length) {
if (_local5.useFrames == true){
_local9 = new TweenListObj(_local4[_local3], (_currentTimeFrame + (_local7 / _timeScale)), (_currentTimeFrame + ((_local7 + _local6) / _timeScale)), true, _local8, _local5.transitionParams);
} else {
_local9 = new TweenListObj(_local4[_local3], (_currentTime + ((_local7 * 1000) / _timeScale)), (_currentTime + (((_local7 * 1000) + (_local6 * 1000)) / _timeScale)), false, _local8, _local5.transitionParams);
};
_local9.properties = null;
_local9.onStart = _local5.onStart;
_local9.onUpdate = _local5.onUpdate;
_local9.onComplete = _local5.onComplete;
_local9.onOverwrite = _local5.onOverwrite;
_local9.onStartParams = _local5.onStartParams;
_local9.onUpdateParams = _local5.onUpdateParams;
_local9.onCompleteParams = _local5.onCompleteParams;
_local9.onOverwriteParams = _local5.onOverwriteParams;
_local9.onStartScope = _local5.onStartScope;
_local9.onUpdateScope = _local5.onUpdateScope;
_local9.onCompleteScope = _local5.onCompleteScope;
_local9.onOverwriteScope = _local5.onOverwriteScope;
_local9.onErrorScope = _local5.onErrorScope;
_local9.isCaller = true;
_local9.count = _local5.count;
_local9.waitFrames = _local5.waitFrames;
_tweenList.push(_local9);
if ((((_local6 == 0)) && ((_local7 == 0)))){
_local10 = (_tweenList.length - 1);
updateTweenByIndex(_local10);
removeTweenByIndex(_local10);
};
_local3++;
};
return (true);
}
public static function pauseAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
pauseTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function removeTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local5:SpecialPropertySplitter;
var _local6:Array;
var _local7:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){
if (_specialPropertySplitterList[_args[_local4]]){
_local5 = _specialPropertySplitterList[_args[_local4]];
_local6 = _local5.splitValues(_arg1, null);
_local7 = 0;
while (_local7 < _local6.length) {
_local3.push(_local6[_local7].name);
_local7++;
};
} else {
_local3.push(_args[_local4]);
};
};
_local4++;
};
return (affectTweens(removeTweenByIndex, _arg1, _local3));
}
public static function splitTweens(_arg1:Number, _arg2:Array):uint{
var _local5:uint;
var _local6:String;
var _local7:Boolean;
var _local3:TweenListObj = _tweenList[_arg1];
var _local4:TweenListObj = _local3.clone(false);
_local5 = 0;
while (_local5 < _arg2.length) {
_local6 = _arg2[_local5];
if (Boolean(_local3.properties[_local6])){
_local3.properties[_local6] = undefined;
delete _local3.properties[_local6];
};
_local5++;
};
for (_local6 in _local4.properties) {
_local7 = false;
_local5 = 0;
while (_local5 < _arg2.length) {
if (_arg2[_local5] == _local6){
_local7 = true;
break;
};
_local5++;
};
if (!_local7){
_local4.properties[_local6] = undefined;
delete _local4.properties[_local6];
};
};
_tweenList.push(_local4);
return ((_tweenList.length - 1));
}
public static function updateFrame():void{
_currentTimeFrame++;
}
public static function resumeTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj = _tweenList[_arg1];
if ((((_local2 == null)) || (!(_local2.isPaused)))){
return (false);
};
var _local3:Number = getCurrentTweeningTime(_local2);
_local2.timeStart = (_local2.timeStart + (_local3 - _local2.timePaused));
_local2.timeComplete = (_local2.timeComplete + (_local3 - _local2.timePaused));
_local2.timePaused = undefined;
_local2.isPaused = false;
return (true);
}
public static function getVersion():String{
return ("AS3 1.31.74");
}
public static function onEnterFrame(_arg1:Event):void{
updateTime();
updateFrame();
var _local2:Boolean;
_local2 = updateTweens();
if (!_local2){
stopEngine();
};
}
public static function updateTime():void{
_currentTime = getTimer();
}
private static function updateTweenByIndex(_arg1:Number):Boolean{
var tTweening:TweenListObj;
var mustUpdate:Boolean;
var nv:Number;
var t:Number;
var b:Number;
var c:Number;
var d:Number;
var pName:String;
var eventScope:Object;
var tScope:Object;
var tProperty:Object;
var pv:Number;
var i = _arg1;
tTweening = _tweenList[i];
if ((((tTweening == null)) || (!(Boolean(tTweening.scope))))){
return (false);
};
var isOver:Boolean;
var cTime:Number = getCurrentTweeningTime(tTweening);
if (cTime >= tTweening.timeStart){
tScope = tTweening.scope;
if (tTweening.isCaller){
do {
t = (((tTweening.timeComplete - tTweening.timeStart) / tTweening.count) * (tTweening.timesCalled + 1));
b = tTweening.timeStart;
c = (tTweening.timeComplete - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d);
} while (!(cTime >= nv));
} else {
mustUpdate = (((((tTweening.skipUpdates < 1)) || (!(tTweening.skipUpdates)))) || ((tTweening.updatesSkipped >= tTweening.skipUpdates)));
if (cTime >= tTweening.timeComplete){
isOver = true;
mustUpdate = true;
};
if (!tTweening.hasStarted){
if (Boolean(tTweening.onStart)){
eventScope = (Boolean(tTweening.onStartScope)) ? tTweening.onStartScope : tScope;
try {
tTweening.onStart.apply(eventScope, tTweening.onStartParams);
} catch(e2:Error) {
handleError(tTweening, e2, "onStart");
};
};
for (pName in tTweening.properties) {
if (tTweening.properties[pName].isSpecialProperty){
if (Boolean(_specialPropertyList[pName].preProcess)){
tTweening.properties[pName].valueComplete = _specialPropertyList[pName].preProcess(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].originalValueComplete, tTweening.properties[pName].extra);
};
pv = _specialPropertyList[pName].getValue(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
pv = tScope[pName];
};
tTweening.properties[pName].valueStart = (isNaN(pv)) ? tTweening.properties[pName].valueComplete : pv;
};
mustUpdate = true;
tTweening.hasStarted = true;
};
if (mustUpdate){
for (pName in tTweening.properties) {
tProperty = tTweening.properties[pName];
if (isOver){
nv = tProperty.valueComplete;
} else {
if (tProperty.hasModifier){
t = (cTime - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, 0, 1, d, tTweening.transitionParams);
nv = tProperty.modifierFunction(tProperty.valueStart, tProperty.valueComplete, nv, tProperty.modifierParameters);
} else {
t = (cTime - tTweening.timeStart);
b = tProperty.valueStart;
c = (tProperty.valueComplete - tProperty.valueStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d, tTweening.transitionParams);
};
};
if (tTweening.rounded){
nv = Math.round(nv);
};
if (tProperty.isSpecialProperty){
_specialPropertyList[pName].setValue(tScope, nv, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
tScope[pName] = nv;
};
};
tTweening.updatesSkipped = 0;
if (Boolean(tTweening.onUpdate)){
eventScope = (Boolean(tTweening.onUpdateScope)) ? tTweening.onUpdateScope : tScope;
try {
tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams);
} catch(e3:Error) {
handleError(tTweening, e3, "onUpdate");
};
};
} else {
tTweening.updatesSkipped++;
};
};
if (((isOver) && (Boolean(tTweening.onComplete)))){
eventScope = (Boolean(tTweening.onCompleteScope)) ? tTweening.onCompleteScope : tScope;
try {
tTweening.onComplete.apply(eventScope, tTweening.onCompleteParams);
} catch(e4:Error) {
handleError(tTweening, e4, "onComplete");
};
};
return (!(isOver));
};
return (true);
}
public static function setTimeScale(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (isNaN(_arg1)){
_arg1 = 1;
};
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
if (_arg1 != _timeScale){
if (_tweenList != null){
_local2 = 0;
while (_local2 < _tweenList.length) {
_local3 = getCurrentTweeningTime(_tweenList[_local2]);
_tweenList[_local2].timeStart = (_local3 - (((_local3 - _tweenList[_local2].timeStart) * _timeScale) / _arg1));
_tweenList[_local2].timeComplete = (_local3 - (((_local3 - _tweenList[_local2].timeComplete) * _timeScale) / _arg1));
if (_tweenList[_local2].timePaused != undefined){
_tweenList[_local2].timePaused = (_local3 - (((_local3 - _tweenList[_local2].timePaused) * _timeScale) / _arg1));
};
_local2++;
};
};
_timeScale = _arg1;
};
}
public static function resumeAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
resumeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
private static function handleError(_arg1:TweenListObj, _arg2:Error, _arg3:String):void{
var eventScope:Object;
var pTweening = _arg1;
var pError = _arg2;
var pCallBackName = _arg3;
if (((Boolean(pTweening.onError)) && ((pTweening.onError is Function)))){
eventScope = (Boolean(pTweening.onErrorScope)) ? pTweening.onErrorScope : pTweening.scope;
try {
pTweening.onError.apply(eventScope, [pTweening.scope, pError]);
} catch(metaError:Error) {
printError(((((String(pTweening.scope) + " raised an error while executing the 'onError' handler. Original error:\n ") + pError.getStackTrace()) + "\nonError error: ") + metaError.getStackTrace()));
};
} else {
if (!Boolean(pTweening.onError)){
printError(((((String(pTweening.scope) + " raised an error while executing the '") + pCallBackName) + "'handler. \n") + pError.getStackTrace()));
};
};
}
private static function startEngine():void{
_engineExists = true;
_tweenList = new Array();
__tweener_controller__ = new MovieClip();
__tweener_controller__.addEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
_currentTimeFrame = 0;
updateTime();
}
public static function removeAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
removeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function addTween(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local3:Number;
var _local4:Number;
var _local5:String;
var _local6:Array;
var _local13:Function;
var _local14:Object;
var _local15:TweenListObj;
var _local16:Number;
var _local17:Array;
var _local18:Array;
var _local19:Array;
var _local20:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local6 = _arg1.concat();
} else {
_local6 = [_arg1];
};
var _local7:Object = TweenListObj.makePropertiesChain(_arg2);
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
var _local8:Number = (isNaN(_local7.time)) ? 0 : _local7.time;
var _local9:Number = (isNaN(_local7.delay)) ? 0 : _local7.delay;
var _local10:Array = new Array();
var _local11:Object = {time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, transitionParams:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, onError:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams:true, onStartScope:true, onUpdateScope:true, onCompleteScope:true, onOverwriteScope:true, onErrorScope:true};
var _local12:Object = new Object();
for (_local5 in _local7) {
if (!_local11[_local5]){
if (_specialPropertySplitterList[_local5]){
_local17 = _specialPropertySplitterList[_local5].splitValues(_local7[_local5], _specialPropertySplitterList[_local5].parameters);
_local3 = 0;
while (_local3 < _local17.length) {
if (_specialPropertySplitterList[_local17[_local3].name]){
_local18 = _specialPropertySplitterList[_local17[_local3].name].splitValues(_local17[_local3].value, _specialPropertySplitterList[_local17[_local3].name].parameters);
_local4 = 0;
while (_local4 < _local18.length) {
_local10[_local18[_local4].name] = {valueStart:undefined, valueComplete:_local18[_local4].value, arrayIndex:_local18[_local4].arrayIndex, isSpecialProperty:false};
_local4++;
};
} else {
_local10[_local17[_local3].name] = {valueStart:undefined, valueComplete:_local17[_local3].value, arrayIndex:_local17[_local3].arrayIndex, isSpecialProperty:false};
};
_local3++;
};
} else {
if (_specialPropertyModifierList[_local5] != undefined){
_local19 = _specialPropertyModifierList[_local5].modifyValues(_local7[_local5]);
_local3 = 0;
while (_local3 < _local19.length) {
_local12[_local19[_local3].name] = {modifierParameters:_local19[_local3].parameters, modifierFunction:_specialPropertyModifierList[_local5].getValue};
_local3++;
};
} else {
_local10[_local5] = {valueStart:undefined, valueComplete:_local7[_local5]};
};
};
};
};
for (_local5 in _local10) {
if (_specialPropertyList[_local5] != undefined){
_local10[_local5].isSpecialProperty = true;
} else {
if (_local6[0][_local5] == undefined){
printError((((("The property '" + _local5) + "' doesn't seem to be a normal object property of ") + String(_local6[0])) + " or a registered special property."));
};
};
};
for (_local5 in _local12) {
if (_local10[_local5] != undefined){
_local10[_local5].modifierParameters = _local12[_local5].modifierParameters;
_local10[_local5].modifierFunction = _local12[_local5].modifierFunction;
};
};
if (typeof(_local7.transition) == "string"){
_local20 = _local7.transition.toLowerCase();
_local13 = _transitionList[_local20];
} else {
_local13 = _local7.transition;
};
if (!Boolean(_local13)){
_local13 = _transitionList["easeoutexpo"];
};
_local3 = 0;
while (_local3 < _local6.length) {
_local14 = new Object();
for (_local5 in _local10) {
_local14[_local5] = new PropertyInfoObj(_local10[_local5].valueStart, _local10[_local5].valueComplete, _local10[_local5].valueComplete, _local10[_local5].arrayIndex, {}, _local10[_local5].isSpecialProperty, _local10[_local5].modifierFunction, _local10[_local5].modifierParameters);
};
if (_local7.useFrames == true){
_local15 = new TweenListObj(_local6[_local3], (_currentTimeFrame + (_local9 / _timeScale)), (_currentTimeFrame + ((_local9 + _local8) / _timeScale)), true, _local13, _local7.transitionParams);
} else {
_local15 = new TweenListObj(_local6[_local3], (_currentTime + ((_local9 * 1000) / _timeScale)), (_currentTime + (((_local9 * 1000) + (_local8 * 1000)) / _timeScale)), false, _local13, _local7.transitionParams);
};
_local15.properties = _local14;
_local15.onStart = _local7.onStart;
_local15.onUpdate = _local7.onUpdate;
_local15.onComplete = _local7.onComplete;
_local15.onOverwrite = _local7.onOverwrite;
_local15.onError = _local7.onError;
_local15.onStartParams = _local7.onStartParams;
_local15.onUpdateParams = _local7.onUpdateParams;
_local15.onCompleteParams = _local7.onCompleteParams;
_local15.onOverwriteParams = _local7.onOverwriteParams;
_local15.onStartScope = _local7.onStartScope;
_local15.onUpdateScope = _local7.onUpdateScope;
_local15.onCompleteScope = _local7.onCompleteScope;
_local15.onOverwriteScope = _local7.onOverwriteScope;
_local15.onErrorScope = _local7.onErrorScope;
_local15.rounded = _local7.rounded;
_local15.skipUpdates = _local7.skipUpdates;
removeTweensByTime(_local15.scope, _local15.properties, _local15.timeStart, _local15.timeComplete);
_tweenList.push(_local15);
if ((((_local8 == 0)) && ((_local9 == 0)))){
_local16 = (_tweenList.length - 1);
updateTweenByIndex(_local16);
removeTweenByIndex(_local16);
};
_local3++;
};
return (true);
}
public static function registerTransition(_arg1:String, _arg2:Function):void{
if (!_inited){
init();
};
_transitionList[_arg1] = _arg2;
}
public static function printError(_arg1:String):void{
trace(("## [Tweener] Error: " + _arg1));
}
private static function affectTweens(_arg1:Function, _arg2:Object, _arg3:Array):Boolean{
var _local5:uint;
var _local6:Array;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local4:Boolean;
if (!Boolean(_tweenList)){
return (false);
};
_local5 = 0;
while (_local5 < _tweenList.length) {
if (((_tweenList[_local5]) && ((_tweenList[_local5].scope == _arg2)))){
if (_arg3.length == 0){
_arg1(_local5);
_local4 = true;
} else {
_local6 = new Array();
_local7 = 0;
while (_local7 < _arg3.length) {
if (Boolean(_tweenList[_local5].properties[_arg3[_local7]])){
_local6.push(_arg3[_local7]);
};
_local7++;
};
if (_local6.length > 0){
_local8 = AuxFunctions.getObjectLength(_tweenList[_local5].properties);
if (_local8 == _local6.length){
_arg1(_local5);
_local4 = true;
} else {
_local9 = splitTweens(_local5, _local6);
_arg1(_local9);
_local4 = true;
};
};
};
};
_local5++;
};
return (_local4);
}
public static function getTweens(_arg1:Object):Array{
var _local2:uint;
var _local3:String;
if (!Boolean(_tweenList)){
return ([]);
};
var _local4:Array = new Array();
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
for (_local3 in _tweenList[_local2].properties) {
_local4.push(_local3);
};
};
_local2++;
};
return (_local4);
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public static function pauseTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj = _tweenList[_arg1];
if ((((_local2 == null)) || (_local2.isPaused))){
return (false);
};
_local2.timePaused = getCurrentTweeningTime(_local2);
_local2.isPaused = true;
return (true);
}
public static function getCurrentTweeningTime(_arg1:Object):Number{
return ((_arg1.useFrames) ? _currentTimeFrame : _currentTime);
}
public static function getTweenCount(_arg1:Object):Number{
var _local2:uint;
if (!Boolean(_tweenList)){
return (0);
};
var _local3:Number = 0;
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
_local3 = (_local3 + AuxFunctions.getObjectLength(_tweenList[_local2].properties));
};
_local2++;
};
return (_local3);
}
private static function stopEngine():void{
_engineExists = false;
_tweenList = null;
_currentTime = 0;
_currentTimeFrame = 0;
__tweener_controller__.removeEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
__tweener_controller__ = null;
}
public static function removeTweensByTime(_arg1:Object, _arg2:Object, _arg3:Number, _arg4:Number):Boolean{
var removedLocally:Boolean;
var i:uint;
var pName:String;
var eventScope:Object;
var p_scope = _arg1;
var p_properties = _arg2;
var p_timeStart = _arg3;
var p_timeComplete = _arg4;
var removed:Boolean;
var tl:uint = _tweenList.length;
i = 0;
while (i < tl) {
if (((Boolean(_tweenList[i])) && ((p_scope == _tweenList[i].scope)))){
if ((((p_timeComplete > _tweenList[i].timeStart)) && ((p_timeStart < _tweenList[i].timeComplete)))){
removedLocally = false;
for (pName in _tweenList[i].properties) {
if (Boolean(p_properties[pName])){
if (Boolean(_tweenList[i].onOverwrite)){
eventScope = (Boolean(_tweenList[i].onOverwriteScope)) ? _tweenList[i].onOverwriteScope : _tweenList[i].scope;
try {
_tweenList[i].onOverwrite.apply(eventScope, _tweenList[i].onOverwriteParams);
} catch(e:Error) {
handleError(_tweenList[i], e, "onOverwrite");
};
};
_tweenList[i].properties[pName] = undefined;
delete _tweenList[i].properties[pName];
removedLocally = true;
removed = true;
};
};
if (removedLocally){
if (AuxFunctions.getObjectLength(_tweenList[i].properties) == 0){
removeTweenByIndex(i);
};
};
};
};
i = (i + 1);
};
return (removed);
}
public static function registerSpecialPropertySplitter(_arg1:String, _arg2:Function, _arg3:Array=null):void{
if (!_inited){
init();
};
var _local4:SpecialPropertySplitter = new SpecialPropertySplitter(_arg2, _arg3);
_specialPropertySplitterList[_arg1] = _local4;
}
public static function removeTweenByIndex(_arg1:Number, _arg2:Boolean=false):Boolean{
_tweenList[_arg1] = null;
if (_arg2){
_tweenList.splice(_arg1, 1);
};
return (true);
}
public static function resumeTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(resumeTweenByIndex, _arg1, _local3));
}
public static function pauseTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(pauseTweenByIndex, _arg1, _local3));
}
}
}//package caurina.transitions
Section 8
//TweenListObj (caurina.transitions.TweenListObj)
package caurina.transitions {
public class TweenListObj {
public var hasStarted:Boolean;
public var onUpdate:Function;
public var useFrames:Boolean;
public var count:Number;
public var onOverwriteParams:Array;
public var timeStart:Number;
public var timeComplete:Number;
public var onStartParams:Array;
public var onUpdateScope:Object;
public var rounded:Boolean;
public var onUpdateParams:Array;
public var properties:Object;
public var onComplete:Function;
public var transitionParams:Object;
public var updatesSkipped:Number;
public var onStart:Function;
public var onOverwriteScope:Object;
public var skipUpdates:Number;
public var onStartScope:Object;
public var scope:Object;
public var isCaller:Boolean;
public var timePaused:Number;
public var transition:Function;
public var onCompleteParams:Array;
public var onError:Function;
public var timesCalled:Number;
public var onErrorScope:Object;
public var onOverwrite:Function;
public var isPaused:Boolean;
public var waitFrames:Boolean;
public var onCompleteScope:Object;
public function TweenListObj(_arg1:Object, _arg2:Number, _arg3:Number, _arg4:Boolean, _arg5:Function, _arg6:Object){
scope = _arg1;
timeStart = _arg2;
timeComplete = _arg3;
useFrames = _arg4;
transition = _arg5;
transitionParams = _arg6;
properties = new Object();
isPaused = false;
timePaused = undefined;
isCaller = false;
updatesSkipped = 0;
timesCalled = 0;
skipUpdates = 0;
hasStarted = false;
}
public function clone(_arg1:Boolean):TweenListObj{
var _local3:String;
var _local2:TweenListObj = new TweenListObj(scope, timeStart, timeComplete, useFrames, transition, transitionParams);
_local2.properties = new Array();
for (_local3 in properties) {
_local2.properties[_local3] = properties[_local3].clone();
};
_local2.skipUpdates = skipUpdates;
_local2.updatesSkipped = updatesSkipped;
if (!_arg1){
_local2.onStart = onStart;
_local2.onUpdate = onUpdate;
_local2.onComplete = onComplete;
_local2.onOverwrite = onOverwrite;
_local2.onError = onError;
_local2.onStartParams = onStartParams;
_local2.onUpdateParams = onUpdateParams;
_local2.onCompleteParams = onCompleteParams;
_local2.onOverwriteParams = onOverwriteParams;
_local2.onStartScope = onStartScope;
_local2.onUpdateScope = onUpdateScope;
_local2.onCompleteScope = onCompleteScope;
_local2.onOverwriteScope = onOverwriteScope;
_local2.onErrorScope = onErrorScope;
};
_local2.rounded = rounded;
_local2.isPaused = isPaused;
_local2.timePaused = timePaused;
_local2.isCaller = isCaller;
_local2.count = count;
_local2.timesCalled = timesCalled;
_local2.waitFrames = waitFrames;
_local2.hasStarted = hasStarted;
return (_local2);
}
public function toString():String{
var _local3:String;
var _local1 = "\n[TweenListObj ";
_local1 = (_local1 + ("scope:" + String(scope)));
_local1 = (_local1 + ", properties:");
var _local2:Boolean;
for (_local3 in properties) {
if (!_local2){
_local1 = (_local1 + ",");
};
_local1 = (_local1 + ("[name:" + properties[_local3].name));
_local1 = (_local1 + (",valueStart:" + properties[_local3].valueStart));
_local1 = (_local1 + (",valueComplete:" + properties[_local3].valueComplete));
_local1 = (_local1 + "]");
_local2 = false;
};
_local1 = (_local1 + (", timeStart:" + String(timeStart)));
_local1 = (_local1 + (", timeComplete:" + String(timeComplete)));
_local1 = (_local1 + (", useFrames:" + String(useFrames)));
_local1 = (_local1 + (", transition:" + String(transition)));
_local1 = (_local1 + (", transitionParams:" + String(transitionParams)));
if (skipUpdates){
_local1 = (_local1 + (", skipUpdates:" + String(skipUpdates)));
};
if (updatesSkipped){
_local1 = (_local1 + (", updatesSkipped:" + String(updatesSkipped)));
};
if (Boolean(onStart)){
_local1 = (_local1 + (", onStart:" + String(onStart)));
};
if (Boolean(onUpdate)){
_local1 = (_local1 + (", onUpdate:" + String(onUpdate)));
};
if (Boolean(onComplete)){
_local1 = (_local1 + (", onComplete:" + String(onComplete)));
};
if (Boolean(onOverwrite)){
_local1 = (_local1 + (", onOverwrite:" + String(onOverwrite)));
};
if (Boolean(onError)){
_local1 = (_local1 + (", onError:" + String(onError)));
};
if (onStartParams){
_local1 = (_local1 + (", onStartParams:" + String(onStartParams)));
};
if (onUpdateParams){
_local1 = (_local1 + (", onUpdateParams:" + String(onUpdateParams)));
};
if (onCompleteParams){
_local1 = (_local1 + (", onCompleteParams:" + String(onCompleteParams)));
};
if (onOverwriteParams){
_local1 = (_local1 + (", onOverwriteParams:" + String(onOverwriteParams)));
};
if (onStartScope){
_local1 = (_local1 + (", onStartScope:" + String(onStartScope)));
};
if (onUpdateScope){
_local1 = (_local1 + (", onUpdateScope:" + String(onUpdateScope)));
};
if (onCompleteScope){
_local1 = (_local1 + (", onCompleteScope:" + String(onCompleteScope)));
};
if (onOverwriteScope){
_local1 = (_local1 + (", onOverwriteScope:" + String(onOverwriteScope)));
};
if (onErrorScope){
_local1 = (_local1 + (", onErrorScope:" + String(onErrorScope)));
};
if (rounded){
_local1 = (_local1 + (", rounded:" + String(rounded)));
};
if (isPaused){
_local1 = (_local1 + (", isPaused:" + String(isPaused)));
};
if (timePaused){
_local1 = (_local1 + (", timePaused:" + String(timePaused)));
};
if (isCaller){
_local1 = (_local1 + (", isCaller:" + String(isCaller)));
};
if (count){
_local1 = (_local1 + (", count:" + String(count)));
};
if (timesCalled){
_local1 = (_local1 + (", timesCalled:" + String(timesCalled)));
};
if (waitFrames){
_local1 = (_local1 + (", waitFrames:" + String(waitFrames)));
};
if (hasStarted){
_local1 = (_local1 + (", hasStarted:" + String(hasStarted)));
};
_local1 = (_local1 + "]\n");
return (_local1);
}
public static function makePropertiesChain(_arg1:Object):Object{
var _local3:Object;
var _local4:Object;
var _local5:Object;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local2:Object = _arg1.base;
if (_local2){
_local3 = {};
if ((_local2 is Array)){
_local4 = [];
_local8 = 0;
while (_local8 < _local2.length) {
_local4.push(_local2[_local8]);
_local8++;
};
} else {
_local4 = [_local2];
};
_local4.push(_arg1);
_local6 = _local4.length;
_local7 = 0;
while (_local7 < _local6) {
if (_local4[_local7]["base"]){
_local5 = AuxFunctions.concatObjects(makePropertiesChain(_local4[_local7]["base"]), _local4[_local7]);
} else {
_local5 = _local4[_local7];
};
_local3 = AuxFunctions.concatObjects(_local3, _local5);
_local7++;
};
if (_local3["base"]){
delete _local3["base"];
};
return (_local3);
//unresolved jump
};
return (_arg1);
}
}
}//package caurina.transitions
Section 9
//SWFProfiler (com.flashdynamix.utils.SWFProfiler)
package com.flashdynamix.utils {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.ui.*;
import flash.system.*;
import flash.net.*;
public class SWFProfiler {
private static var started:Boolean = false;
public static var memList:Array = [];
public static var history:int = 60;
private static var itvTime:int;
public static var minMem:Number;
public static var fpsList:Array = [];
private static var frameCount:int;
private static var totalCount:int;
private static var inited:Boolean = false;
public static var minFps:Number;
public static var maxMem:Number;
public static var refreshRate:Number = 1;
private static var displayed:Boolean = false;
public static var maxFps:Number;
private static var currentTime:int;
private static var frame:Sprite;
private static var ci:ContextMenuItem;
private static var content:ProfilerContent;
private static var initTime:int;
private static var stage:Stage;
private static function addEvent(_arg1:EventDispatcher, _arg2:String, _arg3:Function):void{
_arg1.addEventListener(_arg2, _arg3, false, 0, true);
}
private static function show():void{
ci.caption = "Hide Profiler";
displayed = true;
stage.addChild(content);
updateDisplay();
}
public static function stop():void{
if (!started){
return;
};
started = false;
removeEvent(frame, Event.ENTER_FRAME, draw);
}
public static function get averageFps():Number{
return ((totalCount / runningTime));
}
public static function init(_arg1:InteractiveObject):void{
if (inited){
return;
};
inited = true;
stage = _arg1.stage;
content = new ProfilerContent();
frame = new Sprite();
minFps = Number.MAX_VALUE;
maxFps = Number.MIN_VALUE;
minMem = Number.MAX_VALUE;
maxMem = Number.MIN_VALUE;
var _local2:ContextMenu = new ContextMenu();
_local2.hideBuiltInItems();
ci = new ContextMenuItem("Show Profiler", true);
_local2.customItems = [ci];
_arg1.contextMenu = _local2;
addEvent(ci, ContextMenuEvent.MENU_ITEM_SELECT, onSelect);
start();
}
public static function get currentMem():Number{
return (((System.totalMemory / 0x0400) / 1000));
}
private static function get runningTime():Number{
return (((currentTime - initTime) / 1000));
}
private static function get intervalTime():Number{
return (((currentTime - itvTime) / 1000));
}
private static function updateDisplay():void{
updateMinMax();
content.update(runningTime, minFps, maxFps, minMem, maxMem, currentFps, currentMem, averageFps, fpsList, memList, history);
}
private static function onSelect(_arg1:ContextMenuEvent):void{
if (!displayed){
show();
} else {
hide();
};
}
public static function get currentFps():Number{
return ((frameCount / intervalTime));
}
private static function hide():void{
ci.caption = "Show Profiler";
displayed = false;
stage.removeChild(content);
}
private static function draw(_arg1:Event=null):void{
currentTime = getTimer();
frameCount++;
totalCount++;
if (intervalTime >= refreshRate){
if (displayed){
updateDisplay();
} else {
updateMinMax();
};
fpsList.unshift(currentFps);
memList.unshift(currentMem);
if (fpsList.length > history){
fpsList.pop();
};
if (memList.length > history){
memList.pop();
};
itvTime = currentTime;
frameCount = 0;
};
}
public static function gc():void{
try {
System.gc();
new LocalConnection().connect("foo");
new LocalConnection().connect("foo");
} catch(e:Error) {
};
}
public static function start():void{
if (started){
return;
};
started = true;
initTime = (itvTime = getTimer());
totalCount = (frameCount = 0);
addEvent(frame, Event.ENTER_FRAME, draw);
}
private static function updateMinMax():void{
if (!(currentFps > 0)){
return;
};
minFps = Math.min(currentFps, minFps);
maxFps = Math.max(currentFps, maxFps);
minMem = Math.min(currentMem, minMem);
maxMem = Math.max(currentMem, maxMem);
}
private static function removeEvent(_arg1:EventDispatcher, _arg2:String, _arg3:Function):void{
_arg1.removeEventListener(_arg2, _arg3);
}
}
}//package com.flashdynamix.utils
import flash.events.*;
import flash.display.*;
import flash.text.*;
class ProfilerContent extends Sprite {
private var maxFpsTxtBx:TextField;
private var minMemTxtBx:TextField;
private var fps:Shape;
private var box:Shape;
private var minFpsTxtBx:TextField;
private var maxMemTxtBx:TextField;
private var infoTxtBx:TextField;
private var mb:Shape;
private function ProfilerContent():void{
fps = new Shape();
mb = new Shape();
box = new Shape();
this.mouseChildren = false;
this.mouseEnabled = false;
fps.x = 65;
fps.y = 45;
mb.x = 65;
mb.y = 90;
var _local1:TextFormat = new TextFormat("_sans", 9, 0xAAAAAA);
infoTxtBx = new TextField();
infoTxtBx.autoSize = TextFieldAutoSize.LEFT;
infoTxtBx.defaultTextFormat = new TextFormat("_sans", 11, 0xCCCCCC);
infoTxtBx.y = 98;
minFpsTxtBx = new TextField();
minFpsTxtBx.autoSize = TextFieldAutoSize.LEFT;
minFpsTxtBx.defaultTextFormat = _local1;
minFpsTxtBx.x = 7;
minFpsTxtBx.y = 37;
maxFpsTxtBx = new TextField();
maxFpsTxtBx.autoSize = TextFieldAutoSize.LEFT;
maxFpsTxtBx.defaultTextFormat = _local1;
maxFpsTxtBx.x = 7;
maxFpsTxtBx.y = 5;
minMemTxtBx = new TextField();
minMemTxtBx.autoSize = TextFieldAutoSize.LEFT;
minMemTxtBx.defaultTextFormat = _local1;
minMemTxtBx.x = 7;
minMemTxtBx.y = 83;
maxMemTxtBx = new TextField();
maxMemTxtBx.autoSize = TextFieldAutoSize.LEFT;
maxMemTxtBx.defaultTextFormat = _local1;
maxMemTxtBx.x = 7;
maxMemTxtBx.y = 50;
addChild(box);
addChild(infoTxtBx);
addChild(minFpsTxtBx);
addChild(maxFpsTxtBx);
addChild(minMemTxtBx);
addChild(maxMemTxtBx);
addChild(fps);
addChild(mb);
this.addEventListener(Event.ADDED_TO_STAGE, added, false, 0, true);
this.addEventListener(Event.REMOVED_FROM_STAGE, removed, false, 0, true);
}
private function added(_arg1:Event):void{
resize();
stage.addEventListener(Event.RESIZE, resize, false, 0, true);
}
private function removed(_arg1:Event):void{
stage.removeEventListener(Event.RESIZE, resize);
}
private function resize(_arg1:Event=null):void{
var _local2:Graphics = box.graphics;
_local2.clear();
_local2.beginFill(0, 0.5);
_local2.drawRect(0, 0, stage.stageWidth, 120);
_local2.lineStyle(1, 0xFFFFFF, 0.2);
_local2.moveTo(65, 45);
_local2.lineTo(65, 10);
_local2.moveTo(65, 45);
_local2.lineTo((stage.stageWidth - 15), 45);
_local2.moveTo(65, 90);
_local2.lineTo(65, 55);
_local2.moveTo(65, 90);
_local2.lineTo((stage.stageWidth - 15), 90);
_local2.endFill();
infoTxtBx.x = ((stage.stageWidth - infoTxtBx.width) - 20);
}
public function update(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Array, _arg10:Array, _arg11:int):void{
var _local19:Number;
if (_arg1 >= 1){
minFpsTxtBx.text = (_arg2.toFixed(3) + " Fps");
maxFpsTxtBx.text = (_arg3.toFixed(3) + " Fps");
minMemTxtBx.text = (_arg4.toFixed(3) + " Mb");
maxMemTxtBx.text = (_arg5.toFixed(3) + " Mb");
};
infoTxtBx.text = (((((("Current Fps " + _arg6.toFixed(3)) + " | Average Fps ") + _arg8.toFixed(3)) + " | Memory Used ") + _arg7.toFixed(3)) + " Mb");
infoTxtBx.x = ((stage.stageWidth - infoTxtBx.width) - 20);
var _local12:Graphics = fps.graphics;
_local12.clear();
_local12.lineStyle(1, 0x33FF00, 0.7);
var _local13:int;
var _local14:int = _arg9.length;
var _local15 = 35;
var _local16:int = (stage.stageWidth - 80);
var _local17:Number = (_local16 / (_arg11 - 1));
var _local18:Number = (_arg3 - _arg2);
_local13 = 0;
while (_local13 < _local14) {
_local19 = ((_arg9[_local13] - _arg2) / _local18);
if (_local13 == 0){
_local12.moveTo(0, (-(_local19) * _local15));
} else {
_local12.lineTo((_local13 * _local17), (-(_local19) * _local15));
};
_local13++;
};
_local12 = mb.graphics;
_local12.clear();
_local12.lineStyle(1, 26367, 0.7);
_local13 = 0;
_local14 = _arg10.length;
_local18 = (_arg5 - _arg4);
_local13 = 0;
while (_local13 < _local14) {
_local19 = ((_arg10[_local13] - _arg4) / _local18);
if (_local13 == 0){
_local12.moveTo(0, (-(_local19) * _local15));
} else {
_local12.lineTo((_local13 * _local17), (-(_local19) * _local15));
};
_local13++;
};
}
}
Section 10
//GameEvent (com.nick.pom.core.GameEvent)
package com.nick.pom.core {
import flash.events.*;
public class GameEvent extends Event {
private var _score:uint;
public static const GAME_OVER:String = "gameOver";
public function GameEvent(_arg1:String, _arg2:uint, _arg3:Boolean=true, _arg4:Boolean=false){
_score = _arg2;
super(_arg1, _arg3, _arg4);
}
public function get score():uint{
return (_score);
}
override public function clone():Event{
return (new GameEvent(type, _score, bubbles, cancelable));
}
}
}//package com.nick.pom.core
Section 11
//ICore (com.nick.pom.core.ICore)
package com.nick.pom.core {
import flash.display.*;
public interface ICore {
function init(_arg1:XML, _arg2:IGame, _arg3:MovieClip, _arg4:ITransition, _arg5:IEndScreen):void;
function showMenu():void;
function get border():MovieClip;
}
}//package com.nick.pom.core
Section 12
//IDispatch (com.nick.pom.core.IDispatch)
package com.nick.pom.core {
public interface IDispatch {
function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void;
function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void;
}
}//package com.nick.pom.core
Section 13
//IEndScreen (com.nick.pom.core.IEndScreen)
package com.nick.pom.core {
public interface IEndScreen extends IDispatch {
function gotoStatus(_arg1:uint, _arg2:Array=null):void;
function gotoPart(_arg1:uint, _arg2:Array):void;
}
}//package com.nick.pom.core
Section 14
//IGame (com.nick.pom.core.IGame)
package com.nick.pom.core {
public interface IGame extends IDispatch {
function start():void;
function resume():void;
function pause():void;
function quit():void;
}
}//package com.nick.pom.core
Section 15
//ITransition (com.nick.pom.core.ITransition)
package com.nick.pom.core {
public interface ITransition extends IDispatch {
function transitionOut():void;
function transitionIn():void;
function transitionInOut():void;
}
}//package com.nick.pom.core
Section 16
//Boy (com.nick.pom.nutsforpeanuts.Boy)
package com.nick.pom.nutsforpeanuts {
import flash.events.*;
import flash.display.*;
import gs.*;
import gs.easing.*;
public class Boy extends MovieClip {
private var _speedTween:TweenMax;
private var _speed:Number;
private var _tween:TweenMax;
public var clip:Sprite;
private var _origProps:Object;
public function Boy(){
stop();
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
}
private function onAddedToStage(_arg1:Event):void{
_origProps = {x:x, y:y, scaleX:scaleX, scaleY:scaleY};
}
function start():void{
var _local1:*;
TweenMax.killTweensOf(this, false);
play();
if (_tween){
_tween = null;
for (_local1 in _origProps) {
this[_local1] = _origProps[_local1];
};
};
startAcceleration();
walkLeft();
trace("boy acceleration restarted");
}
function resume():void{
if (Game.instance.paused){
return;
};
play();
if (_tween){
_tween.resume();
};
if (_speedTween){
_speedTween.resume();
};
}
public function get speed():Number{
return (_speed);
}
function quit():void{
TweenMax.killTweensOf(this, false);
}
public function startAcceleration(){
speed = 8;
_speedTween = TweenMax.to(this, 300, {speed:4});
}
private function walkLeft(){
scaleX = 1;
x = 505;
_tween = TweenMax.to(this, speed, {x:20, onComplete:walkRight, ease:Linear.easeNone});
}
public function set speed(_arg1:Number){
_speed = _arg1;
}
function pause():void{
stop();
if (_tween){
_tween.pause();
};
if (_speedTween){
_speedTween.pause();
};
}
private function walkRight(){
scaleX = -1;
x = 80;
_tween = TweenMax.to(this, speed, {x:580, onComplete:walkLeft, ease:Linear.easeNone});
}
function get hitSpot():HitSpot{
return (clip["hitSpot"]);
}
}
}//package com.nick.pom.nutsforpeanuts
Section 17
//Button (com.nick.pom.nutsforpeanuts.Button)
package com.nick.pom.nutsforpeanuts {
import flash.events.*;
import flash.display.*;
import gs.*;
import gs.easing.*;
public class Button extends Sprite {
private var _origProps:Object;
public var hit:Sprite;
public var clip:Sprite;
public function Button(){
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
hit.mouseEnabled = false;
hitArea = hit;
buttonMode = true;
}
private function onAddedToStage(_arg1:Event):void{
addEventListener(MouseEvent.ROLL_OVER, _onRollOver, false, 0, true);
addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
_origProps = {x:x};
}
private function onClick(_arg1:MouseEvent):void{
Sounds.click();
}
function animateIn(){
}
private function _onRollOver(_arg1:Event){
TweenMax.to(clip, 0.3, {x:15, tint:0xFFFFFF});
TweenMax.to(clip, 0.3, {x:0, ease:Back.easeOut, delay:0.3});
TweenMax.to(clip, 0.3, {tint:null, delay:0.3});
}
}
}//package com.nick.pom.nutsforpeanuts
Section 18
//Crash (com.nick.pom.nutsforpeanuts.Crash)
package com.nick.pom.nutsforpeanuts {
import flash.events.*;
import flash.display.*;
public class Crash extends MovieClip {
public function Crash(){
addFrameScript(37, frame38);
super();
stop();
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
}
public function done(){
stop();
Game.instance.addEndScreen();
}
public function onAddedToStage(_arg1:Event){
gotoAndPlay(1);
}
function frame38(){
done();
}
}
}//package com.nick.pom.nutsforpeanuts
Section 19
//Elephant (com.nick.pom.nutsforpeanuts.Elephant)
package com.nick.pom.nutsforpeanuts {
import flash.events.*;
import caurina.transitions.*;
import flash.display.*;
import gs.*;
import org.casalib.util.*;
import gs.easing.*;
import flash.utils.*;
public class Elephant extends Sprite {
private var _anger:Number;// = 0.5
public var hit:Sprite;
private var _bobTween:TweenMax;
private var _index:uint;
public var warning:Sprite;
private var _peakAnger:Number;
private var _angerInterval:uint;
private var _origProps:Object;
private var _saturation:Number;
private var _peanutsFed:uint;
public var trunk:Sprite;
private var _trunkTween:TweenMax;
private var _idling:Boolean;// = true
private static var _elephants:Array = [];
private static var _highestElephantDepth:uint;
private static var _addElephantTimeout:uint;
private static var _inactiveElephants:Array = [];
private static var _hunger:Number;
private static var _activeElephants:Array = [];
private static var _startScale = 0.5;
private static var _addElephantDelay:uint;
public function Elephant(){
_elephants.push(this);
_inactiveElephants.push(this);
buttonMode = true;
_origProps = {x:x, y:y};
_index = uint(this.name.substr(8, 1));
scaleX = (scaleY = _startScale);
y = (_origProps.y + 20);
anger = (_peakAnger = (saturation = _anger));
addEventListener(MouseEvent.CLICK, onClick);
addEventListener(MouseEvent.ROLL_OVER, onRollOver);
addEventListener(MouseEvent.ROLL_OUT, onRollOut);
trunk["hit"].mouseEnabled = false;
trunk.hitArea = trunk["hit"];
hit.mouseEnabled = false;
hitArea = hit;
warning.mouseEnabled = false;
warning.mouseChildren = false;
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
}
private function randomTrunk(){
_trunkTween = TweenMax.to(trunk, ((Math.random() * 0.5) + 5), {y:(Math.random() * 20), rotation:((Math.random() * 20) - 10), delay:(Math.random() * 5), onComplete:randomTrunk, ease:Expo.easeInOut});
}
private function onClick(_arg1:MouseEvent){
Game.instance.tryFeedElephant(this);
}
private function charge(){
mouseEnabled = (mouseChildren = false);
Sounds.elephant();
idle();
parent.setChildIndex(this, _highestElephantDepth);
TweenMax.to(this, 1, {scaleX:1.2, scaleY:1.2, ease:Sine.easeIn, onComplete:Game.instance.crackWall});
TweenMax.to(this, 1, {y:(_origProps.y + 20), scaleX:0.5, scaleY:0.5, ease:Sine.easeInOut, delay:1, onComplete:deactivate});
}
function start(){
warning.visible = false;
_idling = false;
mouseEnabled = true;
_peanutsFed = 0;
clearInterval(_angerInterval);
_angerInterval = setInterval(incAnger, 4000);
randomBob();
randomTrunk();
TweenMax.to(this, 2, {scaleX:1, scaleY:1, ease:Linear.easeOut});
TweenMax.to(this, 2, {y:_origProps.y, ease:Bounce.easeOut});
}
function feedPeanut(){
_peanutsFed++;
anger = (anger - (1 / (_hunger * 10)));
}
function get anger():Number{
return (_anger);
}
private function incAnger(){
anger = (anger + 0.1);
}
private function randomBob(){
_bobTween = TweenMax.to(this, ((Math.random() * 0.5) + 5), {x:(((Math.random() * 30) - 15) + _origProps.x), y:(((Math.random() * 20) - 10) + _origProps.y), delay:(Math.random() * 5), onComplete:randomBob, ease:Expo.easeInOut});
}
private function deactivate(){
saturation = 0.5;
_anger = 0.5;
_inactiveElephants.push(this);
ArrayUtil.removeItem(_activeElephants, this);
}
function set anger(_arg1:Number){
_anger = Math.max(Math.min(1, _arg1), 0);
_peakAnger = Math.max(_peakAnger, _anger);
TweenMax.to(this, 1, {saturation:_anger});
if ((((_anger >= 0.9)) && ((_anger < 1)))){
warning.visible = true;
} else {
warning.visible = false;
};
if (_anger == 1){
charge();
} else {
if (_anger <= 0){
receed();
};
};
}
private function idle(){
_idling = true;
clearInterval(_angerInterval);
if (_bobTween){
_bobTween.pause();
};
if (_trunkTween){
_trunkTween.pause();
};
mouseEnabled = (mouseChildren = false);
TweenMax.to(trunk, 1, {y:0});
}
public function get saturation():Number{
return (_saturation);
}
public function set saturation(_arg1:Number){
_saturation = _arg1;
TweenMax.to(this, 0, {colorMatrixFilter:{saturation:_saturation}});
}
private function onRollOut(_arg1:MouseEvent){
Game.instance.elephantPointer(false);
}
private function onAddedToStage(_arg1:Event):void{
_highestElephantDepth = Math.max(parent.getChildIndex(this), _highestElephantDepth);
}
private function receed(){
var _local1:Number = (Math.round((_hunger * 5)) * 100);
var _local2:Number = Math.round(((_hunger * 10) / 2));
var _local3:Number = ((_peanutsFed - _local2) * 100);
var _local4:* = Math.max((_local1 - _local3), 100);
Game.instance.scorePoints(_local4);
setTimeout(Game.instance.elephantScorePrompt, 500, this, _local4);
trace("points:", _local4, "peanutsFed:", _peanutsFed, "initPeanutsNeeded:", _local2, "potentialPoints:", _local1, "penalty:", _local3, "_anger:", _anger);
idle();
TweenMax.to(this, 1, {y:(_origProps.y + 20), scaleX:0.5, scaleY:0.5, ease:Linear.easeNone, delay:1, onComplete:deactivate});
}
private function onRollOver(_arg1:MouseEvent){
Game.instance.elephantPointer(true);
}
public static function startElephants(){
reset();
_hunger = 0.1;
_addElephantDelay = 6000;
Tweener.addCaller(Elephant, {onUpdate:increaseHunger, time:180, count:8, delay:20, transition:"linear"});
TweenMax.to(Elephant, 180, {addElephantDelay:3000, ease:Sine.easeOut});
clearTimeout(_addElephantTimeout);
_addElephantTimeout = setTimeout(addElephant, 2000);
}
public static function get elephants():Array{
return (_elephants);
}
static function reset():void{
var _local1:Object;
var _local2:String;
clearTimeout(_addElephantTimeout);
for each (_local1 in _elephants) {
clearInterval(_local1._angerInterval);
for (_local2 in _local1._origProps) {
_local1.idle();
_local1.scaleY = _startScale;
_local1.scaleX = _startScale;
_local1.y = (_local1._origProps.y + 20);
_local1._anger = (_local1.saturation = 0.5);
};
};
_inactiveElephants = _elephants.concat();
_activeElephants = [];
}
public static function get addElephantDelay():uint{
return (_addElephantDelay);
}
private static function addElephant(){
var _local2:Elephant;
var _local1:uint = (Math.random() * inactiveElephants.length);
if (inactiveElephants.length){
_local2 = inactiveElephants[_local1];
_inactiveElephants.splice(_local1, 1);
_local2.start();
_activeElephants.concat(_local2);
};
clearTimeout(_addElephantTimeout);
_addElephantTimeout = setTimeout(addElephant, _addElephantDelay);
}
public static function get inactiveElephants():Array{
return (_inactiveElephants);
}
private static function increaseHunger(){
_hunger = NumberUtil.roundDecimalToPlace(Math.min((_hunger + 0.1), 1), 1);
trace("increasing hunger", _hunger);
}
public static function set addElephantDelay(_arg1:uint){
_addElephantDelay = _arg1;
}
public static function get activeElephants():Array{
return (_activeElephants);
}
static function resume():void{
var _local1:Object;
clearTimeout(_addElephantTimeout);
_addElephantTimeout = setTimeout(addElephant, _addElephantDelay);
for each (_local1 in _elephants) {
if (!_local1._idling){
clearInterval(_local1._angerInterval);
_local1._angerInterval = setInterval(_local1.incAnger, 4000);
};
};
Tweener.resumeTweens(Elephant);
}
static function pause():void{
var _local1:Object;
clearTimeout(_addElephantTimeout);
for each (_local1 in _elephants) {
clearInterval(_local1._angerInterval);
};
Tweener.pauseTweens(Elephant);
}
}
}//package com.nick.pom.nutsforpeanuts
Section 20
//EndScreen (com.nick.pom.nutsforpeanuts.EndScreen)
package com.nick.pom.nutsforpeanuts {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class EndScreen extends Sprite {
public var playButton:Sprite;
public var pointsField:TextField;
public function EndScreen(){
playButton.addEventListener(MouseEvent.CLICK, replayGame);
}
function replayGame(_arg1:Event){
Game.instance.startGamePlay();
}
function set points(_arg1:uint){
pointsField.text = String(_arg1);
}
}
}//package com.nick.pom.nutsforpeanuts
Section 21
//Game (com.nick.pom.nutsforpeanuts.Game)
package com.nick.pom.nutsforpeanuts {
import flash.events.*;
import com.nick.pom.core.*;
import flash.display.*;
import gs.*;
import flash.geom.*;
import gs.easing.*;
import flash.utils.*;
import com.flashdynamix.utils.*;
import flash.ui.*;
import flash.errors.*;
public class Game extends MovieClip implements IGame {
private var _points:uint;
private var _menuButton:Sprite;
private var _instructionScreen:InstructionScreen;
public var penguin:Penguin;
public var border:MovieClip;
public var pointer:MovieClip;
public var sidePenguins:SidePenguins;
public var elephant0:Elephant;
public var elephant1:Elephant;
public var elephant2:Elephant;
public var elephant3:Elephant;
public var elephant4:Elephant;
private var _gameOver:Boolean;// = true
private var _paused:Boolean;
private var _peanuts:uint;
private var _shotRadians:Number;
public var bars1:Sprite;
public var bars2:Sprite;
public var rope1:Sprite;
public var rope2:Sprite;
public var scoreBoard:Sprite;
public var target:Sprite;
private var _crashWall:Crash;
public var penguinCursorActivator:Sprite;
private var _shakeTween:TweenMax;
private var _endScreen:EndScreen;
private var _dragging:Boolean;
public var crack:MovieClip;
var p1:Point;
var p2:Point;
var p3:Point;
var p4:Point;
public var boy:Boy;
var angle:Number;
private var _pTarget:Object;
public var titleScreen:TitleScreen;
static const RETURN_POINT:Point = new Point(300, 150);
static const TRAJECTORY_POINT:Point = new Point(300, 180);
private static var _instance:Game;
public function Game(){
var _local1:uint;
_pTarget = {};
_instructionScreen = new InstructionScreen();
_endScreen = new EndScreen();
_crashWall = new Crash();
p1 = new Point();
p2 = new Point();
p3 = new Point();
p4 = new Point();
super();
trace("Game instance up.");
if (_instance){
throw (new IllegalOperationError("Game instance already instantiated."));
};
_instance = this;
updateElems(null);
rope1.mouseEnabled = false;
rope2.mouseEnabled = false;
rope1.mouseChildren = false;
rope2.mouseChildren = false;
bars1.mouseEnabled = false;
bars2.mouseEnabled = false;
bars1.mouseChildren = false;
bars2.mouseChildren = false;
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
}
private function shakeTween(){
var shakeSidePenguins:Function;
var randEase:Function;
shakeSidePenguins = function (){
if (((!((sidePenguins.parent == this))) && (!(contains(_crashWall))))){
sidePenguins.shakeRestPos(x, y);
};
};
randEase = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
var t = _arg1;
var b = _arg2;
var c = _arg3;
var d = _arg4;
var s = _arg5;
var randPosNeg:Function = function ():int{
if (Math.random() >= 0.5){
return (3);
};
return (1);
};
return (((Math.abs((t - 1)) * randPosNeg()) * Math.random()));
};
Sounds.impact();
x = (y = 4);
TweenMax.to(this, 0.6, {onUpdate:shakeSidePenguins, x:0, ease:randEase});
TweenMax.to(this, 0.6, {onUpdate:shakeSidePenguins, y:0, ease:randEase});
}
private function set pointerMode(_arg1:String){
pointer.gotoAndStop(_arg1);
if (_arg1 == PointerMode.NORMAL){
Mouse.show();
} else {
Mouse.hide();
};
if (_arg1 == PointerMode.DRAG){
pointer.mouseEnabled = true;
} else {
pointer.mouseEnabled = false;
};
}
function scorePoints(_arg1:uint){
points = (points + _arg1);
}
function get shotRadians():Number{
return (_shotRadians);
}
public function set _customPointer(_arg1:Boolean){
if (_arg1){
pointer.visible = true;
stage.addEventListener(MouseEvent.MOUSE_MOVE, movePointer, false, 0, true);
pointer.x = stage.mouseX;
pointer.y = stage.mouseY;
} else {
pointer.visible = false;
stage.removeEventListener(MouseEvent.MOUSE_MOVE, movePointer);
};
}
function get pTarget():Object{
return (_pTarget);
}
function tryFeedElephant(_arg1:Elephant){
var _local2:PeanutProjectile;
if ((((_peanuts > 0)) && ((_arg1.anger > 0)))){
peanuts--;
_local2 = new PeanutProjectile(_arg1);
Sounds.swish();
sidePenguins.throwPeanut();
addChildAt(_local2, 8);
};
}
private function set peanuts(_arg1:uint){
_peanuts = _arg1;
scoreBoard["peanuts"].text = _peanuts;
}
public function resume():void{
Sounds.bgLoops();
mouseEnabled = true;
mouseChildren = true;
trace("game resumed <===============");
_customPointer = true;
_paused = false;
boy.resume();
Elephant.resume();
penguin.resume();
sidePenguins.animateIn();
}
public function get paused():Boolean{
return (_paused);
}
public function movePointer(_arg1:MouseEvent){
pointer.x = _arg1.stageX;
pointer.y = _arg1.stageY;
_arg1.updateAfterEvent();
}
public function onDragStarted(){
Sounds.rope();
_dragging = true;
pointerMode = PointerMode.DRAG;
target.visible = true;
whileDragging(null);
stage.addEventListener(MouseEvent.MOUSE_MOVE, whileDragging, false, -100000);
}
public function quit():void{
Sounds.bgLoopsOut();
if (_menuButton){
_menuButton.visible = false;
_menuButton.alpha = 0;
};
pause();
_customPointer = false;
addChild(titleScreen);
sidePenguins.blurOut();
mouseEnabled = true;
mouseChildren = true;
}
private function whileFlinging(_arg1:Event):void{
updateElems(null);
}
function onRecoilComplete(){
stage.removeEventListener(Event.ENTER_FRAME, whileFlinging);
}
public function start():void{
mouseEnabled = true;
mouseChildren = true;
if ((parent is ICore)){
_menuButton = border.menuButton;
_menuButton.visible = false;
_menuButton.alpha = 0;
};
}
private function updateElems(_arg1:Event):void{
p1.x = rope1.x;
p1.y = rope1.y;
p2.x = rope2.x;
p2.y = rope2.y;
p3.x = (penguin.x - 13);
p3.y = penguin.y;
p4.x = (penguin.x + 15);
p4.y = penguin.y;
rope1["clip"].width = Point.distance(p1, p3);
rope2["clip"].width = Point.distance(p2, p4);
angle = Math.atan2((penguin.y - rope1.y), ((penguin.x - 13) - rope1.x));
angle = ((180 / Math.PI) * angle);
rope1.rotation = angle;
angle = Math.atan2((penguin.y - rope2.y), ((penguin.x + 15) - rope2.x));
angle = ((180 / Math.PI) * angle);
rope2.rotation = angle;
bars1.visible = (penguin.y < 170);
bars2.visible = (penguin.y >= 170);
if (penguin.y < rope1.y){
setChildIndex(penguin, (getChildIndex(rope1) - 1));
} else {
setChildIndex(penguin, (getChildIndex(rope2) + 2));
};
}
function addEndScreen(){
var delayedAddEndScreen:Function;
delayedAddEndScreen = function (){
addChild(_endScreen);
};
dispatchEvent(new GameEvent(GameEvent.GAME_OVER, _points));
_endScreen.points = _points;
setTimeout(delayedAddEndScreen, 1000);
}
private function get peanuts():uint{
return (_peanuts);
}
private function whileDragging(_arg1:MouseEvent):void{
if (_arg1){
_arg1.updateAfterEvent();
};
penguin.upright();
var _local2:Point = new Point(penguin.x, penguin.y);
_pTarget.x = (-((penguin.x - TRAJECTORY_POINT.x)) + TRAJECTORY_POINT.x);
_pTarget.y = (-((penguin.y - TRAJECTORY_POINT.y)) + TRAJECTORY_POINT.y);
_shotRadians = Math.atan2((penguin.y - TRAJECTORY_POINT.y), (penguin.x - TRAJECTORY_POINT.x));
target.x = ((Math.cos((_shotRadians + Math.PI)) * (Point.distance(TRAJECTORY_POINT, _local2) + 31)) + TRAJECTORY_POINT.x);
target.y = ((Math.sin((_shotRadians + Math.PI)) * (Point.distance(TRAJECTORY_POINT, _local2) + 31)) + TRAJECTORY_POINT.y);
updateElems(null);
}
public function onDragStopped(){
Sounds.whoosh();
_dragging = false;
pointerMode = PointerMode.NORMAL;
target.visible = false;
stage.removeEventListener(MouseEvent.MOUSE_MOVE, whileDragging);
stage.addEventListener(Event.ENTER_FRAME, whileFlinging, false, -1);
}
public function onAddedToStage(_arg1:Event):void{
SWFProfiler.init(this);
if ((parent is ICore)){
border = parent["border"];
};
if (border){
border.addChild(sidePenguins);
border.addChild(pointer);
};
pointer.mouseEnabled = false;
pointer.mouseChildren = false;
if (!(parent is ICore)){
start();
};
}
function instructions():void{
removeChild(titleScreen);
addChild(_instructionScreen);
}
function earnPeanuts(_arg1:uint){
peanuts = (peanuts + _arg1);
scorePoints((_arg1 * 5));
}
function crackWall():void{
if (!_gameOver){
shakeTween();
if (crack.currentFrame < 4){
crack.gotoAndStop((crack.currentFrame + 1));
} else {
gameOver();
};
};
}
function testHit():Boolean{
var _local2:PeanutPrompt;
boy.pause();
var _local1:uint = boy.hitSpot.hitTest(target);
if (((_local1) && (!(contains(_crashWall))))){
_local2 = new PeanutPrompt(_local1);
earnPeanuts(_local1);
_local2.x = target.x;
_local2.y = (target.y - 20);
Sounds.chomp();
addChild(_local2);
};
return (Boolean(_local1));
}
function elephantScorePrompt(_arg1:Elephant, _arg2:uint){
var _local3:ScorePrompt;
if (!contains(_crashWall)){
_local3 = new ScorePrompt(_arg2);
_local3.x = _arg1.x;
_local3.y = 100;
addChild(_local3);
};
}
private function set points(_arg1:uint){
_points = _arg1;
scoreBoard["points"].text = ("SCORE: " + _points);
}
public function startGamePlay():void{
_gameOver = false;
Sounds.bgLoops();
_paused = false;
points = 0;
peanuts = 0;
if ((parent is ICore)){
TweenMax.to(_menuButton, 0.5, {autoAlpha:1});
};
_customPointer = true;
crack.gotoAndStop(1);
if (contains(_instructionScreen)){
removeChild(_instructionScreen);
};
if (contains(_endScreen)){
removeChild(_endScreen);
};
if (contains(_crashWall)){
removeChild(_crashWall);
};
boy.start();
penguin.activate();
sidePenguins.animateIn();
Elephant.startElephants();
}
private function get points():uint{
return (_points);
}
private function gameOver(){
_gameOver = true;
if (_menuButton){
TweenMax.to(_menuButton, 0.2, {delay:2.5, autoAlpha:0});
};
_customPointer = false;
Elephant.pause();
addChild(_crashWall);
peanuts = 0;
sidePenguins.blurOut();
Sounds.bgLoopsOut();
Sounds.crash();
}
public function elephantPointer(_arg1:Boolean){
if (!_dragging){
if (_arg1){
pointerMode = PointerMode.ELEPHANT;
} else {
pointerMode = PointerMode.NORMAL;
};
};
}
public function pause():void{
Sounds.bgLoopsOut();
mouseEnabled = false;
mouseChildren = false;
sidePenguins.blurOut();
_customPointer = false;
_paused = true;
Elephant.pause();
boy.pause();
penguin.pause();
trace("game paused <===============");
}
public static function get instance():Game{
if (_instance == null){
_instance = new (Game);
};
return (Game._instance);
}
}
}//package com.nick.pom.nutsforpeanuts
Section 22
//HitSpot (com.nick.pom.nutsforpeanuts.HitSpot)
package com.nick.pom.nutsforpeanuts {
import flash.display.*;
import flash.geom.*;
import flash.errors.*;
public class HitSpot extends Sprite {
function hitTest(_arg1):Number{
if (!((("x" in _arg1)) && (("y" in _arg1)))){
throw (new IllegalOperationError("testObj param must have x and y properties."));
};
var _local2:Point = new Point(_arg1.x, _arg1.y);
var _local3:Point = parent.localToGlobal(new Point(x, y));
var _local4:uint = Math.round(Math.max((25 - Point.distance(_local2, _local3)), 0));
var _local5:uint = Math.ceil((_local4 / 5));
return (_local5);
}
}
}//package com.nick.pom.nutsforpeanuts
Section 23
//InstructionScreen (com.nick.pom.nutsforpeanuts.InstructionScreen)
package com.nick.pom.nutsforpeanuts {
import flash.events.*;
import flash.display.*;
public class InstructionScreen extends Sprite {
public var playButton:Sprite;
public function InstructionScreen(){
playButton.addEventListener(MouseEvent.CLICK, start);
}
public function start(_arg1:Event){
Game.instance.startGamePlay();
}
}
}//package com.nick.pom.nutsforpeanuts
Section 24
//PeanutProjectile (com.nick.pom.nutsforpeanuts.PeanutProjectile)
package com.nick.pom.nutsforpeanuts {
import flash.events.*;
import flash.display.*;
import gs.*;
import gs.easing.*;
public class PeanutProjectile extends Sprite {
private var _target:Sprite;
private var _thisClip:PeanutProjectile;
public function PeanutProjectile(_arg1:Sprite){
_thisClip = this;
_target = _arg1;
this.x = 55;
this.y = 42;
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
if ((_target is Elephant)){
easeElephant(Elephant(_target));
};
mouseEnabled = false;
mouseChildren = false;
}
private function launch(){
var onComplete:Function;
onComplete = function (){
if (parent){
parent.removeChild(_thisClip);
};
};
var time:Number = 1;
TweenMax.to(this, time, {x:_target.x, rotation:6000, ease:Sine.easeInOut, onComplete:onComplete});
TweenMax.to(this, (time / 2), {y:20, ease:Sine.easeOut});
TweenMax.to(this, (time / 2), {y:200, ease:Sine.easeIn, delay:(time / 2)});
}
private function onAddedToStage(_arg1:Event){
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
launch();
}
private function easeElephant(_arg1:Elephant){
_arg1.feedPeanut();
}
}
}//package com.nick.pom.nutsforpeanuts
Section 25
//PeanutPrompt (com.nick.pom.nutsforpeanuts.PeanutPrompt)
package com.nick.pom.nutsforpeanuts {
import flash.events.*;
import flash.display.*;
import gs.*;
public class PeanutPrompt extends Sprite {
public var clip:Sprite;
public function PeanutPrompt(_arg1:uint){
this.score = _arg1;
rotation = ((Math.random() * 20) - 10);
alpha = 0;
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
mouseChildren = false;
mouseEnabled = false;
}
private function onAddedToStage(_arg1:Event){
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
TweenMax.to(this, 0.5, {alpha:1, y:(y - 20)});
TweenMax.to(this, 0.5, {alpha:0, delay:0.6, onComplete:remove});
}
private function set score(_arg1:uint){
clip["field"].text = _arg1;
clip.x = -((clip.width / 2));
}
private function remove(){
parent.removeChild(this);
}
}
}//package com.nick.pom.nutsforpeanuts
Section 26
//Penguin (com.nick.pom.nutsforpeanuts.Penguin)
package com.nick.pom.nutsforpeanuts {
import flash.events.*;
import flash.display.*;
import s2.damper.*;
import gs.*;
import flash.geom.*;
import gs.easing.*;
import flash.utils.*;
public class Penguin extends MovieClip {
public var hit:Sprite;
public var clip:MovieClip;
private var _cursorActivator:Sprite;
private var _offX:Number;
private var _offY:Number;
public function Penguin(){
stop();
buttonMode = true;
hit.mouseEnabled = false;
hit.mouseChildren = false;
mouseChildren = false;
this.hitArea = hit;
mouseEnabled = false;
}
private function targetReached(){
if (Game.instance.testHit()){
setTimeout(recoil, 800);
} else {
setTimeout(recoil, 250);
};
}
private function onDrag(_arg1:MouseEvent){
var _local2:Rectangle = new Rectangle(-100, -100, 800, (Game.instance.rope1.y + 100));
x = Math.min(Math.max(_local2.left, stage.mouseX), _local2.right);
y = Math.min(Math.max(_local2.top, stage.mouseY), _local2.bottom);
}
private function onClickDetectComplete(_arg1:MouseEvent):void{
stage.removeEventListener(MouseEvent.MOUSE_DOWN, onStageMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, onClickDetectComplete);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, beginDrag);
activate();
}
private function onStageMouseDown(_arg1:MouseEvent):void{
if (hit.hitTestPoint(stage.mouseX, stage.mouseY, true)){
stage.addEventListener(MouseEvent.MOUSE_MOVE, beginDrag);
};
}
private function recoil(){
Game.instance.boy.resume();
uprightOpposite();
new Damp(this, "x", Game.RETURN_POINT.x, {m:10, decay:0.7, k:1.5});
new Damp(this, "y", Game.RETURN_POINT.y, {m:10, decay:0.7, k:1.5});
setTimeout(activate, 300);
}
private function onRecoilComplete(){
Game.instance.onRecoilComplete();
}
function upright(){
clip.alpha = 0;
if ((((x > 300)) && (!((currentLabel == "standing_left"))))){
gotoAndStop("standing_left");
} else {
if ((((x <= 300)) && (!((currentLabel == "standing_right"))))){
gotoAndStop("standing_right");
};
};
}
private function prone(){
clip.alpha = 1;
gotoAndStop("prone");
if ((((x > 300)) && (!((currentLabel == "prone_left"))))){
clip.gotoAndStop("left");
} else {
if ((((x <= 300)) && (!((currentLabel == "prone_right"))))){
clip.gotoAndStop("right");
};
};
clip.rotation = (((Game.instance.shotRadians * 180) / Math.PI) + 180);
}
function resume(){
stage.addEventListener(MouseEvent.MOUSE_DOWN, onStageMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, onClickDetectComplete);
}
private function endDrag(){
stage.removeEventListener(MouseEvent.MOUSE_MOVE, onDrag);
}
function activate(){
_cursorActivator = Game.instance.penguinCursorActivator;
_cursorActivator.buttonMode = true;
stage.addEventListener(MouseEvent.MOUSE_DOWN, onStageMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, onClickDetectComplete);
}
function deactivate(){
endDrag();
mouseChildren = false;
mouseEnabled = false;
stage.removeEventListener(MouseEvent.MOUSE_UP, onPenguinRelease);
}
function pause(){
stage.removeEventListener(MouseEvent.MOUSE_DOWN, onStageMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, onClickDetectComplete);
}
function uprightOpposite(){
clip.alpha = 0;
if ((((x < 300)) && (!((currentLabel == "standing_left"))))){
gotoAndStop("standing_left");
} else {
if ((((x >= 300)) && (!((currentLabel == "standing_right"))))){
gotoAndStop("standing_right");
};
};
}
private function onPenguinRelease(_arg1:MouseEvent):void{
deactivate();
stopDrag();
TweenMax.to(this, 0.7, {x:Game.instance.pTarget.x, y:Game.instance.pTarget.y, ease:Quint.easeOut});
setTimeout(targetReached, 450);
Game.instance.onDragStopped();
prone();
}
private function beginDrag(_arg1:MouseEvent){
_cursorActivator.buttonMode = false;
Game.instance.onDragStarted();
stage.removeEventListener(MouseEvent.MOUSE_MOVE, beginDrag);
stage.removeEventListener(MouseEvent.MOUSE_UP, onClickDetectComplete);
onDrag(null);
Damp.clearDamp(this, "x");
Damp.clearDamp(this, "y");
onRecoilComplete();
_offX = mouseX;
_offY = mouseY;
stage.addEventListener(MouseEvent.MOUSE_UP, onPenguinRelease);
stage.addEventListener(MouseEvent.MOUSE_MOVE, onDrag, false, 10000000);
}
}
}//package com.nick.pom.nutsforpeanuts
Section 27
//PlayAgainButton (com.nick.pom.nutsforpeanuts.PlayAgainButton)
package com.nick.pom.nutsforpeanuts {
public dynamic class PlayAgainButton extends Button {
}
}//package com.nick.pom.nutsforpeanuts
Section 28
//PlayButton (com.nick.pom.nutsforpeanuts.PlayButton)
package com.nick.pom.nutsforpeanuts {
public dynamic class PlayButton extends Button {
}
}//package com.nick.pom.nutsforpeanuts
Section 29
//PointerMode (com.nick.pom.nutsforpeanuts.PointerMode)
package com.nick.pom.nutsforpeanuts {
public class PointerMode {
public static const ELEPHANT:String = "elephant";
public static const DRAG:String = "drag";
public static const NORMAL:String = "normal";
}
}//package com.nick.pom.nutsforpeanuts
Section 30
//ScorePrompt (com.nick.pom.nutsforpeanuts.ScorePrompt)
package com.nick.pom.nutsforpeanuts {
import flash.events.*;
import flash.display.*;
import gs.*;
import flash.text.*;
public class ScorePrompt extends Sprite {
public var clip:Sprite;
public function ScorePrompt(_arg1:uint){
this.score = _arg1;
mouseEnabled = false;
alpha = 0;
clip["field"].autoSize = TextFieldAutoSize.CENTER;
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
mouseChildren = false;
mouseEnabled = false;
}
private function onAddedToStage(_arg1:Event){
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
TweenMax.to(this, 0.5, {alpha:1, y:(y - 20)});
TweenMax.to(this, 0.5, {alpha:0, delay:0.6, onComplete:remove});
}
private function set score(_arg1:uint){
clip["field"].text = _arg1;
clip.x = -((clip.width / 2));
}
private function remove(){
parent.removeChild(this);
}
}
}//package com.nick.pom.nutsforpeanuts
Section 31
//SidePenguins (com.nick.pom.nutsforpeanuts.SidePenguins)
package com.nick.pom.nutsforpeanuts {
import flash.display.*;
import gs.*;
import gs.easing.*;
import flash.utils.*;
public class SidePenguins extends Sprite {
private var _restProps:Object;
private var _bobTimeout:uint;
private var _origProps:Object;
public function SidePenguins(){
_restProps = {x:39, y:140, scaleX:1, scaleY:1};
_origProps = {x:39, y:-5, scaleX:1, scaleY:1};
super();
}
public function animateIn():void{
x = _origProps.x;
y = _origProps.y;
TweenMax.to(this, 0.3, {y:_restProps.y, delay:0.5, ease:Quint.easeIn});
TweenMax.to(this, 0, {blurFilter:{blurY:10, blurX:0, quality:1}});
TweenMax.to(this, 0, {blurFilter:{blurY:0, blurX:0, quality:1}, delay:0.8});
TweenMax.to(this, 0.05, {scaleY:0.9, delay:0.8});
TweenMax.to(this, 0.2, {scaleY:1, delay:0.85, ease:Elastic.easeOut, onComplete:init});
}
function blurOut(){
var onComplete:Function;
onComplete = function (){
filters = [];
alpha = 1;
y = _origProps.y;
};
TweenMax.to(this, 0.4, {alpha:0, blurFilter:{blurX:20}, onComplete:onComplete});
}
private function newBobTimeout(){
_bobTimeout = setTimeout(randomBob, ((Math.random() * 5000) + 5000));
}
public function resume(){
newBobTimeout();
}
public function throwPeanut():void{
TweenMax.to(this, 0.3, {rotation:1, scaleX:1});
TweenMax.to(this, 0.3, {rotation:0, delay:0.3, ease:Back.easeOut});
}
private function randomBob():void{
TweenMax.to(this, 0.2, {scaleY:0.9});
TweenMax.to(this, 0.3, {x:_restProps.x, scaleY:_restProps.scaleY, delay:0.2, ease:Back.easeOut});
newBobTimeout();
}
public function pause(){
clearTimeout(_bobTimeout);
}
public function init(){
newBobTimeout();
}
function shakeRestPos(_arg1:Number, _arg2:Number){
x = (_restProps.x + _arg1);
y = (_restProps.y + _arg2);
}
}
}//package com.nick.pom.nutsforpeanuts
Section 32
//Sounds (com.nick.pom.nutsforpeanuts.Sounds)
package com.nick.pom.nutsforpeanuts {
import flash.media.*;
import s2.sound.*;
import sound.*;
public class Sounds {
static function elephant(){
SoundMan.play("Elephant", "game");
}
static function bgLoopsOut(){
SoundMan.fade("Jungle", 1, 0, true, "game");
SoundMan.fade("BG", 1, 0, true, "game");
}
static function whoosh(){
SoundMan.play("Whoosh", "game");
}
static function impact(){
SoundMan.play("Impact", "game");
}
static function crash(){
SoundMan.play("Crash", "game");
}
static function click(){
SoundMan.play("Click", "game");
}
static function rope(){
SoundMan.play("Rope", "game");
}
static function swish(){
SoundMan.play("Swish", "game");
}
static function bgLoops(){
SoundMan.play("Jungle", "game", 10000, new SoundTransform(0.5));
SoundMan.play("BG", "game", 10000, new SoundTransform(0));
SoundMan.fade("BG", 1, 0.75, false, "game");
}
static function chomp(){
SoundMan.play("Chomp", "game");
}
SoundMan.init();
SoundMan.createPool("game");
SoundMan.addSound("Click", new Click(), "game");
SoundMan.addSound("Crash", new Crash(), "game");
SoundMan.addSound("Impact", new Impact(), "game");
SoundMan.addSound("Elephant", new Elephant(), "game");
SoundMan.addSound("Jungle", new Jungle(), "game");
SoundMan.addSound("Swish", new Swish(), "game");
SoundMan.addSound("Rope", new Rope(), "game");
SoundMan.addSound("Whoosh", new Whoosh(), "game");
SoundMan.addSound("Chomp", new Chomp(), "game");
SoundMan.addSound("BG", new BG(), "game");
}
}//package com.nick.pom.nutsforpeanuts
Section 33
//TitleScreen (com.nick.pom.nutsforpeanuts.TitleScreen)
package com.nick.pom.nutsforpeanuts {
import flash.events.*;
import flash.display.*;
public class TitleScreen extends Sprite {
public var playButton:Sprite;
public function TitleScreen(){
playButton.mouseEnabled = false;
playButton.mouseChildren = false;
enable();
}
function enable(){
playButton.mouseEnabled = true;
playButton.mouseChildren = true;
playButton.addEventListener(MouseEvent.CLICK, onButtonClick, false, 0, true);
}
private function onButtonClick(_arg1:MouseEvent):void{
Game.instance.instructions();
}
}
}//package com.nick.pom.nutsforpeanuts
Section 34
//Wall (com.nick.pom.nutsforpeanuts.Wall)
package com.nick.pom.nutsforpeanuts {
import flash.display.*;
public class Wall extends Sprite {
public var hit:Sprite;
public function Wall(){
buttonMode = false;
hit.mouseEnabled = false;
hit.mouseChildren = false;
hitArea = hit;
}
}
}//package com.nick.pom.nutsforpeanuts
Section 35
//Back (gs.easing.Back)
package gs.easing {
public class Back {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_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));
}
}
}//package gs.easing
Section 36
//Bounce (gs.easing.Bounce)
package gs.easing {
public class Bounce {
public static function easeOut(_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 easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 - easeOut((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeIn((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOut(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
}
}//package gs.easing
Section 37
//Elastic (gs.easing.Elastic)
package gs.easing {
public class Elastic {
private static const _2PI:Number = 6.28318530717959;
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):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 / _2PI) * Math.asin((_arg3 / _arg5)));
};
--_arg1;
return ((-(((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6)))) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):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 / _2PI) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6)))) + _arg2));
};
--_arg1;
return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6))) * 0.5) + _arg3) + _arg2));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):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 / _2PI) * Math.asin((_arg3 / _arg5)));
};
return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6))) + _arg3) + _arg2));
}
}
}//package gs.easing
Section 38
//Expo (gs.easing.Expo)
package gs.easing {
public class Expo {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1)==_arg4) ? (_arg2 + _arg3) : ((_arg3 * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2));
}
public static function easeIn(_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 easeInOut(_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));
};
--_arg1;
return ((((_arg3 / 2) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2));
}
}
}//package gs.easing
Section 39
//Linear (gs.easing.Linear)
package gs.easing {
public class Linear {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package gs.easing
Section 40
//Quint (gs.easing.Quint)
package gs.easing {
public class Quint {
public static function easeOut(_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 easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_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));
}
}
}//package gs.easing
Section 41
//Sine (gs.easing.Sine)
package gs.easing {
public class Sine {
private static const _HALF_PI:Number = 1.5707963267949;
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * _HALF_PI))) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * _HALF_PI))) + _arg3) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
}
}//package gs.easing
Section 42
//TweenEvent (gs.events.TweenEvent)
package gs.events {
import flash.events.*;
public class TweenEvent extends Event {
public var info:Object;
public static const UPDATE:String = "update";
public static const START:String = "start";
public static const version:Number = 0.9;
public static const COMPLETE:String = "complete";
public function TweenEvent(_arg1:String, _arg2:Object=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.info = _arg2;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.info, this.bubbles, this.cancelable));
}
}
}//package gs.events
Section 43
//AutoAlphaPlugin (gs.plugins.AutoAlphaPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class AutoAlphaPlugin extends TweenPlugin {
protected var _tweenVisible:Boolean;
protected var _target:Object;
protected var _visible:Boolean;
protected var _tween:TweenLite;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function AutoAlphaPlugin(){
this.propName = "autoAlpha";
this.overwriteProps = ["alpha", "visible"];
this.onComplete = onCompleteTween;
}
override public function killProps(_arg1:Object):void{
super.killProps(_arg1);
_tweenVisible = !(Boolean(("visible" in _arg1)));
}
public function onCompleteTween():void{
if (((((_tweenVisible) && (!((_tween.vars.runBackwards == true))))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_visible = Boolean(!((_arg2 == 0)));
_tweenVisible = true;
addTween(_arg1, "alpha", _arg1.alpha, _arg2, "alpha");
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
if (((!((_target.visible == true))) && (_tweenVisible))){
_target.visible = true;
};
}
}
}//package gs.plugins
Section 44
//BevelFilterPlugin (gs.plugins.BevelFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class BevelFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BevelFilterPlugin(){
this.propName = "bevelFilter";
this.overwriteProps = ["bevelFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = BevelFilter;
initFilter(_arg2, new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, ((_arg2.quality) || (2))));
return (true);
}
}
}//package gs.plugins
Section 45
//BezierPlugin (gs.plugins.BezierPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class BezierPlugin extends TweenPlugin {
protected var _future:Object;
protected var _orient:Boolean;
protected var _orientData:Array;
protected var _target:Object;
protected var _beziers:Object;
protected static const _RAD2DEG:Number = 57.2957795130823;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function BezierPlugin(){
_future = {};
super();
this.propName = "bezier";
this.overwriteProps = [];
}
override public function killProps(_arg1:Object):void{
var _local2:String;
for (_local2 in _beziers) {
if ((_local2 in _arg1)){
delete _beziers[_local2];
};
};
super.killProps(_arg1);
}
protected function init(_arg1:TweenLite, _arg2:Array, _arg3:Boolean):void{
var _local5:int;
var _local6:String;
_target = _arg1.target;
if (_arg1.exposedVars.orientToBezier == true){
_orientData = [["x", "y", "rotation", 0]];
_orient = true;
} else {
if ((_arg1.exposedVars.orientToBezier is Array)){
_orientData = _arg1.exposedVars.orientToBezier;
_orient = true;
};
};
var _local4:Object = {};
_local5 = 0;
while (_local5 < _arg2.length) {
for (_local6 in _arg2[_local5]) {
if (_local4[_local6] == undefined){
_local4[_local6] = [_arg1.target[_local6]];
};
if (typeof(_arg2[_local5][_local6]) == "number"){
_local4[_local6].push(_arg2[_local5][_local6]);
} else {
_local4[_local6].push((_arg1.target[_local6] + Number(_arg2[_local5][_local6])));
};
};
_local5++;
};
for (_local6 in _local4) {
this.overwriteProps[this.overwriteProps.length] = _local6;
if (_arg1.exposedVars[_local6] != undefined){
if (typeof(_arg1.exposedVars[_local6]) == "number"){
_local4[_local6].push(_arg1.exposedVars[_local6]);
} else {
_local4[_local6].push((_arg1.target[_local6] + Number(_arg1.exposedVars[_local6])));
};
delete _arg1.exposedVars[_local6];
_local5 = (_arg1.tweens.length - 1);
while (_local5 > -1) {
if (_arg1.tweens[_local5].name == _local6){
_arg1.tweens.splice(_local5, 1);
};
_local5--;
};
};
};
_beziers = parseBeziers(_local4, _arg3);
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg2 is Array)){
return (false);
};
init(_arg3, (_arg2 as Array), false);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:String;
var _local4:Object;
var _local5:Number;
var _local6:uint;
var _local7:Number;
var _local8:int;
var _local9:Object;
var _local10:Boolean;
var _local11:Number;
var _local12:Number;
var _local13:Array;
var _local14:Number;
if (_arg1 == 1){
for (_local3 in _beziers) {
_local2 = (_beziers[_local3].length - 1);
_target[_local3] = _beziers[_local3][_local2][2];
};
} else {
for (_local3 in _beziers) {
_local6 = _beziers[_local3].length;
if (_arg1 < 0){
_local2 = 0;
} else {
if (_arg1 >= 1){
_local2 = (_local6 - 1);
} else {
_local2 = int((_local6 * _arg1));
};
};
_local5 = ((_arg1 - (_local2 * (1 / _local6))) * _local6);
_local4 = _beziers[_local3][_local2];
if (this.round){
_local7 = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0])))));
_local8 = ((_local7)<0) ? -1 : 1;
_target[_local3] = ((((_local7 % 1) * _local8))>0.5) ? (int(_local7) + _local8) : int(_local7);
} else {
_target[_local3] = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0])))));
};
};
};
if (_orient){
_local9 = _target;
_local10 = this.round;
_target = _future;
this.round = false;
_orient = false;
this.changeFactor = (_arg1 + 0.01);
_target = _local9;
this.round = _local10;
_orient = true;
_local2 = 0;
while (_local2 < _orientData.length) {
_local13 = _orientData[_local2];
_local14 = ((_local13[3]) || (0));
_local11 = (_future[_local13[0]] - _target[_local13[0]]);
_local12 = (_future[_local13[1]] - _target[_local13[1]]);
_target[_local13[2]] = ((Math.atan2(_local12, _local11) * _RAD2DEG) + _local14);
_local2++;
};
};
}
public static function parseBeziers(_arg1:Object, _arg2:Boolean=false):Object{
var _local3:int;
var _local4:Array;
var _local5:Object;
var _local6:String;
var _local7:Object = {};
if (_arg2){
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 2){
_local5[_local5.length] = [_local4[0], (_local4[1] - ((_local4[2] - _local4[0]) / 4)), _local4[1]];
_local3 = 1;
while (_local3 < (_local4.length - 1)) {
_local5[_local5.length] = [_local4[_local3], (_local4[_local3] + (_local4[_local3] - _local5[(_local3 - 1)][1])), _local4[(_local3 + 1)]];
_local3++;
};
} else {
_local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]];
};
};
} else {
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 3){
_local5[_local5.length] = [_local4[0], _local4[1], ((_local4[1] + _local4[2]) / 2)];
_local3 = 2;
while (_local3 < (_local4.length - 2)) {
_local5[_local5.length] = [_local5[(_local3 - 2)][2], _local4[_local3], ((_local4[_local3] + _local4[(_local3 + 1)]) / 2)];
_local3++;
};
_local5[_local5.length] = [_local5[(_local5.length - 1)][2], _local4[(_local4.length - 2)], _local4[(_local4.length - 1)]];
} else {
if (_local4.length == 3){
_local5[_local5.length] = [_local4[0], _local4[1], _local4[2]];
} else {
if (_local4.length == 2){
_local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]];
};
};
};
};
};
return (_local7);
}
}
}//package gs.plugins
Section 46
//BezierThroughPlugin (gs.plugins.BezierThroughPlugin)
package gs.plugins {
import gs.*;
public class BezierThroughPlugin extends BezierPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BezierThroughPlugin(){
this.propName = "bezierThrough";
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg2 is Array)){
return (false);
};
init(_arg3, (_arg2 as Array), true);
return (true);
}
}
}//package gs.plugins
Section 47
//BlurFilterPlugin (gs.plugins.BlurFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class BlurFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BlurFilterPlugin(){
this.propName = "blurFilter";
this.overwriteProps = ["blurFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = BlurFilter;
initFilter(_arg2, new BlurFilter(0, 0, ((_arg2.quality) || (2))));
return (true);
}
}
}//package gs.plugins
Section 48
//ColorMatrixFilterPlugin (gs.plugins.ColorMatrixFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class ColorMatrixFilterPlugin extends FilterPlugin {
protected var _matrix:Array;
protected var _matrixTween:EndArrayPlugin;
public static const API:Number = 1;
public static const VERSION:Number = 1.01;
protected static var _lumG:Number = 0.71516;
protected static var _lumR:Number = 0.212671;
protected static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
protected static var _lumB:Number = 0.072169;
public function ColorMatrixFilterPlugin(){
this.propName = "colorMatrixFilter";
this.overwriteProps = ["colorMatrixFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = ColorMatrixFilter;
var _local4:Object = _arg2;
initFilter({}, new ColorMatrixFilter(_idMatrix.slice()));
_matrix = ColorMatrixFilter(_filter).matrix;
var _local5:Array = [];
if (((!((_local4.matrix == null))) && ((_local4.matrix is Array)))){
_local5 = _local4.matrix;
} else {
if (_local4.relative == true){
_local5 = _matrix.slice();
} else {
_local5 = _idMatrix.slice();
};
_local5 = setBrightness(_local5, _local4.brightness);
_local5 = setContrast(_local5, _local4.contrast);
_local5 = setHue(_local5, _local4.hue);
_local5 = setSaturation(_local5, _local4.saturation);
_local5 = setThreshold(_local5, _local4.threshold);
if (!isNaN(_local4.colorize)){
_local5 = colorize(_local5, _local4.colorize, _local4.amount);
};
};
_matrixTween = new EndArrayPlugin();
_matrixTween.init(_matrix, _local5);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
_matrixTween.changeFactor = _arg1;
ColorMatrixFilter(_filter).matrix = _matrix;
super.changeFactor = _arg1;
}
public static function setSaturation(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Number = (1 - _arg2);
var _local4:Number = (_local3 * _lumR);
var _local5:Number = (_local3 * _lumG);
var _local6:Number = (_local3 * _lumB);
var _local7:Array = [(_local4 + _arg2), _local5, _local6, 0, 0, _local4, (_local5 + _arg2), _local6, 0, 0, _local4, _local5, (_local6 + _arg2), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local7, _arg1));
}
public static function setHue(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 * (Math.PI / 180));
var _local3:Number = Math.cos(_arg2);
var _local4:Number = Math.sin(_arg2);
var _local5:Array = [((_lumR + (_local3 * (1 - _lumR))) + (_local4 * -(_lumR))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * -(_lumG))), ((_lumB + (_local3 * -(_lumB))) + (_local4 * (1 - _lumB))), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * 0.143)), ((_lumG + (_local3 * (1 - _lumG))) + (_local4 * 0.14)), ((_lumB + (_local3 * -(_lumB))) + (_local4 * -0.283)), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * -((1 - _lumR)))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * _lumG)), ((_lumB + (_local3 * (1 - _lumB))) + (_local4 * _lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return (applyMatrix(_local5, _arg1));
}
public static function setThreshold(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Array = [(_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function applyMatrix(_arg1:Array, _arg2:Array):Array{
var _local6:int;
var _local7:int;
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (_arg2);
};
var _local3:Array = [];
var _local4:int;
var _local5:int;
_local6 = 0;
while (_local6 < 4) {
_local7 = 0;
while (_local7 < 5) {
if (_local7 == 4){
_local5 = _arg1[(_local4 + 4)];
} else {
_local5 = 0;
};
_local3[(_local4 + _local7)] = (((((_arg1[_local4] * _arg2[_local7]) + (_arg1[(_local4 + 1)] * _arg2[(_local7 + 5)])) + (_arg1[(_local4 + 2)] * _arg2[(_local7 + 10)])) + (_arg1[(_local4 + 3)] * _arg2[(_local7 + 15)])) + _local5);
_local7++;
};
_local4 = (_local4 + 5);
_local6++;
};
return (_local3);
}
public static function colorize(_arg1:Array, _arg2:Number, _arg3:Number=1):Array{
if (isNaN(_arg2)){
return (_arg1);
};
if (isNaN(_arg3)){
_arg3 = 1;
};
var _local4:Number = (((_arg2 >> 16) & 0xFF) / 0xFF);
var _local5:Number = (((_arg2 >> 8) & 0xFF) / 0xFF);
var _local6:Number = ((_arg2 & 0xFF) / 0xFF);
var _local7:Number = (1 - _arg3);
var _local8:Array = [(_local7 + ((_arg3 * _local4) * _lumR)), ((_arg3 * _local4) * _lumG), ((_arg3 * _local4) * _lumB), 0, 0, ((_arg3 * _local5) * _lumR), (_local7 + ((_arg3 * _local5) * _lumG)), ((_arg3 * _local5) * _lumB), 0, 0, ((_arg3 * _local6) * _lumR), ((_arg3 * _local6) * _lumG), (_local7 + ((_arg3 * _local6) * _lumB)), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local8, _arg1));
}
public static function setBrightness(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = ((_arg2 * 100) - 100);
return (applyMatrix([1, 0, 0, 0, _arg2, 0, 1, 0, 0, _arg2, 0, 0, 1, 0, _arg2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], _arg1));
}
public static function setContrast(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 + 0.01);
var _local3:Array = [_arg2, 0, 0, 0, (128 * (1 - _arg2)), 0, _arg2, 0, 0, (128 * (1 - _arg2)), 0, 0, _arg2, 0, (128 * (1 - _arg2)), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
}
}//package gs.plugins
Section 49
//DropShadowFilterPlugin (gs.plugins.DropShadowFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class DropShadowFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function DropShadowFilterPlugin(){
this.propName = "dropShadowFilter";
this.overwriteProps = ["dropShadowFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = DropShadowFilter;
initFilter(_arg2, new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, ((_arg2.quality) || (2)), _arg2.inner, _arg2.knockout, _arg2.hideObject));
return (true);
}
}
}//package gs.plugins
Section 50
//EndArrayPlugin (gs.plugins.EndArrayPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import gs.utils.tween.*;
public class EndArrayPlugin extends TweenPlugin {
protected var _a:Array;
protected var _info:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function EndArrayPlugin(){
_info = [];
super();
this.propName = "endArray";
this.overwriteProps = ["endArray"];
}
public function init(_arg1:Array, _arg2:Array):void{
_a = _arg1;
var _local3:int = (_arg2.length - 1);
while (_local3 > -1) {
if (((!((_arg1[_local3] == _arg2[_local3]))) && (!((_arg1[_local3] == null))))){
_info[_info.length] = new ArrayTweenInfo(_local3, _a[_local3], (_arg2[_local3] - _a[_local3]));
};
_local3--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (false);
};
init((_arg1 as Array), _arg2);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:ArrayTweenInfo;
var _local4:Number;
var _local5:int;
if (this.round){
_local2 = (_info.length - 1);
while (_local2 > -1) {
_local3 = _info[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local5 = ((_local4)<0) ? -1 : 1;
_a[_local3.index] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4);
_local2--;
};
} else {
_local2 = (_info.length - 1);
while (_local2 > -1) {
_local3 = _info[_local2];
_a[_local3.index] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
};
}
}
}//package gs.plugins
Section 51
//FilterPlugin (gs.plugins.FilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
import gs.utils.tween.*;
public class FilterPlugin extends TweenPlugin {
protected var _remove:Boolean;
protected var _target:Object;
protected var _index:int;
protected var _filter:BitmapFilter;
protected var _type:Class;
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function onCompleteTween():void{
var _local1:int;
var _local2:Array;
if (_remove){
_local2 = _target.filters;
if (!(_local2[_index] is _type)){
_local1 = (_local2.length - 1);
while (_local1 > -1) {
if ((_local2[_local1] is _type)){
_local2.splice(_local1, 1);
break;
};
_local1--;
};
} else {
_local2.splice(_index, 1);
};
_target.filters = _local2;
};
}
protected function initFilter(_arg1:Object, _arg2:BitmapFilter):void{
var _local4:String;
var _local5:int;
var _local6:HexColorsPlugin;
var _local3:Array = _target.filters;
_index = -1;
if (_arg1.index != null){
_index = _arg1.index;
} else {
_local5 = (_local3.length - 1);
while (_local5 > -1) {
if ((_local3[_local5] is _type)){
_index = _local5;
break;
};
_local5--;
};
};
if ((((((_index == -1)) || ((_local3[_index] == null)))) || ((_arg1.addFilter == true)))){
_index = ((_arg1.index)!=null) ? _arg1.index : _local3.length;
_local3[_index] = _arg2;
_target.filters = _local3;
};
_filter = _local3[_index];
_remove = Boolean((_arg1.remove == true));
if (_remove){
this.onComplete = onCompleteTween;
};
var _local7:Object = ((_arg1.isTV)==true) ? _arg1.exposedVars : _arg1;
for (_local4 in _local7) {
if (((((((((!((_local4 in _filter))) || ((_filter[_local4] == _local7[_local4])))) || ((_local4 == "remove")))) || ((_local4 == "index")))) || ((_local4 == "addFilter")))){
} else {
if ((((((_local4 == "color")) || ((_local4 == "highlightColor")))) || ((_local4 == "shadowColor")))){
_local6 = new HexColorsPlugin();
_local6.initColor(_filter, _local4, _filter[_local4], _local7[_local4]);
_tweens[_tweens.length] = new TweenInfo(_local6, "changeFactor", 0, 1, _local4, false);
} else {
if ((((((((_local4 == "quality")) || ((_local4 == "inner")))) || ((_local4 == "knockout")))) || ((_local4 == "hideObject")))){
_filter[_local4] = _local7[_local4];
} else {
addTween(_filter, _local4, _filter[_local4], _local7[_local4], _local4);
};
};
};
};
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:TweenInfo;
var _local4:Array = _target.filters;
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
if (!(_local4[_index] is _type)){
_index = (_local4.length - 1);
_local2 = (_local4.length - 1);
while (_local2 > -1) {
if ((_local4[_local2] is _type)){
_index = _local2;
break;
};
_local2--;
};
};
_local4[_index] = _filter;
_target.filters = _local4;
}
}
}//package gs.plugins
Section 52
//FramePlugin (gs.plugins.FramePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class FramePlugin extends TweenPlugin {
protected var _target:MovieClip;
public var frame:int;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function FramePlugin(){
this.propName = "frame";
this.overwriteProps = ["frame"];
this.round = true;
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is MovieClip))) || (isNaN(_arg2)))){
return (false);
};
_target = (_arg1 as MovieClip);
addTween(this, "frame", _target.currentFrame, _arg2, "frame");
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.gotoAndStop(this.frame);
}
}
}//package gs.plugins
Section 53
//GlowFilterPlugin (gs.plugins.GlowFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class GlowFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function GlowFilterPlugin(){
this.propName = "glowFilter";
this.overwriteProps = ["glowFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = GlowFilter;
initFilter(_arg2, new GlowFilter(0xFFFFFF, 0, 0, 0, ((_arg2.strength) || (1)), ((_arg2.quality) || (2)), _arg2.inner, _arg2.knockout));
return (true);
}
}
}//package gs.plugins
Section 54
//HexColorsPlugin (gs.plugins.HexColorsPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class HexColorsPlugin extends TweenPlugin {
protected var _colors:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function HexColorsPlugin(){
this.propName = "hexColors";
this.overwriteProps = [];
_colors = [];
}
override public function killProps(_arg1:Object):void{
var _local2:int = (_colors.length - 1);
while (_local2 > -1) {
if (_arg1[_colors[_local2][1]] != undefined){
_colors.splice(_local2, 1);
};
_local2--;
};
super.killProps(_arg1);
}
public function initColor(_arg1:Object, _arg2:String, _arg3:uint, _arg4:uint):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
if (_arg3 != _arg4){
_local5 = (_arg3 >> 16);
_local6 = ((_arg3 >> 8) & 0xFF);
_local7 = (_arg3 & 0xFF);
_colors[_colors.length] = [_arg1, _arg2, _local5, ((_arg4 >> 16) - _local5), _local6, (((_arg4 >> 8) & 0xFF) - _local6), _local7, ((_arg4 & 0xFF) - _local7)];
this.overwriteProps[this.overwriteProps.length] = _arg2;
};
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:Array;
_local2 = (_colors.length - 1);
while (_local2 > -1) {
_local3 = _colors[_local2];
_local3[0][_local3[1]] = ((((_local3[2] + (_arg1 * _local3[3])) << 16) | ((_local3[4] + (_arg1 * _local3[5])) << 8)) | (_local3[6] + (_arg1 * _local3[7])));
_local2--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:String;
for (_local4 in _arg2) {
initColor(_arg1, _local4, uint(_arg1[_local4]), uint(_arg2[_local4]));
};
return (true);
}
}
}//package gs.plugins
Section 55
//RemoveTintPlugin (gs.plugins.RemoveTintPlugin)
package gs.plugins {
public class RemoveTintPlugin extends TintPlugin {
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function RemoveTintPlugin(){
this.propName = "removeTint";
}
}
}//package gs.plugins
Section 56
//RoundPropsPlugin (gs.plugins.RoundPropsPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class RoundPropsPlugin extends TweenPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function RoundPropsPlugin(){
this.propName = "roundProps";
this.overwriteProps = [];
this.round = true;
}
public function add(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number):void{
addTween(_arg1, _arg2, _arg3, (_arg3 + _arg4), _arg2);
this.overwriteProps[this.overwriteProps.length] = _arg2;
}
}
}//package gs.plugins
Section 57
//ShortRotationPlugin (gs.plugins.ShortRotationPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class ShortRotationPlugin extends TweenPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function ShortRotationPlugin(){
this.propName = "shortRotation";
this.overwriteProps = [];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:String;
if (typeof(_arg2) == "number"){
trace("WARNING: You appear to be using the old shortRotation syntax. Instead of passing a number, please pass an object with properties that correspond to the rotations values For example, TweenMax.to(mc, 2, {shortRotation:{rotationX:-170, rotationY:25}})");
return (false);
};
for (_local4 in _arg2) {
initRotation(_arg1, _local4, _arg1[_local4], _arg2[_local4]);
};
return (true);
}
public function initRotation(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number):void{
var _local5:Number = ((_arg4 - _arg3) % 360);
if (((_arg4 - _arg3) % 360) != (_local5 % 180)){
_local5 = ((_local5)<0) ? (_local5 + 360) : (_local5 - 360);
};
addTween(_arg1, _arg2, _arg3, (_arg3 + _local5), _arg2);
this.overwriteProps[this.overwriteProps.length] = _arg2;
}
}
}//package gs.plugins
Section 58
//TintPlugin (gs.plugins.TintPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.geom.*;
import gs.utils.tween.*;
public class TintPlugin extends TweenPlugin {
protected var _target:DisplayObject;
protected var _ct:ColorTransform;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
protected static var _props:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset"];
public function TintPlugin(){
this.propName = "tint";
this.overwriteProps = ["tint"];
}
public function init(_arg1:DisplayObject, _arg2:ColorTransform):void{
var _local3:int;
var _local4:String;
_target = _arg1;
_ct = _target.transform.colorTransform;
_local3 = (_props.length - 1);
while (_local3 > -1) {
_local4 = _props[_local3];
if (_ct[_local4] != _arg2[_local4]){
_tweens[_tweens.length] = new TweenInfo(_ct, _local4, _ct[_local4], (_arg2[_local4] - _ct[_local4]), "tint", false);
};
_local3--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg1 is DisplayObject)){
return (false);
};
var _local4:ColorTransform = new ColorTransform();
if (((!((_arg2 == null))) && (!((_arg3.exposedVars.removeTint == true))))){
_local4.color = uint(_arg2);
};
if (((!((_arg3.exposedVars.alpha == undefined))) || (!((_arg3.exposedVars.autoAlpha == undefined))))){
_local4.alphaMultiplier = ((_arg3.exposedVars.alpha)!=undefined) ? _arg3.exposedVars.alpha : _arg3.exposedVars.autoAlpha;
_arg3.killVars({alpha:1, autoAlpha:1});
} else {
_local4.alphaMultiplier = _arg1.alpha;
};
init((_arg1 as DisplayObject), _local4);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.transform.colorTransform = _ct;
}
}
}//package gs.plugins
Section 59
//TweenPlugin (gs.plugins.TweenPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class TweenPlugin {
public var overwriteProps:Array;
protected var _tweens:Array;
public var propName:String;
public var onComplete:Function;
public var round:Boolean;
protected var _changeFactor:Number;// = 0
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function TweenPlugin(){
_tweens = [];
super();
}
protected function updateTweens(_arg1:Number):void{
var _local2:int;
var _local3:TweenInfo;
var _local4:Number;
var _local5:int;
if (this.round){
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local5 = ((_local4)<0) ? -1 : 1;
_local3.target[_local3.property] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4);
_local2--;
};
} else {
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
};
}
public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_changeFactor = _arg1;
}
protected function addTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4, _arg5:String=null):void{
var _local6:Number;
if (_arg4 != null){
_local6 = ((typeof(_arg4))=="number") ? (_arg4 - _arg3) : Number(_arg4);
if (_local6 != 0){
_tweens[_tweens.length] = new TweenInfo(_arg1, _arg2, _arg3, _local6, ((_arg5) || (_arg2)), false);
};
};
}
public function killProps(_arg1:Object):void{
var _local2:int;
_local2 = (this.overwriteProps.length - 1);
while (_local2 > -1) {
if ((this.overwriteProps[_local2] in _arg1)){
this.overwriteProps.splice(_local2, 1);
};
_local2--;
};
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
if ((_tweens[_local2].name in _arg1)){
_tweens.splice(_local2, 1);
};
_local2--;
};
}
public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
addTween(_arg1, this.propName, _arg1[this.propName], _arg2, this.propName);
return (true);
}
public function get changeFactor():Number{
return (_changeFactor);
}
public static function activate(_arg1:Array):Boolean{
var _local2:int;
var _local3:Object;
_local2 = (_arg1.length - 1);
while (_local2 > -1) {
_local3 = new (_arg1[_local2]);
TweenLite.plugins[_local3.propName] = _arg1[_local2];
_local2--;
};
return (true);
}
}
}//package gs.plugins
Section 60
//VisiblePlugin (gs.plugins.VisiblePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class VisiblePlugin extends TweenPlugin {
protected var _target:Object;
protected var _visible:Boolean;
protected var _tween:TweenLite;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function VisiblePlugin(){
this.propName = "visible";
this.overwriteProps = ["visible"];
this.onComplete = onCompleteTween;
}
public function onCompleteTween():void{
if (((!((_tween.vars.runBackwards == true))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_visible = Boolean(_arg2);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
if (_target.visible != true){
_target.visible = true;
};
}
}
}//package gs.plugins
Section 61
//VolumePlugin (gs.plugins.VolumePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.media.*;
public class VolumePlugin extends TweenPlugin {
protected var _target:Object;
protected var _st:SoundTransform;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function VolumePlugin(){
this.propName = "volume";
this.overwriteProps = ["volume"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((isNaN(_arg2)) || (!(_arg1.hasOwnProperty("soundTransform"))))){
return (false);
};
_target = _arg1;
_st = _target.soundTransform;
addTween(_st, "volume", _st.volume, _arg2, "volume");
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.soundTransform = _st;
}
}
}//package gs.plugins
Section 62
//ArrayTweenInfo (gs.utils.tween.ArrayTweenInfo)
package gs.utils.tween {
public class ArrayTweenInfo {
public var change:Number;
public var start:Number;
public var index:uint;
public function ArrayTweenInfo(_arg1:uint, _arg2:Number, _arg3:Number){
this.index = _arg1;
this.start = _arg2;
this.change = _arg3;
}
}
}//package gs.utils.tween
Section 63
//TweenInfo (gs.utils.tween.TweenInfo)
package gs.utils.tween {
public class TweenInfo {
public var start:Number;
public var name:String;
public var change:Number;
public var target:Object;
public var property:String;
public var isPlugin:Boolean;
public function TweenInfo(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean){
this.target = _arg1;
this.property = _arg2;
this.start = _arg3;
this.change = _arg4;
this.name = _arg5;
this.isPlugin = _arg6;
}
}
}//package gs.utils.tween
Section 64
//OverwriteManager (gs.OverwriteManager)
package gs {
import gs.utils.tween.*;
import flash.utils.*;
import flash.errors.*;
public class OverwriteManager {
public static const ALL:int = 1;
public static const NONE:int = 0;
public static const AUTO:int = 2;
public static const CONCURRENT:int = 3;
public static const version:Number = 3.12;
public static var mode:int;
public static var enabled:Boolean;
public static function killVars(_arg1:Object, _arg2:Object, _arg3:Array):void{
var _local4:int;
var _local5:String;
var _local6:TweenInfo;
_local4 = (_arg3.length - 1);
while (_local4 > -1) {
_local6 = _arg3[_local4];
if ((_local6.name in _arg1)){
_arg3.splice(_local4, 1);
} else {
if (((_local6.isPlugin) && ((_local6.name == "_MULTIPLE_")))){
_local6.target.killProps(_arg1);
if (_local6.target.overwriteProps.length == 0){
_arg3.splice(_local4, 1);
};
};
};
_local4--;
};
for (_local5 in _arg1) {
delete _arg2[_local5];
};
}
public static function manageOverwrites(_arg1:TweenLite, _arg2:Array):void{
var _local7:int;
var _local8:TweenLite;
var _local10:Array;
var _local11:Object;
var _local12:int;
var _local13:TweenInfo;
var _local14:Array;
var _local3:Object = _arg1.vars;
var _local4:int = ((_local3.overwrite)==undefined) ? mode : int(_local3.overwrite);
if ((((_local4 < 2)) || ((_arg2 == null)))){
return;
};
var _local5:Number = _arg1.startTime;
var _local6:Array = [];
var _local9 = -1;
_local7 = (_arg2.length - 1);
while (_local7 > -1) {
_local8 = _arg2[_local7];
if (_local8 == _arg1){
_local9 = _local7;
} else {
if ((((((_local7 < _local9)) && ((_local8.startTime <= _local5)))) && (((_local8.startTime + ((_local8.duration * 1000) / _local8.combinedTimeScale)) > _local5)))){
_local6[_local6.length] = _local8;
};
};
_local7--;
};
if ((((_local6.length == 0)) || ((_arg1.tweens.length == 0)))){
return;
};
if (_local4 == AUTO){
_local10 = _arg1.tweens;
_local11 = {};
_local7 = (_local10.length - 1);
while (_local7 > -1) {
_local13 = _local10[_local7];
if (_local13.isPlugin){
if (_local13.name == "_MULTIPLE_"){
_local14 = _local13.target.overwriteProps;
_local12 = (_local14.length - 1);
while (_local12 > -1) {
_local11[_local14[_local12]] = true;
_local12--;
};
} else {
_local11[_local13.name] = true;
};
_local11[_local13.target.propName] = true;
} else {
_local11[_local13.name] = true;
};
_local7--;
};
_local7 = (_local6.length - 1);
while (_local7 > -1) {
killVars(_local11, _local6[_local7].exposedVars, _local6[_local7].tweens);
_local7--;
};
} else {
_local7 = (_local6.length - 1);
while (_local7 > -1) {
_local6[_local7].enabled = false;
_local7--;
};
};
}
public static function init(_arg1:int=2):int{
if (TweenLite.version < 10.09){
trace("TweenLite warning: Your TweenLite class needs to be updated to work with OverwriteManager (or you may need to clear your ASO files). Please download and install the latest version from http://www.tweenlite.com.");
};
TweenLite.overwriteManager = OverwriteManager;
mode = _arg1;
enabled = true;
return (mode);
}
}
}//package gs
Section 65
//TweenLite (gs.TweenLite)
package gs {
import flash.events.*;
import flash.display.*;
import gs.utils.tween.*;
import flash.utils.*;
import gs.plugins.*;
public class TweenLite {
public var started:Boolean;
public var delay:Number;
protected var _hasUpdate:Boolean;
protected var _hasPlugins:Boolean;
public var initted:Boolean;
public var active:Boolean;
public var startTime:Number;
public var target:Object;
public var duration:Number;
public var gc:Boolean;
public var tweens:Array;
public var vars:Object;
public var ease:Function;
public var exposedVars:Object;
public var initTime:Number;
public var combinedTimeScale:Number;
public static const version:Number = 10.09;
private static var _timer:Timer = new Timer(2000);
public static var defaultEase:Function = TweenLite.easeOut;
public static var plugins:Object = {};
public static var currentTime:uint;
public static var masterList:Dictionary = new Dictionary(false);
protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, persist:1, renderOnStart:1, proxiedEase:1, easeParams:1, yoyo:1, loop:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, orientToBezier:1, timeScale:1};
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var timingSprite:Sprite = new Sprite();
public static var overwriteManager:Object;
private static var _tlInitted:Boolean;
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
if (_arg1 == null){
return;
};
if (!_tlInitted){
TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin]);
currentTime = getTimer();
timingSprite.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_timer.addEventListener("timer", killGarbage, false, 0, true);
_timer.start();
_tlInitted = true;
};
this.vars = _arg3;
this.duration = ((_arg2) || (0.001));
this.delay = ((_arg3.delay) || (0));
this.combinedTimeScale = ((_arg3.timeScale) || (1));
this.active = Boolean((((_arg2 == 0)) && ((this.delay == 0))));
this.target = _arg1;
if (typeof(this.vars.ease) != "function"){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
this.ease = this.vars.ease;
this.exposedVars = ((this.vars.isTV)==true) ? this.vars.exposedVars : this.vars;
this.tweens = [];
this.initTime = currentTime;
this.startTime = (this.initTime + (this.delay * 1000));
var _local4:int = ((((_arg3.overwrite == undefined)) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
if (((!((_arg1 in masterList))) || ((_local4 == 1)))){
masterList[_arg1] = [this];
} else {
masterList[_arg1].push(this);
};
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (this.active))){
initTweenVals();
if (this.active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
if (((((!((this.exposedVars.visible == null))) && ((this.vars.runBackwards == true)))) && ((this.target is DisplayObject)))){
this.target.visible = this.exposedVars.visible;
};
};
}
public function get enabled():Boolean{
return ((this.gc) ? false : true);
}
public function set enabled(_arg1:Boolean):void{
var _local2:Array;
var _local3:Boolean;
var _local4:int;
if (_arg1){
if (!(this.target in masterList)){
masterList[this.target] = [this];
} else {
_local2 = masterList[this.target];
_local4 = (_local2.length - 1);
while (_local4 > -1) {
if (_local2[_local4] == this){
_local3 = true;
break;
};
_local4--;
};
if (!_local3){
_local2[_local2.length] = this;
};
};
};
this.gc = (_arg1) ? false : true;
if (this.gc){
this.active = false;
} else {
this.active = this.started;
};
}
public function clear():void{
this.tweens = [];
this.vars = (this.exposedVars = {ease:this.vars.ease});
_hasUpdate = false;
}
public function render(_arg1:uint):void{
var _local3:Number;
var _local4:TweenInfo;
var _local5:int;
var _local2:Number = ((_arg1 - this.startTime) * 0.001);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4.target[_local4.property] = (_local4.start + (_local3 * _local4.change));
_local5--;
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
public function activate():void{
this.started = (this.active = true);
if (!this.initted){
initTweenVals();
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
}
public function initTweenVals():void{
var _local1:String;
var _local2:int;
var _local3:*;
var _local4:TweenInfo;
if (((!((this.exposedVars.timeScale == undefined))) && ((this.target is TweenLite)))){
this.tweens[this.tweens.length] = new TweenInfo(this.target, "timeScale", this.target.timeScale, (this.exposedVars.timeScale - this.target.timeScale), "timeScale", false);
};
for (_local1 in this.exposedVars) {
if ((_local1 in _reservedProps)){
} else {
if ((_local1 in plugins)){
_local3 = new (plugins[_local1]);
if (_local3.onInitTween(this.target, this.exposedVars[_local1], this) == false){
this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false);
} else {
this.tweens[this.tweens.length] = new TweenInfo(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true);
_hasPlugins = true;
};
} else {
this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false);
};
};
};
if (this.vars.runBackwards == true){
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
_local4 = this.tweens[_local2];
this.tweens[_local2].start = (_local4.start + _local4.change);
_local4.change = -(_local4.change);
_local2--;
};
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
if (((TweenLite.overwriteManager.enabled) && ((this.target in masterList)))){
overwriteManager.manageOverwrites(this, masterList[this.target]);
};
this.initted = true;
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function killVars(_arg1:Object):void{
if (overwriteManager.enabled){
overwriteManager.killVars(_arg1, this.exposedVars, this.tweens);
};
}
public function complete(_arg1:Boolean=false):void{
var _local2:int;
if (!_arg1){
if (!this.initted){
initTweenVals();
};
this.startTime = (currentTime - ((this.duration * 1000) / this.combinedTimeScale));
render(currentTime);
return;
};
if (_hasPlugins){
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
if (((this.tweens[_local2].isPlugin) && (!((this.tweens[_local2].target.onComplete == null))))){
this.tweens[_local2].target.onComplete();
};
_local2--;
};
};
if (this.vars.persist != true){
this.enabled = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public static function updateAll(_arg1:Event=null):void{
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
var _local2:uint = (currentTime = getTimer());
var _local3:Dictionary = masterList;
for each (_local4 in _local3) {
_local5 = (_local4.length - 1);
while (_local5 > -1) {
_local6 = _local4[_local5];
if (_local6.active){
_local6.render(_local2);
} else {
if (_local6.gc){
_local4.splice(_local5, 1);
} else {
if (_local2 >= _local6.startTime){
_local6.activate();
_local6.render(_local2);
};
};
};
_local5--;
};
};
}
public static function removeTween(_arg1:TweenLite, _arg2:Boolean=true):void{
if (_arg1 != null){
if (_arg2){
_arg1.clear();
};
_arg1.enabled = false;
};
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
if (((!((_arg1 == null))) && ((_arg1 in masterList)))){
_local3 = masterList[_arg1];
_local4 = (_local3.length - 1);
while (_local4 > -1) {
_local5 = _local3[_local4];
if (((_arg2) && (!(_local5.gc)))){
_local5.complete(false);
};
_local5.clear();
_local4--;
};
delete masterList[_arg1];
};
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
protected static function killGarbage(_arg1:TimerEvent):void{
var _local3:Object;
var _local2:Dictionary = masterList;
for (_local3 in _local2) {
if (_local2[_local3].length == 0){
delete _local2[_local3];
};
};
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, overwrite:0}));
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 66
//TweenMax (gs.TweenMax)
package gs {
import flash.events.*;
import gs.utils.tween.*;
import flash.utils.*;
import gs.plugins.*;
import gs.events.*;
public class TweenMax extends TweenLite implements IEventDispatcher {
protected var _dispatcher:EventDispatcher;
protected var _callbacks:Object;
public var pauseTime:Number;
protected var _repeatCount:Number;
protected var _timeScale:Number;
public static const version:Number = 10.1;
public static var removeTween:Function = TweenLite.removeTween;
private static var _overwriteMode:int = (OverwriteManager.enabled) ? OverwriteManager.mode : OverwriteManager.init();
;
protected static var _pausedTweens:Dictionary = new Dictionary(false);
protected static var _globalTimeScale:Number = 1;
public static var killTweensOf:Function = TweenLite.killTweensOf;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _activatedPlugins:Boolean = TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin, HexColorsPlugin, BlurFilterPlugin, ColorMatrixFilterPlugin, BevelFilterPlugin, DropShadowFilterPlugin, GlowFilterPlugin, RoundPropsPlugin, BezierPlugin, BezierThroughPlugin, ShortRotationPlugin]);
public function TweenMax(_arg1:Object, _arg2:Number, _arg3:Object){
super(_arg1, _arg2, _arg3);
if (TweenLite.version < 10.09){
trace("TweenMax error! Please update your TweenLite class or try deleting your ASO files. TweenMax requires a more recent version. Download updates at http://www.TweenMax.com.");
};
if (((!((this.combinedTimeScale == 1))) && ((this.target is TweenMax)))){
_timeScale = 1;
this.combinedTimeScale = _globalTimeScale;
} else {
_timeScale = this.combinedTimeScale;
this.combinedTimeScale = (this.combinedTimeScale * _globalTimeScale);
};
if (((!((this.combinedTimeScale == 1))) && (!((this.delay == 0))))){
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
};
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
initDispatcher();
if ((((_arg2 == 0)) && ((this.delay == 0)))){
onUpdateDispatcher();
onCompleteDispatcher();
};
};
_repeatCount = 0;
if (((!(isNaN(this.vars.yoyo))) || (!(isNaN(this.vars.loop))))){
this.vars.persist = true;
};
}
public function dispatchEvent(_arg1:Event):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.dispatchEvent(_arg1));
}
public function get reversed():Boolean{
return ((this.ease == reverseEase));
}
public function set reversed(_arg1:Boolean):void{
if (this.reversed != _arg1){
reverse();
};
}
public function get progress():Number{
var _local1:Number = (isNaN(this.pauseTime)) ? currentTime : this.pauseTime;
var _local2:Number = (((((_local1 - this.initTime) * 0.001) - (this.delay / this.combinedTimeScale)) / this.duration) * this.combinedTimeScale);
if (_local2 > 1){
return (1);
};
if (_local2 < 0){
return (0);
};
return (_local2);
}
override public function set enabled(_arg1:Boolean):void{
if (!_arg1){
_pausedTweens[this] = null;
delete _pausedTweens[this];
};
super.enabled = _arg1;
if (_arg1){
this.combinedTimeScale = (_timeScale * _globalTimeScale);
};
}
protected function onStartDispatcher(... _args):void{
if (_callbacks.onStart != null){
_callbacks.onStart.apply(null, this.vars.onStartParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START));
}
public function setDestination(_arg1:String, _arg2, _arg3:Boolean=true):void{
var _local5:int;
var _local6:Object;
var _local7:Array;
var _local8:Boolean;
var _local9:Array;
var _local10:Object;
var _local11:int;
var _local12:Array;
var _local4:Number = this.progress;
if (this.initted){
if (((!(_arg3)) && (!((_local4 == 0))))){
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
if (this.tweens[_local5].name == _arg1){
this.tweens[_local5].target[this.tweens[_local5].property] = this.tweens[_local5].start;
};
_local5--;
};
};
_local6 = this.vars;
_local7 = this.tweens;
_local8 = _hasPlugins;
this.tweens = [];
this.vars = (this.exposedVars = {});
this.vars[_arg1] = _arg2;
initTweenVals();
if (((!((this.ease == reverseEase))) && ((_local6.ease is Function)))){
this.ease = _local6.ease;
};
if (((_arg3) && (!((_local4 == 0))))){
adjustStartValues();
};
_local9 = this.tweens;
this.vars = _local6;
this.tweens = _local7;
_local10 = {};
_local5 = (_local9.length - 1);
while (_local5 > -1) {
if (_local9[_local5].name == "_MULTIPLE_"){
_local12 = _local9[_local5].target.overwriteProps;
_local11 = (_local12.length - 1);
while (_local11 > -1) {
_local10[_local12[_local11]] = true;
_local11--;
};
} else {
_local10[_local9[_local5].name] = true;
};
_local5--;
};
killVars(_local10);
this.tweens = this.tweens.concat(_local9);
_hasPlugins = Boolean(((_local8) || (_hasPlugins)));
};
this.vars[_arg1] = _arg2;
}
override public function initTweenVals():void{
var _local1:int;
var _local2:int;
var _local3:String;
var _local4:String;
var _local5:Array;
var _local6:Object;
var _local7:TweenInfo;
if (this.exposedVars.startAt != null){
this.exposedVars.startAt.overwrite = 0;
new TweenMax(this.target, 0, this.exposedVars.startAt);
};
super.initTweenVals();
if ((((this.exposedVars.roundProps is Array)) && (!((TweenLite.plugins.roundProps == null))))){
_local5 = this.exposedVars.roundProps;
_local1 = (_local5.length - 1);
while (_local1 > -1) {
_local3 = _local5[_local1];
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
_local7 = this.tweens[_local2];
if (_local7.name == _local3){
if (_local7.isPlugin){
_local7.target.round = true;
} else {
if (_local6 == null){
_local6 = new TweenLite.plugins.roundProps();
_local6.add(_local7.target, _local3, _local7.start, _local7.change);
_hasPlugins = true;
this.tweens[_local2] = new TweenInfo(_local6, "changeFactor", 0, 1, _local3, true);
} else {
_local6.add(_local7.target, _local3, _local7.start, _local7.change);
this.tweens.splice(_local2, 1);
};
};
} else {
if (((((_local7.isPlugin) && ((_local7.name == "_MULTIPLE_")))) && (!(_local7.target.round)))){
_local4 = ((" " + _local7.target.overwriteProps.join(" ")) + " ");
if (_local4.indexOf(((" " + _local3) + " ")) != -1){
_local7.target.round = true;
};
};
};
_local2--;
};
_local1--;
};
};
}
public function restart(_arg1:Boolean=false):void{
if (_arg1){
this.initTime = currentTime;
this.startTime = (currentTime + (this.delay * (1000 / this.combinedTimeScale)));
} else {
this.startTime = currentTime;
this.initTime = (currentTime - (this.delay * (1000 / this.combinedTimeScale)));
};
_repeatCount = 0;
if (this.target != this.vars.onComplete){
render(this.startTime);
};
this.pauseTime = NaN;
_pausedTweens[this] = null;
delete _pausedTweens[this];
this.enabled = true;
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
if (_dispatcher != null){
_dispatcher.removeEventListener(_arg1, _arg2, _arg3);
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
if (_dispatcher == null){
initDispatcher();
};
if ((((_arg1 == TweenEvent.UPDATE)) && (!((this.vars.onUpdate == onUpdateDispatcher))))){
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
_dispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
protected function adjustStartValues():void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:TweenInfo;
var _local6:int;
var _local1:Number = this.progress;
if (_local1 != 0){
_local2 = this.ease(_local1, 0, 1, 1);
_local3 = (1 / (1 - _local2));
_local6 = (this.tweens.length - 1);
while (_local6 > -1) {
_local5 = this.tweens[_local6];
_local4 = (_local5.start + _local5.change);
if (_local5.isPlugin){
_local5.change = ((_local4 - _local2) * _local3);
} else {
_local5.change = ((_local4 - _local5.target[_local5.property]) * _local3);
};
_local5.start = (_local4 - _local5.change);
_local6--;
};
};
}
override public function render(_arg1:uint):void{
var _local3:Number;
var _local4:TweenInfo;
var _local5:int;
var _local2:Number = (((_arg1 - this.startTime) * 0.001) * this.combinedTimeScale);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4.target[_local4.property] = (_local4.start + (_local3 * _local4.change));
_local5--;
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
protected function initDispatcher():void{
var _local1:Object;
var _local2:String;
if (_dispatcher == null){
_dispatcher = new EventDispatcher(this);
_callbacks = {onStart:this.vars.onStart, onUpdate:this.vars.onUpdate, onComplete:this.vars.onComplete};
if (this.vars.isTV == true){
this.vars = this.vars.clone();
} else {
_local1 = {};
for (_local2 in this.vars) {
_local1[_local2] = this.vars[_local2];
};
this.vars = _local1;
};
this.vars.onStart = onStartDispatcher;
this.vars.onComplete = onCompleteDispatcher;
if ((this.vars.onStartListener is Function)){
_dispatcher.addEventListener(TweenEvent.START, this.vars.onStartListener, false, 0, true);
};
if ((this.vars.onUpdateListener is Function)){
_dispatcher.addEventListener(TweenEvent.UPDATE, this.vars.onUpdateListener, false, 0, true);
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
if ((this.vars.onCompleteListener is Function)){
_dispatcher.addEventListener(TweenEvent.COMPLETE, this.vars.onCompleteListener, false, 0, true);
};
};
}
public function willTrigger(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.willTrigger(_arg1));
}
public function set progress(_arg1:Number):void{
this.startTime = (currentTime - ((this.duration * _arg1) * 1000));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
if (!this.started){
activate();
};
render(currentTime);
if (!isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.active = false;
};
}
public function reverse(_arg1:Boolean=true, _arg2:Boolean=true):void{
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
var _local3:Number = this.progress;
if (((_arg1) && ((_local3 > 0)))){
this.startTime = (currentTime - ((((1 - _local3) * this.duration) * 1000) / this.combinedTimeScale));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
};
if (_arg2 != false){
if (_local3 < 1){
resume();
} else {
restart();
};
};
}
protected function onUpdateDispatcher(... _args):void{
if (_callbacks.onUpdate != null){
_callbacks.onUpdate.apply(null, this.vars.onUpdateParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
}
public function set paused(_arg1:Boolean):void{
if (_arg1){
pause();
} else {
resume();
};
}
public function resume():void{
this.enabled = true;
if (!isNaN(this.pauseTime)){
this.initTime = (this.initTime + (currentTime - this.pauseTime));
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
this.pauseTime = NaN;
if (((!(this.started)) && ((currentTime >= this.startTime)))){
activate();
} else {
this.active = this.started;
};
_pausedTweens[this] = null;
delete _pausedTweens[this];
};
}
public function get paused():Boolean{
return (!(isNaN(this.pauseTime)));
}
public function reverseEase(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.ease((_arg4 - _arg1), _arg2, _arg3, _arg4));
}
public function killProperties(_arg1:Array):void{
var _local3:int;
var _local2:Object = {};
_local3 = (_arg1.length - 1);
while (_local3 > -1) {
_local2[_arg1[_local3]] = true;
_local3--;
};
killVars(_local2);
}
public function hasEventListener(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.hasEventListener(_arg1));
}
public function pause():void{
if (isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.enabled = false;
_pausedTweens[this] = this;
};
}
override public function complete(_arg1:Boolean=false):void{
if (((((!(isNaN(this.vars.yoyo))) && ((((_repeatCount < this.vars.yoyo)) || ((this.vars.yoyo == 0)))))) || (((!(isNaN(this.vars.loop))) && ((((_repeatCount < this.vars.loop)) || ((this.vars.loop == 0)))))))){
_repeatCount++;
if (!isNaN(this.vars.yoyo)){
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
};
this.startTime = (_arg1) ? (this.startTime + (this.duration * (1000 / this.combinedTimeScale))) : currentTime;
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
} else {
if (this.vars.persist == true){
pause();
};
};
super.complete(_arg1);
}
public function set timeScale(_arg1:Number):void{
if (_arg1 < 1E-5){
_arg1 = (_timeScale = 1E-5);
} else {
_timeScale = _arg1;
_arg1 = (_arg1 * _globalTimeScale);
};
this.initTime = ((currentTime - ((((currentTime - this.initTime) - (this.delay * (1000 / this.combinedTimeScale))) * this.combinedTimeScale) * (1 / _arg1))) - (this.delay * (1000 / _arg1)));
if (this.startTime != 999999999999999){
this.startTime = (this.initTime + (this.delay * (1000 / _arg1)));
};
this.combinedTimeScale = _arg1;
}
public function invalidate(_arg1:Boolean=true):void{
var _local2:Number;
if (this.initted){
_local2 = this.progress;
if (((!(_arg1)) && (!((_local2 == 0))))){
this.progress = 0;
};
this.tweens = [];
_hasPlugins = false;
this.exposedVars = ((this.vars.isTV)==true) ? this.vars.exposedProps : this.vars;
initTweenVals();
_timeScale = ((this.vars.timeScale) || (1));
this.combinedTimeScale = (_timeScale * _globalTimeScale);
this.delay = ((this.vars.delay) || (0));
if (isNaN(this.pauseTime)){
this.startTime = (this.initTime + ((this.delay * 1000) / this.combinedTimeScale));
};
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
if (_dispatcher != null){
this.vars.onStart = _callbacks.onStart;
this.vars.onUpdate = _callbacks.onUpdate;
this.vars.onComplete = _callbacks.onComplete;
_dispatcher = null;
};
initDispatcher();
};
if (_local2 != 0){
if (_arg1){
adjustStartValues();
} else {
this.progress = _local2;
};
};
};
}
public function get timeScale():Number{
return (_timeScale);
}
protected function onCompleteDispatcher(... _args):void{
if (_callbacks.onComplete != null){
_callbacks.onComplete.apply(null, this.vars.onCompleteParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
}
public static function set globalTimeScale(_arg1:Number):void{
setGlobalTimeScale(_arg1);
}
public static function pauseAll(_arg1:Boolean=true, _arg2:Boolean=false):void{
changePause(true, _arg1, _arg2);
}
public static function killAllDelayedCalls(_arg1:Boolean=false):void{
killAll(_arg1, false, true);
}
public static function setGlobalTimeScale(_arg1:Number):void{
var _local3:int;
var _local4:Array;
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
var _local2:Dictionary = masterList;
_globalTimeScale = _arg1;
for each (_local4 in _local2) {
_local3 = (_local4.length - 1);
while (_local3 > -1) {
if ((_local4[_local3] is TweenMax)){
_local4[_local3].timeScale = (_local4[_local3].timeScale * 1);
};
_local3--;
};
};
}
public static function get globalTimeScale():Number{
return (_globalTimeScale);
}
public static function getTweensOf(_arg1:Object):Array{
var _local4:TweenLite;
var _local5:int;
var _local2:Array = masterList[_arg1];
var _local3:Array = [];
if (_local2 != null){
_local5 = (_local2.length - 1);
while (_local5 > -1) {
if (!_local2[_local5].gc){
_local3[_local3.length] = _local2[_local5];
};
_local5--;
};
};
for each (_local4 in _pausedTweens) {
if (_local4.target == _arg1){
_local3[_local3.length] = _local4;
};
};
return (_local3);
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenMax{
return (new TweenMax(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, persist:_arg4, overwrite:0}));
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:Array = getTweensOf(_arg1);
var _local3:int = (_local2.length - 1);
while (_local3 > -1) {
if (((((_local2[_local3].active) || ((_local2[_local3].startTime == currentTime)))) && (!(_local2[_local3].gc)))){
return (true);
};
_local3--;
};
return (false);
}
public static function changePause(_arg1:Boolean, _arg2:Boolean=true, _arg3:Boolean=false):void{
var _local5:Boolean;
var _local4:Array = getAllTweens();
var _local6:int = (_local4.length - 1);
while (_local6 > -1) {
_local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete);
if ((((_local4[_local6] is TweenMax)) && ((((_local5 == _arg3)) || (!((_local5 == _arg2))))))){
_local4[_local6].paused = _arg1;
};
_local6--;
};
}
public static function killAllTweens(_arg1:Boolean=false):void{
killAll(_arg1, true, false);
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
_arg3.runBackwards = true;
return (new TweenMax(_arg1, _arg2, _arg3));
}
public static function killAll(_arg1:Boolean=false, _arg2:Boolean=true, _arg3:Boolean=true):void{
var _local5:Boolean;
var _local6:int;
var _local4:Array = getAllTweens();
_local6 = (_local4.length - 1);
while (_local6 > -1) {
_local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete);
if ((((_local5 == _arg3)) || (!((_local5 == _arg2))))){
if (_arg1){
_local4[_local6].complete(false);
_local4[_local6].clear();
} else {
TweenLite.removeTween(_local4[_local6], true);
};
};
_local6--;
};
}
public static function getAllTweens():Array{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
var _local1:Dictionary = masterList;
var _local2:Array = [];
for each (_local3 in _local1) {
_local4 = (_local3.length - 1);
while (_local4 > -1) {
if (!_local3[_local4].gc){
_local2[_local2.length] = _local3[_local4];
};
_local4--;
};
};
for each (_local5 in _pausedTweens) {
_local2[_local2.length] = _local5;
};
return (_local2);
}
public static function resumeAll(_arg1:Boolean=true, _arg2:Boolean=false):void{
changePause(false, _arg1, _arg2);
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
return (new TweenMax(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 67
//Crack_9 (nutsforpeanuts_fla.Crack_9)
package nutsforpeanuts_fla {
import flash.display.*;
public dynamic class Crack_9 extends MovieClip {
public function Crack_9(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package nutsforpeanuts_fla
Section 68
//PFlying_15 (nutsforpeanuts_fla.PFlying_15)
package nutsforpeanuts_fla {
import flash.display.*;
public dynamic class PFlying_15 extends MovieClip {
public function PFlying_15(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package nutsforpeanuts_fla
Section 69
//Percent (org.casalib.math.Percent)
package org.casalib.math {
public class Percent {
protected var _percent:Number;
public function Percent(_arg1:Number=0, _arg2:Boolean=true){
if (_arg2){
this.decimalPercentage = _arg1;
} else {
this.percentage = _arg1;
};
}
public function set percentage(_arg1:Number):void{
this._percent = (_arg1 * 0.01);
}
public function clone():Percent{
return (new Percent(this.decimalPercentage));
}
public function get percentage():Number{
return ((100 * this._percent));
}
public function get decimalPercentage():Number{
return (this._percent);
}
public function set decimalPercentage(_arg1:Number):void{
this._percent = _arg1;
}
public function toString():String{
return (this.decimalPercentage.toString());
}
public function equals(_arg1:Percent):Boolean{
return ((this.decimalPercentage == _arg1.decimalPercentage));
}
}
}//package org.casalib.math
Section 70
//ArrayUtil (org.casalib.util.ArrayUtil)
package org.casalib.util {
public class ArrayUtil {
protected static function _sortRandom(_arg1, _arg2):int{
return ((NumberUtil.randomIntegerWithinRange(0, 1)) ? 1 : -1);
}
public static function containsAll(_arg1:Array, _arg2:Array):Boolean{
var _local3:uint = _arg2.length;
while (_local3--) {
if (_arg1.indexOf(_arg2[_local3]) == -1){
return (false);
};
};
return (true);
}
protected static function _removeDuplicatesFilter(_arg1, _arg2:int, _arg3:Array):Boolean{
return (((_arg2)==0) ? true : (_arg3.lastIndexOf(_arg1, (_arg2 - 1)) == -1));
}
public static function equals(_arg1:Array, _arg2:Array):Boolean{
var _local3:uint = _arg1.length;
if (_local3 != _arg2.length){
return (false);
};
while (_local3--) {
if (_arg1[_local3] != _arg2[_local3]){
return (false);
};
};
return (true);
}
public static function getHighestValue(_arg1:Array):Number{
return (_arg1[_arg1.sort((16 | 8))[(_arg1.length - 1)]]);
}
public static function sum(_arg1:Array):Number{
var _local2:Number = 0;
var _local3:uint = _arg1.length;
while (_local3--) {
_local2 = (_local2 + _arg1[_local3]);
};
return (_local2);
}
public static function removeDuplicates(_arg1:Array):Array{
return (_arg1.filter(ArrayUtil._removeDuplicatesFilter));
}
public static function containsAny(_arg1:Array, _arg2:Array):Boolean{
var _local3:uint = _arg2.length;
while (_local3--) {
if (_arg1.indexOf(_arg2[_local3]) != -1){
return (true);
};
};
return (false);
}
public static function getIndexOfDifference(_arg1:Array, _arg2:Array, _arg3:uint=0):int{
var _local4:int = (_arg3 - 1);
while (++_local4 < _arg1.length) {
if (_arg1[_local4] != _arg2[_local4]){
return (_local4);
};
};
return (-1);
}
public static function randomize(_arg1:Array):Array{
var _local2:Array = new Array();
var _local3:Array = _arg1.sort(ArrayUtil._sortRandom, Array.RETURNINDEXEDARRAY);
var _local4 = -1;
while (++_local4 < _arg1.length) {
_local2.push(_arg1[_local3[_local4]]);
};
return (_local2);
}
public static function addItemsAt(_arg1:Array, _arg2:Array, _arg3:int=2147483647):Boolean{
if (_arg2.length == 0){
return (false);
};
var _local4:Array = _arg2.concat();
_local4.splice(0, 0, _arg3, 0);
_arg1.splice.apply(null, _local4);
return (true);
}
public static function removeItem(_arg1:Array, _arg2):uint{
var _local3:int = _arg1.indexOf(_arg2);
var _local4:uint;
while (_local3 != -1) {
_arg1.splice(_local3, 1);
_local3 = _arg1.indexOf(_arg2, _local3);
_local4++;
};
return (_local4);
}
public static function getLowestValue(_arg1:Array):Number{
return (_arg1[_arg1.sort((16 | 8))[0]]);
}
public static function retainItems(_arg1:Array, _arg2:Array):Boolean{
var _local3:Boolean;
var _local4:uint = _arg1.length;
while (_local4--) {
if (_arg2.indexOf(_arg1[_local4]) == -1){
_arg1.splice(_local4, 1);
_local3 = true;
};
};
return (_local3);
}
public static function removeItems(_arg1:Array, _arg2:Array):Boolean{
var _local3:Boolean;
var _local4:uint = _arg1.length;
while (_local4--) {
if (_arg2.indexOf(_arg1[_local4]) != -1){
_arg1.splice(_local4, 1);
_local3 = true;
};
};
return (_local3);
}
public static function average(_arg1:Array):Number{
if (_arg1.length == 0){
return (0);
};
return ((ArrayUtil.sum(_arg1) / _arg1.length));
}
public static function contains(_arg1:Array, _arg2):uint{
var _local3:int = _arg1.indexOf(_arg2, 0);
var _local4:uint;
while (_local3 != -1) {
_local3 = _arg1.indexOf(_arg2, (_local3 + 1));
_local4++;
};
return (_local4);
}
}
}//package org.casalib.util
Section 71
//NumberUtil (org.casalib.util.NumberUtil)
package org.casalib.util {
import org.casalib.math.*;
public class NumberUtil {
public static function interpolate(_arg1:Percent, _arg2:Number, _arg3:Number):Number{
return ((_arg2 + ((_arg3 - _arg2) * _arg1.decimalPercentage)));
}
public static function max(_arg1, _arg2):Number{
if (((((isNaN(_arg1)) && (isNaN(_arg2)))) || ((((_arg1 == null)) && ((_arg2 == null)))))){
return (NaN);
};
if ((((_arg1 == null)) || ((_arg2 == null)))){
return (((_arg2)==null) ? _arg1 : _arg2);
};
if (((isNaN(_arg1)) || (isNaN(_arg2)))){
return ((isNaN(_arg2)) ? _arg1 : _arg2);
};
return (Math.max(_arg1, _arg2));
}
public static function isOdd(_arg1:Number):Boolean{
return (!(NumberUtil.isEven(_arg1)));
}
public static function constrain(_arg1:Number, _arg2:Number, _arg3:Number):Number{
return (Math.min(Math.max(_arg1, Math.min(_arg2, _arg3)), Math.max(_arg2, _arg3)));
}
public static function roundDecimalToPlace(_arg1:Number, _arg2:uint):Number{
var _local3:Number = Math.pow(10, _arg2);
return ((Math.round((_arg1 * _local3)) / _local3));
}
public static function isEqual(_arg1:Number, _arg2:Number, _arg3:Number=0):Boolean{
return ((Math.abs((_arg1 - _arg2)) <= Math.abs(_arg3)));
}
public static function isEven(_arg1:Number):Boolean{
return (((_arg1 & 1) == 0));
}
public static function getOrdinalSuffix(_arg1:int):String{
if ((((_arg1 >= 10)) && ((_arg1 <= 20)))){
return ("th");
};
switch ((_arg1 % 10)){
case 0:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
return ("th");
case 3:
return ("rd");
case 2:
return ("nd");
case 1:
return ("st");
default:
return ("");
};
}
public static function normalize(_arg1:Number, _arg2:Number, _arg3:Number):Percent{
return (new Percent(((_arg1 - _arg2) / (_arg3 - _arg2))));
}
public static function loopIndex(_arg1:int, _arg2:uint):uint{
if (_arg1 < 0){
_arg1 = (_arg2 + (_arg1 % _arg2));
};
if (_arg1 >= _arg2){
return ((_arg1 % _arg2));
};
return (_arg1);
}
public static function randomWithinRange(_arg1:Number, _arg2:Number):Number{
return ((_arg1 + (Math.random() * (_arg2 - _arg1))));
}
public static function min(_arg1, _arg2):Number{
if (((((isNaN(_arg1)) && (isNaN(_arg2)))) || ((((_arg1 == null)) && ((_arg2 == null)))))){
return (NaN);
};
if ((((_arg1 == null)) || ((_arg2 == null)))){
return (((_arg2)==null) ? _arg1 : _arg2);
};
if (((isNaN(_arg1)) || (isNaN(_arg2)))){
return ((isNaN(_arg2)) ? _arg1 : _arg2);
};
return (Math.min(_arg1, _arg2));
}
public static function isInteger(_arg1:Number):Boolean{
return (((_arg1 % 1) == 0));
}
public static function isPrime(_arg1:Number):Boolean{
if ((((_arg1 == 1)) || ((_arg1 == 2)))){
return (true);
};
if (NumberUtil.isEven(_arg1)){
return (false);
};
var _local2:Number = Math.sqrt(_arg1);
var _local3:Number = 3;
while (_local3 <= _local2) {
if ((_arg1 % _local3) == 0){
return (false);
};
_local3++;
};
return (true);
}
public static function randomIntegerWithinRange(_arg1:int, _arg2:int):int{
return (Math.round(NumberUtil.randomWithinRange(_arg1, _arg2)));
}
public static function format(_arg1:Number, _arg2:uint, _arg3:String=null, _arg4:String=null):String{
var _local7:Array;
var _local8:uint;
var _local9:uint;
var _local10:String;
var _local5:String = _arg1.toString();
var _local6:uint = _local5.length;
if (_arg3 != null){
_local7 = _local5.split("");
_local8 = 3;
_local9 = _local7.length;
while (--_local9 > 0) {
--_local8;
if (_local8 == 0){
_local8 = 3;
_local7.splice(_local9, 0, _arg3);
};
};
_local5 = _local7.join("");
};
if (_arg2 != 0){
if (_local6 < _arg2){
_arg2 = (_arg2 - _local6);
_local10 = ((_arg4)==null) ? "0" : _arg4;
while (_arg2--) {
_local5 = (_local10 + _local5);
};
};
};
return (_local5);
}
public static function addLeadingZero(_arg1:Number):String{
return (((_arg1)<10) ? ("0" + _arg1) : _arg1.toString());
}
public static function map(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Number{
return (NumberUtil.interpolate(NumberUtil.normalize(_arg1, _arg2, _arg3), _arg4, _arg5));
}
public static function createStepsBetween(_arg1:Number, _arg2:Number, _arg3:Number):Array{
_arg3++;
var _local4:uint;
var _local5:Array = new Array();
var _local6:Number = ((_arg2 - _arg1) / _arg3);
while (++_local4 < _arg3) {
_local5.push(((_local4 * _local6) + _arg1));
};
return (_local5);
}
public static function isBetween(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
return (!((((_arg1 < Math.min(_arg2, _arg3))) || ((_arg1 > Math.max(_arg2, _arg3))))));
}
}
}//package org.casalib.util
Section 72
//Damp (s2.damper.Damp)
package s2.damper {
public class Damp {
private var _propStart:Number;
private var _completed:Boolean;// = false
private var _dampingProps:DampingProps;
private var _propTarget:Number;
private var _propName:String;
private var _obj:Object;
public function Damp(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Object=null){
_obj = _arg1;
_propTarget = _arg3;
_propName = _arg2;
_propStart = _arg1[_propName];
if (((_arg4) && ((_arg4 is DampingProps)))){
_dampingProps = DampingProps(_arg4);
} else {
_dampingProps = new DampingProps(_arg4);
};
DampingEngine.instance.addMovement(this);
}
public function set propTarget(_arg1:Number){
_propTarget = _arg1;
}
public function get completed():Boolean{
return (_completed);
}
public function get propStart():Number{
return (_propStart);
}
public function get propName():String{
return (_propName);
}
public function get obj():Object{
return (_obj);
}
public function get propTarget():Number{
return (_propTarget);
}
public function get dampingProps():DampingProps{
return (_dampingProps);
}
public function set propStart(_arg1:Number){
_propStart = _arg1;
}
public static function clearDamp(_arg1:Object, _arg2:String):void{
DampingEngine.instance.clearDamp(_arg1, _arg2);
}
}
}//package s2.damper
Section 73
//DampingEngine (s2.damper.DampingEngine)
package s2.damper {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.errors.*;
public class DampingEngine {
private var _movements:Dictionary;
private var _stage:Stage;
private static var _instance:DampingEngine;
public function DampingEngine(_arg1:PrivateClass){
_movements = new Dictionary();
super();
}
public function init(_arg1:Stage):void{
_stage = _arg1;
_stage.addEventListener(Event.ENTER_FRAME, incrementDamping);
}
public function addMovement(_arg1:Damp){
if (((!(_stage)) && (!(_arg1.obj.stage)))){
throw (new IllegalOperationError("Damping engine not inited and stage not found on damped object."));
};
if (!_stage){
_stage = _arg1.obj.stage;
};
_stage.addEventListener(Event.ENTER_FRAME, incrementDamping);
if (!_movements[_arg1.obj]){
_movements[_arg1.obj] = {};
};
_movements[_arg1.obj][_arg1.propName] = _arg1;
}
private function removeEmptyMovements(_arg1){
var _local2:uint;
var _local3:String;
if (_movements[_arg1]){
for (_local3 in _movements[_arg1]) {
_local2++;
};
if (_local2 == 0){
delete _movements[_arg1];
};
};
}
private function incrementDamping(_arg1:Event){
var _local2:Object;
var _local3:String;
var _local4:Damp;
var _local5:DampingProps;
for (_local2 in _movements) {
for (_local3 in _movements[_local2]) {
_local4 = _movements[_local2][_local3];
_local5 = _local4.dampingProps;
_local4.dampingProps.accel = (-((_local5.k / _local5.m)) * (_local4.propStart - _local4.propTarget));
_local5.velocity = (_local5.velocity * _local5.decay);
_local5.velocity = (_local5.velocity + _local5.accel);
_local4.propStart = (_local4.propStart + _local5.velocity);
_local4.obj[_local4.propName] = _local4.propStart;
if ((((Math.abs(_local5.velocity) <= _local5.tVelocity)) && ((Math.abs(_local5.accel) <= _local5.tVelocity)))){
if (_local5.onComplete != null){
_local5.onComplete();
};
_local4.obj[_local4.propName] = _local4.propTarget;
clearDamp(_local2, _local3);
};
};
};
}
function clearDamp(_arg1:Object, _arg2:String):void{
if (((_movements[_arg1]) && (_movements[_arg1][_arg2]))){
delete _movements[_arg1][_arg2];
};
removeEmptyMovements(_arg1);
}
public static function get instance():DampingEngine{
if (_instance == null){
_instance = new DampingEngine(new PrivateClass());
};
return (_instance);
}
}
}//package s2.damper
class PrivateClass {
private function PrivateClass(){
}
}
Section 74
//DampingProps (s2.damper.DampingProps)
package s2.damper {
public class DampingProps {
public var delay:uint;
public var accel:Number;
public var decay:Number;
public var k:Number;
public var m:Number;
public var tVelocity:Number;
public var onComplete:Function;
public var velocity:Number;
public static var DELAY:uint;
public static var ACCEL:Number = 0;
public static var K:Number = 1.9;
public static var M:Number = 10;
public static var T_VELOCITY:Number = 0.1;
public static var ON_COMPLETE:Function = null;
public static var DECAY:Number = 0.9;
public static var VELOCITY:Number = 0;
public function DampingProps(_arg1:Object=null){
k = K;
m = M;
decay = DECAY;
velocity = VELOCITY;
accel = ACCEL;
delay = DELAY;
onComplete = ON_COMPLETE;
tVelocity = T_VELOCITY;
setDampingProps(_arg1);
}
private function setDampingProps(_arg1:Object){
if (_arg1){
k = ((_arg1.k)!=null) ? _arg1.k : k;
m = ((_arg1.m)!=null) ? _arg1.m : m;
decay = ((_arg1.decay)!=null) ? _arg1.decay : decay;
accel = ((_arg1.accel)!=null) ? _arg1.accel : accel;
velocity = ((_arg1.velocity)!=null) ? _arg1.velocity : velocity;
delay = ((_arg1.delay)!=null) ? _arg1.delay : delay;
onComplete = ((_arg1.onComplete)!=null) ? _arg1.onComplete : onComplete;
tVelocity = ((_arg1.tVelocity)!=null) ? _arg1.tVelocity : tVelocity;
};
}
}
}//package s2.damper
Section 75
//cuePointEvent (s2.sound.cuePointEvent)
package s2.sound {
import flash.events.*;
public class cuePointEvent extends Event {
private var _tag:String;
private var _time:Number;
public static const CUE_POINT:String = "Cue_Point";
public function cuePointEvent(_arg1:String, _arg2:String, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
_tag = _arg2;
_time = _arg3;
super(_arg1, _arg4, _arg5);
}
public function get time():Number{
return (_time);
}
public function get tag():String{
return (_tag);
}
override public function clone():Event{
return (new cuePointEvent(type, _tag, time, bubbles, cancelable));
}
}
}//package s2.sound
Section 76
//SoundMan (s2.sound.SoundMan)
package s2.sound {
import flash.media.*;
import flash.utils.*;
public class SoundMan {
private static var _defaultPool:String = "default";
private static var _numPools:int = 0;
private static var _initialized:Boolean;
private static var _pools:Object = {};
public static function stop(_arg1:String, _arg2:String=null):void{
var _local3:SoundPool = getPool(((_arg2) || (_defaultPool)));
_local3.stop(_arg1);
}
public static function fadeAll():void{
var _local1:String;
var _local2:SoundPool;
for (_local1 in _pools) {
_local2 = (_pools[_local1] as SoundPool);
_local2.fadePool();
};
}
public static function checkPlaying(_arg1:String, _arg2:String=null):Boolean{
var _local3:SoundPool = getPool(((_arg2) || (_defaultPool)));
return (_local3.getSound(_arg1).playing);
}
public static function createPool(_arg1:String):void{
if (_pools[_arg1] != null){
trace((("Warning: Sound pool with name " + _arg1) + " already exists."));
} else {
_pools[_arg1] = new SoundPool(_arg1);
_numPools++;
};
}
private static function getPool(_arg1:String):SoundPool{
var _local2:SoundPool;
if (!_initialized){
throw (new Error("Error: SoundManager not initialized."));
};
if (_pools[_arg1] == null){
throw (new Error(("Attempted accessing invalid pool name: " + _arg1)));
};
_local2 = (_pools[_arg1] as SoundPool);
return (_local2);
}
public static function playRandom(_arg1:String=null, _arg2:int=0, _arg3:SoundTransform=null):void{
var _local4:SoundPool = getPool(((_arg1) || (_defaultPool)));
_local4.playRandom();
}
public static function getSound(_arg1:String, _arg2:String):SoundProxy{
var _local3:SoundPool = getPool(((_arg2) || (_defaultPool)));
var _local4:SoundProxy = _local3.getSound(_arg1);
return (_local4);
}
public static function addCuePoint(_arg1:Number, _arg2:String, _arg3:String=null, _arg4:String="none"){
var _local5:SoundPool = getPool(((_arg3) || (_defaultPool)));
var _local6:SoundProxy = _local5.getSound(_arg2);
_local6.addCuePoint({time:_arg1, tag:_arg4});
}
public static function init():void{
createPool("default");
_initialized = true;
trace("Initialized");
}
public static function removeSound(_arg1:String, _arg2:String=null):void{
var _local3:SoundPool = getPool(((_arg2) || (_defaultPool)));
_local3.removeSound(_arg1);
}
public static function addSound(_arg1:String, _arg2, _arg3:String=null):void{
var _local4:Sound;
var _local6:Class;
if (!_initialized){
init();
};
switch (typeof(_arg2)){
case "string":
_local6 = (getDefinitionByName(_arg2) as Class);
if (_local6 != null){
_local4 = Sound(new (_local6));
} else {
throw (new Error(("Unable to find Sound by classname: " + _arg2)));
};
break;
case "object":
_local4 = Sound(_arg2);
break;
default:
throw (new Error("Only strings or Sound classes can be passed into the SoundMan.addSound() method."));
};
var _local5:SoundPool = getPool(((_arg3) || (_defaultPool)));
trace(_arg3);
_local5.addSound(_arg1, _local4);
}
public static function get numPools():int{
return (_numPools);
}
public static function play(_arg1:String, _arg2:String=null, _arg3:int=0, _arg4:SoundTransform=null, _arg5:Boolean=true):void{
var _local6:SoundPool = getPool(((_arg2) || (_defaultPool)));
var _local7:Boolean = checkPlaying(_arg1, _arg2);
if (((_arg5) || (!(_local7)))){
_local6.play(_arg1, _arg3, _arg4);
};
}
public static function pause(_arg1:String, _arg2:String=null){
var _local3:SoundPool = getPool(((_arg2) || (_defaultPool)));
var _local4:SoundProxy = _local3.getSound(_arg1);
_local4.pause();
}
public static function fadePool(_arg1:Number=0.3, _arg2:Number=0, _arg3:Boolean=false, _arg4:String=null):void{
var _local5:SoundPool = getPool(((_arg4) || (_defaultPool)));
_local5.fadePool(_arg1, _arg2, _arg3);
}
public static function set defaultPool(_arg1:String):void{
if (_pools[_arg1] == null){
throw (new Error(("Error: Invalid SoundPool name. Cannot set defaultPool to:" + _arg1)));
};
_defaultPool = _arg1;
}
public static function fade(_arg1:String, _arg2:Number=0.3, _arg3:Number=0, _arg4:Boolean=false, _arg5:String=null):void{
var _local6:SoundPool = getPool(((_arg5) || (_defaultPool)));
_local6.fade(_arg1, _arg2, _arg3, _arg4);
}
public static function get defaultPool():String{
return (_defaultPool);
}
public static function stopPool(_arg1:String=null):void{
var _local2:SoundPool = getPool(((_arg1) || (_defaultPool)));
_local2.stopPool();
}
public static function stopAll():void{
var _local1:String;
var _local2:SoundPool;
for (_local1 in _pools) {
_local2 = (_pools[_local1] as SoundPool);
_local2.stopPool();
};
}
}
}//package s2.sound
Section 77
//SoundPool (s2.sound.SoundPool)
package s2.sound {
import flash.media.*;
public class SoundPool {
private var _sounds:Object;
private var _name:String;
private var _lastID:String;
private var _numSounds:uint;
public function SoundPool(_arg1:String):void{
_name = _arg1;
_sounds = {};
}
function stop(_arg1:String):void{
var _local2:SoundProxy = (_sounds[_arg1] as SoundProxy);
if (_local2 == null){
throw (new Error(((((("SoundPool " + _name) + ": stop(") + _arg1) + ") failed. No such sound id ") + _arg1)));
};
_local2.stop();
}
function removeSound(_arg1:String):void{
var _local2:SoundProxy = (_sounds[_arg1] as SoundProxy);
_local2.removeSound();
if (_sounds[_arg1] != null){
_sounds[_arg1] = null;
};
}
function addSound(_arg1:String, _arg2:Sound):void{
if (!_sounds[_arg1]){
_sounds[_arg1] = new SoundProxy(_arg1, _arg2);
_numSounds++;
} else {
throw (new Error((((("Error: Sound id " + _arg1) + " of pool ") + _name) + " already exists")));
};
}
protected function getRandomSoundID():String{
var _local2:String;
var _local3:String;
var _local1:Array = [];
for (_local3 in _sounds) {
_local1.push(_local3);
};
if (_local1.length < 1){
throw (new Error((("(SoundPool: " + _name) + ", getRandomSoundID() Error: No sounds registered.")));
};
if (_local1.length > 1){
do {
_local2 = _local1[Math.round((Math.random() * (_local1.length - 1)))];
} while ((((_local2 == _lastID)) && (!((_lastID == null)))));
} else {
_local2 = _local1[0];
};
return (_local2);
}
function playRandom(_arg1:int=0, _arg2:SoundTransform=null):SoundChannel{
var _local3:String = getRandomSoundID();
var _local4:SoundChannel = play(_local3, _arg1, _arg2);
return (_local4);
}
function fadePool(_arg1:Number=0.3, _arg2:Number=0, _arg3:Boolean=false):void{
var _local4:SoundProxy;
var _local5:String;
for (_local5 in _sounds) {
_local4 = (_sounds[_local5] as SoundProxy);
_local4.fade(_arg1, _arg2, _arg3);
};
}
public function getSound(_arg1:String):SoundProxy{
var _local2:SoundProxy = (_sounds[_arg1] as SoundProxy);
if (!_local2){
throw (new Error(((((("SoundPool " + _name) + ": stop(") + _arg1) + ") failed. No such sound id ") + _arg1)));
};
return (_local2);
}
function get name():String{
return (_name);
}
function play(_arg1:String, _arg2:int=0, _arg3:SoundTransform=null):SoundChannel{
var _local5:SoundChannel;
var _local4:SoundProxy = (_sounds[_arg1] as SoundProxy);
if (_local4 == null){
throw (new Error(((((("SoundPool " + _name) + ": play(") + _arg1) + ") failed. No such sound id ") + _arg1)));
};
_local5 = _local4.play(0, _arg2, _arg3);
_lastID = _arg1;
return (_local5);
}
function fade(_arg1:String, _arg2:Number=0.3, _arg3:Number=0, _arg4:Boolean=false):void{
var _local5:SoundProxy = (_sounds[_arg1] as SoundProxy);
if (_local5 == null){
throw (new Error(((((("SoundPool " + _name) + ": fade(") + _arg1) + ") failed. No such sound id ") + _arg1)));
};
_local5.fade(_arg2, _arg3, _arg4);
}
function set name(_arg1:String):void{
_name = _arg1;
}
function stopPool():void{
var _local1:SoundProxy;
var _local2:String;
for (_local2 in _sounds) {
_local1 = (_sounds[_local2] as SoundProxy);
_local1.stop();
};
}
}
}//package s2.sound
Section 78
//SoundProxy (s2.sound.SoundProxy)
package s2.sound {
import flash.events.*;
import gs.*;
import flash.media.*;
import gs.easing.*;
import flash.utils.*;
public class SoundProxy extends EventDispatcher {
private var _delay:Number;// = 100
private var _overlap:Boolean;
private var _paused:Boolean;// = false
private var _pauseTimes:Dictionary;
private var _sound:Sound;
private var _name:String;
private var _channels:Array;
private var _beatTimer:Timer;
private var _cuePoints:Array;
private var _lastCue:Dictionary;
public function SoundProxy(_arg1:String, _arg2:Sound):void{
_sound = new Sound();
_cuePoints = [];
_beatTimer = new Timer(_delay, 0);
_pauseTimes = new Dictionary(true);
_lastCue = new Dictionary(true);
super();
_name = _arg1;
_sound = _arg2;
_channels = [];
}
function stop():void{
fade(0, 0, true);
}
function fade(_arg1:Number, _arg2:Number, _arg3:Boolean=false):void{
var fadeDone:Function;
var channel:SoundChannel;
var $time = _arg1;
var $volume = _arg2;
var $autoStop = _arg3;
fadeDone = function (_arg1:SoundChannel, _arg2:Boolean=false):void{
if ((($autoStop) && ((_arg1.soundTransform.volume == 0)))){
_arg1.stop();
cleanupChannel(_arg1);
};
};
var i:int;
while (i < _channels.length) {
channel = (_channels[i] as SoundChannel);
if (!channel){
} else {
if ($time == 0){
channel.stop();
cleanupChannel(channel);
} else {
TweenLite.to(channel, $time, {volume:$volume, ease:Linear.easeNone, onComplete:fadeDone, onCompleteParams:[channel], overwrite:0});
};
};
i = (i + 1);
};
}
function timerHandler(_arg1:TimerEvent):void{
var _local3:SoundChannel;
var _local4:Number;
var _local5:Number;
var _local6:String;
var _local2:int;
while (_local2 < _channels.length) {
_local3 = (_channels[_local2] as SoundChannel);
if (!_local3){
} else {
_local4 = Math.floor(_local3.position);
if (!_lastCue[_local3]){
};
_local5 = 0;
while (_local5 < _cuePoints.length) {
if ((((Math.abs((_cuePoints[_local5].time - _local4)) < _delay)) && (!((_lastCue[_local3] == _local5))))){
_lastCue[_local3] = _local5;
_local6 = ((_cuePoints[_local5].tag)=="none") ? _local5.toString() : _cuePoints[_local5].tag;
dispatchEvent(new cuePointEvent(cuePointEvent.CUE_POINT, _local6, _cuePoints[_local5].time, true));
};
_local5++;
};
};
_local2++;
};
}
function soundPlaybackEnded(_arg1:Event):void{
var _local2:SoundChannel = (_arg1.target as SoundChannel);
cleanupChannel(_local2);
}
function removeSound():void{
if (_beatTimer.hasEventListener("timer")){
_beatTimer.removeEventListener(TimerEvent.TIMER, timerHandler);
};
this.stop();
}
function addCuePoint(_arg1:Object):void{
if (!_beatTimer.hasEventListener("timer")){
_beatTimer.addEventListener(TimerEvent.TIMER, timerHandler, false, 0, true);
_beatTimer.start();
};
_cuePoints.push(_arg1);
_cuePoints.sortOn("time", Array.NUMERIC);
}
function play(_arg1:Number=0, _arg2:int=0, _arg3:SoundTransform=null):SoundChannel{
var _local4:SoundChannel = new SoundChannel();
_local4 = _sound.play(_arg1, _arg2, _arg3);
_channels.push(_local4);
_pauseTimes[_local4] = _arg1;
if (_local4){
_local4.addEventListener(Event.SOUND_COMPLETE, soundPlaybackEnded, false, 0, true);
};
_paused = false;
return (_local4);
}
public function get playing():Boolean{
return ((_channels.length > 0));
}
function pause():void{
var _local2:SoundChannel;
var _local1:int;
while (_local1 < _channels.length) {
_local2 = (_channels[_local1] as SoundChannel);
if (!_local2){
} else {
if (!_paused){
_paused = true;
_pauseTimes[_local2] = _local2.position;
_local2.stop();
trace("stop");
} else {
_paused = false;
_channels[_local1] = _sound.play(_pauseTimes[_local2]);
trace("play");
};
};
_local1++;
};
}
function cleanupChannel(_arg1:SoundChannel):void{
var _local2:int = _channels.indexOf(_arg1);
_arg1.removeEventListener(Event.SOUND_COMPLETE, soundPlaybackEnded);
_channels.splice(_local2, 1);
}
}
}//package s2.sound
Section 79
//BG (sound.BG)
package sound {
import flash.media.*;
public dynamic class BG extends Sound {
}
}//package sound
Section 80
//Chomp (sound.Chomp)
package sound {
import flash.media.*;
public dynamic class Chomp extends Sound {
}
}//package sound
Section 81
//Click (sound.Click)
package sound {
import flash.media.*;
public dynamic class Click extends Sound {
}
}//package sound
Section 82
//Crash (sound.Crash)
package sound {
import flash.media.*;
public dynamic class Crash extends Sound {
}
}//package sound
Section 83
//Elephant (sound.Elephant)
package sound {
import flash.media.*;
public dynamic class Elephant extends Sound {
}
}//package sound
Section 84
//Impact (sound.Impact)
package sound {
import flash.media.*;
public dynamic class Impact extends Sound {
}
}//package sound
Section 85
//Jungle (sound.Jungle)
package sound {
import flash.media.*;
public dynamic class Jungle extends Sound {
}
}//package sound
Section 86
//Rope (sound.Rope)
package sound {
import flash.media.*;
public dynamic class Rope extends Sound {
}
}//package sound
Section 87
//Swish (sound.Swish)
package sound {
import flash.media.*;
public dynamic class Swish extends Sound {
}
}//package sound
Section 88
//Whoosh (sound.Whoosh)
package sound {
import flash.media.*;
public dynamic class Whoosh extends Sound {
}
}//package sound
Section 89
//Bars (Bars)
package {
import flash.display.*;
public dynamic class Bars extends Sprite {
}
}//package
Section 90
//BoyClip (BoyClip)
package {
import flash.display.*;
import com.nick.pom.nutsforpeanuts.*;
public dynamic class BoyClip extends Sprite {
public var hitSpot:HitSpot;
}
}//package
Section 91
//CustomPointer (CustomPointer)
package {
import flash.display.*;
public dynamic class CustomPointer extends MovieClip {
public function CustomPointer(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 92
//PHit (PHit)
package {
import flash.display.*;
public dynamic class PHit extends Sprite {
}
}//package
Section 93
//ScoreClip (ScoreClip)
package {
import flash.display.*;
import flash.text.*;
public dynamic class ScoreClip extends Sprite {
public var field:TextField;
}
}//package
Section 94
//Trunk (Trunk)
package {
import flash.display.*;
public dynamic class Trunk extends Sprite {
public var hit:MovieClip;
}
}//package