Section 1
//but_glos_11 (balance_fla.but_glos_11)
package balance_fla {
import flash.display.*;
public dynamic class but_glos_11 extends MovieClip {
public function but_glos_11(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package balance_fla
Section 2
//but_x_12 (balance_fla.but_x_12)
package balance_fla {
import flash.display.*;
public dynamic class but_x_12 extends MovieClip {
public function but_x_12(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package balance_fla
Section 3
//but1_48 (balance_fla.but1_48)
package balance_fla {
import flash.display.*;
public dynamic class but1_48 extends MovieClip {
public var n1:MovieClip;
public function but1_48(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package balance_fla
Section 4
//but1kopia3_46 (balance_fla.but1kopia3_46)
package balance_fla {
import flash.display.*;
public dynamic class but1kopia3_46 extends MovieClip {
public var n1:MovieClip;
public function but1kopia3_46(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package balance_fla
Section 5
//but1kopia4_44 (balance_fla.but1kopia4_44)
package balance_fla {
import flash.display.*;
public dynamic class but1kopia4_44 extends MovieClip {
public var n1:MovieClip;
public function but1kopia4_44(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package balance_fla
Section 6
//logo_menu_2 (balance_fla.logo_menu_2)
package balance_fla {
import flash.display.*;
public dynamic class logo_menu_2 extends MovieClip {
public function logo_menu_2(){
addFrameScript(48, frame49);
}
function frame49(){
stop();
}
}
}//package balance_fla
Section 7
//mc_close_5 (balance_fla.mc_close_5)
package balance_fla {
import flash.display.*;
public dynamic class mc_close_5 extends MovieClip {
public function mc_close_5(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package balance_fla
Section 8
//mc_diff_15 (balance_fla.mc_diff_15)
package balance_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_diff_15 extends MovieClip {
public var tf_diff:TextField;
}
}//package balance_fla
Section 9
//mc_diffkopia_16 (balance_fla.mc_diffkopia_16)
package balance_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_diffkopia_16 extends MovieClip {
public var tf_diff:TextField;
public function mc_diffkopia_16(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package balance_fla
Section 10
//mc_left_arrow_13 (balance_fla.mc_left_arrow_13)
package balance_fla {
import flash.display.*;
public dynamic class mc_left_arrow_13 extends MovieClip {
public function mc_left_arrow_13(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package balance_fla
Section 11
//mc_leng_50 (balance_fla.mc_leng_50)
package balance_fla {
import flash.display.*;
public dynamic class mc_leng_50 extends MovieClip {
public var n1:MovieClip;
public function mc_leng_50(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package balance_fla
Section 12
//mc_logo_noba_7 (balance_fla.mc_logo_noba_7)
package balance_fla {
import flash.display.*;
public dynamic class mc_logo_noba_7 extends MovieClip {
public function mc_logo_noba_7(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package balance_fla
Section 13
//mc_play1_49 (balance_fla.mc_play1_49)
package balance_fla {
import flash.display.*;
public dynamic class mc_play1_49 extends MovieClip {
public function mc_play1_49(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package balance_fla
Section 14
//mc_play1kopia_47 (balance_fla.mc_play1kopia_47)
package balance_fla {
import flash.display.*;
public dynamic class mc_play1kopia_47 extends MovieClip {
public function mc_play1kopia_47(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package balance_fla
Section 15
//mc_play1kopia2_45 (balance_fla.mc_play1kopia2_45)
package balance_fla {
import flash.display.*;
public dynamic class mc_play1kopia2_45 extends MovieClip {
public function mc_play1kopia2_45(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package balance_fla
Section 16
//mc_popupxx_3 (balance_fla.mc_popupxx_3)
package balance_fla {
import flash.display.*;
public dynamic class mc_popupxx_3 extends MovieClip {
public var btn_close:MovieClip;
public function mc_popupxx_3(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package balance_fla
Section 17
//mc_rightaroow_14 (balance_fla.mc_rightaroow_14)
package balance_fla {
import flash.display.*;
public dynamic class mc_rightaroow_14 extends MovieClip {
public function mc_rightaroow_14(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package balance_fla
Section 18
//mc_tries_17 (balance_fla.mc_tries_17)
package balance_fla {
import flash.display.*;
public dynamic class mc_tries_17 extends MovieClip {
public var n1:MovieClip;
}
}//package balance_fla
Section 19
//mc_ui_text_19 (balance_fla.mc_ui_text_19)
package balance_fla {
import flash.display.*;
public dynamic class mc_ui_text_19 extends MovieClip {
public function mc_ui_text_19(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package balance_fla
Section 20
//n1_51 (balance_fla.n1_51)
package balance_fla {
import flash.display.*;
public dynamic class n1_51 extends MovieClip {
public function n1_51(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package balance_fla
Section 21
//UserInterface_10 (balance_fla.UserInterface_10)
package balance_fla {
import flash.display.*;
import flash.text.*;
public dynamic class UserInterface_10 extends MovieClip {
public var mc_diff2:MovieClip;
public var mc_diff1:MovieClip;
public var tf_right:TextField;
public var mc_text:MovieClip;
public var tf_points:TextField;
public var btn_sound:MovieClip;
public var tf_level:TextField;
public var mc_rightArrow:MovieClip;
public var mc_trial2:MovieClip;
public var mc_trial1:MovieClip;
public var mc_trial0:MovieClip;
public var tf_left:TextField;
public var mc_leftArrow:MovieClip;
public var tf_lifes:TextField;
public var btn_btm:MovieClip;
}
}//package balance_fla
Section 22
//AuxFunctions (caurina.transitions.AuxFunctions)
package caurina.transitions {
public class AuxFunctions {
public static function getObjectLength(_arg1:Object):uint{
var _local2:uint;
var _local3:String;
_local2 = 0;
for (_local3 in _arg1) {
_local2++;
};
return (_local2);
}
public static function numberToG(_arg1:Number):Number{
return (((_arg1 & 0xFF00) >> 8));
}
public static function numberToB(_arg1:Number):Number{
return ((_arg1 & 0xFF));
}
public static function numberToR(_arg1:Number):Number{
return (((_arg1 & 0xFF0000) >> 16));
}
public static function concatObjects(... _args):Object{
var _local2:Object;
var _local3:Object;
var _local4:int;
var _local5:String;
_local2 = {};
_local4 = 0;
while (_local4 < _args.length) {
_local3 = _args[_local4];
for (_local5 in _local3) {
if (_local3[_local5] == null){
delete _local2[_local5];
} else {
_local2[_local5] = _local3[_local5];
};
};
_local4++;
};
return (_local2);
}
}
}//package caurina.transitions
Section 23
//Equations (caurina.transitions.Equations)
package caurina.transitions {
public class Equations {
public function Equations(){
trace("Equations is a static class and should not be instantiated.");
}
public static function easeOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeInOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
var _local7:Number;
var _local8:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * (0.3 * 1.5)) : _arg5.period;
_local8 = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2));
};
--_arg1;
return ((((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) * 0.5) + _arg3) + _arg2));
}
public static function easeInOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
public static function easeInOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeInBounce((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOutBounce(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
public static function easeInOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_local6 = (_local6 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_local6 + 1) * _arg1) - _local6))) + _arg2));
};
_arg1 = (_arg1 - 2);
_local6 = (_local6 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 2)) + _arg2));
}
public static function easeOutInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCubic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInCubic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 1)) + _arg2));
}
public static function easeInOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
public static function easeInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_local6 + 1) * _arg1) - _local6)) + _arg2));
}
public static function easeInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeOutInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuint((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuint(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBounce((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBounce(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function init():void{
Tweener.registerTransition("easenone", easeNone);
Tweener.registerTransition("linear", easeNone);
Tweener.registerTransition("easeinquad", easeInQuad);
Tweener.registerTransition("easeoutquad", easeOutQuad);
Tweener.registerTransition("easeinoutquad", easeInOutQuad);
Tweener.registerTransition("easeoutinquad", easeOutInQuad);
Tweener.registerTransition("easeincubic", easeInCubic);
Tweener.registerTransition("easeoutcubic", easeOutCubic);
Tweener.registerTransition("easeinoutcubic", easeInOutCubic);
Tweener.registerTransition("easeoutincubic", easeOutInCubic);
Tweener.registerTransition("easeinquart", easeInQuart);
Tweener.registerTransition("easeoutquart", easeOutQuart);
Tweener.registerTransition("easeinoutquart", easeInOutQuart);
Tweener.registerTransition("easeoutinquart", easeOutInQuart);
Tweener.registerTransition("easeinquint", easeInQuint);
Tweener.registerTransition("easeoutquint", easeOutQuint);
Tweener.registerTransition("easeinoutquint", easeInOutQuint);
Tweener.registerTransition("easeoutinquint", easeOutInQuint);
Tweener.registerTransition("easeinsine", easeInSine);
Tweener.registerTransition("easeoutsine", easeOutSine);
Tweener.registerTransition("easeinoutsine", easeInOutSine);
Tweener.registerTransition("easeoutinsine", easeOutInSine);
Tweener.registerTransition("easeincirc", easeInCirc);
Tweener.registerTransition("easeoutcirc", easeOutCirc);
Tweener.registerTransition("easeinoutcirc", easeInOutCirc);
Tweener.registerTransition("easeoutincirc", easeOutInCirc);
Tweener.registerTransition("easeinexpo", easeInExpo);
Tweener.registerTransition("easeoutexpo", easeOutExpo);
Tweener.registerTransition("easeinoutexpo", easeInOutExpo);
Tweener.registerTransition("easeoutinexpo", easeOutInExpo);
Tweener.registerTransition("easeinelastic", easeInElastic);
Tweener.registerTransition("easeoutelastic", easeOutElastic);
Tweener.registerTransition("easeinoutelastic", easeInOutElastic);
Tweener.registerTransition("easeoutinelastic", easeOutInElastic);
Tweener.registerTransition("easeinback", easeInBack);
Tweener.registerTransition("easeoutback", easeOutBack);
Tweener.registerTransition("easeinoutback", easeInOutBack);
Tweener.registerTransition("easeoutinback", easeOutInBack);
Tweener.registerTransition("easeinbounce", easeInBounce);
Tweener.registerTransition("easeoutbounce", easeOutBounce);
Tweener.registerTransition("easeinoutbounce", easeInOutBounce);
Tweener.registerTransition("easeoutinbounce", easeOutInBounce);
}
public static function easeOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg1)==_arg4) ? (_arg2 + _arg3) : (((_arg3 * 1.001) * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2));
}
public static function easeOutInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBack((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBack(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg1)==0) ? _arg2 : (((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2) - (_arg3 * 0.001)));
}
public static function easeInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2));
}
public static function easeInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg3 - easeOutBounce((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeOutInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutExpo((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInExpo(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((-(_arg3) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2));
}
public static function easeInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2));
}
public static function easeInOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 2)) + _arg2));
}
public static function easeOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeOutInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutElastic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInElastic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
var _local7:Number;
var _local8:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
_local8 = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
--_arg1;
return ((-(((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2));
}
public static function easeOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuad((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuad(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2));
}
public static function easeInOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
}
public static function easeOutInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutSine((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInSine(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 == 0){
return (_arg2);
};
if (_arg1 == _arg4){
return ((_arg2 + _arg3));
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2) - (_arg3 * 0.0005)));
};
--_arg1;
return (((((_arg3 / 2) * 1.0005) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2));
}
public static function easeOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
var _local7:Number;
var _local8:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
_local8 = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
return (((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) + _arg3) + _arg2));
}
public static function easeOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
}
public static function easeOutInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuart((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuart(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCirc((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInCirc(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
}
}//package caurina.transitions
Section 24
//PropertyInfoObj (caurina.transitions.PropertyInfoObj)
package caurina.transitions {
public class PropertyInfoObj {
public var originalValueComplete:Object;
public var modifierParameters:Array;
public var isSpecialProperty:Boolean;
public var hasModifier:Boolean;
public var valueComplete:Number;
public var extra:Object;
public var valueStart:Number;
public var modifierFunction:Function;
public var arrayIndex:Number;
public function PropertyInfoObj(_arg1:Number, _arg2:Number, _arg3:Object, _arg4:Number, _arg5:Object, _arg6:Boolean, _arg7:Function, _arg8:Array){
valueStart = _arg1;
valueComplete = _arg2;
originalValueComplete = _arg3;
arrayIndex = _arg4;
extra = _arg5;
isSpecialProperty = _arg6;
hasModifier = Boolean(_arg7);
modifierFunction = _arg7;
modifierParameters = _arg8;
}
public function toString():String{
var _local1:String;
_local1 = "\n[PropertyInfoObj ";
_local1 = (_local1 + ("valueStart:" + String(valueStart)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("valueComplete:" + String(valueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("originalValueComplete:" + String(originalValueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("arrayIndex:" + String(arrayIndex)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("extra:" + String(extra)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("isSpecialProperty:" + String(isSpecialProperty)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("hasModifier:" + String(hasModifier)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierFunction:" + String(modifierFunction)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierParameters:" + String(modifierParameters)));
_local1 = (_local1 + "]\n");
return (_local1);
}
public function clone():PropertyInfoObj{
var _local1:PropertyInfoObj;
_local1 = new PropertyInfoObj(valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, modifierFunction, modifierParameters);
return (_local1);
}
}
}//package caurina.transitions
Section 25
//SpecialProperty (caurina.transitions.SpecialProperty)
package caurina.transitions {
public class SpecialProperty {
public var parameters:Array;
public var preProcess:Function;
public var setValue:Function;
public var getValue:Function;
public function SpecialProperty(_arg1:Function, _arg2:Function, _arg3:Array=null, _arg4:Function=null){
getValue = _arg1;
setValue = _arg2;
parameters = _arg3;
preProcess = _arg4;
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + "[SpecialProperty ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("setValue:" + String(setValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("preProcess:" + String(preProcess)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 26
//SpecialPropertyModifier (caurina.transitions.SpecialPropertyModifier)
package caurina.transitions {
public class SpecialPropertyModifier {
public var getValue:Function;
public var modifyValues:Function;
public function SpecialPropertyModifier(_arg1:Function, _arg2:Function){
modifyValues = _arg1;
getValue = _arg2;
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + "[SpecialPropertyModifier ");
_local1 = (_local1 + ("modifyValues:" + String(modifyValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 27
//SpecialPropertySplitter (caurina.transitions.SpecialPropertySplitter)
package caurina.transitions {
public class SpecialPropertySplitter {
public var parameters:Array;
public var splitValues:Function;
public function SpecialPropertySplitter(_arg1:Function, _arg2:Array){
splitValues = _arg1;
parameters = _arg2;
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + "[SpecialPropertySplitter ");
_local1 = (_local1 + ("splitValues:" + String(splitValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 28
//Tweener (caurina.transitions.Tweener)
package caurina.transitions {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Tweener {
private static var _timeScale:Number = 1;
private static var _currentTimeFrame:Number;
private static var _specialPropertySplitterList:Object;
public static var autoOverwrite:Boolean = true;
private static var _engineExists:Boolean = false;
private static var _currentTime:Number;
private static var _tweenList:Array;
private static var _specialPropertyModifierList:Object;
private static var _specialPropertyList:Object;
private static var _transitionList:Object;
private static var _inited:Boolean = false;
private static var __tweener_controller__:MovieClip;
public function Tweener(){
trace("Tweener is a static class and should not be instantiated.");
}
public static function registerSpecialPropertyModifier(_arg1:String, _arg2:Function, _arg3:Function):void{
var _local4:SpecialPropertyModifier;
if (!_inited){
init();
};
_local4 = new SpecialPropertyModifier(_arg2, _arg3);
_specialPropertyModifierList[_arg1] = _local4;
}
public static function registerSpecialProperty(_arg1:String, _arg2:Function, _arg3:Function, _arg4:Array=null, _arg5:Function=null):void{
var _local6:SpecialProperty;
if (!_inited){
init();
};
_local6 = new SpecialProperty(_arg2, _arg3, _arg4, _arg5);
_specialPropertyList[_arg1] = _local6;
}
public static function init(... _args):void{
_inited = true;
_transitionList = new Object();
Equations.init();
_specialPropertyList = new Object();
_specialPropertyModifierList = new Object();
_specialPropertySplitterList = new Object();
}
private static function updateTweens():Boolean{
var _local1:int;
if (_tweenList.length == 0){
return (false);
};
_local1 = 0;
while (_local1 < _tweenList.length) {
if ((((_tweenList[_local1] == undefined)) || (!(_tweenList[_local1].isPaused)))){
if (!updateTweenByIndex(_local1)){
removeTweenByIndex(_local1);
};
if (_tweenList[_local1] == null){
removeTweenByIndex(_local1, true);
_local1--;
};
};
_local1++;
};
return (true);
}
public static function addCaller(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local3:Number;
var _local4:Array;
var _local5:Object;
var _local6:Number;
var _local7:Number;
var _local8:Function;
var _local9:TweenListObj;
var _local10:Number;
var _local11:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local4 = _arg1.concat();
} else {
_local4 = [_arg1];
};
_local5 = _arg2;
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
_local6 = (isNaN(_local5.time)) ? 0 : _local5.time;
_local7 = (isNaN(_local5.delay)) ? 0 : _local5.delay;
if (typeof(_local5.transition) == "string"){
_local11 = _local5.transition.toLowerCase();
_local8 = _transitionList[_local11];
} else {
_local8 = _local5.transition;
};
if (!Boolean(_local8)){
_local8 = _transitionList["easeoutexpo"];
};
_local3 = 0;
while (_local3 < _local4.length) {
if (_local5.useFrames == true){
_local9 = new TweenListObj(_local4[_local3], (_currentTimeFrame + (_local7 / _timeScale)), (_currentTimeFrame + ((_local7 + _local6) / _timeScale)), true, _local8, _local5.transitionParams);
} else {
_local9 = new TweenListObj(_local4[_local3], (_currentTime + ((_local7 * 1000) / _timeScale)), (_currentTime + (((_local7 * 1000) + (_local6 * 1000)) / _timeScale)), false, _local8, _local5.transitionParams);
};
_local9.properties = null;
_local9.onStart = _local5.onStart;
_local9.onUpdate = _local5.onUpdate;
_local9.onComplete = _local5.onComplete;
_local9.onOverwrite = _local5.onOverwrite;
_local9.onStartParams = _local5.onStartParams;
_local9.onUpdateParams = _local5.onUpdateParams;
_local9.onCompleteParams = _local5.onCompleteParams;
_local9.onOverwriteParams = _local5.onOverwriteParams;
_local9.onStartScope = _local5.onStartScope;
_local9.onUpdateScope = _local5.onUpdateScope;
_local9.onCompleteScope = _local5.onCompleteScope;
_local9.onOverwriteScope = _local5.onOverwriteScope;
_local9.onErrorScope = _local5.onErrorScope;
_local9.isCaller = true;
_local9.count = _local5.count;
_local9.waitFrames = _local5.waitFrames;
_tweenList.push(_local9);
if ((((_local6 == 0)) && ((_local7 == 0)))){
_local10 = (_tweenList.length - 1);
updateTweenByIndex(_local10);
removeTweenByIndex(_local10);
};
_local3++;
};
return (true);
}
public static function pauseAllTweens():Boolean{
var _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_local2 = 0;
while (_local2 < _tweenList.length) {
pauseTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function removeTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
var _local5:SpecialPropertySplitter;
var _local6:Array;
var _local7:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){
if (_specialPropertySplitterList[_args[_local4]]){
_local5 = _specialPropertySplitterList[_args[_local4]];
_local6 = _local5.splitValues(_arg1, null);
_local7 = 0;
while (_local7 < _local6.length) {
_local3.push(_local6[_local7].name);
_local7++;
};
} else {
_local3.push(_args[_local4]);
};
};
_local4++;
};
return (affectTweens(removeTweenByIndex, _arg1, _local3));
}
public static function updateFrame():void{
_currentTimeFrame++;
}
public static function splitTweens(_arg1:Number, _arg2:Array):uint{
var _local3:TweenListObj;
var _local4:TweenListObj;
var _local5:uint;
var _local6:String;
var _local7:Boolean;
_local3 = _tweenList[_arg1];
_local4 = _local3.clone(false);
_local5 = 0;
while (_local5 < _arg2.length) {
_local6 = _arg2[_local5];
if (Boolean(_local3.properties[_local6])){
_local3.properties[_local6] = undefined;
delete _local3.properties[_local6];
};
_local5++;
};
for (_local6 in _local4.properties) {
_local7 = false;
_local5 = 0;
while (_local5 < _arg2.length) {
if (_arg2[_local5] == _local6){
_local7 = true;
break;
};
_local5++;
};
if (!_local7){
_local4.properties[_local6] = undefined;
delete _local4.properties[_local6];
};
};
_tweenList.push(_local4);
return ((_tweenList.length - 1));
}
public static function resumeTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj;
var _local3:Number;
_local2 = _tweenList[_arg1];
if ((((_local2 == null)) || (!(_local2.isPaused)))){
return (false);
};
_local3 = getCurrentTweeningTime(_local2);
_local2.timeStart = (_local2.timeStart + (_local3 - _local2.timePaused));
_local2.timeComplete = (_local2.timeComplete + (_local3 - _local2.timePaused));
_local2.timePaused = undefined;
_local2.isPaused = false;
return (true);
}
public static function getVersion():String{
return ("AS3 1.33.74");
}
public static function onEnterFrame(_arg1:Event):void{
var _local2:Boolean;
updateTime();
updateFrame();
_local2 = false;
_local2 = updateTweens();
if (!_local2){
stopEngine();
};
}
public static function updateTime():void{
_currentTime = getTimer();
}
private static function updateTweenByIndex(_arg1:Number):Boolean{
var tTweening:TweenListObj;
var isOver:Boolean;
var mustUpdate:Boolean;
var nv:Number;
var t:Number;
var b:Number;
var c:Number;
var d:Number;
var pName:String;
var eventScope:Object;
var tScope:Object;
var cTime:Number;
var tProperty:Object;
var pv:Number;
var i = _arg1;
tTweening = _tweenList[i];
if ((((tTweening == null)) || (!(Boolean(tTweening.scope))))){
return (false);
};
isOver = false;
cTime = getCurrentTweeningTime(tTweening);
if (cTime >= tTweening.timeStart){
tScope = tTweening.scope;
if (tTweening.isCaller){
do {
t = (((tTweening.timeComplete - tTweening.timeStart) / tTweening.count) * (tTweening.timesCalled + 1));
b = tTweening.timeStart;
c = (tTweening.timeComplete - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d);
} while (!(cTime >= nv));
} else {
mustUpdate = (((((tTweening.skipUpdates < 1)) || (!(tTweening.skipUpdates)))) || ((tTweening.updatesSkipped >= tTweening.skipUpdates)));
if (cTime >= tTweening.timeComplete){
isOver = true;
mustUpdate = true;
};
if (!tTweening.hasStarted){
if (Boolean(tTweening.onStart)){
eventScope = (Boolean(tTweening.onStartScope)) ? tTweening.onStartScope : tScope;
try {
tTweening.onStart.apply(eventScope, tTweening.onStartParams);
} catch(e2:Error) {
handleError(tTweening, e2, "onStart");
};
};
for (pName in tTweening.properties) {
if (tTweening.properties[pName].isSpecialProperty){
if (Boolean(_specialPropertyList[pName].preProcess)){
tTweening.properties[pName].valueComplete = _specialPropertyList[pName].preProcess(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].originalValueComplete, tTweening.properties[pName].extra);
};
pv = _specialPropertyList[pName].getValue(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
pv = tScope[pName];
};
tTweening.properties[pName].valueStart = (isNaN(pv)) ? tTweening.properties[pName].valueComplete : pv;
};
mustUpdate = true;
tTweening.hasStarted = true;
};
if (mustUpdate){
for (pName in tTweening.properties) {
tProperty = tTweening.properties[pName];
if (isOver){
nv = tProperty.valueComplete;
} else {
if (tProperty.hasModifier){
t = (cTime - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, 0, 1, d, tTweening.transitionParams);
nv = tProperty.modifierFunction(tProperty.valueStart, tProperty.valueComplete, nv, tProperty.modifierParameters);
} else {
t = (cTime - tTweening.timeStart);
b = tProperty.valueStart;
c = (tProperty.valueComplete - tProperty.valueStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d, tTweening.transitionParams);
};
};
if (tTweening.rounded){
nv = Math.round(nv);
};
if (tProperty.isSpecialProperty){
_specialPropertyList[pName].setValue(tScope, nv, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
tScope[pName] = nv;
};
};
tTweening.updatesSkipped = 0;
if (Boolean(tTweening.onUpdate)){
eventScope = (Boolean(tTweening.onUpdateScope)) ? tTweening.onUpdateScope : tScope;
try {
tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams);
} catch(e3:Error) {
handleError(tTweening, e3, "onUpdate");
};
};
} else {
tTweening.updatesSkipped++;
};
};
if (((isOver) && (Boolean(tTweening.onComplete)))){
eventScope = (Boolean(tTweening.onCompleteScope)) ? tTweening.onCompleteScope : tScope;
try {
tTweening.onComplete.apply(eventScope, tTweening.onCompleteParams);
} catch(e4:Error) {
handleError(tTweening, e4, "onComplete");
};
};
return (!(isOver));
};
return (true);
}
public static function setTimeScale(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (isNaN(_arg1)){
_arg1 = 1;
};
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
if (_arg1 != _timeScale){
if (_tweenList != null){
_local2 = 0;
while (_local2 < _tweenList.length) {
_local3 = getCurrentTweeningTime(_tweenList[_local2]);
_tweenList[_local2].timeStart = (_local3 - (((_local3 - _tweenList[_local2].timeStart) * _timeScale) / _arg1));
_tweenList[_local2].timeComplete = (_local3 - (((_local3 - _tweenList[_local2].timeComplete) * _timeScale) / _arg1));
if (_tweenList[_local2].timePaused != undefined){
_tweenList[_local2].timePaused = (_local3 - (((_local3 - _tweenList[_local2].timePaused) * _timeScale) / _arg1));
};
_local2++;
};
};
_timeScale = _arg1;
};
}
public static function resumeAllTweens():Boolean{
var _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_local2 = 0;
while (_local2 < _tweenList.length) {
resumeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
private static function handleError(_arg1:TweenListObj, _arg2:Error, _arg3:String):void{
var eventScope:Object;
var pTweening = _arg1;
var pError = _arg2;
var pCallBackName = _arg3;
if (((Boolean(pTweening.onError)) && ((pTweening.onError is Function)))){
eventScope = (Boolean(pTweening.onErrorScope)) ? pTweening.onErrorScope : pTweening.scope;
try {
pTweening.onError.apply(eventScope, [pTweening.scope, pError]);
} catch(metaError:Error) {
printError(((((String(pTweening.scope) + " raised an error while executing the 'onError' handler. Original error:\n ") + pError.getStackTrace()) + "\nonError error: ") + metaError.getStackTrace()));
};
} else {
if (!Boolean(pTweening.onError)){
printError(((((String(pTweening.scope) + " raised an error while executing the '") + pCallBackName) + "'handler. \n") + pError.getStackTrace()));
};
};
}
private static function startEngine():void{
_engineExists = true;
_tweenList = new Array();
__tweener_controller__ = new MovieClip();
__tweener_controller__.addEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
_currentTimeFrame = 0;
updateTime();
}
public static function removeAllTweens():Boolean{
var _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_local2 = 0;
while (_local2 < _tweenList.length) {
removeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function addTween(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local3:Number;
var _local4:Number;
var _local5:String;
var _local6:Array;
var _local7:Object;
var _local8:Number;
var _local9:Number;
var _local10:Array;
var _local11:Object;
var _local12:Object;
var _local13:Function;
var _local14:Object;
var _local15:TweenListObj;
var _local16:Number;
var _local17:Array;
var _local18:Array;
var _local19:Array;
var _local20:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local6 = _arg1.concat();
} else {
_local6 = [_arg1];
};
_local7 = TweenListObj.makePropertiesChain(_arg2);
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
_local8 = (isNaN(_local7.time)) ? 0 : _local7.time;
_local9 = (isNaN(_local7.delay)) ? 0 : _local7.delay;
_local10 = new Array();
_local11 = {overwrite:true, time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, transitionParams:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, onError:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams:true, onStartScope:true, onUpdateScope:true, onCompleteScope:true, onOverwriteScope:true, onErrorScope:true};
_local12 = new Object();
for (_local5 in _local7) {
if (!_local11[_local5]){
if (_specialPropertySplitterList[_local5]){
_local17 = _specialPropertySplitterList[_local5].splitValues(_local7[_local5], _specialPropertySplitterList[_local5].parameters);
_local3 = 0;
while (_local3 < _local17.length) {
if (_specialPropertySplitterList[_local17[_local3].name]){
_local18 = _specialPropertySplitterList[_local17[_local3].name].splitValues(_local17[_local3].value, _specialPropertySplitterList[_local17[_local3].name].parameters);
_local4 = 0;
while (_local4 < _local18.length) {
_local10[_local18[_local4].name] = {valueStart:undefined, valueComplete:_local18[_local4].value, arrayIndex:_local18[_local4].arrayIndex, isSpecialProperty:false};
_local4++;
};
} else {
_local10[_local17[_local3].name] = {valueStart:undefined, valueComplete:_local17[_local3].value, arrayIndex:_local17[_local3].arrayIndex, isSpecialProperty:false};
};
_local3++;
};
} else {
if (_specialPropertyModifierList[_local5] != undefined){
_local19 = _specialPropertyModifierList[_local5].modifyValues(_local7[_local5]);
_local3 = 0;
while (_local3 < _local19.length) {
_local12[_local19[_local3].name] = {modifierParameters:_local19[_local3].parameters, modifierFunction:_specialPropertyModifierList[_local5].getValue};
_local3++;
};
} else {
_local10[_local5] = {valueStart:undefined, valueComplete:_local7[_local5]};
};
};
};
};
for (_local5 in _local10) {
if (_specialPropertyList[_local5] != undefined){
_local10[_local5].isSpecialProperty = true;
} else {
if (_local6[0][_local5] == undefined){
printError((((("The property '" + _local5) + "' doesn't seem to be a normal object property of ") + String(_local6[0])) + " or a registered special property."));
};
};
};
for (_local5 in _local12) {
if (_local10[_local5] != undefined){
_local10[_local5].modifierParameters = _local12[_local5].modifierParameters;
_local10[_local5].modifierFunction = _local12[_local5].modifierFunction;
};
};
if (typeof(_local7.transition) == "string"){
_local20 = _local7.transition.toLowerCase();
_local13 = _transitionList[_local20];
} else {
_local13 = _local7.transition;
};
if (!Boolean(_local13)){
_local13 = _transitionList["easeoutexpo"];
};
_local3 = 0;
while (_local3 < _local6.length) {
_local14 = new Object();
for (_local5 in _local10) {
_local14[_local5] = new PropertyInfoObj(_local10[_local5].valueStart, _local10[_local5].valueComplete, _local10[_local5].valueComplete, _local10[_local5].arrayIndex, {}, _local10[_local5].isSpecialProperty, _local10[_local5].modifierFunction, _local10[_local5].modifierParameters);
};
if (_local7.useFrames == true){
_local15 = new TweenListObj(_local6[_local3], (_currentTimeFrame + (_local9 / _timeScale)), (_currentTimeFrame + ((_local9 + _local8) / _timeScale)), true, _local13, _local7.transitionParams);
} else {
_local15 = new TweenListObj(_local6[_local3], (_currentTime + ((_local9 * 1000) / _timeScale)), (_currentTime + (((_local9 * 1000) + (_local8 * 1000)) / _timeScale)), false, _local13, _local7.transitionParams);
};
_local15.properties = _local14;
_local15.onStart = _local7.onStart;
_local15.onUpdate = _local7.onUpdate;
_local15.onComplete = _local7.onComplete;
_local15.onOverwrite = _local7.onOverwrite;
_local15.onError = _local7.onError;
_local15.onStartParams = _local7.onStartParams;
_local15.onUpdateParams = _local7.onUpdateParams;
_local15.onCompleteParams = _local7.onCompleteParams;
_local15.onOverwriteParams = _local7.onOverwriteParams;
_local15.onStartScope = _local7.onStartScope;
_local15.onUpdateScope = _local7.onUpdateScope;
_local15.onCompleteScope = _local7.onCompleteScope;
_local15.onOverwriteScope = _local7.onOverwriteScope;
_local15.onErrorScope = _local7.onErrorScope;
_local15.rounded = _local7.rounded;
_local15.skipUpdates = _local7.skipUpdates;
if (((_local7.overwrite == undefined)) ? autoOverwrite : _local7.overwrite){
removeTweensByTime(_local15.scope, _local15.properties, _local15.timeStart, _local15.timeComplete);
};
_tweenList.push(_local15);
if ((((_local8 == 0)) && ((_local9 == 0)))){
_local16 = (_tweenList.length - 1);
updateTweenByIndex(_local16);
removeTweenByIndex(_local16);
};
_local3++;
};
return (true);
}
public static function registerTransition(_arg1:String, _arg2:Function):void{
if (!_inited){
init();
};
_transitionList[_arg1] = _arg2;
}
public static function printError(_arg1:String):void{
trace(("## [Tweener] Error: " + _arg1));
}
private static function affectTweens(_arg1:Function, _arg2:Object, _arg3:Array):Boolean{
var _local4:Boolean;
var _local5:uint;
var _local6:Array;
var _local7:uint;
var _local8:uint;
var _local9:uint;
_local4 = false;
if (!Boolean(_tweenList)){
return (false);
};
_local5 = 0;
while (_local5 < _tweenList.length) {
if (((_tweenList[_local5]) && ((_tweenList[_local5].scope == _arg2)))){
if (_arg3.length == 0){
_arg1(_local5);
_local4 = true;
} else {
_local6 = new Array();
_local7 = 0;
while (_local7 < _arg3.length) {
if (Boolean(_tweenList[_local5].properties[_arg3[_local7]])){
_local6.push(_arg3[_local7]);
};
_local7++;
};
if (_local6.length > 0){
_local8 = AuxFunctions.getObjectLength(_tweenList[_local5].properties);
if (_local8 == _local6.length){
_arg1(_local5);
_local4 = true;
} else {
_local9 = splitTweens(_local5, _local6);
_arg1(_local9);
_local4 = true;
};
};
};
};
_local5++;
};
return (_local4);
}
public static function getTweens(_arg1:Object):Array{
var _local2:uint;
var _local3:String;
var _local4:Array;
if (!Boolean(_tweenList)){
return ([]);
};
_local4 = new Array();
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
for (_local3 in _tweenList[_local2].properties) {
_local4.push(_local3);
};
};
_local2++;
};
return (_local4);
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public static function pauseTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj;
_local2 = _tweenList[_arg1];
if ((((_local2 == null)) || (_local2.isPaused))){
return (false);
};
_local2.timePaused = getCurrentTweeningTime(_local2);
_local2.isPaused = true;
return (true);
}
public static function getCurrentTweeningTime(_arg1:Object):Number{
return ((_arg1.useFrames) ? _currentTimeFrame : _currentTime);
}
public static function getTweenCount(_arg1:Object):Number{
var _local2:uint;
var _local3:Number;
if (!Boolean(_tweenList)){
return (0);
};
_local3 = 0;
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
_local3 = (_local3 + AuxFunctions.getObjectLength(_tweenList[_local2].properties));
};
_local2++;
};
return (_local3);
}
private static function stopEngine():void{
_engineExists = false;
_tweenList = null;
_currentTime = 0;
_currentTimeFrame = 0;
__tweener_controller__.removeEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
__tweener_controller__ = null;
}
public static function removeTweensByTime(_arg1:Object, _arg2:Object, _arg3:Number, _arg4:Number):Boolean{
var removed:Boolean;
var removedLocally:Boolean;
var i:uint;
var tl:uint;
var pName:String;
var eventScope:Object;
var p_scope = _arg1;
var p_properties = _arg2;
var p_timeStart = _arg3;
var p_timeComplete = _arg4;
removed = false;
tl = _tweenList.length;
i = 0;
while (i < tl) {
if (((Boolean(_tweenList[i])) && ((p_scope == _tweenList[i].scope)))){
if ((((p_timeComplete > _tweenList[i].timeStart)) && ((p_timeStart < _tweenList[i].timeComplete)))){
removedLocally = false;
for (pName in _tweenList[i].properties) {
if (Boolean(p_properties[pName])){
if (Boolean(_tweenList[i].onOverwrite)){
eventScope = (Boolean(_tweenList[i].onOverwriteScope)) ? _tweenList[i].onOverwriteScope : _tweenList[i].scope;
try {
_tweenList[i].onOverwrite.apply(eventScope, _tweenList[i].onOverwriteParams);
} catch(e:Error) {
handleError(_tweenList[i], e, "onOverwrite");
};
};
_tweenList[i].properties[pName] = undefined;
delete _tweenList[i].properties[pName];
removedLocally = true;
removed = true;
};
};
if (removedLocally){
if (AuxFunctions.getObjectLength(_tweenList[i].properties) == 0){
removeTweenByIndex(i);
};
};
};
};
i = (i + 1);
};
return (removed);
}
public static function registerSpecialPropertySplitter(_arg1:String, _arg2:Function, _arg3:Array=null):void{
var _local4:SpecialPropertySplitter;
if (!_inited){
init();
};
_local4 = new SpecialPropertySplitter(_arg2, _arg3);
_specialPropertySplitterList[_arg1] = _local4;
}
public static function removeTweenByIndex(_arg1:Number, _arg2:Boolean=false):Boolean{
_tweenList[_arg1] = null;
if (_arg2){
_tweenList.splice(_arg1, 1);
};
return (true);
}
public static function resumeTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(resumeTweenByIndex, _arg1, _local3));
}
public static function pauseTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(pauseTweenByIndex, _arg1, _local3));
}
}
}//package caurina.transitions
Section 29
//TweenListObj (caurina.transitions.TweenListObj)
package caurina.transitions {
public class TweenListObj {
public var onUpdate:Function;
public var useFrames:Boolean;
public var hasStarted:Boolean;
public var onOverwriteParams:Array;
public var timeStart:Number;
public var count:Number;
public var timeComplete:Number;
public var onStartParams:Array;
public var onUpdateScope:Object;
public var rounded:Boolean;
public var onUpdateParams:Array;
public var properties:Object;
public var onComplete:Function;
public var transitionParams:Object;
public var updatesSkipped:Number;
public var onStart:Function;
public var onOverwriteScope:Object;
public var skipUpdates:Number;
public var onStartScope:Object;
public var scope:Object;
public var transition:Function;
public var timePaused:Number;
public var onCompleteParams:Array;
public var timesCalled:Number;
public var isCaller:Boolean;
public var onError:Function;
public var onErrorScope:Object;
public var onOverwrite:Function;
public var isPaused:Boolean;
public var waitFrames:Boolean;
public var onCompleteScope:Object;
public function TweenListObj(_arg1:Object, _arg2:Number, _arg3:Number, _arg4:Boolean, _arg5:Function, _arg6:Object){
scope = _arg1;
timeStart = _arg2;
timeComplete = _arg3;
useFrames = _arg4;
transition = _arg5;
transitionParams = _arg6;
properties = new Object();
isPaused = false;
timePaused = undefined;
isCaller = false;
updatesSkipped = 0;
timesCalled = 0;
skipUpdates = 0;
hasStarted = false;
}
public function clone(_arg1:Boolean):TweenListObj{
var _local2:TweenListObj;
var _local3:String;
_local2 = new TweenListObj(scope, timeStart, timeComplete, useFrames, transition, transitionParams);
_local2.properties = new Array();
for (_local3 in properties) {
_local2.properties[_local3] = properties[_local3].clone();
};
_local2.skipUpdates = skipUpdates;
_local2.updatesSkipped = updatesSkipped;
if (!_arg1){
_local2.onStart = onStart;
_local2.onUpdate = onUpdate;
_local2.onComplete = onComplete;
_local2.onOverwrite = onOverwrite;
_local2.onError = onError;
_local2.onStartParams = onStartParams;
_local2.onUpdateParams = onUpdateParams;
_local2.onCompleteParams = onCompleteParams;
_local2.onOverwriteParams = onOverwriteParams;
_local2.onStartScope = onStartScope;
_local2.onUpdateScope = onUpdateScope;
_local2.onCompleteScope = onCompleteScope;
_local2.onOverwriteScope = onOverwriteScope;
_local2.onErrorScope = onErrorScope;
};
_local2.rounded = rounded;
_local2.isPaused = isPaused;
_local2.timePaused = timePaused;
_local2.isCaller = isCaller;
_local2.count = count;
_local2.timesCalled = timesCalled;
_local2.waitFrames = waitFrames;
_local2.hasStarted = hasStarted;
return (_local2);
}
public function toString():String{
var _local1:String;
var _local2:Boolean;
var _local3:String;
_local1 = "\n[TweenListObj ";
_local1 = (_local1 + ("scope:" + String(scope)));
_local1 = (_local1 + ", properties:");
_local2 = true;
for (_local3 in properties) {
if (!_local2){
_local1 = (_local1 + ",");
};
_local1 = (_local1 + ("[name:" + properties[_local3].name));
_local1 = (_local1 + (",valueStart:" + properties[_local3].valueStart));
_local1 = (_local1 + (",valueComplete:" + properties[_local3].valueComplete));
_local1 = (_local1 + "]");
_local2 = false;
};
_local1 = (_local1 + (", timeStart:" + String(timeStart)));
_local1 = (_local1 + (", timeComplete:" + String(timeComplete)));
_local1 = (_local1 + (", useFrames:" + String(useFrames)));
_local1 = (_local1 + (", transition:" + String(transition)));
_local1 = (_local1 + (", transitionParams:" + String(transitionParams)));
if (skipUpdates){
_local1 = (_local1 + (", skipUpdates:" + String(skipUpdates)));
};
if (updatesSkipped){
_local1 = (_local1 + (", updatesSkipped:" + String(updatesSkipped)));
};
if (Boolean(onStart)){
_local1 = (_local1 + (", onStart:" + String(onStart)));
};
if (Boolean(onUpdate)){
_local1 = (_local1 + (", onUpdate:" + String(onUpdate)));
};
if (Boolean(onComplete)){
_local1 = (_local1 + (", onComplete:" + String(onComplete)));
};
if (Boolean(onOverwrite)){
_local1 = (_local1 + (", onOverwrite:" + String(onOverwrite)));
};
if (Boolean(onError)){
_local1 = (_local1 + (", onError:" + String(onError)));
};
if (onStartParams){
_local1 = (_local1 + (", onStartParams:" + String(onStartParams)));
};
if (onUpdateParams){
_local1 = (_local1 + (", onUpdateParams:" + String(onUpdateParams)));
};
if (onCompleteParams){
_local1 = (_local1 + (", onCompleteParams:" + String(onCompleteParams)));
};
if (onOverwriteParams){
_local1 = (_local1 + (", onOverwriteParams:" + String(onOverwriteParams)));
};
if (onStartScope){
_local1 = (_local1 + (", onStartScope:" + String(onStartScope)));
};
if (onUpdateScope){
_local1 = (_local1 + (", onUpdateScope:" + String(onUpdateScope)));
};
if (onCompleteScope){
_local1 = (_local1 + (", onCompleteScope:" + String(onCompleteScope)));
};
if (onOverwriteScope){
_local1 = (_local1 + (", onOverwriteScope:" + String(onOverwriteScope)));
};
if (onErrorScope){
_local1 = (_local1 + (", onErrorScope:" + String(onErrorScope)));
};
if (rounded){
_local1 = (_local1 + (", rounded:" + String(rounded)));
};
if (isPaused){
_local1 = (_local1 + (", isPaused:" + String(isPaused)));
};
if (timePaused){
_local1 = (_local1 + (", timePaused:" + String(timePaused)));
};
if (isCaller){
_local1 = (_local1 + (", isCaller:" + String(isCaller)));
};
if (count){
_local1 = (_local1 + (", count:" + String(count)));
};
if (timesCalled){
_local1 = (_local1 + (", timesCalled:" + String(timesCalled)));
};
if (waitFrames){
_local1 = (_local1 + (", waitFrames:" + String(waitFrames)));
};
if (hasStarted){
_local1 = (_local1 + (", hasStarted:" + String(hasStarted)));
};
_local1 = (_local1 + "]\n");
return (_local1);
}
public static function makePropertiesChain(_arg1:Object):Object{
var _local2:Object;
var _local3:Object;
var _local4:Object;
var _local5:Object;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local2 = _arg1.base;
if (_local2){
_local3 = {};
if ((_local2 is Array)){
_local4 = [];
_local8 = 0;
while (_local8 < _local2.length) {
_local4.push(_local2[_local8]);
_local8++;
};
} else {
_local4 = [_local2];
};
_local4.push(_arg1);
_local6 = _local4.length;
_local7 = 0;
while (_local7 < _local6) {
if (_local4[_local7]["base"]){
_local5 = AuxFunctions.concatObjects(makePropertiesChain(_local4[_local7]["base"]), _local4[_local7]);
} else {
_local5 = _local4[_local7];
};
_local3 = AuxFunctions.concatObjects(_local3, _local5);
_local7++;
};
if (_local3["base"]){
delete _local3["base"];
};
return (_local3);
//unresolved jump
};
return (_arg1);
}
}
}//package caurina.transitions
Section 30
//Debug (com.hexagonstar.util.debug.Debug)
package com.hexagonstar.util.debug {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public final class Debug {
public static const LEVEL_WARN:int = 2;
public static const LEVEL_DEBUG:int = 0;
public static const LEVEL_INFO:int = 1;
public static const LEVEL_FATAL:int = 4;
public static const LEVEL_ERROR:int = 3;
private static var _stage:Stage;
private static var _filterLevel:int = 0;
private static var _isEnabled:Boolean = true;
private static var _isConnected:Boolean = false;
private static var _isPollingFPS:Boolean = false;
private static var _stopWatch:StopWatch;
private static var _connection:LocalConnection;
private static var _fpsMeter:FPSMeter;
public static function forceGC():void{
try {
} catch(e1:Error) {
try {
new LocalConnection().connect("forceGC");
new LocalConnection().connect("forceGC");
} catch(e2:Error) {
};
};
}
private static function send(_arg1:String, _arg2, _arg3:int=1, _arg4:int=0):void{
var _local5:Number;
var _local6:ByteArray;
if (_isEnabled){
if (!_isConnected){
_isConnected = true;
_connection = new LocalConnection();
_connection.addEventListener(StatusEvent.STATUS, onStatus);
};
_local5 = 0;
if (typeof(_arg2) == "string"){
_local5 = String(_arg2).length;
} else {
if (typeof(_arg2) == "object"){
_local6 = new ByteArray();
_local6.writeObject(_arg2);
_local5 = _local6.length;
_local6 = null;
};
};
if (_local5 > 39000){
storeDataLSO(_arg1, _arg2);
_arg1 = "onLargeData";
_arg2 = null;
};
_connection.send("_alcon_lc", _arg1, _arg2, _arg3, _arg4, "");
};
}
public static function stop():void{
if (_fpsMeter){
_isPollingFPS = false;
_fpsMeter.stop();
_fpsMeter.removeEventListener(FPSMeter.FPS_UPDATE, onFPSUpdate);
_fpsMeter = null;
_stage = null;
};
}
public static function timerReset():void{
if (_stopWatch){
_stopWatch.reset();
};
}
private static function onFPSUpdate(_arg1:Event):void{
send("onFPS", ((((((_fpsMeter.fps + ",") + _stage.frameRate) + ",") + _fpsMeter.frt) + ",") + System.totalMemory));
}
public static function delimiter():void{
Debug.trace("[%DLT%]", 5);
}
public static function set enabled(_arg1:Boolean):void{
_isEnabled = _arg1;
}
public static function inspect(_arg1:Object):void{
send("onInspect", _arg1, 1, -1);
}
public static function timerStart(_arg1:String=""):void{
if (_isEnabled){
if (!_stopWatch){
_stopWatch = new StopWatch();
};
_stopWatch.start(_arg1);
};
}
public static function createCategory(_arg1:int, _arg2:String="", _arg3:uint=0, _arg4:uint=0xFFFF00):void{
send("onCategory", [_arg1, _arg2, _arg3, _arg4], 0, 0);
}
private static function storeDataLSO(_arg1:String, _arg2):void{
var sharedObject:SharedObject;
var flushResult:String;
var m = _arg1;
var d = _arg2;
sharedObject = SharedObject.getLocal("alcon", "/");
sharedObject.data["alconMethod"] = m;
sharedObject.data["alconData"] = d;
try {
flushResult = sharedObject.flush();
if (flushResult == SharedObjectFlushStatus.FLUSHED){
return;
};
} catch(e:Error) {
Security.showSettings(SecurityPanel.LOCAL_STORAGE);
};
}
public static function hexDump(_arg1:Object):void{
send("onHexDump", _arg1, 0, 0);
}
private static function onStatus(_arg1:StatusEvent):void{
}
public static function get enabled():Boolean{
return (_isEnabled);
}
public static function trace(... _args):void{
var _local2:int;
_local2 = ((_args[1] is int)) ? _args[1] : 1;
if ((((_local2 >= _filterLevel)) && ((_local2 < 7)))){
send("onData", _args[0], _local2, 0);
};
}
public static function timerToString():void{
if (_stopWatch){
Debug.trace(_stopWatch.toString());
};
}
public static function mark(_arg1:uint=0xFF00FF):void{
send("onMarker", _arg1, 1, -1);
}
public static function timerInSeconds():void{
if (_stopWatch){
Debug.trace((_stopWatch.timeInSeconds + "s"));
};
}
public static function set filterLevel(_arg1:int):void{
if ((((_arg1 >= 0)) && ((_arg1 < 5)))){
_filterLevel = _arg1;
};
}
public static function monitor(_arg1:Stage, _arg2:int=500):void{
if (_isPollingFPS){
Debug.stop();
};
if (((_isEnabled) && (!(_fpsMeter)))){
_isPollingFPS = true;
_stage = _arg1;
sendCapabilities();
_fpsMeter = new FPSMeter(_stage, _arg2);
_fpsMeter.addEventListener(FPSMeter.FPS_UPDATE, onFPSUpdate);
_fpsMeter.start();
};
}
public static function time():void{
Debug.trace("[%TME%]", 5);
}
private static function sendCapabilities():void{
var _local1:XML;
var _local2:Array;
var _local3:XML;
var _local4:String;
_local1 = describeType(Capabilities);
_local2 = [];
for each (_local3 in _local1.*) {
_local4 = _local3.@name.toString();
if ((((((_local4.length > 0)) && (!((_local4 == "_internal"))))) && (!((_local4 == "prototype"))))){
_local2.push({p:_local4, v:Capabilities[_local4].toString()});
};
};
_local2.sortOn(["p"], Array.CASEINSENSITIVE);
send("onCap", _local2);
}
public static function clear():void{
Debug.trace("[%CLR%]", 5);
}
public static function timerStop():void{
if (_stopWatch){
_stopWatch.stop();
};
}
public static function timerInMilliSeconds():void{
if (_stopWatch){
Debug.trace((_stopWatch.timeInMilliSeconds + "ms"));
};
}
public static function get filterLevel():int{
return (_filterLevel);
}
public static function traceObj(_arg1:Object, _arg2:int=64, _arg3:int=1):void{
if ((((_arg3 >= _filterLevel)) && ((_arg3 < 7)))){
send("onData", _arg1, _arg3, _arg2);
};
}
public static function timerStopToString(_arg1:Boolean=false):void{
if (_stopWatch){
_stopWatch.stop();
Debug.trace(_stopWatch.toString());
if (_arg1){
_stopWatch.reset();
};
};
}
public static function pause():void{
Debug.trace("[%PSE%]", 5);
}
}
}//package com.hexagonstar.util.debug
Section 31
//FPSMeter (com.hexagonstar.util.debug.FPSMeter)
package com.hexagonstar.util.debug {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class FPSMeter extends EventDispatcher {
private var _pollInterval:int;
private var _delay:int;
private var _ms:int;
private var _prev:int;
private var _delayMax:int;// = 10
private var _timer:Timer;
private var _frt:int;
private var _fps:int;
private var _isRunning:Boolean;
private var _stage:Stage;
public static const FPS_UPDATE:String = "fpsUpdate";
public function FPSMeter(_arg1:Stage, _arg2:int=500){
_delayMax = 10;
super();
_stage = _arg1;
_pollInterval = _arg2;
reset();
}
public function stop():void{
if (_isRunning){
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, onTimer);
_stage.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
_timer = null;
reset();
};
}
public function reset():void{
_fps = 0;
_frt = 0;
_ms = 0;
_delay = 0;
_prev = 0;
_isRunning = false;
}
private function onEnterFrame(_arg1:Event):void{
var _local2:Number;
_local2 = getTimer();
_delay++;
if (_delay >= _delayMax){
_delay = 0;
_fps = int(((1000 * _delayMax) / (_local2 - _prev)));
_prev = _local2;
};
_frt = (_local2 - _ms);
_ms = _local2;
}
private function onTimer(_arg1:TimerEvent):void{
dispatchEvent(new Event(FPSMeter.FPS_UPDATE));
}
public function get frt():int{
return (_frt);
}
public function get fps():int{
return (_fps);
}
public function start():void{
if (!_isRunning){
_isRunning = true;
_timer = new Timer(_pollInterval, 0);
_timer.addEventListener(TimerEvent.TIMER, onTimer);
_stage.addEventListener(Event.ENTER_FRAME, onEnterFrame);
_timer.start();
};
}
}
}//package com.hexagonstar.util.debug
Section 32
//StopWatch (com.hexagonstar.util.debug.StopWatch)
package com.hexagonstar.util.debug {
import flash.utils.*;
public class StopWatch {
private var _started:Boolean;// = false
private var _stopTimeKeys:Array;
private var _startTimeKeys:Array;
private var _title:String;
public function StopWatch(){
_started = false;
super();
reset();
}
public function get timeInMilliSeconds():int{
var _local1:int;
var _local2:int;
if (_started){
_stopTimeKeys[(_startTimeKeys.length - 1)] = getTimer();
};
_local1 = 0;
_local2 = 0;
while (_local2 < _startTimeKeys.length) {
_local1 = (_local1 + (_stopTimeKeys[_local2] - _startTimeKeys[_local2]));
_local2++;
};
return (_local1);
}
public function toString():String{
var _local1:String;
var _local2:int;
var _local3:int;
var _local4:int;
_local1 = "\n ********************* [STOPWATCH] *********************";
if (_title != ""){
_local1 = (_local1 + ("\n * " + _title));
};
_local2 = 0;
while (_local2 < _startTimeKeys.length) {
_local3 = _startTimeKeys[_local2];
_local4 = _stopTimeKeys[_local2];
_local1 = (_local1 + (((((("\n * started [" + format(_local3)) + "ms] stopped [") + format(_local4)) + "ms] time [") + format((_local4 - _local3))) + "ms]"));
_local2++;
};
if (_local2 == 0){
_local1 = (_local1 + "\n * never started.");
} else {
_local1 = (_local1 + (("\n * total runnning time: " + timeInSeconds) + "s"));
};
_local1 = (_local1 + "\n *******************************************************");
return (_local1);
}
public function get timeInSeconds():Number{
return ((timeInMilliSeconds / 1000));
}
public function get started():Boolean{
return (_started);
}
public function start(_arg1:String=""):void{
if (!_started){
_title = _arg1;
_started = true;
_startTimeKeys.push(getTimer());
};
}
public function reset():void{
_startTimeKeys = [];
_stopTimeKeys = [];
_started = false;
}
private function format(_arg1:int):String{
var _local2:String;
var _local3:int;
var _local4:int;
_local2 = "";
_local3 = _arg1.toString().length;
_local4 = 0;
while (_local4 < (5 - _local3)) {
_local2 = (_local2 + "0");
_local4++;
};
return ((_local2 + _arg1));
}
public function stop():void{
var _local1:int;
if (_started){
_local1 = getTimer();
_stopTimeKeys[(_startTimeKeys.length - 1)] = _local1;
_started = false;
};
}
}
}//package com.hexagonstar.util.debug
Section 33
//MindJoltAPI (com.mindjolt.api.as3.MindJoltAPI)
package com.mindjolt.api.as3 {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class MindJoltAPI extends MovieClip {
private var dispatcher:CustomDispatcher;
public static var service:Object;
public function MindJoltAPI(){
dispatcher = new CustomDispatcher();
dispatcher.doAction(1, 100);
dispatcher.addEventListener(_slot2.ACTION, createRoot);
}
private function createRoot(_arg1:Event):void{
if (root != null){
_arg1.currentTarget.removeEventListener(_slot2.ACTION, createRoot);
init();
};
}
private function init():void{
var _local1:Object;
var _local2:String;
var _local3:Loader;
_local1 = Object(parent.root).loaderInfo.parameters;
_local2 = "";
if (((!((_local1.mjPath == null))) && (isDomainAllowed()))){
_local2 = _local1.mjPath;
} else {
_local2 = "http://static.mindjolt.com/api/as3/scoreapi_as3_local.swf";
};
_local3 = new Loader();
_local3.contentLoaderInfo.addEventListener(Event.COMPLETE, loadFinished);
_local3.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadFailed);
_local3.load(new URLRequest(_local2));
addChild(_local3);
}
private function loadFinished(_arg1:Event):void{
service = _arg1.currentTarget.content.service;
service.connect();
trace("[MindJoltAPI] service loaded");
}
private function isDomainAllowed():Boolean{
var _local1:String;
var _local2:LocalConnection;
var _local3:String;
_local1 = ".mindjolt.com";
_local2 = new LocalConnection();
_local3 = _local2.domain;
if (_local3.indexOf(_local1) == (_local3.length - _local1.length)){
return (true);
};
return (false);
}
private function loadFailed(_arg1:IOErrorEvent):void{
trace("[MindJoltAPI] unable to load service");
}
}
}//package com.mindjolt.api.as3
import flash.events.*;
import flash.utils.*;
class CustomDispatcher extends EventDispatcher {
public static var ACTION:String = "action";
private function CustomDispatcher(){
}
public function doAction(_arg1:Number, _arg2:Number):void{
var myTimer:Timer;
var propAction:Function;
var delay = _arg1;
var repeat = _arg2;
propAction = function (_arg1:TimerEvent):void{
dispatchEvent(new Event(_slot2.ACTION));
};
myTimer = new Timer(delay, repeat);
myTimer.addEventListener(TimerEvent.TIMER, propAction);
myTimer.start();
}
}
Section 34
//MyButton (com.MyButton)
package com {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class MyButton extends MovieClip {
public var clip:MovieClip;
private var mother:Object;
public function MyButton(_arg1:MovieClip, _arg2:Object):void{
var _local3:uint;
var _local4:*;
var _local5:uint;
var _local6:*;
super();
clip = _arg1;
mother = _arg2;
clip.addEventListener(MouseEvent.CLICK, hClick);
clip.addEventListener(MouseEvent.ROLL_OUT, hRollOut);
clip.addEventListener(MouseEvent.ROLL_OVER, hRoll);
clip.buttonMode = true;
_local3 = 0;
while (_local3 < clip.numChildren) {
_local4 = clip.getChildAt(_local3);
if ((((_local4 is MovieClip)) || ((_local4 is TextField)))){
_local4.mouseEnabled = false;
if ((_local4 is MovieClip)){
_local5 = 0;
while (_local5 < _local4.numChildren) {
_local6 = _local4.getChildAt(_local5);
if ((((_local6 is MovieClip)) || ((_local6 is TextField)))){
_local6.mouseEnabled = false;
};
_local5++;
};
};
};
_local3++;
};
}
private function hClick(_arg1:MouseEvent):void{
mother.hClick(_arg1);
}
public function destroy():void{
clip.removeEventListener(MouseEvent.CLICK, hClick);
clip.removeEventListener(MouseEvent.ROLL_OUT, hRollOut);
clip.removeEventListener(MouseEvent.ROLL_OVER, hRoll);
}
private function hRoll(_arg1:MouseEvent):void{
clip.gotoAndStop(2);
}
private function hRollOut(_arg1:MouseEvent):void{
clip.gotoAndStop(1);
}
}
}//package com
Section 35
//LevelData (data.LevelData)
package data {
public class LevelData {
private var level:uint;
public var maxDiff:uint;
public var ballsId:Array;
public var array;
public var isLevel:Boolean;
private var trials:uint;
public function LevelData(_arg1:uint):void{
array = new Array();
ballsId = new Array();
super();
this.level = _arg1;
}
public function getData():Array{
isLevel = true;
array = new Array();
ballsId = new Array(0, 0, 0);
maxDiff = 40;
switch (level){
case 0:
array.push({x:500, y:100, r:15, id:0});
break;
case 1:
array.push({x:600, y:100, r:10, id:0});
array.push({x:500, y:100, r:15, id:0});
array.push({x:550, y:100, r:15, id:0});
break;
case 2:
array.push({x:600, y:100, r:20, id:1});
break;
case 3:
array.push({x:600, y:100, r:20, id:1});
array.push({x:200, y:100, r:20, id:0});
break;
case 4:
array.push({x:600, y:100, r:8, id:1});
array.push({x:580, y:100, r:9, id:1});
array.push({x:560, y:100, r:12, id:1});
array.push({x:540, y:100, r:15, id:1});
break;
case 5:
array.push({x:600, y:100, r:20, id:2});
array.push({x:200, y:100, r:20, id:0});
break;
case 6:
array.push({x:600, y:100, r:20, id:3});
array.push({x:200, y:100, r:20, id:0});
break;
case 7:
array.push({x:600, y:100, r:20, id:4});
array.push({x:200, y:100, r:20, id:0});
break;
case 8:
array.push({x:600, y:100, r:20, id:4});
array.push({x:200, y:100, r:20, id:0});
array.push({x:300, y:100, r:20, id:1});
array.push({x:500, y:100, r:20, id:2});
break;
case 9:
array.push({x:600, y:100, r:20, id:1});
array.push({x:200, y:100, r:20, id:4});
break;
case 10:
array.push({x:600, y:100, r:40, id:3});
array.push({x:550, y:100, r:40, id:2});
ballsId = new Array(2, 2, 2);
break;
case 11:
array.push({x:600, y:100, r:30, id:3});
array.push({x:600, y:100, r:30, id:0});
ballsId = new Array(3, 3, 3);
break;
case 12:
array.push({x:600, y:100, r:10, id:1});
array.push({x:600, y:100, r:10, id:2});
array.push({x:600, y:100, r:10, id:3});
array.push({x:600, y:100, r:10, id:4});
ballsId = new Array(1, 1, 1);
break;
case 13:
array.push({x:600, y:100, r:10, id:1});
array.push({x:600, y:100, r:10, id:2});
ballsId = new Array(2, 3, 4);
break;
case 14:
array.push({x:600, y:100, r:20, id:0});
array.push({x:600, y:100, r:20, id:0});
ballsId = new Array(0, 0, 4);
break;
case 15:
array.push({x:600, y:100, r:20, id:4});
array.push({x:600, y:100, r:30, id:3});
ballsId = new Array(2, 3, 4);
break;
case 16:
array.push({x:600, y:100, r:20, id:4});
array.push({x:600, y:100, r:5, id:1});
array.push({x:600, y:100, r:20, id:2});
array.push({x:600, y:100, r:30, id:0});
ballsId = new Array(2, 3, 1);
break;
case 17:
array.push({x:600, y:100, r:20, id:4});
array.push({x:600, y:100, r:5, id:1});
array.push({x:600, y:100, r:20, id:2});
array.push({x:600, y:100, r:30, id:0});
ballsId = new Array(2, 2, 2);
break;
case 18:
array.push({x:600, y:100, r:15, id:1});
array.push({x:600, y:100, r:15, id:1});
ballsId = new Array(1, 1, 1);
break;
case 19:
array.push({x:600, y:100, r:17, id:1});
array.push({x:600, y:100, r:17, id:1});
ballsId = new Array(0, 1, 2);
break;
default:
isLevel = false;
break;
};
return (array);
}
public function getTrials():uint{
return (ballsId.length);
}
public function getLength():uint{
var _local1:uint;
var _local2:uint;
var _local3:uint;
_local1 = level;
_local3 = 0;
while (_local3 < 100) {
level = _local3;
getData();
if (isLevel != true){
_local2 = level;
break;
};
_local3++;
};
level = _local1;
return (_local2);
}
public function getBalls():Array{
return (ballsId);
}
}
}//package data
Section 36
//DrawShape (draw.DrawShape)
package draw {
import flash.events.*;
import flash.display.*;
public class DrawShape extends Sprite {
private var size:uint;// = 80
private var gutter:uint;// = 5
private var child:Sprite;
private var bgColor:uint;// = 0xCCCCCC
private var cornerRadius:uint;// = 9
private var borderSize:uint;// = 0
private var child2:Sprite;
private var borderColor:uint;// = 0x666666
public function DrawShape(_arg1:String, _arg2:uint):void{
size = 80;
bgColor = 0xCCCCCC;
borderColor = 0x666666;
borderSize = 0;
cornerRadius = 9;
gutter = 5;
super();
if (_arg1 == "circle"){
child = getClip(_arg2);
} else {
child = new Sprite();
};
addChild(child);
addEventListener(Event.ADDED_TO_STAGE, hAdd);
}
private function hAdd(_arg1:Event):void{
}
public function drawCircle(_arg1:Number, _arg2:Number, _arg3:Number):void{
child.graphics.clear();
child.graphics.beginFill(bgColor);
child.graphics.lineStyle(borderSize, borderColor);
child.graphics.drawCircle(_arg1, _arg2, _arg3);
child.graphics.endFill();
}
public function drawRect(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
child.graphics.clear();
child.graphics.beginFill(bgColor);
child.graphics.lineStyle(borderSize, borderColor);
child.graphics.drawRect(_arg1, _arg2, (_arg3 - _arg1), (_arg4 - _arg2));
child.graphics.endFill();
}
public function drawCircle2(_arg1:Number, _arg2:Number, _arg3:Number):void{
child.x = _arg1;
child.y = _arg2;
child.width = (_arg3 * 2);
child.height = (_arg3 * 2);
}
private function getClip(_arg1:uint):MovieClip{
switch (_arg1){
case 0:
return (new McIron());
case 1:
return (new McGold());
case 2:
return (new McGlass());
case 3:
return (new McIce());
case 4:
return (new McWood());
default:
return (new McIron());
};
}
public function destroy():void{
removeChild(child);
removeEventListener(Event.ADDED_TO_STAGE, hAdd);
}
}
}//package draw
Section 37
//AddScoresEvent (events.AddScoresEvent)
package events {
import flash.events.*;
public class AddScoresEvent extends Event {
public var scores:Number;
public static const ADD_SCORE:String = "addScore";
public function AddScoresEvent(_arg1:Number):void{
super(ADD_SCORE);
scores = _arg1;
}
}
}//package events
Section 38
//BallReflectEvent (events.BallReflectEvent)
package events {
import flash.events.*;
public class BallReflectEvent extends Event {
public static const REFLECT:String = "reflect";
public function BallReflectEvent():void{
super(REFLECT);
}
}
}//package events
Section 39
//BreakOffEvent (events.BreakOffEvent)
package events {
import flash.events.*;
public class BreakOffEvent extends Event {
public static const BREAK:String = "brakOff";
public function BreakOffEvent():void{
super(BREAK);
}
}
}//package events
Section 40
//CreateBallEvent (events.CreateBallEvent)
package events {
import flash.events.*;
public class CreateBallEvent extends Event {
public var id_material:uint;
public var radius:Number;
public var yPos:Number;
public var creator:String;
public var xPos:Number;
public static const CREATE_BALL:String = "createBall";
public function CreateBallEvent(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:uint, _arg5:String):void{
super(CREATE_BALL);
id_material = _arg4;
xPos = _arg1;
yPos = _arg2;
radius = _arg3;
creator = _arg5;
}
}
}//package events
Section 41
//DestroyBallEvent (events.DestroyBallEvent)
package events {
import flash.events.*;
import objects.*;
public class DestroyBallEvent extends Event {
public var object:Ball;
public static const DESTROY_BALL:String = "destroyBall";
public function DestroyBallEvent(_arg1:Ball):void{
super(DESTROY_BALL);
object = _arg1;
}
}
}//package events
Section 42
//DifferenceEvent (events.DifferenceEvent)
package events {
import flash.events.*;
public class DifferenceEvent extends Event {
public var difference:Number;
public var mass2:Number;
public var mass1:Number;
public static const DIFFERENCE_CHANGE:String = "differenceChange";
public function DifferenceEvent(_arg1:Number, _arg2:Number):void{
super(DIFFERENCE_CHANGE);
mass1 = _arg1;
mass2 = _arg2;
difference = Math.floor((mass1 - mass2));
}
}
}//package events
Section 43
//EndGameEvent (events.EndGameEvent)
package events {
import flash.events.*;
public class EndGameEvent extends Event {
public static const END_GAME:String = "endGame";
public function EndGameEvent():void{
super(END_GAME);
}
}
}//package events
Section 44
//EndLevelEvent (events.EndLevelEvent)
package events {
import flash.events.*;
public class EndLevelEvent extends Event {
public static const LEVEL_END:String = "levelEnd";
public function EndLevelEvent():void{
super(LEVEL_END);
}
}
}//package events
Section 45
//LooseLifeEvent (events.LooseLifeEvent)
package events {
import flash.events.*;
public class LooseLifeEvent extends Event {
public static const LOOSE_LIFE:String = "looseLife";
public function LooseLifeEvent():void{
super(LOOSE_LIFE);
}
}
}//package events
Section 46
//MenuEvent (events.MenuEvent)
package events {
import flash.events.*;
public class MenuEvent extends Event {
public static const GO_TO_MENU:String = "gotoMenu";
public function MenuEvent():void{
super(GO_TO_MENU);
}
}
}//package events
Section 47
//NextTrialEvent (events.NextTrialEvent)
package events {
import flash.events.*;
public class NextTrialEvent extends Event {
public var trials:uint;
public var ballsId:Array;
public static const NEXT_TRIAL:String = "nextTrial";
public function NextTrialEvent(_arg1:uint, _arg2:Array):void{
ballsId = new Array();
super(NEXT_TRIAL);
trials = _arg1;
ballsId = _arg2;
}
}
}//package events
Section 48
//PauseEvent (events.PauseEvent)
package events {
import flash.events.*;
public class PauseEvent extends Event {
public static const PAUSE_ON:String = "pauseOn";
public function PauseEvent():void{
super(PAUSE_ON);
}
}
}//package events
Section 49
//PauseOffEvent (events.PauseOffEvent)
package events {
import flash.events.*;
public class PauseOffEvent extends Event {
public static const PAUSE_OFF:String = "pauseOff";
public function PauseOffEvent():void{
super(PAUSE_OFF);
}
}
}//package events
Section 50
//ShowBoardEvent (events.ShowBoardEvent)
package events {
import flash.events.*;
public class ShowBoardEvent extends Event {
public static const SHOW_BOARD:String = "showBoard";
public function ShowBoardEvent():void{
super(SHOW_BOARD);
}
}
}//package events
Section 51
//SoundChangeEvent (events.SoundChangeEvent)
package events {
import flash.events.*;
public class SoundChangeEvent extends Event {
public static const SOUND_CHANGE:String = "soundChange";
public function SoundChangeEvent():void{
super(SOUND_CHANGE);
}
}
}//package events
Section 52
//StartLevelEvent (events.StartLevelEvent)
package events {
import flash.events.*;
public class StartLevelEvent extends Event {
public var level:uint;
public var maxDiff:uint;
public var levelMax:uint;
public static const LEVEL_START:String = "levelStart";
public function StartLevelEvent(_arg1:uint, _arg2:uint, _arg3:uint):void{
super(LEVEL_START);
level = _arg1;
levelMax = _arg2;
maxDiff = _arg3;
}
}
}//package events
Section 53
//StopArmEvent (events.StopArmEvent)
package events {
import flash.events.*;
public class StopArmEvent extends Event {
public static const STOP_ARM:String = "stopArm";
public function StopArmEvent():void{
super(STOP_ARM);
}
}
}//package events
Section 54
//SubmitScoresEvent (events.SubmitScoresEvent)
package events {
import flash.events.*;
public class SubmitScoresEvent extends Event {
public var scores:Number;
public static const SUBMIT_SCORES:String = "submitScores";
public function SubmitScoresEvent(_arg1:Number):void{
super(SUBMIT_SCORES);
scores = _arg1;
}
}
}//package events
Section 55
//UpdateScoresEvent (events.UpdateScoresEvent)
package events {
import flash.events.*;
public class UpdateScoresEvent extends Event {
public var scores:Number;
public static const UPDATE_SCORES:String = "updateScores";
public function UpdateScoresEvent(_arg1:Number):void{
super(UPDATE_SCORES);
scores = _arg1;
}
}
}//package events
Section 56
//Adds (interfaces.Adds)
package interfaces {
import flash.events.*;
import flash.display.*;
import events.*;
import mochi.as3.*;
import com.mindjolt.api.as3.*;
public dynamic class Adds extends Sprite {
public var boardID:String;// = "15ad2602ebf0a5cd"
public var gameID:String;// = "b684708446294759"
public var mother:Main;
public function Adds(_arg1:Main):void{
gameID = "b684708446294759";
boardID = "15ad2602ebf0a5cd";
super();
mother = _arg1;
MochiServices.connect(gameID, mother, onConnectError);
MochiAd.showPreGameAd({clip:mother, id:gameID, res:"800x600"});
addEventListener(Event.ADDED_TO_STAGE, hAdd);
}
private function hAdd(_arg1:Event):void{
stage.addEventListener(ShowBoardEvent.SHOW_BOARD, showScore);
stage.addEventListener(SubmitScoresEvent.SUBMIT_SCORES, hSubmit);
}
public function hNothing():void{
}
public function checkMenu(_arg1):void{
var _local2:String;
_local2 = LoaderInfo(mother.loaderInfo).url;
if (_local2.indexOf("gamebrew.com") > -1){
_arg1.visible = false;
} else {
if (_local2.indexOf("mindjolt.com") > -1){
_arg1.visible = false;
} else {
if (_local2.indexOf("thisarcade.com") > -1){
_arg1.visible = false;
} else {
_arg1.visible = true;
};
};
};
}
public function showScore(_arg1:ShowBoardEvent):void{
MochiScores.showLeaderboard({boardID:boardID, onClose:hNothing});
}
public function hSubmit(_arg1:SubmitScoresEvent):void{
var _local2:String;
var _local3:Number;
_local2 = LoaderInfo(mother.loaderInfo).url;
_local3 = Math.floor(_arg1.scores);
if (_local2.indexOf("gamebrew.com") > -1){
MindJoltAPI.service.submitScore(_local3);
} else {
if (_local2.indexOf("mindjolt.com") > -1){
MindJoltAPI.service.submitScore(_local3);
} else {
if (_local2.indexOf("thisarcade.com") > -1){
MindJoltAPI.service.submitScore(_local3);
} else {
MochiScores.showLeaderboard({boardID:boardID, score:_local3, onClose:hMenu});
};
};
};
}
public function onConnectError(_arg1:String):void{
trace("error :(");
}
public function hMenu():void{
stage.dispatchEvent(new MenuEvent());
}
}
}//package interfaces
Section 57
//Caption (interfaces.Caption)
package interfaces {
import caurina.transitions.*;
public class Caption extends McCaption {
public function Caption(_arg1:String, _arg2:Number, _arg3:Number):void{
var _local4:Number;
super();
_local4 = 1.5;
tf1.text = _arg1;
x = _arg2;
y = _arg3;
Tweener.addTween(this, {alpha:0, time:_local4, transition:"easeInExpo", onComplete:destroy});
Tweener.addTween(this, {scaleX:2, time:1, transition:"easeOutExpo"});
Tweener.addTween(this, {scaleY:2, time:1, transition:"easeOutExpo"});
Tweener.addTween(this, {y:(this.y - 20), time:1, transition:"easeOutExpo"});
}
public function destroy():void{
tf1 = null;
}
}
}//package interfaces
Section 58
//Logo (interfaces.Logo)
package interfaces {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class Logo extends MovieClip {
private var clip:MovieClip;
public function Logo(_arg1:MovieClip):void{
clip = _arg1;
clip.buttonMode = true;
clip.addEventListener(MouseEvent.CLICK, getLogoURL);
}
private function getLogoURL(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.nobagames.com/";
_local3 = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
}
}//package interfaces
Section 59
//MouseAction (interfaces.MouseAction)
package interfaces {
import flash.events.*;
import flash.display.*;
import events.*;
import draw.*;
public class MouseAction extends MovieClip {
private var counter:uint;// = 0
private var pauseOn:Boolean;// = false
private var radius:uint;// = 1
private var nextBall:Boolean;// = true
private var ds:DrawShape;
private var armRun:Boolean;// = false
private var lastDiff;// = 0
private var ballsId:Array;
private var ballCreated:Boolean;// = false
public function MouseAction():void{
radius = 1;
pauseOn = false;
ballCreated = false;
nextBall = true;
armRun = false;
ballsId = new Array();
counter = 0;
lastDiff = 0;
super();
addEventListener(Event.ADDED_TO_STAGE, hAdd);
}
public function destroy():void{
removeEventListener(Event.ENTER_FRAME, hEnterFrame);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, hMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, hMouseUp);
removeEventListener(Event.ADDED_TO_STAGE, hAdd);
stage.removeEventListener(PauseEvent.PAUSE_ON, function (){
pauseOn = true;
});
stage.removeEventListener(PauseOffEvent.PAUSE_OFF, function (){
pauseOn = false;
});
stage.removeEventListener(DifferenceEvent.DIFFERENCE_CHANGE, hDiff);
stage.removeEventListener(StopArmEvent.STOP_ARM, hStopArm);
stage.removeEventListener(EndGameEvent.END_GAME, hEndGame);
}
public function setBalls(_arg1:Array):void{
ballsId = new Array();
ballsId = _arg1;
}
private function hAdd(_arg1:Event):void{
var e = _arg1;
stage.addEventListener(MouseEvent.MOUSE_DOWN, hMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, hMouseUp);
stage.addEventListener(PauseEvent.PAUSE_ON, function (){
pauseOn = true;
});
stage.addEventListener(PauseOffEvent.PAUSE_OFF, function (){
pauseOn = false;
});
stage.addEventListener(DifferenceEvent.DIFFERENCE_CHANGE, hDiff);
stage.addEventListener(StopArmEvent.STOP_ARM, hStopArm);
stage.addEventListener(EndGameEvent.END_GAME, hEndGame);
}
private function hMouseDown(_arg1:MouseEvent):void{
if ((((((((pauseOn == false)) && ((ballCreated == false)))) && ((nextBall == true)))) && ((armRun == false)))){
ballCreated = true;
ds = new DrawShape("circle", ballsId[counter]);
addChild(ds);
radius = 1;
addEventListener(Event.ENTER_FRAME, hEnterFrame);
};
}
private function hStopArm(_arg1:StopArmEvent):void{
armRun = false;
}
private function hMouseUp(_arg1:MouseEvent):void{
if ((((((pauseOn == false)) && ((ballCreated == true)))) && ((nextBall == true)))){
ds.destroy();
removeEventListener(Event.ENTER_FRAME, hEnterFrame);
stage.dispatchEvent(new CreateBallEvent(_arg1.stageX, _arg1.stageY, radius, ballsId[counter], "player"));
ballCreated = false;
nextBall = false;
counter++;
};
}
public function hDiff(_arg1:DifferenceEvent):void{
nextBall = true;
if (_arg1.difference != lastDiff){
armRun = true;
};
lastDiff = _arg1.difference;
}
private function hEndGame(_arg1:EndGameEvent):void{
destroy();
}
private function hEnterFrame(_arg1:Event):void{
if (radius < 60){
radius = (radius + 2);
};
ds.drawCircle2(mouseX, mouseY, radius);
}
}
}//package interfaces
Section 60
//MyMenu (interfaces.MyMenu)
package interfaces {
import flash.events.*;
import flash.display.*;
import events.*;
import com.*;
public class MyMenu extends MovieClip {
public var b2:MyButton;
public var b4:MyButton;
public var popInstr:PopInstructions;
public var b1:MyButton;
public var b3:MyButton;
public var btn_play:MovieClip;
public var clip:MovieClip;
public var btn_instr:MovieClip;
public var btn_scores:MovieClip;
private var mother:Main;
public var mc_popup:MovieClip;
public var mc_language:MovieClip;
public function MyMenu(_arg1:Main):void{
mother = _arg1;
addEventListener(Event.ADDED_TO_STAGE, hAdd);
}
public function hClick(_arg1:MouseEvent):void{
switch (_arg1.target){
case btn_play:
remove();
mother.gotoAndStop("game");
break;
case btn_scores:
stage.dispatchEvent(new ShowBoardEvent());
break;
case btn_instr:
popInstr.show();
break;
case mc_language:
mother.language = ((mother.language == "pl")) ? "en" : "pl";
setLanguage(mother.language);
break;
};
}
private function hAdd(_arg1:Event):void{
clip = new McMenu();
addChild(clip);
popInstr = new PopInstructions(mother.mc_popup);
btn_play = clip.btn_play;
btn_instr = clip.btn_instr;
btn_scores = clip.btn_scores;
mc_language = clip.mc_language;
b1 = new MyButton(btn_play, this);
b2 = new MyButton(btn_scores, this);
b3 = new MyButton(btn_instr, this);
b4 = new MyButton(mc_language, this);
setLanguage(mother.language);
}
private function remove():void{
b1.destroy();
b1 = null;
b2.destroy();
b3.destroy();
b4.destroy();
b2 = null;
b3 = null;
b4 = null;
}
public function setLanguage(_arg1:String):void{
if (btn_instr){
mc_language.n1.gotoAndStop(_arg1);
btn_play.n1.gotoAndStop(_arg1);
btn_instr.n1.gotoAndStop(_arg1);
btn_scores.n1.gotoAndStop(_arg1);
mother.mc_popup.gotoAndStop(_arg1);
mother.mc_popup.gotoAndStop(_arg1);
};
}
}
}//package interfaces
Section 61
//MySound (interfaces.MySound)
package interfaces {
import flash.events.*;
import flash.display.*;
import events.*;
import flash.media.*;
public class MySound extends MovieClip {
private var channel:SoundChannel;
public var s1:Sound;
private var turnOn:Boolean;// = true
private var sLoop:Sound;
public function MySound():void{
turnOn = true;
super();
s1 = new SReflect();
sLoop = new Loop1();
addEventListener(Event.ADDED_TO_STAGE, hAdd);
}
private function hAdd(_arg1:Event):void{
stage.addEventListener(SoundChangeEvent.SOUND_CHANGE, hChange);
stage.addEventListener(BallReflectEvent.REFLECT, hReflect);
}
private function hReflect(_arg1:BallReflectEvent):void{
if (turnOn == true){
s1.play(0, 1);
};
}
public function hChange(_arg1:SoundChangeEvent):void{
if (turnOn == false){
channel = sLoop.play(0, 999);
turnOn = true;
} else {
channel.stop();
turnOn = false;
};
}
public function playSound():void{
if (turnOn == true){
channel = sLoop.play(0, 999);
};
}
public function getSound():Boolean{
return (turnOn);
}
}
}//package interfaces
Section 62
//PopInstructions (interfaces.PopInstructions)
package interfaces {
import flash.events.*;
import caurina.transitions.*;
import flash.display.*;
import com.*;
public class PopInstructions {
var clip:MovieClip;
var btn_close:MovieClip;
public function PopInstructions(_arg1:MovieClip):void{
var _local2:*;
super();
clip = _arg1;
btn_close = clip.btn_close;
_local2 = new MyButton(clip.btn_close, this);
}
public function hide():void{
Tweener.addTween(clip, {y:-400, time:0.5, transition:"easeOutExpo"});
}
public function hClick(_arg1:MouseEvent):void{
hide();
}
public function show():void{
Tweener.addTween(clip, {y:120, time:0.5, transition:"easeOutBack"});
}
}
}//package interfaces
Section 63
//Scores (interfaces.Scores)
package interfaces {
import flash.events.*;
import flash.display.*;
import events.*;
public class Scores extends MovieClip {
private var scores:Number;
public function Scores():void{
scores = 0;
addEventListener(Event.ADDED_TO_STAGE, hAdd);
}
public function destroy():void{
removeEventListener(Event.ADDED_TO_STAGE, hAdd);
stage.removeEventListener(AddScoresEvent.ADD_SCORE, hAddScores);
}
public function getScores():Number{
return (scores);
}
public function addScores(_arg1:int):void{
scores = (scores + _arg1);
stage.dispatchEvent(new UpdateScoresEvent(scores));
}
private function hAdd(_arg1:Event):void{
stage.addEventListener(AddScoresEvent.ADD_SCORE, hAddScores);
stage.addEventListener(EndGameEvent.END_GAME, hEndGame);
stage.dispatchEvent(new UpdateScoresEvent(scores));
}
private function hAddScores(_arg1:AddScoresEvent):void{
addScores(_arg1.scores);
}
private function hEndGame(_arg1:EndGameEvent):void{
stage.dispatchEvent(new SubmitScoresEvent(getScores()));
}
}
}//package interfaces
Section 64
//UserInterface (interfaces.UserInterface)
package interfaces {
import flash.events.*;
import flash.display.*;
import events.*;
import flash.utils.*;
import flash.text.*;
import com.*;
public class UserInterface extends MovieClip {
private var clips:Array;
private var conteners:Array;
private var scores:Number;
private var timer:Timer;
public var clip:MovieClip;
private var language:String;
private var lifes:uint;
public var tf:TextField;
public var tryCounter:uint;// = 0
public function UserInterface(_arg1:MovieClip):void{
tryCounter = 0;
clips = new Array();
conteners = new Array();
super();
clip = _arg1;
addEventListener(Event.ADDED_TO_STAGE, hAdd);
timer = new Timer(2);
timer.addEventListener(TimerEvent.TIMER, hUpdate);
}
public function hClick(_arg1:MouseEvent):void{
switch (_arg1.target){
case clip.btn_btm:
submitScores();
break;
case clip.btn_sound:
stage.dispatchEvent(new SoundChangeEvent());
break;
};
}
public function destroy():void{
removeEventListener(Event.ADDED_TO_STAGE, hAdd);
stage.removeEventListener(DifferenceEvent.DIFFERENCE_CHANGE, hDiff);
stage.removeEventListener(StartLevelEvent.LEVEL_START, hLevel);
stage.removeEventListener(UpdateScoresEvent.UPDATE_SCORES, hUpdateScores);
stage.removeEventListener(NextTrialEvent.NEXT_TRIAL, hNextTrial);
stage.removeEventListener(LooseLifeEvent.LOOSE_LIFE, hLooseLife);
clip.btn_btm.removeEventListener(MouseEvent.ROLL_OVER, hRollOver);
clip.btn_btm.removeEventListener(MouseEvent.ROLL_OUT, hRollOut);
clip.btn_btm.removeEventListener(MouseEvent.CLICK, hClick);
clip.btn_sound.removeEventListener(MouseEvent.ROLL_OVER, hRollOver);
clip.btn_sound.removeEventListener(MouseEvent.ROLL_OUT, hRollOut);
clip.btn_sound.removeEventListener(MouseEvent.CLICK, hClick);
}
private function hRollOut(_arg1:MouseEvent):void{
_arg1.target.gotoAndStop(1);
stage.dispatchEvent(new PauseOffEvent());
}
private function hLevel(_arg1:StartLevelEvent):void{
clip.btn_btm.addEventListener(MouseEvent.ROLL_OVER, hRollOver);
clip.btn_btm.addEventListener(MouseEvent.ROLL_OUT, hRollOut);
clip.btn_btm.addEventListener(MouseEvent.CLICK, hClick);
clip.btn_btm.buttonMode = true;
clip.btn_sound.addEventListener(MouseEvent.ROLL_OVER, hRollOver);
clip.btn_sound.addEventListener(MouseEvent.ROLL_OUT, hRollOut);
clip.btn_sound.addEventListener(MouseEvent.CLICK, hClick);
clip.btn_sound.buttonMode = true;
clip.tf_level.text = ((("level: " + (_arg1.level + 1).toString()) + "/") + _arg1.levelMax.toString());
}
private function hAdd(_arg1:Event):void{
lifes = 10;
tryCounter = 0;
clip.tf_lifes.text = lifes;
stage.addEventListener(StartLevelEvent.LEVEL_START, hLevel);
stage.addEventListener(DifferenceEvent.DIFFERENCE_CHANGE, hDiff);
stage.addEventListener(UpdateScoresEvent.UPDATE_SCORES, hUpdateScores);
stage.addEventListener(NextTrialEvent.NEXT_TRIAL, hNextTrial);
stage.addEventListener(LooseLifeEvent.LOOSE_LIFE, hLooseLife);
}
public function hLooseLife(_arg1:LooseLifeEvent):void{
lifes--;
clip.tf_lifes.text = lifes;
}
private function hNextTrial(_arg1:NextTrialEvent):void{
var _local2:uint;
conteners = new Array(clip.mc_trial0.n1, clip.mc_trial1.n1, clip.mc_trial2.n1);
_local2 = 0;
while (_local2 < _arg1.ballsId.length) {
clips[_local2] = getClip(_arg1.ballsId[_local2]);
clips[_local2].width = 70;
clips[_local2].height = 70;
conteners[_local2].addChild(clips[_local2]);
if (_arg1.trials == 3){
conteners[0].visible = true;
conteners[1].visible = true;
conteners[2].visible = true;
};
if (_arg1.trials == 2){
conteners[0].visible = false;
conteners[1].visible = true;
conteners[2].visible = true;
};
if (_arg1.trials == 1){
conteners[0].visible = false;
conteners[1].visible = false;
conteners[2].visible = true;
};
if (_arg1.trials == 0){
conteners[0].visible = false;
conteners[1].visible = false;
conteners[2].visible = false;
};
_local2++;
};
}
private function hUpdate(_arg1:TimerEvent):void{
var _local2:int;
tf = clip.tf_points;
_local2 = int(tf.text);
if (_local2 < scores){
tf.text = (_local2 + 1).toString();
if (scores == _local2){
timer.stop();
};
} else {
tf.text = scores.toString();
timer.stop();
};
}
public function submitScores():void{
stage.dispatchEvent(new EndGameEvent());
}
public function remove():void{
timer.stop();
timer.removeEventListener(TimerEvent.TIMER, hUpdate);
}
private function hRollOver(_arg1:MouseEvent):void{
_arg1.target.gotoAndStop(2);
stage.dispatchEvent(new PauseEvent());
}
private function hDiff(_arg1:DifferenceEvent):void{
if (Math.abs(_arg1.difference) < 40){
clip.mc_diff1.visible = false;
clip.mc_diff2.visible = true;
clip.mc_leftArrow.gotoAndStop(2);
clip.mc_rightArrow.gotoAndStop(2);
} else {
clip.mc_diff1.visible = true;
clip.mc_diff2.visible = false;
clip.mc_leftArrow.gotoAndStop(1);
clip.mc_rightArrow.gotoAndStop(1);
};
clip.tf_left.text = Math.floor(_arg1.mass1).toString();
clip.tf_right.text = Math.floor(_arg1.mass2).toString();
clip.mc_diff1.tf_diff.text = (Math.floor(_arg1.mass1) - Math.floor(_arg1.mass2)).toString();
clip.mc_diff2.tf_diff.text = (Math.floor(_arg1.mass1) - Math.floor(_arg1.mass2)).toString();
}
private function getClip(_arg1:uint):MovieClip{
switch (_arg1){
case 0:
return (new McIron());
case 1:
return (new McGold());
case 2:
return (new McGlass());
case 3:
return (new McIce());
case 4:
return (new McWood());
default:
return (new McIron());
};
}
private function hUpdateScores(_arg1:UpdateScoresEvent):void{
scores = _arg1.scores;
timer.start();
}
public function setLanguage(_arg1:String):void{
language = _arg1;
clip.mc_text.gotoAndStop(language);
}
}
}//package interfaces
Section 65
//MochiAd (mochi.as3.MochiAd)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showClickAwayAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_timeout:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var sendHostProgress:Boolean;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
sendHostProgress = false;
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
_local3 = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.root == null){
_local3 = true;
};
if (_local3){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType == "application"){
return (_local2);
};
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (_arg1.origFrameRate != undefined){
_arg1.stage.frameRate = _arg1.origFrameRate;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad._containerLCName != undefined){
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"});
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (_local3);
}
public static function _cleanup(_arg1:Object):void{
var idx:Number;
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
idx = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
} else {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest(((server + ".swf?cacheBust=") + new Date().getTime()));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (_arg1:IOErrorEvent):void{
trace("[MochiAds] Blocked URL");
});
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
if (typeof(_arg1[_local4[_local5]]) == "function"){
return (_arg1[_local4[_local5]].apply(_arg1, _arg3));
};
return (undefined);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function adShowing(_arg1:Object):void{
_arg1.origFrameRate = _arg1.stage.frameRate;
_arg1.stage.frameRate = 30;
}
public static function getValue(_arg1:Object, _arg2:String):Object{
var _local3:Array;
var _local4:Number;
_local3 = _arg2.split(".");
_local4 = 0;
while (_local4 < (_local3.length - 1)) {
if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local3[_local4]];
_local4++;
};
return (_arg1[_local3[_local4]]);
}
public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{
var _local4:Object;
var _local5:Object;
switch (_arg3.id){
case "setValue":
MochiAd.setValue(_arg1, _arg3.objectName, _arg3.value);
break;
case "getValue":
_local4 = MochiAd.getValue(_arg1, _arg3.objectName);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(_arg1, _arg3.method, _arg3.args);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5);
break;
default:
trace(("[mochiads rpc] unknown rpc id: " + _arg3.id));
};
}
public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return;
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
_arg1[_local4[_local5]] = _arg3;
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_w:Number;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var progress:Number;
var f:Function;
var sendHostProgress:Boolean;
var fn:Function;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}, ad_progress:function (_arg1:Number):void{
}, progress_override:function (_arg1:Object):Number{
return (NaN);
}, bar_offset:0};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
return;
};
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
MochiAd._cleanup(mc);
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = (10 + options.bar_offset);
bar.y = (h - 20);
};
bar_w = ((w - bar.x) - 10);
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo(bar_w, 0);
backing.lineTo(bar_w, 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo(bar_w, 0);
inside.lineTo(bar_w, 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo(bar_w, 0);
outline.lineTo(bar_w, 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
progress = Math.min(1, options.progress_override(clip));
f = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
if (!isNaN(progress)){
complete = (progress == 1);
} else {
if (clip.loaderInfo.bytesLoaded == clip.loaderInfo.bytesTotal){
complete = true;
} else {
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
mc.rpcTestFn = function (_arg1:String):Object{
trace(("[MOCHIAD rpcTestFn] " + _arg1));
return (_arg1);
};
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (_arg1:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Object;
var _local11:Number;
var _local12:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
_local7 = Math.min(1, options.progress_override(_local1));
if (_local7 == 1){
complete = true;
};
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
_local8 = ((100 * _local6) / _local5);
if (!isNaN(_local7)){
_local8 = (100 * _local7);
};
_local9 = ((100 * _local3) / chk.ad_msec);
_local10 = this._mochiad_bar._inside;
_local11 = Math.min(100, Math.min(((_local8) || (0)), _local9));
_local11 = Math.max(this.last_pcnt, _local11);
this.last_pcnt = _local11;
_local10.scaleX = (_local11 * 0.01);
options.ad_progress(_local11);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local8});
if (_local8 >= 100){
sendHostProgress = false;
};
};
if (!chk.showing){
_local12 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local12 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((_local3 > chk.ad_timeout)) && ((_local8 == 100)))){
options.ad_failed();
_local4 = true;
};
};
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (unloaded){
MochiAd.unload(_local1);
} else {
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package mochi.as3
Section 66
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const LOGGED_IN:String = "LoggedIn";
public static const STORE_ITEMS:String = "StoreItems";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const ITEM_NEW:String = "ItemNew";
public static const USER_INFO:String = "UserInfo";
public static const IO_ERROR:String = "IOError";
public static const ITEM_OWNED:String = "ItemOwned";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const ERROR:String = "Error";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_HIDE:String = "LoginHide";
public static const LOGIN_SHOW:String = "LoginShow";
public static const STORE_SHOW:String = "StoreShow";
public static const PROFILE_HIDE:String = "ProfileHide";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("coins_saveUserProperties", _arg1);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showLoginWidget", {options:_arg1});
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showStore(_arg1:Object=null):void{
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function getUserInfo():void{
MochiServices.send("coins_getUserInfo");
}
public static function hideLoginWidget():void{
MochiServices.send("coins_hideLoginWidget");
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
}
}//package mochi.as3
Section 67
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function reencode():void{
var _local1:uint;
_local1 = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function toString():String{
var _local1:String;
_local1 = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
public function get value():Number{
return (Number(this.toString()));
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String;
_local3 = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
}
}//package mochi.as3
Section 68
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
eventTable = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
return;
};
for (_local3 in eventTable[_arg1]) {
var _local6 = eventTable[_arg1];
_local6[_local3](_arg2);
};
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
eventTable[_arg1] = [];
return;
};
for (_local3 in eventTable[_arg1]) {
if (eventTable[_arg1][_local3] != _arg2){
} else {
eventTable[_arg1].splice(Number(_local3), 1);
};
};
}
public function addEventListener(_arg1:String, _arg2:Function):void{
removeEventListener(_arg1, _arg2);
eventTable[_arg1].push(_arg2);
}
}
}//package mochi.as3
Section 69
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function startSession(_arg1:String):void{
MochiServices.send("events_beginSession", {achievementID:_arg1}, null, null);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function setNotifications(_arg1:MovieClip, _arg2:Object):void{
var _local3:Object;
var _local4:Object;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
_local3.clip = _arg1;
MochiServices.send("events_setNotifications", _local3, null, null);
}
public static function endGame():void{
var _local1:Number;
_local1 = (new Date().time - gameStart);
trigger("end_game", {time:_local1});
}
public static function startGame():void{
gameStart = new Date().time;
trigger("start_game");
}
public static function trigger(_arg1:String, _arg2:Object=null):void{
if (_arg2 == null){
_arg2 = {};
} else {
if (_arg2["kind"] != undefined){
trace("WARNING: optional arguements package contains key 'id', it will be overwritten");
_arg2["kind"] = _arg1;
};
};
MochiServices.send("events_triggerEvent", {eventObject:_arg2}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startLevel():void{
levelStart = new Date().time;
trigger("start_level");
}
public static function endLevel():void{
var _local1:Number;
_local1 = (new Date().time - levelStart);
trigger("end_level", {time:_local1});
}
}
}//package mochi.as3
Section 70
//MochiScores (mochi.as3.MochiScores)
package mochi.as3 {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public static function showLeaderboard(_arg1:Object=null):void{
var n:Number;
var options = _arg1;
if (options != null){
delete options.clip;
MochiServices.setContainer();
MochiServices.bringToTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local2:Object;
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
_local2 = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
_arg1 = Number(_arg1);
if (isNaN(_arg1)){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(_arg1) != _arg1){
trace((("WARNING: Submitted score '" + String(_arg1)) + "' will be truncated"));
};
_arg1 = Number(_arg1);
};
};
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (((((_arg1) && ((_arg1.error == true)))) && (onErrorHandler))){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiServices.warnID(_arg1, true);
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi.as3
Section 71
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
public static var servicesSync:MochiSync = new MochiSync();
private static var _clip:MovieClip;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _loader:Loader;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(_arg1:Object):void{
var cb:String;
var cblst:Object;
var method:*;
var methodName:String;
var obj:Object;
var pkg = _arg1;
cb = pkg.callbackID;
cblst = _clip._callbacks[cb];
if (!cblst){
return;
};
method = cblst.callbackMethod;
methodName = "";
obj = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete _clip._callbacks[cb];
}
public static function get childClip():Object{
return (_clip);
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + _arg1));
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_clip._nextcallbackID++;
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local3:Array;
var _local4:int;
var _local5:Array;
var _local6:Array;
var _local7:MovieClip;
var _local8:LocalConnection;
var _local9:String;
var _local10:ByteArray;
var _local11:ByteArray;
var _local12:uint;
var _local13:uint;
var _local14:Loader;
_local3 = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
_local5 = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
_local6 = [0, 64, 0, 0, 0];
_local7 = new MovieClip();
_local8 = new LocalConnection();
_local9 = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
_local10 = new ByteArray();
_local11 = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
_local12 = ((_local3.length + _local11.length) + 4);
_local13 = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var vars:Object;
var avm1Click:DisplayObject;
var s:String;
var i:Number;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
vars = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
s = "?";
i = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
var _local2:Rectangle;
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
_local2 = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
var _local3:Number;
_arg1 = _arg1.toLowerCase();
if (_arg1.length != 16){
trace((("WARNING: " + (_arg2) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
_local3 = 0;
while (_local3 < _arg1.length) {
switch (_arg1.charAt(_local3)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + _arg1));
return;
};
_local3++;
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_mochiLocalConnection.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
};
return (_local2);
}
public static function getVersion():String{
return ("3.3 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (((_clip) && (_clip._queue))){
while (_clip._queue.length > 0) {
_local2 = _clip._queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _clip._callbacks[_local2.callbackID];
};
delete _clip._callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(_arg1:Object):void{
var _local2:String;
var _local3:String;
_local2 = _arg1.target;
_local3 = _arg1.event;
switch (_local2){
case "events":
MochiEvents.triggerEvent(_arg1.event, _arg1.args);
break;
case "coins":
MochiCoins.triggerEvent(_arg1.event, _arg1.args);
break;
case "sync":
servicesSync.triggerEvent(_arg1.event, _arg1.args);
break;
};
}
private static function urlOptions(_arg1:Object):Object{
var _local2:Object;
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:Array;
_local2 = {};
if (_arg1.stage){
_local3 = _arg1.stage.loaderInfo.parameters.mochiad_options;
} else {
_local3 = _arg1.loaderInfo.parameters.mochiad_options;
};
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_arg1 != null){
if ((_arg1 is Sprite)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
private static function loadError(_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, clip:_container, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_clip._queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function loadLCBridge(_arg1:Object):void{
var loader:Loader;
var mochiLCURL:String;
var req:URLRequest;
var complete:Function;
var clip = _arg1;
loader = new Loader();
mochiLCURL = (_servURL + _mochiLC);
req = new URLRequest(mochiLCURL);
complete = function (_arg1:Object):void{
_mochiLocalConnection = MovieClip(loader.content);
listen();
};
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var _local3:String;
var _local4:String;
var _local5:URLRequest;
var _local6:URLVariables;
_local3 = ("_mochiservices_com_" + _arg1);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(_arg2).servURL){
_servURL = urlOptions(_arg2).servURL;
};
_local4 = (_servURL + _services);
if (urlOptions(_arg2).servicesURL){
_local4 = urlOptions(_arg2).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(_local4);
_clip = createEmptyMovieClip(_arg2, _local3, 10336, false);
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
_local5 = new URLRequest(_local4);
_local6 = new URLVariables();
_local6.listenLC = _listenChannelName;
_local6.mochiad_options = _arg2.loaderInfo.parameters.mochiad_options;
_local6.api_version = getVersion();
if (widget){
_local6.widget = true;
};
_local5.data = _local6;
_loader.load(_local5);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_clip._nextcallbackID = 0;
_clip._callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
warnID(id, false);
if ((clip is DisplayObject)){
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{
var mc:MovieClip;
var parent = _arg1;
var name = _arg2;
var depth = _arg3;
var doAdd = _arg4;
mc = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
try {
parent[name] = mc;
} catch(e:Error) {
throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
mc["_name"] = name;
return (mc);
}
public static function bringToTop(_arg1:Event=null):void{
var e = _arg1;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 72
//MochiSync (mochi.as3.MochiSync)
package mochi.as3 {
import flash.utils.*;
public dynamic class MochiSync extends Proxy {
private var _syncContainer:Object;
public static var SYNC_PROPERTY:String = "UpdateProperty";
public static var SYNC_REQUEST:String = "SyncRequest";
public function MochiSync():void{
_syncContainer = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
switch (_arg1){
case SYNC_REQUEST:
MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY:
_syncContainer[_arg2.name] = _arg2.value;
break;
};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
return (_syncContainer[_arg1]);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:String;
if (_syncContainer[_arg1] == _arg2){
return;
};
_local3 = _arg1.toString();
_syncContainer[_local3] = _arg2;
MochiServices.send("sync_propUpdate", {name:_local3, value:_arg2});
}
}
}//package mochi.as3
Section 73
//Arm (objects.Arm)
package objects {
import flash.events.*;
import flash.display.*;
import events.*;
import draw.*;
public class Arm extends MovieClip {
public var myPosition:Number;
public var maxWeight:uint;// = 113
public var id:uint;
public var clip:MovieClip;
public var velY:Number;
public var o:Array;
public var w:Number;
public var aObjects:Array;
public var border1:Number;// = 0
private var ds:DrawShape;
public var border2:Number;// = 1000
public var centerY:uint;// = 300
public static var counter:uint = 0;
public function Arm(_arg1, _arg2, _arg3, _arg4):void{
o = new Array();
border1 = 0;
border2 = 1000;
centerY = 300;
maxWeight = 113;
super();
velY = 0;
x = _arg1;
y = _arg2;
aObjects = new Array();
border1 = _arg1;
border2 = _arg3;
ds = new DrawShape("arm", 0);
addChild(ds);
ds.drawRect(0, 0, (_arg3 - _arg1), (_arg4 - _arg2));
w = (_arg3 - _arg1);
id = counter++;
clip = new McArm();
clip.cacheAsBitmap = true;
addChild(clip);
addEventListener(Event.ADDED_TO_STAGE, hAdd);
}
public function destroy():void{
stage.removeEventListener(DestroyBallEvent.DESTROY_BALL, destroyBall);
ds.destroy();
ds = null;
}
private function removeObject(_arg1:Ball):void{
var _local2:int;
var _local3:uint;
_local2 = -1;
while (_local3 < aObjects.length) {
if (_arg1 == aObjects[_local3]){
_local2 = _local3;
break;
};
_local3++;
};
if (_local2 != -1){
aObjects = removeFromArray(aObjects, _local2);
};
}
public function addSpeed():void{
velY = (velY + 1);
}
private function hAdd(_arg1:Event):void{
stage.addEventListener(DestroyBallEvent.DESTROY_BALL, destroyBall);
}
private function destroyBall(_arg1:DestroyBallEvent):void{
removeObject(_arg1.object);
}
public function sortBalls(_arg1):void{
var _local2:uint;
var _local3:uint;
o = new Array();
_local3 = 0;
while (_local3 < aObjects.length) {
o.push({ob:aObjects[_local3], xx:aObjects[_local3].x});
_local3++;
};
o.sortOn("xx", Array.NUMERIC);
_local3 = 0;
while (_local3 < aObjects.length) {
if (_arg1 == o[_local3].ob){
_local2 = _local3;
};
_local3++;
};
rozsun(_local2);
}
public function getMass():Number{
var _local1:Number;
var _local2:*;
_local1 = 0;
for (_local2 in aObjects) {
_local1 = (_local1 + aObjects[_local2].getMass());
};
return (_local1);
}
public function addObject(_arg1):void{
aObjects.push(_arg1);
}
public function rozsun(_arg1:int){
var _local2:int;
var _local3:Number;
var _local4:*;
_local2 = (_arg1 + 1);
while (_local2 < o.length) {
if (o[_local2].ob.x < ((o[(_local2 - 1)].ob.x + (o[(_local2 - 1)].ob.width / 2)) + (o[_local2].ob.width / 2))){
o[_local2].ob.x = ((o[(_local2 - 1)].ob.x + (o[(_local2 - 1)].ob.width / 2)) + (o[_local2].ob.width / 2));
};
_local2++;
};
_local2 = (_arg1 - 1);
while (_local2 >= 0) {
if (o[_local2].ob.x > ((o[(_local2 + 1)].ob.x - (o[(_local2 + 1)].ob.width / 2)) - (o[_local2].ob.width / 2))){
o[_local2].ob.x = ((o[(_local2 + 1)].ob.x - (o[(_local2 + 1)].ob.width / 2)) - (o[_local2].ob.width / 2));
};
_local2--;
};
_local3 = 0;
for (_local4 in aObjects) {
_local3 = (_local3 + aObjects[_local4].width);
};
if (_local3 < (((border2 - border1) + (o[0].ob.width / 2)) + (o[(o.length - 1)].ob.width / 2))){
if (o[0].ob.x < border1){
o[0].ob.x = border1;
rozsun(0);
};
if (o[(o.length - 1)].ob.x > border2){
o[(o.length - 1)].ob.x = border2;
rozsun((o.length - 1));
};
};
}
public function setPosition(_arg1:Number):void{
myPosition = -(_arg1);
addEventListener(Event.ENTER_FRAME, hEnterFrame);
}
public function removeFromArray(_arg1:Array, _arg2:uint):Array{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _arg1.length) {
if (_local4 < _arg2){
_local3[_local4] = _arg1[_local4];
};
if (_local4 > _arg2){
_local3[(_local4 - 1)] = _arg1[_local4];
};
_local4++;
};
return (_local3);
}
private function hEnterFrame(_arg1:Event):void{
var _local2:*;
if (y <= (centerY + myPosition)){
if (((((y + 2) < (centerY + myPosition))) && (((y - 2) < (centerY + maxWeight))))){
y = (y + 2);
} else {
if (myPosition > maxWeight){
stage.dispatchEvent(new BreakOffEvent());
} else {
y = (centerY + myPosition);
};
stage.dispatchEvent(new StopArmEvent());
removeEventListener(Event.ENTER_FRAME, hEnterFrame);
};
};
if (y > (centerY + myPosition)){
if (((((y - 2) > (centerY + myPosition))) && (((y - 2) > (centerY - maxWeight))))){
y = (y - 2);
} else {
if (myPosition < -(maxWeight)){
stage.dispatchEvent(new BreakOffEvent());
} else {
y = (centerY + myPosition);
};
stage.dispatchEvent(new StopArmEvent());
removeEventListener(Event.ENTER_FRAME, hEnterFrame);
};
};
for (_local2 in aObjects) {
if (aObjects[_local2].isSleeping == true){
aObjects[_local2].y = (y - aObjects[_local2].radius);
};
};
}
}
}//package objects
Section 74
//Ball (objects.Ball)
package objects {
import flash.display.*;
public class Ball extends MovieClip {
public var isSleeping;// = false
private var mass:Number;
private var names:Array;
public var clip:MovieClip;
public var velY:Number;
public var radius:Number;
public var id_material:uint;
private var density:Array;
public var isAdded:Boolean;// = false
public function Ball(_arg1, _arg2, _arg3, _arg4):void{
names = new Array("iron", "gold", "glass", "ice", "wood");
density = new Array(7875, 19282, 2400, 900, 600);
isSleeping = false;
isAdded = false;
super();
id_material = _arg4;
velY = 0;
x = _arg1;
y = _arg2;
radius = _arg3;
clip = getClip(id_material);
clip.width = (radius * 2);
clip.height = (radius * 2);
addChild(clip);
setMass();
}
public function destroy():void{
removeChild(clip);
clip = null;
}
public function addSpeed():void{
velY = (velY + 1);
}
public function getMass():Number{
return (mass);
}
public function setMass():void{
mass = ((((4 / 3) * Math.PI) * Math.pow((radius / 100), 3)) * density[id_material]);
if (mass < 1){
mass = 1;
};
}
public function reflect():void{
velY = (velY / -4);
if ((((velY < 0)) && ((velY > -2)))){
velY = 0;
isSleeping = true;
};
}
public function getX():Number{
return (x);
}
public function getY():Number{
return (y);
}
private function getClip(_arg1:uint):MovieClip{
switch (_arg1){
case 0:
return (new McIron());
case 1:
return (new McGold());
case 2:
return (new McGlass());
case 3:
return (new McIce());
case 4:
return (new McWood());
default:
return (new McIron());
};
}
}
}//package objects
Section 75
//Cloud (objects.Cloud)
package objects {
import flash.events.*;
import flash.display.*;
public class Cloud extends MovieClip {
public var clip:McCloud;
public var speed:Number;
public var ysc:Number;
public var xsc:Number;
public function Cloud():void{
clip = new McCloud();
setProp();
addChild(clip);
addEventListener(Event.ENTER_FRAME, hFrame);
}
public function destroy():void{
removeEventListener(Event.ENTER_FRAME, hFrame);
}
private function hFrame(_arg1:Event):void{
clip.x = (clip.x - speed);
if ((clip.x + clip.width) < -10){
clip.visible = false;
setProp();
clip.x = 810;
clip.visible = true;
};
}
private function setProp():void{
clip.y = (Math.random() * 300);
clip.x = (Math.random() * 800);
xsc = (((Math.random() * 70) + 30) / 100);
clip.alpha = (((Math.random() * 70) + 30) / 100);
speed = Math.round(((Math.random() * 3) + 1));
clip.gotoAndStop(Math.round(((Math.random() * 10) + 1)));
clip.scaleX = xsc;
clip.scaleY = clip.scaleX;
}
}
}//package objects
Section 76
//Whell (objects.Whell)
package objects {
import flash.events.*;
import flash.display.*;
import events.*;
import com.hexagonstar.util.debug.*;
public class Whell extends MovieClip {
private var lastDiff:Number;
public var moves:Boolean;// = false
public function Whell():void{
moves = false;
super();
stop();
addEventListener(Event.ADDED_TO_STAGE, hAdd);
}
private function hAdd(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, hAdd);
stage.addEventListener(DifferenceEvent.DIFFERENCE_CHANGE, hStart);
stage.addEventListener(StopArmEvent.STOP_ARM, hStop);
Debug.monitor(stage, 1000);
}
public function hStop(_arg1:StopArmEvent):void{
if (moves == true){
stop();
moves = false;
};
}
public function hStart(_arg1:DifferenceEvent):void{
if ((((moves == false)) && (!((lastDiff == _arg1.difference))))){
Debug.mark(0xFF0000);
lastDiff = _arg1.difference;
play();
moves = true;
};
}
}
}//package objects
Section 77
//Gravity (physics.Gravity)
package physics {
import flash.events.*;
import flash.display.*;
import events.*;
import interfaces.*;
public class Gravity extends MovieClip {
public var aObjects:Array;
public var grounds:Array;
public function Gravity():void{
aObjects = new Array();
grounds = new Array();
addEventListener(Event.ADDED_TO_STAGE, hAdd);
}
public function destroy():void{
var _local1:uint;
removeEventListener(Event.ENTER_FRAME, hEnterFrame);
_local1 = 0;
while (_local1 < aObjects.length) {
aObjects[_local1].destroy();
_local1++;
};
}
private function hAdd(_arg1:Event):void{
addEventListener(Event.ENTER_FRAME, hEnterFrame);
}
public function addObject(_arg1):void{
aObjects.push(_arg1);
}
public function addGround(_arg1):void{
grounds.push(_arg1);
}
public function removeFromArray(_arg1:Array, _arg2:uint):Array{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _arg1.length) {
if (_local4 < _arg2){
_local3[_local4] = _arg1[_local4];
};
if (_local4 > _arg2){
_local3[(_local4 - 1)] = _arg1[_local4];
};
_local4++;
};
return (_local3);
}
private function hEnterFrame(_arg1:Event):void{
var _local2:Number;
var _local3:uint;
var _local4:uint;
var _local5:Boolean;
var _local6:uint;
var _local7:*;
var _local8:String;
_local2 = -1;
_local3 = 0;
while (_local3 < aObjects.length) {
if (aObjects[_local3].isSleeping == false){
_local4 = ((aObjects[_local3].x < 400)) ? 0 : 1;
if (aObjects[_local3].x < grounds[_local4].x){
aObjects[_local3].x = grounds[_local4].x;
};
if (aObjects[_local3].x > (grounds[_local4].x + grounds[_local4].w)){
aObjects[_local3].x = (grounds[_local4].x + grounds[_local4].w);
};
_local5 = false;
_local6 = 0;
while (_local6 < aObjects.length) {
if (_local5 == false){
if (((aObjects[_local3].hitTestObject(aObjects[_local6])) && (!((aObjects[_local3] == aObjects[_local6]))))){
grounds[_local4].sortBalls(aObjects[_local3]);
_local5 = true;
};
};
_local6++;
};
aObjects[_local3].y = (aObjects[_local3].y + aObjects[_local3].velY);
aObjects[_local3].addSpeed();
if ((((aObjects[_local3].y >= (grounds[_local4].y - aObjects[_local3].radius))) && (((aObjects[_local3].y - (grounds[_local4].y - aObjects[_local3].radius)) < 40)))){
aObjects[_local3].y = (grounds[_local4].y - aObjects[_local3].radius);
if (aObjects[_local3].isSleeping == false){
stage.dispatchEvent(new BallReflectEvent());
aObjects[_local3].reflect();
if (aObjects[_local3].isAdded == false){
_local7 = Math.floor(((grounds[0].getMass() - grounds[1].getMass()) / 10));
stage.dispatchEvent(new DifferenceEvent(grounds[0].getMass(), grounds[1].getMass()));
grounds[0].setPosition(-(_local7));
grounds[1].setPosition(_local7);
aObjects[_local3].isAdded = true;
_local8 = "";
if (Math.round(aObjects[_local3].getMass()) > 0){
_local8 = Math.round(aObjects[_local3].getMass()).toString();
} else {
_local8 = "1";
};
addChild(new Caption(_local8, (aObjects[_local3].getX() - x), (aObjects[_local3].getY() - y)));
};
};
};
if (aObjects[_local3].y > 700){
_local2 = _local3;
stage.dispatchEvent(new DifferenceEvent(grounds[0].getMass(), grounds[1].getMass()));
};
};
_local3++;
};
if (_local2 != -1){
stage.dispatchEvent(new DestroyBallEvent(aObjects[_local2]));
aObjects = removeFromArray(aObjects, _local2);
};
}
}
}//package physics
Section 78
//PopupBad (popups.PopupBad)
package popups {
import flash.events.*;
import events.*;
import com.*;
public class PopupBad extends PopupBadMc {
public var b1:MyButton;
public function PopupBad():void{
addEventListener(Event.ADDED_TO_STAGE, hAdd);
}
public function hClick(_arg1:MouseEvent):void{
switch (_arg1.target){
case btn_ok:
stage.dispatchEvent(new LooseLifeEvent());
remove();
break;
};
}
private function hAdd(_arg1:Event):void{
x = 400;
y = 300;
b1 = new MyButton(btn_ok, this);
}
private function remove():void{
b1.destroy();
b1 = null;
removeEventListener(Event.ADDED_TO_STAGE, hAdd);
}
}
}//package popups
Section 79
//PopupGood (popups.PopupGood)
package popups {
import flash.events.*;
import events.*;
import com.*;
public class PopupGood extends PopupGoodMc {
public var b1:MyButton;
public function PopupGood():void{
addEventListener(Event.ADDED_TO_STAGE, hAdd);
}
public function hClick(_arg1:MouseEvent):void{
switch (_arg1.target){
case btn_ok:
remove();
stage.dispatchEvent(new EndLevelEvent());
break;
};
}
private function hAdd(_arg1:Event):void{
x = 400;
y = 300;
b1 = new MyButton(btn_ok, this);
}
private function remove():void{
b1.destroy();
b1 = null;
removeEventListener(Event.ADDED_TO_STAGE, hAdd);
}
}
}//package popups
Section 80
//Level (Level)
package {
import flash.events.*;
import flash.display.*;
import objects.*;
import events.*;
import data.*;
import interfaces.*;
import draw.*;
import popups.*;
import physics.*;
public class Level extends MovieClip {
private var popup1:PopupGood;
private var popup2:PopupBad;
private var trials:uint;
private var lifes:uint;
private var difference:Number;// = 0
public var arm2:Arm;
public var gravity:Gravity;
public var circle2:MovieClip;
public var arm1:Arm;
private var levelData:LevelData;
public var circle1:MovieClip;
private var level:uint;
private var maxDiff:uint;
public var ma:MouseAction;
private var mask1:MovieClip;
private var mask2:MovieClip;
public var ballsId:Array;
public var clouds:Array;
public function Level():void{
difference = 0;
ballsId = new Array();
super();
level = 0;
addEventListener(Event.ADDED_TO_STAGE, hAdd);
}
public function destroy():void{
removeEventListener(Event.ADDED_TO_STAGE, hAdd);
stage.removeEventListener(CreateBallEvent.CREATE_BALL, addBall);
stage.removeEventListener(DifferenceEvent.DIFFERENCE_CHANGE, hDiff);
stage.removeEventListener(EndLevelEvent.LEVEL_END, hEndLevel);
stage.removeEventListener(LooseLifeEvent.LOOSE_LIFE, hLooseLife);
stage.removeEventListener(DestroyBallEvent.DESTROY_BALL, destroyBall);
stage.removeEventListener(BreakOffEvent.BREAK, hBreakOff);
stage.removeEventListener(StopArmEvent.STOP_ARM, hStopArm);
}
private function hAdd(_arg1:Event):void{
lifes = 10;
stage.addEventListener(CreateBallEvent.CREATE_BALL, addBall);
stage.addEventListener(EndLevelEvent.LEVEL_END, hEndLevel);
stage.addEventListener(MenuEvent.GO_TO_MENU, hMenu);
stage.addEventListener(LooseLifeEvent.LOOSE_LIFE, hLooseLife);
stage.addEventListener(DestroyBallEvent.DESTROY_BALL, destroyBall);
stage.addEventListener(BreakOffEvent.BREAK, hBreakOff);
stage.addEventListener(StopArmEvent.STOP_ARM, hStopArm);
createStage();
}
public function hLooseLife(_arg1:LooseLifeEvent):void{
removeChild(popup2);
popup2 = null;
lifes--;
if (lifes == 0){
stage.dispatchEvent(new EndGameEvent());
} else {
clearStage();
createStage();
};
}
private function clearStage():void{
var _local1:uint;
if (ma){
ma.destroy();
ma = null;
removeChild(circle2);
removeChild(circle1);
circle1 = null;
circle2 = null;
removeChild(arm1);
arm1 = null;
removeChild(arm2);
arm2 = null;
gravity.destroy();
removeChild(gravity);
gravity = null;
};
if (popup2){
removeChild(popup2);
popup2 = null;
};
_local1 = 0;
while (_local1 < clouds.length) {
removeChild(clouds[_local1]);
clouds[_local1] = null;
_local1++;
};
}
private function destroyBall(_arg1:DestroyBallEvent):void{
removeChild(_arg1.object);
}
private function createStage():void{
var _local1:uint;
var _local2:Array;
var _local3:*;
clouds = new Array();
_local1 = 0;
while (_local1 < 4) {
clouds[_local1] = new Cloud();
addChild(clouds[_local1]);
_local1++;
};
circle1 = new McCircle();
circle2 = new McCircle();
circle1.x = 174.4;
circle1.y = -4.4;
circle2.x = 516;
circle2.y = -4.4;
addChild(circle2);
addChild(circle1);
mask1 = new Mask1();
mask1.y = 54;
addChild(mask1);
mask2 = new Mask1();
mask2.y = 54;
addChild(mask2);
arm1 = new Arm(50, 300, 350, 310);
addChild(arm1);
arm1.mask = mask1;
arm2 = new Arm(450, 300, 750, 310);
addChild(arm2);
arm2.mask = mask2;
gravity = new Gravity();
addChild(gravity);
gravity.addGround(arm1);
gravity.addGround(arm2);
levelData = new LevelData(level);
stage.addEventListener(DifferenceEvent.DIFFERENCE_CHANGE, hDiff);
_local2 = levelData.getData();
for (_local3 in _local2) {
stage.dispatchEvent(new CreateBallEvent(_local2[_local3].x, _local2[_local3].y, _local2[_local3].r, _local2[_local3].id, "level"));
};
trials = levelData.getTrials();
ballsId = levelData.getBalls();
stage.dispatchEvent(new NextTrialEvent(trials, ballsId));
maxDiff = levelData.maxDiff;
ma = new MouseAction();
ma.setBalls(ballsId);
addChild(ma);
stage.dispatchEvent(new StartLevelEvent(level, levelData.getLength(), maxDiff));
}
private function hBreakOff(_arg1:BreakOffEvent):void{
if (!popup2){
popup2 = new PopupBad();
addChild(popup2);
};
}
private function hStopArm(_arg1:StopArmEvent):void{
var _local2:Number;
if ((((((Math.abs(difference) <= maxDiff)) && ((trials == 0)))) || ((Math.abs(difference) < 10)))){
ma.destroy();
if (!popup1){
popup1 = new PopupGood();
addChild(popup1);
};
_local2 = (Math.round((500 - (Math.abs(difference) * 10))) + (trials * 200));
stage.dispatchEvent(new AddScoresEvent(_local2));
trials = 0;
};
if ((((Math.abs(difference) > maxDiff)) && ((trials == 0)))){
if (!popup2){
popup2 = new PopupBad();
addChild(popup2);
};
};
}
private function hDiff(_arg1:DifferenceEvent):void{
difference = _arg1.difference;
if ((((Math.abs(difference) > maxDiff)) && ((trials == 0)))){
if (!popup2){
popup2 = new PopupBad();
addChild(popup2);
};
};
}
public function addBall(_arg1:CreateBallEvent):void{
var _local2:*;
_local2 = new Ball(_arg1.xPos, _arg1.yPos, _arg1.radius, _arg1.id_material);
addChild(_local2);
gravity.addObject(_local2);
if (_arg1.xPos < 400){
if (_arg1.yPos < arm1.y){
arm1.addObject(_local2);
};
} else {
if (_arg1.yPos < arm2.y){
arm2.addObject(_local2);
};
};
if (_arg1.creator == "player"){
trials--;
stage.dispatchEvent(new NextTrialEvent(trials, ballsId));
if (trials == 0){
ma.destroy();
};
};
addChild(gravity);
}
public function setLanguage(_arg1:String):void{
}
private function hEndLevel(_arg1:EndLevelEvent):void{
removeChild(popup1);
popup1 = null;
clearStage();
level++;
if (level > (levelData.getLength() - 1)){
stage.dispatchEvent(new EndGameEvent());
} else {
createStage();
};
}
public function hMenu(_arg1:MenuEvent):void{
clearStage();
stage.removeEventListener(MenuEvent.GO_TO_MENU, hMenu);
}
}
}//package
Section 81
//Loop1 (Loop1)
package {
import flash.media.*;
public dynamic class Loop1 extends Sound {
}
}//package
Section 82
//Main (Main)
package {
import flash.events.*;
import flash.display.*;
import events.*;
import interfaces.*;
public dynamic class Main extends MovieClip {
public var mc_sound:MovieClip;
public var scores:Scores;
public var mc_glosnik:MovieClip;
public var language:String;// = "en"
private var menu:MyMenu;
public var level:Level;
public var ui:UserInterface;
public var mc_logo:MovieClip;
private var mySound:MySound;
public var mc_ui:MovieClip;
public var mc_language:MovieClip;
private var adds:Adds;
public function Main():void{
language = "en";
super();
addFrameScript(10, frame11, 17, frame18);
addEventListener(Event.ADDED_TO_STAGE, hAdd);
}
public function initGame():void{
ui = new UserInterface(mc_ui);
ui.setLanguage(language);
addChild(ui);
removeChild(menu);
menu = null;
level = new Level();
level.setLanguage(language);
stage.addEventListener(MenuEvent.GO_TO_MENU, hMenu);
addChild(level);
scores = new Scores();
addChild(scores);
}
public function hAdd(_arg1:Event){
addChild(new Secure());
adds = new Adds(this);
addChild(adds);
}
function frame18(){
stop();
initGame();
}
function frame11(){
stop();
initMenu();
}
public function initMenu():void{
var _local1:Logo;
if (!mySound){
mySound = new MySound();
addChild(mySound);
mySound.playSound();
};
if (level){
level.destroy();
level = null;
};
if (ui){
ui.destroy();
ui = null;
};
_local1 = new Logo(mc_logo);
menu = new MyMenu(this);
addChild(menu);
}
public function hMenu(_arg1:MenuEvent):void{
stage.removeEventListener(MenuEvent.GO_TO_MENU, hMenu);
gotoAndStop("menu");
}
}
}//package
Section 83
//Mask1 (Mask1)
package {
import flash.display.*;
public dynamic class Mask1 extends MovieClip {
}
}//package
Section 84
//McArm (McArm)
package {
import flash.display.*;
public dynamic class McArm extends MovieClip {
}
}//package
Section 85
//McCaption (McCaption)
package {
import flash.display.*;
import flash.text.*;
public dynamic class McCaption extends MovieClip {
public var tf1:TextField;
}
}//package
Section 86
//McCircle (McCircle)
package {
import flash.display.*;
import objects.*;
public dynamic class McCircle extends MovieClip {
public var n1:Whell;
}
}//package
Section 87
//McCloud (McCloud)
package {
import flash.display.*;
public dynamic class McCloud extends MovieClip {
public function McCloud(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 88
//McGlass (McGlass)
package {
import flash.display.*;
public dynamic class McGlass extends MovieClip {
}
}//package
Section 89
//McGold (McGold)
package {
import flash.display.*;
public dynamic class McGold extends MovieClip {
}
}//package
Section 90
//McIce (McIce)
package {
import flash.display.*;
public dynamic class McIce extends MovieClip {
}
}//package
Section 91
//McIron (McIron)
package {
import flash.display.*;
public dynamic class McIron extends MovieClip {
}
}//package
Section 92
//McMenu (McMenu)
package {
import caurina.transitions.*;
import flash.display.*;
public dynamic class McMenu extends MovieClip {
public var btn_play:MovieClip;
public var btn_instr:MovieClip;
public var btn_scores:MovieClip;
public var mc_language:MovieClip;
public function McMenu(){
addFrameScript(5, frame6, 8, frame9, 11, frame12, 39, frame40);
}
function frame12(){
Tweener.addTween(btn_scores, {x:172, time:0.5, transition:"easeOutBack"});
}
function frame6(){
Tweener.addTween(btn_play, {x:172, time:0.5, transition:"easeOutBack"});
}
function frame9(){
Tweener.addTween(btn_instr, {x:172, time:0.5, transition:"easeOutBack"});
}
function frame40(){
stop();
}
}
}//package
Section 93
//McWood (McWood)
package {
import flash.display.*;
public dynamic class McWood extends MovieClip {
}
}//package
Section 94
//PopupBadMc (PopupBadMc)
package {
import flash.display.*;
public dynamic class PopupBadMc extends MovieClip {
public var btn_ok:MovieClip;
}
}//package
Section 95
//PopupGoodMc (PopupGoodMc)
package {
import flash.display.*;
public dynamic class PopupGoodMc extends MovieClip {
public var btn_ok:MovieClip;
}
}//package
Section 96
//Secure (Secure)
package {
import flash.events.*;
import flash.display.*;
import flash.system.*;
public class Secure extends Sprite {
public function Secure():void{
addEventListener(Event.ADDED_TO_STAGE, hAdd);
}
private function hAdd(_arg1:Event):void{
Security.allowDomain("*");
stage.showDefaultContextMenu = false;
}
}
}//package
Section 97
//SReflect (SReflect)
package {
import flash.media.*;
public dynamic class SReflect extends Sound {
}
}//package