Section 1
//AuxFunctions (caurina.transitions.AuxFunctions)
package caurina.transitions {
public class AuxFunctions {
public static function getObjectLength(_arg1:Object):uint{
var _local3:String;
var _local2:uint;
for (_local3 in _arg1) {
_local2++;
};
return (_local2);
}
public static function numberToG(_arg1:Number):Number{
return (((_arg1 & 0xFF00) >> 8));
}
public static function numberToB(_arg1:Number):Number{
return ((_arg1 & 0xFF));
}
public static function numberToR(_arg1:Number):Number{
return (((_arg1 & 0xFF0000) >> 16));
}
public static function concatObjects(... _args):Object{
var _local3:Object;
var _local5:String;
var _local2:Object = {};
var _local4:int;
while (_local4 < _args.length) {
_local3 = _args[_local4];
for (_local5 in _local3) {
if (_local3[_local5] == null){
delete _local2[_local5];
} else {
_local2[_local5] = _local3[_local5];
};
};
_local4++;
};
return (_local2);
}
}
}//package caurina.transitions
Section 2
//Equations (caurina.transitions.Equations)
package caurina.transitions {
public class Equations {
public function Equations(){
trace("Equations is a static class and should not be instantiated.");
}
public static function easeOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeInOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * (0.3 * 1.5)) : _arg5.period;
var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2));
};
--_arg1;
return ((((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) * 0.5) + _arg3) + _arg2));
}
public static function easeInOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
public static function easeInOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeInBounce((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOutBounce(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
public static function easeInOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_local6 = (_local6 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_local6 + 1) * _arg1) - _local6))) + _arg2));
};
_arg1 = (_arg1 - 2);
_local6 = (_local6 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 2)) + _arg2));
}
public static function easeOutInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCubic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInCubic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 1)) + _arg2));
}
public static function easeInOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
public static function easeInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_local6 + 1) * _arg1) - _local6)) + _arg2));
}
public static function easeInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeOutInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuint((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuint(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBounce((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBounce(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function init():void{
Tweener.registerTransition("easenone", easeNone);
Tweener.registerTransition("linear", easeNone);
Tweener.registerTransition("easeinquad", easeInQuad);
Tweener.registerTransition("easeoutquad", easeOutQuad);
Tweener.registerTransition("easeinoutquad", easeInOutQuad);
Tweener.registerTransition("easeoutinquad", easeOutInQuad);
Tweener.registerTransition("easeincubic", easeInCubic);
Tweener.registerTransition("easeoutcubic", easeOutCubic);
Tweener.registerTransition("easeinoutcubic", easeInOutCubic);
Tweener.registerTransition("easeoutincubic", easeOutInCubic);
Tweener.registerTransition("easeinquart", easeInQuart);
Tweener.registerTransition("easeoutquart", easeOutQuart);
Tweener.registerTransition("easeinoutquart", easeInOutQuart);
Tweener.registerTransition("easeoutinquart", easeOutInQuart);
Tweener.registerTransition("easeinquint", easeInQuint);
Tweener.registerTransition("easeoutquint", easeOutQuint);
Tweener.registerTransition("easeinoutquint", easeInOutQuint);
Tweener.registerTransition("easeoutinquint", easeOutInQuint);
Tweener.registerTransition("easeinsine", easeInSine);
Tweener.registerTransition("easeoutsine", easeOutSine);
Tweener.registerTransition("easeinoutsine", easeInOutSine);
Tweener.registerTransition("easeoutinsine", easeOutInSine);
Tweener.registerTransition("easeincirc", easeInCirc);
Tweener.registerTransition("easeoutcirc", easeOutCirc);
Tweener.registerTransition("easeinoutcirc", easeInOutCirc);
Tweener.registerTransition("easeoutincirc", easeOutInCirc);
Tweener.registerTransition("easeinexpo", easeInExpo);
Tweener.registerTransition("easeoutexpo", easeOutExpo);
Tweener.registerTransition("easeinoutexpo", easeInOutExpo);
Tweener.registerTransition("easeoutinexpo", easeOutInExpo);
Tweener.registerTransition("easeinelastic", easeInElastic);
Tweener.registerTransition("easeoutelastic", easeOutElastic);
Tweener.registerTransition("easeinoutelastic", easeInOutElastic);
Tweener.registerTransition("easeoutinelastic", easeOutInElastic);
Tweener.registerTransition("easeinback", easeInBack);
Tweener.registerTransition("easeoutback", easeOutBack);
Tweener.registerTransition("easeinoutback", easeInOutBack);
Tweener.registerTransition("easeoutinback", easeOutInBack);
Tweener.registerTransition("easeinbounce", easeInBounce);
Tweener.registerTransition("easeoutbounce", easeOutBounce);
Tweener.registerTransition("easeinoutbounce", easeInOutBounce);
Tweener.registerTransition("easeoutinbounce", easeOutInBounce);
}
public static function easeOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg1)==_arg4) ? (_arg2 + _arg3) : (((_arg3 * 1.001) * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2));
}
public static function easeOutInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBack((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBack(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg1)==0) ? _arg2 : (((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2) - (_arg3 * 0.001)));
}
public static function easeInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2));
}
public static function easeInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg3 - easeOutBounce((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeOutInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutExpo((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInExpo(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((-(_arg3) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2));
}
public static function easeInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2));
}
public static function easeInOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 2)) + _arg2));
}
public static function easeOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeOutInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutElastic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInElastic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
--_arg1;
return ((-(((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2));
}
public static function easeOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuad((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuad(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2));
}
public static function easeInOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
}
public static function easeOutInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutSine((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInSine(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 == 0){
return (_arg2);
};
if (_arg1 == _arg4){
return ((_arg2 + _arg3));
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2) - (_arg3 * 0.0005)));
};
--_arg1;
return (((((_arg3 / 2) * 1.0005) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2));
}
public static function easeOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
return (((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) + _arg3) + _arg2));
}
public static function easeOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
}
public static function easeOutInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuart((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuart(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCirc((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInCirc(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
}
}//package caurina.transitions
Section 3
//PropertyInfoObj (caurina.transitions.PropertyInfoObj)
package caurina.transitions {
public class PropertyInfoObj {
public var modifierParameters:Array;
public var isSpecialProperty:Boolean;
public var valueComplete:Number;
public var modifierFunction:Function;
public var extra:Object;
public var valueStart:Number;
public var hasModifier:Boolean;
public var arrayIndex:Number;
public var originalValueComplete:Object;
public function PropertyInfoObj(_arg1:Number, _arg2:Number, _arg3:Object, _arg4:Number, _arg5:Object, _arg6:Boolean, _arg7:Function, _arg8:Array){
valueStart = _arg1;
valueComplete = _arg2;
originalValueComplete = _arg3;
arrayIndex = _arg4;
extra = _arg5;
isSpecialProperty = _arg6;
hasModifier = Boolean(_arg7);
modifierFunction = _arg7;
modifierParameters = _arg8;
}
public function toString():String{
var _local1 = "\n[PropertyInfoObj ";
_local1 = (_local1 + ("valueStart:" + String(valueStart)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("valueComplete:" + String(valueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("originalValueComplete:" + String(originalValueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("arrayIndex:" + String(arrayIndex)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("extra:" + String(extra)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("isSpecialProperty:" + String(isSpecialProperty)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("hasModifier:" + String(hasModifier)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierFunction:" + String(modifierFunction)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierParameters:" + String(modifierParameters)));
_local1 = (_local1 + "]\n");
return (_local1);
}
public function clone():PropertyInfoObj{
var _local1:PropertyInfoObj = new PropertyInfoObj(valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, modifierFunction, modifierParameters);
return (_local1);
}
}
}//package caurina.transitions
Section 4
//SpecialProperty (caurina.transitions.SpecialProperty)
package caurina.transitions {
public class SpecialProperty {
public var parameters:Array;
public var getValue:Function;
public var preProcess:Function;
public var setValue:Function;
public function SpecialProperty(_arg1:Function, _arg2:Function, _arg3:Array=null, _arg4:Function=null){
getValue = _arg1;
setValue = _arg2;
parameters = _arg3;
preProcess = _arg4;
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + "[SpecialProperty ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("setValue:" + String(setValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("preProcess:" + String(preProcess)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 5
//SpecialPropertyModifier (caurina.transitions.SpecialPropertyModifier)
package caurina.transitions {
public class SpecialPropertyModifier {
public var getValue:Function;
public var modifyValues:Function;
public function SpecialPropertyModifier(_arg1:Function, _arg2:Function){
modifyValues = _arg1;
getValue = _arg2;
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + "[SpecialPropertyModifier ");
_local1 = (_local1 + ("modifyValues:" + String(modifyValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 6
//SpecialPropertySplitter (caurina.transitions.SpecialPropertySplitter)
package caurina.transitions {
public class SpecialPropertySplitter {
public var parameters:Array;
public var splitValues:Function;
public function SpecialPropertySplitter(_arg1:Function, _arg2:Array){
splitValues = _arg1;
parameters = _arg2;
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + "[SpecialPropertySplitter ");
_local1 = (_local1 + ("splitValues:" + String(splitValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 7
//Tweener (caurina.transitions.Tweener)
package caurina.transitions {
import flash.utils.*;
import flash.events.*;
import flash.display.*;
public class Tweener {
private static var _timeScale:Number = 1;
private static var _currentTimeFrame:Number;
private static var _specialPropertySplitterList:Object;
public static var autoOverwrite:Boolean = true;
private static var _engineExists:Boolean = false;
private static var _currentTime:Number;
private static var _tweenList:Array;
private static var _specialPropertyModifierList:Object;
private static var _specialPropertyList:Object;
private static var _transitionList:Object;
private static var _inited:Boolean = false;
private static var __tweener_controller__:MovieClip;
public function Tweener(){
trace("Tweener is a static class and should not be instantiated.");
}
public static function registerSpecialPropertyModifier(_arg1:String, _arg2:Function, _arg3:Function):void{
if (!_inited){
init();
};
var _local4:SpecialPropertyModifier = new SpecialPropertyModifier(_arg2, _arg3);
_specialPropertyModifierList[_arg1] = _local4;
}
public static function registerSpecialProperty(_arg1:String, _arg2:Function, _arg3:Function, _arg4:Array=null, _arg5:Function=null):void{
if (!_inited){
init();
};
var _local6:SpecialProperty = new SpecialProperty(_arg2, _arg3, _arg4, _arg5);
_specialPropertyList[_arg1] = _local6;
}
public static function init(... _args):void{
_inited = true;
_transitionList = new Object();
Equations.init();
_specialPropertyList = new Object();
_specialPropertyModifierList = new Object();
_specialPropertySplitterList = new Object();
}
private static function updateTweens():Boolean{
var _local1:int;
if (_tweenList.length == 0){
return (false);
};
_local1 = 0;
while (_local1 < _tweenList.length) {
if ((((_tweenList[_local1] == undefined)) || (!(_tweenList[_local1].isPaused)))){
if (!updateTweenByIndex(_local1)){
removeTweenByIndex(_local1);
};
if (_tweenList[_local1] == null){
removeTweenByIndex(_local1, true);
_local1--;
};
};
_local1++;
};
return (true);
}
public static function addCaller(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local3:Number;
var _local4:Array;
var _local8:Function;
var _local9:TweenListObj;
var _local10:Number;
var _local11:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local4 = _arg1.concat();
} else {
_local4 = [_arg1];
};
var _local5:Object = _arg2;
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
var _local6:Number = (isNaN(_local5.time)) ? 0 : _local5.time;
var _local7:Number = (isNaN(_local5.delay)) ? 0 : _local5.delay;
if (typeof(_local5.transition) == "string"){
_local11 = _local5.transition.toLowerCase();
_local8 = _transitionList[_local11];
} else {
_local8 = _local5.transition;
};
if (!Boolean(_local8)){
_local8 = _transitionList["easeoutexpo"];
};
_local3 = 0;
while (_local3 < _local4.length) {
if (_local5.useFrames == true){
_local9 = new TweenListObj(_local4[_local3], (_currentTimeFrame + (_local7 / _timeScale)), (_currentTimeFrame + ((_local7 + _local6) / _timeScale)), true, _local8, _local5.transitionParams);
} else {
_local9 = new TweenListObj(_local4[_local3], (_currentTime + ((_local7 * 1000) / _timeScale)), (_currentTime + (((_local7 * 1000) + (_local6 * 1000)) / _timeScale)), false, _local8, _local5.transitionParams);
};
_local9.properties = null;
_local9.onStart = _local5.onStart;
_local9.onUpdate = _local5.onUpdate;
_local9.onComplete = _local5.onComplete;
_local9.onOverwrite = _local5.onOverwrite;
_local9.onStartParams = _local5.onStartParams;
_local9.onUpdateParams = _local5.onUpdateParams;
_local9.onCompleteParams = _local5.onCompleteParams;
_local9.onOverwriteParams = _local5.onOverwriteParams;
_local9.onStartScope = _local5.onStartScope;
_local9.onUpdateScope = _local5.onUpdateScope;
_local9.onCompleteScope = _local5.onCompleteScope;
_local9.onOverwriteScope = _local5.onOverwriteScope;
_local9.onErrorScope = _local5.onErrorScope;
_local9.isCaller = true;
_local9.count = _local5.count;
_local9.waitFrames = _local5.waitFrames;
_tweenList.push(_local9);
if ((((_local6 == 0)) && ((_local7 == 0)))){
_local10 = (_tweenList.length - 1);
updateTweenByIndex(_local10);
removeTweenByIndex(_local10);
};
_local3++;
};
return (true);
}
public static function pauseAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
pauseTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function removeTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local5:SpecialPropertySplitter;
var _local6:Array;
var _local7:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){
if (_specialPropertySplitterList[_args[_local4]]){
_local5 = _specialPropertySplitterList[_args[_local4]];
_local6 = _local5.splitValues(_arg1, null);
_local7 = 0;
while (_local7 < _local6.length) {
_local3.push(_local6[_local7].name);
_local7++;
};
} else {
_local3.push(_args[_local4]);
};
};
_local4++;
};
return (affectTweens(removeTweenByIndex, _arg1, _local3));
}
public static function updateFrame():void{
_currentTimeFrame++;
}
public static function splitTweens(_arg1:Number, _arg2:Array):uint{
var _local5:uint;
var _local6:String;
var _local7:Boolean;
var _local3:TweenListObj = _tweenList[_arg1];
var _local4:TweenListObj = _local3.clone(false);
_local5 = 0;
while (_local5 < _arg2.length) {
_local6 = _arg2[_local5];
if (Boolean(_local3.properties[_local6])){
_local3.properties[_local6] = undefined;
delete _local3.properties[_local6];
};
_local5++;
};
for (_local6 in _local4.properties) {
_local7 = false;
_local5 = 0;
while (_local5 < _arg2.length) {
if (_arg2[_local5] == _local6){
_local7 = true;
break;
};
_local5++;
};
if (!_local7){
_local4.properties[_local6] = undefined;
delete _local4.properties[_local6];
};
};
_tweenList.push(_local4);
return ((_tweenList.length - 1));
}
public static function resumeTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj = _tweenList[_arg1];
if ((((_local2 == null)) || (!(_local2.isPaused)))){
return (false);
};
var _local3:Number = getCurrentTweeningTime(_local2);
_local2.timeStart = (_local2.timeStart + (_local3 - _local2.timePaused));
_local2.timeComplete = (_local2.timeComplete + (_local3 - _local2.timePaused));
_local2.timePaused = undefined;
_local2.isPaused = false;
return (true);
}
public static function getVersion():String{
return ("AS3 1.33.74");
}
public static function onEnterFrame(_arg1:Event):void{
updateTime();
updateFrame();
var _local2:Boolean;
_local2 = updateTweens();
if (!_local2){
stopEngine();
};
}
public static function updateTime():void{
_currentTime = getTimer();
}
private static function updateTweenByIndex(_arg1:Number):Boolean{
var tTweening:TweenListObj;
var mustUpdate:Boolean;
var nv:Number;
var t:Number;
var b:Number;
var c:Number;
var d:Number;
var pName:String;
var eventScope:Object;
var tScope:Object;
var tProperty:Object;
var pv:Number;
var i = _arg1;
tTweening = _tweenList[i];
if ((((tTweening == null)) || (!(Boolean(tTweening.scope))))){
return (false);
};
var isOver:Boolean;
var cTime:Number = getCurrentTweeningTime(tTweening);
if (cTime >= tTweening.timeStart){
tScope = tTweening.scope;
if (tTweening.isCaller){
do {
t = (((tTweening.timeComplete - tTweening.timeStart) / tTweening.count) * (tTweening.timesCalled + 1));
b = tTweening.timeStart;
c = (tTweening.timeComplete - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d);
} while (!(cTime >= nv));
} else {
mustUpdate = (((((tTweening.skipUpdates < 1)) || (!(tTweening.skipUpdates)))) || ((tTweening.updatesSkipped >= tTweening.skipUpdates)));
if (cTime >= tTweening.timeComplete){
isOver = true;
mustUpdate = true;
};
if (!tTweening.hasStarted){
if (Boolean(tTweening.onStart)){
eventScope = (Boolean(tTweening.onStartScope)) ? tTweening.onStartScope : tScope;
try {
tTweening.onStart.apply(eventScope, tTweening.onStartParams);
} catch(e2:Error) {
handleError(tTweening, e2, "onStart");
};
};
for (pName in tTweening.properties) {
if (tTweening.properties[pName].isSpecialProperty){
if (Boolean(_specialPropertyList[pName].preProcess)){
tTweening.properties[pName].valueComplete = _specialPropertyList[pName].preProcess(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].originalValueComplete, tTweening.properties[pName].extra);
};
pv = _specialPropertyList[pName].getValue(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
pv = tScope[pName];
};
tTweening.properties[pName].valueStart = (isNaN(pv)) ? tTweening.properties[pName].valueComplete : pv;
};
mustUpdate = true;
tTweening.hasStarted = true;
};
if (mustUpdate){
for (pName in tTweening.properties) {
tProperty = tTweening.properties[pName];
if (isOver){
nv = tProperty.valueComplete;
} else {
if (tProperty.hasModifier){
t = (cTime - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, 0, 1, d, tTweening.transitionParams);
nv = tProperty.modifierFunction(tProperty.valueStart, tProperty.valueComplete, nv, tProperty.modifierParameters);
} else {
t = (cTime - tTweening.timeStart);
b = tProperty.valueStart;
c = (tProperty.valueComplete - tProperty.valueStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d, tTweening.transitionParams);
};
};
if (tTweening.rounded){
nv = Math.round(nv);
};
if (tProperty.isSpecialProperty){
_specialPropertyList[pName].setValue(tScope, nv, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
tScope[pName] = nv;
};
};
tTweening.updatesSkipped = 0;
if (Boolean(tTweening.onUpdate)){
eventScope = (Boolean(tTweening.onUpdateScope)) ? tTweening.onUpdateScope : tScope;
try {
tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams);
} catch(e3:Error) {
handleError(tTweening, e3, "onUpdate");
};
};
} else {
tTweening.updatesSkipped++;
};
};
if (((isOver) && (Boolean(tTweening.onComplete)))){
eventScope = (Boolean(tTweening.onCompleteScope)) ? tTweening.onCompleteScope : tScope;
try {
tTweening.onComplete.apply(eventScope, tTweening.onCompleteParams);
} catch(e4:Error) {
handleError(tTweening, e4, "onComplete");
};
};
return (!(isOver));
};
return (true);
}
public static function setTimeScale(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (isNaN(_arg1)){
_arg1 = 1;
};
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
if (_arg1 != _timeScale){
if (_tweenList != null){
_local2 = 0;
while (_local2 < _tweenList.length) {
_local3 = getCurrentTweeningTime(_tweenList[_local2]);
_tweenList[_local2].timeStart = (_local3 - (((_local3 - _tweenList[_local2].timeStart) * _timeScale) / _arg1));
_tweenList[_local2].timeComplete = (_local3 - (((_local3 - _tweenList[_local2].timeComplete) * _timeScale) / _arg1));
if (_tweenList[_local2].timePaused != undefined){
_tweenList[_local2].timePaused = (_local3 - (((_local3 - _tweenList[_local2].timePaused) * _timeScale) / _arg1));
};
_local2++;
};
};
_timeScale = _arg1;
};
}
public static function resumeAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
resumeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
private static function handleError(_arg1:TweenListObj, _arg2:Error, _arg3:String):void{
var eventScope:Object;
var pTweening = _arg1;
var pError = _arg2;
var pCallBackName = _arg3;
if (((Boolean(pTweening.onError)) && ((pTweening.onError is Function)))){
eventScope = (Boolean(pTweening.onErrorScope)) ? pTweening.onErrorScope : pTweening.scope;
try {
pTweening.onError.apply(eventScope, [pTweening.scope, pError]);
} catch(metaError:Error) {
printError(((((String(pTweening.scope) + " raised an error while executing the 'onError' handler. Original error:\n ") + pError.getStackTrace()) + "\nonError error: ") + metaError.getStackTrace()));
};
} else {
if (!Boolean(pTweening.onError)){
printError(((((String(pTweening.scope) + " raised an error while executing the '") + pCallBackName) + "'handler. \n") + pError.getStackTrace()));
};
};
}
private static function startEngine():void{
_engineExists = true;
_tweenList = new Array();
__tweener_controller__ = new MovieClip();
__tweener_controller__.addEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
_currentTimeFrame = 0;
updateTime();
}
public static function removeAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
removeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function addTween(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local3:Number;
var _local4:Number;
var _local5:String;
var _local6:Array;
var _local13:Function;
var _local14:Object;
var _local15:TweenListObj;
var _local16:Number;
var _local17:Array;
var _local18:Array;
var _local19:Array;
var _local20:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local6 = _arg1.concat();
} else {
_local6 = [_arg1];
};
var _local7:Object = TweenListObj.makePropertiesChain(_arg2);
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
var _local8:Number = (isNaN(_local7.time)) ? 0 : _local7.time;
var _local9:Number = (isNaN(_local7.delay)) ? 0 : _local7.delay;
var _local10:Array = new Array();
var _local11:Object = {overwrite:true, time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, transitionParams:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, onError:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams:true, onStartScope:true, onUpdateScope:true, onCompleteScope:true, onOverwriteScope:true, onErrorScope:true};
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;
if (((_local7.overwrite == undefined)) ? autoOverwrite : _local7.overwrite){
removeTweensByTime(_local15.scope, _local15.properties, _local15.timeStart, _local15.timeComplete);
};
_tweenList.push(_local15);
if ((((_local8 == 0)) && ((_local9 == 0)))){
_local16 = (_tweenList.length - 1);
updateTweenByIndex(_local16);
removeTweenByIndex(_local16);
};
_local3++;
};
return (true);
}
public static function registerTransition(_arg1:String, _arg2:Function):void{
if (!_inited){
init();
};
_transitionList[_arg1] = _arg2;
}
public static function printError(_arg1:String):void{
trace(("## [Tweener] Error: " + _arg1));
}
private static function affectTweens(_arg1:Function, _arg2:Object, _arg3:Array):Boolean{
var _local5:uint;
var _local6:Array;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local4:Boolean;
if (!Boolean(_tweenList)){
return (false);
};
_local5 = 0;
while (_local5 < _tweenList.length) {
if (((_tweenList[_local5]) && ((_tweenList[_local5].scope == _arg2)))){
if (_arg3.length == 0){
_arg1(_local5);
_local4 = true;
} else {
_local6 = new Array();
_local7 = 0;
while (_local7 < _arg3.length) {
if (Boolean(_tweenList[_local5].properties[_arg3[_local7]])){
_local6.push(_arg3[_local7]);
};
_local7++;
};
if (_local6.length > 0){
_local8 = AuxFunctions.getObjectLength(_tweenList[_local5].properties);
if (_local8 == _local6.length){
_arg1(_local5);
_local4 = true;
} else {
_local9 = splitTweens(_local5, _local6);
_arg1(_local9);
_local4 = true;
};
};
};
};
_local5++;
};
return (_local4);
}
public static function getTweens(_arg1:Object):Array{
var _local2:uint;
var _local3:String;
if (!Boolean(_tweenList)){
return ([]);
};
var _local4:Array = new Array();
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
for (_local3 in _tweenList[_local2].properties) {
_local4.push(_local3);
};
};
_local2++;
};
return (_local4);
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public static function pauseTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj = _tweenList[_arg1];
if ((((_local2 == null)) || (_local2.isPaused))){
return (false);
};
_local2.timePaused = getCurrentTweeningTime(_local2);
_local2.isPaused = true;
return (true);
}
public static function getCurrentTweeningTime(_arg1:Object):Number{
return ((_arg1.useFrames) ? _currentTimeFrame : _currentTime);
}
public static function getTweenCount(_arg1:Object):Number{
var _local2:uint;
if (!Boolean(_tweenList)){
return (0);
};
var _local3:Number = 0;
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
_local3 = (_local3 + AuxFunctions.getObjectLength(_tweenList[_local2].properties));
};
_local2++;
};
return (_local3);
}
private static function stopEngine():void{
_engineExists = false;
_tweenList = null;
_currentTime = 0;
_currentTimeFrame = 0;
__tweener_controller__.removeEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
__tweener_controller__ = null;
}
public static function removeTweensByTime(_arg1:Object, _arg2:Object, _arg3:Number, _arg4:Number):Boolean{
var removedLocally:Boolean;
var i:uint;
var pName:String;
var eventScope:Object;
var p_scope = _arg1;
var p_properties = _arg2;
var p_timeStart = _arg3;
var p_timeComplete = _arg4;
var removed:Boolean;
var tl:uint = _tweenList.length;
i = 0;
while (i < tl) {
if (((Boolean(_tweenList[i])) && ((p_scope == _tweenList[i].scope)))){
if ((((p_timeComplete > _tweenList[i].timeStart)) && ((p_timeStart < _tweenList[i].timeComplete)))){
removedLocally = false;
for (pName in _tweenList[i].properties) {
if (Boolean(p_properties[pName])){
if (Boolean(_tweenList[i].onOverwrite)){
eventScope = (Boolean(_tweenList[i].onOverwriteScope)) ? _tweenList[i].onOverwriteScope : _tweenList[i].scope;
try {
_tweenList[i].onOverwrite.apply(eventScope, _tweenList[i].onOverwriteParams);
} catch(e:Error) {
handleError(_tweenList[i], e, "onOverwrite");
};
};
_tweenList[i].properties[pName] = undefined;
delete _tweenList[i].properties[pName];
removedLocally = true;
removed = true;
};
};
if (removedLocally){
if (AuxFunctions.getObjectLength(_tweenList[i].properties) == 0){
removeTweenByIndex(i);
};
};
};
};
i = (i + 1);
};
return (removed);
}
public static function registerSpecialPropertySplitter(_arg1:String, _arg2:Function, _arg3:Array=null):void{
if (!_inited){
init();
};
var _local4:SpecialPropertySplitter = new SpecialPropertySplitter(_arg2, _arg3);
_specialPropertySplitterList[_arg1] = _local4;
}
public static function removeTweenByIndex(_arg1:Number, _arg2:Boolean=false):Boolean{
_tweenList[_arg1] = null;
if (_arg2){
_tweenList.splice(_arg1, 1);
};
return (true);
}
public static function resumeTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(resumeTweenByIndex, _arg1, _local3));
}
public static function pauseTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(pauseTweenByIndex, _arg1, _local3));
}
}
}//package caurina.transitions
Section 8
//TweenListObj (caurina.transitions.TweenListObj)
package caurina.transitions {
public class TweenListObj {
public var hasStarted:Boolean;
public var onUpdate:Function;
public var useFrames:Boolean;
public var count:Number;
public var onOverwriteParams:Array;
public var timeStart:Number;
public var timeComplete:Number;
public var onStartParams:Array;
public var onUpdateScope:Object;
public var rounded:Boolean;
public var onUpdateParams:Array;
public var properties:Object;
public var onComplete:Function;
public var transitionParams:Object;
public var updatesSkipped:Number;
public var onStart:Function;
public var onOverwriteScope:Object;
public var skipUpdates:Number;
public var onStartScope:Object;
public var scope:Object;
public var isCaller:Boolean;
public var timePaused:Number;
public var transition:Function;
public var onCompleteParams:Array;
public var onError:Function;
public var timesCalled:Number;
public var onErrorScope:Object;
public var onOverwrite:Function;
public var isPaused:Boolean;
public var waitFrames:Boolean;
public var onCompleteScope:Object;
public function TweenListObj(_arg1:Object, _arg2:Number, _arg3:Number, _arg4:Boolean, _arg5:Function, _arg6:Object){
scope = _arg1;
timeStart = _arg2;
timeComplete = _arg3;
useFrames = _arg4;
transition = _arg5;
transitionParams = _arg6;
properties = new Object();
isPaused = false;
timePaused = undefined;
isCaller = false;
updatesSkipped = 0;
timesCalled = 0;
skipUpdates = 0;
hasStarted = false;
}
public function clone(_arg1:Boolean):TweenListObj{
var _local3:String;
var _local2:TweenListObj = new TweenListObj(scope, timeStart, timeComplete, useFrames, transition, transitionParams);
_local2.properties = new Array();
for (_local3 in properties) {
_local2.properties[_local3] = properties[_local3].clone();
};
_local2.skipUpdates = skipUpdates;
_local2.updatesSkipped = updatesSkipped;
if (!_arg1){
_local2.onStart = onStart;
_local2.onUpdate = onUpdate;
_local2.onComplete = onComplete;
_local2.onOverwrite = onOverwrite;
_local2.onError = onError;
_local2.onStartParams = onStartParams;
_local2.onUpdateParams = onUpdateParams;
_local2.onCompleteParams = onCompleteParams;
_local2.onOverwriteParams = onOverwriteParams;
_local2.onStartScope = onStartScope;
_local2.onUpdateScope = onUpdateScope;
_local2.onCompleteScope = onCompleteScope;
_local2.onOverwriteScope = onOverwriteScope;
_local2.onErrorScope = onErrorScope;
};
_local2.rounded = rounded;
_local2.isPaused = isPaused;
_local2.timePaused = timePaused;
_local2.isCaller = isCaller;
_local2.count = count;
_local2.timesCalled = timesCalled;
_local2.waitFrames = waitFrames;
_local2.hasStarted = hasStarted;
return (_local2);
}
public function toString():String{
var _local3:String;
var _local1 = "\n[TweenListObj ";
_local1 = (_local1 + ("scope:" + String(scope)));
_local1 = (_local1 + ", properties:");
var _local2:Boolean;
for (_local3 in properties) {
if (!_local2){
_local1 = (_local1 + ",");
};
_local1 = (_local1 + ("[name:" + properties[_local3].name));
_local1 = (_local1 + (",valueStart:" + properties[_local3].valueStart));
_local1 = (_local1 + (",valueComplete:" + properties[_local3].valueComplete));
_local1 = (_local1 + "]");
_local2 = false;
};
_local1 = (_local1 + (", timeStart:" + String(timeStart)));
_local1 = (_local1 + (", timeComplete:" + String(timeComplete)));
_local1 = (_local1 + (", useFrames:" + String(useFrames)));
_local1 = (_local1 + (", transition:" + String(transition)));
_local1 = (_local1 + (", transitionParams:" + String(transitionParams)));
if (skipUpdates){
_local1 = (_local1 + (", skipUpdates:" + String(skipUpdates)));
};
if (updatesSkipped){
_local1 = (_local1 + (", updatesSkipped:" + String(updatesSkipped)));
};
if (Boolean(onStart)){
_local1 = (_local1 + (", onStart:" + String(onStart)));
};
if (Boolean(onUpdate)){
_local1 = (_local1 + (", onUpdate:" + String(onUpdate)));
};
if (Boolean(onComplete)){
_local1 = (_local1 + (", onComplete:" + String(onComplete)));
};
if (Boolean(onOverwrite)){
_local1 = (_local1 + (", onOverwrite:" + String(onOverwrite)));
};
if (Boolean(onError)){
_local1 = (_local1 + (", onError:" + String(onError)));
};
if (onStartParams){
_local1 = (_local1 + (", onStartParams:" + String(onStartParams)));
};
if (onUpdateParams){
_local1 = (_local1 + (", onUpdateParams:" + String(onUpdateParams)));
};
if (onCompleteParams){
_local1 = (_local1 + (", onCompleteParams:" + String(onCompleteParams)));
};
if (onOverwriteParams){
_local1 = (_local1 + (", onOverwriteParams:" + String(onOverwriteParams)));
};
if (onStartScope){
_local1 = (_local1 + (", onStartScope:" + String(onStartScope)));
};
if (onUpdateScope){
_local1 = (_local1 + (", onUpdateScope:" + String(onUpdateScope)));
};
if (onCompleteScope){
_local1 = (_local1 + (", onCompleteScope:" + String(onCompleteScope)));
};
if (onOverwriteScope){
_local1 = (_local1 + (", onOverwriteScope:" + String(onOverwriteScope)));
};
if (onErrorScope){
_local1 = (_local1 + (", onErrorScope:" + String(onErrorScope)));
};
if (rounded){
_local1 = (_local1 + (", rounded:" + String(rounded)));
};
if (isPaused){
_local1 = (_local1 + (", isPaused:" + String(isPaused)));
};
if (timePaused){
_local1 = (_local1 + (", timePaused:" + String(timePaused)));
};
if (isCaller){
_local1 = (_local1 + (", isCaller:" + String(isCaller)));
};
if (count){
_local1 = (_local1 + (", count:" + String(count)));
};
if (timesCalled){
_local1 = (_local1 + (", timesCalled:" + String(timesCalled)));
};
if (waitFrames){
_local1 = (_local1 + (", waitFrames:" + String(waitFrames)));
};
if (hasStarted){
_local1 = (_local1 + (", hasStarted:" + String(hasStarted)));
};
_local1 = (_local1 + "]\n");
return (_local1);
}
public static function makePropertiesChain(_arg1:Object):Object{
var _local3:Object;
var _local4:Object;
var _local5:Object;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local2:Object = _arg1.base;
if (_local2){
_local3 = {};
if ((_local2 is Array)){
_local4 = [];
_local8 = 0;
while (_local8 < _local2.length) {
_local4.push(_local2[_local8]);
_local8++;
};
} else {
_local4 = [_local2];
};
_local4.push(_arg1);
_local6 = _local4.length;
_local7 = 0;
while (_local7 < _local6) {
if (_local4[_local7]["base"]){
_local5 = AuxFunctions.concatObjects(makePropertiesChain(_local4[_local7]["base"]), _local4[_local7]);
} else {
_local5 = _local4[_local7];
};
_local3 = AuxFunctions.concatObjects(_local3, _local5);
_local7++;
};
if (_local3["base"]){
delete _local3["base"];
};
return (_local3);
//unresolved jump
};
return (_arg1);
}
}
}//package caurina.transitions
Section 9
//SoundManager (fangxu.manager.SoundManager)
package fangxu.manager {
import flash.events.*;
import flash.media.*;
public class SoundManager {
public var effectsOn:Boolean;
public var musicOn:Boolean;
private var _isSound:Boolean;// = true
private var _channel:SoundChannel;
private var _sound:Sound;
private static var instance:SoundManager;
private static var key:Boolean = false;
public function SoundManager(){
if (!key){
throw (new Error("单例,请用 getInstance() 取实例!"));
};
key = false;
musicOn = true;
effectsOn = true;
}
public function start():void{
if (_sound != null){
_channel = _sound.play();
_channel.addEventListener(Event.SOUND_COMPLETE, this.onSoundEnd);
};
}
public function startSound(_arg1:Class){
if (_channel != null){
this.clear();
};
_sound = new (_arg1);
this.start();
}
public function stop():void{
if (_channel != null){
_channel.stop();
_channel.removeEventListener(Event.SOUND_COMPLETE, this.onSoundEnd);
};
}
private function onSoundEnd(_arg1:Event):void{
_channel.removeEventListener(Event.SOUND_COMPLETE, this.onSoundEnd);
this.start();
if (_isSound){
_channel.soundTransform = new SoundTransform(1);
} else {
_channel.soundTransform = new SoundTransform(0);
};
}
public function clear():void{
this.stop();
_sound = null;
_channel = null;
_isSound = true;
}
public function stopSound():void{
_channel.stop();
_isSound = false;
}
public static function getInstance():SoundManager{
if (SoundManager.instance == null){
key = true;
SoundManager.instance = new (SoundManager);
};
return (SoundManager.instance);
}
}
}//package fangxu.manager
Section 10
//TimeManager (fangxu.manager.TimeManager)
package fangxu.manager {
import flash.utils.*;
import flash.events.*;
public class TimeManager {
private var _completeFn:Function;
private var _timer:Timer;
private var _timerFn:Function;
private var _isTimeOn:Boolean;// = false
private static var instance:TimeManager;
private static var key:Boolean = false;
public function TimeManager(){
if (!key){
throw (new Error("单例,请用 getInstance() 取实例!"));
};
key = false;
_isTimeOn = false;
}
public function start():void{
if (_timer != null){
_isTimeOn = true;
_timer.start();
};
}
public function stop():void{
if (_timer != null){
_isTimeOn = false;
_timer.stop();
};
}
public function clear():void{
if (_timer != null){
_isTimeOn = false;
_timer.removeEventListener(TimerEvent.TIMER, _timerFn);
_timer.removeEventListener(TimerEvent.TIMER_COMPLETE, _completeFn);
_timer.stop();
_timer = null;
};
}
public function reStart(_arg1:uint):void{
if (_timer != null){
this.clear();
};
_isTimeOn = true;
_timer = new Timer(1000, _arg1);
_timer.addEventListener(TimerEvent.TIMER, _timerFn);
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, _completeFn);
_timer.start();
}
public function adStart(_arg1:uint, _arg2:Function, _arg3:Function):void{
this._timerFn = _arg2;
this._completeFn = _arg3;
if (_timer == null){
_isTimeOn = true;
_timer = new Timer(1000, _arg1);
_timer.addEventListener(TimerEvent.TIMER, _timerFn);
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, _completeFn);
_timer.start();
} else {
this.clear();
};
}
public static function getInstance():TimeManager{
if (TimeManager.instance == null){
key = true;
TimeManager.instance = new (TimeManager);
};
return (TimeManager.instance);
}
}
}//package fangxu.manager
Section 11
//IntUtil (fangxu.util.IntUtil)
package fangxu.util {
public class IntUtil {
private static var hexChars:String = "0123456789abcdef";
public static function toHex(_arg1:int, _arg2:Boolean=false):String{
var _local4:int;
var _local5:int;
var _local3 = "";
if (_arg2){
_local4 = 0;
while (_local4 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> (((3 - _local4) * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> ((3 - _local4) * 8)) & 15))));
_local4++;
};
} else {
_local5 = 0;
while (_local5 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> ((_local5 * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> (_local5 * 8)) & 15))));
_local5++;
};
};
return (_local3);
}
public static function ror(_arg1:int, _arg2:int):uint{
var _local3:int = (32 - _arg2);
return (((_arg1 << _local3) | (_arg1 >>> (32 - _local3))));
}
public static function rol(_arg1:int, _arg2:int):int{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
}
}//package fangxu.util
Section 12
//MD5 (fangxu.util.MD5)
package fangxu.util {
import flash.utils.*;
public class MD5 {
public static var digest:ByteArray;
private static function ff(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(f, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function f(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg2) | (~(_arg1) & _arg3)));
}
private static function g(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg3) | (_arg2 & ~(_arg3))));
}
private static function h(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 ^ _arg2) ^ _arg3));
}
private static function i(_arg1:int, _arg2:int, _arg3:int):int{
return ((_arg2 ^ (_arg1 | ~(_arg3))));
}
private static function transform(_arg1:Function, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):int{
var _local9:int = (((_arg2 + int(_arg1(_arg3, _arg4, _arg5))) + _arg6) + _arg8);
return ((IntUtil.rol(_local9, _arg7) + _arg3));
}
private static function hh(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(h, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
public static function hash(_arg1:String):String{
var _local2:ByteArray = new ByteArray();
_local2.writeUTFBytes(_arg1);
return (hashBinary(_local2));
}
private static function createBlocks(_arg1:ByteArray):Array{
var _local2:Array = new Array();
var _local3:int = (_arg1.length * 8);
var _local4 = 0xFF;
var _local5:int;
while (_local5 < _local3) {
_local2[int((_local5 >> 5))] = (_local2[int((_local5 >> 5))] | ((_arg1[(_local5 / 8)] & _local4) << (_local5 % 32)));
_local5 = (_local5 + 8);
};
_local2[int((_local3 >> 5))] = (_local2[int((_local3 >> 5))] | (128 << (_local3 % 32)));
_local2[int(((((_local3 + 64) >>> 9) << 4) + 14))] = _local3;
return (_local2);
}
public static function hashBinary(_arg1:ByteArray):String{
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local2 = 1732584193;
var _local3 = -271733879;
var _local4 = -1732584194;
var _local5 = 271733878;
var _local10:Array = createBlocks(_arg1);
var _local11:int = _local10.length;
var _local12:int;
while (_local12 < _local11) {
_local6 = _local2;
_local7 = _local3;
_local8 = _local4;
_local9 = _local5;
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 7, -680876936);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 1))], 12, -389564586);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 17, 606105819);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 3))], 22, -1044525330);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 7, -176418897);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 5))], 12, 1200080426);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 17, -1473231341);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 7))], 22, -45705983);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 7, 1770035416);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 9))], 12, -1958414417);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 17, -42063);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 11))], 22, -1990404162);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 7, 1804603682);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 13))], 12, -40341101);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 17, -1502002290);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 15))], 22, 1236535329);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 5, -165796510);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 6))], 9, -1069501632);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 14, 643717713);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 0))], 20, -373897302);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 5, -701558691);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 10))], 9, 38016083);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 14, -660478335);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 4))], 20, -405537848);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 5, 568446438);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 14))], 9, -1019803690);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 14, -187363961);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 8))], 20, 1163531501);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 5, -1444681467);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 2))], 9, -51403784);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 14, 1735328473);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 12))], 20, -1926607734);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 4, -378558);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 8))], 11, -2022574463);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 16, 1839030562);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 14))], 23, -35309556);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 4, -1530992060);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 4))], 11, 1272893353);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 16, -155497632);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 10))], 23, -1094730640);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 4, 681279174);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 0))], 11, -358537222);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 16, -722521979);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 6))], 23, 76029189);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 4, -640364487);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 12))], 11, -421815835);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 16, 530742520);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 2))], 23, -995338651);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 6, -198630844);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 7))], 10, 1126891415);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 15, -1416354905);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 5))], 21, -57434055);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 6, 1700485571);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 3))], 10, -1894986606);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 15, -1051523);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 1))], 21, -2054922799);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 6, 1873313359);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 15))], 10, -30611744);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 15, -1560198380);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 13))], 21, 1309151649);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 6, -145523070);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 11))], 10, -1120210379);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 15, 718787259);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 9))], 21, -343485551);
_local2 = (_local2 + _local6);
_local3 = (_local3 + _local7);
_local4 = (_local4 + _local8);
_local5 = (_local5 + _local9);
_local12 = (_local12 + 16);
};
digest = new ByteArray();
digest.writeInt(_local2);
digest.writeInt(_local3);
digest.writeInt(_local4);
digest.writeInt(_local5);
digest.position = 0;
return ((((IntUtil.toHex(_local2) + IntUtil.toHex(_local3)) + IntUtil.toHex(_local4)) + IntUtil.toHex(_local5)));
}
private static function gg(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(g, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function ii(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(i, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
public static function hashBytes(_arg1:ByteArray):String{
return (hashBinary(_arg1));
}
}
}//package fangxu.util
Section 13
//NumberUtil (fangxu.util.NumberUtil)
package fangxu.util {
public class NumberUtil {
public static function random(_arg1:Number, _arg2:Number):Number{
return (((Math.random() * ((_arg2 - _arg1) + 1)) + _arg1));
}
public static function ranFloor(_arg1:int, _arg2:int):int{
return ((Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1));
}
}
}//package fangxu.util
Section 14
//TimeUtil (fangxu.util.TimeUtil)
package fangxu.util {
public class TimeUtil {
public static function convertTime(_arg1:Number):String{
var _local2:* = Math.ceil(_arg1);
var _local3:* = Math.floor((_local2 / 60));
return (((_local3 + ":") + strPad((_local2 % 60))));
}
public static function strPad(_arg1):String{
var _local2:String = new String(_arg1);
if (_local2.length <= 1){
_local2 = ("0" + _local2);
};
return (_local2);
}
}
}//package fangxu.util
Section 15
//MainBase (fangxu.MainBase)
package fangxu {
import flash.display.*;
public class MainBase extends Sprite {
private var _mouseSprite:Sprite;
public var mStage:Stage;
public var mRoot;
public function initBase(_arg1:Stage, _arg2=null){
this.mRoot = _arg2;
this.mStage = _arg1;
}
public function adMouseSprite(_arg1=null, _arg2:Number=0, _arg3:uint=0x9900):Sprite{
var _local4:Number;
var _local5:Number;
if (_arg1 == null){
_arg1 = this.mStage;
_local4 = _arg1.stageWidth;
_local5 = _arg1.stageHeight;
} else {
_local4 = _arg1.width;
_local5 = _arg1.height;
};
var _local6:Sprite = new Sprite();
_local6.graphics.beginFill(_arg3);
_local6.graphics.drawRect(0, 0, _local4, _local5);
_local6.graphics.endFill();
_local6.alpha = _arg2;
_arg1.addChild(_local6);
mouseSprite = _local6;
return (_local6);
}
public function get mouseSprite():Sprite{
return (_mouseSprite);
}
public function rmMouseSprite():Boolean{
try {
_mouseSprite.parent.removeChild(_mouseSprite);
} catch(e) {
return (false);
};
return (true);
}
public function set mouseSprite(_arg1:Sprite):void{
_mouseSprite = _arg1;
}
}
}//package fangxu
Section 16
//Config (game.Config)
package game {
public class Config {
public static const MAX_LEVEL:int = 11;
public static function getTime(_arg1:int=1):int{
var _local2 = 60;
switch (_arg1){
case 1:
_local2 = 30;
break;
case 2:
_local2 = 50;
break;
case 3:
_local2 = 55;
break;
case 4:
_local2 = 110;
break;
case 5:
_local2 = 110;
break;
case 6:
_local2 = 180;
break;
case 7:
_local2 = 170;
break;
case 8:
_local2 = 280;
break;
case 9:
_local2 = 180;
break;
case 10:
_local2 = 300;
break;
};
return (_local2);
}
public static function getTileNumber(_arg1:int=1):int{
var _local2 = 5;
return ((((_local2 + _arg1) > 15)) ? 15 : (_local2 + _arg1));
}
public static function getSpeTileNum(_arg1:int=1):int{
var _local2:int;
switch (_arg1){
case 1:
_local2 = 0;
break;
case 2:
_local2 = 1;
break;
case 3:
_local2 = 1;
break;
case 4:
_local2 = 2;
break;
case 5:
_local2 = 2;
break;
case 6:
_local2 = 2;
break;
case 7:
_local2 = 3;
break;
case 8:
_local2 = 3;
break;
case 9:
_local2 = 3;
break;
case 10:
_local2 = 4;
break;
};
return (_local2);
}
public static function getTotalNum(_arg1:int=1):int{
var _local5:uint;
var _local6:uint;
var _local2:int;
var _local3:Array = getStructure(_arg1);
var _local4:uint;
while (_local4 < _local3.length) {
_local5 = 0;
while (_local5 < _local3[_local4].length) {
_local6 = 0;
while (_local6 < _local3[_local4][_local5].length) {
if (_local3[_local4][_local5][_local6] == 1){
_local2++;
};
_local6++;
};
_local5++;
};
_local4++;
};
return (_local2);
}
public static function getBGSound(_arg1:int=1):Class{
var _local2:Class = BG1Sound;
switch (_arg1){
case 1:
_local2 = BG1Sound;
break;
case 2:
_local2 = BG2Sound;
break;
case 3:
_local2 = BG3Sound;
break;
case 4:
_local2 = BG4Sound;
break;
case 5:
_local2 = BG5Sound;
break;
case 6:
_local2 = BG6Sound;
break;
case 7:
_local2 = BG7Sound;
break;
case 8:
_local2 = BG8Sound;
break;
case 9:
_local2 = BG9Sound;
break;
case 10:
_local2 = BG10Sound;
break;
};
return (_local2);
}
public static function getBGMessage(_arg1:int=1):String{
var _local2:String = ("level " + _arg1);
switch (_arg1){
case 1:
_local2 = "Peter likes to explore the world and purchased a mystical treasure map from a beggar. He leaves his hometown to go on a dangerous journey to discover the treasure.";
break;
case 2:
_local2 = "The Departure";
break;
case 3:
_local2 = "The Rainstorm";
break;
case 4:
_local2 = "The Tsunami";
break;
case 5:
_local2 = "The Whirlpool";
break;
case 6:
_local2 = "The Sea Serpent";
break;
case 7:
_local2 = "The Pirates";
break;
case 8:
_local2 = "Going ashore on the Dragon Island";
break;
case 9:
_local2 = "The Fire Cave";
break;
case 10:
_local2 = "The Fight with the Dragon";
break;
case 11:
_local2 = "The Treasure";
break;
};
return (_local2);
}
public static function getStructure(_arg1:int=1):Array{
data = new Array();
switch (_arg1){
case 1:
data.push([[0, 1, 0], [1, 1, 1], [0, 1, 0]]);
data.push([[1, 1, 1], [1, 0, 1], [1, 1, 1]]);
data.push([[0, 1, 0], [1, 1, 1], [0, 1, 0]]);
break;
case 2:
data.push([[1, 1, 1], [1, 1, 1], [1, 1, 1]]);
data.push([[1, 1, 1], [1, 0, 1], [1, 1, 1]]);
data.push([[1, 1, 1], [1, 1, 1], [1, 1, 1]]);
break;
case 3:
data.push([[0, 1, 1, 0], [0, 1, 1, 0], [0, 1, 1, 0], [0, 1, 1, 0]]);
data.push([[0, 0, 0, 0], [1, 1, 1, 1], [1, 1, 1, 1], [0, 0, 0, 0]]);
data.push([[0, 1, 1, 0], [0, 1, 1, 0], [0, 1, 1, 0], [0, 1, 1, 0]]);
data.push([[0, 0, 0, 0], [1, 1, 1, 1], [1, 1, 1, 1], [0, 0, 0, 0]]);
break;
case 4:
data.push([[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]);
data.push([[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]);
data.push([[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]);
data.push([[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]);
data.push([[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]);
break;
case 5:
data.push([[0, 0, 1, 0, 0], [0, 0, 1, 0, 0], [1, 1, 1, 1, 1], [0, 0, 1, 0, 0], [0, 0, 1, 0, 0]]);
data.push([[1, 0, 0, 0, 1], [0, 1, 1, 1, 0], [0, 1, 1, 1, 0], [0, 1, 1, 1, 0], [1, 0, 0, 0, 1]]);
data.push([[0, 0, 1, 0, 0], [0, 0, 1, 0, 0], [1, 1, 0, 1, 1], [0, 0, 1, 0, 0], [0, 0, 1, 0, 0]]);
data.push([[1, 0, 0, 0, 1], [0, 1, 1, 1, 0], [0, 1, 1, 1, 0], [0, 1, 1, 1, 0], [1, 0, 0, 0, 1]]);
data.push([[0, 0, 1, 0, 0], [0, 0, 1, 0, 0], [1, 1, 1, 1, 1], [0, 0, 1, 0, 0], [0, 0, 1, 0, 0]]);
break;
case 6:
data.push([[1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1]]);
data.push([[0, 0, 0, 0, 0], [0, 0, 1, 0, 0], [0, 1, 1, 1, 0], [0, 0, 1, 0, 0], [0, 0, 0, 0, 0]]);
data.push([[1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1]]);
data.push([[0, 0, 0, 0, 0], [0, 0, 1, 0, 0], [0, 1, 1, 1, 0], [0, 0, 1, 0, 0], [0, 0, 0, 0, 0]]);
data.push([[1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1]]);
break;
case 7:
data.push([[0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 1, 1], [1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0]]);
data.push([[1, 0, 0, 0, 0, 0], [1, 1, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 1]]);
data.push([[0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 1, 1], [1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0]]);
data.push([[1, 0, 0, 0, 0, 0], [1, 1, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 1]]);
data.push([[0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 1, 1], [1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0]]);
break;
case 8:
data.push([[0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0]]);
data.push([[0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0]]);
data.push([[1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1]]);
data.push([[0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0]]);
data.push([[0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0]]);
break;
case 9:
data.push([[0, 0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0, 0], [1, 1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1, 0]]);
data.push([[0, 1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1, 1], [0, 0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0, 0]]);
data.push([[0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0], [1, 1, 1, 0, 1, 1, 1], [0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0]]);
data.push([[0, 1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1, 1], [0, 0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0, 0]]);
data.push([[0, 0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0, 0], [1, 1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1, 0]]);
break;
case 10:
data.push([[1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1, 1], [1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1]]);
data.push([[0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 0], [0, 1, 1, 0, 1, 1, 0], [0, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0]]);
data.push([[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 1, 0, 1, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]]);
data.push([[0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 0], [0, 1, 1, 0, 1, 1, 0], [0, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0]]);
data.push([[0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 0], [0, 1, 0, 0, 0, 1, 0], [0, 1, 0, 0, 0, 1, 0], [0, 1, 0, 0, 0, 1, 0], [0, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0]]);
data.push([[1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 1, 1], [1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1]]);
break;
};
return (data);
}
}
}//package game
Section 17
//CTile (game.CTile)
package game {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class CTile extends MovieClip {
var _mcBitmap;
var _nStepInterval;
var _twColorTransform;
var _bTime;
var _bReplace;// = false
var __get__white;
public var mcClear:MovieClip;
var _nBonusValue;// = 0
var _smcBitmapData;
var _oColumn;
var _nBonusCountDownStep;// = 0
var _bBurstExist;// = false
var _sbtShape;
var _nIDInTileArray;
var _bSelect;// = false
public function CTile(){
addFrameScript(0, frame1);
super();
init();
}
public function set oColumn(_arg1:Object):void{
this._oColumn = _arg1;
}
public function selectTile(_arg1:MouseEvent=null){
_bSelect = !(_bSelect);
if (_bSelect){
this.transform.colorTransform = new ColorTransform(1.5, 1.5, 1.5, 1);
} else {
this.transform.colorTransform = new ColorTransform(1, 1, 1, 1);
};
}
private function init():void{
this.useHandCursor = true;
this.buttonMode = true;
}
function frame1(){
stop();
}
public function get oColumn():Object{
return (_oColumn);
}
}
}//package game
Section 18
//Loading (game.Loading)
package game {
import flash.events.*;
import flash.display.*;
import flash.media.*;
public class Loading {
private var _root;
private var _func:Function;
private var _channel:SoundChannel;
private var _loadSound:Sound;
private var _channel2:SoundChannel;
private var _loadSound2:Sound;
private var _mc:MovieClip;
public function Loading(_arg1, _arg2:MovieClip, _arg3:Function){
var _r = _arg1;
var _mc = _arg2;
var _callBack = _arg3;
super();
this._root = _r;
this._mc = _mc;
this._func = _callBack;
_mc.mcLoader1.visible = true;
_mc.mcLoader2.visible = false;
trace("_mc.mcLoader2.mc_9_loading", _mc.mcLoader2.mc_9_loading);
_mc.mcLoader2.mc_9_loading.visible = false;
_mc.mcLoader2.mc_9_loading.gotoAndStop(1);
_root.loaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
_root.loaderInfo.addEventListener(Event.COMPLETE, loadEnd);
_mc.mcLoader2.btSkip.addEventListener(MouseEvent.CLICK, function (){
if (_channel){
_channel.stop();
};
if (_channel2){
_channel2.stop();
};
_mc.mcLoader2.mc_9_loading.visible = false;
_mc.mcLoader2.mc_9_loading.gotoAndStop(1);
if (_channel){
_channel.removeEventListener(Event.SOUND_COMPLETE, onLoadSoundEnd);
};
_mc.mcLoader2.removeEventListener(Event.ENTER_FRAME, frameListiser);
_func();
});
}
private function frameListiser(_arg1:Event):void{
if (_mc.mcLoader2.currentFrame == 77){
_mc.mcLoader2.mc_9_loading.visible = true;
_mc.mcLoader2.mc_9_loading.gotoAndPlay(1);
};
if (_mc.mcLoader2.currentFrame == 174){
if (_channel){
_channel.stop();
};
if (_channel2){
_channel2.stop();
};
_mc.mcLoader2.mc_9_loading.visible = false;
_mc.mcLoader2.mc_9_loading.gotoAndStop(1);
_mc.mcLoader2.removeEventListener(Event.ENTER_FRAME, frameListiser);
_func();
};
}
private function loadEnd(_arg1:Event):void{
trace("loadEnd");
_mc.txtLoaded.text = "";
_mc.mcLoading.visible = false;
_mc.mcLoader1.visible = false;
_mc.mcLoader2.visible = true;
_root.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, loadProgress);
_root.loaderInfo.removeEventListener(Event.COMPLETE, loadEnd);
_loadSound = new LoadSound();
_channel = _loadSound.play();
_channel.addEventListener(Event.SOUND_COMPLETE, onLoadSoundEnd);
_mc.mcLoader2.addEventListener(Event.ENTER_FRAME, frameListiser);
}
private function onLoadSoundEnd(_arg1:Event){
_channel.removeEventListener(Event.SOUND_COMPLETE, onLoadSoundEnd);
_channel = _loadSound.play();
_channel.addEventListener(Event.SOUND_COMPLETE, onLoadSoundEnd);
}
private function loadProgress(_arg1:ProgressEvent):void{
trace(_arg1.bytesLoaded, _arg1.bytesTotal);
var _local2:* = Math.floor(((_arg1.bytesLoaded / _arg1.bytesTotal) * 100));
_mc.txtLoaded.text = (_local2 + "%");
}
}
}//package game
Section 19
//CVXCV_120 (MahjongDiscovery_gamesonly_fla.CVXCV_120)
package MahjongDiscovery_gamesonly_fla {
import flash.utils.*;
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
public dynamic class CVXCV_120 extends MovieClip {
public function CVXCV_120(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MahjongDiscovery_gamesonly_fla
Section 20
//load_Mcloading_1 (MahjongDiscovery_gamesonly_fla.load_Mcloading_1)
package MahjongDiscovery_gamesonly_fla {
import flash.utils.*;
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
public dynamic class load_Mcloading_1 extends MovieClip {
public var txtLoaded:TextField;
public var mcLoading:MovieClip;
public var mcLoader1:MovieClip;
public var mcLoader2:MovieClip;
public function load_Mcloading_1(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MahjongDiscovery_gamesonly_fla
Section 21
//MainTimeline (MahjongDiscovery_gamesonly_fla.MainTimeline)
package MahjongDiscovery_gamesonly_fla {
import flash.utils.*;
import fangxu.manager.*;
import flash.events.*;
import flash.display.*;
import game.*;
import fangxu.util.*;
import flash.media.*;
import flash.text.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
public dynamic class MainTimeline extends MovieClip {
public var txtScore:TextField;
public var mcTimeBorder:MovieClip;
public var mcSound:MovieClip;
public var btPlay:SimpleButton;
public var btSubmitScore:SimpleButton;
public var totalScore;
public var mcMusic:MovieClip;
public var btHelp:SimpleButton;
public var btMoreMahjongGames:SimpleButton;
public var btMoreGames:SimpleButton;
public var btStory:SimpleButton;
public var btPause:SimpleButton;
public var bg:MCBg;
public var mcLoader:MovieClip;
public var mcLeftButton:MovieClip;
public var btMenu:SimpleButton;
public var btPlayAgain:SimpleButton;
public var mc1:CTile;
public var mc2:CTile;
public var txtTime:TextField;
public var mcParent:MovieClip;
public var mcNextLevel:MovieClip;
public var btHighScore:SimpleButton;
public var mcNextScore:MCNextScore;
public var mcRightButton:MovieClip;
public var btReshuff:SimpleButton;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5);
}
function frame1(){
stop();
new Loading(root, mcLoader, function (){
nextFrame();
});
}
function frame4(){
stop();
totalScore = 0;
btMenu.addEventListener(MouseEvent.CLICK, function (){
Main.getInstance(stage, root).destroy();
prevFrame();
prevFrame();
});
Main.getInstance(stage, root).init();
}
function frame5(){
stop();
txtScore.text = root.totalScore;
btSubmitScore.addEventListener(MouseEvent.CLICK, function ():void{
var _local1:* = totalScore;
var _local2:* = "mahjongdiscovery";
var _local3:* = "www.gamesonly.com.cn";
var _local4:* = MD5.hash((((_local3 + _local2) + _local1) + "zygomaticgames"));
navigateToURL(new URLRequest((((((("http://www.gamesonly.com.cn/highscore.php?game=" + _local2) + "&score=") + _local1) + "&otherparam=") + _local4) + "")), "_blank");
trace((((((("http://www.gamesonly.net/highscore.php?game=" + _local2) + "&score=") + _local1) + "&otherparam=") + _local4) + ""));
});
btPlayAgain.addEventListener(MouseEvent.CLICK, function (){
prevFrame();
});
SoundManager.getInstance().startSound(MainSound);
}
function frame3(){
stop();
btPlay.addEventListener(MouseEvent.CLICK, function (){
nextFrame();
prevFrame();
});
}
function frame2(){
stop();
SoundMixer.stopAll();
totalScore = 0;
btHelp.addEventListener(MouseEvent.CLICK, function (){
nextFrame();
});
btPlay.addEventListener(MouseEvent.CLICK, function (){
nextFrame();
nextFrame();
});
btHighScore.addEventListener(MouseEvent.CLICK, function ():void{
navigateToURL(new URLRequest("http://www.gamesonly.com.cn/"), "_blank");
});
btMoreGames.addEventListener(MouseEvent.CLICK, function ():void{
navigateToURL(new URLRequest("http://www.gamesonly.com.cn/"), "_blank");
});
btMoreMahjongGames.addEventListener(MouseEvent.CLICK, function ():void{
navigateToURL(new URLRequest("http://www.mahjonggames4all.com/"), "_blank");
});
SoundManager.getInstance().startSound(MainSound);
}
}
}//package MahjongDiscovery_gamesonly_fla
Section 22
//mcMusic_111 (MahjongDiscovery_gamesonly_fla.mcMusic_111)
package MahjongDiscovery_gamesonly_fla {
import flash.utils.*;
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
public dynamic class mcMusic_111 extends MovieClip {
public function mcMusic_111(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MahjongDiscovery_gamesonly_fla
Section 23
//mcSound_100 (MahjongDiscovery_gamesonly_fla.mcSound_100)
package MahjongDiscovery_gamesonly_fla {
import flash.utils.*;
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
public dynamic class mcSound_100 extends MovieClip {
public function mcSound_100(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MahjongDiscovery_gamesonly_fla
Section 24
//Timeline_12 (MahjongDiscovery_gamesonly_fla.Timeline_12)
package MahjongDiscovery_gamesonly_fla {
import flash.utils.*;
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
public dynamic class Timeline_12 extends MovieClip {
public function Timeline_12(){
addFrameScript(79, frame80);
}
function frame80(){
stop();
}
}
}//package MahjongDiscovery_gamesonly_fla
Section 25
//Timeline_14 (MahjongDiscovery_gamesonly_fla.Timeline_14)
package MahjongDiscovery_gamesonly_fla {
import flash.utils.*;
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
public dynamic class Timeline_14 extends MovieClip {
public function Timeline_14(){
addFrameScript(106, frame107);
}
function frame107(){
stop();
}
}
}//package MahjongDiscovery_gamesonly_fla
Section 26
//Timeline_2 (MahjongDiscovery_gamesonly_fla.Timeline_2)
package MahjongDiscovery_gamesonly_fla {
import flash.utils.*;
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
public dynamic class Timeline_2 extends MovieClip {
public var btSkip:SimpleButton;
public var mc_9_loading:MovieClip;
public function Timeline_2(){
addFrameScript(173, frame174);
}
function frame174(){
stop();
}
}
}//package MahjongDiscovery_gamesonly_fla
Section 27
//Timeline_46 (MahjongDiscovery_gamesonly_fla.Timeline_46)
package MahjongDiscovery_gamesonly_fla {
import flash.utils.*;
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
public dynamic class Timeline_46 extends MovieClip {
public function Timeline_46(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MahjongDiscovery_gamesonly_fla
Section 28
//Award1Sound (Award1Sound)
package {
import flash.media.*;
public dynamic class Award1Sound extends Sound {
}
}//package
Section 29
//Award2Sound (Award2Sound)
package {
import flash.media.*;
public dynamic class Award2Sound extends Sound {
}
}//package
Section 30
//Award3Sound (Award3Sound)
package {
import flash.media.*;
public dynamic class Award3Sound extends Sound {
}
}//package
Section 31
//BG10Sound (BG10Sound)
package {
import flash.media.*;
public dynamic class BG10Sound extends Sound {
}
}//package
Section 32
//BG1Sound (BG1Sound)
package {
import flash.media.*;
public dynamic class BG1Sound extends Sound {
}
}//package
Section 33
//BG2Sound (BG2Sound)
package {
import flash.media.*;
public dynamic class BG2Sound extends Sound {
}
}//package
Section 34
//BG3Sound (BG3Sound)
package {
import flash.media.*;
public dynamic class BG3Sound extends Sound {
}
}//package
Section 35
//BG4Sound (BG4Sound)
package {
import flash.media.*;
public dynamic class BG4Sound extends Sound {
}
}//package
Section 36
//BG5Sound (BG5Sound)
package {
import flash.media.*;
public dynamic class BG5Sound extends Sound {
}
}//package
Section 37
//BG6Sound (BG6Sound)
package {
import flash.media.*;
public dynamic class BG6Sound extends Sound {
}
}//package
Section 38
//BG7Sound (BG7Sound)
package {
import flash.media.*;
public dynamic class BG7Sound extends Sound {
}
}//package
Section 39
//BG8Sound (BG8Sound)
package {
import flash.media.*;
public dynamic class BG8Sound extends Sound {
}
}//package
Section 40
//BG9Sound (BG9Sound)
package {
import flash.media.*;
public dynamic class BG9Sound extends Sound {
}
}//package
Section 41
//ClickSound (ClickSound)
package {
import flash.media.*;
public dynamic class ClickSound extends Sound {
}
}//package
Section 42
//ClockSound (ClockSound)
package {
import flash.media.*;
public dynamic class ClockSound extends Sound {
}
}//package
Section 43
//GameOverSound (GameOverSound)
package {
import flash.media.*;
public dynamic class GameOverSound extends Sound {
}
}//package
Section 44
//GameSound (GameSound)
package {
import flash.media.*;
public dynamic class GameSound extends Sound {
}
}//package
Section 45
//LevelsSound (LevelsSound)
package {
import flash.media.*;
public dynamic class LevelsSound extends Sound {
}
}//package
Section 46
//LevelUpSound (LevelUpSound)
package {
import flash.media.*;
public dynamic class LevelUpSound extends Sound {
}
}//package
Section 47
//LoadSound (LoadSound)
package {
import flash.media.*;
public dynamic class LoadSound extends Sound {
}
}//package
Section 48
//LoadSound2 (LoadSound2)
package {
import flash.media.*;
public dynamic class LoadSound2 extends Sound {
}
}//package
Section 49
//Main (Main)
package {
import flash.utils.*;
import fangxu.manager.*;
import flash.events.*;
import flash.display.*;
import caurina.transitions.*;
import game.*;
import fangxu.util.*;
import fangxu.*;
import flash.geom.*;
public class Main extends MainBase {
var mcPause:MCPause;
var nMaxStep:uint;
var isSound:Boolean;
var arrMCLevels:Array;
var aColumn:Array;
var isMusic:Boolean;// = true
var isClickMC2:Boolean;
var _bIsRotate:Boolean;
private var moreClick:int;// = 0
var isBtStory:Boolean;// = false
var _mcParent:Stage;
var timeOutId:uint;
var nStartX:Number;
var nStartY:Number;
private var isNextLevel;
var sDirection:String;
private var isEnd;
var mcClear:MCClear;
var nStep:uint;
var nTileSize:Number;
var mcReshuffle:MCReshuffle;
var nColumnX;
var nColumnY;
var nColumnZ;
var level:uint;
var mcColumn:MovieClip;
var nTileHalf:Number;
var _nScale:Number;
var aTiles:Array;
var nColumnAngle:Number;
private var scoreTimer:Timer;
var arrMCLevelTexts:Array;
var currentTime:int;
var preTile:CTile;
private var isPause;
var pLevel:uint;
private static var instance:Main;
public function Main(){
aColumn = [];
arrMCLevelTexts = [];
super();
}
private function fnPause(_arg1:Boolean=true):void{
var bPause = _arg1;
isPause = bPause;
if (bPause){
if (mcPause == null){
mcPause = new MCPause();
mcPause.x = ((mStage.stageWidth / 2) - (mcPause.width / 2));
mcPause.y = ((mStage.stageHeight / 2) - (mcPause.height / 2));
mStage.addChild(mcPause);
mcPause.btContinue.addEventListener(MouseEvent.CLICK, function (){
fnPause(false);
});
};
mcPause.visible = true;
TimeManager.getInstance().stop();
if (isMusic){
SoundManager.getInstance().stop();
};
adMouseSprite(mStage);
mStage.swapChildren(mcPause, mouseSprite);
} else {
TimeManager.getInstance().start();
if (isMusic){
SoundManager.getInstance().start();
};
rmMouseSprite();
mcPause.visible = false;
};
}
public function init():void{
_mcParent = mStage;
aTiles = [];
aColumn = [];
nColumnX = 1;
nColumnY = 1;
nColumnZ = 1;
nTileSize = 54;
_nScale = 1;
nColumnAngle = 52;
nStartX = 0;
nStartY = 0;
nTileHalf = 0;
nMaxStep = 10;
nStep = 0;
_bIsRotate = false;
sDirection = "right";
mcColumn = null;
scoreTimer = null;
moreClick = 0;
level = 0;
currentTime = 0;
timeOutId = 0;
preTile = null;
isSound = true;
mRoot.mc1.visible = false;
mRoot.mc2.visible = false;
isMusic = true;
isClickMC2 = false;
isEnd = false;
isPause = false;
isNextLevel = false;
arrMCLevels = [];
arrMCLevelTexts = [];
initMC();
fnNextLevel(level);
mStage.addEventListener(KeyboardEvent.KEY_DOWN, fnKeyClick);
}
function shuffleTiles(_arg1:Boolean=false){
var _local2:CTile;
var _local3:CTile;
var _local5:*;
var _local6:uint;
var _local7:*;
fnReshuffle(true, _arg1);
var _local4:Array = [];
for (_local5 in aColumn) {
if (aColumn[_local5] != null){
_local4.push(aColumn[_local5]);
};
};
_local6 = 0;
while (_local6 < (_local4.length - 1)) {
_local7 = NumberUtil.ranFloor((_local6 + 1), (_local4.length - 1));
_local2 = _local4[_local6];
_local3 = _local4[_local7];
changeTiles(_local2, _local3);
_local6++;
};
}
private function fnClearTiles(_arg1:CTile, _arg2:Boolean=false):void{
if (!_arg2){
mcClear = new MCClear();
mcClear.x = (((_arg1.x + (_arg1.width / 2)) - (mcClear.width / 2)) + 25);
mcClear.y = (((_arg1.y + (_arg1.height / 2)) - (mcClear.height / 2)) + 25);
mcClear.addEventListener(Event.ENTER_FRAME, fnMCClear);
mStage.addChild(mcClear);
mcClear = new MCClear();
mcClear.x = (((preTile.x + (preTile.width / 2)) - (mcClear.width / 2)) + 25);
mcClear.y = (((preTile.y + (preTile.height / 2)) - (mcClear.height / 2)) + 25);
mcClear.addEventListener(Event.ENTER_FRAME, fnMCClear);
mStage.addChild(mcClear);
};
var _local3:* = 0;
while (_local3 < aTiles.length) {
if ((((aTiles[_local3] == _arg1)) || ((aTiles[_local3] == preTile)))){
aTiles.splice(_local3, 1);
};
_local3++;
};
aColumn[((((preTile.oColumn.x + ":") + preTile.oColumn.y) + ":") + preTile.oColumn.z)] = null;
aColumn[((((_arg1.oColumn.x + ":") + _arg1.oColumn.y) + ":") + _arg1.oColumn.z)] = null;
_mcParent.removeChild(preTile);
_mcParent.removeChild(_arg1);
_arg1 = null;
preTile = null;
mRoot.mc1.visible = false;
mRoot.mc2.visible = false;
isClickMC2 = false;
if (scoreTimer == null){
scoreTimer = new Timer(2000);
scoreTimer.addEventListener(TimerEvent.TIMER, updateScore);
scoreTimer.start();
fnScore(100);
moreClick++;
} else {
if (moreClick > 0){
scoreTimer.removeEventListener(TimerEvent.TIMER, updateScore);
fnScore((100 + (25 * moreClick)));
} else {
fnScore(100);
};
scoreTimer.addEventListener(TimerEvent.TIMER, updateScore);
scoreTimer.start();
moreClick++;
};
if (isSuccess()){
if (level == Config.MAX_LEVEL){
} else {
isNextLevel = true;
TimeManager.getInstance().stop();
fnNextLevel(level, true);
};
} else {
autoReshuffle();
};
}
private function fnVisibleTiles(_arg1:Boolean):void{
var _local2:*;
for (_local2 in aColumn) {
if (aColumn[_local2] != null){
aColumn[_local2].visible = _arg1;
};
};
}
private function updateScore(_arg1:TimerEvent){
scoreTimer.removeEventListener(TimerEvent.TIMER, updateScore);
scoreTimer.stop();
moreClick = 0;
}
private function fnMoreClick():void{
var _local2:CTile;
var _local3:*;
var _local1:uint;
for (_local3 in aColumn) {
if (aColumn[_local3] != null){
if (_local1 == 0){
_local2 = aColumn[_local3];
_local1 = _local2.currentFrame;
} else {
if (_local1 == (aColumn[_local3] as CTile).currentFrame){
preTile = _local2;
fnClearTiles((aColumn[_local3] as CTile));
return;
};
};
};
};
}
function showTile(_arg1){
var _local2:* = ((nStartX + ((_arg1.oColumn.x * nTileSize) * _nScale)) + nTileHalf);
var _local3:* = ((nStartY + ((_arg1.oColumn.y * nTileSize) * _nScale)) + nTileHalf);
var _local4:* = ((_arg1.oColumn.z * nTileSize) * _nScale);
var _local5:Point = new Point(_local2, _local3);
_local5 = mcColumn.localToGlobal(_local5);
_arg1.x = (_local5.x - (40 * _nScale));
_arg1.y = ((_local5.y - _local4) - (62 * _nScale));
}
private function fnKeyClick(_arg1:KeyboardEvent):void{
if (((((isEnd) || (isPause))) || (isNextLevel))){
return;
};
switch (_arg1.keyCode){
case 37:
sDirection = "right";
if (isSound){
new RotateSound().play();
};
mcColumn.addEventListener(Event.ENTER_FRAME, rotateColumn);
break;
case 39:
sDirection = "left";
if (isSound){
new RotateSound().play();
};
mcColumn.addEventListener(Event.ENTER_FRAME, rotateColumn);
break;
};
}
public function start():void{
var _local8:CTile;
var _local10:uint;
var _local11:uint;
if (level == 1){
SoundManager.getInstance().startSound(Config.getBGSound(level));
};
var _local1:Array = Config.getStructure(level);
currentTime = Config.getTime(level);
var _local2:uint = 1;
var _local3:int;
var _local4:uint = (Config.getTotalNum(level) / 2);
var _local5:uint = 1;
var _local6:Array = [];
var _local7:uint;
while (_local7 < _local4) {
if (_local3 < Config.getSpeTileNum(level)){
_local2 = NumberUtil.ranFloor(1, 18);
if (_local2 > 15){
_local3++;
};
} else {
_local2 = NumberUtil.ranFloor(1, 15);
};
_local6.push(_local2);
++_local5;
if (_local5 > Config.getTileNumber(level)){
_local5 = 1;
};
_local7++;
};
aTiles = new Array();
aColumn = new Array();
nColumnX = _local1[0][0].length;
nColumnY = _local1[0].length;
nColumnZ = _local1.length;
initColumn();
_local5 = 0;
var _local9:uint;
while (_local9 < _local1.length) {
_local10 = 0;
while (_local10 < _local1[_local9].length) {
_local11 = 0;
while (_local11 < _local1[_local9][_local10].length) {
if (_local1[_local9][_local10][_local11] != "0"){
_local8 = new CTile();
_local8.gotoAndStop(_local6[_local5]);
++_local5;
if (_local5 >= _local6.length){
_local5 = 0;
};
_local8.oColumn = {x:_local11, y:_local10, z:_local9};
_mcParent.addChild(_local8);
aColumn[((((_local11 + ":") + _local10) + ":") + _local9)] = _local8;
aTiles.push(_local8);
_local8.addEventListener(MouseEvent.ROLL_OVER, tileOver);
_local8.addEventListener(MouseEvent.ROLL_OUT, tileOut);
_local8.addEventListener(MouseEvent.CLICK, tileClick);
};
_local11++;
};
_local10++;
};
_local9++;
};
shuffleTiles();
showAllTiles();
autoReshuffle();
mRoot.bg.mcSBG.visible = false;
TimeManager.getInstance().adStart(currentTime, updateTimer, end);
mRoot.mcTimeBorder.mcTime.gotoAndStop(1);
}
private function fnSkip():void{
if (timeOutId != 0){
clearTimeout(timeOutId);
timeOutId = 0;
};
mRoot.bg.txtStory2.text = "";
mRoot.bg.txtStory.text = "";
mRoot.bg.btSkip.visible = false;
mRoot.bg.btBack.visible = false;
mRoot.swapChildren(mRoot.bg, mouseSprite);
rmMouseSprite();
if (isBtStory){
TimeManager.getInstance().start();
fnVisibleTiles(true);
} else {
start();
};
}
private function fnNextLevel(_arg1:uint, _arg2:Boolean=false):void{
var pLevel = _arg1;
var isNextScore = _arg2;
if (isNextScore){
this.pLevel = pLevel;
if (mRoot.mcNextScore.y == 502){
adMouseSprite(mRoot);
mRoot.swapChildren(mRoot.mcNextScore, mouseSprite);
mRoot.mcNextScore.txtScore.text = (currentTime * 80);
Tweener.addTween(mRoot.mcNextScore, {y:108, time:0.5, transition:"linear", onComplete:function (){
setTimeout(function (){
fnNextLevel(pLevel, isNextScore);
fnScore((currentTime * 80));
}, 3000);
}});
return;
};
mRoot.swapChildren(mRoot.mcNextScore, mouseSprite);
rmMouseSprite();
mRoot.mcNextScore.y = 502;
};
if (level == (Config.MAX_LEVEL - 1)){
level++;
fnShowBG();
return;
};
var i:uint;
while (i < pLevel) {
arrMCLevels[i].gotoAndStop(3);
arrMCLevelTexts[i].gotoAndStop(2);
i = (i + 1);
};
if (pLevel != 0){
arrMCLevels[(pLevel - 1)].gotoAndStop(2);
arrMCLevelTexts[(pLevel - 1)].gotoAndStop(1);
Tweener.addTween(mRoot.mcNextLevel, {y:-20, time:0.5, transition:"linear", onComplete:function (){
if ((((pLevel == 1)) || ((pLevel > 6)))){
mRoot.mcNextLevel.mcPeter.gotoAndStop(1);
} else {
mRoot.mcNextLevel.mcPeter.gotoAndStop(2);
};
Tweener.addTween(mRoot.mcNextLevel.mcPeter, {x:arrMCLevels[(pLevel - 1)].x, y:arrMCLevels[(pLevel - 1)].y, time:0.8, transition:"linear"});
}});
};
if (isSound){
new LevelUpSound().play();
};
if (isSound){
SoundManager.getInstance().clear();
};
if (level == 0){
isNextLevel = false;
level++;
fnShowBG();
} else {
setTimeout(function (){
arrMCLevels[(level - 1)].buttonMode = true;
arrMCLevels[(level - 1)].addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent){
var e = _arg1;
Tweener.addTween(mRoot.mcNextLevel, {y:-570, time:0.5, transition:"linear", onComplete:function (){
destroy();
isNextLevel = false;
level++;
fnShowBG();
}});
});
}, 1000);
};
}
private function autoReshuffle():void{
if (isReffle()){
shuffleTiles();
};
}
private function isSuccess():Boolean{
var _local1:*;
for (_local1 in aColumn) {
if (aColumn[_local1] != null){
return (false);
};
};
return (true);
}
private function tileClick(_arg1:MouseEvent):void{
var _local3:Boolean;
var _local2:CTile = (_arg1.currentTarget as CTile);
if (((!((_local2 == null))) && (isCanClear(_local2.oColumn.x, _local2.oColumn.y, _local2.oColumn.z)))){
if (preTile != _local2){
isClickMC2 = true;
_local2.selectTile();
if (((!((preTile == null))) && ((preTile.currentFrame == _local2.currentFrame)))){
_local3 = false;
if (isSound){
if (_local2.currentFrame == 16){
_local3 = true;
new Award1Sound().play();
} else {
if (_local2.currentFrame == 17){
new Award2Sound().play();
fnScore(100);
} else {
if (_local2.currentFrame == 18){
currentTime = (currentTime + 5);
new Award3Sound().play();
} else {
new RightClickSound().play();
};
};
};
};
fnClearTiles(_local2);
if (_local3){
fnMoreClick();
};
} else {
if (preTile != null){
if (isSound){
new WrongClickSound().play();
};
preTile.selectTile();
} else {
if (isSound){
new ClickSound().play();
};
};
preTile = _local2;
mRoot.mc1.gotoAndStop(_local2.currentFrame);
mRoot.mc2.gotoAndStop(_local2.currentFrame);
};
};
};
}
private function fnReshuffle(_arg1:Boolean, _arg2:Boolean=false):void{
var bReshuffle = _arg1;
var isReduceScore = _arg2;
if (bReshuffle){
if (mcReshuffle == null){
mcReshuffle = new MCReshuffle();
mcReshuffle.x = ((mStage.stageWidth / 2) - (mcReshuffle.width / 2));
mcReshuffle.y = ((mStage.stageHeight / 2) - (mcReshuffle.height / 2));
mStage.addChild(mcReshuffle);
};
if (isReduceScore){
mcReshuffle.txtScore.visible = true;
} else {
mcReshuffle.txtScore.visible = false;
};
mcReshuffle.visible = true;
TimeManager.getInstance().stop();
adMouseSprite(mStage);
mStage.swapChildren(mcReshuffle, mouseSprite);
setTimeout(function (){
fnReshuffle(false, isReduceScore);
}, 1000);
} else {
TimeManager.getInstance().start();
rmMouseSprite();
mcReshuffle.visible = false;
if (isReduceScore){
fnScore(-500);
};
};
}
function showAllTiles(){
var _local1:*;
for (_local1 in aColumn) {
if (aColumn[_local1] != null){
showTile(aColumn[_local1]);
};
};
}
function initColumn(){
if (mcColumn != null){
mcColumn.parent.removeChild(mcColumn);
};
mcColumn = new MovieClip();
_mcParent.addChild(mcColumn);
mcColumn.visible = false;
var _local1:* = ((nColumnX * nTileSize) * _nScale);
var _local2:* = ((nColumnY * nTileSize) * _nScale);
mcColumn.graphics.beginFill(0);
mcColumn.graphics.moveTo((-(_local1) * 0.5), (-(_local2) * 0.5));
mcColumn.graphics.lineTo((_local1 * 0.5), (-(_local2) * 0.5));
mcColumn.graphics.lineTo((_local1 * 0.5), (_local2 * 0.5));
mcColumn.graphics.lineTo((-(_local1) * 0.5), (_local2 * 0.5));
mcColumn.graphics.lineTo((-(_local1) * 0.5), (-(_local2) * 0.5));
mcColumn.graphics.endFill();
transformColumn(nColumnAngle);
nStartX = (((-(nColumnX) * nTileSize) * _nScale) * 0.5);
nStartY = (((-(nColumnY) * nTileSize) * _nScale) * 0.5);
nTileHalf = ((nTileSize * 0.5) * _nScale);
}
function rotateColumn(_arg1:Event){
var _local2:* = (90 / nMaxStep);
if (sDirection == "left"){
nColumnAngle = (nColumnAngle - _local2);
transformColumn(nColumnAngle);
} else {
if (sDirection == "right"){
nColumnAngle = (nColumnAngle + _local2);
transformColumn(nColumnAngle);
};
};
showAllTiles();
nStep++;
if (nStep >= (nMaxStep / 2)){
sorts(aTiles);
};
if (nStep == nMaxStep){
nStep = 0;
mcColumn.removeEventListener(Event.ENTER_FRAME, rotateColumn);
_bIsRotate = true;
sorts(aTiles);
};
}
function sorts(_arg1:Array):Array{
var temp:CTile;
var kZ:Number;
var tZ:Number;
var k:*;
var arr = _arg1;
if ((((arr == null)) || ((arr.length == 0)))){
return ([]);
};
var n:* = 0;
while (n < arr.length) {
k = 0;
while (k < ((arr.length - n) - 1)) {
if (((!((arr[k] is CTile))) || (!((arr[(k + 1)] is CTile))))){
} else {
try {
kZ = ((arr[k].oColumn.z * 1000) + (Math.floor(arr[k].y) * 10));
tZ = ((arr[(k + 1)].oColumn.z * 1000) + (Math.floor(arr[(k + 1)].y) * 10));
if (kZ > tZ){
_mcParent.swapChildren(arr[k], arr[(k + 1)]);
temp = arr[k];
arr[k] = arr[(k + 1)];
arr[(k + 1)] = temp;
};
} catch(e) {
trace(e);
trace(("arr[k+1] = " + arr[(k + 1)]), arr[k].name, arr[(k + 1)].parent);
trace("arr[k] = ", arr[k], arr[k].name, arr[k].parent);
trace(((("arr.length = " + arr.length) + ", k = ") + k));
};
};
k = (k + 1);
};
n = (n + 1);
};
return (arr);
}
private function fnMCClear(_arg1:Event):void{
var _local2:MovieClip = (_arg1.currentTarget as MovieClip);
if (_local2.currentFrame == _local2.totalFrames){
_local2.removeEventListener(Event.ENTER_FRAME, fnMCClear);
mStage.addChild(_local2);
};
}
private function isCanClear(_arg1:int, _arg2:int, _arg3:int):Boolean{
var _local4:Boolean;
var _local5:Boolean;
var _local6:Boolean;
var _local7:Boolean;
var _local8:Boolean;
var _local9:Boolean;
var _local10:Boolean;
if (aColumn[((((_arg1 + ":") + _arg2) + ":") + _arg3)] == null){
return (false);
};
if (_arg1 > 0){
if (aColumn[(((((_arg1 - 1) + ":") + _arg2) + ":") + _arg3)] != null){
_local9 = true;
};
};
if (_arg1 < (nColumnX - 1)){
if (aColumn[(((((_arg1 + 1) + ":") + _arg2) + ":") + _arg3)] != null){
_local10 = true;
};
};
if (_arg2 > 0){
if (aColumn[((((_arg1 + ":") + (_arg2 - 1)) + ":") + _arg3)] != null){
_local6 = true;
};
};
if (_arg2 < (nColumnY - 1)){
if (aColumn[((((_arg1 + ":") + (_arg2 + 1)) + ":") + _arg3)] != null){
_local5 = true;
};
};
if (_arg3 > 0){
if (aColumn[((((_arg1 + ":") + _arg2) + ":") + (_arg3 - 1))] != null){
_local7 = true;
};
};
if (_arg3 < (nColumnZ - 1)){
if (aColumn[((((_arg1 + ":") + _arg2) + ":") + (_arg3 + 1))] != null){
_local8 = true;
};
};
if (((((((_local5) && (_local6))) || (((_local7) && (_local8))))) || (((_local9) && (_local10))))){
_local4 = false;
} else {
_local4 = true;
};
return (_local4);
}
private function tileOver(_arg1:MouseEvent):void{
if (((((isEnd) || (isPause))) || (isNextLevel))){
return;
};
var _local2:CTile = (_arg1.currentTarget as CTile);
if (isClickMC2){
mRoot.mc1.visible = true;
mRoot.mc1.gotoAndStop(_local2.currentFrame);
} else {
mRoot.mc2.visible = true;
mRoot.mc2.gotoAndStop(_local2.currentFrame);
};
}
private function fnScore(_arg1:Number):void{
mRoot.totalScore = (mRoot.totalScore + _arg1);
mRoot.txtScore.text = mRoot.totalScore;
}
public function initMC():void{
mRoot.mcLeftButton.useHandCursor = true;
mRoot.mcLeftButton.buttonMode = true;
mRoot.mcLeftButton.addEventListener(MouseEvent.CLICK, function (){
sDirection = "right";
if (isSound){
new RotateSound().play();
};
mcColumn.addEventListener(Event.ENTER_FRAME, rotateColumn);
});
mRoot.mcRightButton.useHandCursor = true;
mRoot.mcRightButton.buttonMode = true;
mRoot.mcRightButton.addEventListener(MouseEvent.CLICK, function (){
sDirection = "left";
if (isSound){
new RotateSound().play();
};
mcColumn.addEventListener(Event.ENTER_FRAME, rotateColumn);
});
mRoot.mcSound.buttonMode = true;
mRoot.mcSound.addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent){
if (mRoot.mcSound.currentFrame == 1){
isSound = false;
mRoot.mcSound.nextFrame();
} else {
isSound = true;
mRoot.mcSound.prevFrame();
};
});
mRoot.mcMusic.buttonMode = true;
mRoot.mcMusic.addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent){
if (mRoot.mcMusic.currentFrame == 1){
isMusic = false;
mRoot.mcMusic.nextFrame();
SoundManager.getInstance().clear();
} else {
isMusic = true;
mRoot.mcMusic.prevFrame();
SoundManager.getInstance().startSound(Config.getBGSound(level));
};
});
mRoot.mcNextLevel.btMenu.addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent){
Main.getInstance(stage, root).destroy();
mRoot.prevFrame();
mRoot.prevFrame();
});
mRoot.mcNextLevel.btNextLevel.addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent){
var e = _arg1;
Tweener.addTween(mRoot.mcNextLevel, {y:-570, time:0.5, transition:"linear", onComplete:function (){
destroy();
isNextLevel = false;
level++;
fnShowBG();
}});
});
mRoot.btReshuff.addEventListener(MouseEvent.CLICK, function (){
shuffleTiles(true);
});
mRoot.btPause.addEventListener(MouseEvent.CLICK, function (){
fnPause(true);
});
mRoot.btStory.addEventListener(MouseEvent.CLICK, function (){
fnShowBG(true);
});
mRoot.bg.btBack.visible = false;
mRoot.bg.btSkip.visible = false;
mRoot.mcNextLevel.mcPeter.gotoAndStop(1);
arrMCLevels.push(mRoot.mcNextLevel.mcLevel1);
arrMCLevels.push(mRoot.mcNextLevel.mcLevel2);
arrMCLevels.push(mRoot.mcNextLevel.mcLevel3);
arrMCLevels.push(mRoot.mcNextLevel.mcLevel4);
arrMCLevels.push(mRoot.mcNextLevel.mcLevel5);
arrMCLevels.push(mRoot.mcNextLevel.mcLevel6);
arrMCLevels.push(mRoot.mcNextLevel.mcLevel7);
arrMCLevels.push(mRoot.mcNextLevel.mcLevel8);
arrMCLevels.push(mRoot.mcNextLevel.mcLevel9);
var i:uint;
while (i < arrMCLevels.length) {
arrMCLevels[i].gotoAndStop(1);
i = (i + 1);
};
arrMCLevelTexts.push(mRoot.mcNextLevel.mcLevelText1);
arrMCLevelTexts.push(mRoot.mcNextLevel.mcLevelText2);
arrMCLevelTexts.push(mRoot.mcNextLevel.mcLevelText3);
arrMCLevelTexts.push(mRoot.mcNextLevel.mcLevelText4);
arrMCLevelTexts.push(mRoot.mcNextLevel.mcLevelText5);
arrMCLevelTexts.push(mRoot.mcNextLevel.mcLevelText6);
arrMCLevelTexts.push(mRoot.mcNextLevel.mcLevelText7);
arrMCLevelTexts.push(mRoot.mcNextLevel.mcLevelText8);
arrMCLevelTexts.push(mRoot.mcNextLevel.mcLevelText9);
i = 0;
while (i < arrMCLevelTexts.length) {
arrMCLevelTexts[i].gotoAndStop(1);
i = (i + 1);
};
}
private function changeTiles(_arg1, _arg2):void{
var _local3:uint = _arg1.currentFrame;
_arg1.gotoAndStop(_arg2.currentFrame);
_arg2.gotoAndStop(_local3);
}
private function isReffle():Boolean{
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local1:Array = new Array();
var _local2:uint;
while (_local2 < nColumnZ) {
_local5 = 0;
while (_local5 < nColumnY) {
_local6 = 0;
while (_local6 < nColumnX) {
if (((!((aColumn[((((_local6 + ":") + _local5) + ":") + _local2)] == null))) && (isCanClear(_local6, _local5, _local2)))){
_local1.push(aColumn[((((_local6 + ":") + _local5) + ":") + _local2)]);
};
_local6++;
};
_local5++;
};
_local2++;
};
var _local3:* = _local1.length;
var _local4:uint;
while (_local4 < _local3) {
_local7 = (_local4 + 1);
while (_local7 < _local3) {
if (_local1[_local4].currentFrame == _local1[_local7].currentFrame){
return (false);
};
_local7++;
};
_local4++;
};
return (true);
}
private function tileOut(_arg1:MouseEvent):void{
if (((((isEnd) || (isPause))) || (isNextLevel))){
return;
};
if (mRoot.mc1.visible){
mRoot.mc1.visible = false;
} else {
if (!isClickMC2){
mRoot.mc2.visible = false;
};
};
}
private function end(_arg1:TimerEvent=null):void{
trace(isEnd);
if (!isEnd){
mRoot.mcTimeBorder.mcTime.gotoAndStop(25);
if (isSound){
new GameOverSound().play();
};
destroy();
isEnd = true;
mRoot.bg.visible = false;
mRoot.gotoAndStop(5);
};
}
function transformColumn(_arg1){
var _local2:Object = {x:370, y:420};
var _local3:Matrix = new Matrix();
var _local4:* = ((_arg1 / 180) * Math.PI);
_local3.rotate(_local4);
_local3.scale(1, 0.28);
_local3.translate(_local2.x, _local2.y);
mcColumn.transform.matrix = _local3;
}
private function fnShowBG(_arg1:Boolean=false):void{
var p = _arg1;
isBtStory = p;
if (isBtStory){
fnVisibleTiles(false);
TimeManager.getInstance().stop();
} else {
if (((isSound) && (!((level == Config.MAX_LEVEL))))){
if (isMusic){
SoundManager.getInstance().startSound(Config.getBGSound(level));
};
};
};
adMouseSprite(mRoot);
mRoot.swapChildren(mRoot.bg, mouseSprite);
mRoot.bg.gotoAndStop(level);
try {
mRoot.bg.mcSBG.visible = true;
} catch(e) {
trace(e, mRoot.bg.mcSBG);
};
if (isBtStory){
mRoot.bg.btBack.visible = true;
} else {
mRoot.bg.btSkip.visible = true;
};
mRoot.bg.btSkip.addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent){
if (!_arg1.currentTarget.visible){
return;
};
if (timeOutId != 0){
clearTimeout(timeOutId);
timeOutId = 0;
};
if (level != Config.MAX_LEVEL){
fnSkip();
} else {
end();
};
});
mRoot.bg.btBack.addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent){
if (!_arg1.currentTarget.visible){
return;
};
if (timeOutId != 0){
clearTimeout(timeOutId);
timeOutId = 0;
};
mRoot.bg.mcSBG.visible = false;
fnSkip();
});
if (level == 1){
mRoot.bg.txtStory2.text = Config.getBGMessage(level);
timeOutId = setTimeout(fnSkip, 8000);
} else {
mRoot.bg.txtStory2.text = "";
mRoot.bg.txtStory.text = Config.getBGMessage(level);
if (level == Config.MAX_LEVEL){
timeOutId = setTimeout(function (){
clearTimeout(timeOutId);
timeOutId = 0;
mRoot.swapChildren(mRoot.bg, mouseSprite);
rmMouseSprite();
end();
}, 4000);
} else {
timeOutId = setTimeout(fnSkip, 7000);
};
};
}
public function destroy():void{
var _local1:*;
TimeManager.getInstance().clear();
if (scoreTimer != null){
scoreTimer.removeEventListener(TimerEvent.TIMER, updateScore);
scoreTimer.stop();
scoreTimer = null;
};
for (_local1 in aColumn) {
if (aColumn[_local1] != null){
_mcParent.removeChild(aColumn[_local1]);
aColumn[_local1] = null;
};
};
aColumn = [];
aTiles = [];
if (mcColumn != null){
_mcParent.removeChild(mcColumn);
mcColumn = null;
};
nColumnAngle = 52;
nMaxStep = 10;
nStep = 0;
_bIsRotate = false;
sDirection = "right";
mcColumn = null;
moreClick = 0;
currentTime = 0;
preTile = null;
mRoot.mc1.visible = false;
mRoot.mc2.visible = false;
isClickMC2 = false;
isEnd = false;
isPause = false;
isNextLevel = false;
}
private function updateTimer(_arg1:TimerEvent){
currentTime--;
if (currentTime > 0){
mRoot.mcTimeBorder.mcTime.gotoAndStop((25 - Math.floor(((currentTime / Config.getTime(level)) * 25))));
mRoot.txtTime.text = TimeUtil.convertTime(currentTime);
if (currentTime <= 10){
if (isSound){
new ClockSound().play();
};
};
} else {
end();
};
}
public static function getInstance(_arg1:Stage, _arg2=null):Main{
if (Main.instance == null){
Main.instance = new (Main);
Main.instance.initBase(_arg1, _arg2);
};
return (Main.instance);
}
}
}//package
Section 50
//MainSound (MainSound)
package {
import flash.media.*;
public dynamic class MainSound extends Sound {
}
}//package
Section 51
//MCBg (MCBg)
package {
import flash.utils.*;
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
public dynamic class MCBg extends MovieClip {
public var mcSBG:MovieClip;
public var txtStory:TextField;
public var txtStory2:TextField;
public var btSkip:SimpleButton;
public var tbSkip:MovieClip;
public var btBack:SimpleButton;
public function MCBg(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 52
//MCClear (MCClear)
package {
import flash.utils.*;
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
public dynamic class MCClear extends MovieClip {
public function MCClear(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package
Section 53
//MCNextScore (MCNextScore)
package {
import flash.display.*;
import flash.text.*;
public dynamic class MCNextScore extends MovieClip {
public var txtScore:TextField;
}
}//package
Section 54
//MCPause (MCPause)
package {
import flash.display.*;
public dynamic class MCPause extends MovieClip {
public var btContinue:SimpleButton;
}
}//package
Section 55
//MCReshuffle (MCReshuffle)
package {
import flash.display.*;
import flash.text.*;
public dynamic class MCReshuffle extends MovieClip {
public var txtScore:TextField;
}
}//package
Section 56
//RightClickSound (RightClickSound)
package {
import flash.media.*;
public dynamic class RightClickSound extends Sound {
}
}//package
Section 57
//RotateSound (RotateSound)
package {
import flash.media.*;
public dynamic class RotateSound extends Sound {
}
}//package
Section 58
//WrongClickSound (WrongClickSound)
package {
import flash.media.*;
public dynamic class WrongClickSound extends Sound {
}
}//package