Section 1
//AuxFunctions (caurina.transitions.AuxFunctions)
package caurina.transitions {
public class AuxFunctions {
public static function numberToR(_arg1:Number):Number{
return (((_arg1 & 0xFF0000) >> 16));
}
public static function numberToG(_arg1:Number):Number{
return (((_arg1 & 0xFF00) >> 8));
}
public static function numberToB(_arg1:Number):Number{
return ((_arg1 & 0xFF));
}
public static function isInArray(_arg1:String, _arg2:Array):Boolean{
var _local3:uint = _arg2.length;
var _local4:uint;
while (_local4 < _local3) {
if (_arg2[_local4] == _arg1){
return (true);
};
_local4++;
};
return (false);
}
public static function getObjectLength(_arg1:Object):uint{
var _local3:String;
var _local2:uint;
for (_local3 in _arg1) {
_local2++;
};
return (_local2);
}
public static function 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 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 easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((_arg3 * _arg1) / _arg4) + _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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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));
}
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 = (_arg1 - 1);
return ((-(((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _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 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 = (_arg1 - 1);
return (((-0.5 * ((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2));
};
_arg1 = (_arg1 - 1);
return ((((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) * 0.5) + _arg3) + _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 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 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 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 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 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 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 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 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));
}
}
}//package caurina.transitions
Section 3
//PropertyInfoObj (caurina.transitions.PropertyInfoObj)
package caurina.transitions {
public class PropertyInfoObj {
public var valueStart:Number;
public var valueComplete:Number;
public var originalValueComplete:Object;
public var arrayIndex:Number;
public var extra:Object;
public var isSpecialProperty:Boolean;
public var hasModifier:Boolean;
public var modifierFunction:Function;
public var modifierParameters:Array;
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 clone():PropertyInfoObj{
var _local1:PropertyInfoObj = new PropertyInfoObj(valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, modifierFunction, modifierParameters);
return (_local1);
}
public function toString():String{
var _local1:String = "\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);
}
}
}//package caurina.transitions
Section 4
//SpecialProperty (caurina.transitions.SpecialProperty)
package caurina.transitions {
public class SpecialProperty {
public var getValue:Function;
public var setValue:Function;
public var parameters:Array;
public var preProcess:Function;
public function SpecialProperty(_arg1:Function, _arg2:Function, _arg3:Array=null, _arg4:Function=null){
getValue = _arg1;
setValue = _arg2;
parameters = _arg3;
preProcess = _arg4;
}
public function toString():String{
var _local1:String = "";
_local1 = (_local1 + "[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 modifyValues:Function;
public var getValue:Function;
public function SpecialPropertyModifier(_arg1:Function, _arg2:Function){
modifyValues = _arg1;
getValue = _arg2;
}
public function toString():String{
var _local1:String = "";
_local1 = (_local1 + "[SpecialPropertyModifier ");
_local1 = (_local1 + ("modifyValues:" + String(modifyValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 6
//SpecialPropertySplitter (caurina.transitions.SpecialPropertySplitter)
package caurina.transitions {
public class SpecialPropertySplitter {
public var parameters:Array;
public var splitValues:Function;
public function SpecialPropertySplitter(_arg1:Function, _arg2:Array){
splitValues = _arg1;
parameters = _arg2;
}
public function toString():String{
var _local1:String = "";
_local1 = (_local1 + "[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.display.*;
import flash.events.*;
import flash.utils.*;
public class Tweener {
private static var __tweener_controller__:MovieClip;
private static var _engineExists:Boolean = false;
private static var _inited:Boolean = false;
private static var _currentTime:Number;
private static var _currentTimeFrame:Number;
private static var _tweenList:Array;
private static var _timeScale:Number = 1;
private static var _transitionList:Object;
private static var _specialPropertyList:Object;
private static var _specialPropertyModifierList:Object;
private static var _specialPropertySplitterList:Object;
public function Tweener(){
trace("Tweener is a static class and should not be instantiated.");
}
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 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 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 removeTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(removeTweenByIndex, _arg1, _local3));
}
public static function 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 pauseTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(pauseTweenByIndex, _arg1, _local3));
}
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 resumeTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(resumeTweenByIndex, _arg1, _local3));
}
public static function 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 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 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));
}
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 removeTweenByIndex(_arg1:Number, _arg2:Boolean=false):Boolean{
_tweenList[_arg1] = null;
if (_arg2){
_tweenList.splice(_arg1, 1);
};
return (true);
}
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 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);
}
private static function updateTweenByIndex(_arg1:Number):Boolean{
var tTweening:TweenListObj;
var mustUpdate:Boolean;
var nv:Number;
var t:Number;
var b:Number;
var c:Number;
var d:Number;
var pName:String;
var eventScope:Object;
var tScope:Object;
var tProperty:Object;
var pv:Number;
var i = _arg1;
tTweening = _tweenList[i];
if ((((tTweening == null)) || (!(Boolean(tTweening.scope))))){
return (false);
};
var isOver:Boolean;
var cTime:Number = getCurrentTweeningTime(tTweening);
if (cTime >= tTweening.timeStart){
tScope = tTweening.scope;
if (tTweening.isCaller){
do {
t = (((tTweening.timeComplete - tTweening.timeStart) / tTweening.count) * (tTweening.timesCalled + 1));
b = tTweening.timeStart;
c = (tTweening.timeComplete - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d);
} while (!(cTime >= nv));
} else {
mustUpdate = (((((tTweening.skipUpdates < 1)) || (!(tTweening.skipUpdates)))) || ((tTweening.updatesSkipped >= tTweening.skipUpdates)));
if (cTime >= tTweening.timeComplete){
isOver = true;
mustUpdate = true;
};
if (!(tTweening.hasStarted)){
if (Boolean(tTweening.onStart)){
eventScope = (Boolean(tTweening.onStartScope)) ? tTweening.onStartScope : tScope;
try {
tTweening.onStart.apply(eventScope, tTweening.onStartParams);
} catch(e:Error) {
handleError(tTweening, e, "onStart");
};
};
for (pName in tTweening.properties) {
if (tTweening.properties[pName].isSpecialProperty){
if (Boolean(_specialPropertyList[pName].preProcess)){
tTweening.properties[pName].valueComplete = _specialPropertyList[pName].preProcess(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].originalValueComplete, tTweening.properties[pName].extra);
};
pv = _specialPropertyList[pName].getValue(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
pv = tScope[pName];
};
tTweening.properties[pName].valueStart = (isNaN(pv)) ? tTweening.properties[pName].valueComplete : pv;
};
mustUpdate = true;
tTweening.hasStarted = true;
};
if (mustUpdate){
for (pName in tTweening.properties) {
tProperty = tTweening.properties[pName];
if (isOver){
nv = tProperty.valueComplete;
} else {
if (tProperty.hasModifier){
t = (cTime - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, 0, 1, d, tTweening.transitionParams);
nv = tProperty.modifierFunction(tProperty.valueStart, tProperty.valueComplete, nv, tProperty.modifierParameters);
} else {
t = (cTime - tTweening.timeStart);
b = tProperty.valueStart;
c = (tProperty.valueComplete - tProperty.valueStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d, tTweening.transitionParams);
};
};
if (tTweening.rounded){
nv = Math.round(nv);
};
if (tProperty.isSpecialProperty){
_specialPropertyList[pName].setValue(tScope, nv, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
tScope[pName] = nv;
};
};
tTweening.updatesSkipped = 0;
if (Boolean(tTweening.onUpdate)){
eventScope = (Boolean(tTweening.onUpdateScope)) ? tTweening.onUpdateScope : tScope;
try {
tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams);
} catch(e:Error) {
handleError(tTweening, e, "onUpdate");
};
};
} else {
tTweening.updatesSkipped++;
};
};
if (((isOver) && (Boolean(tTweening.onComplete)))){
eventScope = (Boolean(tTweening.onCompleteScope)) ? tTweening.onCompleteScope : tScope;
try {
tTweening.onComplete.apply(eventScope, tTweening.onCompleteParams);
} catch(e:Error) {
handleError(tTweening, e, "onComplete");
};
};
return (!(isOver));
};
return (true);
}
public static function init(... _args):void{
_inited = true;
_transitionList = new Object();
Equations.init();
_specialPropertyList = new Object();
_specialPropertyModifierList = new Object();
_specialPropertySplitterList = new Object();
}
public static function registerTransition(_arg1:String, _arg2:Function):void{
if (!(_inited)){
init();
};
_transitionList[_arg1] = _arg2;
}
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 registerSpecialPropertyModifier(_arg1:String, _arg2:Function, _arg3:Function):void{
if (!(_inited)){
init();
};
var _local4:SpecialPropertyModifier = new SpecialPropertyModifier(_arg2, _arg3);
_specialPropertyModifierList[_arg1] = _local4;
}
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;
}
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();
}
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 updateTime():void{
_currentTime = getTimer();
}
public static function updateFrame():void{
_currentTimeFrame++;
}
public static function onEnterFrame(_arg1:Event):void{
updateTime();
updateFrame();
var _local2:Boolean;
_local2 = updateTweens();
if (!(_local2)){
stopEngine();
};
}
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 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 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 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 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()));
};
};
}
public static function getCurrentTweeningTime(_arg1:Object):Number{
return ((_arg1.useFrames) ? _currentTimeFrame : _currentTime);
}
public static function getVersion():String{
return ("AS3 1.31.71");
}
public static function printError(_arg1:String):void{
trace(("## [Tweener] Error: " + _arg1));
}
}
}//package caurina.transitions
Section 8
//TweenListObj (caurina.transitions.TweenListObj)
package caurina.transitions {
public class TweenListObj {
public var scope:Object;
public var properties:Object;
public var timeStart:Number;
public var timeComplete:Number;
public var useFrames:Boolean;
public var transition:Function;
public var transitionParams:Object;
public var onStart:Function;
public var onUpdate:Function;
public var onComplete:Function;
public var onOverwrite:Function;
public var onError:Function;
public var onStartParams:Array;
public var onUpdateParams:Array;
public var onCompleteParams:Array;
public var onOverwriteParams:Array;
public var onStartScope:Object;
public var onUpdateScope:Object;
public var onCompleteScope:Object;
public var onOverwriteScope:Object;
public var onErrorScope:Object;
public var rounded:Boolean;
public var isPaused:Boolean;
public var timePaused:Number;
public var isCaller:Boolean;
public var count:Number;
public var timesCalled:Number;
public var waitFrames:Boolean;
public var skipUpdates:Number;
public var updatesSkipped:Number;
public var hasStarted:Boolean;
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:String = "\n[TweenListObj ";
_local1 = (_local1 + ("scope:" + String(scope)));
_local1 = (_local1 + ", properties:");
var _local2:Boolean = true;
for (_local3 in properties) {
if (!(_local2)){
_local1 = (_local1 + ",");
};
_local1 = (_local1 + ("[name:" + properties[_local3].name));
_local1 = (_local1 + (",valueStart:" + properties[_local3].valueStart));
_local1 = (_local1 + (",valueComplete:" + properties[_local3].valueComplete));
_local1 = (_local1 + "]");
_local2 = false;
};
_local1 = (_local1 + (", timeStart:" + String(timeStart)));
_local1 = (_local1 + (", timeComplete:" + String(timeComplete)));
_local1 = (_local1 + (", useFrames:" + String(useFrames)));
_local1 = (_local1 + (", transition:" + String(transition)));
_local1 = (_local1 + (", transitionParams:" + String(transitionParams)));
if (skipUpdates){
_local1 = (_local1 + (", skipUpdates:" + String(skipUpdates)));
};
if (updatesSkipped){
_local1 = (_local1 + (", updatesSkipped:" + String(updatesSkipped)));
};
if (Boolean(onStart)){
_local1 = (_local1 + (", onStart:" + String(onStart)));
};
if (Boolean(onUpdate)){
_local1 = (_local1 + (", onUpdate:" + String(onUpdate)));
};
if (Boolean(onComplete)){
_local1 = (_local1 + (", onComplete:" + String(onComplete)));
};
if (Boolean(onOverwrite)){
_local1 = (_local1 + (", onOverwrite:" + String(onOverwrite)));
};
if (Boolean(onError)){
_local1 = (_local1 + (", onError:" + String(onError)));
};
if (onStartParams){
_local1 = (_local1 + (", onStartParams:" + String(onStartParams)));
};
if (onUpdateParams){
_local1 = (_local1 + (", onUpdateParams:" + String(onUpdateParams)));
};
if (onCompleteParams){
_local1 = (_local1 + (", onCompleteParams:" + String(onCompleteParams)));
};
if (onOverwriteParams){
_local1 = (_local1 + (", onOverwriteParams:" + String(onOverwriteParams)));
};
if (onStartScope){
_local1 = (_local1 + (", onStartScope:" + String(onStartScope)));
};
if (onUpdateScope){
_local1 = (_local1 + (", onUpdateScope:" + String(onUpdateScope)));
};
if (onCompleteScope){
_local1 = (_local1 + (", onCompleteScope:" + String(onCompleteScope)));
};
if (onOverwriteScope){
_local1 = (_local1 + (", onOverwriteScope:" + String(onOverwriteScope)));
};
if (onErrorScope){
_local1 = (_local1 + (", onErrorScope:" + String(onErrorScope)));
};
if (rounded){
_local1 = (_local1 + (", rounded:" + String(rounded)));
};
if (isPaused){
_local1 = (_local1 + (", isPaused:" + String(isPaused)));
};
if (timePaused){
_local1 = (_local1 + (", timePaused:" + String(timePaused)));
};
if (isCaller){
_local1 = (_local1 + (", isCaller:" + String(isCaller)));
};
if (count){
_local1 = (_local1 + (", count:" + String(count)));
};
if (timesCalled){
_local1 = (_local1 + (", timesCalled:" + String(timesCalled)));
};
if (waitFrames){
_local1 = (_local1 + (", waitFrames:" + String(waitFrames)));
};
if (hasStarted){
_local1 = (_local1 + (", hasStarted:" + String(hasStarted)));
};
_local1 = (_local1 + "]\n");
return (_local1);
}
public static function makePropertiesChain(_arg1:Object):Object{
var _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
//BigAssCanvas (com.bit101.display.BigAssCanvas)
package com.bit101.display {
import flash.display.*;
import flash.geom.*;
public class BigAssCanvas extends Sprite {
private var _bitmaps:Array;
private var _width:Number;
private var _height:Number;
private var _transparent:Boolean;
private var _color:uint;
public function BigAssCanvas(_arg1:Number, _arg2:Number, _arg3:Boolean=false, _arg4:uint=0xFFFFFF){
_width = _arg1;
_height = _arg2;
_transparent = _arg3;
_color = _arg4;
makeBitmaps();
}
private function makeBitmaps():void{
var _local3:Number;
var _local4:Number;
var _local5:Bitmap;
_bitmaps = new Array();
var _local1:Number = _height;
var _local2:Number = 0;
while (_local1 > 0) {
_local3 = 0;
_local4 = _width;
while (_local4 > 0) {
_local5 = new Bitmap(new BitmapData(Math.min(2880, _local4), Math.min(2880, _local1), _transparent, _color));
_local5.x = _local3;
_local5.y = _local2;
addChild(_local5);
_bitmaps.push(_local5);
_local4 = (_local4 - _local5.width);
_local3 = (_local3 + _local5.width);
};
_local2 = (_local2 + Math.min(2880, _local1));
_local1 = (_local1 - Math.min(2880, _local1));
};
}
public function draw(_arg1:IBitmapDrawable, _arg2:Matrix=null, _arg3:ColorTransform=null, _arg4:String=null, _arg5:Rectangle=null, _arg6:Boolean=false):void{
var _local8:Bitmap;
var _local9:Matrix;
var _local10:Rectangle;
if (_arg2 == null){
_arg2 = new Matrix();
};
var _local7:int;
while (_local7 < _bitmaps.length) {
_local8 = (_bitmaps[_local7] as Bitmap);
_local9 = _arg2.clone();
_local9.tx = (_local9.tx - _local8.x);
_local9.ty = (_local9.ty - _local8.y);
if (_arg5 != null){
_local10 = _arg5.clone();
_local10.x = (_local10.x - _local8.x);
_local10.y = (_local10.y - _local8.y);
} else {
_local10 = null;
};
_local8.bitmapData.draw(_arg1, _local9, _arg3, _arg4, _local10, _arg6);
_local7++;
};
}
public function dispose():void{
var _local1:Bitmap;
while (_bitmaps.length > 0) {
_local1 = (_bitmaps.shift() as Bitmap);
removeChild(_local1);
_local1.bitmapData.dispose();
};
}
public function fillRect(_arg1:Rectangle, _arg2:uint):void{
var _local4:Bitmap;
var _local5:Rectangle;
var _local3:int;
while (_local3 < _bitmaps.length) {
_local4 = (_bitmaps[_local3] as Bitmap);
_local5 = _arg1.clone();
_local5.x = (_local5.x - _local4.x);
_local5.y = (_local5.y - _local4.y);
_local4.bitmapData.fillRect(_local5, _arg2);
_local3++;
};
}
public function copyPixelsOut(_arg1:Rectangle, _arg2:Boolean=true, _arg3:uint=4278190080):BitmapData{
var _local6:Bitmap;
var _local7:Rectangle;
var _local4:BitmapData = new BitmapData(_arg1.width, _arg1.height, true, _arg3);
var _local5:int;
while (_local5 < _bitmaps.length) {
_local6 = (_bitmaps[_local5] as Bitmap);
_local7 = _arg1.clone();
_local7.x = (_local7.x - _local6.x);
_local7.y = (_local7.y - _local6.y);
if (_local7.intersects(new Rectangle(0, 0, 2880, 2880))){
_local4.copyPixels(_local6.bitmapData, _local7, new Point());
};
_local5++;
};
return (_local4);
}
public function getPixel(_arg1:Number, _arg2:Number):uint{
var _local4:Bitmap;
var _local3:int;
while (_local3 < _bitmaps.length) {
_local4 = (_bitmaps[_local3] as Bitmap);
if ((((((((_arg1 >= _local4.x)) && ((_arg1 < (_local4.x + _local4.width))))) && ((_arg2 >= _local4.y)))) && ((_arg2 < (_local4.y + _local4.height))))){
return (_local4.bitmapData.getPixel((_arg1 - _local4.x), (_arg2 - _local4.y)));
};
_local3++;
};
return (0);
}
public function setPixel(_arg1:Number, _arg2:Number, _arg3:uint):void{
var _local5:Bitmap;
var _local4:int;
while (_local4 < _bitmaps.length) {
_local5 = (_bitmaps[_local4] as Bitmap);
if ((((((((_arg1 >= _local5.x)) && ((_arg1 < (_local5.x + _local5.width))))) && ((_arg2 >= _local5.y)))) && ((_arg2 < (_local5.y + _local5.height))))){
_local5.bitmapData.setPixel(Math.round((_arg1 - _local5.x)), Math.round((_arg2 - _local5.y)), _arg3);
};
_local4++;
};
}
public function getPixel32(_arg1:Number, _arg2:Number):uint{
var _local4:Bitmap;
var _local3:int;
while (_local3 < _bitmaps.length) {
_local4 = (_bitmaps[_local3] as Bitmap);
if ((((((((_arg1 >= _local4.x)) && ((_arg1 < (_local4.x + _local4.width))))) && ((_arg2 >= _local4.y)))) && ((_arg2 < (_local4.y + _local4.height))))){
return (_local4.bitmapData.getPixel32((_arg1 - _local4.x), (_arg2 - _local4.y)));
};
_local3++;
};
return (0);
}
public function setPixel32(_arg1:Number, _arg2:Number, _arg3:uint):void{
var _local5:Bitmap;
var _local4:int;
while (_local4 < _bitmaps.length) {
_local5 = (_bitmaps[_local4] as Bitmap);
if ((((((((_arg1 >= _local5.x)) && ((_arg1 < (_local5.x + _local5.width))))) && ((_arg2 >= _local5.y)))) && ((_arg2 < (_local5.y + _local5.height))))){
_local5.bitmapData.setPixel32((_arg1 - _local5.x), (_arg2 - _local5.y), _arg3);
};
_local4++;
};
}
public function noise(_arg1:int, _arg2:uint=0, _arg3:uint=0xFF, _arg4:uint=7, _arg5:Boolean=false):void{
var _local7:Bitmap;
var _local6:int;
while (_local6 < _bitmaps.length) {
_local7 = (_bitmaps[_local6] as Bitmap);
_local7.bitmapData.noise(_arg1, _arg2, _arg3, _arg4, _arg5);
_local6++;
};
}
public function perlinNoise(_arg1:Number, _arg2:Number, _arg3:uint, _arg4:int, _arg5:Boolean, _arg6:uint=7, _arg7:Boolean=false):void{
var _local10:Bitmap;
var _local11:Array;
var _local12:int;
var _local8:Array = new Array();
var _local9:int;
while (_local9 < _arg3) {
_local8.push(new Point());
_local9++;
};
_local9 = 0;
while (_local9 < _bitmaps.length) {
_local10 = (_bitmaps[_local9] as Bitmap);
_local11 = new Array();
_local12 = 0;
while (_local12 < _local8.length) {
_local11[_local12] = new Point((_local8[_local12].x + _local10.x), (_local8[_local12].y + _local10.y));
_local12++;
};
_local10.bitmapData.perlinNoise(_arg1, _arg2, _arg3, _arg4, false, _arg5, _arg6, _arg7, _local11);
_local9++;
};
}
public function lock():void{
var _local2:Bitmap;
var _local1:int;
while (_local1 < _bitmaps.length) {
_local2 = (_bitmaps[_local1] as Bitmap);
_local2.bitmapData.lock();
_local1++;
};
}
public function unlock():void{
var _local2:Bitmap;
var _local1:int;
while (_local1 < _bitmaps.length) {
_local2 = (_bitmaps[_local1] as Bitmap);
_local2.bitmapData.unlock();
_local1++;
};
}
}
}//package com.bit101.display
Section 10
//ProcessEvent (com.touchmypixel.events.ProcessEvent)
package com.touchmypixel.events {
import flash.events.*;
public class ProcessEvent extends Event {
public var percentage:Number;// = 0
public static const START = "Process.Start";
public static const PROGRESS = "Process.Progress";
public static const COMPLETE = "Process.Complete";
public function ProcessEvent(_arg1:String, _arg2:Number=0, _arg3:Boolean=false, _arg4:Boolean=false){
this.percentage = _arg2;
if (_arg1 == COMPLETE){
this.percentage = 1;
};
super(_arg1, _arg3, _arg4);
}
}
}//package com.touchmypixel.events
Section 11
//Animation (com.touchmypixel.peepee.utils.Animation)
package com.touchmypixel.peepee.utils {
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import com.bit101.display.*;
import flash.events.*;
public class Animation extends Sprite {
public var bitmap:Bitmap;
public var clip:MovieClip;
public var frames:Array;
public var currentFrame:Number;// = 1
private var _playing:Boolean;// = false
private var _cache:Boolean;// = true
public var repeat:Boolean;// = true
public var onEnd:Function;
public var destroyOnEnd:Boolean;// = false
private var clipData:MovieClip;
public var reverse:Boolean;// = false
public var speed:Number;// = 1
public var treatAsLoopedGraphic:Boolean;// = false
public var bigBitmap:BigAssCanvas;
public var cols:Number;// = 0
public var rows:Number;// = 0
public var r:Rectangle;
private var _totalFrames;
public var useSpriteSheet:Boolean;// = false
public var useTypedElements:Boolean;// = true
public var typeNum:int;// = 1
public function Animation(){
frames = [];
super();
bitmap = new Bitmap();
bitmap.smoothing = false;
addChild(bitmap);
}
public function set bitmapData(_arg1:BitmapData){
bitmap.bitmapData = _arg1;
}
public function get bitmapData():BitmapData{
return (bitmap.bitmapData);
}
public function get playing():Boolean{
return (_playing);
}
public function get totalFrames():Number{
return (clip.totalFrames);
}
public function buildCacheFromLibrary(_arg1:String, _arg2:int=0):void{
if (_arg2 != 0){
useTypedElements = true;
typeNum = _arg2;
};
if (useSpriteSheet){
buildCacheFromClip2(new (getDefinitionByName(_arg1)));
} else {
buildCacheFromClip(new (getDefinitionByName(_arg1)));
};
}
public function buildCacheFromClip(_arg1:MovieClip):void{
var c:*;
var bitmapData:BitmapData;
var m:Matrix;
var _clip = _arg1;
clip = _clip;
if (clip["e_bounds"] != null){
c = clip["e_bounds"];
r = new Rectangle(c.x, c.y, c.width, c.height);
clip["e_bounds"].visible = false;
} else {
r = clip.getRect(clip);
};
var i:* = 1;
while (i <= clip.totalFrames) {
clip.gotoAndStop(i);
makeAllChildrenGoToFrame(clip, i);
try {
bitmapData = new BitmapData(r.width, r.height, true, 0);
m = new Matrix();
m.translate(-(r.x), -(r.y));
m.scale(clip.scaleX, clip.scaleY);
bitmapData.draw(clip, m);
frames.push(bitmapData);
} catch(e:Error) {
trace(((((((("Animation: " + e) + " clip:") + _clip) + " ") + r.width) + " ") + r.height));
};
i = (i + 1);
};
bitmap.x = r.x;
bitmap.y = r.y;
}
public function buildCacheFromClip2(_arg1:MovieClip):void{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:Matrix;
clip = _arg1;
if (clip["e_bounds"] != null){
_local3 = clip["e_bounds"];
r = new Rectangle(_local3.x, _local3.y, _local3.width, _local3.height);
clip["e_bounds"].visible = false;
} else {
r = clip.getRect(clip);
};
cols = Math.floor((2880 / r.width));
rows = Math.ceil((clip.totalFrames / cols));
bigBitmap = new BigAssCanvas(Math.ceil((cols * clip.width)), Math.ceil((rows * clip.height)), true);
var _local2:* = 0;
while (_local2 <= (clip.totalFrames - 1)) {
clip.gotoAndStop((_local2 + 1));
makeAllChildrenGoToFrame(clip, (_local2 + 1));
_local4 = ((_local2 % cols) * r.width);
_local5 = (Math.floor((_local2 / cols)) * r.height);
_local6 = new Matrix();
_local6.translate(-(r.x), -(r.y));
_local6.scale(clip.scaleX, clip.scaleY);
_local6.translate(_local4, _local5);
bigBitmap.draw(clip, _local6, null, null);
_local2++;
};
_totalFrames = clip.totalFrames;
}
private function makeAllChildrenGoToFrame(_arg1:MovieClip, _arg2:int):void{
var _local4:*;
var _local3:int;
while (_local3 < _arg1.numChildren) {
_local4 = _arg1.getChildAt(_local3);
if ((((useTypedElements == true)) && ((_local4 is TypedAnimElement)))){
_local4.gotoAndStop(typeNum);
} else {
if ((_local4 is MovieClip)){
makeAllChildrenGoToFrame(_local4, _arg2);
_local4.gotoAndStop(_arg2);
};
};
_local3++;
};
}
public function play():void{
_playing = true;
addEventListener(Event.ENTER_FRAME, enterFrame, false, 0, true);
}
public function stop():void{
_playing = false;
removeEventListener(Event.ENTER_FRAME, enterFrame);
}
public function gotoAndStop(_arg1:Number):void{
if (treatAsLoopedGraphic){
if (_arg1 > totalFrames){
_arg1 = (_arg1 % totalFrames);
};
};
currentFrame = _arg1;
goto(currentFrame);
stop();
}
public function gotoAndPlay(_arg1:Number):void{
currentFrame = _arg1;
goto(currentFrame);
play();
}
public function gotoAndPlayRandomFrame():void{
gotoAndPlay(Math.ceil((Math.random() * totalFrames)));
}
public function nextFrame(_arg1:Boolean=false):void{
if (_arg1){
currentFrame = (currentFrame + speed);
} else {
currentFrame++;
};
if (currentFrame > totalFrames){
currentFrame = 1;
};
goto(currentFrame);
}
public function prevFrame(_arg1:Boolean=false):void{
if (_arg1){
currentFrame = (currentFrame - speed);
} else {
currentFrame--;
};
if (currentFrame < 1){
currentFrame = totalFrames;
};
goto(currentFrame);
}
private function goto(_arg1:Number):void{
var _local2:*;
var _local3:Rectangle;
var _local4:Rectangle;
if (!(_cache)){
if (!(clipData)){
_local2 = getQualifiedClassName(clip);
clipData = new (getDefinitionByName(_local2));
_local3 = clipData.getRect(clipData);
clipData.x = _local3.x;
clipData.y = _local3.y;
addChild(clipData);
};
clipData.gotoAndStop(int(_arg1));
} else {
if (useSpriteSheet){
_local4 = r.clone();
_local4.x = (((currentFrame - 1) % cols) * r.width);
_local4.y = (Math.floor(((currentFrame - 1) / cols)) * r.height);
if (bitmapData){
bitmapData.dispose();
};
bitmapData = bigBitmap.copyPixelsOut(_local4);
bitmap.bitmapData = bitmapData;
bitmap.smoothing = true;
} else {
bitmap.bitmapData = frames[(int(currentFrame) - 1)];
bitmap.smoothing = true;
};
};
}
public function enterFrame(_arg1:Event=null):void{
if (reverse){
prevFrame(true);
} else {
nextFrame(true);
};
if (currentFrame >= totalFrames){
if (!(repeat)){
stop();
};
dispatchEvent(new Event(Event.COMPLETE));
if (onEnd != null){
onEnd();
};
if (destroyOnEnd == true){
destroy();
};
};
}
public function update():void{
stop();
frames = [];
buildCacheFromClip(clip);
}
public function destroy(){
stop();
if (parent){
parent.removeChild(this);
};
}
}
}//package com.touchmypixel.peepee.utils
Section 12
//AnimationCache (com.touchmypixel.peepee.utils.AnimationCache)
package com.touchmypixel.peepee.utils {
import com.touchmypixel.events.*;
import flash.utils.*;
import flash.events.*;
public class AnimationCache extends EventDispatcher {
public var cacheQueue:Array;
public var currentlyProcessingItem:uint;// = 0
public var replaceExisting:Boolean;// = false
private var animations:Object;
private static var instance:AnimationCache;
public function AnimationCache(){
cacheQueue = [];
animations = {};
super();
if (AnimationCache.instance){
throw (new Error("AnimationCache is a Singleton. Don't Instantiate!"));
};
instance = this;
}
public function isAnimation(_arg1:String):Boolean{
if (animations[_arg1]){
return (true);
};
return (false);
}
public function cacheAnimation(_arg1:String, _arg2:Boolean=false):Animation{
var _local3:Animation;
if (((!(animations[_arg1])) || (replaceExisting))){
_local3 = new Animation();
_local3.useSpriteSheet = _arg2;
_local3.buildCacheFromLibrary(_arg1);
animations[_arg1] = _local3;
} else {
_local3 = animations[_arg1];
};
return (_local3);
}
public function cacheTypedAnimation(_arg1:String, _arg2:int, _arg3:Boolean=false):void{
var _local5:String;
var _local6:Animation;
var _local4:int = 1;
while (_local4 <= _arg2) {
_local5 = ((_arg1 + "T") + _local4);
if (((!(animations[_local5])) || (replaceExisting))){
_local6 = new Animation();
_local6.useSpriteSheet = _arg3;
_local6.buildCacheFromLibrary(_arg1, _local4);
animations[_local5] = _local6;
} else {
_local6 = animations[_local5];
};
_local4++;
};
}
public function getAnimation(_arg1):Animation{
if (!(animations[_arg1])){
return (getAnimation("GE_NoAnimation"));
};
var _local2:Animation = new Animation();
_local2.frames = animations[_arg1].frames;
_local2.bigBitmap = animations[_arg1].bigBitmap;
_local2.bitmap.x = animations[_arg1].bitmap.x;
_local2.bitmap.y = animations[_arg1].bitmap.y;
_local2.cols = animations[_arg1].cols;
_local2.rows = animations[_arg1].rows;
_local2.r = animations[_arg1].r;
_local2.clip = animations[_arg1].clip;
_local2.useSpriteSheet = animations[_arg1].useSpriteSheet;
_local2.gotoAndStop(1);
return (_local2);
}
public function addToBulkCache(_arg1:Array){
var _local2:*;
for each (_local2 in _arg1) {
cacheQueue.push(_local2);
};
}
public function processQueue(){
currentlyProcessingItem = 0;
dispatchEvent(new ProcessEvent(ProcessEvent.START));
process();
}
private function process():void{
var _local1:* = cacheQueue[currentlyProcessingItem++];
if (_local1 != null){
cacheAnimation(_local1);
dispatchEvent(new ProcessEvent(ProcessEvent.PROGRESS, (currentlyProcessingItem / cacheQueue.length)));
setTimeout(process, 1);
} else {
dispatchEvent(new ProcessEvent(ProcessEvent.COMPLETE));
cacheQueue = [];
};
}
public static function getInstance():AnimationCache{
return ((!(instance)) ? new (AnimationCache) : instance);
}
}
}//package com.touchmypixel.peepee.utils
Section 13
//AdLoader (CPMStar.AdLoader)
package CPMStar {
import flash.events.*;
import flash.system.*;
import flash.display.*;
import flash.net.*;
public class AdLoader extends Sprite {
private var cpmstarLoader:Loader;
private var contentspotid:String;
public function AdLoader(_arg1:String){
this.contentspotid = _arg1;
addEventListener(Event.ADDED, addedHandler, false, 0, true);
}
private function addedHandler(_arg1:Event):void{
removeEventListener(Event.ADDED, addedHandler);
addEventListener(Event.REMOVED, removedHandler, false, 0, true);
Security.allowDomain("server.cpmstar.com");
var _local2:String = "http://server.cpmstar.com/adviewas3.swf";
var _local3:DisplayObjectContainer = parent;
cpmstarLoader = new Loader();
cpmstarLoader.contentLoaderInfo.addEventListener(Event.INIT, dispatchInitHandler);
cpmstarLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dispatchCompleteHandler);
cpmstarLoader.contentLoaderInfo.addEventListener(Event.OPEN, openHandler);
cpmstarLoader.load(new URLRequest(((_local2 + "?contentspotid=") + contentspotid)));
addChild(cpmstarLoader);
}
private function removedHandler(_arg1:Event):void{
if (((!((cpmstarLoader == null))) && (!((cpmstarLoader.contentLoaderInfo == null))))){
cpmstarLoader.contentLoaderInfo.removeEventListener(Event.INIT, dispatchInitHandler);
cpmstarLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, dispatchCompleteHandler);
cpmstarLoader.contentLoaderInfo.removeEventListener(Event.OPEN, openHandler);
};
}
private function dispatchInitHandler(_arg1:Event):void{
dispatchEvent(_arg1);
}
private function dispatchCompleteHandler(_arg1:Event):void{
dispatchEvent(_arg1);
}
private function openHandler(_arg1:Event):void{
dispatchEvent(_arg1);
}
}
}//package CPMStar
Section 14
//AppleDown01_246 (Kaban_fla.AppleDown01_246)
package Kaban_fla {
import flash.display.*;
public dynamic class AppleDown01_246 extends MovieClip {
public function AppleDown01_246(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package Kaban_fla
Section 15
//AssetHolder_11 (Kaban_fla.AssetHolder_11)
package Kaban_fla {
import flash.display.*;
public dynamic class AssetHolder_11 extends MovieClip {
public function AssetHolder_11(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Kaban_fla
Section 16
//Bubble01_238 (Kaban_fla.Bubble01_238)
package Kaban_fla {
import flash.display.*;
public dynamic class Bubble01_238 extends MovieClip {
public function Bubble01_238(){
addFrameScript(12, frame13);
}
function frame13(){
SoundManager.createSound(SndBubble, false, true);
}
}
}//package Kaban_fla
Section 17
//Bubble02_368 (Kaban_fla.Bubble02_368)
package Kaban_fla {
import flash.display.*;
public dynamic class Bubble02_368 extends MovieClip {
public function Bubble02_368(){
addFrameScript(38, frame39);
}
function frame39(){
SoundManager.createSound(SndBubble, false, true);
}
}
}//package Kaban_fla
Section 18
//Effect02_73 (Kaban_fla.Effect02_73)
package Kaban_fla {
import flash.display.*;
public dynamic class Effect02_73 extends MovieClip {
public function Effect02_73(){
addFrameScript(12, frame13);
}
function frame13(){
stop();
}
}
}//package Kaban_fla
Section 19
//Effect03_71 (Kaban_fla.Effect03_71)
package Kaban_fla {
import flash.display.*;
public dynamic class Effect03_71 extends MovieClip {
public function Effect03_71(){
addFrameScript(1, frame2, 16, frame17);
}
function frame2(){
SoundManager.createSound(SndBonus, false, false);
}
function frame17(){
stop();
}
}
}//package Kaban_fla
Section 20
//Effect04_74 (Kaban_fla.Effect04_74)
package Kaban_fla {
import flash.display.*;
public dynamic class Effect04_74 extends MovieClip {
public function Effect04_74(){
addFrameScript(7, frame8);
}
function frame8(){
stop();
}
}
}//package Kaban_fla
Section 21
//EStar_221 (Kaban_fla.EStar_221)
package Kaban_fla {
import flash.display.*;
public dynamic class EStar_221 extends MovieClip {
public function EStar_221(){
addFrameScript(12, frame13);
}
function frame13(){
stop();
}
}
}//package Kaban_fla
Section 22
//Eyelid01_377 (Kaban_fla.Eyelid01_377)
package Kaban_fla {
import flash.display.*;
public dynamic class Eyelid01_377 extends MovieClip {
public function Eyelid01_377(){
addFrameScript(0, frame1, 180, frame181);
}
function frame1(){
gotoAndPlay(int((Math.random() * 180)));
}
function frame181(){
gotoAndPlay("start");
}
}
}//package Kaban_fla
Section 23
//Farmer_87 (Kaban_fla.Farmer_87)
package Kaban_fla {
import flash.display.*;
public dynamic class Farmer_87 extends MovieClip {
public function Farmer_87(){
addFrameScript(1, frame2, 9, frame10);
}
function frame2(){
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
function frame10(){
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
}
}//package Kaban_fla
Section 24
//FPF_126 (Kaban_fla.FPF_126)
package Kaban_fla {
import flash.display.*;
public dynamic class FPF_126 extends MovieClip {
public function FPF_126(){
addFrameScript(1, frame2, 9, frame10);
}
function frame2(){
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
function frame10(){
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
}
}//package Kaban_fla
Section 25
//FPF_127 (Kaban_fla.FPF_127)
package Kaban_fla {
import flash.display.*;
public dynamic class FPF_127 extends MovieClip {
public function FPF_127(){
addFrameScript(1, frame2, 9, frame10);
}
function frame2(){
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
function frame10(){
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
}
}//package Kaban_fla
Section 26
//FPF_128 (Kaban_fla.FPF_128)
package Kaban_fla {
import flash.display.*;
public dynamic class FPF_128 extends MovieClip {
public function FPF_128(){
addFrameScript(1, frame2);
}
function frame2(){
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
}
}//package Kaban_fla
Section 27
//Kaban_162 (Kaban_fla.Kaban_162)
package Kaban_fla {
import flash.display.*;
public dynamic class Kaban_162 extends MovieClip {
public function Kaban_162(){
addFrameScript(0, frame1, 4, frame5);
}
function frame1(){
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
function frame5(){
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
}
}//package Kaban_fla
Section 28
//Kaban_171 (Kaban_fla.Kaban_171)
package Kaban_fla {
import flash.display.*;
public dynamic class Kaban_171 extends MovieClip {
public function Kaban_171(){
addFrameScript(0, frame1, 4, frame5);
}
function frame1(){
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
function frame5(){
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
}
}//package Kaban_fla
Section 29
//Kaban_174 (Kaban_fla.Kaban_174)
package Kaban_fla {
import flash.display.*;
public dynamic class Kaban_174 extends MovieClip {
public function Kaban_174(){
addFrameScript(0, frame1, 4, frame5);
}
function frame1(){
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
function frame5(){
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
}
}//package Kaban_fla
Section 30
//Kaban_181 (Kaban_fla.Kaban_181)
package Kaban_fla {
import flash.display.*;
public dynamic class Kaban_181 extends MovieClip {
public function Kaban_181(){
addFrameScript(0, frame1, 7, frame8);
}
function frame1(){
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
function frame8(){
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
}
}//package Kaban_fla
Section 31
//Kaban_182 (Kaban_fla.Kaban_182)
package Kaban_fla {
import flash.display.*;
public dynamic class Kaban_182 extends MovieClip {
public function Kaban_182(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
function frame2(){
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
}
}//package Kaban_fla
Section 32
//Kaban_183 (Kaban_fla.Kaban_183)
package Kaban_fla {
import flash.display.*;
public dynamic class Kaban_183 extends MovieClip {
public function Kaban_183(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
function frame2(){
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
}
}//package Kaban_fla
Section 33
//Kaban_321 (Kaban_fla.Kaban_321)
package Kaban_fla {
import flash.display.*;
public dynamic class Kaban_321 extends MovieClip {
public function Kaban_321(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
SoundManager.createSound(SndSleep1, false, true);
}
function frame45(){
SoundManager.createSound(SndSleep2, false, true);
}
}
}//package Kaban_fla
Section 34
//Kaban_323 (Kaban_fla.Kaban_323)
package Kaban_fla {
import flash.display.*;
public dynamic class Kaban_323 extends MovieClip {
public function Kaban_323(){
addFrameScript(1, frame2, 20, frame21);
}
function frame2(){
SoundManager.createSound(SndKaban02, false, true);
}
function frame21(){
SoundManager.createSound(SndKaban02, false, true);
}
}
}//package Kaban_fla
Section 35
//Kaban_339 (Kaban_fla.Kaban_339)
package Kaban_fla {
import flash.display.*;
public dynamic class Kaban_339 extends MovieClip {
public function Kaban_339(){
addFrameScript(0, frame1);
}
function frame1(){
SoundManager.createSound(SndKaban03, false, true);
}
}
}//package Kaban_fla
Section 36
//Kaban_340 (Kaban_fla.Kaban_340)
package Kaban_fla {
import flash.display.*;
public dynamic class Kaban_340 extends MovieClip {
public function Kaban_340(){
addFrameScript(12, frame13);
}
function frame13(){
stop();
}
}
}//package Kaban_fla
Section 37
//Kaban_366 (Kaban_fla.Kaban_366)
package Kaban_fla {
import flash.display.*;
public dynamic class Kaban_366 extends MovieClip {
public function Kaban_366(){
addFrameScript(54, frame55, 133, frame134, 232, frame233, 260, frame261);
}
function frame55(){
SoundManager.createSound(SndKaban04, false, true);
}
function frame134(){
SoundManager.createSound(SndKaban04, false, true);
}
function frame233(){
SoundManager.createSound(SndDrunkDown, false, true);
}
function frame261(){
SoundManager.createSound(SndKaban01, false, true);
}
}
}//package Kaban_fla
Section 38
//Kaban_383 (Kaban_fla.Kaban_383)
package Kaban_fla {
import flash.display.*;
public dynamic class Kaban_383 extends MovieClip {
public function Kaban_383(){
addFrameScript(16, frame17);
}
function frame17(){
SoundManager.createSound(SndKaban04, false, true);
}
}
}//package Kaban_fla
Section 39
//Kaban_385 (Kaban_fla.Kaban_385)
package Kaban_fla {
import flash.display.*;
public dynamic class Kaban_385 extends MovieClip {
public function Kaban_385(){
addFrameScript(4, frame5, 32, frame33);
}
function frame5(){
SoundManager.createSound(SndFarmerDrop, false, true);
}
function frame33(){
SoundManager.createSound(SndDrunkDown, false, true);
}
}
}//package Kaban_fla
Section 40
//PowerDown01_219 (Kaban_fla.PowerDown01_219)
package Kaban_fla {
import flash.display.*;
public dynamic class PowerDown01_219 extends MovieClip {
public function PowerDown01_219(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
}
}
}//package Kaban_fla
Section 41
//PowerUp01_218 (Kaban_fla.PowerUp01_218)
package Kaban_fla {
import flash.display.*;
public dynamic class PowerUp01_218 extends MovieClip {
public function PowerUp01_218(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
}
}
}//package Kaban_fla
Section 42
//ScoreArrow_397 (Kaban_fla.ScoreArrow_397)
package Kaban_fla {
import flash.display.*;
public dynamic class ScoreArrow_397 extends MovieClip {
public function ScoreArrow_397(){
addFrameScript(1, frame2, 4, frame5);
}
function frame2(){
SoundManager.createSound(SndScoreCalc, false, true);
}
function frame5(){
SoundManager.createSound(SndScoreCalc, false, true);
}
}
}//package Kaban_fla
Section 43
//Smoke_298 (Kaban_fla.Smoke_298)
package Kaban_fla {
import flash.display.*;
public dynamic class Smoke_298 extends MovieClip {
public function Smoke_298(){
addFrameScript(19, frame20);
}
function frame20(){
if (parent){
parent.removeChild(this);
};
}
}
}//package Kaban_fla
Section 44
//Stars01_135 (Kaban_fla.Stars01_135)
package Kaban_fla {
import flash.display.*;
public dynamic class Stars01_135 extends MovieClip {
public function Stars01_135(){
addFrameScript(0, frame1);
}
function frame1(){
SoundManager.createSound(SndStars, false, true);
}
}
}//package Kaban_fla
Section 45
//State_225 (Kaban_fla.State_225)
package Kaban_fla {
import flash.display.*;
public dynamic class State_225 extends MovieClip {
public function State_225(){
addFrameScript(74, frame75);
}
function frame75(){
gotoAndPlay("down");
}
}
}//package Kaban_fla
Section 46
//State_266 (Kaban_fla.State_266)
package Kaban_fla {
import flash.display.*;
public dynamic class State_266 extends MovieClip {
public function State_266(){
addFrameScript(293, frame294);
}
function frame294(){
gotoAndPlay("sit");
}
}
}//package Kaban_fla
Section 47
//State_282 (Kaban_fla.State_282)
package Kaban_fla {
import flash.events.*;
import flash.display.*;
public dynamic class State_282 extends MovieClip {
public function State_282(){
addFrameScript(0, frame1, 23, frame24, 67, frame68, 68, frame69, 147, frame148);
}
function frame1(){
SoundManager.stopSound(SndKabanEat);
SoundManager.createSound(SndFly, true, true);
}
function frame24(){
SoundManager.createSound(SndKabanEat, false, true);
}
function frame68(){
gotoAndPlay("eat");
}
function frame69(){
SoundManager.stopSound(SndKabanEat);
SoundManager.createSound(SndSwarm);
SoundManager.createSound(SndKaban02);
}
function frame148(){
stop();
if (((parent) && (parent.parent))){
parent.parent.dispatchEvent(new Event("BEGIN_LEVEL"));
};
}
}
}//package Kaban_fla
Section 48
//State_300 (Kaban_fla.State_300)
package Kaban_fla {
import flash.events.*;
import flash.display.*;
public dynamic class State_300 extends MovieClip {
public function State_300(){
addFrameScript(0, frame1, 23, frame24, 67, frame68, 68, frame69, 117, frame118, 168, frame169);
}
function frame1(){
SoundManager.stopSound(SndKabanEat);
}
function frame24(){
SoundManager.createSound(SndKabanEat, false, true);
}
function frame68(){
gotoAndPlay("eat");
}
function frame69(){
SoundManager.stopSound(SndKabanEat);
SoundManager.createSound(SndKabanPuzo);
}
function frame118(){
SoundManager.createSound(SndPuk);
}
function frame169(){
stop();
if (((parent) && (parent.parent))){
parent.parent.dispatchEvent(new Event("BEGIN_LEVEL"));
};
}
}
}//package Kaban_fla
Section 49
//State_307 (Kaban_fla.State_307)
package Kaban_fla {
import flash.events.*;
import flash.display.*;
public dynamic class State_307 extends MovieClip {
public function State_307(){
addFrameScript(0, frame1, 19, frame20, 43, frame44, 70, frame71);
}
function frame1(){
SoundManager.stopSound(SndKaban02);
}
function frame20(){
SoundManager.createSound(SndKaban02, false, true);
}
function frame44(){
gotoAndPlay("sit");
}
function frame71(){
stop();
if (((parent) && (parent.parent))){
parent.parent.dispatchEvent(new Event("BEGIN_LEVEL"));
};
}
}
}//package Kaban_fla
Section 50
//State_320 (Kaban_fla.State_320)
package Kaban_fla {
import flash.events.*;
import flash.display.*;
public dynamic class State_320 extends MovieClip {
public var piglet1:MovieClip;
public var piglet2:MovieClip;
public var piglet3:MovieClip;
public function State_320(){
addFrameScript(20, frame21, 26, frame27, 170, frame171);
}
function frame21(){
piglet2.gotoAndPlay(8);
piglet3.gotoAndPlay(15);
}
function frame27(){
stop();
}
function frame171(){
stop();
if (((parent) && (parent.parent))){
parent.parent.dispatchEvent(new Event("BEGIN_LEVEL"));
};
}
}
}//package Kaban_fla
Section 51
//State_326 (Kaban_fla.State_326)
package Kaban_fla {
import flash.display.*;
public dynamic class State_326 extends MovieClip {
public function State_326(){
addFrameScript(73, frame74);
}
function frame74(){
gotoAndPlay("sit");
}
}
}//package Kaban_fla
Section 52
//State_333 (Kaban_fla.State_333)
package Kaban_fla {
import flash.display.*;
public dynamic class State_333 extends MovieClip {
public function State_333(){
addFrameScript(0, frame1, 23, frame24, 154, frame155);
}
function frame1(){
SoundManager.createSound(SndSwarm, true, true);
SoundManager.createSound(SndWaterOut, false, true);
}
function frame24(){
SoundManager.createSound(SndWaterIn, false, true);
}
function frame155(){
gotoAndPlay("sit");
}
}
}//package Kaban_fla
Section 53
//State_338 (Kaban_fla.State_338)
package Kaban_fla {
import flash.events.*;
import flash.display.*;
public dynamic class State_338 extends MovieClip {
public function State_338(){
addFrameScript(62, frame63, 89, frame90);
}
function frame63(){
SoundManager.createSound(SndGirl, false, true);
stop();
}
function frame90(){
stop();
if (((parent) && (parent.parent))){
parent.parent.dispatchEvent(new Event("BEGIN_LEVEL"));
};
}
}
}//package Kaban_fla
Section 54
//State_347 (Kaban_fla.State_347)
package Kaban_fla {
import flash.events.*;
import flash.display.*;
public dynamic class State_347 extends MovieClip {
public var piglet1:MovieClip;
public var piglet2:MovieClip;
public var piglet3:MovieClip;
public function State_347(){
addFrameScript(20, frame21, 56, frame57, 99, frame100);
}
function frame21(){
piglet2.gotoAndPlay(8);
piglet3.gotoAndPlay(15);
}
function frame57(){
stop();
}
function frame100(){
stop();
if (((parent) && (parent.parent))){
parent.parent.dispatchEvent(new Event("BEGIN_LEVEL"));
};
}
}
}//package Kaban_fla
Section 55
//State_361 (Kaban_fla.State_361)
package Kaban_fla {
import flash.events.*;
import flash.display.*;
public dynamic class State_361 extends MovieClip {
public function State_361(){
addFrameScript(0, frame1, 19, frame20, 43, frame44, 135, frame136);
}
function frame1(){
SoundManager.stopSound(SndKaban02);
}
function frame20(){
SoundManager.createSound(SndKaban02, false, true);
}
function frame44(){
gotoAndPlay("sit");
}
function frame136(){
stop();
if (((parent) && (parent.parent))){
parent.parent.dispatchEvent(new Event("BEGIN_LEVEL"));
};
}
}
}//package Kaban_fla
Section 56
//State_365 (Kaban_fla.State_365)
package Kaban_fla {
import flash.display.*;
public dynamic class State_365 extends MovieClip {
public var kaban:MovieClip;
public function State_365(){
addFrameScript(34, frame35);
}
function frame35(){
gotoAndPlay("sit");
}
}
}//package Kaban_fla
Section 57
//State_370 (Kaban_fla.State_370)
package Kaban_fla {
import flash.events.*;
import flash.display.*;
public dynamic class State_370 extends MovieClip {
public function State_370(){
addFrameScript(0, frame1, 43, frame44, 45, frame46, 126, frame127);
}
function frame1(){
SoundManager.stopSound(SndKaban02);
}
function frame44(){
gotoAndPlay("sit");
}
function frame46(){
SoundManager.createSound(SndKaban03, false, true);
}
function frame127(){
stop();
if (((parent) && (parent.parent))){
parent.parent.dispatchEvent(new Event("BEGIN_LEVEL"));
};
}
}
}//package Kaban_fla
Section 58
//State_373 (Kaban_fla.State_373)
package Kaban_fla {
import flash.display.*;
public dynamic class State_373 extends MovieClip {
public var piglet1:MovieClip;
public var piglet2:MovieClip;
public function State_373(){
addFrameScript(0, frame1, 42, frame43, 58, frame59, 98, frame99);
}
function frame1(){
SoundManager.createSound(SndKabanEat, true, true);
piglet1.gotoAndPlay(30);
piglet2.gotoAndPlay(35);
}
function frame43(){
SoundManager.createSound(SndPiglet01, false, false);
}
function frame59(){
SoundManager.createSound(SndPiglet01, false, false);
}
function frame99(){
gotoAndPlay("sit");
}
}
}//package Kaban_fla
Section 59
//State_381 (Kaban_fla.State_381)
package Kaban_fla {
import flash.events.*;
import flash.display.*;
public dynamic class State_381 extends MovieClip {
public function State_381(){
addFrameScript(43, frame44, 45, frame46, 109, frame110);
}
function frame44(){
gotoAndPlay("sit");
}
function frame46(){
SoundManager.createSound(SndKaban02, false, true);
}
function frame110(){
stop();
if (((parent) && (parent.parent))){
parent.parent.dispatchEvent(new Event("BEGIN_LEVEL"));
};
}
}
}//package Kaban_fla
Section 60
//State_387 (Kaban_fla.State_387)
package Kaban_fla {
import flash.events.*;
import flash.display.*;
public dynamic class State_387 extends MovieClip {
public function State_387(){
addFrameScript(0, frame1, 19, frame20, 43, frame44, 70, frame71);
}
function frame1(){
SoundManager.stopSound(SndKaban02);
}
function frame20(){
SoundManager.createSound(SndKaban02, false, true);
}
function frame44(){
gotoAndPlay("sit");
}
function frame71(){
stop();
if (((parent) && (parent.parent))){
parent.parent.dispatchEvent(new Event("BEGIN_LEVEL"));
};
}
}
}//package Kaban_fla
Section 61
//State_390 (Kaban_fla.State_390)
package Kaban_fla {
import flash.display.*;
public dynamic class State_390 extends MovieClip {
public function State_390(){
addFrameScript(293, frame294);
}
function frame294(){
gotoAndPlay("sit");
}
}
}//package Kaban_fla
Section 62
//State_420 (Kaban_fla.State_420)
package Kaban_fla {
import flash.display.*;
public dynamic class State_420 extends MovieClip {
public function State_420(){
addFrameScript(24, frame25, 34, frame35);
}
function frame25(){
SoundManager.createSound(SndGirl, false, true);
}
function frame35(){
gotoAndPlay("sit");
}
}
}//package Kaban_fla
Section 63
//TheEndCast_417 (Kaban_fla.TheEndCast_417)
package Kaban_fla {
import flash.display.*;
public dynamic class TheEndCast_417 extends MovieClip {
public function TheEndCast_417(){
addFrameScript(299, frame300);
}
function frame300(){
stop();
}
}
}//package Kaban_fla
Section 64
//Think11_324 (Kaban_fla.Think11_324)
package Kaban_fla {
import flash.display.*;
public dynamic class Think11_324 extends MovieClip {
public function Think11_324(){
addFrameScript(0, frame1);
}
function frame1(){
MyUtils.stopMovie(this);
}
}
}//package Kaban_fla
Section 65
//Think12_362 (Kaban_fla.Think12_362)
package Kaban_fla {
import flash.display.*;
public dynamic class Think12_362 extends MovieClip {
public function Think12_362(){
addFrameScript(23, frame24);
}
function frame24(){
SoundManager.createSound(SndStack, false, false);
}
}
}//package Kaban_fla
Section 66
//Trajectory01_198 (Kaban_fla.Trajectory01_198)
package Kaban_fla {
import flash.display.*;
public dynamic class Trajectory01_198 extends MovieClip {
public function Trajectory01_198(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package Kaban_fla
Section 67
//MochiBot (mochi.as3.MochiBot)
package mochi.as3 {
import flash.system.*;
import flash.net.*;
import flash.display.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
if (Security.sandboxType == "localWithFile"){
return (null);
};
var _local3:MochiBot = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
var _local4:String = "http://core.mochibot.com/my/core.swf";
var _local5:URLVariables = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
var _local6:String = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
var _local7:URLRequest = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
var _local8:Loader = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package mochi.as3
Section 68
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_SHOW:String = "StoreShow";
public static const STORE_HIDE:String = "StoreHide";
public static const ITEM_OWNED:String = "ItemOwned";
public static const ITEM_NEW:String = "ItemNew";
public static const STORE_ITEMS:String = "StoreItems";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IOError";
public static const NO_USER:String = "NoUser";
public static var _inventory:MochiInventory;
public static function get inventory():MochiInventory{
return (_inventory);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showStore(_arg1:Object=null):void{
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
MochiSocial.addEventListener(_arg1, _arg2);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
MochiSocial.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
MochiSocial.removeEventListener(_arg1, _arg2);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_inventory = new MochiInventory();
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_inventory = null;
});
}
}//package mochi.as3
Section 69
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Fragment:Number;
private var Sibling:MochiDigits;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function get value():Number{
return (Number(this.toString()));
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function reencode():void{
var _local1:uint = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function toString():String{
var _local1:String = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
}
}//package mochi.as3
Section 70
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
eventTable = {};
}
public function addEventListener(_arg1:String, _arg2:Function):void{
removeEventListener(_arg1, _arg2);
eventTable[_arg1].push(_arg2);
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
eventTable[_arg1] = [];
return;
};
for (_local3 in eventTable[_arg1]) {
if (eventTable[_arg1][_local3] != _arg2){
} else {
eventTable[_arg1].splice(Number(_local3), 1);
};
};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
return;
};
for (_local3 in eventTable[_arg1]) {
var _local6 = eventTable[_arg1];
_local6[_local3](_arg2);
};
}
}
}//package mochi.as3
Section 71
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_CENTER:String = "ALIGN_C";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const FORMAT_SHORT:String = "ShortForm";
public static const FORMAT_LONG:String = "LongForm";
private static var gameStart:Number;
private static var levelStart:Number;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startSession(_arg1:String):void{
MochiServices.send("events_beginSession", {achievementID:_arg1}, null, null);
}
public static function setNotifications(_arg1:MovieClip, _arg2:Object):void{
var _local4:Object;
var _local3:Object = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
_local3.clip = _arg1;
MochiServices.send("events_setNotifications", _local3, null, null);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function startPlay(_arg1:String="gameplay"):void{
MochiServices.send("events_setRoundID", {tag:String(_arg1)}, null, null);
}
public static function endPlay():void{
MochiServices.send("events_clearRoundID", null, null, null);
}
public static function trackEvent(_arg1:String, _arg2=null):void{
MochiServices.send("events_trackEvent", {tag:_arg1, value:_arg2}, null, null);
}
}
}//package mochi.as3
Section 72
//MochiInventory (mochi.as3.MochiInventory)
package mochi.as3 {
import flash.utils.*;
import flash.events.*;
public dynamic class MochiInventory extends Proxy {
private var _timer:Timer;
private var _consumableProperties:Object;
private var _syncPending:Boolean;
private var _outstandingID:Number;
private var _syncID:Number;
private var _names:Array;
private var _storeSync:Object;
private static const CONSUMER_KEY:String = "MochiConsumables";
private static const KEY_SALT:String = " syncMaint";
public static const READY:String = "InvReady";
public static const WRITTEN:String = "InvWritten";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IoError";
public static const VALUE_ERROR:String = "InvValueError";
public static const NOT_READY:String = "InvNotReady";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiInventory():void{
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned);
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut);
_storeSync = new Object();
_syncPending = false;
_outstandingID = 0;
_syncID = 0;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, sync);
_timer.start();
if (MochiSocial.loggedIn){
loggedIn();
} else {
loggedOut();
};
}
public function release():void{
MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut);
}
private function loggedOut(_arg1:Object=null):void{
_consumableProperties = null;
}
private function loggedIn(_arg1:Object=null):void{
MochiUserData.get(CONSUMER_KEY, getConsumableBag);
}
private function newItems(_arg1:Object):void{
if (!(this[(_arg1.id + KEY_SALT)])){
this[(_arg1.id + KEY_SALT)] = 0;
};
if (!(this[_arg1.id])){
this[_arg1.id] = 0;
};
this[(_arg1.id + KEY_SALT)] = (this[(_arg1.id + KEY_SALT)] + _arg1.count);
this[_arg1.id] = (this[_arg1.id] + _arg1.count);
if (_arg1.privateProperties.consumable){
if (!(this[_arg1.privateProperties.tag])){
this[_arg1.privateProperties.tag] = 0;
};
this[_arg1.privateProperties.tag] = (this[_arg1.privateProperties.tag] + (_arg1.privateProperties.inc * _arg1.count));
};
}
private function itemOwned(_arg1:Object):void{
_storeSync[_arg1.id] = {properties:_arg1.properties, count:_arg1.count};
}
private function getConsumableBag(_arg1:MochiUserData):void{
var _local2:String;
var _local3:Number;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
return;
};
_consumableProperties = {};
_names = new Array();
if (_arg1.data){
for (_local2 in _arg1.data) {
_names.push(_local2);
_consumableProperties[_local2] = new MochiDigits(_arg1.data[_local2]);
};
};
for (_local2 in _storeSync) {
_local3 = _storeSync[_local2].count;
if (_consumableProperties[(_local2 + KEY_SALT)]){
_local3 = (_local3 - _consumableProperties[_local2]);
};
if (_local3 == 0){
} else {
newItems({id:_local2, count:_local3, properties:_storeSync[_local2].properties});
};
};
triggerEvent(READY, {});
}
private function putConsumableBag(_arg1:MochiUserData):void{
_syncPending = false;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
_outstandingID = -1;
};
triggerEvent(WRITTEN, {});
}
private function sync(_arg1:Event=null):void{
var _local3:String;
if (((_syncPending) || ((_syncID == _outstandingID)))){
return;
};
_outstandingID = _syncID;
var _local2:Object = {};
for (_local3 in _consumableProperties) {
_local2[_local3] = MochiDigits(_consumableProperties[_local3]).value;
};
MochiUserData.put(CONSUMER_KEY, _local2, putConsumableBag);
_syncPending = true;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (-1);
};
if (_consumableProperties[_arg1]){
return (MochiDigits(_consumableProperties[_arg1]).value);
};
return (undefined);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(_arg1):Boolean{
if (!(_consumableProperties[_arg1])){
return (false);
};
_names.splice(_names.indexOf(_arg1), 1);
delete _consumableProperties[_arg1];
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(_arg1):Boolean{
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (false);
};
if (_consumableProperties[_arg1] == undefined){
return (false);
};
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:MochiDigits;
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return;
};
if (!((_arg2 is Number))){
triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:_arg2});
return;
};
if (_consumableProperties[_arg1]){
_local3 = MochiDigits(_consumableProperties[_arg1]);
if (_local3.value == _arg2){
return;
};
_local3.value = _arg2;
} else {
_names.push(_arg1);
_consumableProperties[_arg1] = new MochiDigits(_arg2);
};
_syncID++;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(_arg1:int):int{
return (((_arg1)>=_names.length) ? 0 : (_arg1 + 1));
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(_arg1:int):String{
return (_names[(_arg1 - 1)]);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
}
}//package mochi.as3
Section 73
//MochiScores (mochi.as3.MochiScores)
package mochi.as3 {
import flash.display.*;
import flash.text.*;
public class MochiScores {
public static var onCloseHandler:Object;
public static var onErrorHandler:Object;
private static var boardID:String;
public static function onClose(_arg1:Object=null):void{
if (((((_arg1) && ((_arg1.error == true)))) && (onErrorHandler))){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiServices.warnID(_arg1, true);
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
public static function showLeaderboard(_arg1:Object=null):void{
var n:Number;
var options = _arg1;
if (options != null){
delete options.clip;
MochiServices.setContainer();
MochiServices.bringToTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
_arg1 = Number(_arg1);
if (isNaN(_arg1)){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(_arg1) != _arg1){
trace((("WARNING: Submitted score '" + String(_arg1)) + "' will be truncated"));
};
_arg1 = Number(_arg1);
};
};
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
var _local2:Object = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
}
}//package mochi.as3
Section 74
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.system.*;
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import flash.geom.*;
public class MochiServices {
private static var _id:String;
private static var _container:Object;
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _timer:Timer;
private static var _preserved:Object;
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
private static var _services:String = "services.swf";
private static var _mochiLC:String = "MochiLC.swf";
private static var _swfVersion:String;
private static var _listenChannelName:String = "__ms_";
private static var _sendChannel:LocalConnection;
private static var _sendChannelName:String;
private static var _connecting:Boolean = false;
private static var _connected:Boolean = false;
public static var netup:Boolean = true;
public static var netupAttempted:Boolean = false;
public static var onError:Object;
public static var widget:Boolean = false;
public static var servicesSync:MochiSync = new MochiSync();
private static var _mochiLocalConnection:MovieClip;
private static var _queue:Array;
private static var _nextCallbackID:Number;
private static var _callbacks:Object;
public static function get id():String{
return (_id);
}
public static function get clip():Object{
return (_container);
}
public static function get childClip():Object{
return (_clip);
}
public static function getVersion():String{
return ("3.8 as3");
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
};
return (_local2);
}
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
public static function get connected():Boolean{
return (_connected);
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
_arg1 = _arg1.toLowerCase();
if (_arg1.length != 16){
trace((("WARNING: " + (_arg2) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
var _local3:Number = 0;
while (_local3 < _arg1.length) {
switch (_arg1.charAt(_local3)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + _arg1));
return;
};
_local3++;
};
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
warnID(id, false);
if ((clip is DisplayObject)){
if (clip.stage == null){
trace("MochiServices connect requires the containing clip be attached to the stage");
};
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_mochiLocalConnection.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
public static function bringToTop(_arg1:Event=null):void{
var e = _arg1;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_clip.parent){
_clip.parent.removeChild(_clip);
};
if (_arg1 != null){
if ((_arg1 is DisplayObjectContainer)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is DisplayObjectContainer)){
DisplayObjectContainer(_container).addChild(_clip);
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
if (_clip != null){
return (_clip);
};
if (!(MochiServices.isNetworkAvailable())){
return (null);
};
if (urlOptions(_arg2).servURL){
_servURL = urlOptions(_arg2).servURL;
};
var _local3:String = (_servURL + _services);
if (urlOptions(_arg2).servicesURL){
_local3 = urlOptions(_arg2).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(_local3);
_clip = new MovieClip();
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
var _local4:URLRequest = new URLRequest(_local3);
var _local5:URLVariables = new URLVariables();
_local5.listenLC = _listenChannelName;
_local5.mochiad_options = _arg2.loaderInfo.parameters.mochiad_options;
_local5.api_version = getVersion();
if (widget){
_local5.widget = true;
};
_local4.data = _local5;
_loader.load(_local4);
_clip.addChild(_loader);
_sendChannel = new LocalConnection();
_queue = [];
_nextCallbackID = 0;
_callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
private static function loadLCBridge(_arg1:Object):void{
var loader:Loader;
var clip = _arg1;
loader = new Loader();
var mochiLCURL:String = (_servURL + _mochiLC);
var req:URLRequest = new URLRequest(mochiLCURL);
var complete:Function = function (_arg1:Object):void{
_mochiLocalConnection = MovieClip(loader.content);
listen();
};
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
private static function loadError(_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
public static function connectWait(_arg1:TimerEvent):void{
if (!(_connected)){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
private static function initComChannels():void{
if (!(_connected)){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _queue.shift());
};
};
}
private static function onReceive(_arg1:Object):void{
var methodName:String;
var pkg = _arg1;
var cb:String = pkg.callbackID;
var cblst:Object = _callbacks[cb];
if (!(cblst)){
return;
};
var method:* = cblst.callbackMethod;
methodName = "";
var obj:Object = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete _callbacks[cb];
}
private static function onEvent(_arg1:Object):void{
var _local2:String = _arg1.target;
var _local3:String = _arg1.event;
switch (_local2){
case "events":
MochiEvents.triggerEvent(_arg1.event, _arg1.args);
break;
case "coins":
MochiCoins.triggerEvent(_arg1.event, _arg1.args);
break;
case "sync":
servicesSync.triggerEvent(_arg1.event, _arg1.args);
break;
};
}
public static function updateCopy(_arg1:Object):void{
MochiServices.send("coins_updateCopy", _arg1, null, null);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (((_clip) && (_queue))){
while (_queue.length > 0) {
_local2 = _queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _callbacks[_local2.callbackID];
};
delete _callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_nextCallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + _arg1));
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_queue.push({methodName:_arg1, args:_arg2, callbackID:_nextCallbackID});
};
if (_clip != null){
if (_callbacks != null){
_callbacks[_nextCallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_nextCallbackID++;
};
};
}
private static function urlOptions(_arg1:Object):Object{
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:Array;
var _local2:Object = {};
if (_arg1.stage){
_local3 = _arg1.stage.loaderInfo.parameters.mochiad_options;
} else {
_local3 = _arg1.loaderInfo.parameters.mochiad_options;
};
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var avm1Click:DisplayObject;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
var vars:Object = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
var s:String = "?";
var i:Number = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
var _local2:Rectangle = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!(((netupAttempted) || (_connected)))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local4:int;
var _local14:Loader;
var _local3:Array = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
var _local5:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
var _local6:Array = [0, 64, 0, 0, 0];
var _local7:MovieClip = new MovieClip();
var _local8:LocalConnection = new LocalConnection();
var _local9:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
var _local10:ByteArray = new ByteArray();
var _local11:ByteArray = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
var _local12:uint = ((_local3.length + _local11.length) + 4);
var _local13:uint = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
}
}//package mochi.as3
Section 75
//MochiSocial (mochi.as3.MochiSocial)
package mochi.as3 {
public class MochiSocial {
public static const LOGGED_IN:String = "LoggedIn";
public static const LOGGED_OUT:String = "LoggedOut";
public static const LOGIN_SHOW:String = "LoginShow";
public static const LOGIN_HIDE:String = "LoginHide";
public static const LOGIN_SHOWN:String = "LoginShown";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const PROFILE_HIDE:String = "ProfileHide";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const USER_INFO:String = "UserInfo";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IOError";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static var _user_info:Object = null;
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function getAPIURL():String{
if (!(_user_info)){
return (null);
};
return (_user_info.api_url);
}
public static function getAPIToken():String{
if (!(_user_info)){
return (null);
};
return (_user_info.api_token);
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showLoginWidget", {options:_arg1});
}
public static function hideLoginWidget():void{
MochiServices.send("coins_hideLoginWidget");
}
public static function requestLogin():void{
MochiServices.send("coins_requestLogin");
}
public static function getUserInfo():void{
MochiServices.send("coins_getUserInfo");
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("coins_saveUserProperties", _arg1);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function get loggedIn():Boolean{
return (!((_user_info == null)));
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_user_info = _arg1;
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_user_info = null;
});
}
}//package mochi.as3
Section 76
//MochiSync (mochi.as3.MochiSync)
package mochi.as3 {
import flash.utils.*;
public dynamic class MochiSync extends Proxy {
private var _syncContainer:Object;
public static var SYNC_REQUEST:String = "SyncRequest";
public static var SYNC_PROPERTY:String = "UpdateProperty";
public function MochiSync():void{
_syncContainer = {};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
return (_syncContainer[_arg1]);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
if (_syncContainer[_arg1] == _arg2){
return;
};
var _local3:String = _arg1.toString();
_syncContainer[_local3] = _arg2;
MochiServices.send("sync_propUpdate", {name:_local3, value:_arg2});
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
switch (_arg1){
case SYNC_REQUEST:
MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY:
_syncContainer[_arg2.name] = _arg2.value;
break;
};
}
}
}//package mochi.as3
Section 77
//MochiUserData (mochi.as3.MochiUserData)
package mochi.as3 {
import flash.utils.*;
import flash.net.*;
import flash.events.*;
public class MochiUserData extends EventDispatcher {
public var _loader:URLLoader;
public var key:String;// = null
public var data;// = null
public var error:Event;// = null
public var operation:String;// = null
public var callback:Function;// = null
public function MochiUserData(_arg1:String="", _arg2:Function=null){
this.key = _arg1;
this.callback = _arg2;
}
public function serialize(_arg1):ByteArray{
var _local2:ByteArray = new ByteArray();
_local2.objectEncoding = ObjectEncoding.AMF3;
_local2.writeObject(_arg1);
_local2.compress();
return (_local2);
}
public function deserialize(_arg1:ByteArray){
_arg1.objectEncoding = ObjectEncoding.AMF3;
_arg1.uncompress();
return (_arg1.readObject());
}
public function request(_arg1:String, _arg2:ByteArray):void{
var _operation = _arg1;
var _data = _arg2;
operation = _operation;
var api_url:String = MochiSocial.getAPIURL();
var api_token:String = MochiSocial.getAPIToken();
if ((((api_url == null)) || ((api_token == null)))){
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in"));
return;
};
_loader = new URLLoader();
var args:URLVariables = new URLVariables();
args.op = _operation;
args.key = key;
var req:URLRequest = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString()));
req.method = URLRequestMethod.POST;
req.contentType = "application/x-mochi-userdata";
req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)];
req.data = _data;
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.addEventListener(Event.COMPLETE, completeHandler);
_loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
try {
_loader.load(req);
} catch(e:SecurityError) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + e.toString())));
};
}
public function completeHandler(_arg1:Event):void{
var event = _arg1;
try {
if (_loader.data.length){
data = deserialize(_loader.data);
} else {
data = null;
};
} catch(e:Error) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + e.toString())));
return;
};
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function errorHandler(_arg1:IOErrorEvent):void{
data = null;
error = _arg1;
if (callback != null){
performCallback();
} else {
dispatchEvent(_arg1);
};
close();
}
public function securityErrorHandler(_arg1:SecurityErrorEvent):void{
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _arg1.toString())));
}
public function performCallback():void{
try {
callback(this);
} catch(e:Error) {
trace(("[MochiUserData] exception during callback: " + e));
};
}
public function close():void{
if (_loader){
_loader.removeEventListener(Event.COMPLETE, completeHandler);
_loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.close();
_loader = null;
};
error = null;
callback = null;
}
public function getEvent():void{
request("get", serialize(null));
}
public function putEvent(_arg1):void{
request("put", serialize(_arg1));
}
override public function toString():String{
return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]"));
}
public static function get(_arg1:String, _arg2:Function):void{
var _local3:MochiUserData = new MochiUserData(_arg1, _arg2);
_local3.getEvent();
}
public static function put(_arg1:String, _arg2, _arg3:Function):void{
var _local4:MochiUserData = new MochiUserData(_arg1, _arg3);
_local4.putEvent(_arg2);
}
}
}//package mochi.as3
Section 78
//BackElement (src.BackElement)
package src {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
public class BackElement extends Depthable {
public var boundZone:MovieClip;
var level:Level;
public static var maskBitmaps:Array = new Array();
public function BackElement(){
if (boundZone != null){
boundZone.visible = false;
};
addEventListener(Event.ENTER_FRAME, handleAdded, false, 0, true);
}
public function handleAdded(_arg1:Event):void{
var className:String;
var bitmapData:BitmapData;
var maskClass:Class;
var e = _arg1;
removeEventListener(Event.ENTER_FRAME, handleAdded);
level = (parent as Level);
if (level == null){
return;
};
var i:int;
while (i < numChildren) {
if ((getChildAt(i) is MovieClip)){
(getChildAt(i) as MovieClip).play();
};
i = (i + 1);
};
className = (getQualifiedClassName(this) + "Mask");
try {
if (maskBitmaps[className] == null){
maskClass = (getDefinitionByName(className) as Class);
bitmapData = new maskClass(0, 0);
maskBitmaps[className] = bitmapData;
} else {
bitmapData = (maskBitmaps[className] as BitmapData);
};
level.bgMask.bitmapData.copyPixels(bitmapData, new Rectangle(0, 0, bitmapData.width, bitmapData.height), new Point(x, y), null, null, true);
} catch(e:Error) {
trace(("BackElement: mask error " + className));
};
}
}
}//package src
Section 79
//Creature (src.Creature)
package src {
import flash.geom.*;
import flash.events.*;
import flash.display.*;
public class Creature extends Depthable {
public var boundZone:MovieClip;
protected var level:Level;
protected var bgMask:Bitmap;
protected var direction:Number;// = 1
protected var step:Number;// = 3
protected var target:Point;
protected var distToTarget:Number;
public var directionX:int;// = 0
public var directionY:int;// = 0
public var prevDirectionX:int;// = 0
public var prevDirectionY:int;// = 0
protected var boundRect:Rectangle;
var isMovable:Boolean;// = true
public var isDepthable:Boolean;// = true
public static var doc:Doc;
public function Creature(){
target = new Point(0, 0);
boundRect = new Rectangle(-5, -5, 10, 10);
super();
doc = Doc.getInstance();
addEventListener(Event.ENTER_FRAME, handleAdded, false, 0, true);
addEventListener(Event.REMOVED_FROM_STAGE, handleRemoved, false, 0, true);
}
public function handleAdded(_arg1:Event):void{
var _local2:Sprite;
removeEventListener(Event.ENTER_FRAME, handleAdded);
if ((parent is Level)){
level = (parent as Level);
if (boundZone != null){
boundRect = new Rectangle(boundZone.x, boundZone.y, boundZone.width, boundZone.height);
boundZone.visible = false;
};
bgMask = level.bgMask;
_local2 = (getChildByName("crossMask") as Sprite);
if (_local2 != null){
_local2.visible = false;
hitArea = _local2;
};
onCreate();
};
}
public function handleRemoved(_arg1:Event):void{
removeEventListener(Event.REMOVED_FROM_STAGE, handleRemoved);
onRemove();
}
public function onCreate():void{
}
public function onRemove():void{
}
public function onContact():void{
}
public function checkInteractions():void{
}
public function pause(_arg1:Boolean=true):void{
}
public function putToBG():void{
parent.setChildIndex(this, (level.getChildIndex(level.bg) + 1));
depthEnable = false;
}
public function getFromBG():void{
depthEnable = true;
checkDepth();
}
public function getCX():Number{
return (((x + boundRect.x) + (boundRect.width / 2)));
}
public function getCY():Number{
return (((y + boundRect.y) + (boundRect.height / 2)));
}
public function setCX(_arg1:Number):void{
x = (_arg1 - (boundRect.x + (boundRect.width / 2)));
}
public function setCY(_arg1:Number):void{
y = (_arg1 - (boundRect.y + (boundRect.height / 2)));
}
public function moveToTargetNoClip(_arg1:Event=null):void{
var _local2:Number = (target.x - x);
var _local3:Number = (target.y - y);
var _local4:Number = Math.atan2(_local3, _local2);
distToTarget = MyUtils.distanceNumber(_local2, _local3);
if (distToTarget > step){
x = (x + (step * Math.cos(_local4)));
y = (y + (step * Math.sin(_local4)));
};
}
public function fly(_arg1:Event=null):void{
var _local2:Number;
var _local3:Number;
var _local4:Number = (target.x - x);
var _local5:Number = (target.y - y);
var _local6:Number = Math.atan2(_local5, _local4);
distToTarget = MyUtils.distanceNumber(_local4, _local5);
if (distToTarget > step){
_local2 = (x + (step * Math.cos(_local6)));
_local3 = (y + (step * Math.sin(_local6)));
x = _local2;
y = _local3;
};
}
public function moveToTargetStreight(_arg1:Event=null):void{
var _local2:Number;
var _local3:Number;
var _local7:Rectangle;
var _local4:Number = (target.x - x);
var _local5:Number = (target.y - y);
var _local6:Number = Math.atan2(_local5, _local4);
distToTarget = MyUtils.distanceNumber(_local4, _local5);
if (distToTarget > step){
_local2 = (x + (step * Math.cos(_local6)));
_local3 = (y + (step * Math.sin(_local6)));
_local7 = new Rectangle((_local2 + boundRect.x), (y + boundRect.y), boundRect.width, boundRect.height);
if (bgMask.bitmapData.hitTest(new Point(0, 0), 1, _local7)){
_local2 = x;
};
_local7 = new Rectangle((x + boundRect.x), (_local3 + boundRect.y), boundRect.width, boundRect.height);
if (bgMask.bitmapData.hitTest(new Point(0, 0), 1, _local7)){
_local3 = y;
};
if (((!((_local2 == x))) && ((_local3 == y)))){
if (Math.abs((target.x - x)) > (step / 2)){
if (Math.cos(_local6) > 0){
_local2 = (x + step);
} else {
_local2 = (x - step);
};
};
_local7 = new Rectangle((_local2 + boundRect.x), (_local3 + boundRect.y), boundRect.width, boundRect.height);
if (bgMask.bitmapData.hitTest(new Point(0, 0), 1, _local7)){
_local2 = x;
_local3 = y;
};
};
if ((((_local2 == x)) && (!((_local3 == y))))){
if (Math.abs((target.y - y)) > (step / 2)){
if (Math.sin(_local6) > 0){
_local3 = (y + step);
} else {
_local3 = (y - step);
};
};
_local7 = new Rectangle((_local2 + boundRect.x), (_local3 + boundRect.y), boundRect.width, boundRect.height);
if (bgMask.bitmapData.hitTest(new Point(0, 0), 1, _local7)){
_local2 = x;
_local3 = y;
};
};
if ((((_local2 == x)) || ((_local3 == y)))){
onContact();
};
x = _local2;
y = _local3;
};
}
public function resetDirection():void{
direction = Math.atan2((target.x - x), (target.y - y));
}
public function moveToTarget(_arg1:Event=null):void{
var _local2:Number;
var _local3:Number;
var _local7:Rectangle;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:*;
var _local15:*;
var _local16:*;
var _local4:Number = (target.x - x);
var _local5:Number = (target.y - y);
var _local6:Number = Math.atan2(_local5, _local4);
distToTarget = MyUtils.distanceNumber(_local4, _local5);
if (distToTarget > step){
_local2 = (x + (step * Math.cos(_local6)));
_local3 = (y + ((step * Math.sin(_local6)) * 0.8));
_local7 = new Rectangle((_local2 + boundRect.x), (_local3 + boundRect.y), boundRect.width, boundRect.height);
if (((bgMask.bitmapData.hitTest(new Point(0, 0), 1, _local7)) || ((level.checkObjectIntersect(this) == true)))){
onContact();
_local10 = MyUtils.dAngleRadian(direction, _local6);
_local11 = (_local6 + (_local10 * 0.8));
_local12 = 0;
while (_local12 < 360) {
_local13 = -1;
while (_local13 <= 1) {
_local14 = (_local11 + (MyUtils.radian(_local12) * _local13));
_local15 = (x + (step * Math.cos(_local14)));
_local16 = (y + ((step * Math.sin(_local14)) * 0.8));
_local7.x = (_local15 + boundRect.x);
_local7.y = (_local16 + boundRect.y);
_local7.width = boundRect.width;
_local7.height = boundRect.height;
if (((!((bgMask.bitmapData.hitTest(new Point(0, 0), 1, _local7) == true))) && ((level.checkObjectIntersect(this) == false)))){
_local2 = _local15;
_local3 = _local16;
break;
};
_local13 = (_local13 + 2);
};
_local12 = (_local12 + 10);
};
};
_local8 = (_local2 - x);
_local9 = (_local3 - y);
direction = Math.atan2(_local9, _local8);
_local10 = MyUtils.dAngleDegree(((direction * 180) / Math.PI), rotation);
x = _local2;
y = _local3;
};
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, handleAdded);
removeEventListener(Event.REMOVED_FROM_STAGE, handleRemoved);
if (parent){
parent.removeChild(this);
};
}
}
}//package src
Section 80
//CreditsScreen (src.CreditsScreen)
package src {
import flash.events.*;
import flash.display.*;
public class CreditsScreen extends Screen {
public var backButton:MovieClip;
override public function onInit():void{
backButton.addEventListener(MouseEvent.CLICK, onBackButtonClick, false, 0, true);
backButton.caption.text = Loc.BTN_BACK;
}
public function onBackButtonClick(_arg1:MouseEvent){
doc.showMainMenuScreen();
}
}
}//package src
Section 81
//DebugPanel (src.DebugPanel)
package src {
import flash.events.*;
import flash.utils.*;
import flash.system.*;
import flash.text.*;
import flash.display.*;
public class DebugPanel extends MovieClip {
public var doc:Doc;
public var signal:Boolean;// = false
public var tempo:Number;
public var time:Number;
public var inputFrameRate:TextField;
public var txtFPS:TextField;
public var txtMemory:TextField;
public var inputDifficulty:TextField;
public function DebugPanel(){
doc = Doc.getInstance();
inputFrameRate.addEventListener(Event.CHANGE, onInputFrameRate, false, 0, true);
addEventListener(Event.ENTER_FRAME, handleEnterFrame, false, 0, true);
}
function getFPS():Number{
if (signal == true){
time = getTimer();
} else {
tempo = int((1000 / (getTimer() - time)));
};
signal = !(signal);
return (tempo);
}
function handleEnterFrame(_arg1:Event):void{
txtMemory.text = ("" + System.totalMemory);
}
public function print(_arg1:String):void{
trace(_arg1);
}
public function onInputFrameRate(_arg1:Event):void{
stage.frameRate = parseInt(inputFrameRate.text);
print(("FrameRate changed: " + stage.frameRate));
}
}
}//package src
Section 82
//Depthable (src.Depthable)
package src {
import flash.display.*;
public class Depthable extends MovieClip {
public var depthEnable:Boolean;// = true
public var depthPointY:Number;
public var depthPoint:MovieClip;
public static var level:Level;
public function Depthable(){
if ((parent is Level)){
level = (parent as Level);
};
var _local1:DisplayObject = getChildByName("depthPoint");
if (_local1 != null){
depthPointY = _local1.y;
_local1.visible = false;
} else {
depthPointY = height;
};
}
public function checkDepth():void{
level.needCheckDepth();
}
}
}//package src
Section 83
//Discovery (src.Discovery)
package src {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class Discovery extends Screen {
public var discoveryItems:Array;
public var backButton:GameButton;
public var prevButton:GameButton;
public var nextButton:GameButton;
public var pageNumText:TextField;
public var isSoundOn:Boolean;
public var curPage:int;// = 0
public static const FALL_IN_POOL:int = 1;
public static const FARMER_IN_POOL:int = 2;
public static const FARMER_OPEN_DOOR:int = 3;
public static const PIGLET:int = 4;
public static const APPLE_TREE:int = 5;
public static const FARMER_WITH_PITCHFORKS:int = 6;
public static const STACK:int = 7;
public static const PUMPKIN:int = 8;
public static var isNewDiscoveries:Boolean = false;
public static var discoveries:Array = new Array({desc:""}, {icon:DiscoveryIcon1, desc:"The pool detains for a few seconds and reduce power. It is worth to walk round the pond."}, {icon:DiscoveryIcon4, desc:"The farmer in pool will provide unimpeded movement through it."}, {icon:DiscoveryIcon2, desc:"Farmer can open the locked gates."}, {icon:DiscoveryIcon8, desc:"Piglets follow you. Most important thing is not to lose them."}, {icon:DiscoveryIcon3, desc:"Apples from the tree restores power and gives score points."}, {icon:DiscoveryIcon7, desc:"Be careful to farmer with pitchfork. Flee from him! Better don't let him take it."}, {icon:DiscoveryIcon5, desc:"If you sprint through a stack, it will collapse."}, {icon:DiscoveryIcon6, desc:"Gather pumpkins. It gives you score points."});
public function Discovery(){
discoveryItems = new Array();
super();
backButton.caption.text = Loc.BTN_BACK;
backButton.addEventListener(MouseEvent.CLICK, backButtonClicked);
prevButton.addEventListener(MouseEvent.CLICK, prevButtonClicked);
nextButton.addEventListener(MouseEvent.CLICK, nextButtonClicked);
}
public function backButtonClicked(_arg1:MouseEvent):void{
doc.hideDiscoveryScreen();
}
public function prevButtonClicked(_arg1:MouseEvent):void{
if (curPage > 0){
curPage = (curPage - 1);
hide();
show();
};
}
public function nextButtonClicked(_arg1:MouseEvent):void{
if (((curPage + 1) * 4) < discoveryItems.length){
curPage = (curPage + 1);
hide();
show();
};
}
override public function show():void{
var _local1:*;
var _local2:int;
super.show();
isNewDiscoveries = false;
for each (_local1 in discoveryItems) {
discoveries[_local1].item.visible = false;
};
_local2 = (curPage * 4);
while ((((_local2 < ((curPage * 4) + 4))) && ((_local2 < discoveryItems.length)))) {
discoveries[discoveryItems[_local2]].item.visible = true;
_local2++;
};
if (curPage == 0){
prevButton.setEnable(false);
} else {
prevButton.setEnable(true);
};
if (((curPage + 1) * 4) < discoveryItems.length){
nextButton.setEnable(true);
} else {
nextButton.setEnable(false);
};
pageNumText.text = (curPage + 1).toString();
}
override public function hide():void{
super.hide();
}
public function make(_arg1:int):Boolean{
var _local2:int;
var _local3:int;
var _local4:DiscoveryItem;
var _local5:MovieClip;
if (discoveries[_arg1].available == null){
isNewDiscoveries = true;
discoveries[_arg1].available = true;
discoveryItems.push(_arg1);
_local2 = ((discoveryItems.length - 1) / 4);
_local3 = (discoveryItems.length - (_local2 * 4));
_local4 = new DiscoveryItem();
_local4.mouseChildren = false;
_local4.buttonMode = false;
_local4.useHandCursor = false;
_local5 = new discoveries[_arg1].icon();
_local4.icon.addChild(_local5);
_local4.description.text = discoveries[_arg1].desc;
_local4.x = 30;
_local4.y = 70;
if (_local3 > 2){
_local4.y = (_local4.y + 81);
};
if ((((_local3 == 2)) || ((_local3 == 4)))){
_local4.x = (_local4.x + 260);
};
discoveries[_arg1].item = _local4;
addChild(_local4);
MyUtils.stopMovie(_local5);
return (true);
//unresolved jump
};
return (false);
}
}
}//package src
Section 84
//DiscoveryMessage (src.DiscoveryMessage)
package src {
import flash.events.*;
import flash.display.*;
import com.touchmypixel.peepee.utils.*;
public class DiscoveryMessage extends MovieClip {
public var icon:MovieClip;
public function DiscoveryMessage(_arg1:int=-1){
addFrameScript(0, frame1, 99, frame100);
if (_arg1 == -1){
return;
};
mouseChildren = false;
buttonMode = true;
useHandCursor = true;
tabEnabled = false;
addEventListener(MouseEvent.CLICK, handleClick);
var _local2:MovieClip = new Discovery.discoveries[_arg1].icon();
MyUtils.stopMovie(_local2);
_local2.cacheAsBitmap = true;
icon.addChild(_local2);
x = 18;
y = 388;
}
public function remove():void{
stop();
removeEventListener(MouseEvent.CLICK, handleClick);
if (parent){
parent.removeChild(this);
};
}
function handleClick(_arg1:MouseEvent):void{
Doc.getInstance().showDiscoveryScreen();
}
function playEffect():void{
var _local1:String = "AnimDiscoveryMessageEffect";
AnimationCache.getInstance().cacheAnimation(_local1);
var _local2:Animation = AnimationCache.getInstance().getAnimation(_local1);
_local2.repeat = false;
_local2.play();
addChild(_local2);
}
function frame1(){
playEffect();
}
function frame100(){
remove();
}
}
}//package src
Section 85
//Doc (src.Doc)
package src {
import flash.events.*;
import flash.ui.*;
import flash.utils.*;
import mochi.as3.*;
import flash.net.*;
import flash.display.*;
public class Doc extends MovieClip {
public const levelCount:int = 10;
protected var prevScreen:Screen;
protected var mainMenuScreen:MainMenuScreen;
protected var selectLevelScreen:SelectLevelScreen;
public var gameScreen:GameScreen;
protected var endLevelScreen:EndLevelScreen;
protected var gameOverScreen:GameOverScreen;
protected var helpScreen:HelpScreen;
protected var creditsScreen:CreditsScreen;
protected var optionsScreen:OptionsScreen;
protected var selectControlScreen:SelectControlScreen;
protected var theEndScreen:TheEndScreen;
protected var discoveryScreen:Discovery;
public var controlScreenShown:Boolean;// = false
public var helpScreenShown:Boolean;// = false
public var levelNum:Number;
public var levelTime:Number;
public var compliteLevelCount:Number;
protected var levelScore:int;
protected var scoreXCoef:Number;// = 1
public var curLevel:Object;
public var playerPower:Number;// = 1
public var gamePaused:Boolean;// = false
public var globalTimer:Number;// = 0
public var gameControl:int;// = 1
protected static var instance:Doc;
public function Doc(){
instance = this;
addEventListener(Event.ADDED_TO_STAGE, handleAdded);
var _local1:ContextMenu = new ContextMenu();
_local1.hideBuiltInItems();
contextMenu = _local1;
loadDefaultParameters();
loadGame();
mainMenuScreen = new MainMenuScreen();
gameOverScreen = new GameOverScreen();
selectLevelScreen = new SelectLevelScreen();
gameScreen = new GameScreen();
endLevelScreen = new EndLevelScreen();
helpScreen = new HelpScreen();
creditsScreen = new CreditsScreen();
optionsScreen = new OptionsScreen();
selectControlScreen = new SelectControlScreen();
theEndScreen = new TheEndScreen();
discoveryScreen = new Discovery();
showMainMenuScreen();
}
public function printTime(_arg1:String=""):void{
trace(((_arg1 + " ") + (getTimer() - globalTimer)));
globalTimer = getTimer();
}
public function loadDefaultParameters():void{
levelNum = 1;
levelScore = 0;
scoreXCoef = 1;
compliteLevelCount = 0;
}
public function initLevelParameters(_arg1:int):void{
levelScore = 0;
levelNum = _arg1;
levelTime = Levels.levels[(levelNum - 1)].duration;
playerPower = 1;
}
public function loadGame():void{
var _local2:int;
var _local1:SharedObject = SharedObject.getLocal("compliteLevelCount");
if (_local1.size != 0){
if (compliteLevelCount < _local1.data.compliteLevelCount){
compliteLevelCount = _local1.data.compliteLevelCount;
};
if (_local1.data.bestScores != null){
_local2 = 0;
while (_local2 < _local1.data.bestScores.length) {
Levels.levels[_local2].bestScore = _local1.data.bestScores[_local2];
_local2++;
};
};
};
}
public function saveGame():void{
var _local1:SharedObject = SharedObject.getLocal("compliteLevelCount");
if (_local1.size == 0){
_local1.data.compliteLevelCount = compliteLevelCount;
} else {
if (_local1.data.compliteLevelCount < compliteLevelCount){
_local1.data.compliteLevelCount = compliteLevelCount;
};
};
_local1.data.bestScores = new Array();
var _local2:* = Levels.levels;
var _local3:int;
while (_local3 < Levels.levels.length) {
if (Levels.levels[_local3].bestScore == null){
Levels.levels[_local3].bestScore = int(0);
};
_local1.data.bestScores[_local3] = Levels.levels[_local3].bestScore;
_local3++;
};
_local1.flush();
}
public function hideAllScreens():void{
mainMenuScreen.hide();
selectLevelScreen.hide();
gameScreen.hide();
endLevelScreen.hide();
gameOverScreen.hide();
helpScreen.hide();
creditsScreen.hide();
optionsScreen.hide();
selectControlScreen.hide();
theEndScreen.hide();
if (stage != null){
stage.focus = null;
};
}
public function beginLevel(_arg1:int=-1):void{
if (_arg1 == -1){
_arg1 = levelNum;
};
curLevel = Levels.levels[(_arg1 - 1)];
curLevel.score = 0;
if (curLevel.counter != null){
curLevel.counter = 0;
};
hideAllScreens();
initLevelParameters(_arg1);
gameScreen.show();
gameScreen.beginLevel();
SoundManager.playMusic(MscGame);
SoundManager.createSound(SndAtmasfera);
}
public function restartLevel():void{
curLevel.score = 0;
if (curLevel.counter != null){
curLevel.counter = 0;
};
hideAllScreens();
initLevelParameters(levelNum);
gameScreen.show();
gameScreen.beginLevel();
SoundManager.playMusic(MscGame);
}
public function getCurLevelClip():Level{
if (gameScreen != null){
return (gameScreen.level);
};
return (null);
}
public function endLevel():void{
pause(true);
levelNum++;
if ((((compliteLevelCount < levelNum)) && ((compliteLevelCount < levelCount)))){
compliteLevelCount = levelNum;
};
if (compliteLevelCount >= levelCount){
compliteLevelCount = levelCount;
};
SoundManager.stopMusic();
SoundManager.createSound(SndWin);
var _local1:EndLevelFadeScreen = new EndLevelFadeScreen();
addChild(_local1);
setTimeout(showEndLevelScreen, 2000);
}
public function gameOver():void{
pause(true);
SoundManager.stopMusic();
SoundManager.createSound(SndLose);
var _local1:GameOverFadeScreen = new GameOverFadeScreen();
addChild(_local1);
setTimeout(showGameOverScreen, 1500);
}
public function showGameOverScreen():void{
hideAllScreens();
gameOverScreen.show();
var _local1:FadeOutScreen = new FadeOutScreen();
addChild(_local1);
}
public function showMainMenuScreen(_arg1:Event=null):void{
hideAllScreens();
mainMenuScreen.show();
SoundManager.playMusic(MscMenu);
}
public function showSelectLevelScreen(_arg1:Event=null):void{
if (helpScreenShown == false){
showHelpScreen();
} else {
if (controlScreenShown == false){
showSelectControlScreen();
} else {
hideAllScreens();
selectLevelScreen.show();
};
};
}
public function showEndLevelScreen(_arg1:Event=null):void{
hideAllScreens();
endLevelScreen.show();
SoundManager.playMusic(MscMenu);
var _local2:FadeOutScreen = new FadeOutScreen();
addChild(_local2);
}
public function showHelpScreen(_arg1:Event=null):void{
helpScreenShown = true;
hideAllScreens();
helpScreen.show();
}
public function showCreditsScreen(_arg1:Event=null):void{
hideAllScreens();
creditsScreen.show();
}
public function showOptionsScreen(_arg1:Event=null):void{
pause(true);
optionsScreen.show();
}
public function showSelectControlScreen(_arg1:Event=null):void{
hideAllScreens();
selectControlScreen.show();
}
public function hideOptionsScreen(_arg1:Event=null):void{
pause(false);
optionsScreen.hide();
}
public function showDiscoveryScreen(_arg1:Event=null):void{
if (gameScreen.visible == true){
showOptionsScreen();
};
discoveryScreen.show();
if (selectLevelScreen.visible == true){
selectLevelScreen.hide();
prevScreen = selectLevelScreen;
};
}
public function hideDiscoveryScreen(_arg1:Event=null):void{
discoveryScreen.hide();
if (prevScreen != null){
prevScreen.show();
};
prevScreen = null;
}
public function showTheEndScreen(_arg1:Event=null):void{
hideAllScreens();
theEndScreen.show();
SoundManager.createSound(SndAtmasfera);
SoundManager.playMusic(MscTheEnd);
}
public function makeDiscovery(_arg1:int):void{
var _local2:DiscoveryMessage;
var _local3:DiscoveryMessage;
if ((((discoveryScreen.make(_arg1) == true)) && ((gameScreen.visible == true)))){
SoundManager.createSound(SndEffect01);
_local2 = (gameScreen.getChildByName("discoveryMessage") as DiscoveryMessage);
if (_local2 != null){
_local2.remove();
};
_local3 = new DiscoveryMessage(_arg1);
_local3.name = "discoveryMessage";
gameScreen.addChild(_local3);
};
}
public function interfaceUpdated():void{
dispatchEvent(new Event("UPDATE_INTERFACE"));
}
public function setKeyboardControl():void{
gameControl = 2;
dispatchEvent(new Event("UPDATE_CONTROL"));
}
public function setMouseControl():void{
gameControl = 1;
dispatchEvent(new Event("UPDATE_CONTROL"));
}
public function getTotalScore():int{
var _local1:int;
var _local2:int;
while (_local2 < Levels.levels.length) {
if (Levels.levels[_local2].bestScore == null){
Levels.levels[_local2].bestScore = int(0);
};
_local1 = (_local1 + Levels.levels[_local2].bestScore);
_local2++;
};
return (_local1);
}
public function getLevelScore():int{
return (levelScore);
}
public function getBestLevelScore():int{
return (curLevel.bestScore);
}
public function increaseLevelScore(_arg1:int, _arg2:Number=1):int{
var _local3:EScoreText;
if (_arg1 > 0){
if (gameScreen.visible == true){
gameScreen.increaseScoreEffect.gotoAndPlay(1);
_local3 = new EScoreText();
_local3.scoreText.text = ("+" + (_arg1 * int((scoreXCoef * _arg2))));
gameScreen.increaseScoreEffect.addChild(_local3);
};
};
levelScore = (levelScore + (_arg1 * int((scoreXCoef * _arg2))));
interfaceUpdated();
return ((_arg1 * int((scoreXCoef * _arg2))));
}
public function powerUp():void{
gameScreen.powerUp.gotoAndPlay(1);
playerPower = 1;
}
public function powerDown():void{
gameScreen.powerDown.gotoAndPlay(1);
playerPower = 0;
}
public function pause(_arg1:Boolean=true):void{
gamePaused = _arg1;
if (_arg1){
dispatchEvent(new Event("PAUSE_GAME"));
} else {
dispatchEvent(new Event("UNPAUSE_GAME"));
};
}
public function setQuality(_arg1:int):void{
switch (_arg1){
case 0:
stage.quality = StageQuality.LOW;
break;
case 1:
stage.quality = StageQuality.MEDIUM;
break;
case 2:
stage.quality = StageQuality.BEST;
break;
default:
stage.quality = StageQuality.BEST;
};
}
public function createEffect(_arg1:Class):void{
var _local2:MovieClip = new (_arg1);
_local2.x = (gameScreen.level.x + gameScreen.level.player.getCX());
_local2.y = ((gameScreen.level.y + gameScreen.level.player.getCY()) - 80);
gameScreen.addChild(_local2);
}
public function handleAdded(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, handleAdded);
MochiServices.connect("f5bed552d7d53fcc", root);
}
public function submitScore(){
var o:Object = {n:[3, 3, 15, 10, 9, 5, 8, 0, 11, 8, 4, 9, 15, 11, 6, 2], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
var boardID:String = o.f(0, "");
var playerscore:MochiDigits = new MochiDigits(getTotalScore());
MochiScores.showLeaderboard({boardID:boardID, score:playerscore, onDisplay:function ():void{
}, onClose:function ():void{
}, onError:function ():void{
}});
}
public static function getInstance():Doc{
return (instance);
}
}
}//package src
Section 86
//EndLevelScreen (src.EndLevelScreen)
package src {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.text.*;
public class EndLevelScreen extends Screen {
public var timeArrow:MovieClip;
public var continueButton:MovieClip;
public var spentTimeText:TextField;
public var bestLevelScoreText:TextField;
public var levelTimeText:TextField;
public var levelScoreText:TextField;
public var scoreBoard:MovieClip;
public var prevMoney:Number;
public var levelMoney:Number;
protected var bg:MovieClip;
public var curBalloon:int;// = 0
public var balloonCount:int;// = 0
public var time:Number;// = 0
public var score:Number;// = 0
public var scoreWithoutTime:Number;// = 0
public var dx:Number;
protected var allShown:Boolean;// = false
protected var timeoutId:uint;
protected var curBlownTextField:TextField;
var isContinueButtonClicked:Boolean;// = false
public var adShowCount:int;// = 0
public function EndLevelScreen(){
timeArrow.stop();
}
override public function onInit():void{
continueButton.caption.text = Loc.ENDLEVEL_BTN_CONTINUE;
continueButton.addEventListener(MouseEvent.CLICK, continueButtonClicked);
}
override public function show():void{
SoundManager.stopAllSounds();
super.show();
allShown = false;
spentTimeText.text = MyUtils.timeToText((doc.curLevel.duration - doc.levelTime));
bestLevelScoreText.text = "";
levelTimeText.text = MyUtils.timeToText(doc.levelTime);
levelScoreText.text = "";
time = doc.levelTime;
score = (doc.getLevelScore() + doc.curLevel.winScore);
calcScores();
timeArrow.visible = false;
updateBG();
stage.addEventListener(MouseEvent.CLICK, mouseClicked);
timeoutId = setTimeout(beginCalc, 1000);
}
override public function hide():void{
clearTimeout(timeoutId);
timeArrow.stop();
if (bg != null){
MyUtils.stopMovie(bg);
};
if (stage != null){
stage.removeEventListener(MouseEvent.CLICK, mouseClicked);
};
removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
super.hide();
}
public function beginCalc():void{
dx = (time / 80);
if (dx < 0.7){
dx = 0.7;
};
addEventListener(Event.ENTER_FRAME, handleEnterFrame);
timeArrow.visible = true;
isContinueButtonClicked = false;
timeArrow.play();
}
public function handleEnterFrame(_arg1:Event):void{
if (time > 0){
time = (time - dx);
levelTimeText.text = MyUtils.timeToText(time);
score = (score + dx);
levelScoreText.text = int(score).toString();
} else {
showAll();
};
}
public function mouseClicked(_arg1:MouseEvent):void{
if (((!((bg == null))) && (!((bg.kaban == null))))){
bg.kaban.gotoAndPlay(1);
};
if (allShown == false){
showAll();
};
if (isContinueButtonClicked == false){
SoundManager.createSound(SndKaban01);
};
}
public function calcScores():void{
doc.increaseLevelScore(doc.curLevel.winScore);
doc.increaseLevelScore(doc.levelTime);
doc.curLevel.score = doc.getLevelScore();
if ((((doc.curLevel.bestScore == null)) || ((doc.curLevel.bestScore < doc.curLevel.score)))){
doc.curLevel.bestScore = doc.curLevel.score;
};
doc.saveGame();
}
public function showAll():void{
clearTimeout(timeoutId);
removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
if (allShown == true){
return;
};
allShown = true;
levelTimeText.text = MyUtils.timeToText(0);
levelScoreText.text = doc.getLevelScore().toString();
timeArrow.visible = false;
timeArrow.stop();
bestLevelScoreText.text = doc.curLevel.bestScore.toString();
SoundManager.createSound(SndMoney);
}
public function continueButtonClicked(_arg1:MouseEvent):void{
SoundManager.stopAllSounds();
isContinueButtonClicked = true;
if (doc.levelNum > doc.levelCount){
doc.showTheEndScreen();
} else {
if (adShowCount >= 1){
adShowCount = 0;
(root as RootClass).showAd();
} else {
adShowCount++;
};
doc.showSelectLevelScreen();
};
if (stage != null){
stage.removeEventListener(MouseEvent.CLICK, mouseClicked);
};
}
public function updateBG():void{
if (((!((bg == null))) && (contains(bg)))){
MyUtils.stopMovie(bg);
removeChild(bg);
};
bg = new doc.curLevel.endLevelScreenBG();
bg.x = 278;
bg.y = 200;
addChildAt(bg, 0);
}
}
}//package src
Section 87
//Farmer (src.Farmer)
package src {
public dynamic class Farmer extends ScaredEnemy {
var inPool:Pool;// = null
var isUnderwater:Boolean;// = false
var wasTargetContact:Boolean;// = false
public var animationList:AnimationList;
public function Farmer(){
animationList = new AnimationList(this);
animationList.cacheAnimation("AnimScaredFarmerScare");
animationList.cacheAnimation("AnimScaredFarmerStayRight");
animationList.cacheAnimation("AnimScaredFarmerStayLeft");
animationList.cacheAnimation("AnimScaredFarmerStayDown");
animationList.cacheAnimation("AnimScaredFarmerStayUp");
animationList.cacheAnimation("AnimScaredFarmerMoveLeft");
animationList.cacheAnimation("AnimScaredFarmerMoveRight");
animationList.cacheAnimation("AnimScaredFarmerMoveDown");
animationList.cacheAnimation("AnimScaredFarmerMoveUp");
animationList.cacheAnimation("AnimScaredFarmerFallRight");
animationList.cacheAnimation("AnimScaredFarmerFallLeft");
animationList.cacheAnimation("AnimScaredFarmerFallUp");
animationList.cacheAnimation("AnimScaredFarmerFallDown");
animationList.cacheAnimation("AnimScaredFarmerInPool");
animationList.cacheAnimation("AnimScaredFarmerUnderWater");
step = 5;
}
override public function pause(_arg1:Boolean=true):void{
super.pause(_arg1);
animationList.pause(_arg1);
}
override public function onTargetContact():void{
if (wasTargetContact == false){
wasTargetContact = true;
doc.increaseLevelScore(5);
};
}
override public function checkInteractions():void{
var _local4:FarmerWithPitchfork;
if (boundZone == null){
return;
};
level.collisionList.swapTarget(boundZone);
var _local1:Array = level.collisionList.checkCollisions();
var _local2:Object;
var _local3:uint;
while (_local3 < _local1.length) {
if (_local1[_local3].object1.parent == this){
_local2 = _local1[_local3].object2;
} else {
_local2 = _local1[_local3].object1;
};
if ((_local2.parent is Pool)){
if (inPool == null){
diveIntoPool(_local2.parent);
};
return;
} else {
if ((_local2.parent is Gate)){
doc.makeDiscovery(Discovery.FARMER_OPEN_DOOR);
(_local2.parent as Gate).openGate();
} else {
if ((_local2.parent is Pitchfork)){
if ((this is FarmerWithPitchfork) == false){
SoundManager.createSound(SndPitchfork, false, false);
doc.makeDiscovery(Discovery.FARMER_WITH_PITCHFORKS);
_local4 = new FarmerWithPitchfork();
_local4.x = x;
_local4.y = y;
parent.addChild(_local4);
checkDepth();
remove();
(_local2.parent as Pitchfork).remove();
return;
};
};
};
};
_local3++;
};
inPool = null;
}
public function diveIntoPool(_arg1:Pool=null):void{
if (_arg1 == null){
if (inPool == null){
return;
};
} else {
inPool = _arg1;
};
if (((!((inPool.victim == null))) && (!((inPool.victim == this))))){
return;
};
setCX(((inPool.boundZone.x + inPool.x) + (inPool.boundZone.width / 2)));
setCY(((inPool.boundZone.y + inPool.y) + (inPool.boundZone.height / 2)));
gotoAndPlay("diveIntoPool");
isMovable = false;
inPool.victim = this;
}
public function outOfPool():void{
state = STAY;
isMovable = true;
if (inPool.victim == this){
inPool.victim = null;
};
x = (x + 20);
}
public function playAnimation(_arg1:String, _arg2:Boolean=true, _arg3:Function=null):void{
animationList.stopAllAnimations();
animationList.play(_arg1, _arg2, _arg3);
}
override public function updateAnimation():void{
if (state == RUN){
if (directionX != 0){
if ((((directionX < 0)) && (!((currentLabel == "moveLeft"))))){
gotoAndPlay("moveLeft");
};
if ((((directionX > 0)) && (!((currentLabel == "moveRight"))))){
gotoAndPlay("moveRight");
};
} else {
if ((((directionY < 0)) && (!((currentLabel == "moveUp"))))){
gotoAndPlay("moveUp");
};
if ((((directionY > 0)) && (!((currentLabel == "moveDown"))))){
gotoAndPlay("moveDown");
};
};
} else {
if (state == STAY){
if (directionX != 0){
if ((((directionX < 0)) && (!((currentLabel == "stayLeft"))))){
gotoAndPlay("stayLeft");
};
if ((((directionX > 0)) && (!((currentLabel == "stayRight"))))){
gotoAndPlay("stayRight");
};
} else {
if ((((directionY < 0)) && (!((currentLabel == "stayUp"))))){
gotoAndPlay("stayUp");
};
if ((((directionY > 0)) && (!((currentLabel == "stayDown"))))){
gotoAndPlay("stayDown");
};
};
} else {
if ((((state == FALL)) && ((fallTime == 0)))){
createBlow();
if (targetObject.directionX != 0){
if ((((targetObject.directionX < 0)) && (!((currentLabel == "fallLeft"))))){
gotoAndPlay("fallLeft");
} else {
if (currentLabel != "fallRight"){
gotoAndPlay("fallRight");
};
};
} else {
if ((((targetObject.directionY < 0)) && (!((currentLabel == "fallUp"))))){
gotoAndPlay("fallUp");
} else {
if (currentLabel != "fallDown"){
gotoAndPlay("fallDown");
};
};
};
};
};
};
}
}
}//package src
Section 88
//FarmerWithPitchfork (src.FarmerWithPitchfork)
package src {
import flash.events.*;
public class FarmerWithPitchfork extends Farmer {
var overtakeDist:Number;// = 30
public function FarmerWithPitchfork(){
addFrameScript(23, frame24, 47, frame48, 71, frame72, 95, frame96, 113, frame114, 131, frame132, 141, frame142, 151, frame152, 152, frame153, 199, frame200, 201, frame202, 202, frame203, 218, frame219);
}
override public function handleEnterFrame(_arg1:Event):void{
checkInteractions();
if (isMovable == false){
return;
};
var _local2:* = x;
var _local3:* = y;
var _local4:Number = MyUtils.distanceNumber((targetObject.getCX() - getCX()), (targetObject.getCY() - getCY()));
if ((((isMovable == true)) && ((overtakeDist > _local4)))){
createBlow();
doc.gameOver();
return;
};
if ((((state == RUN)) && ((_local4 > maxDistToTargetObject)))){
state = STAY;
updateAnimation();
return;
};
if ((((state == STAY)) && ((_local4 < minDistToTargetObject)))){
SoundManager.createSound(SndAngry, false, false);
state = RUN;
target.x = (targetObject.getCX() - (getCX() - x));
target.y = (targetObject.getCY() - (getCY() - y));
moveToTarget();
direction = Math.atan2((targetObject.getCY() - getCY()), (targetObject.getCX() - getCX()));
if (Math.abs((_local2 - x)) > Math.abs((_local3 - y))){
directionX = (x - _local2);
} else {
directionX = 0;
};
directionY = (y - _local3);
updateAnimation();
};
if (state == RUN){
target.x = (targetObject.getCX() - (getCX() - x));
target.y = (targetObject.getCY() - (getCY() - y));
moveToTarget();
prevDirectionX = directionX;
prevDirectionY = directionY;
if (Math.abs((_local2 - x)) > Math.abs((_local3 - y))){
directionX = (x - _local2);
} else {
directionX = 0;
};
directionY = (y - _local3);
if (((!((directionX == prevDirectionX))) || (!((directionY == prevDirectionY))))){
updateAnimation();
};
checkDepth();
};
}
override public function createBlow():void{
var _local1:Boom01;
SoundManager.createSound(SndFarmerDrop);
_local1 = new Boom01();
_local1.x = targetObject.getCX();
_local1.y = (targetObject.getCY() - 20);
parent.addChildAt(_local1, (parent.numChildren - 1));
}
function frame24(){
gotoAndPlay("stayDown");
updateAnimation();
}
function frame48(){
gotoAndPlay("stayUp");
updateAnimation();
}
function frame72(){
gotoAndPlay("stayRight");
updateAnimation();
}
function frame96(){
gotoAndPlay("stayLeft");
updateAnimation();
}
function frame114(){
gotoAndPlay("moveDown");
updateAnimation();
}
function frame132(){
gotoAndPlay("moveUp");
updateAnimation();
}
function frame142(){
gotoAndPlay("moveRight");
updateAnimation();
}
function frame152(){
gotoAndPlay("moveLeft");
updateAnimation();
}
function frame153(){
SoundManager.createSound(SndWaterIn, false, false);
}
function frame200(){
SoundManager.createSound(SndWaterOut, false, false);
}
function frame202(){
stop();
outOfPool();
updateAnimation();
}
function frame203(){
SoundManager.createSound(SndWaterIn, false, false);
}
function frame219(){
stop();
diveIntoPool();
}
}
}//package src
Section 89
//Flies (src.Flies)
package src {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
public class Flies extends Creature {
var targetObject:MovieClip;
var targetFliesPoint:MovieClip;
var timeToCheckDepth:int;// = 0
public function Flies(){
isDepthable = false;
}
override public function onCreate():void{
parent.setChildIndex(this, (parent.numChildren - 1));
}
public function setTarget(_arg1:MovieClip):void{
step = 5;
boundRect = new Rectangle(0, 38, 40, 32);
targetObject = _arg1;
targetFliesPoint = (targetObject.getChildByName("fliesPoint") as MovieClip);
addEventListener(Event.ENTER_FRAME, handleEnterFrame, false, 0, true);
}
override public function pause(_arg1:Boolean=true):void{
if (_arg1 == true){
stop();
removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
} else {
play();
addEventListener(Event.ENTER_FRAME, handleEnterFrame, false, 0, true);
};
}
public function handleEnterFrame(_arg1:Event):void{
if (targetObject != null){
target.x = (targetObject.x - (width / 2));
target.y = (targetObject.y - 10);
if (targetFliesPoint != null){
target.x = (target.x + targetFliesPoint.x);
target.y = (target.y + targetFliesPoint.y);
};
moveToTargetNoClip();
timeToCheckDepth++;
if (timeToCheckDepth > 30){
timeToCheckDepth = 0;
};
};
}
override public function onRemove():void{
super.onRemove();
removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
}
}
}//package src
Section 90
//Flower (src.Flower)
package src {
import flash.events.*;
public class Flower extends BackElement {
var isCut:Boolean;// = false
public function Flower(){
stop();
}
override public function handleAdded(_arg1:Event):void{
var _local2:Level;
removeEventListener(Event.ENTER_FRAME, handleAdded);
_local2 = (parent as Level);
if (_local2 == null){
return;
};
boundZone.owner = this;
boundZone.visible = false;
_local2.collisionList.addItem(boundZone);
}
public function playerContact():void{
if (isCut == true){
return;
};
isCut = true;
gotoAndPlay("cut");
depthEnable = false;
checkDepth();
Doc.getInstance().curLevel.counter++;
Doc.getInstance().createEffect(EffectFlower01);
var _local1:Level = (parent as Level);
if (_local1 == null){
return;
};
_local1.collisionList.removeItem(boundZone);
}
}
}//package src
Section 91
//GameOverScreen (src.GameOverScreen)
package src {
import flash.events.*;
import flash.net.*;
import flash.text.*;
import flash.display.*;
public class GameOverScreen extends Screen {
public var comment:TextField;
public var bg:MovieClip;
public var restartButton:MovieClip;
public var menuButton:MovieClip;
public var submitScoreButton:MovieClip;
public var moreButton:MovieClip;
public var totalScoreText:TextField;
public function GameOverScreen(){
if (((!((bg == null))) && (!((bg.kaban == null))))){
bg.kaban.gotoAndStop(1);
};
}
override public function onInit():void{
if (((!((bg == null))) && (!((bg.kaban == null))))){
bg.kaban.gotoAndStop(1);
};
restartButton.caption.text = Loc.BTN_RESTART;
restartButton.addEventListener(MouseEvent.CLICK, restartButtonClicked, false, 0, true);
menuButton.addEventListener(MouseEvent.CLICK, onClickMenuButton, false, 0, true);
menuButton.caption.text = Loc.BTN_MAINMENU;
submitScoreButton.caption.text = Loc.GAMEOVER_BTN_SUBMITSCORE;
submitScoreButton.addEventListener(MouseEvent.CLICK, onClickSubmitScoreButton, false, 0, true);
moreButton.caption.text = Loc.MORE_BTN_SUBMITSCORE;
moreButton.addEventListener(MouseEvent.CLICK, onClickMoreButton, false, 0, true);
}
override public function show():void{
SoundManager.stopAllSounds();
super.show();
if (((!((bg == null))) && (!((bg.kaban == null))))){
bg.kaban.play();
};
stage.addEventListener(MouseEvent.CLICK, mouseClicked, false, 0, true);
totalScoreText.text = doc.getTotalScore().toString();
SoundManager.playMusic(MscGameOver);
}
override public function hide():void{
bg.stop();
if (((!((bg == null))) && (!((bg.kaban == null))))){
bg.kaban.gotoAndStop(1);
};
if (stage != null){
stage.removeEventListener(MouseEvent.CLICK, mouseClicked);
};
super.hide();
}
public function mouseClicked(_arg1:MouseEvent):void{
if ((((((visible == true)) && (!((bg == null))))) && (!((bg.kaban == null))))){
bg.kaban.gotoAndPlay(1);
};
}
public function onClickMenuButton(_arg1:MouseEvent){
doc.showMainMenuScreen();
}
public function updateBG():void{
if (((!((bg == null))) && (contains(bg)))){
bg.stop();
removeChild(bg);
};
bg = new Levels.levels[(doc.levelNum - 1)].gameOverScreenBG();
bg.x = 278;
bg.y = 200;
addChildAt(bg, 0);
}
public function restartButtonClicked(_arg1:MouseEvent):void{
doc.restartLevel();
}
public function onClickSubmitScoreButton(_arg1:MouseEvent){
doc.submitScore();
}
public function onClickMoreButton(_arg1:MouseEvent){
var _local2:URLRequest = new URLRequest("http://www.2game.org/?gameid=Kaban");
navigateToURL(_local2, "_blank");
}
}
}//package src
Section 92
//GameScreen (src.GameScreen)
package src {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.text.*;
public class GameScreen extends Screen {
public var optionsButton:MovieClip;
public var powerBar:MovieClip;
public var scoreText:TextField;
public var timeOutText:TextField;
public var timeText:TextField;
public var powerUp:MovieClip;
public var powerDown:MovieClip;
public var increaseScoreEffect:MovieClip;
public var level:Level;
public var levelGUI:MovieClip;
protected var lastFrameTime:int;// = 0
protected var deltaTime:Number;// = 0
public var signal:Boolean;// = false
public var tempo:Number;
public var time:Number;
public function GameScreen(){
increaseScoreEffect.stop();
}
override public function onInit():void{
doc.addEventListener("UPDATE_INTERFACE", updateInterface, false, 0, true);
doc.addEventListener("PAUSE_GAME", handlePauseGame, false, 0, true);
doc.addEventListener("UNPAUSE_GAME", handleUnPauseGame, false, 0, true);
optionsButton.addEventListener(MouseEvent.CLICK, optionsButtonClicked, false, 0, true);
}
override public function show():void{
super.show();
stage.removeEventListener(KeyboardEvent.KEY_UP, reportKeyUp);
stage.addEventListener(KeyboardEvent.KEY_UP, reportKeyUp, false, 0, true);
powerUp.gotoAndStop("stop");
powerDown.gotoAndStop("stop");
increaseScoreEffect.gotoAndStop("stop");
}
override public function hide():void{
removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
if (stage != null){
stage.removeEventListener(KeyboardEvent.KEY_UP, reportKeyUp);
};
if (level != null){
MyUtils.stopMovie(level);
if (contains(level)){
removeChild(level);
};
};
level = null;
if (((!((levelGUI == null))) && (contains(levelGUI)))){
removeChild(levelGUI);
levelGUI = null;
};
super.hide();
}
public function optionsButtonClicked(_arg1:MouseEvent):void{
doc.showOptionsScreen();
}
public function updateInterface(_arg1:Event=null):void{
scoreText.text = doc.getLevelScore().toString();
}
public function beginLevel():void{
var levelClass:Class;
timeOutText.visible = false;
try {
if (((!((level == null))) && (contains(level)))){
removeChild(level);
};
levelClass = (getDefinitionByName(("Level" + doc.levelNum)) as Class);
level = (new (levelClass) as Level);
level.name = "level";
addChildAt(level, 0);
addEventListener(Event.ENTER_FRAME, handleEnterFrame, false, 0, true);
lastFrameTime = getTimer();
if (doc.curLevel.levelGUI != null){
levelGUI = new doc.curLevel.levelGUI();
addChild(levelGUI);
};
} catch(e:ReferenceError) {
level = null;
};
updateInterface();
}
function reportKeyUp(_arg1:KeyboardEvent):void{
if ((((_arg1.keyCode == 80)) || ((_arg1.keyCode == 27)))){
doc.showOptionsScreen();
};
if (_arg1.keyCode == 82){
doc.endLevel();
};
if (_arg1.keyCode == 81){
level.printDepth();
};
if (_arg1.keyCode == 77){
level.switchMask();
};
}
public function handlePauseGame(_arg1:Event):void{
pause(true);
}
public function handleUnPauseGame(_arg1:Event):void{
pause(false);
}
public function pause(_arg1:Boolean=true):void{
if (level != null){
level.pause(_arg1);
};
if (_arg1 == true){
removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
} else {
lastFrameTime = getTimer();
addEventListener(Event.ENTER_FRAME, handleEnterFrame, false, 0, true);
};
}
public function handleEnterFrame(_arg1:Event):void{
deltaTime = ((getTimer() - lastFrameTime) / 1000);
lastFrameTime = getTimer();
updateLevelTime(deltaTime);
powerBar.scaleX = doc.playerPower;
}
function getFPS():Number{
if (signal == true){
time = getTimer();
} else {
tempo = int((1000 / (getTimer() - time)));
};
signal = !(signal);
return (tempo);
}
public function updateLevelTime(_arg1:Number):void{
var _local2:String;
doc.levelTime = (doc.levelTime - ((_arg1 * getFPS()) / 30));
if (doc.levelTime <= 0){
doc.gameOver();
return;
};
timeText.text = MyUtils.timeToText(doc.levelTime);
if (doc.levelTime <= 10){
_local2 = timeOutText.text;
timeOutText.text = timeText.text;
if (_local2 != timeOutText.text){
SoundManager.createSound(SndTimeOver);
};
timeOutText.visible = true;
};
}
}
}//package src
Section 93
//Gate (src.Gate)
package src {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
public class Gate extends BackElement {
var isOpen:Boolean;// = true
public function Gate(){
stop();
}
override public function handleAdded(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, handleAdded);
level = (parent as Level);
if (level == null){
return;
};
closeGate();
gotoAndStop("closed");
boundZone.owner = this;
boundZone.visible = false;
level.collisionList.addItem(boundZone);
}
public function closeGate():void{
var maskClass:Class;
var bitmapData:BitmapData;
if (isOpen == false){
return;
};
isOpen = false;
gotoAndPlay("close");
var className:String = (getQualifiedClassName(this) + "Mask1");
try {
maskClass = (getDefinitionByName(className) as Class);
bitmapData = new maskClass(0, 0);
level.bgMask.bitmapData.copyPixels(bitmapData, new Rectangle(0, 0, bitmapData.width, bitmapData.height), new Point(x, y), null, null, true);
} catch(e:Error) {
};
}
public function openGate():void{
var maskClass:Class;
var antiMaskBitmapData:BitmapData;
var maskBitmapData:BitmapData;
var rect:Rectangle;
var myBitmapData:BitmapData;
if (isOpen == true){
return;
};
isOpen = true;
gotoAndPlay("closed");
var classNameAnti:String = (getQualifiedClassName(this) + "AntiMask1");
var classNameMask:String = (getQualifiedClassName(this) + "Mask2");
try {
maskClass = (getDefinitionByName(classNameAnti) as Class);
antiMaskBitmapData = new maskClass(0, 0);
maskClass = (getDefinitionByName(classNameMask) as Class);
maskBitmapData = new maskClass(0, 0);
rect = new Rectangle(0, 0, maskBitmapData.width, maskBitmapData.height);
myBitmapData = new BitmapData(maskBitmapData.width, maskBitmapData.height, true, 0xFF0000);
myBitmapData.copyPixels(level.bgMask.bitmapData, new Rectangle(x, y, antiMaskBitmapData.width, antiMaskBitmapData.height), new Point(0, 0), antiMaskBitmapData);
myBitmapData.copyPixels(maskBitmapData, new Rectangle(0, 0, maskBitmapData.width, maskBitmapData.height), new Point(0, 0), null, null, true);
level.bgMask.bitmapData.copyPixels(myBitmapData, new Rectangle(0, 0, maskBitmapData.width, maskBitmapData.height), new Point(x, y));
} catch(e:Error) {
};
}
}
}//package src
Section 94
//GraphicsBtn (src.GraphicsBtn)
package src {
public class GraphicsBtn extends GameButton {
var doc:Doc;
public static const LOW:String = "low";
public static const MED:String = "med";
public static const HIGH:String = "high";
public function GraphicsBtn(){
doc = Doc.getInstance();
super();
setState(HIGH);
}
override public function onClick():void{
if (state == LOW){
setState(MED);
doc.setQuality(1);
} else {
if (state == MED){
setState(HIGH);
doc.setQuality(2);
} else {
setState(LOW);
doc.setQuality(0);
};
};
}
}
}//package src
Section 95
//HelpScreen (src.HelpScreen)
package src {
import flash.events.*;
import flash.display.*;
public class HelpScreen extends Screen {
public var backButton:MovieClip;
public var playButton:MovieClip;
override public function onInit():void{
backButton.addEventListener(MouseEvent.CLICK, onBackButtonClick, false, 0, true);
backButton.caption.text = Loc.BTN_BACK;
playButton.caption.text = Loc.BTN_PLAY;
playButton.addEventListener(MouseEvent.CLICK, playButtonClicked, false, 0, true);
}
public function onBackButtonClick(_arg1:MouseEvent){
doc.showMainMenuScreen();
}
public function playButtonClicked(_arg1:MouseEvent):void{
doc.showSelectLevelScreen();
}
}
}//package src
Section 96
//KabanEyes (src.KabanEyes)
package src {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
public dynamic class KabanEyes extends MovieClip {
public var targetObject:MovieClip;
public var targetFliesPoint:MovieClip;
public var eye1LocalPos:Point;
public var eye2LocalPos:Point;
public var eye1Pos:Point;
public var eye2Pos:Point;
public var eye1:KabanEye;
public var eye2:KabanEye;
public function KabanEyes(){
addEventListener(Event.ADDED_TO_STAGE, handleAdded, false, 0, true);
addEventListener(Event.REMOVED_FROM_STAGE, handleRemoved, false, 0, true);
}
private function handleAdded(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, handleAdded);
stage.addEventListener(MouseEvent.MOUSE_MOVE, handleMouseMove, false, 0, true);
stage.addEventListener(MouseEvent.CLICK, handleMouseClick, false, 0, true);
eye1LocalPos = new Point(eye1.x, eye1.y);
eye1Pos = localToGlobal(eye1LocalPos);
eye2LocalPos = new Point(eye2.x, eye2.y);
eye2Pos = localToGlobal(eye2LocalPos);
}
private function handleRemoved(_arg1:Event):void{
removeEventListener(Event.REMOVED_FROM_STAGE, handleRemoved);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleMouseMove);
stage.removeEventListener(MouseEvent.CLICK, handleMouseClick);
}
public function handleMouseClick(_arg1:MouseEvent):void{
gotoAndPlay(2);
}
public function handleMouseMove(_arg1:MouseEvent):void{
var _local2:Number = MyUtils.distance((_arg1.stageX - eye1Pos.x), (_arg1.stageY - eye1Pos.y));
if (_local2 < 10){
_local2 = 10;
};
eye1.x = (eye1LocalPos.x + ((_arg1.stageX - eye1Pos.x) / (_local2 / 5)));
eye1.y = (eye1LocalPos.y + ((_arg1.stageY - eye1Pos.y) / (_local2 / 5)));
eye2.x = (eye2LocalPos.x + ((_arg1.stageX - eye2Pos.x) / (_local2 / 5)));
eye2.y = (eye2LocalPos.y + ((_arg1.stageY - eye2Pos.y) / (_local2 / 5)));
}
}
}//package src
Section 97
//KeyboardControlButton (src.KeyboardControlButton)
package src {
import flash.events.*;
public class KeyboardControlButton extends GameButton {
public function KeyboardControlButton(){
Doc.getInstance().addEventListener("UPDATE_CONTROL", updateControl, false, 0, true);
}
override public function handleAdded(_arg1:Event):void{
super.handleAdded(_arg1);
updateControl();
}
public function updateControl(_arg1:Event=null):void{
if (Doc.getInstance().gameControl == 2){
setState("active");
} else {
setState("passive");
};
}
override public function onClick():void{
if (Doc.getInstance().gameControl != 2){
setState("active");
Doc.getInstance().setKeyboardControl();
};
}
}
}//package src
Section 98
//Level (src.Level)
package src {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class Level extends MovieClip {
public var bgMask:Bitmap;
public var collisionList:CollisionList;
public var triggersList:Array;
public var levelRect:MovieClip;
public var player:Player;
public var bg:MovieClip;
public var isNeedCheckDepth:Boolean;// = false
public var lastDepthCheckTime:int;// = 0
public function Level(){
triggersList = new Array();
super();
addEventListener(Event.ADDED_TO_STAGE, handleAdded);
addEventListener(Event.REMOVED_FROM_STAGE, handleRemoved);
var _local1:BitmapData = new BitmapData(levelRect.width, levelRect.height, true, 0);
bgMask = new Bitmap(_local1);
var _local2:Number = bgMask.width;
var _local3:Number = bgMask.height;
bgMask.bitmapData.copyPixels(new BitmapData(levelRect.width, 10, false, 0), new Rectangle(0, 0, levelRect.width, 10), new Point(0, 20));
bgMask.bitmapData.copyPixels(new BitmapData(levelRect.width, 10, false, 0), new Rectangle(0, 0, levelRect.width, 10), new Point(0, (levelRect.height - 15)));
bgMask.bitmapData.copyPixels(new BitmapData(10, levelRect.height, false, 0), new Rectangle(0, 0, 10, levelRect.height), new Point(0, 0));
bgMask.bitmapData.copyPixels(new BitmapData(20, levelRect.height, false, 0), new Rectangle(0, 0, 20, levelRect.height), new Point((levelRect.width - 20), 0));
triggersList = new Array();
levelRect.visible = false;
if (bg == null){
trace("Level::Level ERROR no bg");
};
Doc.getInstance().printTime("Level::Level");
}
public function pause(_arg1:Boolean=true):void{
var _local3:Creature;
var _local2:int;
while (_local2 < numChildren) {
_local3 = (getChildAt(_local2) as Creature);
if (_local3 != null){
_local3.pause(_arg1);
};
_local2++;
};
_local2 = 0;
while (_local2 < bg.numChildren) {
_local3 = (bg.getChildAt(_local2) as Creature);
if (_local3 != null){
_local3.pause(_arg1);
};
_local2++;
};
if (_arg1 == true){
removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
} else {
addEventListener(Event.ENTER_FRAME, handleEnterFrame);
};
}
public function handleAdded(_arg1:Event):void{
addEventListener(Event.ENTER_FRAME, handleEnterFrame);
checkDepth();
collisionList = new CollisionList(this);
Doc.getInstance().printTime("Level::handleAdded");
}
public function handleRemoved(_arg1:Event):void{
trace("Level::handleRemoved");
player.stop();
triggersList = null;
removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
removeEventListener(Event.REMOVED_FROM_STAGE, handleRemoved);
}
public function switchMask():void{
if (contains(bgMask)){
removeChild(bgMask);
} else {
addChild(bgMask);
};
}
public function printDepth():void{
var _local2:Depthable;
trace("----------- DEPTH");
trace(("count: " + numChildren));
var _local1:int;
while (_local1 < numChildren) {
_local2 = (getChildAt(_local1) as Depthable);
if (_local2 != null){
if (_local2.depthEnable == true){
trace(((((int((_local2.y + _local2.depthPointY)) + " ") + int(_local2.depthPointY)) + " ") + _local2));
} else {
trace((((((int((_local2.y + _local2.depthPointY)) + " ") + int(_local2.depthPointY)) + " ") + _local2) + " NO DEPTH"));
};
};
_local1++;
};
trace(("count: " + numChildren));
trace("-----------");
}
public function needCheckDepth():void{
isNeedCheckDepth = true;
}
protected function checkDepth():void{
var _local3:DisplayObject;
var _local7:int;
var _local1:Array = new Array();
var _local2:int;
var _local4:int;
while (_local4 < numChildren) {
_local3 = getChildAt(_local4);
if ((((_local3 is Depthable)) && (((_local3 as Depthable).depthEnable == true)))){
_local2 = (_local3.y + (_local3 as Depthable).depthPointY);
} else {
_local2 = 0;
};
if (_local2 < 0){
_local2 = 0;
};
if (_local1[_local2] == null){
_local1[_local2] = new Array();
};
_local1[_local2].push(_local3);
_local4++;
};
var _local5:int;
var _local6:int;
while (_local6 < _local1.length) {
if (_local1[_local6] != null){
_local7 = 0;
while (_local7 < _local1[_local6].length) {
setChildIndex(_local1[_local6][_local7], _local5);
_local5++;
_local7++;
};
};
_local6++;
};
}
public function handleEnterFrame(_arg1:Event):void{
var _local4:int;
if (isNeedCheckDepth == true){
_local4 = getTimer();
if ((_local4 - lastDepthCheckTime) > 100){
lastDepthCheckTime = _local4;
checkDepth();
isNeedCheckDepth = false;
};
};
var _local2:Number = 550;
var _local3:Number = 400;
x = (x - int((((x + player.getCX()) - (_local2 / 2)) / 5)));
if (x < (-(levelRect.width) + _local2)){
x = (-(levelRect.width) + _local2);
};
if (x > 0){
x = 0;
};
y = (y - int(((((y + player.getCY()) - (_local3 / 2)) - 20) / 5)));
if (y < (-(levelRect.height) + _local3)){
y = (-(levelRect.height) + _local3);
};
if (y > 20){
y = 20;
};
}
public function checkObjectIntersect(_arg1:DisplayObject):Boolean{
return (false);
}
}
}//package src
Section 99
//LevelInterface (src.LevelInterface)
package src {
import flash.events.*;
import flash.display.*;
public class LevelInterface extends MovieClip {
public var counter:MovieClip;
public static var doc:Doc;
public function LevelInterface(){
doc = Doc.getInstance();
addEventListener(Event.ENTER_FRAME, handleAdded, false, 0, true);
addEventListener(Event.REMOVED_FROM_STAGE, handleRemoved, false, 0, true);
}
public function handleAdded(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, handleAdded);
if ((parent is GameScreen) == false){
return;
};
if (((((!((doc.curLevel.counter == null))) && (!((doc.curLevel.maxCounter == null))))) && (!((counter == null))))){
counter.gotoAndStop((doc.curLevel.counter + 1));
addEventListener(Event.ENTER_FRAME, handleEnterFrame, false, 0, true);
};
}
public function handleRemoved(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
removeEventListener(Event.REMOVED_FROM_STAGE, handleRemoved);
}
public function handleEnterFrame(_arg1:Event):void{
if (counter.currentFrame != (doc.curLevel.counter + 1)){
counter.gotoAndStop((doc.curLevel.counter + 1));
};
}
}
}//package src
Section 100
//Levels (src.Levels)
package src {
public class Levels {
public static var levels:Array = new Array({duration:50, winScore:30, buttonImg:Level1ButtonImage, screenBG:Level1ScreenBG, endLevelScreenBG:Level1EndLevelScreenBG, gameOverScreenBG:Level1GameOverScreenBG}, {duration:80, winScore:40, buttonImg:Level2ButtonImage, screenBG:Level2ScreenBG, endLevelScreenBG:Level2EndLevelScreenBG, gameOverScreenBG:Level1GameOverScreenBG}, {duration:70, winScore:50, buttonImg:Level3ButtonImage, screenBG:Level3ScreenBG, endLevelScreenBG:Level2EndLevelScreenBG, gameOverScreenBG:Level1GameOverScreenBG}, {duration:120, winScore:60, buttonImg:Level4ButtonImage, screenBG:Level4ScreenBG, endLevelScreenBG:Level4EndLevelScreenBG, gameOverScreenBG:Level1GameOverScreenBG, levelGUI:LevelGUIPiglets, counter:0, maxCounter:3}, {duration:120, winScore:70, buttonImg:Level5ButtonImage, screenBG:Level5ScreenBG, endLevelScreenBG:Level5EndLevelScreenBG, gameOverScreenBG:Level1GameOverScreenBG, levelGUI:LevelGUIPiglets, counter:0, maxCounter:3}, {duration:170, winScore:80, buttonImg:Level6ButtonImage, screenBG:Level6ScreenBG, endLevelScreenBG:Level6EndLevelScreenBG, gameOverScreenBG:Level1GameOverScreenBG}, {duration:170, winScore:90, buttonImg:Level7ButtonImage, screenBG:Level7ScreenBG, endLevelScreenBG:Level7EndLevelScreenBG, gameOverScreenBG:Level1GameOverScreenBG}, {duration:70, winScore:30, buttonImg:Level8ButtonImage, screenBG:Level8ScreenBG, endLevelScreenBG:Level2EndLevelScreenBG, gameOverScreenBG:Level1GameOverScreenBG}, {duration:100, winScore:30, buttonImg:Level9ButtonImage, screenBG:Level9ScreenBG, endLevelScreenBG:Level9EndLevelScreenBG, gameOverScreenBG:Level1GameOverScreenBG, levelGUI:LevelGUIFlowers, counter:0, maxCounter:5}, {duration:140, winScore:30, buttonImg:Level10ButtonImage, screenBG:Level10ScreenBG, endLevelScreenBG:Level10EndLevelScreenBG, gameOverScreenBG:Level1GameOverScreenBG});
}
}//package src
Section 101
//Loc (src.Loc)
package src {
public class Loc {
public static const MAINMENU_BTN_NEWGAME:String = "Play";
public static const MAINMENU_BTN_HELP:String = "How To Play";
public static const MAINMENU_BTN_CREDITS:String = "Credits";
public static const MAINMENU_BTN_MOREGAMES:String = "More Games";
public static const BEGINGAME_BTN_EASY:String = "Easy";
public static const BEGINGAME_BTN_NORMAL:String = "Normal";
public static const BEGINGAME_BTN_HARD:String = "Hard";
public static const ENDLEVEL_BTN_CONTINUE:String = "Continue";
public static const GAMEOVER_BTN_SUBMITSCORE:String = "Submit Score";
public static const BTN_MAINMENU:String = "Menu";
public static const BTN_CONTINUE:String = "Continue";
public static const BTN_RESTART:String = "Restart";
public static const BTN_DISCOVERIES:String = "Discoveries";
public static const OPTIONS_BTN_MENU:String = "quit";
public static const OPTIONS_BTN_CONTINUE:String = "continue";
public static const OPTIONS_BTN_RESTART:String = "restart";
public static const BTN_NEXT_LEVEL:String = "Next Level";
public static const BTN_PLAY:String = "Play";
public static const BTN_BACK:String = "Back";
public static const BTN_QUIT:String = "Quit";
public static const BTN_CLOSE:String = "Close";
public static const TENSION_SPEED:String = "Tension speed";
public static const AMMO_LOAD_SPEED:String = "Firing rate";
public static const LIFE_COUNT:String = "+1 Life";
public static const SHELL_ROCK:String = "Rock";
public static const SHELL_MULTI_ROCK:String = "Multi rock";
public static const SHELL_DYNAMITE:String = "Dynamite";
public static const SHELL_MACE:String = "Mace";
public static const SHELL_BOMB:String = "Bomb";
public static const SHELL_BLACKHOLE:String = "Blackhole";
public static const SHELL_MINE:String = "Fragmentation mine";
public static const MORE_BTN_SUBMITSCORE:String = "More Games";
public static const WEAPON_UPGRADE:Array = new Array(TENSION_SPEED, AMMO_LOAD_SPEED, LIFE_COUNT);
public static const LEVEL_COMPLETE:String = "WELL DONE!";
public static const LEVEL_GAINED_AT_LEVEL:String = "Gained";
public static const LEVEL_MONEY:String = "Level money:";
public static const TOTAL_MONEY:String = "Total money";
public static const LEVEL_SCORE:String = "Level score:";
public static const TOTAL_SCORE:String = "Total score:";
public static const PLAYSCREEN_LEVEL_COMPLETE:String = "Level complete!";
}
}//package src
Section 102
//Logo (src.Logo)
package src {
import flash.events.*;
import flash.net.*;
import flash.display.*;
public class Logo extends MovieClip {
public function Logo(){
this.addEventListener(MouseEvent.CLICK, clickLogo);
this.buttonMode = true;
}
private function clickLogo(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("http://www.2game.org/?gameid=Kaban");
navigateToURL(_local2, "_blank");
}
}
}//package src
Section 103
//MainMenuScreen (src.MainMenuScreen)
package src {
import flash.events.*;
import flash.net.*;
public class MainMenuScreen extends Screen {
public var newGameButton:GameButton;
public var helpButton:GameButton;
public var creditsButton:GameButton;
public var moreGamesButton:GameButton;
override public function onInit():void{
newGameButton.caption.text = Loc.MAINMENU_BTN_NEWGAME;
newGameButton.addEventListener(MouseEvent.CLICK, newGameButtonClicked, false, 0, true);
helpButton.caption.text = Loc.MAINMENU_BTN_HELP;
helpButton.addEventListener(MouseEvent.CLICK, helpButtonClicked, false, 0, true);
creditsButton.caption.text = Loc.MAINMENU_BTN_CREDITS;
creditsButton.addEventListener(MouseEvent.CLICK, creditsButtonClicked, false, 0, true);
moreGamesButton.caption.text = Loc.MAINMENU_BTN_MOREGAMES;
moreGamesButton.addEventListener(MouseEvent.CLICK, moreGamesButtonClicked, false, 0, true);
}
override public function onRemove():void{
newGameButton.removeEventListener(MouseEvent.CLICK, newGameButtonClicked);
helpButton.removeEventListener(MouseEvent.CLICK, helpButtonClicked);
creditsButton.removeEventListener(MouseEvent.CLICK, creditsButtonClicked);
moreGamesButton.removeEventListener(MouseEvent.CLICK, moreGamesButtonClicked);
}
override public function show():void{
super.show();
}
override public function hide():void{
super.hide();
}
public function newGameButtonClicked(_arg1:MouseEvent):void{
doc.showSelectLevelScreen();
}
public function helpButtonClicked(_arg1:MouseEvent):void{
doc.showHelpScreen();
}
public function creditsButtonClicked(_arg1:MouseEvent):void{
doc.showCreditsScreen();
}
public function moreGamesButtonClicked(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.2game.org/?gameid=Kaban"), "_blank");
}
}
}//package src
Section 104
//MouseControlButton (src.MouseControlButton)
package src {
import flash.events.*;
public class MouseControlButton extends GameButton {
public function MouseControlButton(){
Doc.getInstance().addEventListener("UPDATE_CONTROL", updateControl, false, 0, true);
}
override public function handleAdded(_arg1:Event):void{
super.handleAdded(_arg1);
updateControl();
}
public function updateControl(_arg1:Event=null):void{
if (Doc.getInstance().gameControl == 1){
setState("active");
} else {
setState("passive");
};
}
override public function onClick():void{
if (Doc.getInstance().gameControl != 1){
setState("active");
Doc.getInstance().setMouseControl();
};
}
}
}//package src
Section 105
//MusicBtn (src.MusicBtn)
package src {
public class MusicBtn extends GameButton {
public static const ON:String = "on";
public static const OFF:String = "off";
public function MusicBtn(){
if (SoundManager.isMusicOn()){
setState(ON);
} else {
setState(OFF);
};
}
override public function onClick():void{
if (state == ON){
setState(OFF);
SoundManager.switchMusic(false);
} else {
setState(ON);
SoundManager.switchMusic(true);
};
}
}
}//package src
Section 106
//Obstacle (src.Obstacle)
package src {
import flash.events.*;
public class Obstacle extends BackElement {
override public function handleAdded(_arg1:Event):void{
var _local2:BackElement;
var _local3:*;
super.handleAdded(_arg1);
if (level != null){
_local3 = 0;
while (_local3 < level.numChildren) {
_local2 = (level.getChildAt(_local3) as BackElement);
if (((((!((_local2 == null))) && (!((_local2 == this))))) && (((_local2.y + _local2.depthPointY) == (y + depthPointY))))){
parent.removeChild(this);
_local2.addChild(this);
x = (x - _local2.x);
y = (y - _local2.y);
this.cacheAsBitmap = true;
_local2.cacheAsBitmap = true;
};
_local3++;
};
};
}
}
}//package src
Section 107
//OptionsScreen (src.OptionsScreen)
package src {
import flash.events.*;
import flash.display.*;
public class OptionsScreen extends Screen {
public var keyboardButton:MovieClip;
public var mouseButton:MovieClip;
public var restartButton:MovieClip;
public var continueButton:MovieClip;
public var mainMenuButton:MovieClip;
public var discoveryButton:MovieClip;
public function OptionsScreen(){
restartButton.caption.text = Loc.OPTIONS_BTN_RESTART;
restartButton.addEventListener(MouseEvent.CLICK, restartButtonClicked);
continueButton.caption.text = Loc.OPTIONS_BTN_CONTINUE;
continueButton.addEventListener(MouseEvent.CLICK, continueButtonClicked);
mainMenuButton.caption.text = Loc.OPTIONS_BTN_MENU;
mainMenuButton.addEventListener(MouseEvent.CLICK, mainMenuButtonClicked);
discoveryButton.caption.text = Loc.BTN_DISCOVERIES;
discoveryButton.addEventListener(MouseEvent.CLICK, discoveryButtonClicked);
}
public function restartButtonClicked(_arg1:MouseEvent):void{
doc.restartLevel();
}
public function continueButtonClicked(_arg1:MouseEvent):void{
doc.hideOptionsScreen();
}
public function mainMenuButtonClicked(_arg1:MouseEvent):void{
doc.showMainMenuScreen();
}
public function discoveryButtonClicked(_arg1:MouseEvent):void{
doc.showDiscoveryScreen();
}
}
}//package src
Section 108
//Piglet (src.Piglet)
package src {
import flash.geom.*;
import flash.events.*;
import flash.display.*;
public dynamic class Piglet extends Creature {
var player:Creature;
var runMaxDistToPlayer:Number;
var runMinDistToPlayer:Number;
var stayDistToPlayer:Number;// = 10
public var stateStr:Array;
var stayTime:Number;// = 60
var stayPos:Point;
public var state:int;// = 0
public var prevX:Number;
public var prevY:Number;
public var targetDX:Number;// = 0
public var targetDY:Number;// = 0
public var isFinded:Boolean;// = false
public var wasFinded:Boolean;// = false
var inPool:Pool;// = null
public static const STAY:int = 0;
public static const RUN_TO_PLAYER:int = 1;
public static const RUN_RANDOM:int = 2;
public function Piglet(){
stateStr = new Array("STAY", "RUN_TO_PLAYER", "RUN_RANDOM");
super();
addFrameScript(6, frame7, 13, frame14, 20, frame21, 34, frame35, 48, frame49, 62, frame63, 69, frame70, 82, frame83, 84, frame85, 132, frame133, 134, frame135, 135, frame136, 151, frame152, 169, frame170);
}
override public function onCreate():void{
step = 4;
stayDistToPlayer = (10 + (Math.random() * 40));
runMinDistToPlayer = (stayDistToPlayer + (Math.random() * 50));
runMaxDistToPlayer = (200 + (Math.random() * 50));
player = Doc.getInstance().getCurLevelClip().player;
boundRect = new Rectangle(boundZone.x, boundZone.y, boundZone.width, boundZone.height);
boundZone.visible = false;
stayPos = new Point(getCX(), getCY());
gotoAndPlay("stayRight");
addEventListener(Event.ENTER_FRAME, handleEnterFrame, false, 0, true);
}
override public function pause(_arg1:Boolean=true):void{
var _local2:int;
var _local3:int;
if (_arg1 == true){
stop();
_local2 = 0;
while (_local2 < numChildren) {
if ((getChildAt(_local2) is MovieClip)){
(getChildAt(_local2) as MovieClip).stop();
};
_local2++;
};
removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
} else {
play();
_local3 = 0;
while (_local3 < numChildren) {
if ((getChildAt(_local3) is MovieClip)){
(getChildAt(_local3) as MovieClip).play();
};
_local3++;
};
addEventListener(Event.ENTER_FRAME, handleEnterFrame, false, 0, true);
};
}
public function handleEnterFrame(_arg1:Event):void{
var _local3:Number;
if (isMovable == false){
return;
};
prevX = x;
prevY = y;
var _local2:Number = MyUtils.distanceNumber((player.getCX() - getCX()), (player.getCY() - getCY()));
if (_local2 > (runMaxDistToPlayer * 2)){
return;
};
if ((((state == RUN_TO_PLAYER)) && ((((_local2 < stayDistToPlayer)) || ((_local2 > runMaxDistToPlayer)))))){
state = STAY;
stayPos = new Point(getCX(), getCY());
updateAnimation();
if (_local2 > runMaxDistToPlayer){
isFinded = false;
Doc.getInstance().curLevel.counter--;
};
};
if (((((!((state == RUN_TO_PLAYER))) && ((_local2 > runMinDistToPlayer)))) && ((_local2 < runMaxDistToPlayer)))){
state = RUN_TO_PLAYER;
targetDX = 0;
targetDY = 0;
runToPlayer();
updateAnimation();
if ((((isFinded == false)) && (!((Doc.getInstance().curLevel.counter == null))))){
Doc.getInstance().curLevel.counter++;
SoundManager.createSound(SndPiglet01);
if (wasFinded == false){
wasFinded = true;
Doc.getInstance().makeDiscovery(Discovery.PIGLET);
doc.createEffect(EffectPiglet01);
};
};
isFinded = true;
};
if (state == RUN_TO_PLAYER){
runToPlayer();
};
if (state == STAY){
stayTime = (stayTime - 1);
if (stayTime < 0){
stayTime = ((Math.random() * 60) + 30);
state = RUN_RANDOM;
target.x = ((x + (Math.random() * 60)) - 30);
target.y = ((y + (Math.random() * 60)) - 30);
runToTarget();
updateAnimation();
};
};
if (state == RUN_RANDOM){
_local3 = MyUtils.distanceNumber((stayPos.x - getCX()), (stayPos.y - getCY()));
if (_local3 > 100){
target.x = ((stayPos.x + (Math.random() * 30)) - 15);
target.y = ((stayPos.y + (Math.random() * 30)) - 15);
};
runToTarget();
};
}
public function runToPlayer():void{
checkInteractions();
if (isMovable == false){
return;
};
target.x = (player.getCX() + targetDX);
target.y = ((player.getCY() + targetDY) - 30);
moveToTarget();
checkDepth();
if ((((prevX == x)) && ((prevY == y)))){
state = STAY;
stayPos = new Point(getCX(), getCY());
updateAnimation();
};
if (Math.abs((prevX - x)) > Math.abs((prevY - y))){
directionX = (x - prevX);
} else {
directionX = 0;
};
directionY = (y - prevY);
}
public function runToTarget():void{
checkInteractions();
if (isMovable == false){
return;
};
moveToTarget();
checkDepth();
if (Math.abs((prevX - x)) > Math.abs((prevY - y))){
directionX = (x - prevX);
} else {
directionX = 0;
};
directionY = (y - prevY);
if ((((Math.abs((target.x - x)) < 10)) && ((Math.abs((target.y - y)) < 10)))){
state = STAY;
updateAnimation();
};
}
public function updateAnimation():void{
if (state != STAY){
if (directionX != 0){
if ((((directionX < 0)) && (!((currentLabel == "moveLeft"))))){
gotoAndPlay("moveLeft");
};
if ((((directionX > 0)) && (!((currentLabel == "moveRight"))))){
gotoAndPlay("moveRight");
};
} else {
if ((((directionY < 0)) && (!((currentLabel == "moveUp"))))){
gotoAndPlay("moveUp");
};
if ((((directionY > 0)) && (!((currentLabel == "moveDown"))))){
gotoAndPlay("moveDown");
};
};
} else {
if (directionX != 0){
if ((((directionX < 0)) && (!((currentLabel == "stayLeft"))))){
gotoAndPlay("stayLeft");
};
if ((((directionX > 0)) && (!((currentLabel == "stayRight"))))){
gotoAndPlay("stayRight");
};
} else {
if ((((directionY < 0)) && (!((currentLabel == "stayUp"))))){
gotoAndPlay("stayUp");
};
if ((((directionY > 0)) && (!((currentLabel == "stayDown"))))){
gotoAndPlay("stayDown");
};
};
};
}
override public function checkInteractions():void{
level.collisionList.swapTarget(boundZone);
var _local1:Array = level.collisionList.checkCollisions();
var _local2:Object;
var _local3:uint;
while (_local3 < _local1.length) {
if (_local1[_local3].object1.parent == this){
_local2 = _local1[_local3].object2;
} else {
_local2 = _local1[_local3].object1;
};
if ((_local2.parent is Pool)){
if (inPool == null){
diveIntoPool(_local2.parent);
};
return;
};
_local3++;
};
inPool = null;
}
public function diveIntoPool(_arg1:Pool=null):void{
if (_arg1 == null){
if (inPool == null){
return;
};
} else {
inPool = _arg1;
};
if (((!((inPool.victim == null))) && (!((inPool.victim == this))))){
return;
};
setCX(((inPool.boundZone.x + inPool.x) + (inPool.boundZone.width / 2)));
setCY(((inPool.boundZone.y + inPool.y) + (inPool.boundZone.height / 2)));
gotoAndPlay("diveIntoPool");
isMovable = false;
inPool.victim = this;
}
public function outOfPool():void{
isMovable = true;
if (inPool.victim == this){
inPool.victim = null;
};
}
override public function onRemove():void{
super.onRemove();
removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
}
function frame7(){
gotoAndPlay("moveRight");
updateAnimation();
}
function frame14(){
gotoAndPlay("moveUp");
updateAnimation();
}
function frame21(){
gotoAndPlay("moveDown");
updateAnimation();
}
function frame35(){
gotoAndPlay("stayRight");
updateAnimation();
}
function frame49(){
gotoAndPlay("stayUp");
updateAnimation();
}
function frame63(){
gotoAndPlay("stayDown");
updateAnimation();
}
function frame70(){
gotoAndPlay("moveLeft");
updateAnimation();
}
function frame83(){
gotoAndPlay("stayLeft");
updateAnimation();
}
function frame85(){
SoundManager.createSound(SndWaterIn, false, false);
}
function frame133(){
SoundManager.createSound(SndWaterOut, false, false);
}
function frame135(){
stop();
outOfPool();
updateAnimation();
}
function frame136(){
trace("Piglet underwater");
}
function frame152(){
trace("Piglet");
}
function frame170(){
stop();
outOfPool();
updateAnimation();
SoundManager.createSound(SndWaterOut, false, false);
}
}
}//package src
Section 109
//Pitchfork (src.Pitchfork)
package src {
import flash.events.*;
public class Pitchfork extends BackElement {
public function Pitchfork(){
if (getChildByName("depthPoint") == null){
depthEnable = false;
};
}
override public function handleAdded(_arg1:Event):void{
var _local2:Level;
removeEventListener(Event.ENTER_FRAME, handleAdded);
_local2 = (parent as Level);
if (_local2 == null){
return;
};
boundZone.owner = this;
boundZone.visible = false;
_local2.collisionList.addItem(boundZone);
}
public function remove():void{
var _local1:Level = (parent as Level);
if (_local1 != null){
_local1.collisionList.removeItem(boundZone);
};
if (parent){
parent.removeChild(this);
};
}
}
}//package src
Section 110
//Player (src.Player)
package src {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
public class Player extends Creature {
public var fliesPoint:MovieClip;
var isRuning:Boolean;// = false
var prevX:int;// = 0
var prevY:int;// = 0
var runFast:Boolean;// = false
var normSpeed:Number;// = 6
var runFastSpeed:Number;// = 9
var leftKeyPressed:Boolean;// = false
var rightKeyPressed:Boolean;// = false
var upKeyPressed:Boolean;// = false
var downKeyPressed:Boolean;// = false
var shiftKeyPressed:Boolean;// = false
var inPool:Pool;// = null
public function Player(){
step = normSpeed;
}
override public function onCreate():void{
stop();
stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown, false, 0, true);
stage.addEventListener(KeyboardEvent.KEY_UP, reportKeyUp, false, 0, true);
if (doc.gameControl == 2){
addEventListener(Event.ENTER_FRAME, handleEnterFrameKeyboardControl, false, 0, true);
} else {
if (doc.gameControl == 1){
addEventListener(Event.ENTER_FRAME, handleEnterFrameMouseControl, false, 0, true);
};
};
updateAnimation();
var _local1:Flies = new Flies();
_local1.x = (x + (width / 2));
_local1.y = (y + height);
_local1.name = "flies";
_local1.setTarget(this);
parent.addChildAt(_local1, (parent.numChildren - 1));
fliesPoint.visible = false;
}
override public function pause(_arg1:Boolean=true):void{
if (_arg1 == true){
stop();
MyUtils.stopMovie(this);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
stage.removeEventListener(KeyboardEvent.KEY_UP, reportKeyUp);
removeEventListener(Event.ENTER_FRAME, handleEnterFrameKeyboardControl);
removeEventListener(Event.ENTER_FRAME, handleEnterFrameMouseControl);
leftKeyPressed = false;
rightKeyPressed = false;
upKeyPressed = false;
downKeyPressed = false;
} else {
stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown, false, 0, true);
stage.addEventListener(KeyboardEvent.KEY_UP, reportKeyUp, false, 0, true);
if (doc.gameControl == 2){
addEventListener(Event.ENTER_FRAME, handleEnterFrameKeyboardControl, false, 0, true);
} else {
if (doc.gameControl == 1){
addEventListener(Event.ENTER_FRAME, handleEnterFrameMouseControl, false, 0, true);
};
};
isRuning = false;
MyUtils.playMovie(this);
gotoAndPlay(currentFrame);
updateAnimation();
};
}
function reportKeyDown(_arg1:KeyboardEvent):void{
if ((((_arg1.charCode == 112)) || ((_arg1.charCode == 27)))){
};
if ((((_arg1.shiftKey == true)) && ((shiftKeyPressed == false)))){
shiftKeyPressed = true;
SoundManager.createSound(SndKaban01, false, true);
};
if ((((_arg1.shiftKey == true)) && ((doc.playerPower >= 0.1)))){
runFast = true;
step = runFastSpeed;
};
if ((((_arg1.keyCode == 87)) || ((_arg1.keyCode == 38)))){
upKeyPressed = true;
};
if ((((_arg1.keyCode == 83)) || ((_arg1.keyCode == 40)))){
downKeyPressed = true;
};
if ((((_arg1.keyCode == 65)) || ((_arg1.keyCode == 37)))){
leftKeyPressed = true;
};
if ((((_arg1.keyCode == 68)) || ((_arg1.keyCode == 39)))){
rightKeyPressed = true;
};
}
function reportKeyUp(_arg1:KeyboardEvent):void{
if ((((_arg1.charCode == 112)) || ((_arg1.charCode == 27)))){
};
if (_arg1.shiftKey == false){
shiftKeyPressed = false;
runFast = false;
step = normSpeed;
};
if ((((_arg1.keyCode == 87)) || ((_arg1.keyCode == 38)))){
upKeyPressed = false;
};
if ((((_arg1.keyCode == 83)) || ((_arg1.keyCode == 40)))){
downKeyPressed = false;
};
if ((((_arg1.keyCode == 65)) || ((_arg1.keyCode == 37)))){
leftKeyPressed = false;
};
if ((((_arg1.keyCode == 68)) || ((_arg1.keyCode == 39)))){
rightKeyPressed = false;
};
}
public function checkTarget():void{
var _local1:Rectangle = new Rectangle((x + boundRect.x), (y + boundRect.y), boundRect.width, boundRect.height);
var _local2:MovieClip;
var _local3:uint;
while (_local3 < level.triggersList.length) {
_local2 = level.triggersList[_local3];
if (_local1.intersects(_local2.getBounds(parent))){
(_local2 as Trigger).onPlayerIntersect();
return;
};
_local3++;
};
}
public function handleEnterFrameKeyboardControl(_arg1:Event):void{
checkInteractions();
checkTarget();
if (isMovable == false){
return;
};
prevX = x;
prevY = y;
directionY = 0;
directionX = 0;
if ((((isRuning == false)) && ((doc.playerPower < 1)))){
doc.playerPower = (doc.playerPower + 0.01);
if (doc.playerPower > 1){
doc.playerPower = 1;
};
};
if ((((upKeyPressed == true)) && ((downKeyPressed == true)))){
} else {
if (upKeyPressed == true){
directionY = -1;
};
if (downKeyPressed == true){
directionY = 1;
};
};
if ((((leftKeyPressed == true)) && ((rightKeyPressed == true)))){
} else {
if (leftKeyPressed == true){
directionX = -1;
};
if (rightKeyPressed == true){
directionX = 1;
};
};
if ((((directionX == 0)) && ((directionY == 0)))){
isRuning = false;
return;
};
prevDirectionX = directionX;
prevDirectionY = directionY;
if (isRuning == false){
isRuning = true;
updateAnimation();
};
target.x = (x + (directionX * 10));
target.y = (y + (directionY * 10));
moveToTargetStreight();
checkDepth();
if ((Math.abs((prevX - x)) - Math.abs((prevY - y))) >= -1){
prevDirectionX = (x - prevX);
} else {
prevDirectionX = 0;
};
prevDirectionY = (y - prevY);
}
public function handleEnterFrameMouseControl(_arg1:Event):void{
checkInteractions();
checkTarget();
if (isMovable == false){
return;
};
prevX = x;
prevY = y;
if ((((isRuning == false)) && ((doc.playerPower < 1)))){
doc.playerPower = (doc.playerPower + 0.01);
if (doc.playerPower > 1){
doc.playerPower = 1;
};
};
if ((((Math.abs((level.mouseX - getCX())) > 25)) || ((Math.abs((level.mouseY - getCY())) > 20)))){
target.x = (level.mouseX + (x - getCX()));
target.y = ((level.mouseY + (y - getCY())) + 20);
moveToTargetStreight();
checkDepth();
if (Math.abs((prevX - x)) > Math.abs((prevY - y))){
directionX = (x - prevX);
} else {
directionX = 0;
};
directionY = (y - prevY);
prevDirectionX = directionX;
prevDirectionY = directionY;
};
if ((((Math.abs((x - prevX)) < 1)) && ((Math.abs((y - prevY)) < 1)))){
x = prevX;
y = prevY;
if (isRuning == true){
isRuning = false;
};
} else {
if (isRuning == false){
isRuning = true;
updateAnimation();
};
};
}
public function updateAnimation():void{
if ((((isMovable == false)) && (!((inPool == null))))){
return;
};
if (isRuning){
if (runFast == false){
if (prevDirectionX != 0){
if ((((prevDirectionX < 0)) && (!((currentLabel == "moveLeft"))))){
gotoAndPlay("moveLeft");
};
if ((((prevDirectionX > 0)) && (!((currentLabel == "moveRight"))))){
gotoAndPlay("moveRight");
};
} else {
if ((((prevDirectionY < 0)) && (!((currentLabel == "moveUp"))))){
gotoAndPlay("moveUp");
};
if ((((prevDirectionY > 0)) && (!((currentLabel == "moveDown"))))){
gotoAndPlay("moveDown");
};
};
} else {
doc.playerPower = (doc.playerPower - 0.1);
if (doc.playerPower <= 0){
runFast = false;
step = normSpeed;
doc.playerPower = 0;
};
if (prevDirectionX != 0){
if ((((prevDirectionX < 0)) && (!((currentLabel == "runLeft"))))){
gotoAndPlay("runLeft");
};
if ((((prevDirectionX > 0)) && (!((currentLabel == "runRight"))))){
gotoAndPlay("runRight");
};
} else {
if ((((prevDirectionY < 0)) && (!((currentLabel == "runUp"))))){
gotoAndPlay("runUp");
};
if ((((prevDirectionY > 0)) && (!((currentLabel == "runDown"))))){
gotoAndPlay("runDown");
};
};
};
} else {
if (prevDirectionX != 0){
if (prevDirectionX < 0){
if (currentLabel != "stayLeft"){
gotoAndPlay("stayLeft");
};
} else {
if (currentLabel != "stayRight"){
gotoAndPlay("stayRight");
};
};
} else {
if (prevDirectionY < 0){
if (currentLabel != "stayUp"){
gotoAndPlay("stayUp");
};
} else {
if (currentLabel != "stayDown"){
gotoAndPlay("stayDown");
};
};
};
};
}
public function createSmoke():void{
var _local1:MovieClip;
if (MyUtils.distanceBox((prevX - x), (prevY - y)) > 2){
if (prevDirectionX != 0){
_local1 = (new Smoke() as MovieClip);
if (prevDirectionX < 0){
_local1.scaleX = -1;
};
} else {
_local1 = (new SmokeUpDown() as MovieClip);
};
_local1.x = (x + 45);
_local1.y = (y + 80);
parent.addChildAt(_local1, parent.getChildIndex(this));
};
}
public function createBigSmoke():void{
var _local1:MovieClip;
var _local2:BigSmoke;
if (MyUtils.distanceBox((prevX - x), (prevY - y)) > 2){
if (prevDirectionX != 0){
_local1 = (new Smoke() as MovieClip);
if (prevDirectionX < 0){
_local1.scaleX = -1;
};
} else {
_local1 = (new SmokeUpDown() as MovieClip);
};
_local1.x = (x + 45);
_local1.y = (y + 80);
parent.addChildAt(_local1, parent.getChildIndex(this));
_local2 = new BigSmoke();
_local2.x = (x + 45);
_local2.y = (y + 80);
parent.addChildAt(_local2, parent.getChildIndex(this));
};
}
override public function checkInteractions():void{
level.collisionList.swapTarget(boundZone);
var _local1:Array = level.collisionList.checkCollisions();
var _local2:Object;
var _local3:uint;
while (_local3 < _local1.length) {
if (_local1[_local3].object1.parent == this){
_local2 = _local1[_local3].object2;
} else {
_local2 = _local1[_local3].object1;
};
if ((_local2.parent is Pool)){
if (inPool == null){
diveIntoPool(_local2.owner);
};
return;
} else {
if ((_local2.parent is Tree)){
(_local2.parent as Tree).playerContact();
} else {
if ((((runFast == true)) && ((_local2.parent is Stack)))){
(_local2.parent as Stack).playerContact();
} else {
if ((_local2.parent is Pumpkin)){
(_local2.parent as Pumpkin).playerContact();
} else {
if ((_local2.parent is Flower)){
(_local2.parent as Flower).playerContact();
};
};
};
};
};
_local3++;
};
inPool = null;
}
public function diveIntoPool(_arg1:Pool):void{
if (_arg1.victim != null){
_arg1.victim.gotoAndPlay("underWater");
if ((_arg1.victim is Farmer)){
doc.makeDiscovery(Discovery.FARMER_IN_POOL);
};
return;
};
doc.makeDiscovery(Discovery.FALL_IN_POOL);
inPool = _arg1;
_arg1.victim = this;
doc.powerDown();
setCX(((_arg1.boundZone.x + _arg1.x) + (_arg1.boundZone.width / 2)));
setCY(((_arg1.boundZone.y + _arg1.y) + (_arg1.boundZone.height / 2)));
gotoAndPlay("diveIntoPool");
isMovable = false;
}
public function outOfPool():void{
isMovable = true;
if (inPool.victim == this){
inPool.victim = null;
};
}
override public function onRemove():void{
super.onRemove();
stop();
stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
stage.removeEventListener(KeyboardEvent.KEY_UP, reportKeyUp);
removeEventListener(Event.ENTER_FRAME, handleEnterFrameKeyboardControl);
removeEventListener(Event.ENTER_FRAME, handleEnterFrameMouseControl);
}
}
}//package src
Section 111
//Pool (src.Pool)
package src {
import flash.events.*;
public class Pool extends BackElement {
public var animationList:AnimationList;
var isOpen:Boolean;// = true
public var victim:Object;// = null
public function Pool(){
animationList = new AnimationList(this);
animationList.cacheAnimation("AnimPool01");
depthEnable = false;
}
override public function handleAdded(_arg1:Event):void{
var _local2:Level;
removeEventListener(Event.ENTER_FRAME, handleAdded);
_local2 = (parent as Level);
if (_local2 == null){
return;
};
boundZone.owner = this;
boundZone.visible = false;
_local2.collisionList.addItem(boundZone);
gotoAndStop(2);
animationList.play("AnimPool01");
}
}
}//package src
Section 112
//Pumpkin (src.Pumpkin)
package src {
import flash.events.*;
public class Pumpkin extends BackElement {
var isCut:Boolean;// = false
public function Pumpkin(){
addFrameScript(2, frame3, 5, frame6);
stop();
}
override public function handleAdded(_arg1:Event):void{
var _local2:Level;
removeEventListener(Event.ENTER_FRAME, handleAdded);
_local2 = (parent as Level);
if (_local2 == null){
return;
};
boundZone.owner = this;
boundZone.visible = false;
_local2.collisionList.addItem(boundZone);
}
public function playerContact():void{
if (isCut == true){
return;
};
isCut = true;
gotoAndPlay("cut");
depthEnable = false;
checkDepth();
Doc.getInstance().makeDiscovery(Discovery.PUMPKIN);
Doc.getInstance().increaseLevelScore(15);
Doc.getInstance().createEffect(EffectPumpkin);
var _local1:Level = (parent as Level);
if (_local1 == null){
return;
};
_local1.collisionList.removeItem(boundZone);
}
function frame3(){
SoundManager.createSound(SndPok, false, false);
}
function frame6(){
stop();
}
}
}//package src
Section 113
//RootClass (src.RootClass)
package src {
import mochi.as3.*;
import CPMStar.*;
import flash.events.*;
import caurina.transitions.*;
import flash.net.*;
import flash.utils.*;
import flash.display.*;
import flash.text.*;
public dynamic class RootClass extends MovieClip {
private var progress:TextField;
public var preloader:Preloader;
public var kaban:KabanLoadrun;
protected var isStarted:Boolean;// = false
public var adBox:AdBox;
public var playButton:MovieClip;
public var airborneAd:MovieClip;
public var interLevelAd:InterLevelAd;
public var sponsor:SponsorSplash;
public var background:Background;
var cpmStarAd:DisplayObject;
public static const IS_SITELOCKED:Boolean = false;
public static const MOCHI_BOT:String = "";
public static const CPM_STAR_PREROLL:String = "";
public static const CPM_STAR_INTERLEVEL:String = "";
public static var COPYRIGHT:String = "//© 2009 Denis 'Arkon' Kukushkin | http://sonargames.ru/ | arkon.sg@gmail.com";
public function RootClass(){
sponsor = new SponsorSplash();
background = new Background();
super();
addFrameScript(2, frame3);
stop();
if (MOCHI_BOT != ""){
MochiBot.track(this, MOCHI_BOT);
};
if (CPM_STAR_PREROLL != ""){
cpmStarAd = new AdLoader(CPM_STAR_PREROLL);
adBox.addChild(cpmStarAd);
adBox.mouseEnabled = false;
cpmStarAd.addEventListener(Event.COMPLETE, dispatchAdCompleteHandler, false, 0, true);
adBox.visible = false;
} else {
removeChild(adBox);
};
playButton.caption.text = "Play!";
playButton.visible = false;
playButton.addEventListener(MouseEvent.CLICK, startup, false, 0, true);
if (checkDomain() == true){
addEventListener(Event.ENTER_FRAME, checkFrame);
} else {
stop();
addChild(new DomainCheckErrorScreen());
};
}
public function dispatchAdCompleteHandler(_arg1:Event=null):void{
adBox.visible = true;
}
private function checkFrame(_arg1:Event):void{
var _local2:Number = stage.loaderInfo.bytesLoaded;
var _local3:Number = stage.loaderInfo.bytesTotal;
var _local4:String = "";
var _local5:int;
if (_local3 > 0){
_local5 = Math.floor(((_local2 / _local3) * 100));
_local4 = (_local5 + "%");
preloader.gotoAndStop(_local5);
kaban.x = (26.8 + ((491 * _local5) / 100));
};
if ((((_local2 == _local3)) || ((_local3 == 0)))){
kaban.visible = false;
removeEventListener(Event.ENTER_FRAME, checkFrame);
if (CPM_STAR_PREROLL == ""){
startup();
} else {
playButton.visible = true;
};
};
}
private function showSponsor():void{
addChild(background);
addChild(sponsor);
sponsor.x = 0;
sponsor.y = 0;
sponsor.alpha = 0;
Tweener.addTween(sponsor, {alpha:1, time:0.5, transition:"easeInSine", onComplete:pauseSponsor});
sponsor.addEventListener(MouseEvent.CLICK, clickSponsor);
sponsor.buttonMode = true;
}
private function pauseSponsor():void{
Tweener.addTween(sponsor, {alpha:1, time:5, transition:"easeInSine", onComplete:hideSponsor});
}
private function hideSponsor():void{
Tweener.addTween(sponsor, {alpha:0, time:0.5, transition:"easeInSine", onComplete:removeSponsor});
}
private function removeSponsor():void{
startGame();
}
private function clickSponsor(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("http://www.2game.org/?gameid=Kaban");
navigateToURL(_local2, "_blank");
}
private function startup(_arg1:Event=null):void{
if (checkDomain() == false){
stop();
addChild(new DomainCheckErrorScreen());
return;
};
if (isStarted == true){
return;
};
isStarted = true;
showSponsor();
}
public function startGame():void{
gotoAndStop(3);
var _local1:Class = (getDefinitionByName("src.Doc") as Class);
addChildAt((new (_local1) as DisplayObject), 0);
removeChild(background);
removeChild(sponsor);
}
public function getDomain():String{
var _local1:String = stage.loaderInfo.url;
var _local2:Number = (_local1.indexOf("://") + 3);
var _local3:Number = _local1.indexOf("/", _local2);
var _local4:String = _local1.substring(_local2, _local3);
var _local5:Number = (_local4.lastIndexOf(".") - 1);
var _local6:Number = (_local4.lastIndexOf(".", _local5) + 1);
_local4 = _local4.substring(_local6, _local4.length);
return (_local4);
}
private function checkDomain():Boolean{
if (IS_SITELOCKED == false){
return (true);
};
var _local1:String = getDomain();
if ((((_local1 == "sonargames.ru")) || ((_local1 == "boar-games.com")))){
return (true);
};
return (true);
}
public function showAd():void{
if (CPM_STAR_INTERLEVEL == ""){
return;
};
interLevelAd = new InterLevelAd();
addChild(interLevelAd);
setTimeout(function (){
interLevelAd.playButton.visible = true;
interLevelAd.playButton.addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent){
removeChild(interLevelAd);
cpmStarAd = null;
}, false, 0, true);
}, 4000);
setTimeout(function (){
if (contains(interLevelAd)){
removeChild(interLevelAd);
};
cpmStarAd = null;
}, 10000);
cpmStarAd = new AdLoader(CPM_STAR_INTERLEVEL);
interLevelAd.adBox.addChild(cpmStarAd);
interLevelAd.adBox.visible = false;
interLevelAd.adBox.mouseEnabled = false;
interLevelAd.playButton.caption.text = "Continue";
interLevelAd.playButton.visible = false;
cpmStarAd.addEventListener(Event.COMPLETE, function (){
interLevelAd.adBox.visible = true;
}, false, 0, true);
}
function frame3(){
stop();
MochiBot.track(this, "979a5141");
}
}
}//package src
Section 114
//ScaredEnemy (src.ScaredEnemy)
package src {
import flash.geom.*;
import flash.events.*;
import flash.display.*;
public dynamic class ScaredEnemy extends Creature {
var targetObject:Creature;
var maxDistToTargetObject:Number;
var minDistToTargetObject:Number;
var fallDistToTargetObject:Number;
public var state:int;// = 0
protected var fallTime:int;// = 0
public static const STAY:int = 0;
public static const SCARED:int = 1;
public static const RUN:int = 2;
public static const FALL:int = 3;
public function ScaredEnemy(){
boundRect = new Rectangle(20, 40, 50, 30);
step = 4;
}
override public function onCreate():void{
fallDistToTargetObject = 50;
minDistToTargetObject = 150;
maxDistToTargetObject = ((250 + (Math.random() * 30)) - 15);
setTarget(level.player);
gotoAndPlay("stayRight");
addEventListener(Event.ENTER_FRAME, handleEnterFrame, false, 0, true);
}
public function setTarget(_arg1:Creature):void{
targetObject = _arg1;
}
override public function pause(_arg1:Boolean=true):void{
if (_arg1 == true){
stop();
MyUtils.stopMovie(this);
removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
} else {
addEventListener(Event.ENTER_FRAME, handleEnterFrame, false, 0, true);
if (state != FALL){
play();
MyUtils.playMovie(this);
} else {
if (getChildByName("stars") != null){
(getChildByName("stars") as MovieClip).play();
};
};
};
}
public function onTargetContact():void{
}
public function handleEnterFrame2(_arg1:Event):void{
checkInteractions();
}
public function handleEnterFrame(_arg1:Event):void{
checkInteractions();
if (isMovable == false){
return;
};
var _local2:* = x;
var _local3:* = y;
var _local4:Number = MyUtils.distanceNumber((targetObject.getCX() - getCX()), (targetObject.getCY() - getCY()));
if ((((((_local4 < fallDistToTargetObject)) && (!((state == FALL))))) && (((!((targetObject.directionX == 0))) || (!((targetObject.directionY == 0))))))){
fallTime = 0;
state = FALL;
putToBG();
updateAnimation();
onTargetContact();
return;
};
if ((((state == STAY)) && ((_local4 > minDistToTargetObject)))){
return;
};
if (state == FALL){
if (fallTime < 70){
fallTime++;
} else {
if (_local4 > fallDistToTargetObject){
fallTime = 0;
state = STAY;
getFromBG();
updateAnimation();
checkDepth();
};
};
};
if ((((state == RUN)) && ((_local4 > maxDistToTargetObject)))){
state = STAY;
updateAnimation();
return;
};
if ((((state == STAY)) && ((_local4 < minDistToTargetObject)))){
if (currentLabel != "scare"){
gotoAndPlay("scare");
};
target.x = (x + ((x - targetObject.x) * 2));
target.y = (y + ((y - targetObject.y) * 2));
direction = Math.atan2((target.y - y), (target.x - x));
};
if ((((state == RUN)) || ((state == SCARED)))){
target.x = (x + ((x - targetObject.x) * 2));
target.y = (y + ((y - targetObject.y) * 2));
moveToTarget();
checkDepth();
prevDirectionX = directionX;
prevDirectionY = directionY;
if (Math.abs((_local2 - x)) > Math.abs((_local3 - y))){
directionX = (x - _local2);
} else {
directionX = 0;
};
directionY = (y - _local3);
if (((!((directionX == prevDirectionX))) || (!((directionY == prevDirectionY))))){
updateAnimation();
};
if (2.8 < Math.abs(MyUtils.dAngleRadian(Math.atan2((x - _local2), (y - _local3)), Math.atan2((target.x - _local2), (target.y - _local3))))){
resetDirection();
};
};
if (state == SCARED){
state = RUN;
updateAnimation();
};
}
public function updateAnimation():void{
if (state == RUN){
if (directionX != 0){
if ((((directionX < 0)) && (!((currentLabel == "moveLeft"))))){
gotoAndPlay("moveLeft");
};
if ((((directionX > 0)) && (!((currentLabel == "moveRight"))))){
gotoAndPlay("moveRight");
};
} else {
if ((((directionY < 0)) && (!((currentLabel == "moveUp"))))){
gotoAndPlay("moveUp");
};
if ((((directionY > 0)) && (!((currentLabel == "moveDown"))))){
gotoAndPlay("moveDown");
};
};
} else {
if (state == STAY){
if (directionX != 0){
if ((((directionX < 0)) && (!((currentLabel == "stayLeft"))))){
gotoAndPlay("stayLeft");
};
if ((((directionX > 0)) && (!((currentLabel == "stayRight"))))){
gotoAndPlay("stayRight");
};
} else {
if ((((directionY < 0)) && (!((currentLabel == "stayUp"))))){
gotoAndPlay("stayUp");
};
if ((((directionY > 0)) && (!((currentLabel == "stayDown"))))){
gotoAndPlay("stayDown");
};
};
} else {
if ((((state == FALL)) && ((fallTime == 0)))){
createBlow();
if (targetObject.directionX != 0){
if ((((targetObject.directionX < 0)) && (!((currentLabel == "fallLeft"))))){
gotoAndPlay("fallLeft");
} else {
if (currentLabel != "fallRight"){
gotoAndPlay("fallRight");
};
};
} else {
if ((((targetObject.directionY < 0)) && (!((currentLabel == "fallUp"))))){
gotoAndPlay("fallUp");
} else {
if (currentLabel != "fallDown"){
gotoAndPlay("fallDown");
};
};
};
};
};
};
}
public function createBlow():void{
var _local1:MovieClip;
SoundManager.createSound(SndFarmerDrop);
_local1 = (new Boom01() as MovieClip);
_local1.x = (x + (width / 2));
_local1.y = ((y + height) - 20);
parent.addChildAt(_local1, (parent.numChildren - 1));
}
override public function onRemove():void{
super.onRemove();
removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
}
override public function remove():void{
stop();
isMovable = false;
depthEnable = false;
super.remove();
removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
}
}
}//package src
Section 115
//Screen (src.Screen)
package src {
import flash.events.*;
import flash.display.*;
public class Screen extends MovieClip {
public static var doc:Doc;
public function Screen(){
doc = Doc.getInstance();
addEventListener(Event.ADDED_TO_STAGE, handleAdded, false, 0, true);
}
private function handleAdded(_arg1:Event):void{
addEventListener(Event.REMOVED_FROM_STAGE, handleRemoved);
onInit();
}
private function handleRemoved(_arg1:Event):void{
removeEventListener(Event.REMOVED_FROM_STAGE, handleRemoved);
onRemove();
}
public function onInit():void{
}
public function onRemove():void{
}
public function show():void{
visible = true;
if (doc.contains(this) == false){
doc.addChild(this);
} else {
doc.setChildIndex(this, (doc.numChildren - 1));
};
if (stage != null){
stage.focus = stage;
};
}
public function hide():void{
if (stage != null){
stage.focus = stage;
};
visible = false;
if (doc.contains(this) == true){
doc.removeChild(this);
};
}
}
}//package src
Section 116
//SelectControlScreen (src.SelectControlScreen)
package src {
import flash.events.*;
import flash.display.*;
public class SelectControlScreen extends Screen {
public var keyboardButton:MovieClip;
public var mouseButton:MovieClip;
public var backButton:MovieClip;
public var playButton:MovieClip;
public function SelectControlScreen(){
backButton.caption.text = Loc.BTN_MAINMENU;
backButton.addEventListener(MouseEvent.CLICK, backButtonClicked, false, 0, true);
playButton.caption.text = Loc.BTN_PLAY;
playButton.addEventListener(MouseEvent.CLICK, playButtonClicked, false, 0, true);
}
override public function show():void{
super.show();
doc.controlScreenShown = true;
}
public function backButtonClicked(_arg1:MouseEvent):void{
doc.showMainMenuScreen();
}
public function playButtonClicked(_arg1:MouseEvent):void{
doc.showSelectLevelScreen();
}
}
}//package src
Section 117
//SelectLevelButton (src.SelectLevelButton)
package src {
public dynamic class SelectLevelButton extends GameButton {
var levelNum:int;
var doc:Doc;
public function SelectLevelButton(){
doc = Doc.getInstance();
super();
}
override public function onClick():void{
if (state == "active"){
doc.levelNum = levelNum;
setState("selected");
};
}
}
}//package src
Section 118
//SelectLevelScreen (src.SelectLevelScreen)
package src {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class SelectLevelScreen extends Screen {
public var playButton:MovieClip;
public var backButton:MovieClip;
public var discoveriesButton:MovieClip;
public var submitScoreButton:MovieClip;
public var levelScore:TextField;
public var totalScore:TextField;
var buttons:Array;
var buttonsColCount:int;// = 5
var playButtonClicked:Boolean;// = false
var selectLevelButtonClicked:Boolean;// = false
var bg:MovieClip;
protected var btnPosX:int;// = 35
protected var btnPosY:int;// = 40
protected var btnPosDX:int;// = 100
protected var btnPosDY:int;// = 80
public function SelectLevelScreen(){
buttons = new Array();
super();
addEventListener("BEGIN_LEVEL", beginLevel);
playButton.addEventListener(MouseEvent.CLICK, onPlayButtonClick);
playButton.caption.text = Loc.MAINMENU_BTN_NEWGAME;
backButton.addEventListener(MouseEvent.CLICK, onBackButtonClick, false, 10);
backButton.caption.text = Loc.BTN_MAINMENU;
submitScoreButton.caption.text = Loc.GAMEOVER_BTN_SUBMITSCORE;
submitScoreButton.addEventListener(MouseEvent.CLICK, submitScoreButtonClicked);
discoveriesButton.caption.text = Loc.BTN_DISCOVERIES;
discoveriesButton.addEventListener(MouseEvent.CLICK, discoveriesButtonClicked);
}
override public function onInit():void{
var _local2:SelectLevelButton;
var _local3:MovieClip;
buttons = new Array();
var _local1:int;
while (_local1 < Levels.levels.length) {
_local2 = new SelectLevelButton();
_local2.x = (btnPosX + (btnPosDX * (_local1 - (int((_local1 / buttonsColCount)) * buttonsColCount))));
_local2.y = (70 + (int((_local1 / buttonsColCount)) * btnPosDY));
_local2.levelNum = (_local1 + 1);
_local2.addEventListener(MouseEvent.CLICK, updateSelectButtons);
_local2.cacheAsBitmap = true;
if (Levels.levels[_local1].buttonImg != null){
_local3 = new Levels.levels[_local1].buttonImg();
_local3.x = _local2.x;
_local3.y = _local2.y;
_local3.cacheAsBitmap = true;
addChild(_local3);
MyUtils.stopMovie(_local3);
};
addChild(_local2);
buttons.push(_local2);
if ((_local1 + 1) == doc.levelNum){
_local2.setState("selected");
} else {
if (_local1 < doc.compliteLevelCount){
_local2.setState("active");
} else {
_local2.setState("inactive");
_local2.buttonMode = false;
};
};
_local1++;
};
}
public function beginLevel(_arg1:Event=null){
SoundManager.stopAllSounds();
doc.beginLevel();
}
public function onPlayButtonClick(_arg1:MouseEvent){
SoundManager.playMusic(MscGame);
if (playButtonClicked == false){
playButtonClicked = true;
if (bg.kaban != null){
bg.kaban.gotoAndPlay("beginLevel");
};
} else {
if (bg.kaban != null){
bg.gotoAndStop("stop");
};
beginLevel();
};
}
public function onBackButtonClick(_arg1:MouseEvent){
if (bg.kaban != null){
MyUtils.stopMovie(bg.kaban);
};
SoundManager.stopAllSounds();
doc.showMainMenuScreen();
}
public function submitScoreButtonClicked(_arg1:MouseEvent):void{
doc.submitScore();
}
public function discoveriesButtonClicked(_arg1:MouseEvent){
SoundManager.stopAllSounds();
doc.showDiscoveryScreen();
}
protected function updateSelectButtons(_arg1:MouseEvent=null):void{
SoundManager.stopAllSounds();
SoundManager.playMusic(MscMenu);
selectLevelButtonClicked = true;
updateBG();
playButtonClicked = false;
var _local2:int;
while (_local2 < buttons.length) {
if ((buttons[_local2] as SelectLevelButton).levelNum == doc.levelNum){
(buttons[_local2] as SelectLevelButton).setState("selected");
(buttons[_local2] as SelectLevelButton).buttonMode = false;
} else {
if (_local2 < doc.compliteLevelCount){
(buttons[_local2] as SelectLevelButton).setState("active");
(buttons[_local2] as SelectLevelButton).buttonMode = true;
} else {
(buttons[_local2] as SelectLevelButton).setState("inactive");
(buttons[_local2] as SelectLevelButton).buttonMode = false;
};
};
_local2++;
};
showBestLevelScore();
}
public function showBestLevelScore():void{
var _local1:* = Levels.levels;
if (((!((Levels.levels[(doc.levelNum - 1)].bestScore == null))) && (!((Levels.levels[(doc.levelNum - 1)].bestScore == 0))))){
levelScore.visible = true;
levelScore.text = ("best level score: " + Levels.levels[(doc.levelNum - 1)].bestScore);
} else {
levelScore.visible = false;
};
}
public function updateBG():void{
removeBG();
bg = new Levels.levels[(doc.levelNum - 1)].screenBG();
bg.x = 278;
bg.y = 200;
addChildAt(bg, 0);
}
public function removeBG():void{
if (bg != null){
bg.stop();
MyUtils.stopMovie(bg);
if (contains(bg)){
removeChild(bg);
};
bg = null;
};
}
override public function show():void{
super.show();
if (doc.levelNum > doc.levelCount){
doc.levelNum = 1;
};
playButtonClicked = false;
updateBG();
if (((!((bg == null))) && (!((bg.kaban == null))))){
bg.kaban.gotoAndPlay(1);
};
updateSelectButtons();
levelScore.visible = false;
totalScore.text = ("total score: " + doc.getTotalScore());
showBestLevelScore();
if (Discovery.isNewDiscoveries == true){
discoveriesButton.setState("shine");
} else {
discoveriesButton.setState("");
};
stage.removeEventListener(MouseEvent.CLICK, mouseClicked);
stage.addEventListener(MouseEvent.CLICK, mouseClicked);
}
override public function hide():void{
removeBG();
if (stage != null){
stage.removeEventListener(MouseEvent.CLICK, mouseClicked);
};
super.hide();
}
public function mouseClicked(_arg1:MouseEvent):void{
if ((((((playButtonClicked == false)) && (!((bg == null))))) && (!((bg.kaban == null))))){
if (selectLevelButtonClicked == true){
selectLevelButtonClicked = false;
} else {
SoundManager.createSound(SndKaban01);
};
bg.kaban.gotoAndPlay(1);
};
}
}
}//package src
Section 119
//SoundBtn (src.SoundBtn)
package src {
public class SoundBtn extends GameButton {
public static const ON:String = "on";
public static const OFF:String = "off";
public function SoundBtn(){
setState(ON);
}
override public function onClick():void{
if (state == ON){
setState(OFF);
SoundManager.switchSound(false);
} else {
setState(ON);
SoundManager.switchSound(true);
};
}
}
}//package src
Section 120
//Stack (src.Stack)
package src {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class Stack extends BackElement {
var isDroped:Boolean;// = false
public function Stack(){
gotoAndStop(1);
}
override public function handleAdded(_arg1:Event):void{
super.handleAdded(_arg1);
level = (parent as Level);
if (level == null){
return;
};
gotoAndStop(1);
boundZone.owner = this;
boundZone.visible = false;
level.collisionList.addItem(boundZone);
}
public function playerContact():void{
if (isDroped == true){
return;
};
isDroped = true;
level.collisionList.removeItem(boundZone);
gotoAndPlay("drop");
depthEnable = false;
checkDepth();
Doc.getInstance().makeDiscovery(Discovery.STACK);
createMask();
}
public function createMask():void{
var maskClass:Class;
var antiMaskBitmapData:BitmapData;
var maskBitmapData:BitmapData;
var rect:Rectangle;
var myBitmapData:BitmapData;
var classNameAnti:String = "StackAntiMask";
var classNameMask:String = "StackMask";
try {
maskClass = (getDefinitionByName(classNameAnti) as Class);
antiMaskBitmapData = new maskClass(0, 0);
maskClass = (getDefinitionByName(classNameMask) as Class);
maskBitmapData = new maskClass(0, 0);
rect = new Rectangle(0, 0, antiMaskBitmapData.width, antiMaskBitmapData.height);
myBitmapData = new BitmapData(antiMaskBitmapData.width, antiMaskBitmapData.height, true, 0);
myBitmapData.copyPixels(level.bgMask.bitmapData, new Rectangle(x, y, antiMaskBitmapData.width, antiMaskBitmapData.height), new Point(0, 0), antiMaskBitmapData);
level.bgMask.bitmapData.copyPixels(myBitmapData, new Rectangle(0, 0, maskBitmapData.width, maskBitmapData.height), new Point((x + 1), (y + 1)));
} catch(e:Error) {
};
}
}
}//package src
Section 121
//TheEndScreen (src.TheEndScreen)
package src {
import flash.events.*;
import flash.display.*;
public class TheEndScreen extends Screen {
public var kaban:MovieClip;
public var cast:MovieClip;
protected var isButtonClicked:Boolean;// = false
public var menuButton:GameButton;
public function TheEndScreen(){
cast.stop();
}
override public function onInit():void{
menuButton.addEventListener(MouseEvent.CLICK, onClickMenuButton, false, 0, true);
menuButton.caption.text = Loc.BTN_MAINMENU;
}
public function onClickMenuButton(_arg1:MouseEvent){
isButtonClicked = true;
doc.showMainMenuScreen();
}
override public function show():void{
super.show();
isButtonClicked = false;
if (kaban != null){
kaban.gotoAndPlay(1);
};
if (cast != null){
cast.gotoAndPlay(1);
};
stage.addEventListener(MouseEvent.CLICK, mouseClicked, false, 0, true);
}
override public function hide():void{
if (kaban != null){
kaban.stop();
};
if (stage != null){
stage.removeEventListener(MouseEvent.CLICK, mouseClicked);
};
super.hide();
}
public function mouseClicked(_arg1:MouseEvent):void{
kaban.gotoAndPlay(1);
if (isButtonClicked == false){
SoundManager.createSound(SndKaban01);
};
}
}
}//package src
Section 122
//Tree (src.Tree)
package src {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
public class Tree extends BackElement {
public var apple:MovieClip;
var appleAvailable:Boolean;// = true
var intervalId:uint;
public var animationList:AnimationList;
public function Tree(){
animationList = new AnimationList(this);
animationList.cacheAnimation("AnimTree01stay");
animationList.cacheAnimation("AnimTree01rustle");
addEventListener(Event.REMOVED_FROM_STAGE, handleRemoved, false, 0, true);
}
override public function handleAdded(_arg1:Event):void{
super.handleAdded(_arg1);
apple.visible = false;
var _local2:Level = (parent as Level);
if (_local2 == null){
return;
};
boundZone.visible = false;
_local2.collisionList.addItem(boundZone);
gotoAndStop(2);
playStayAnimation();
}
public function handleRemoved(_arg1:Event):void{
removeEventListener(Event.REMOVED_FROM_STAGE, handleRemoved);
clearTimeout(intervalId);
}
public function playerContact():void{
if (appleAvailable == true){
animationList.stopAnimation("AnimTree01stay");
animationList.play("AnimTree01rustle", false, playStayAnimation);
apple.visible = true;
apple.gotoAndPlay(1);
appleAvailable = false;
Doc.getInstance().makeDiscovery(Discovery.APPLE_TREE);
Doc.getInstance().powerUp();
Doc.getInstance().createEffect(EffectApple01);
Doc.getInstance().increaseLevelScore(5);
intervalId = setTimeout(resetApple, 5000);
};
}
public function playStayAnimation():void{
animationList.stopAnimation("AnimTree01rustle");
animationList.play("AnimTree01stay");
}
public function resetApple():void{
appleAvailable = true;
}
}
}//package src
Section 123
//Trigger (src.Trigger)
package src {
import flash.events.*;
import flash.display.*;
public dynamic class Trigger extends MovieClip {
var level:Level;
public function Trigger(){
addEventListener(Event.ENTER_FRAME, handleAdded, false, 0, true);
}
public function handleAdded(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, handleAdded);
level = (parent as Level);
if (level == null){
return;
};
level.triggersList.push(this);
visible = false;
onCreate();
}
public function onCreate():void{
}
public function onPlayerIntersect():void{
}
}
}//package src
Section 124
//TriggerCounter (src.TriggerCounter)
package src {
public class TriggerCounter extends Trigger {
public var doc:Doc;
public function TriggerCounter(){
doc = Doc.getInstance();
}
override public function onCreate():void{
}
override public function onPlayerIntersect():void{
if (doc.curLevel.counter >= doc.curLevel.maxCounter){
Doc.getInstance().endLevel();
};
}
}
}//package src
Section 125
//TriggerDestination (src.TriggerDestination)
package src {
public dynamic class TriggerDestination extends Trigger {
override public function onCreate():void{
}
override public function onPlayerIntersect():void{
Doc.getInstance().endLevel();
}
}
}//package src
Section 126
//Wasps (src.Wasps)
package src {
import flash.media.*;
import flash.events.*;
import flash.display.*;
public dynamic class Wasps extends Flies {
public var i:int;
public var bee:BeeFly;
var soundChannel:SoundChannel;
var volumeSoundTransform:SoundTransform;
var overtakeDist:Number;// = 40
public function Wasps(){
volumeSoundTransform = new SoundTransform();
super();
addFrameScript(0, frame1);
}
override public function onCreate():void{
setTarget(level.player);
step = 2.5;
super.onCreate();
}
override public function handleEnterFrame(_arg1:Event):void{
super.handleEnterFrame(_arg1);
var _local2:Number = MyUtils.distanceNumber((level.player.getCX() - getCX()), (level.player.getCY() - getCY()));
soundChannel = SoundManager.createSound(SndSwarm, true, true);
if (soundChannel != null){
volumeSoundTransform.volume = (40000 / (_local2 * _local2));
if (volumeSoundTransform.volume > 1){
volumeSoundTransform.volume = 1;
};
soundChannel.soundTransform = volumeSoundTransform;
};
if (_local2 < overtakeDist){
doc.gameOver();
};
}
override public function pause(_arg1:Boolean=true):void{
var _local2:int;
var _local3:int;
super.pause(_arg1);
if (_arg1 == true){
stop();
_local2 = 0;
while (_local2 < numChildren) {
if ((getChildAt(_local2) is MovieClip)){
(getChildAt(_local2) as MovieClip).stop();
};
_local2++;
};
} else {
play();
_local3 = 0;
while (_local3 < numChildren) {
if ((getChildAt(_local3) is MovieClip)){
(getChildAt(_local3) as MovieClip).play();
};
_local3++;
};
};
}
override public function onRemove():void{
super.onRemove();
if (soundChannel != null){
soundChannel.stop();
};
}
function frame1(){
i = 0;
while (i < 30) {
bee = new BeeFly();
bee.gotoAndPlay(int((Math.random() * 90)));
bee.x = (Math.random() * 20);
bee.y = (Math.random() * 20);
addChild(bee);
i++;
};
}
}
}//package src
Section 127
//_PumpkinMask (_PumpkinMask)
package {
import flash.display.*;
public dynamic class _PumpkinMask extends BitmapData {
public function _PumpkinMask(_arg1:int=20, _arg2:int=24){
super(_arg1, _arg2);
}
}
}//package
Section 128
//AdBox (AdBox)
package {
import flash.display.*;
public dynamic class AdBox extends MovieClip {
}
}//package
Section 129
//AnimationList (AnimationList)
package {
import com.touchmypixel.peepee.utils.*;
import flash.display.*;
public class AnimationList {
public var animations:Array;
public var owner:MovieClip;
public static var animationCache:AnimationCache;
public function AnimationList(_arg1:MovieClip):void{
animations = [];
super();
owner = _arg1;
if (animationCache == null){
animationCache = AnimationCache.getInstance();
};
}
public function isPlaying(_arg1:String, _arg2:int=-1):Boolean{
if (_arg2 == -1){
if (animations[_arg1] != null){
return (true);
};
return (false);
//unresolved jump
};
if (animations[((_arg1 + "T") + _arg2)] != null){
return (true);
};
return (false);
}
public function play(_arg1:String, _arg2:Boolean=true, _arg3:Function=null):Animation{
if (animations[_arg1] != null){
return (animations[_arg1]);
};
var _local4:Animation = animationCache.getAnimation(_arg1);
if (_local4 == null){
cacheAnimation(_arg1);
_local4 = animationCache.getAnimation(_arg1);
trace((("animationCache.cacheAnimation(\"" + _arg1) + "\");"));
};
if (_arg3 != null){
_local4.onEnd = _arg3;
};
_local4.repeat = _arg2;
animations[_arg1] = _local4;
_local4.play();
owner.addChildAt(_local4, 0);
return (_local4);
}
public function playTyped(_arg1:String, _arg2:int, _arg3:Boolean=true, _arg4:Function=null):Animation{
return (play(((_arg1 + "T") + _arg2), _arg3, _arg4));
}
public function stopAnimation(_arg1:String):void{
if (animations[_arg1]){
animations[_arg1].destroy();
animations[_arg1] = null;
};
}
public function stopAllAnimations():void{
var _local1:*;
for each (_local1 in animations) {
_local1.destroy();
};
animations = [];
}
public function cacheAnimation(_arg1:String, _arg2:int=0):void{
if (_arg2 != 0){
animationCache.cacheTypedAnimation(_arg1, _arg2);
} else {
animationCache.cacheAnimation(_arg1);
};
}
public function pause(_arg1:Boolean=true):void{
var _local2:*;
if (_arg1 == true){
for each (_local2 in animations) {
_local2.stop();
};
} else {
for each (_local2 in animations) {
_local2.play();
};
};
}
}
}//package
Section 130
//AnimDiscoveryMessageEffect (AnimDiscoveryMessageEffect)
package {
import flash.display.*;
public dynamic class AnimDiscoveryMessageEffect extends MovieClip {
}
}//package
Section 131
//AnimPool01 (AnimPool01)
package {
public dynamic class AnimPool01 extends CachedMovie {
}
}//package
Section 132
//AnimScaredFarmerFallDown (AnimScaredFarmerFallDown)
package {
import flash.display.*;
public dynamic class AnimScaredFarmerFallDown extends MovieClip {
}
}//package
Section 133
//AnimScaredFarmerFallLeft (AnimScaredFarmerFallLeft)
package {
import flash.display.*;
public dynamic class AnimScaredFarmerFallLeft extends MovieClip {
}
}//package
Section 134
//AnimScaredFarmerFallRight (AnimScaredFarmerFallRight)
package {
import flash.display.*;
public dynamic class AnimScaredFarmerFallRight extends MovieClip {
}
}//package
Section 135
//AnimScaredFarmerFallUp (AnimScaredFarmerFallUp)
package {
import flash.display.*;
public dynamic class AnimScaredFarmerFallUp extends MovieClip {
}
}//package
Section 136
//AnimScaredFarmerInPool (AnimScaredFarmerInPool)
package {
import flash.display.*;
public dynamic class AnimScaredFarmerInPool extends MovieClip {
}
}//package
Section 137
//AnimScaredFarmerMoveDown (AnimScaredFarmerMoveDown)
package {
import flash.display.*;
public dynamic class AnimScaredFarmerMoveDown extends MovieClip {
}
}//package
Section 138
//AnimScaredFarmerMoveLeft (AnimScaredFarmerMoveLeft)
package {
import flash.display.*;
public dynamic class AnimScaredFarmerMoveLeft extends MovieClip {
}
}//package
Section 139
//AnimScaredFarmerMoveRight (AnimScaredFarmerMoveRight)
package {
import flash.display.*;
public dynamic class AnimScaredFarmerMoveRight extends MovieClip {
}
}//package
Section 140
//AnimScaredFarmerMoveUp (AnimScaredFarmerMoveUp)
package {
import flash.display.*;
public dynamic class AnimScaredFarmerMoveUp extends MovieClip {
}
}//package
Section 141
//AnimScaredFarmerScare (AnimScaredFarmerScare)
package {
import flash.display.*;
public dynamic class AnimScaredFarmerScare extends MovieClip {
}
}//package
Section 142
//AnimScaredFarmerStayDown (AnimScaredFarmerStayDown)
package {
import flash.display.*;
public dynamic class AnimScaredFarmerStayDown extends MovieClip {
}
}//package
Section 143
//AnimScaredFarmerStayLeft (AnimScaredFarmerStayLeft)
package {
import flash.display.*;
public dynamic class AnimScaredFarmerStayLeft extends MovieClip {
}
}//package
Section 144
//AnimScaredFarmerStayRight (AnimScaredFarmerStayRight)
package {
import flash.display.*;
public dynamic class AnimScaredFarmerStayRight extends MovieClip {
}
}//package
Section 145
//AnimScaredFarmerStayUp (AnimScaredFarmerStayUp)
package {
import flash.display.*;
public dynamic class AnimScaredFarmerStayUp extends MovieClip {
}
}//package
Section 146
//AnimScaredFarmerUnderWater (AnimScaredFarmerUnderWater)
package {
import flash.display.*;
public dynamic class AnimScaredFarmerUnderWater extends MovieClip {
}
}//package
Section 147
//AnimTree01rustle (AnimTree01rustle)
package {
public dynamic class AnimTree01rustle extends CachedMovie {
}
}//package
Section 148
//AnimTree01stay (AnimTree01stay)
package {
public dynamic class AnimTree01stay extends CachedMovie {
}
}//package
Section 149
//ArrowButton (ArrowButton)
package {
public dynamic class ArrowButton extends GameButton {
}
}//package
Section 150
//Background (Background)
package {
import flash.display.*;
public dynamic class Background extends MovieClip {
}
}//package
Section 151
//BackHead01 (BackHead01)
package {
public dynamic class BackHead01 extends TypedAnimElement {
}
}//package
Section 152
//Barrel (Barrel)
package {
import src.*;
public dynamic class Barrel extends Obstacle {
}
}//package
Section 153
//BarrelMask (BarrelMask)
package {
import flash.display.*;
public dynamic class BarrelMask extends BitmapData {
public function BarrelMask(_arg1:int=48, _arg2:int=51){
super(_arg1, _arg2);
}
}
}//package
Section 154
//Bee (Bee)
package {
import flash.display.*;
public dynamic class Bee extends MovieClip {
}
}//package
Section 155
//BeeFly (BeeFly)
package {
import flash.display.*;
public dynamic class BeeFly extends MovieClip {
}
}//package
Section 156
//Beer (Beer)
package {
import src.*;
public dynamic class Beer extends BackElement {
}
}//package
Section 157
//BGElementWall1 (BGElementWall1)
package {
import src.*;
public dynamic class BGElementWall1 extends Obstacle {
}
}//package
Section 158
//BGElementWall1_2 (BGElementWall1_2)
package {
import src.*;
public dynamic class BGElementWall1_2 extends Obstacle {
}
}//package
Section 159
//BGElementWall1_2Mask (BGElementWall1_2Mask)
package {
import flash.display.*;
public dynamic class BGElementWall1_2Mask extends BitmapData {
public function BGElementWall1_2Mask(_arg1:int=106, _arg2:int=33){
super(_arg1, _arg2);
}
}
}//package
Section 160
//BGElementWall1_4 (BGElementWall1_4)
package {
import src.*;
public dynamic class BGElementWall1_4 extends Obstacle {
}
}//package
Section 161
//BGElementWall1_4Mask (BGElementWall1_4Mask)
package {
import flash.display.*;
public dynamic class BGElementWall1_4Mask extends BitmapData {
public function BGElementWall1_4Mask(_arg1:int=207, _arg2:int=32){
super(_arg1, _arg2);
}
}
}//package
Section 162
//BGElementWall1Mask (BGElementWall1Mask)
package {
import flash.display.*;
public dynamic class BGElementWall1Mask extends BitmapData {
public function BGElementWall1Mask(_arg1:int=55, _arg2:int=32){
super(_arg1, _arg2);
}
}
}//package
Section 163
//BGElementWall2 (BGElementWall2)
package {
import src.*;
public dynamic class BGElementWall2 extends Obstacle {
}
}//package
Section 164
//BGElementWall2_2 (BGElementWall2_2)
package {
import src.*;
public dynamic class BGElementWall2_2 extends Obstacle {
}
}//package
Section 165
//BGElementWall2_2Mask (BGElementWall2_2Mask)
package {
import flash.display.*;
public dynamic class BGElementWall2_2Mask extends BitmapData {
public function BGElementWall2_2Mask(_arg1:int=22, _arg2:int=112){
super(_arg1, _arg2);
}
}
}//package
Section 166
//BGElementWall2_4 (BGElementWall2_4)
package {
import src.*;
public dynamic class BGElementWall2_4 extends Obstacle {
}
}//package
Section 167
//BGElementWall2_4Mask (BGElementWall2_4Mask)
package {
import flash.display.*;
public dynamic class BGElementWall2_4Mask extends BitmapData {
public function BGElementWall2_4Mask(_arg1:int=21, _arg2:int=208){
super(_arg1, _arg2);
}
}
}//package
Section 168
//BGElementWall2Mask (BGElementWall2Mask)
package {
import flash.display.*;
public dynamic class BGElementWall2Mask extends BitmapData {
public function BGElementWall2Mask(_arg1:int=23, _arg2:int=67){
super(_arg1, _arg2);
}
}
}//package
Section 169
//BigSmoke (BigSmoke)
package {
import flash.display.*;
public dynamic class BigSmoke extends MovieClip {
public function BigSmoke(){
addFrameScript(43, frame44);
}
function frame44(){
if (parent){
parent.removeChild(this);
};
}
}
}//package
Section 170
//Boom01 (Boom01)
package {
import flash.display.*;
public dynamic class Boom01 extends MovieClip {
public function Boom01(){
addFrameScript(11, frame12);
}
function frame12(){
if (parent){
parent.removeChild(this);
};
}
}
}//package
Section 171
//CachedMovie (CachedMovie)
package {
import flash.display.*;
public class CachedMovie extends MovieClip {
public var animation:AnimationList;
public var animationType:int;// = -1
public function CachedMovie():void{
animation = new AnimationList(this);
}
public function playAnimation(_arg1:String, _arg2:Boolean=true, _arg3:Function=null):void{
if (animation.isPlaying(_arg1, animationType) == false){
animation.stopAllAnimations();
if (animationType != -1){
animation.playTyped(_arg1, animationType, _arg2, _arg3);
} else {
animation.play(_arg1, _arg2, _arg3);
};
};
}
}
}//package
Section 172
//CDK (CDK)
package {
import flash.utils.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.errors.*;
public class CDK {
private var _root;
protected var objectArray:Array;
protected var objectCheckArray:Array;
protected var objectCollisionArray:Array;
private var colorExclusionArray:Array;
private var bmd1:BitmapData;
private var bmd2:BitmapData;
private var bmdResample:BitmapData;
private var pixels1:ByteArray;
private var pixels2:ByteArray;
private var rect1:Rectangle;
private var rect2:Rectangle;
private var transMatrix1:Matrix;
private var transMatrix2:Matrix;
private var colorTransform1:ColorTransform;
private var colorTransform2:ColorTransform;
private var item1Registration:Point;
private var item2Registration:Point;
private var _alphaThreshold:Number;
private var _returnAngle:Boolean;
private var _returnAngleType:String;
private var _numChildren:uint;
public function CDK():void{
if (getQualifiedClassName(this) == "coreyoneil.collision::CDK"){
throw (new Error("CDK is an abstract class and is not meant for instantiation - use CollisionGroup or CollisionList"));
};
init();
}
private function init():void{
objectCheckArray = new Array();
objectCollisionArray = new Array();
objectArray = new Array();
colorExclusionArray = new Array();
_alphaThreshold = 0;
_returnAngle = false;
_returnAngleType = "RADIANS";
}
public function addItem(_arg1):void{
if ((_arg1 is DisplayObject)){
_root = _arg1.root;
if (_root == null){
throw (new Error((("Cannot add item: " + _arg1) + " - Items added for collision detection must be on the display list.")));
};
objectArray.push(_arg1);
} else {
throw (new Error((("Cannot add item: " + _arg1) + " - item must be a Display Object.")));
};
}
public function removeItem(_arg1):void{
var _local2:Boolean;
var _local3:int = objectArray.length;
var _local4:uint;
while (_local4 < _local3) {
if (objectArray[_local4] == _arg1){
objectArray.splice(_local4, 1);
_local2 = true;
break;
};
_local4++;
};
if (!(_local2)){
throw (new Error((_arg1 + " could not be removed - object not found in item list.")));
};
}
public function excludeColor(_arg1:uint, _arg2:uint=0xFF, _arg3:uint=20, _arg4:uint=20, _arg5:uint=20):void{
var _local6:Object = {color:_arg1, alpha:_arg2, red:_arg3, green:_arg4, blue:_arg5};
colorExclusionArray.push(_local6);
}
public function removeExcludeColor(_arg1:uint):void{
var _local2:Boolean;
var _local3:int = colorExclusionArray.length;
var _local4:uint;
while (_local4 < _local3) {
if (colorExclusionArray[_local4].color == _arg1){
colorExclusionArray.splice(_local4, 1);
_local2 = true;
break;
};
_local4++;
};
if (!(_local2)){
throw (new Error((("Color could not be removed - color not found in exclusion list [" + _arg1) + "]")));
};
}
protected function clearArrays():void{
while (objectCheckArray.length) {
objectCheckArray.pop();
};
while (objectCollisionArray.length) {
objectCollisionArray.pop();
};
}
protected function findCollisions(_arg1, _arg2):void{
var tf:TextFormat;
var alpha1:uint;
var alpha2:uint;
var colorFlag:Boolean;
var red1:uint;
var red2:uint;
var green1:uint;
var green2:uint;
var blue1:uint;
var blue2:uint;
var a:uint;
var r:uint;
var g:uint;
var b:uint;
var item1Flags:uint;
var item2Flags:uint;
var n:uint;
var angle:Number;
var recordedCollision:Object;
var item1 = _arg1;
var item2 = _arg2;
var item1_isText:Boolean;
var item2_isText:Boolean;
try {
tf = item1.getTextFormat();
item1_isText = ((item1.antiAliasType)=="advanced") ? true : false;
item1.antiAliasType = ((item1.antiAliasType)=="advanced") ? "normal" : item1.antiAliasType;
} catch(e:Error) {
};
try {
tf = item2.getTextFormat();
item2_isText = ((item1.antiAliasType)=="advanced") ? true : false;
item2.antiAliasType = ((item2.antiAliasType)=="advanced") ? "normal" : item2.antiAliasType;
} catch(e:Error) {
};
colorTransform1 = item1.transform.colorTransform;
colorTransform2 = item2.transform.colorTransform;
item1Registration = new Point(item1.x, item1.y);
item2Registration = new Point(item2.x, item2.y);
item1Registration = item1.parent.localToGlobal(item1Registration);
item2Registration = item2.parent.localToGlobal(item2Registration);
if ((item2.width * item2.height) > (item1.width * item1.height)){
bmd1 = new BitmapData(item1.width, item1.height, true, 0xFFFFFF);
bmd2 = new BitmapData(item1.width, item1.height, true, 0xFFFFFF);
rect1 = item1.getBounds(_root.stage);
transMatrix1 = item1.transform.matrix;
transMatrix1.tx = (item1Registration.x - rect1.left);
transMatrix1.ty = (item1Registration.y - rect1.top);
transMatrix2 = item2.transform.matrix;
transMatrix2.tx = (item2Registration.x - rect1.left);
transMatrix2.ty = (item2Registration.y - rect1.top);
} else {
bmd1 = new BitmapData(item2.width, item2.height, true, 0xFFFFFF);
bmd2 = new BitmapData(item2.width, item2.height, true, 0xFFFFFF);
rect2 = item2.getBounds(_root.stage);
transMatrix1 = item1.transform.matrix;
transMatrix1.tx = (item1Registration.x - rect2.left);
transMatrix1.ty = (item1Registration.y - rect2.top);
transMatrix2 = item2.transform.matrix;
transMatrix2.tx = (item2Registration.x - rect2.left);
transMatrix2.ty = (item2Registration.y - rect2.top);
};
bmd1.draw(item1, transMatrix1, colorTransform1, null, null, true);
bmd2.draw(item2, transMatrix2, colorTransform2, null, null, true);
pixels1 = bmd1.getPixels(new Rectangle(0, 0, bmd1.width, bmd1.height));
pixels2 = bmd2.getPixels(new Rectangle(0, 0, bmd1.width, bmd1.height));
var k:uint;
var value1:uint;
var value2:uint;
var collisionPoint:Number = -1;
var overlap:uint;
pixels1.position = 0;
pixels2.position = 0;
while (k < pixels1.length) {
k = pixels1.position;
try {
value1 = pixels1.readUnsignedInt();
value2 = pixels2.readUnsignedInt();
} catch(e:EOFError) {
break;
};
alpha1 = ((value1 >> 24) & 0xFF);
alpha2 = ((value2 >> 24) & 0xFF);
if ((((alpha1 > _alphaThreshold)) && ((alpha2 > _alphaThreshold)))){
colorFlag = false;
if (colorExclusionArray.length){
red1 = ((value1 >> 16) & 0xFF);
red2 = ((value2 >> 16) & 0xFF);
green1 = ((value1 >> 8) & 0xFF);
green2 = ((value2 >> 8) & 0xFF);
blue1 = (value1 & 0xFF);
blue2 = (value2 & 0xFF);
n = 0;
while (n < colorExclusionArray.length) {
a = ((colorExclusionArray[n].color >> 24) & 0xFF);
r = ((colorExclusionArray[n].color >> 16) & 0xFF);
g = ((colorExclusionArray[n].color >> 8) & 0xFF);
b = (colorExclusionArray[n].color & 0xFF);
item1Flags = 0;
item2Flags = 0;
if ((((blue1 >= (b - colorExclusionArray[n].blue))) && ((blue1 <= (b + colorExclusionArray[n].blue))))){
item1Flags = (item1Flags + 1);
};
if ((((blue2 >= (b - colorExclusionArray[n].blue))) && ((blue2 <= (b + colorExclusionArray[n].blue))))){
item2Flags = (item2Flags + 1);
};
if ((((green1 >= (g - colorExclusionArray[n].green))) && ((green1 <= (g + colorExclusionArray[n].green))))){
item1Flags = (item1Flags + 1);
};
if ((((green2 >= (g - colorExclusionArray[n].green))) && ((green2 <= (g + colorExclusionArray[n].green))))){
item2Flags = (item2Flags + 1);
};
if ((((red1 >= (r - colorExclusionArray[n].red))) && ((red1 <= (r + colorExclusionArray[n].red))))){
item1Flags = (item1Flags + 1);
};
if ((((red2 >= (r - colorExclusionArray[n].red))) && ((red2 <= (r + colorExclusionArray[n].red))))){
item2Flags = (item2Flags + 1);
};
if ((((alpha1 >= (a - colorExclusionArray[n].alpha))) && ((alpha1 <= (a + colorExclusionArray[n].alpha))))){
item1Flags = (item1Flags + 1);
};
if ((((alpha2 >= (a - colorExclusionArray[n].alpha))) && ((alpha2 <= (a + colorExclusionArray[n].alpha))))){
item2Flags = (item2Flags + 1);
};
if ((((item1Flags == 4)) || ((item2Flags == 4)))){
colorFlag = true;
};
n = (n + 1);
};
};
if ((((collisionPoint == -1)) && (!(colorFlag)))){
if (_returnAngle){
collisionPoint = (k / 4);
angle = findAngle(item1, item2, collisionPoint);
} else {
angle = -1;
collisionPoint = 0;
};
};
overlap = (!(colorFlag)) ? (overlap + 1) : overlap;
};
};
if (overlap){
if ((item2.width * item2.height) < (item1.width * item1.height)){
recordedCollision = {object1:item2, object2:item1, angle:angle, overlap:overlap};
objectCollisionArray.push(recordedCollision);
} else {
recordedCollision = {object1:item1, object2:item2, angle:angle, overlap:overlap};
objectCollisionArray.push(recordedCollision);
};
};
if (item1_isText){
item1.antiAliasType = "advanced";
};
if (item2_isText){
item2.antiAliasType = "advanced";
};
var _local4:Boolean;
item2_isText = _local4;
item1_isText = _local4;
}
private function findAngle(_arg1, _arg2, _arg3):Number{
var pixel:uint;
var thisAlpha:uint;
var lastAlpha:int;
var edgePoint:uint;
var edgeY:uint;
var edgeX:uint;
var slope:Point;
var rowWidth:uint;
var columnHeight:uint;
var center:Point;
var pixels:ByteArray;
var k:uint;
var colorFlag:Boolean;
var red1:uint;
var green1:uint;
var blue1:uint;
var a:uint;
var r:uint;
var g:uint;
var b:uint;
var item1Flags:uint;
var numColors:uint;
var n:uint;
var item1 = _arg1;
var item2 = _arg2;
var collisionPoint = _arg3;
if ((item2.width * item2.height) > (item1.width * item1.height)){
rowWidth = Math.round(item1.width);
columnHeight = Math.round(item1.height);
center = new Point((item1.width >> 1), (item1.height >> 1));
pixels = pixels2;
} else {
rowWidth = Math.round(item2.width);
columnHeight = Math.round(item2.height);
center = new Point((item2.width >> 1), (item2.height >> 1));
pixels = pixels1;
};
var collisionY:* = (collisionPoint / rowWidth);
var collisionX:* = (collisionPoint % rowWidth);
collisionX = (!((collisionX == 0))) ? ((collisionX >> 5) * rowWidth) : 0;
if ((((collisionX == 0)) && ((collisionY == 0)))){
var _local5 = 1;
collisionY = _local5;
collisionX = _local5;
};
if ((item2.width * item2.height) > (item1.width * item1.height)){
transMatrix2.tx = (transMatrix2.tx + center.x);
transMatrix2.ty = (transMatrix2.ty + center.y);
bmdResample = new BitmapData((item1.width * 2), (item1.height * 2), true, 0xFFFFFF);
bmdResample.draw(item2, transMatrix2, colorTransform2, null, null, true);
pixels = bmdResample.getPixels(new Rectangle(0, 0, bmdResample.width, bmdResample.height));
} else {
transMatrix1.tx = (transMatrix1.tx + center.x);
transMatrix1.ty = (transMatrix1.ty + center.y);
bmdResample = new BitmapData((item2.width * 2), (item2.height * 2), true, 0xFFFFFF);
bmdResample.draw(item1, transMatrix1, colorTransform1, null, null, true);
pixels = bmdResample.getPixels(new Rectangle(0, 0, bmdResample.width, bmdResample.height));
};
center.x = (bmdResample.width >> 1);
center.y = (bmdResample.height >> 1);
columnHeight = Math.round(bmdResample.height);
rowWidth = Math.round(bmdResample.width);
var edgeArray:Array = new Array();
var j:uint;
while (j < columnHeight) {
k = ((j * 4) * rowWidth);
pixels.position = k;
lastAlpha = -1;
while (k < (((j + 1) * rowWidth) * 4)) {
k = pixels.position;
try {
pixel = pixels.readUnsignedInt();
} catch(e:EOFError) {
break;
};
thisAlpha = ((pixel >> 24) & 0xFF);
if (lastAlpha == -1){
lastAlpha = thisAlpha;
} else {
if (thisAlpha > _alphaThreshold){
colorFlag = false;
if (colorExclusionArray.length){
red1 = ((pixel >> 16) & 0xFF);
green1 = ((pixel >> 8) & 0xFF);
blue1 = (pixel & 0xFF);
numColors = colorExclusionArray.length;
n = 0;
while (n < numColors) {
a = ((colorExclusionArray[n].color >> 24) & 0xFF);
r = ((colorExclusionArray[n].color >> 16) & 0xFF);
g = ((colorExclusionArray[n].color >> 8) & 0xFF);
b = (colorExclusionArray[n].color & 0xFF);
item1Flags = 0;
if ((((blue1 >= (b - colorExclusionArray[n].blue))) && ((blue1 <= (b + colorExclusionArray[n].blue))))){
item1Flags = (item1Flags + 1);
};
if ((((green1 >= (g - colorExclusionArray[n].green))) && ((green1 <= (g + colorExclusionArray[n].green))))){
item1Flags = (item1Flags + 1);
};
if ((((red1 >= (r - colorExclusionArray[n].red))) && ((red1 <= (r + colorExclusionArray[n].red))))){
item1Flags = (item1Flags + 1);
};
if ((((thisAlpha >= (a - colorExclusionArray[n].alpha))) && ((thisAlpha <= (a + colorExclusionArray[n].alpha))))){
item1Flags = (item1Flags + 1);
};
if (item1Flags == 4){
colorFlag = true;
};
n = (n + 1);
};
};
if (!(colorFlag)){
edgeArray.push((k / 4));
};
};
};
};
j = (j + 1);
};
var angleArray:Array = new Array();
var numYAdjusted:uint;
var numXAdjusted:uint;
var slopeArray:Array = new Array();
var numEdges:int = edgeArray.length;
j = 0;
while (j < numEdges) {
edgePoint = edgeArray[j];
edgeY = (edgePoint / rowWidth);
edgeX = (edgePoint % rowWidth);
edgeX = (!((edgeX == 0))) ? ((edgeX / bmdResample.width) * rowWidth) : 0;
slope = new Point((edgeX - center.x), (center.y - edgeY));
slopeArray.push(slope);
j = (j + 1);
};
var slopeYAvg:Number = 0;
var slopeXAvg:Number = 0;
var numSlopes:int = slopeArray.length;
j = 0;
while (j < numSlopes) {
slopeYAvg = (slopeYAvg + slopeArray[j].y);
slopeXAvg = (slopeXAvg + slopeArray[j].x);
j = (j + 1);
};
var average:Number = returnDegrees(Math.atan2(slopeYAvg, slopeXAvg));
average = (~(average) + 1);
average = ((_returnAngleType == "RADIANS")) ? returnRadians(average) : average;
return (average);
}
private function returnDegrees(_arg1:Number):Number{
var _local2:Number = ((_arg1 * 180) / Math.PI);
return (_local2);
}
private function returnRadians(_arg1:Number):Number{
var _local2:Number = ((_arg1 * Math.PI) / 180);
return (_local2);
}
public function set alphaThreshold(_arg1:Number):void{
if ((((_arg1 <= 1)) && ((_arg1 >= 0)))){
_alphaThreshold = (_arg1 * 0xFF);
} else {
throw (new Error("alphaThreshold expects a value from 0 to 1"));
};
}
public function get alphaThreshold():Number{
return (_alphaThreshold);
}
public function set returnAngle(_arg1):void{
if (typeof(_arg1) == "boolean"){
_returnAngle = _arg1;
} else {
throw (new Error("returnAngle expects a Boolean value (true/false)"));
};
}
public function get returnAngle():Boolean{
return (_returnAngle);
}
public function set returnAngleType(_arg1:String):void{
_arg1 = _arg1.toUpperCase();
switch (_arg1){
case "DEGREES":
case "DEGREE":
case "DEG":
case "DEGS":
_returnAngleType = "DEGREES";
break;
case "RADIANS":
case "RADIAN":
case "RAD":
case "RADS":
_returnAngleType = "RADIANS";
break;
default:
throw (new Error("returnAngleType expects 'DEGREES' or 'RADIANS'"));
};
}
public function get returnAngleType():String{
return (_returnAngleType);
}
public function get numChildren():uint{
return (objectArray.length);
}
}
}//package
Section 173
//CollisionList (CollisionList)
package {
import flash.display.*;
public class CollisionList extends CDK {
public function CollisionList(_arg1, ... _args):void{
addItem(_arg1);
var _local3:uint;
while (_local3 < _args.length) {
addItem(_args[_local3]);
_local3++;
};
}
public function checkCollisions():Array{
var _local4:*;
clearArrays();
var _local1:uint = objectArray.length;
var _local2:* = objectArray[0];
var _local3:uint = 1;
while (_local3 < _local1) {
_local4 = objectArray[_local3];
if (_local2.hitTestObject(_local4)){
objectCheckArray.push([_local2, _local4]);
};
_local3++;
};
if (objectCheckArray.length){
_local1 = objectCheckArray.length;
_local3 = 0;
while (_local3 < _local1) {
findCollisions(objectCheckArray[_local3][0], objectCheckArray[_local3][1]);
_local3++;
};
};
return (objectCollisionArray);
}
public function swapTarget(_arg1):void{
var _local2:*;
if ((_arg1 is DisplayObject)){
_local2 = _arg1.root;
if (_local2 == null){
throw (new Error("Items added for collision detection must be on the display list."));
};
objectArray[0] = _arg1;
} else {
throw (new Error((("Cannot swap target: " + _arg1) + " - item must be a Display Object.")));
};
}
override public function removeItem(_arg1):void{
var _local2:Boolean;
var _local3:int = objectArray.length;
var _local4:uint;
while (_local4 < _local3) {
if (objectArray[_local4] == _arg1){
if (_local4 == 0){
throw (new Error("You cannot remove the target from CollisionList. Use swapTarget to change the target."));
};
objectArray.splice(_local4, 1);
_local2 = true;
break;
};
_local4++;
};
if (!(_local2)){
throw (new Error((_arg1 + " could not be removed - object not found in item list.")));
};
}
}
}//package
Section 174
//CommonEvent (CommonEvent)
package {
import flash.events.*;
public class CommonEvent extends Event {
public var parameters:Object;
public static const ON_GRAPHIC_CHANGED:String = "ON_GRAPHIC_CHANGED";
public static const PAUSE_GAME:String = "PAUSE_GAME";
public static const UNPAUSE_GAME:String = "UNPAUSE_GAME";
public static const LANGUAGE_CHANGED:String = "LANGUAGE_CHANGED";
public static const SCREEN_SHOWN:String = "SCREEN_SHOWN";
public static const SCREEN_HIDDEN:String = "SCREEN_HIDDEN";
public static const LEVEL_START:String = "LEVEL_START";
public static const LEVEL_COMPLETE:String = "LEVEL_COMPLETE";
public static const LEVEL_BREAK:String = "LEVEL_BREAK";
public static const LEVEL_RESTART:String = "LEVEL_RESTART";
public static const UPDATE_INTERFACE:String = "UPDATE_INTERFACE";
public static const UPDATE_CONTROL:String = "UPDATE_CONTROL";
public static const REMOVE_OBJECT:String = "REMOVE_OBJECT";
public static const ON_WINDOW_CLOSE:String = "ON_WINDOW_CLOSE";
public static const ON_WINDOW_QUEUE_CLOSE:String = "ON_WINDOW_QUEUE_CLOSE";
public static const ON_SWITCH_SOUND:String = "ON_SWITCH_SOUND";
public static const ON_SWITCH_MUSIC:String = "ON_SWITCH_MUSIC";
public function CommonEvent(_arg1:String, _arg2:Object=null, _arg3:Boolean=false, _arg4:Boolean=false){
parameters = {};
super(_arg1, _arg3, _arg4);
parameters = _arg2;
}
}
}//package
Section 175
//DiscoveryIcon1 (DiscoveryIcon1)
package {
import flash.display.*;
public dynamic class DiscoveryIcon1 extends MovieClip {
}
}//package
Section 176
//DiscoveryIcon2 (DiscoveryIcon2)
package {
import flash.display.*;
public dynamic class DiscoveryIcon2 extends MovieClip {
}
}//package
Section 177
//DiscoveryIcon3 (DiscoveryIcon3)
package {
import flash.display.*;
public dynamic class DiscoveryIcon3 extends MovieClip {
}
}//package
Section 178
//DiscoveryIcon4 (DiscoveryIcon4)
package {
import flash.display.*;
public dynamic class DiscoveryIcon4 extends MovieClip {
}
}//package
Section 179
//DiscoveryIcon5 (DiscoveryIcon5)
package {
import flash.display.*;
public dynamic class DiscoveryIcon5 extends MovieClip {
}
}//package
Section 180
//DiscoveryIcon6 (DiscoveryIcon6)
package {
import flash.display.*;
public dynamic class DiscoveryIcon6 extends MovieClip {
}
}//package
Section 181
//DiscoveryIcon7 (DiscoveryIcon7)
package {
import flash.display.*;
public dynamic class DiscoveryIcon7 extends MovieClip {
}
}//package
Section 182
//DiscoveryIcon8 (DiscoveryIcon8)
package {
import flash.display.*;
public dynamic class DiscoveryIcon8 extends MovieClip {
}
}//package
Section 183
//DiscoveryItem (DiscoveryItem)
package {
import flash.display.*;
import flash.text.*;
public dynamic class DiscoveryItem extends MovieClip {
public var icon:MovieClip;
public var description:TextField;
}
}//package
Section 184
//DomainCheckErrorScreen (DomainCheckErrorScreen)
package {
import flash.display.*;
public dynamic class DomainCheckErrorScreen extends MovieClip {
}
}//package
Section 185
//EffectApple01 (EffectApple01)
package {
import flash.display.*;
public dynamic class EffectApple01 extends MovieClip {
public function EffectApple01(){
addFrameScript(0, frame1, 27, frame28);
}
function frame1(){
SoundManager.createSound(SndEffectApple, false, false);
}
function frame28(){
stop();
if (parent){
parent.removeChild(this);
};
}
}
}//package
Section 186
//EffectFlower01 (EffectFlower01)
package {
import flash.display.*;
public dynamic class EffectFlower01 extends MovieClip {
public function EffectFlower01(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
if (parent){
parent.removeChild(this);
};
}
}
}//package
Section 187
//EffectPiglet01 (EffectPiglet01)
package {
import flash.display.*;
public dynamic class EffectPiglet01 extends MovieClip {
public function EffectPiglet01(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
if (parent){
parent.removeChild(this);
};
}
}
}//package
Section 188
//EffectPumpkin (EffectPumpkin)
package {
import flash.display.*;
public dynamic class EffectPumpkin extends MovieClip {
public function EffectPumpkin(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
if (parent){
parent.removeChild(this);
};
}
}
}//package
Section 189
//EndLevelFadeScreen (EndLevelFadeScreen)
package {
import flash.display.*;
public dynamic class EndLevelFadeScreen extends MovieClip {
public function EndLevelFadeScreen(){
addFrameScript(66, frame67);
}
function frame67(){
stop();
if (parent){
parent.removeChild(this);
};
}
}
}//package
Section 190
//EScore (EScore)
package {
import flash.display.*;
public dynamic class EScore extends MovieClip {
public function EScore(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package
Section 191
//EScoreText (EScoreText)
package {
import flash.text.*;
import flash.display.*;
public dynamic class EScoreText extends MovieClip {
public var scoreText:TextField;
public function EScoreText(){
addFrameScript(40, frame41);
}
function frame41(){
if (parent){
parent.removeChild(this);
};
}
}
}//package
Section 192
//FadeOutScreen (FadeOutScreen)
package {
import flash.display.*;
public dynamic class FadeOutScreen extends MovieClip {
public function FadeOutScreen(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
if (parent){
parent.removeChild(this);
};
}
}
}//package
Section 193
//Flag (Flag)
package {
import src.*;
public dynamic class Flag extends BackElement {
}
}//package
Section 194
//FlagMask (FlagMask)
package {
import flash.display.*;
public dynamic class FlagMask extends BitmapData {
public function FlagMask(_arg1:int=7, _arg2:int=36){
super(_arg1, _arg2);
}
}
}//package
Section 195
//Flower (Flower)
package {
import src.*;
public dynamic class Flower extends Flower {
public function Flower(){
addFrameScript(2, frame3, 59, frame60);
}
function frame3(){
SoundManager.createSound(SndPok, false, false);
}
function frame60(){
stop();
}
}
}//package
Section 196
//GameButton (GameButton)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
public dynamic class GameButton extends MovieClip {
public var hitZone:MovieClip;
protected var isHover:Boolean;// = false
protected var isClicked:Boolean;// = false
protected var state:String;
protected var enable:Boolean;// = true
protected var shine:Boolean;// = false
public function GameButton(_arg1:String=""){
addEventListener(Event.ADDED_TO_STAGE, handleAdded, false, 0, true);
stop();
mouseChildren = false;
buttonMode = true;
useHandCursor = true;
tabEnabled = false;
state = _arg1;
setFrameUp();
if (this.hitZone != null){
hitArea = this.hitZone;
hitZone.visible = false;
};
}
public function handleAdded(_arg1:Event):void{
addEventListener(Event.REMOVED_FROM_STAGE, handleRemoved, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, handleMouseDown, false, 0, true);
root.addEventListener(MouseEvent.MOUSE_UP, handleMouseUp, false, 0, true);
addEventListener(MouseEvent.MOUSE_OVER, handleMouseOver, false, 0, true);
addEventListener(MouseEvent.MOUSE_OUT, handleMouseOut, false, 0, true);
onInit();
}
public function handleRemoved(_arg1:Event):void{
setFrameUp();
removeEventListener(Event.REMOVED_FROM_STAGE, handleRemoved);
removeEventListener(MouseEvent.MOUSE_DOWN, handleMouseDown);
root.removeEventListener(MouseEvent.MOUSE_UP, handleMouseUp);
removeEventListener(MouseEvent.MOUSE_OVER, handleMouseOver);
removeEventListener(MouseEvent.MOUSE_OUT, handleMouseOut);
onRemove();
}
protected function changeFrame(_arg1:String):void{
gotoAndStop((state + _arg1));
}
public function onInit():void{
}
public function onRemove():void{
}
public function onClick():void{
shine = false;
}
public function onHover():void{
}
public function setEnable(_arg1:Boolean):void{
var curFrameNum:*;
var _enable = _arg1;
enable = _enable;
if (_enable == false){
curFrameNum = currentFrame;
try {
gotoAndStop("disable");
} catch(e:ArgumentError) {
gotoAndStop(curFrameNum);
};
};
if (_enable == true){
setState(state);
};
}
public function getState():String{
return (state);
}
public function setState(_arg1:String):void{
state = _arg1;
if (enable == false){
return;
};
setFrameUp();
isClicked = false;
isHover = false;
}
public function handleMouseDown(_arg1:MouseEvent):void{
if (enable == false){
return;
};
isClicked = true;
changeFrame("click");
}
public function handleMouseUp(_arg1:MouseEvent):void{
var e = _arg1;
if (enable == false){
return;
};
if (isClicked == true){
isClicked = false;
try {
SoundManager.createSound((getDefinitionByName("SndClick") as Class));
} catch(e:Error) {
trace("GameButton ERROR");
};
if (isHover == true){
changeFrame("hover");
} else {
setFrameUp();
};
onClick();
};
}
public function handleMouseOver(_arg1:MouseEvent):void{
if (enable == false){
return;
};
isHover = true;
if (isClicked == false){
changeFrame("hover");
onHover();
} else {
changeFrame("click");
};
}
public function handleMouseOut(_arg1:MouseEvent):void{
if (enable == false){
return;
};
if (isClicked == false){
setFrameUp();
};
isHover = false;
}
public function blink(_arg1:int=4):void{
if (_arg1 == 0){
handleMouseOut(null);
} else {
if (isHover == true){
handleMouseOut(null);
} else {
handleMouseOver(null);
};
setTimeout(blink, 90, (_arg1 - 1));
};
}
public function setFrameUp():void{
if (shine){
changeFrame("shine");
} else {
changeFrame("up");
};
}
public function setShine(_arg1:Boolean=true):void{
shine = _arg1;
setFrameUp();
}
}
}//package
Section 197
//GameOverFadeScreen (GameOverFadeScreen)
package {
import flash.display.*;
public dynamic class GameOverFadeScreen extends MovieClip {
public function GameOverFadeScreen(){
addFrameScript(66, frame67);
}
function frame67(){
stop();
if (parent){
parent.removeChild(this);
};
}
}
}//package
Section 198
//Hive (Hive)
package {
import src.*;
public dynamic class Hive extends Obstacle {
}
}//package
Section 199
//HiveMask (HiveMask)
package {
import flash.display.*;
public dynamic class HiveMask extends BitmapData {
public function HiveMask(_arg1:int=51, _arg2:int=53){
super(_arg1, _arg2);
}
}
}//package
Section 200
//HorizontalGate (HorizontalGate)
package {
import src.*;
public dynamic class HorizontalGate extends Gate {
public function HorizontalGate(){
addFrameScript(1, frame2, 4, frame5, 8, frame9);
}
function frame2(){
SoundManager.createSound(SndDoor, false, true);
}
function frame5(){
stop();
}
function frame9(){
gotoAndStop("closed");
}
}
}//package
Section 201
//HorizontalGateAntiMask1 (HorizontalGateAntiMask1)
package {
import flash.display.*;
public dynamic class HorizontalGateAntiMask1 extends BitmapData {
public function HorizontalGateAntiMask1(_arg1:int=61, _arg2:int=34){
super(_arg1, _arg2);
}
}
}//package
Section 202
//HorizontalGateMask1 (HorizontalGateMask1)
package {
import flash.display.*;
public dynamic class HorizontalGateMask1 extends BitmapData {
public function HorizontalGateMask1(_arg1:int=55, _arg2:int=34){
super(_arg1, _arg2);
}
}
}//package
Section 203
//HorizontalGateMask2 (HorizontalGateMask2)
package {
import flash.display.*;
public dynamic class HorizontalGateMask2 extends BitmapData {
public function HorizontalGateMask2(_arg1:int=61, _arg2:int=51){
super(_arg1, _arg2);
}
}
}//package
Section 204
//InterLevelAd (InterLevelAd)
package {
import flash.display.*;
public dynamic class InterLevelAd extends MovieClip {
public var adBox:AdBox;
public var playButton:MenuButton;
}
}//package
Section 205
//KabanEye (KabanEye)
package {
import flash.display.*;
public dynamic class KabanEye extends MovieClip {
}
}//package
Section 206
//KabanGirl (KabanGirl)
package {
import src.*;
public dynamic class KabanGirl extends Obstacle {
}
}//package
Section 207
//KabanGirlMask (KabanGirlMask)
package {
import flash.display.*;
public dynamic class KabanGirlMask extends BitmapData {
public function KabanGirlMask(_arg1:int=38, _arg2:int=53){
super(_arg1, _arg2);
}
}
}//package
Section 208
//KabanLoadrun (KabanLoadrun)
package {
import flash.display.*;
public dynamic class KabanLoadrun extends MovieClip {
}
}//package
Section 209
//Level1 (Level1)
package {
import src.*;
public dynamic class Level1 extends Level {
}
}//package
Section 210
//Level10 (Level10)
package {
import src.*;
public dynamic class Level10 extends Level {
}
}//package
Section 211
//Level10ButtonImage (Level10ButtonImage)
package {
import flash.display.*;
public dynamic class Level10ButtonImage extends MovieClip {
public var girl:MovieClip;
public function Level10ButtonImage(){
addFrameScript(0, frame1);
}
function frame1(){
girl.stop();
}
}
}//package
Section 212
//Level10EndLevelScreenBG (Level10EndLevelScreenBG)
package {
import flash.display.*;
public dynamic class Level10EndLevelScreenBG extends MovieClip {
public var kaban:MovieClip;
}
}//package
Section 213
//Level10ScreenBG (Level10ScreenBG)
package {
import flash.display.*;
public dynamic class Level10ScreenBG extends MovieClip {
public var kaban:MovieClip;
}
}//package
Section 214
//Level11ButtonImage (Level11ButtonImage)
package {
import flash.display.*;
public dynamic class Level11ButtonImage extends MovieClip {
}
}//package
Section 215
//Level1ButtonImage (Level1ButtonImage)
package {
import flash.display.*;
public dynamic class Level1ButtonImage extends MovieClip {
}
}//package
Section 216
//Level1EndLevelScreenBG (Level1EndLevelScreenBG)
package {
import flash.display.*;
public dynamic class Level1EndLevelScreenBG extends MovieClip {
public var bg:MovieClip;
public var kaban:MovieClip;
}
}//package
Section 217
//Level1GameOverScreenBG (Level1GameOverScreenBG)
package {
import flash.display.*;
public dynamic class Level1GameOverScreenBG extends MovieClip {
public var bg:MovieClip;
public var kaban:MovieClip;
}
}//package
Section 218
//Level1ScreenBG (Level1ScreenBG)
package {
import flash.display.*;
public dynamic class Level1ScreenBG extends MovieClip {
public var bg:MovieClip;
public var kaban:MovieClip;
}
}//package
Section 219
//Level2 (Level2)
package {
import src.*;
public dynamic class Level2 extends Level {
}
}//package
Section 220
//Level2ButtonImage (Level2ButtonImage)
package {
import flash.display.*;
public dynamic class Level2ButtonImage extends MovieClip {
}
}//package
Section 221
//Level2EndLevelScreenBG (Level2EndLevelScreenBG)
package {
import flash.display.*;
public dynamic class Level2EndLevelScreenBG extends MovieClip {
public var kaban:MovieClip;
}
}//package
Section 222
//Level2ScreenBG (Level2ScreenBG)
package {
import flash.display.*;
public dynamic class Level2ScreenBG extends MovieClip {
public var kaban:MovieClip;
}
}//package
Section 223
//Level3 (Level3)
package {
import src.*;
public dynamic class Level3 extends Level {
}
}//package
Section 224
//Level3ButtonImage (Level3ButtonImage)
package {
import flash.display.*;
public dynamic class Level3ButtonImage extends MovieClip {
public var girl:MovieClip;
public function Level3ButtonImage(){
addFrameScript(0, frame1);
}
function frame1(){
girl.stop();
}
}
}//package
Section 225
//Level3ScreenBG (Level3ScreenBG)
package {
import flash.display.*;
public dynamic class Level3ScreenBG extends MovieClip {
public var kaban:MovieClip;
}
}//package
Section 226
//Level4 (Level4)
package {
import src.*;
public dynamic class Level4 extends Level {
}
}//package
Section 227
//Level4ButtonImage (Level4ButtonImage)
package {
import flash.display.*;
public dynamic class Level4ButtonImage extends MovieClip {
public var girl:MovieClip;
public function Level4ButtonImage(){
addFrameScript(0, frame1);
}
function frame1(){
girl.stop();
}
}
}//package
Section 228
//Level4EndLevelScreenBG (Level4EndLevelScreenBG)
package {
import flash.display.*;
public dynamic class Level4EndLevelScreenBG extends MovieClip {
public var kaban:MovieClip;
}
}//package
Section 229
//Level4ScreenBG (Level4ScreenBG)
package {
import flash.display.*;
public dynamic class Level4ScreenBG extends MovieClip {
public var kaban:MovieClip;
}
}//package
Section 230
//Level5 (Level5)
package {
import src.*;
public dynamic class Level5 extends Level {
}
}//package
Section 231
//Level5ButtonImage (Level5ButtonImage)
package {
import flash.display.*;
public dynamic class Level5ButtonImage extends MovieClip {
public var girl:Trough;
public function Level5ButtonImage(){
addFrameScript(0, frame1);
}
function frame1(){
girl.stop();
}
}
}//package
Section 232
//Level5EndLevelScreenBG (Level5EndLevelScreenBG)
package {
import flash.display.*;
public dynamic class Level5EndLevelScreenBG extends MovieClip {
public var kaban:MovieClip;
}
}//package
Section 233
//Level5ScreenBG (Level5ScreenBG)
package {
import flash.display.*;
public dynamic class Level5ScreenBG extends MovieClip {
public var kaban:MovieClip;
}
}//package
Section 234
//Level6 (Level6)
package {
import src.*;
public dynamic class Level6 extends Level {
}
}//package
Section 235
//Level6ButtonImage (Level6ButtonImage)
package {
import flash.display.*;
public dynamic class Level6ButtonImage extends MovieClip {
public var barrel:Barrel;
public function Level6ButtonImage(){
addFrameScript(0, frame1);
}
function frame1(){
barrel.stop();
}
}
}//package
Section 236
//Level6EndLevelScreenBG (Level6EndLevelScreenBG)
package {
import flash.display.*;
public dynamic class Level6EndLevelScreenBG extends MovieClip {
public var kaban:MovieClip;
}
}//package
Section 237
//Level6ScreenBG (Level6ScreenBG)
package {
import flash.display.*;
public dynamic class Level6ScreenBG extends MovieClip {
public var kaban:MovieClip;
}
}//package
Section 238
//Level7 (Level7)
package {
import src.*;
public dynamic class Level7 extends Level {
}
}//package
Section 239
//Level7ButtonImage (Level7ButtonImage)
package {
import flash.display.*;
public dynamic class Level7ButtonImage extends MovieClip {
}
}//package
Section 240
//Level7EndLevelScreenBG (Level7EndLevelScreenBG)
package {
import flash.display.*;
public dynamic class Level7EndLevelScreenBG extends MovieClip {
public var kaban:MovieClip;
}
}//package
Section 241
//Level7ScreenBG (Level7ScreenBG)
package {
import flash.display.*;
public dynamic class Level7ScreenBG extends MovieClip {
public var kaban:MovieClip;
}
}//package
Section 242
//Level8 (Level8)
package {
import src.*;
public dynamic class Level8 extends Level {
}
}//package
Section 243
//Level8ButtonImage (Level8ButtonImage)
package {
import flash.display.*;
public dynamic class Level8ButtonImage extends MovieClip {
public var barrel:Barrel;
public function Level8ButtonImage(){
addFrameScript(0, frame1);
}
function frame1(){
barrel.stop();
}
}
}//package
Section 244
//Level8ScreenBG (Level8ScreenBG)
package {
import flash.display.*;
public dynamic class Level8ScreenBG extends MovieClip {
public var kaban:MovieClip;
}
}//package
Section 245
//Level9 (Level9)
package {
import src.*;
public dynamic class Level9 extends Level {
}
}//package
Section 246
//Level9ButtonImage (Level9ButtonImage)
package {
import flash.display.*;
public dynamic class Level9ButtonImage extends MovieClip {
}
}//package
Section 247
//Level9EndLevelScreenBG (Level9EndLevelScreenBG)
package {
import flash.display.*;
public dynamic class Level9EndLevelScreenBG extends MovieClip {
public var kaban:MovieClip;
}
}//package
Section 248
//Level9ScreenBG (Level9ScreenBG)
package {
import flash.display.*;
public dynamic class Level9ScreenBG extends MovieClip {
public var kaban:MovieClip;
}
}//package
Section 249
//LevelGUIFlowers (LevelGUIFlowers)
package {
import src.*;
public dynamic class LevelGUIFlowers extends LevelInterface {
}
}//package
Section 250
//LevelGUIPiglets (LevelGUIPiglets)
package {
import src.*;
public dynamic class LevelGUIPiglets extends LevelInterface {
}
}//package
Section 251
//MainMenuButton (MainMenuButton)
package {
public dynamic class MainMenuButton extends GameButton {
}
}//package
Section 252
//MainMenuButton2 (MainMenuButton2)
package {
public dynamic class MainMenuButton2 extends GameButton {
}
}//package
Section 253
//MenuButton (MenuButton)
package {
public dynamic class MenuButton extends GameButton {
}
}//package
Section 254
//MscGame (MscGame)
package {
import flash.media.*;
public dynamic class MscGame extends Sound {
}
}//package
Section 255
//MscGameOver (MscGameOver)
package {
import flash.media.*;
public dynamic class MscGameOver extends Sound {
}
}//package
Section 256
//MscMenu (MscMenu)
package {
import flash.media.*;
public dynamic class MscMenu extends Sound {
}
}//package
Section 257
//MscTheEnd (MscTheEnd)
package {
import flash.media.*;
public dynamic class MscTheEnd extends Sound {
}
}//package
Section 258
//MyUtils (MyUtils)
package {
import flash.utils.*;
import flash.text.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class MyUtils {
public static var lastFrameTime:Number = getTimer();
public static var frameTime:Number = 0;
public static var signal:Boolean = false;
public static var tempo:Number;
public static var time:Number;
public static function absInt(_arg1:int):int{
return (((_arg1 ^ (_arg1 >> 31)) - (_arg1 >> 31)));
}
public static function absNumber(_arg1:Number):Number{
return (((_arg1 ^ (_arg1 >> 31)) - (_arg1 >> 31)));
}
public static function setTextLeading(_arg1:TextField, _arg2:Number):void{
var _local3:TextFormat = _arg1.getTextFormat();
_local3.leading = _arg2;
_arg1.setTextFormat(_local3);
}
public static function updateFPS():Number{
if (signal == true){
time = getTimer();
} else {
tempo = int((1000 / (getTimer() - time)));
};
signal = !(signal);
return (tempo);
}
public static function resetFrameTime():void{
lastFrameTime = getTimer();
}
protected static function updateFrameTime(_arg1:Event=null):void{
frameTime = ((getTimer() - lastFrameTime) / 1000);
lastFrameTime = getTimer();
}
public static function initFrameTime(_arg1:EventDispatcher):void{
_arg1.addEventListener(Event.ENTER_FRAME, updateFrameTime, false, 0, true);
}
public static function parseOptions(_arg1:Object, _arg2:Object=null):Object{
var _local4:String;
var _local3:Object = {};
if (_arg2 != null){
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
};
if (_arg1 != null){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
return (_local3);
}
public static function removeFromArray(_arg1:Array, _arg2):Boolean{
var _local3:Boolean;
var _local4:uint;
while (_local4 < _arg1.length) {
if (_arg1[_local4] == _arg2){
_arg1.splice(_local4, 1);
_local4--;
_local3 = true;
};
_local4++;
};
return (_local3);
}
public static function setAnimationType(_arg1:MovieClip, _arg2:int):void{
var _local3:MovieClip;
var _local5:TypedAnimElement;
var _local4:int;
while (_local4 < _arg1.numChildren) {
_local5 = (_arg1.getChildAt(_local4) as TypedAnimElement);
if (_local5 != null){
_local5.gotoAndStop(_arg2);
} else {
_local3 = (_arg1.getChildAt(_local4) as MovieClip);
if (_local3 != null){
setAnimationType(_local3, _arg2);
};
};
_local4++;
};
}
public static function playMovie(_arg1:MovieClip):void{
var _local2:MovieClip;
var _local3:int;
while (_local3 < _arg1.numChildren) {
_local2 = (_arg1.getChildAt(_local3) as MovieClip);
if (_local2 != null){
_local2.play();
playMovie(_local2);
};
_local3++;
};
}
public static function stopMovie(_arg1:MovieClip):void{
var _local2:MovieClip;
var _local3:int;
while (_local3 < _arg1.numChildren) {
_local2 = (_arg1.getChildAt(_local3) as MovieClip);
if (_local2 != null){
_local2.stop();
stopMovie(_local2);
};
_local3++;
};
}
public static function removeAllChildrens(_arg1:DisplayObjectContainer):void{
while (_arg1.numChildren > 0) {
_arg1.removeChildAt(0);
};
}
public static function clone(_arg1:Object){
var _local2:ByteArray = new ByteArray();
_local2.writeObject(_arg1);
_local2.position = 0;
return (_local2.readObject());
}
public static function distance(_arg1:Number, _arg2:Number):Number{
return (Math.sqrt(((_arg1 * _arg1) + (_arg2 * _arg2))));
}
public static function distanceNumber(_arg1:Number, _arg2:Number):Number{
if (_arg1 < 0){
_arg1 = -(_arg1);
};
if (_arg2 < 0){
_arg2 = -(_arg2);
};
if (_arg1 < _arg2){
return (((0.961 * _arg2) + (0.398 * _arg1)));
};
return (((0.961 * _arg1) + (0.398 * _arg2)));
}
public static function distanceInt(_arg1:int, _arg2:int):int{
if (_arg1 < 0){
_arg1 = -(_arg1);
};
if (_arg2 < 0){
_arg2 = -(_arg2);
};
if (_arg1 < _arg2){
return (((123 * _arg2) + ((51 * _arg1) / 128)));
};
return (((123 * _arg1) + ((51 * _arg2) / 128)));
}
public static function distanceBox(_arg1:Number, _arg2:Number):Number{
if (_arg1 < 0){
_arg1 = -(_arg1);
};
if (_arg2 < 0){
_arg2 = -(_arg2);
};
if (_arg1 < _arg2){
return (_arg2);
};
return (_arg1);
}
public static function dAngleRadian(_arg1, _arg2){
var _local3:* = (_arg1 - _arg2);
if (_local3 > Math.PI){
_local3 = ((-(Math.PI) * 2) + _local3);
} else {
if (_local3 < -(Math.PI)){
_local3 = ((Math.PI * 2) + _local3);
};
};
return (_local3);
}
public static function dAngleDegree(_arg1, _arg2){
var _local3:* = (_arg1 - _arg2);
if (_local3 > 180){
_local3 = (-360 + _local3);
} else {
if (_local3 < -180){
_local3 = (360 + _local3);
};
};
return (_local3);
}
public static function degree(_arg1){
return (((_arg1 / Math.PI) * 180));
}
public static function radian(_arg1){
return (((_arg1 / 180) * Math.PI));
}
public static function timeToText(_arg1:Number):String{
if (((isNaN(_arg1)) || ((_arg1 <= 0)))){
return ("00:00");
};
var _local2:int = (_arg1 / 60);
var _local3:int = (_arg1 % 60);
var _local4:String = "";
if (_local2 < 10){
_local4 = "0";
};
_local4 = (_local4 + (_local2 + ":"));
if (_local3 < 10){
_local4 = (_local4 + "0");
};
_local4 = (_local4 + _local3.toString());
return (_local4);
}
public static function getDomain(_arg1:Stage):String{
var _local2:String = _arg1.loaderInfo.url;
var _local3:Number = (_local2.indexOf("://") + 3);
var _local4:Number = _local2.indexOf("/", _local3);
var _local5:String = _local2.substring(_local3, _local4);
var _local6:Number = (_local5.lastIndexOf(".") - 1);
var _local7:Number = (_local5.lastIndexOf(".", _local6) + 1);
_local5 = _local5.substring(_local7, _local5.length);
return (_local5.toLowerCase());
}
public static function cutCross(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Point){
var _local5:Object = new Object();
var _local6:Number = (((_arg2.y - _arg1.y) * (_arg3.x - _arg4.x)) - ((_arg3.y - _arg4.y) * (_arg2.x - _arg1.x)));
var _local7:Number = (((_arg2.y - _arg1.y) * (_arg3.x - _arg1.x)) - ((_arg3.y - _arg1.y) * (_arg2.x - _arg1.x)));
var _local8:Number = (((_arg3.y - _arg1.y) * (_arg3.x - _arg4.x)) - ((_arg3.y - _arg4.y) * (_arg3.x - _arg1.x)));
if ((((((_local6 == 0)) && ((_local7 == 0)))) && ((_local8 == 0)))){
_local5.type = 2;
return (_local5);
};
if (_local6 == 0){
_local5.type = 1;
return (_local5);
};
var _local9:Number = (_local7 / _local6);
var _local10:Number = (_local8 / _local6);
if ((((((((0 <= _local9)) && ((_local9 <= 1)))) && ((0 <= _local10)))) && ((_local10 <= 1)))){
_local5.pt = new Point();
_local5.pt.x = (_arg1.x + ((_arg2.x - _arg1.x) * _local10));
_local5.pt.y = (_arg1.y + ((_arg2.y - _arg1.y) * _local10));
_local5.type = 4;
};
return (_local5);
}
public static function MD5(_arg1){
var k:*;
var AA:*;
var BB:*;
var CC:*;
var DD:*;
var a:*;
var b:*;
var c:*;
var d:*;
var string = _arg1;
var RotateLeft:Function = function (_arg1, _arg2){
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
};
var AddUnsigned:Function = function (_arg1, _arg2){
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
_local5 = (_arg1 & 2147483648);
_local6 = (_arg2 & 2147483648);
_local3 = (_arg1 & 1073741824);
_local4 = (_arg2 & 1073741824);
_local7 = ((_arg1 & 1073741823) + (_arg2 & 1073741823));
if ((_local3 & _local4)){
return ((((_local7 ^ 2147483648) ^ _local5) ^ _local6));
};
if ((_local3 | _local4)){
if ((_local7 & 1073741824)){
return ((((_local7 ^ 3221225472) ^ _local5) ^ _local6));
};
return ((((_local7 ^ 1073741824) ^ _local5) ^ _local6));
//unresolved jump
};
return (((_local7 ^ _local5) ^ _local6));
};
var F:Function = function (_arg1, _arg2, _arg3){
return (((_arg1 & _arg2) | (~(_arg1) & _arg3)));
};
var G:Function = function (_arg1, _arg2, _arg3){
return (((_arg1 & _arg3) | (_arg2 & ~(_arg3))));
};
var H:Function = function (_arg1, _arg2, _arg3){
return (((_arg1 ^ _arg2) ^ _arg3));
};
var I:Function = function (_arg1, _arg2, _arg3){
return ((_arg2 ^ (_arg1 | ~(_arg3))));
};
var FF:Function = function (_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7){
_arg1 = AddUnsigned(_arg1, AddUnsigned(AddUnsigned(F(_arg2, _arg3, _arg4), _arg5), _arg7));
return (AddUnsigned(RotateLeft(_arg1, _arg6), _arg2));
};
var GG:Function = function (_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7){
_arg1 = AddUnsigned(_arg1, AddUnsigned(AddUnsigned(G(_arg2, _arg3, _arg4), _arg5), _arg7));
return (AddUnsigned(RotateLeft(_arg1, _arg6), _arg2));
};
var HH:Function = function (_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7){
_arg1 = AddUnsigned(_arg1, AddUnsigned(AddUnsigned(H(_arg2, _arg3, _arg4), _arg5), _arg7));
return (AddUnsigned(RotateLeft(_arg1, _arg6), _arg2));
};
var II:Function = function (_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7){
_arg1 = AddUnsigned(_arg1, AddUnsigned(AddUnsigned(I(_arg2, _arg3, _arg4), _arg5), _arg7));
return (AddUnsigned(RotateLeft(_arg1, _arg6), _arg2));
};
var ConvertToWordArray:Function = function (_arg1){
var _local2:*;
var _local3:* = _arg1.length;
var _local4:* = (_local3 + 8);
var _local5:* = ((_local4 - (_local4 % 64)) / 64);
var _local6:* = ((_local5 + 1) * 16);
var _local7:Array = new Array((_local6 - 1));
var _local8:* = 0;
var _local9:* = 0;
while (_local9 < _local3) {
_local2 = ((_local9 - (_local9 % 4)) / 4);
_local8 = ((_local9 % 4) * 8);
_local7[_local2] = (_local7[_local2] | (_arg1.charCodeAt(_local9) << _local8));
_local9++;
};
_local2 = ((_local9 - (_local9 % 4)) / 4);
_local8 = ((_local9 % 4) * 8);
_local7[_local2] = (_local7[_local2] | (128 << _local8));
_local7[(_local6 - 2)] = (_local3 << 3);
_local7[(_local6 - 1)] = (_local3 >>> 29);
return (_local7);
};
var WordToHex:Function = function (_arg1){
var _local4:*;
var _local5:*;
var _local2:* = "";
var _local3:* = "";
_local5 = 0;
while (_local5 <= 3) {
_local4 = ((_arg1 >>> (_local5 * 8)) & 0xFF);
_local3 = ("0" + _local4.toString(16));
_local2 = (_local2 + _local3.substr((_local3.length - 2), 2));
_local5++;
};
return (_local2);
};
var Utf8Encode:Function = function (_arg1){
var _local4:*;
var _local2:* = "";
var _local3:* = 0;
while (_local3 < _arg1.length) {
_local4 = _arg1.charCodeAt(_local3);
if (_local4 < 128){
_local2 = (_local2 + String.fromCharCode(_local4));
} else {
if ((((_local4 > 127)) && ((_local4 < 0x0800)))){
_local2 = (_local2 + String.fromCharCode(((_local4 >> 6) | 192)));
_local2 = (_local2 + String.fromCharCode(((_local4 & 63) | 128)));
} else {
_local2 = (_local2 + String.fromCharCode(((_local4 >> 12) | 224)));
_local2 = (_local2 + String.fromCharCode((((_local4 >> 6) & 63) | 128)));
_local2 = (_local2 + String.fromCharCode(((_local4 & 63) | 128)));
};
};
_local3++;
};
return (_local2);
};
var x:Array = [];
var S11:* = 7;
var S12:* = 12;
var S13:* = 17;
var S14:* = 22;
var S21:* = 5;
var S22:* = 9;
var S23:* = 14;
var S24:* = 20;
var S31:* = 4;
var S32:* = 11;
var S33:* = 16;
var S34:* = 23;
var S41:* = 6;
var S42:* = 10;
var S43:* = 15;
var S44:* = 21;
string = Utf8Encode(string);
x = ConvertToWordArray(string);
a = 1732584193;
b = 4023233417;
c = 2562383102;
d = 271733878;
k = 0;
while (k < x.length) {
AA = a;
BB = b;
CC = c;
DD = d;
a = FF(a, b, c, d, x[(k + 0)], S11, 3614090360);
d = FF(d, a, b, c, x[(k + 1)], S12, 3905402710);
c = FF(c, d, a, b, x[(k + 2)], S13, 606105819);
b = FF(b, c, d, a, x[(k + 3)], S14, 3250441966);
a = FF(a, b, c, d, x[(k + 4)], S11, 4118548399);
d = FF(d, a, b, c, x[(k + 5)], S12, 1200080426);
c = FF(c, d, a, b, x[(k + 6)], S13, 2821735955);
b = FF(b, c, d, a, x[(k + 7)], S14, 4249261313);
a = FF(a, b, c, d, x[(k + 8)], S11, 1770035416);
d = FF(d, a, b, c, x[(k + 9)], S12, 2336552879);
c = FF(c, d, a, b, x[(k + 10)], S13, 4294925233);
b = FF(b, c, d, a, x[(k + 11)], S14, 2304563134);
a = FF(a, b, c, d, x[(k + 12)], S11, 1804603682);
d = FF(d, a, b, c, x[(k + 13)], S12, 4254626195);
c = FF(c, d, a, b, x[(k + 14)], S13, 2792965006);
b = FF(b, c, d, a, x[(k + 15)], S14, 1236535329);
a = GG(a, b, c, d, x[(k + 1)], S21, 4129170786);
d = GG(d, a, b, c, x[(k + 6)], S22, 3225465664);
c = GG(c, d, a, b, x[(k + 11)], S23, 643717713);
b = GG(b, c, d, a, x[(k + 0)], S24, 3921069994);
a = GG(a, b, c, d, x[(k + 5)], S21, 3593408605);
d = GG(d, a, b, c, x[(k + 10)], S22, 38016083);
c = GG(c, d, a, b, x[(k + 15)], S23, 3634488961);
b = GG(b, c, d, a, x[(k + 4)], S24, 3889429448);
a = GG(a, b, c, d, x[(k + 9)], S21, 568446438);
d = GG(d, a, b, c, x[(k + 14)], S22, 3275163606);
c = GG(c, d, a, b, x[(k + 3)], S23, 4107603335);
b = GG(b, c, d, a, x[(k + 8)], S24, 1163531501);
a = GG(a, b, c, d, x[(k + 13)], S21, 2850285829);
d = GG(d, a, b, c, x[(k + 2)], S22, 4243563512);
c = GG(c, d, a, b, x[(k + 7)], S23, 1735328473);
b = GG(b, c, d, a, x[(k + 12)], S24, 2368359562);
a = HH(a, b, c, d, x[(k + 5)], S31, 4294588738);
d = HH(d, a, b, c, x[(k + 8)], S32, 2272392833);
c = HH(c, d, a, b, x[(k + 11)], S33, 1839030562);
b = HH(b, c, d, a, x[(k + 14)], S34, 4259657740);
a = HH(a, b, c, d, x[(k + 1)], S31, 2763975236);
d = HH(d, a, b, c, x[(k + 4)], S32, 1272893353);
c = HH(c, d, a, b, x[(k + 7)], S33, 4139469664);
b = HH(b, c, d, a, x[(k + 10)], S34, 3200236656);
a = HH(a, b, c, d, x[(k + 13)], S31, 681279174);
d = HH(d, a, b, c, x[(k + 0)], S32, 3936430074);
c = HH(c, d, a, b, x[(k + 3)], S33, 3572445317);
b = HH(b, c, d, a, x[(k + 6)], S34, 76029189);
a = HH(a, b, c, d, x[(k + 9)], S31, 3654602809);
d = HH(d, a, b, c, x[(k + 12)], S32, 3873151461);
c = HH(c, d, a, b, x[(k + 15)], S33, 530742520);
b = HH(b, c, d, a, x[(k + 2)], S34, 3299628645);
a = II(a, b, c, d, x[(k + 0)], S41, 4096336452);
d = II(d, a, b, c, x[(k + 7)], S42, 1126891415);
c = II(c, d, a, b, x[(k + 14)], S43, 2878612391);
b = II(b, c, d, a, x[(k + 5)], S44, 4237533241);
a = II(a, b, c, d, x[(k + 12)], S41, 1700485571);
d = II(d, a, b, c, x[(k + 3)], S42, 2399980690);
c = II(c, d, a, b, x[(k + 10)], S43, 4293915773);
b = II(b, c, d, a, x[(k + 1)], S44, 2240044497);
a = II(a, b, c, d, x[(k + 8)], S41, 1873313359);
d = II(d, a, b, c, x[(k + 15)], S42, 4264355552);
c = II(c, d, a, b, x[(k + 6)], S43, 2734768916);
b = II(b, c, d, a, x[(k + 13)], S44, 1309151649);
a = II(a, b, c, d, x[(k + 4)], S41, 4149444226);
d = II(d, a, b, c, x[(k + 11)], S42, 3174756917);
c = II(c, d, a, b, x[(k + 2)], S43, 718787259);
b = II(b, c, d, a, x[(k + 9)], S44, 3951481745);
a = AddUnsigned(a, AA);
b = AddUnsigned(b, BB);
c = AddUnsigned(c, CC);
d = AddUnsigned(d, DD);
k = (k + 16);
};
var temp:* = (((WordToHex(a) + WordToHex(b)) + WordToHex(c)) + WordToHex(d));
return (temp.toLowerCase());
}
}
}//package
Section 259
//OptionsButton (OptionsButton)
package {
public dynamic class OptionsButton extends GameButton {
}
}//package
Section 260
//Pitchfork (Pitchfork)
package {
import src.*;
public dynamic class Pitchfork extends Pitchfork {
}
}//package
Section 261
//Player_mc (Player_mc)
package {
import src.*;
public dynamic class Player_mc extends Player {
public function Player_mc(){
addFrameScript(1, frame2, 4, frame5, 7, frame8, 9, frame10, 12, frame13, 14, frame15, 17, frame18, 19, frame20, 34, frame35, 49, frame50, 64, frame65, 79, frame80, 83, frame84, 87, frame88, 91, frame92, 95, frame96, 99, frame100, 103, frame104, 107, frame108, 111, frame112, 112, frame113, 170, frame171, 172, frame173);
}
function frame2(){
createBigSmoke();
}
function frame5(){
gotoAndPlay("runUp");
updateAnimation();
createBigSmoke();
}
function frame8(){
createBigSmoke();
}
function frame10(){
gotoAndPlay("runRight");
updateAnimation();
createBigSmoke();
}
function frame13(){
createBigSmoke();
}
function frame15(){
gotoAndPlay("runLeft");
updateAnimation();
createBigSmoke();
}
function frame18(){
createBigSmoke();
}
function frame20(){
gotoAndPlay("runDown");
updateAnimation();
createBigSmoke();
}
function frame35(){
gotoAndPlay("stayUp");
updateAnimation();
}
function frame50(){
gotoAndPlay("stayRight");
updateAnimation();
}
function frame65(){
gotoAndPlay("stayLeft");
updateAnimation();
}
function frame80(){
gotoAndPlay("stayDown");
updateAnimation();
}
function frame84(){
createSmoke();
}
function frame88(){
gotoAndPlay("moveUp");
updateAnimation();
createSmoke();
}
function frame92(){
createSmoke();
}
function frame96(){
gotoAndPlay("moveRight");
updateAnimation();
createSmoke();
}
function frame100(){
createSmoke();
}
function frame104(){
gotoAndPlay("moveLeft");
updateAnimation();
createSmoke();
}
function frame108(){
createSmoke();
}
function frame112(){
gotoAndPlay("moveDown");
updateAnimation();
}
function frame113(){
SoundManager.createSound(SndWaterIn, false, false);
}
function frame171(){
SoundManager.createSound(SndWaterOut, false, false);
}
function frame173(){
stop();
outOfPool();
updateAnimation();
}
}
}//package
Section 262
//Pool01 (Pool01)
package {
import src.*;
public dynamic class Pool01 extends Pool {
}
}//package
Section 263
//Preloader (Preloader)
package {
import flash.display.*;
public dynamic class Preloader extends MovieClip {
}
}//package
Section 264
//ScaredFarmer (ScaredFarmer)
package {
import src.*;
public dynamic class ScaredFarmer extends Farmer {
public function ScaredFarmer(){
addFrameScript(1, frame2, 9, frame10, 17, frame18, 18, frame19, 26, frame27, 35, frame36, 36, frame37, 44, frame45, 53, frame54, 54, frame55, 62, frame63, 70, frame71, 71, frame72, 94, frame95, 95, frame96, 120, frame121, 145, frame146, 169, frame170, 171, frame172, 172, frame173, 184, frame185, 185, frame186, 197, frame198, 198, frame199, 210, frame211, 211, frame212, 223, frame224, 224, frame225, 271, frame272, 273, frame274, 274, frame275, 290, frame291);
}
function frame2(){
playAnimation("AnimScaredFarmerMoveUp", true, updateAnimation);
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
function frame10(){
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
function frame18(){
gotoAndPlay("moveUp");
}
function frame19(){
playAnimation("AnimScaredFarmerMoveRight", true, updateAnimation);
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
function frame27(){
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
function frame36(){
gotoAndPlay("moveRight");
}
function frame37(){
playAnimation("AnimScaredFarmerMoveLeft", true, updateAnimation);
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
function frame45(){
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
function frame54(){
gotoAndPlay("moveLeft");
}
function frame55(){
playAnimation("AnimScaredFarmerMoveDown", true, updateAnimation);
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
function frame63(){
SoundManager.createRandomSound(false, false, SndStep01, SndStep02, SndStep03);
}
function frame71(){
gotoAndPlay("moveDown");
}
function frame72(){
stop();
playAnimation("AnimScaredFarmerStayUp");
}
function frame95(){
gotoAndPlay("stayUp");
updateAnimation();
}
function frame96(){
stop();
animationList.stopAllAnimations();
animationList.play("AnimScaredFarmerStayRight", true);
}
function frame121(){
stop();
playAnimation("AnimScaredFarmerStayLeft");
}
function frame146(){
stop();
playAnimation("AnimScaredFarmerStayDown");
}
function frame170(){
animationList.stopAllAnimations();
animationList.play("AnimScaredFarmerScare", true);
SoundManager.createSound(SndFarmerScream);
}
function frame172(){
state = SCARED;
stop();
}
function frame173(){
animationList.stopAllAnimations();
animationList.play("AnimScaredFarmerFallUp", false);
}
function frame185(){
stop();
updateAnimation();
}
function frame186(){
animationList.stopAllAnimations();
animationList.play("AnimScaredFarmerFallRight", false);
}
function frame198(){
stop();
updateAnimation();
}
function frame199(){
animationList.stopAllAnimations();
animationList.play("AnimScaredFarmerFallLeft", false);
}
function frame211(){
stop();
updateAnimation();
}
function frame212(){
animationList.stopAllAnimations();
animationList.play("AnimScaredFarmerFallDown", false);
}
function frame224(){
stop();
updateAnimation();
}
function frame225(){
animationList.stopAllAnimations();
animationList.play("AnimScaredFarmerInPool", false);
SoundManager.createSound(SndWaterIn, false, false);
}
function frame272(){
SoundManager.createSound(SndWaterOut, false, false);
}
function frame274(){
stop();
outOfPool();
updateAnimation();
}
function frame275(){
animationList.stopAllAnimations();
animationList.play("AnimScaredFarmerUnderWater", false);
SoundManager.createSound(SndWaterIn, false, false);
}
function frame291(){
stop();
diveIntoPool();
}
}
}//package
Section 265
//ScoreBoardClip_ (ScoreBoardClip_)
package {
import flash.display.*;
public dynamic class ScoreBoardClip_ extends MovieClip {
}
}//package
Section 266
//Smoke (Smoke)
package {
import flash.display.*;
public dynamic class Smoke extends MovieClip {
public function Smoke(){
addFrameScript(19, frame20);
}
function frame20(){
if (parent){
parent.removeChild(this);
};
}
}
}//package
Section 267
//SmokeUpDown (SmokeUpDown)
package {
import flash.display.*;
public dynamic class SmokeUpDown extends MovieClip {
public function SmokeUpDown(){
addFrameScript(19, frame20);
}
function frame20(){
if (parent){
parent.removeChild(this);
};
}
}
}//package
Section 268
//SndAngry (SndAngry)
package {
import flash.media.*;
public dynamic class SndAngry extends Sound {
}
}//package
Section 269
//SndAtmasfera (SndAtmasfera)
package {
import flash.media.*;
public dynamic class SndAtmasfera extends Sound {
}
}//package
Section 270
//SndBonus (SndBonus)
package {
import flash.media.*;
public dynamic class SndBonus extends Sound {
}
}//package
Section 271
//SndBubble (SndBubble)
package {
import flash.media.*;
public dynamic class SndBubble extends Sound {
}
}//package
Section 272
//SndClick (SndClick)
package {
import flash.media.*;
public dynamic class SndClick extends Sound {
}
}//package
Section 273
//SndDoor (SndDoor)
package {
import flash.media.*;
public dynamic class SndDoor extends Sound {
}
}//package
Section 274
//SndDrunkDown (SndDrunkDown)
package {
import flash.media.*;
public dynamic class SndDrunkDown extends Sound {
}
}//package
Section 275
//SndEffect01 (SndEffect01)
package {
import flash.media.*;
public dynamic class SndEffect01 extends Sound {
}
}//package
Section 276
//SndEffectApple (SndEffectApple)
package {
import flash.media.*;
public dynamic class SndEffectApple extends Sound {
}
}//package
Section 277
//SndFarmerDrop (SndFarmerDrop)
package {
import flash.media.*;
public dynamic class SndFarmerDrop extends Sound {
}
}//package
Section 278
//SndFarmerScream (SndFarmerScream)
package {
import flash.media.*;
public dynamic class SndFarmerScream extends Sound {
}
}//package
Section 279
//SndFly (SndFly)
package {
import flash.media.*;
public dynamic class SndFly extends Sound {
}
}//package
Section 280
//SndGirl (SndGirl)
package {
import flash.media.*;
public dynamic class SndGirl extends Sound {
}
}//package
Section 281
//SndKaban01 (SndKaban01)
package {
import flash.media.*;
public dynamic class SndKaban01 extends Sound {
}
}//package
Section 282
//SndKaban02 (SndKaban02)
package {
import flash.media.*;
public dynamic class SndKaban02 extends Sound {
}
}//package
Section 283
//SndKaban03 (SndKaban03)
package {
import flash.media.*;
public dynamic class SndKaban03 extends Sound {
}
}//package
Section 284
//SndKaban04 (SndKaban04)
package {
import flash.media.*;
public dynamic class SndKaban04 extends Sound {
}
}//package
Section 285
//SndKabanEat (SndKabanEat)
package {
import flash.media.*;
public dynamic class SndKabanEat extends Sound {
}
}//package
Section 286
//SndKabanPuzo (SndKabanPuzo)
package {
import flash.media.*;
public dynamic class SndKabanPuzo extends Sound {
}
}//package
Section 287
//SndLose (SndLose)
package {
import flash.media.*;
public dynamic class SndLose extends Sound {
}
}//package
Section 288
//SndMoney (SndMoney)
package {
import flash.media.*;
public dynamic class SndMoney extends Sound {
}
}//package
Section 289
//SndPiglet01 (SndPiglet01)
package {
import flash.media.*;
public dynamic class SndPiglet01 extends Sound {
}
}//package
Section 290
//SndPitchfork (SndPitchfork)
package {
import flash.media.*;
public dynamic class SndPitchfork extends Sound {
}
}//package
Section 291
//SndPok (SndPok)
package {
import flash.media.*;
public dynamic class SndPok extends Sound {
}
}//package
Section 292
//SndPuk (SndPuk)
package {
import flash.media.*;
public dynamic class SndPuk extends Sound {
}
}//package
Section 293
//SndScoreCalc (SndScoreCalc)
package {
import flash.media.*;
public dynamic class SndScoreCalc extends Sound {
}
}//package
Section 294
//SndSleep1 (SndSleep1)
package {
import flash.media.*;
public dynamic class SndSleep1 extends Sound {
}
}//package
Section 295
//SndSleep2 (SndSleep2)
package {
import flash.media.*;
public dynamic class SndSleep2 extends Sound {
}
}//package
Section 296
//SndStack (SndStack)
package {
import flash.media.*;
public dynamic class SndStack extends Sound {
}
}//package
Section 297
//SndStars (SndStars)
package {
import flash.media.*;
public dynamic class SndStars extends Sound {
}
}//package
Section 298
//SndStep01 (SndStep01)
package {
import flash.media.*;
public dynamic class SndStep01 extends Sound {
}
}//package
Section 299
//SndStep02 (SndStep02)
package {
import flash.media.*;
public dynamic class SndStep02 extends Sound {
}
}//package
Section 300
//SndStep03 (SndStep03)
package {
import flash.media.*;
public dynamic class SndStep03 extends Sound {
}
}//package
Section 301
//SndSwarm (SndSwarm)
package {
import flash.media.*;
public dynamic class SndSwarm extends Sound {
}
}//package
Section 302
//SndTimeOver (SndTimeOver)
package {
import flash.media.*;
public dynamic class SndTimeOver extends Sound {
}
}//package
Section 303
//SndWaterIn (SndWaterIn)
package {
import flash.media.*;
public dynamic class SndWaterIn extends Sound {
}
}//package
Section 304
//SndWaterOut (SndWaterOut)
package {
import flash.media.*;
public dynamic class SndWaterOut extends Sound {
}
}//package
Section 305
//SndWin (SndWin)
package {
import flash.media.*;
public dynamic class SndWin extends Sound {
}
}//package
Section 306
//SoundManager (SoundManager)
package {
import flash.media.*;
import flash.events.*;
public class SoundManager {
protected static var soundOn:Boolean = true;
protected static var musicOn:Boolean = true;
protected static var sndMusic:Sound;
protected static var sndMusicClass:Class;
protected static var sndMusicChannel:SoundChannel;
protected static var sndMusicPausePosition:int = -1;
protected static var musicSoundTransform:SoundTransform = new SoundTransform();
protected static var eventDispatcher:EventDispatcher;
protected static var soundArray:Array = new Array();
protected static var namedSoundArray:Array = [];
protected static var musicEndListeners:Array = [];
public static function init(_arg1:EventDispatcher):void{
eventDispatcher = _arg1;
}
public static function playMusicFade(_arg1:Class):void{
stopMusic();
if (isMusicOn()){
createSound(_arg1);
};
}
public static function playMusic(_arg1:Class):void{
if (sndMusicClass == _arg1){
return;
};
if (sndMusicChannel != null){
sndMusicChannel.removeEventListener(Event.SOUND_COMPLETE, onMusicPlaybackComplete);
sndMusicChannel.stop();
};
sndMusic = new (_arg1);
sndMusicClass = _arg1;
sndMusicChannel = sndMusic.play();
if (sndMusicChannel != null){
sndMusicChannel.soundTransform = musicSoundTransform;
sndMusicChannel.addEventListener(Event.SOUND_COMPLETE, onMusicPlaybackComplete, false, 0, true);
sndMusic.addEventListener(Event.COMPLETE, onMusicPlaybackComplete2, false, 0, true);
} else {
sndMusic = null;
sndMusicClass = null;
};
}
public static function stopMusic():void{
if (sndMusicChannel != null){
sndMusicChannel.removeEventListener(Event.SOUND_COMPLETE, onMusicPlaybackComplete);
sndMusicChannel.stop();
};
sndMusic = null;
}
public static function onMusicPlaybackComplete2(_arg1:Event):void{
onMusicPlaybackComplete(_arg1);
}
public static function onMusicPlaybackComplete(_arg1:Event):void{
var _local2:Function;
sndMusicChannel.removeEventListener(Event.SOUND_COMPLETE, onMusicPlaybackComplete);
sndMusicChannel = sndMusic.play();
sndMusicChannel.soundTransform = musicSoundTransform;
sndMusicChannel.addEventListener(Event.SOUND_COMPLETE, onMusicPlaybackComplete, false, 0, true);
for each (_local2 in musicEndListeners) {
_local2(sndMusicClass);
};
}
public static function addMusicEndListener(_arg1:Function):void{
musicEndListeners.push(_arg1);
trace(musicEndListeners);
}
public static function removeMusicEndListener(_arg1:Function):void{
MyUtils.removeFromArray(musicEndListeners, _arg1);
}
public static function isMusicOn():Boolean{
return (musicOn);
}
public static function switchMusic(_arg1:Boolean):void{
musicOn = _arg1;
if (_arg1 == false){
musicSoundTransform.volume = 0;
if (sndMusicChannel != null){
sndMusicChannel.soundTransform = musicSoundTransform;
};
} else {
musicSoundTransform.volume = 1;
if (sndMusic != null){
sndMusicChannel.soundTransform = musicSoundTransform;
};
};
eventDispatcher.dispatchEvent(new Event(CommonEvent.ON_SWITCH_MUSIC));
}
public static function isSoundOn():Boolean{
return (soundOn);
}
public static function switchSound(_arg1:Boolean):void{
soundOn = _arg1;
if (_arg1 == false){
stopAllSounds();
};
eventDispatcher.dispatchEvent(new Event(CommonEvent.ON_SWITCH_SOUND));
}
public static function playSound(_arg1:Sound, _arg2:Boolean=false, _arg3:Boolean=false):SoundChannel{
var _local5:int;
if (soundOn == false){
return (null);
};
if (_arg3 == true){
_local5 = 0;
while (_local5 < soundArray.length) {
if (soundArray[_local5].sound == _arg1){
return (soundArray[_local5].channel);
};
_local5++;
};
};
var _local4:Object = new Object();
_local4.sound = _arg1;
if (_arg2){
_local4.channel = _arg1.play(0, int.MAX_VALUE);
} else {
_local4.channel = _arg1.play();
};
if (_local4.channel == null){
return (null);
};
soundArray.push(_local4);
_local4.channel.addEventListener(Event.SOUND_COMPLETE, onSoundPlaybackComplete, false, 0, true);
return (_local4.channel);
}
public static function createNamedSound(_arg1:String, _arg2:Class, _arg3:Boolean=false, _arg4:Boolean=false):SoundChannel{
if (namedSoundArray[_arg1] != null){
stopSound(namedSoundArray[_arg1]);
};
namedSoundArray[_arg1] = _arg2;
return (createSound(_arg2, _arg3, _arg4));
}
public static function stopNamedSound(_arg1:String):void{
if (namedSoundArray[_arg1] != null){
stopSound(namedSoundArray[_arg1]);
};
}
public static function createSound(_arg1:Class, _arg2:Boolean=false, _arg3:Boolean=false):SoundChannel{
var _local6:int;
if (soundOn == false){
return (null);
};
if (_arg3 == true){
_local6 = 0;
while (_local6 < soundArray.length) {
if ((soundArray[_local6].sound is _arg1)){
return (soundArray[_local6].channel);
};
_local6++;
};
};
var _local4:Sound = new (_arg1);
var _local5:Object = new Object();
_local5.sound = _local4;
if (_arg2){
_local5.channel = _local4.play(0, int.MAX_VALUE);
} else {
_local5.channel = _local4.play();
};
if (_local5.channel == null){
return (null);
};
soundArray.push(_local5);
_local5.channel.addEventListener(Event.SOUND_COMPLETE, onSoundPlaybackComplete, false, 0, true);
return (_local5.channel);
}
public static function createRandomSound(_arg1:Boolean=false, _arg2:Boolean=false, ... _args):SoundChannel{
var _local4:int = int((Math.random() * _args.length));
return (createSound(_args[_local4], _arg1, _arg2));
}
public static function onSoundPlaybackComplete(_arg1:Event){
var _local2:int;
while (_local2 < soundArray.length) {
if (_arg1.target == soundArray[_local2].channel){
soundArray[_local2].channel.removeEventListener(Event.SOUND_COMPLETE, onSoundPlaybackComplete);
soundArray.splice(_local2, 1);
return;
};
_local2++;
};
}
public static function stopAllSounds():void{
var _local1:int;
while (_local1 < soundArray.length) {
soundArray[_local1].channel.removeEventListener(Event.SOUND_COMPLETE, onSoundPlaybackComplete);
soundArray[_local1].channel.stop();
_local1++;
};
soundArray.splice(0, soundArray.length);
}
public static function stopSound(_arg1:Class):void{
var _local2:int;
while (_local2 < soundArray.length) {
if ((soundArray[_local2].sound is _arg1)){
soundArray[_local2].channel.removeEventListener(Event.SOUND_COMPLETE, onSoundPlaybackComplete);
soundArray[_local2].channel.stop();
soundArray.splice(_local2, 1);
_local2--;
};
_local2++;
};
}
public static function printSounds():void{
var _local1:int;
while (_local1 < soundArray.length) {
trace(((_local1 + " ") + soundArray[_local1].sound));
_local1++;
};
}
}
}//package
Section 307
//SponsorSplash (SponsorSplash)
package {
import adobe.utils.*;
import flash.accessibility.*;
import flash.display.*;
import flash.errors.*;
import flash.events.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.text.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class SponsorSplash extends MovieClip {
public var mLoader:Loader;
public var mRequest:URLRequest;
public var timer:Timer;
public function SponsorSplash(){
addFrameScript(0, frame1);
}
public function onCompleteHandler(_arg1:Event){
addChild(_arg1.currentTarget.loader);
}
public function onProgressHandler(_arg1:ProgressEvent){
var _local2:Number = (_arg1.bytesLoaded / _arg1.bytesTotal);
trace(_local2);
}
public function checkBytesLoaded(_arg1:TimerEvent):void{
trace(("Times Fired: " + _arg1.currentTarget.currentCount));
trace(("Time Delayed: " + _arg1.currentTarget.delay));
trace(("alpha: " + this.alpha));
var _local2:Number = stage.loaderInfo.bytesLoaded;
var _local3:Number = stage.loaderInfo.bytesTotal;
if (_local2 == _local3){
mLoader.content.alpha = 0.99;
timer.stop();
};
}
function frame1(){
stop();
mLoader = new Loader();
mRequest = new URLRequest("http://fegn.com/splash.swf");
mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
mLoader.load(mRequest);
timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, checkBytesLoaded);
timer.start();
}
}
}//package
Section 308
//Stack (Stack)
package {
import src.*;
public dynamic class Stack extends Stack {
public function Stack(){
addFrameScript(1, frame2, 44, frame45);
}
function frame2(){
trace("Stack drop");
SoundManager.createSound(SndStack, false, false);
}
function frame45(){
stop();
}
}
}//package
Section 309
//StackAntiMask (StackAntiMask)
package {
import flash.display.*;
public dynamic class StackAntiMask extends BitmapData {
public function StackAntiMask(_arg1:int=44, _arg2:int=53){
super(_arg1, _arg2);
}
}
}//package
Section 310
//StackMask (StackMask)
package {
import flash.display.*;
public dynamic class StackMask extends BitmapData {
public function StackMask(_arg1:int=44, _arg2:int=53){
super(_arg1, _arg2);
}
}
}//package
Section 311
//Toilet (Toilet)
package {
import src.*;
public dynamic class Toilet extends Obstacle {
}
}//package
Section 312
//ToiletMask (ToiletMask)
package {
import flash.display.*;
public dynamic class ToiletMask extends BitmapData {
public function ToiletMask(_arg1:int=34, _arg2:int=65){
super(_arg1, _arg2);
}
}
}//package
Section 313
//Tree01 (Tree01)
package {
import src.*;
public dynamic class Tree01 extends Tree {
}
}//package
Section 314
//Tree01Mask (Tree01Mask)
package {
import flash.display.*;
public dynamic class Tree01Mask extends BitmapData {
public function Tree01Mask(_arg1:int=43, _arg2:int=69){
super(_arg1, _arg2);
}
}
}//package
Section 315
//TriggerCounter (TriggerCounter)
package {
import src.*;
public dynamic class TriggerCounter extends TriggerCounter {
}
}//package
Section 316
//Trough (Trough)
package {
import src.*;
public dynamic class Trough extends Obstacle {
}
}//package
Section 317
//TroughMask (TroughMask)
package {
import flash.display.*;
public dynamic class TroughMask extends BitmapData {
public function TroughMask(_arg1:int=31, _arg2:int=27){
super(_arg1, _arg2);
}
}
}//package
Section 318
//TypedAnimation (TypedAnimation)
package {
import flash.events.*;
import flash.display.*;
public class TypedAnimation extends MovieClip {
public var animType:int;// = 1
public function TypedAnimation(){
addEventListener(Event.ADDED_TO_STAGE, handleAdded, false, 0, true);
}
public function handleAdded(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, handleAdded);
if ((parent is TypedAnimation)){
animType = (parent as TypedAnimation).animType;
} else {
if (parent["animType"] != null){
animType = parent["animType"];
};
};
}
}
}//package
Section 319
//TypedAnimElement (TypedAnimElement)
package {
import flash.events.*;
import flash.display.*;
public class TypedAnimElement extends MovieClip {
public var animType:int;// = 1
public function TypedAnimElement(){
gotoAndStop(animType);
addEventListener(Event.ADDED_TO_STAGE, handleAdded, false, 0, true);
}
public function handleAdded(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, handleAdded);
if ((parent is TypedAnimation)){
animType = (parent as TypedAnimation).animType;
gotoAndStop(animType);
};
}
}
}//package
Section 320
//VerticalGateMask1 (VerticalGateMask1)
package {
import flash.display.*;
public dynamic class VerticalGateMask1 extends BitmapData {
public function VerticalGateMask1(_arg1:int=26, _arg2:int=69){
super(_arg1, _arg2);
}
}
}//package
Section 321
//VerticalGateMask2 (VerticalGateMask2)
package {
import flash.display.*;
public dynamic class VerticalGateMask2 extends BitmapData {
public function VerticalGateMask2(_arg1:int=60, _arg2:int=68){
super(_arg1, _arg2);
}
}
}//package