STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
229595
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2595 · P5190

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/23348731?noj=FRM23348731-22DC" width="1" height="1"></div>

Spin Madness.swf

This is the info page for
Flash #47138

(Click the ID number above for more basic data on this flash file.)


ActionScript [AS3]
Section 1
//FilterShortcuts (caurina.transitions.properties.FilterShortcuts) package caurina.transitions.properties { import caurina.transitions.*; import flash.display.*; import flash.geom.*; import flash.filters.*; public class FilterShortcuts { public function FilterShortcuts(){ trace("This is an static class and should not be instantiated."); } public static function init():void{ Tweener.registerSpecialPropertySplitter("_filter", _filter_splitter); Tweener.registerSpecialProperty("_Bevel_angle", _filter_property_get, _filter_property_set, [BevelFilter, "angle"]); Tweener.registerSpecialProperty("_Bevel_blurX", _filter_property_get, _filter_property_set, [BevelFilter, "blurX"]); Tweener.registerSpecialProperty("_Bevel_blurY", _filter_property_get, _filter_property_set, [BevelFilter, "blurY"]); Tweener.registerSpecialProperty("_Bevel_distance", _filter_property_get, _filter_property_set, [BevelFilter, "distance"]); Tweener.registerSpecialProperty("_Bevel_highlightAlpha", _filter_property_get, _filter_property_set, [BevelFilter, "highlightAlpha"]); Tweener.registerSpecialPropertySplitter("_Bevel_highlightColor", _generic_color_splitter, ["_Bevel_highlightColor_r", "_Bevel_highlightColor_g", "_Bevel_highlightColor_b"]); Tweener.registerSpecialProperty("_Bevel_highlightColor_r", _filter_property_get, _filter_property_set, [BevelFilter, "highlightColor", "color", "r"]); Tweener.registerSpecialProperty("_Bevel_highlightColor_g", _filter_property_get, _filter_property_set, [BevelFilter, "highlightColor", "color", "g"]); Tweener.registerSpecialProperty("_Bevel_highlightColor_b", _filter_property_get, _filter_property_set, [BevelFilter, "highlightColor", "color", "b"]); Tweener.registerSpecialProperty("_Bevel_knockout", _filter_property_get, _filter_property_set, [BevelFilter, "knockout"]); Tweener.registerSpecialProperty("_Bevel_quality", _filter_property_get, _filter_property_set, [BevelFilter, "quality"]); Tweener.registerSpecialProperty("_Bevel_shadowAlpha", _filter_property_get, _filter_property_set, [BevelFilter, "shadowAlpha"]); Tweener.registerSpecialPropertySplitter("_Bevel_shadowColor", _generic_color_splitter, ["_Bevel_shadowColor_r", "_Bevel_shadowColor_g", "_Bevel_shadowColor_b"]); Tweener.registerSpecialProperty("_Bevel_shadowColor_r", _filter_property_get, _filter_property_set, [BevelFilter, "shadowColor", "color", "r"]); Tweener.registerSpecialProperty("_Bevel_shadowColor_g", _filter_property_get, _filter_property_set, [BevelFilter, "shadowColor", "color", "g"]); Tweener.registerSpecialProperty("_Bevel_shadowColor_b", _filter_property_get, _filter_property_set, [BevelFilter, "shadowColor", "color", "b"]); Tweener.registerSpecialProperty("_Bevel_strength", _filter_property_get, _filter_property_set, [BevelFilter, "strength"]); Tweener.registerSpecialProperty("_Bevel_type", _filter_property_get, _filter_property_set, [BevelFilter, "type"]); Tweener.registerSpecialProperty("_Blur_blurX", _filter_property_get, _filter_property_set, [BlurFilter, "blurX"]); Tweener.registerSpecialProperty("_Blur_blurY", _filter_property_get, _filter_property_set, [BlurFilter, "blurY"]); Tweener.registerSpecialProperty("_Blur_quality", _filter_property_get, _filter_property_set, [BlurFilter, "quality"]); Tweener.registerSpecialPropertySplitter("_ColorMatrix_matrix", _generic_matrix_splitter, [[1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0], ["_ColorMatrix_matrix_rr", "_ColorMatrix_matrix_rg", "_ColorMatrix_matrix_rb", "_ColorMatrix_matrix_ra", "_ColorMatrix_matrix_ro", "_ColorMatrix_matrix_gr", "_ColorMatrix_matrix_gg", "_ColorMatrix_matrix_gb", "_ColorMatrix_matrix_ga", "_ColorMatrix_matrix_go", "_ColorMatrix_matrix_br", "_ColorMatrix_matrix_bg", "_ColorMatrix_matrix_bb", "_ColorMatrix_matrix_ba", "_ColorMatrix_matrix_bo", "_ColorMatrix_matrix_ar", "_ColorMatrix_matrix_ag", "_ColorMatrix_matrix_ab", "_ColorMatrix_matrix_aa", "_ColorMatrix_matrix_ao"]]); Tweener.registerSpecialProperty("_ColorMatrix_matrix_rr", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 0]); Tweener.registerSpecialProperty("_ColorMatrix_matrix_rg", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 1]); Tweener.registerSpecialProperty("_ColorMatrix_matrix_rb", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 2]); Tweener.registerSpecialProperty("_ColorMatrix_matrix_ra", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 3]); Tweener.registerSpecialProperty("_ColorMatrix_matrix_ro", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 4]); Tweener.registerSpecialProperty("_ColorMatrix_matrix_gr", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 5]); Tweener.registerSpecialProperty("_ColorMatrix_matrix_gg", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 6]); Tweener.registerSpecialProperty("_ColorMatrix_matrix_gb", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 7]); Tweener.registerSpecialProperty("_ColorMatrix_matrix_ga", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 8]); Tweener.registerSpecialProperty("_ColorMatrix_matrix_go", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 9]); Tweener.registerSpecialProperty("_ColorMatrix_matrix_br", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 10]); Tweener.registerSpecialProperty("_ColorMatrix_matrix_bg", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 11]); Tweener.registerSpecialProperty("_ColorMatrix_matrix_bb", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 12]); Tweener.registerSpecialProperty("_ColorMatrix_matrix_ba", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 13]); Tweener.registerSpecialProperty("_ColorMatrix_matrix_bo", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 14]); Tweener.registerSpecialProperty("_ColorMatrix_matrix_ar", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 15]); Tweener.registerSpecialProperty("_ColorMatrix_matrix_ag", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 16]); Tweener.registerSpecialProperty("_ColorMatrix_matrix_ab", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 17]); Tweener.registerSpecialProperty("_ColorMatrix_matrix_aa", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 18]); Tweener.registerSpecialProperty("_ColorMatrix_matrix_ao", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 19]); Tweener.registerSpecialProperty("_Convolution_alpha", _filter_property_get, _filter_property_set, [ConvolutionFilter, "alpha"]); Tweener.registerSpecialProperty("_Convolution_bias", _filter_property_get, _filter_property_set, [ConvolutionFilter, "bias"]); Tweener.registerSpecialProperty("_Convolution_clamp", _filter_property_get, _filter_property_set, [ConvolutionFilter, "clamp"]); Tweener.registerSpecialPropertySplitter("_Convolution_color", _generic_color_splitter, ["_Convolution_color_r", "_Convolution_color_g", "_Convolution_color_b"]); Tweener.registerSpecialProperty("_Convolution_color_r", _filter_property_get, _filter_property_set, [ConvolutionFilter, "color", "color", "r"]); Tweener.registerSpecialProperty("_Convolution_color_g", _filter_property_get, _filter_property_set, [ConvolutionFilter, "color", "color", "g"]); Tweener.registerSpecialProperty("_Convolution_color_b", _filter_property_get, _filter_property_set, [ConvolutionFilter, "color", "color", "b"]); Tweener.registerSpecialProperty("_Convolution_divisor", _filter_property_get, _filter_property_set, [ConvolutionFilter, "divisor"]); Tweener.registerSpecialProperty("_Convolution_matrixX", _filter_property_get, _filter_property_set, [ConvolutionFilter, "matrixX"]); Tweener.registerSpecialProperty("_Convolution_matrixY", _filter_property_get, _filter_property_set, [ConvolutionFilter, "matrixY"]); Tweener.registerSpecialProperty("_Convolution_preserveAlpha", _filter_property_get, _filter_property_set, [ConvolutionFilter, "preserveAlpha"]); Tweener.registerSpecialProperty("_DisplacementMap_alpha", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "alpha"]); Tweener.registerSpecialPropertySplitter("_DisplacementMap_color", _generic_color_splitter, ["_DisplacementMap_color_r", "_DisplacementMap_color_r", "_DisplacementMap_color_r"]); Tweener.registerSpecialProperty("_DisplacementMap_color_r", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "color", "color", "r"]); Tweener.registerSpecialProperty("_DisplacementMap_color_g", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "color", "color", "g"]); Tweener.registerSpecialProperty("_DisplacementMap_color_b", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "color", "color", "b"]); Tweener.registerSpecialProperty("_DisplacementMap_componentX", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "componentX"]); Tweener.registerSpecialProperty("_DisplacementMap_componentY", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "componentY"]); Tweener.registerSpecialProperty("_DisplacementMap_mapBitmap", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "mapBitmap"]); Tweener.registerSpecialPropertySplitter("_DisplacementMap_mapPoint", _generic_point_splitter, ["_DisplacementMap_mapPoint_x", "_DisplacementMap_mapPoint_y"]); Tweener.registerSpecialProperty("_DisplacementMap_mapPoint_x", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "mapPoint", "point", "x"]); Tweener.registerSpecialProperty("_DisplacementMap_mapPoint_y", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "mapPoint", "point", "y"]); Tweener.registerSpecialProperty("_DisplacementMap_mode", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "mode"]); Tweener.registerSpecialProperty("_DisplacementMap_scaleX", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "scaleX"]); Tweener.registerSpecialProperty("_DisplacementMap_scaleY", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "scaleY"]); Tweener.registerSpecialProperty("_DropShadow_alpha", _filter_property_get, _filter_property_set, [DropShadowFilter, "alpha"]); Tweener.registerSpecialProperty("_DropShadow_angle", _filter_property_get, _filter_property_set, [DropShadowFilter, "angle"]); Tweener.registerSpecialProperty("_DropShadow_blurX", _filter_property_get, _filter_property_set, [DropShadowFilter, "blurX"]); Tweener.registerSpecialProperty("_DropShadow_blurY", _filter_property_get, _filter_property_set, [DropShadowFilter, "blurY"]); Tweener.registerSpecialPropertySplitter("_DropShadow_color", _generic_color_splitter, ["_DropShadow_color_r", "_DropShadow_color_g", "_DropShadow_color_b"]); Tweener.registerSpecialProperty("_DropShadow_color_r", _filter_property_get, _filter_property_set, [DropShadowFilter, "color", "color", "r"]); Tweener.registerSpecialProperty("_DropShadow_color_g", _filter_property_get, _filter_property_set, [DropShadowFilter, "color", "color", "g"]); Tweener.registerSpecialProperty("_DropShadow_color_b", _filter_property_get, _filter_property_set, [DropShadowFilter, "color", "color", "b"]); Tweener.registerSpecialProperty("_DropShadow_distance", _filter_property_get, _filter_property_set, [DropShadowFilter, "distance"]); Tweener.registerSpecialProperty("_DropShadow_hideObject", _filter_property_get, _filter_property_set, [DropShadowFilter, "hideObject"]); Tweener.registerSpecialProperty("_DropShadow_inner", _filter_property_get, _filter_property_set, [DropShadowFilter, "inner"]); Tweener.registerSpecialProperty("_DropShadow_knockout", _filter_property_get, _filter_property_set, [DropShadowFilter, "knockout"]); Tweener.registerSpecialProperty("_DropShadow_quality", _filter_property_get, _filter_property_set, [DropShadowFilter, "quality"]); Tweener.registerSpecialProperty("_DropShadow_strength", _filter_property_get, _filter_property_set, [DropShadowFilter, "strength"]); Tweener.registerSpecialProperty("_Glow_alpha", _filter_property_get, _filter_property_set, [GlowFilter, "alpha"]); Tweener.registerSpecialProperty("_Glow_blurX", _filter_property_get, _filter_property_set, [GlowFilter, "blurX"]); Tweener.registerSpecialProperty("_Glow_blurY", _filter_property_get, _filter_property_set, [GlowFilter, "blurY"]); Tweener.registerSpecialPropertySplitter("_Glow_color", _generic_color_splitter, ["_Glow_color_r", "_Glow_color_g", "_Glow_color_b"]); Tweener.registerSpecialProperty("_Glow_color_r", _filter_property_get, _filter_property_set, [GlowFilter, "color", "color", "r"]); Tweener.registerSpecialProperty("_Glow_color_g", _filter_property_get, _filter_property_set, [GlowFilter, "color", "color", "g"]); Tweener.registerSpecialProperty("_Glow_color_b", _filter_property_get, _filter_property_set, [GlowFilter, "color", "color", "b"]); Tweener.registerSpecialProperty("_Glow_inner", _filter_property_get, _filter_property_set, [GlowFilter, "inner"]); Tweener.registerSpecialProperty("_Glow_knockout", _filter_property_get, _filter_property_set, [GlowFilter, "knockout"]); Tweener.registerSpecialProperty("_Glow_quality", _filter_property_get, _filter_property_set, [GlowFilter, "quality"]); Tweener.registerSpecialProperty("_Glow_strength", _filter_property_get, _filter_property_set, [GlowFilter, "strength"]); Tweener.registerSpecialProperty("_GradientBevel_angle", _filter_property_get, _filter_property_set, [GradientBevelFilter, "angle"]); Tweener.registerSpecialProperty("_GradientBevel_blurX", _filter_property_get, _filter_property_set, [GradientBevelFilter, "blurX"]); Tweener.registerSpecialProperty("_GradientBevel_blurY", _filter_property_get, _filter_property_set, [GradientBevelFilter, "blurY"]); Tweener.registerSpecialProperty("_GradientBevel_distance", _filter_property_get, _filter_property_set, [GradientBevelFilter, "distance"]); Tweener.registerSpecialProperty("_GradientBevel_quality", _filter_property_get, _filter_property_set, [GradientBevelFilter, "quality"]); Tweener.registerSpecialProperty("_GradientBevel_strength", _filter_property_get, _filter_property_set, [GradientBevelFilter, "strength"]); Tweener.registerSpecialProperty("_GradientBevel_type", _filter_property_get, _filter_property_set, [GradientBevelFilter, "type"]); Tweener.registerSpecialProperty("_GradientGlow_angle", _filter_property_get, _filter_property_set, [GradientGlowFilter, "angle"]); Tweener.registerSpecialProperty("_GradientGlow_blurX", _filter_property_get, _filter_property_set, [GradientGlowFilter, "blurX"]); Tweener.registerSpecialProperty("_GradientGlow_blurY", _filter_property_get, _filter_property_set, [GradientGlowFilter, "blurY"]); Tweener.registerSpecialProperty("_GradientGlow_distance", _filter_property_get, _filter_property_set, [GradientGlowFilter, "distance"]); Tweener.registerSpecialProperty("_GradientGlow_knockout", _filter_property_get, _filter_property_set, [GradientGlowFilter, "knockout"]); Tweener.registerSpecialProperty("_GradientGlow_quality", _filter_property_get, _filter_property_set, [GradientGlowFilter, "quality"]); Tweener.registerSpecialProperty("_GradientGlow_strength", _filter_property_get, _filter_property_set, [GradientGlowFilter, "strength"]); Tweener.registerSpecialProperty("_GradientGlow_type", _filter_property_get, _filter_property_set, [GradientGlowFilter, "type"]); } public static function _filter_property_get(_arg1:Object, _arg2:Array, _arg3:Object=null):Number{ var _local5:Number; var _local9:Object; var _local10:String; var _local4:Array = _arg1.filters; var _local6:Object = _arg2[0]; var _local7:String = _arg2[1]; var _local8:String = _arg2[2]; _local5 = 0; while (_local5 < _local4.length) { if ((_local4[_local5] is Class(_local6))){ if (_local8 == "color"){ _local10 = _arg2[3]; if (_local10 == "r"){ return (AuxFunctions.numberToR(_local4[_local5][_local7])); }; if (_local10 == "g"){ return (AuxFunctions.numberToG(_local4[_local5][_local7])); }; if (_local10 == "b"){ return (AuxFunctions.numberToB(_local4[_local5][_local7])); }; } else { if (_local8 == "matrix"){ return (_local4[_local5][_local7][_arg2[3]]); }; if (_local8 == "point"){ return (_local4[_local5][_local7][_arg2[3]]); }; return (_local4[_local5][_local7]); }; }; _local5++; }; switch (_local6){ case BevelFilter: _local9 = {angle:NaN, blurX:0, blurY:0, distance:0, highlightAlpha:1, highlightColor:NaN, knockout:null, quality:NaN, shadowAlpha:1, shadowColor:NaN, strength:2, type:null}; break; case BlurFilter: _local9 = {blurX:0, blurY:0, quality:NaN}; break; case ColorMatrixFilter: _local9 = {matrix:[1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]}; break; case ConvolutionFilter: _local9 = {alpha:0, bias:0, clamp:null, color:NaN, divisor:1, matrix:[1], matrixX:1, matrixY:1, preserveAlpha:null}; break; case DisplacementMapFilter: _local9 = {alpha:0, color:NaN, componentX:null, componentY:null, mapBitmap:null, mapPoint:null, mode:null, scaleX:0, scaleY:0}; break; case DropShadowFilter: _local9 = {distance:0, angle:NaN, color:NaN, alpha:1, blurX:0, blurY:0, strength:1, quality:NaN, inner:null, knockout:null, hideObject:null}; break; case GlowFilter: _local9 = {alpha:1, blurX:0, blurY:0, color:NaN, inner:null, knockout:null, quality:NaN, strength:2}; break; case GradientBevelFilter: _local9 = {alphas:null, angle:NaN, blurX:0, blurY:0, colors:null, distance:0, knockout:null, quality:NaN, ratios:NaN, strength:1, type:null}; break; case GradientGlowFilter: _local9 = {alphas:null, angle:NaN, blurX:0, blurY:0, colors:null, distance:0, knockout:null, quality:NaN, ratios:NaN, strength:1, type:null}; break; }; if (_local8 == "color"){ return (NaN); }; if (_local8 == "matrix"){ return (_local9[_local7][_arg2[3]]); }; if (_local8 == "point"){ return (_local9[_local7][_arg2[3]]); }; return (_local9[_local7]); } public static function _filter_property_set(_arg1:Object, _arg2:Number, _arg3:Array, _arg4:Object=null):void{ var _local6:Number; var _local10:BitmapFilter; var _local11:String; var _local12:Array; var _local13:Point; var _local5:Array = _arg1.filters; var _local7:Object = _arg3[0]; var _local8:String = _arg3[1]; var _local9:String = _arg3[2]; _local6 = 0; while (_local6 < _local5.length) { if ((_local5[_local6] is Class(_local7))){ if (_local9 == "color"){ _local11 = _arg3[3]; if (_local11 == "r"){ _local5[_local6][_local8] = ((_local5[_local6][_local8] & 0xFFFF) | (_arg2 << 16)); }; if (_local11 == "g"){ _local5[_local6][_local8] = ((_local5[_local6][_local8] & 0xFF00FF) | (_arg2 << 8)); }; if (_local11 == "b"){ _local5[_local6][_local8] = ((_local5[_local6][_local8] & 0xFFFF00) | _arg2); }; } else { if (_local9 == "matrix"){ _local12 = _local5[_local6][_local8]; _local12[_arg3[3]] = _arg2; _local5[_local6][_local8] = _local12; } else { if (_local9 == "point"){ _local13 = Point(_local5[_local6][_local8]); _local13[_arg3[3]] = _arg2; _local5[_local6][_local8] = _local13; } else { _local5[_local6][_local8] = _arg2; }; }; }; _arg1.filters = _local5; return; }; _local6++; }; if (_local5 == null){ _local5 = new Array(); }; switch (_local7){ case BevelFilter: _local10 = new BevelFilter(0, 45, 0xFFFFFF, 1, 0, 1, 0, 0); break; case BlurFilter: _local10 = new BlurFilter(0, 0); break; case ColorMatrixFilter: _local10 = new ColorMatrixFilter([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]); break; case ConvolutionFilter: _local10 = new ConvolutionFilter(1, 1, [1], 1, 0, true, true, 0, 0); break; case DisplacementMapFilter: _local10 = new DisplacementMapFilter(new BitmapData(10, 10), new Point(0, 0), 0, 1, 0, 0); break; case DropShadowFilter: _local10 = new DropShadowFilter(0, 45, 0, 1, 0, 0); break; case GlowFilter: _local10 = new GlowFilter(0xFF0000, 1, 0, 0); break; case GradientBevelFilter: _local10 = new GradientBevelFilter(0, 45, [0xFFFFFF, 0], [1, 1], [32, 223], 0, 0); break; case GradientGlowFilter: _local10 = new GradientGlowFilter(0, 45, [0xFFFFFF, 0], [1, 1], [32, 223], 0, 0); break; }; _local5.push(_local10); _arg1.filters = _local5; _filter_property_set(_arg1, _arg2, _arg3); } public static function _generic_color_splitter(_arg1:Number, _arg2:Array):Array{ var _local3:Array = new Array(); _local3.push({name:_arg2[0], value:AuxFunctions.numberToR(_arg1)}); _local3.push({name:_arg2[1], value:AuxFunctions.numberToG(_arg1)}); _local3.push({name:_arg2[2], value:AuxFunctions.numberToB(_arg1)}); return (_local3); } public static function _generic_point_splitter(_arg1:Point, _arg2:Array):Array{ var _local3:Array = new Array(); _local3.push({name:_arg2[0], value:_arg1.x}); _local3.push({name:_arg2[1], value:_arg1.y}); return (_local3); } public static function _generic_matrix_splitter(_arg1:Array, _arg2:Array):Array{ if (_arg1 == null){ _arg1 = _arg2[0].concat(); }; var _local3:Array = new Array(); var _local4:Number = 0; while (_local4 < _arg1.length) { _local3.push({name:_arg2[1][_local4], value:_arg1[_local4]}); _local4++; }; return (_local3); } public static function _filter_splitter(_arg1:BitmapFilter, _arg2:Array, _arg3:Object=null):Array{ var _local4:Array = new Array(); if ((_arg1 is BevelFilter)){ _local4.push({name:"_Bevel_angle", value:BevelFilter(_arg1).angle}); _local4.push({name:"_Bevel_blurX", value:BevelFilter(_arg1).blurX}); _local4.push({name:"_Bevel_blurY", value:BevelFilter(_arg1).blurY}); _local4.push({name:"_Bevel_distance", value:BevelFilter(_arg1).distance}); _local4.push({name:"_Bevel_highlightAlpha", value:BevelFilter(_arg1).highlightAlpha}); _local4.push({name:"_Bevel_highlightColor", value:BevelFilter(_arg1).highlightColor}); _local4.push({name:"_Bevel_knockout", value:BevelFilter(_arg1).knockout}); _local4.push({name:"_Bevel_quality", value:BevelFilter(_arg1).quality}); _local4.push({name:"_Bevel_shadowAlpha", value:BevelFilter(_arg1).shadowAlpha}); _local4.push({name:"_Bevel_shadowColor", value:BevelFilter(_arg1).shadowColor}); _local4.push({name:"_Bevel_strength", value:BevelFilter(_arg1).strength}); _local4.push({name:"_Bevel_type", value:BevelFilter(_arg1).type}); } else { if ((_arg1 is BlurFilter)){ _local4.push({name:"_Blur_blurX", value:BlurFilter(_arg1).blurX}); _local4.push({name:"_Blur_blurY", value:BlurFilter(_arg1).blurY}); _local4.push({name:"_Blur_quality", value:BlurFilter(_arg1).quality}); } else { if ((_arg1 is ColorMatrixFilter)){ _local4.push({name:"_ColorMatrix_matrix", value:ColorMatrixFilter(_arg1).matrix}); } else { if ((_arg1 is ConvolutionFilter)){ _local4.push({name:"_Convolution_alpha", value:ConvolutionFilter(_arg1).alpha}); _local4.push({name:"_Convolution_bias", value:ConvolutionFilter(_arg1).bias}); _local4.push({name:"_Convolution_clamp", value:ConvolutionFilter(_arg1).clamp}); _local4.push({name:"_Convolution_color", value:ConvolutionFilter(_arg1).color}); _local4.push({name:"_Convolution_divisor", value:ConvolutionFilter(_arg1).divisor}); _local4.push({name:"_Convolution_matrixX", value:ConvolutionFilter(_arg1).matrixX}); _local4.push({name:"_Convolution_matrixY", value:ConvolutionFilter(_arg1).matrixY}); _local4.push({name:"_Convolution_preserveAlpha", value:ConvolutionFilter(_arg1).preserveAlpha}); } else { if ((_arg1 is DisplacementMapFilter)){ _local4.push({name:"_DisplacementMap_alpha", value:DisplacementMapFilter(_arg1).alpha}); _local4.push({name:"_DisplacementMap_color", value:DisplacementMapFilter(_arg1).color}); _local4.push({name:"_DisplacementMap_componentX", value:DisplacementMapFilter(_arg1).componentX}); _local4.push({name:"_DisplacementMap_componentY", value:DisplacementMapFilter(_arg1).componentY}); _local4.push({name:"_DisplacementMap_mapBitmap", value:DisplacementMapFilter(_arg1).mapBitmap}); _local4.push({name:"_DisplacementMap_mapPoint", value:DisplacementMapFilter(_arg1).mapPoint}); _local4.push({name:"_DisplacementMap_mode", value:DisplacementMapFilter(_arg1).mode}); _local4.push({name:"_DisplacementMap_scaleX", value:DisplacementMapFilter(_arg1).scaleX}); _local4.push({name:"_DisplacementMap_scaleY", value:DisplacementMapFilter(_arg1).scaleY}); } else { if ((_arg1 is DropShadowFilter)){ _local4.push({name:"_DropShadow_alpha", value:DropShadowFilter(_arg1).alpha}); _local4.push({name:"_DropShadow_angle", value:DropShadowFilter(_arg1).angle}); _local4.push({name:"_DropShadow_blurX", value:DropShadowFilter(_arg1).blurX}); _local4.push({name:"_DropShadow_blurY", value:DropShadowFilter(_arg1).blurY}); _local4.push({name:"_DropShadow_color", value:DropShadowFilter(_arg1).color}); _local4.push({name:"_DropShadow_distance", value:DropShadowFilter(_arg1).distance}); _local4.push({name:"_DropShadow_hideObject", value:DropShadowFilter(_arg1).hideObject}); _local4.push({name:"_DropShadow_inner", value:DropShadowFilter(_arg1).inner}); _local4.push({name:"_DropShadow_knockout", value:DropShadowFilter(_arg1).knockout}); _local4.push({name:"_DropShadow_quality", value:DropShadowFilter(_arg1).quality}); _local4.push({name:"_DropShadow_strength", value:DropShadowFilter(_arg1).strength}); } else { if ((_arg1 is GlowFilter)){ _local4.push({name:"_Glow_alpha", value:GlowFilter(_arg1).alpha}); _local4.push({name:"_Glow_blurX", value:GlowFilter(_arg1).blurX}); _local4.push({name:"_Glow_blurY", value:GlowFilter(_arg1).blurY}); _local4.push({name:"_Glow_color", value:GlowFilter(_arg1).color}); _local4.push({name:"_Glow_inner", value:GlowFilter(_arg1).inner}); _local4.push({name:"_Glow_knockout", value:GlowFilter(_arg1).knockout}); _local4.push({name:"_Glow_quality", value:GlowFilter(_arg1).quality}); _local4.push({name:"_Glow_strength", value:GlowFilter(_arg1).strength}); } else { if ((_arg1 is GradientBevelFilter)){ _local4.push({name:"_GradientBevel_angle", value:GradientBevelFilter(_arg1).strength}); _local4.push({name:"_GradientBevel_blurX", value:GradientBevelFilter(_arg1).blurX}); _local4.push({name:"_GradientBevel_blurY", value:GradientBevelFilter(_arg1).blurY}); _local4.push({name:"_GradientBevel_distance", value:GradientBevelFilter(_arg1).distance}); _local4.push({name:"_GradientBevel_quality", value:GradientBevelFilter(_arg1).quality}); _local4.push({name:"_GradientBevel_strength", value:GradientBevelFilter(_arg1).strength}); _local4.push({name:"_GradientBevel_type", value:GradientBevelFilter(_arg1).type}); } else { if ((_arg1 is GradientGlowFilter)){ _local4.push({name:"_GradientGlow_angle", value:GradientGlowFilter(_arg1).strength}); _local4.push({name:"_GradientGlow_blurX", value:GradientGlowFilter(_arg1).blurX}); _local4.push({name:"_GradientGlow_blurY", value:GradientGlowFilter(_arg1).blurY}); _local4.push({name:"_GradientGlow_distance", value:GradientGlowFilter(_arg1).distance}); _local4.push({name:"_GradientGlow_knockout", value:GradientGlowFilter(_arg1).knockout}); _local4.push({name:"_GradientGlow_quality", value:GradientGlowFilter(_arg1).quality}); _local4.push({name:"_GradientGlow_strength", value:GradientGlowFilter(_arg1).strength}); _local4.push({name:"_GradientGlow_type", value:GradientGlowFilter(_arg1).type}); } else { trace("Tweener FilterShortcuts Error :: Unknown filter class used"); }; }; }; }; }; }; }; }; }; return (_local4); } } }//package caurina.transitions.properties
Section 2
//TextShortcuts (caurina.transitions.properties.TextShortcuts) package caurina.transitions.properties { import caurina.transitions.*; import flash.text.*; public class TextShortcuts { public function TextShortcuts(){ trace("This is an static class and should not be instantiated."); } public static function init():void{ Tweener.registerSpecialProperty("_text", _text_get, _text_set, null, _text_preProcess); Tweener.registerSpecialPropertySplitter("_text_color", _generic_color_splitter, ["_text_color_r", "_text_color_g", "_text_color_b"]); Tweener.registerSpecialProperty("_text_color_r", _textFormat_property_get, _textFormat_property_set, ["color", true, "r"]); Tweener.registerSpecialProperty("_text_color_g", _textFormat_property_get, _textFormat_property_set, ["color", true, "g"]); Tweener.registerSpecialProperty("_text_color_b", _textFormat_property_get, _textFormat_property_set, ["color", true, "b"]); Tweener.registerSpecialProperty("_text_indent", _textFormat_property_get, _textFormat_property_set, ["indent"]); Tweener.registerSpecialProperty("_text_leading", _textFormat_property_get, _textFormat_property_set, ["leading"]); Tweener.registerSpecialProperty("_text_leftMargin", _textFormat_property_get, _textFormat_property_set, ["leftMargin"]); Tweener.registerSpecialProperty("_text_letterSpacing", _textFormat_property_get, _textFormat_property_set, ["letterSpacing"]); Tweener.registerSpecialProperty("_text_rightMargin", _textFormat_property_get, _textFormat_property_set, ["rightMargin"]); Tweener.registerSpecialProperty("_text_size", _textFormat_property_get, _textFormat_property_set, ["size"]); } public static function _text_get(_arg1:Object, _arg2:Array, _arg3:Object=null):Number{ return (-(_arg1.text.length)); } public static function _textFormat_property_set(_arg1:Object, _arg2:Number, _arg3:Array, _arg4:Object=null):void{ var _local8:String; var _local5:TextFormat = _arg1.getTextFormat(); var _local6:String = _arg3[0]; var _local7:Boolean = _arg3[1]; if (!_local7){ _local5[_local6] = _arg2; } else { _local8 = _arg3[2]; if (_local8 == "r"){ _local5[_local6] = ((_local5[_local6] & 0xFFFF) | (_arg2 << 16)); }; if (_local8 == "g"){ _local5[_local6] = ((_local5[_local6] & 0xFF00FF) | (_arg2 << 8)); }; if (_local8 == "b"){ _local5[_local6] = ((_local5[_local6] & 0xFFFF00) | _arg2); }; }; _arg1.defaultTextFormat = _local5; _arg1.setTextFormat(_local5); } public static function _text_set(_arg1:Object, _arg2:Number, _arg3:Array, _arg4:Object=null):void{ if (_arg2 < 0){ _arg1.text = _arg4.oldText.substr(0, -(Math.round(_arg2))); } else { _arg1.text = _arg4.newText.substr(0, Math.round(_arg2)); }; } public static function _textFormat_property_get(_arg1:Object, _arg2:Array, _arg3:Object=null):Number{ var _local7:String; var _local4:TextFormat = _arg1.getTextFormat(); var _local5:String = _arg2[0]; var _local6:Boolean = _arg2[1]; if (!_local6){ return (_local4[_local5]); }; _local7 = _arg2[2]; if (_local7 == "r"){ return (AuxFunctions.numberToR(_local4[_local5])); }; if (_local7 == "g"){ return (AuxFunctions.numberToG(_local4[_local5])); }; if (_local7 == "b"){ return (AuxFunctions.numberToB(_local4[_local5])); }; return (NaN); } public static function _generic_color_splitter(_arg1:Number, _arg2:Array):Array{ var _local3:Array = new Array(); _local3.push({name:_arg2[0], value:AuxFunctions.numberToR(_arg1)}); _local3.push({name:_arg2[1], value:AuxFunctions.numberToG(_arg1)}); _local3.push({name:_arg2[2], value:AuxFunctions.numberToB(_arg1)}); return (_local3); } public static function _text_preProcess(_arg1:Object, _arg2:Array, _arg3:Object, _arg4:Object):Number{ _arg4.oldText = _arg1.text; _arg4.newText = _arg3; return (_arg4.newText.length); } } }//package caurina.transitions.properties
Section 3
//AuxFunctions (caurina.transitions.AuxFunctions) package caurina.transitions { public class AuxFunctions { public static function concatObjects(... _args):Object{ var _local3:Object; var _local5:String; var _local2:Object = {}; var _local4:int; while (_local4 < _args.length) { _local3 = _args[_local4]; for (_local5 in _local3) { if (_local3[_local5] == null){ delete _local2[_local5]; } else { _local2[_local5] = _local3[_local5]; }; }; _local4++; }; return (_local2); } public static function numberToG(_arg1:Number):Number{ return (((_arg1 & 0xFF00) >> 8)); } public static function numberToR(_arg1:Number):Number{ return (((_arg1 & 0xFF0000) >> 16)); } public static function isInArray(_arg1:String, _arg2:Array):Boolean{ var _local3:uint = _arg2.length; var _local4:uint; while (_local4 < _local3) { if (_arg2[_local4] == _arg1){ return (true); }; _local4++; }; return (false); } public static function getObjectLength(_arg1:Object):uint{ var _local3:String; var _local2:uint; for (_local3 in _arg1) { _local2++; }; return (_local2); } public static function numberToB(_arg1:Number):Number{ return ((_arg1 & 0xFF)); } } }//package caurina.transitions
Section 4
//Equations (caurina.transitions.Equations) package caurina.transitions { public class Equations { public function Equations(){ trace("Equations is a static class and should not be instantiated."); } public static function easeOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ _arg1 = (_arg1 / _arg4); if (_arg1 < (1 / 2.75)){ return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2)); }; if (_arg1 < (2 / 2.75)){ _arg1 = (_arg1 - (1.5 / 2.75)); return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2)); }; if (_arg1 < (2.5 / 2.75)){ _arg1 = (_arg1 - (2.25 / 2.75)); return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2)); }; _arg1 = (_arg1 - (2.625 / 2.75)); return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2)); } public static function easeInOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ var _local7:Number; if (_arg1 == 0){ return (_arg2); }; _arg1 = (_arg1 / (_arg4 / 2)); if (_arg1 == 2){ return ((_arg2 + _arg3)); }; var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * (0.3 * 1.5)) : _arg5.period; var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude; if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){ _local8 = _arg3; _local7 = (_local6 / 4); } else { _local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8))); }; if (_arg1 < 1){ --_arg1; return (((-0.5 * ((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2)); }; --_arg1; return ((((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) * 0.5) + _arg3) + _arg2)); } public static function easeInOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ _arg1 = (_arg1 / (_arg4 / 2)); if (_arg1 < 1){ return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2)); }; --_arg1; return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2)); } public static function easeInOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ if (_arg1 < (_arg4 / 2)){ return (((easeInBounce((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2)); }; return ((((easeOutBounce(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2)); } public static function easeInOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot; _arg1 = (_arg1 / (_arg4 / 2)); if (_arg1 < 1){ _local6 = (_local6 * 1.525); return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_local6 + 1) * _arg1) - _local6))) + _arg2)); }; _arg1 = (_arg1 - 2); _local6 = (_local6 * 1.525); return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 2)) + _arg2)); } public static function easeOutInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ if (_arg1 < (_arg4 / 2)){ return (easeOutCubic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5)); }; return (easeInCubic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5)); } public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ return ((((_arg3 * _arg1) / _arg4) + _arg2)); } public static function easeOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot; _arg1 = ((_arg1 / _arg4) - 1); return (((_arg3 * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 1)) + _arg2)); } public static function easeInOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2)); } public static function easeInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot; _arg1 = (_arg1 / _arg4); return (((((_arg3 * _arg1) * _arg1) * (((_local6 + 1) * _arg1) - _local6)) + _arg2)); } public static function easeInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ _arg1 = (_arg1 / _arg4); return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2)); } public static function easeOutInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ if (_arg1 < (_arg4 / 2)){ return (easeOutQuint((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5)); }; return (easeInQuint(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5)); } public static function easeOutInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ if (_arg1 < (_arg4 / 2)){ return (easeOutBounce((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5)); }; return (easeInBounce(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5)); } public static function init():void{ Tweener.registerTransition("easenone", easeNone); Tweener.registerTransition("linear", easeNone); Tweener.registerTransition("easeinquad", easeInQuad); Tweener.registerTransition("easeoutquad", easeOutQuad); Tweener.registerTransition("easeinoutquad", easeInOutQuad); Tweener.registerTransition("easeoutinquad", easeOutInQuad); Tweener.registerTransition("easeincubic", easeInCubic); Tweener.registerTransition("easeoutcubic", easeOutCubic); Tweener.registerTransition("easeinoutcubic", easeInOutCubic); Tweener.registerTransition("easeoutincubic", easeOutInCubic); Tweener.registerTransition("easeinquart", easeInQuart); Tweener.registerTransition("easeoutquart", easeOutQuart); Tweener.registerTransition("easeinoutquart", easeInOutQuart); Tweener.registerTransition("easeoutinquart", easeOutInQuart); Tweener.registerTransition("easeinquint", easeInQuint); Tweener.registerTransition("easeoutquint", easeOutQuint); Tweener.registerTransition("easeinoutquint", easeInOutQuint); Tweener.registerTransition("easeoutinquint", easeOutInQuint); Tweener.registerTransition("easeinsine", easeInSine); Tweener.registerTransition("easeoutsine", easeOutSine); Tweener.registerTransition("easeinoutsine", easeInOutSine); Tweener.registerTransition("easeoutinsine", easeOutInSine); Tweener.registerTransition("easeincirc", easeInCirc); Tweener.registerTransition("easeoutcirc", easeOutCirc); Tweener.registerTransition("easeinoutcirc", easeInOutCirc); Tweener.registerTransition("easeoutincirc", easeOutInCirc); Tweener.registerTransition("easeinexpo", easeInExpo); Tweener.registerTransition("easeoutexpo", easeOutExpo); Tweener.registerTransition("easeinoutexpo", easeInOutExpo); Tweener.registerTransition("easeoutinexpo", easeOutInExpo); Tweener.registerTransition("easeinelastic", easeInElastic); Tweener.registerTransition("easeoutelastic", easeOutElastic); Tweener.registerTransition("easeinoutelastic", easeInOutElastic); Tweener.registerTransition("easeoutinelastic", easeOutInElastic); Tweener.registerTransition("easeinback", easeInBack); Tweener.registerTransition("easeoutback", easeOutBack); Tweener.registerTransition("easeinoutback", easeInOutBack); Tweener.registerTransition("easeoutinback", easeOutInBack); Tweener.registerTransition("easeinbounce", easeInBounce); Tweener.registerTransition("easeoutbounce", easeOutBounce); Tweener.registerTransition("easeinoutbounce", easeInOutBounce); Tweener.registerTransition("easeoutinbounce", easeOutInBounce); } public static function easeOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ return (((_arg1)==_arg4) ? (_arg2 + _arg3) : (((_arg3 * 1.001) * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2)); } public static function easeOutInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ if (_arg1 < (_arg4 / 2)){ return (easeOutBack((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5)); }; return (easeInBack(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5)); } public static function easeInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ return (((_arg1)==0) ? _arg2 : (((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2) - (_arg3 * 0.001))); } public static function easeInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ _arg1 = (_arg1 / _arg4); return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2)); } public static function easeInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ _arg1 = (_arg1 / _arg4); return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2)); } public static function easeInOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ _arg1 = (_arg1 / (_arg4 / 2)); if (_arg1 < 1){ return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2)); }; _arg1 = (_arg1 - 2); return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2)); } public static function easeInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ _arg1 = (_arg1 / _arg4); return ((((_arg3 * _arg1) * _arg1) + _arg2)); } public static function easeInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ return (((_arg3 - easeOutBounce((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2)); } public static function easeOutInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ if (_arg1 < (_arg4 / 2)){ return (easeOutExpo((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5)); }; return (easeInExpo(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5)); } public static function easeOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ _arg1 = ((_arg1 / _arg4) - 1); return (((-(_arg3) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2)); } public static function easeInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2)); } public static function easeInOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ _arg1 = (_arg1 / (_arg4 / 2)); if (_arg1 < 1){ return (((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2)); }; _arg1 = (_arg1 - 2); return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 2)) + _arg2)); } public static function easeOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ _arg1 = (_arg1 / _arg4); return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2)); } public static function easeOutInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ if (_arg1 < (_arg4 / 2)){ return (easeOutElastic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5)); }; return (easeInElastic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5)); } public static function easeInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ var _local7:Number; if (_arg1 == 0){ return (_arg2); }; _arg1 = (_arg1 / _arg4); if (_arg1 == 1){ return ((_arg2 + _arg3)); }; var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period; var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude; if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){ _local8 = _arg3; _local7 = (_local6 / 4); } else { _local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8))); }; --_arg1; return ((-(((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2)); } public static function easeOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ _arg1 = ((_arg1 / _arg4) - 1); return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2)); } public static function easeOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ _arg1 = ((_arg1 / _arg4) - 1); return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2)); } public static function easeOutInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ if (_arg1 < (_arg4 / 2)){ return (easeOutQuad((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5)); }; return (easeInQuad(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5)); } public static function easeOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2)); } public static function easeInOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ _arg1 = (_arg1 / (_arg4 / 2)); if (_arg1 < 1){ return ((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) + _arg2)); }; _arg1 = (_arg1 - 2); return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2)); } public static function easeInOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ _arg1 = (_arg1 / (_arg4 / 2)); if (_arg1 < 1){ return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2)); }; _arg1 = (_arg1 - 2); return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2)); } public static function easeInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ _arg1 = (_arg1 / _arg4); return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2)); } public static function easeOutInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ if (_arg1 < (_arg4 / 2)){ return (easeOutSine((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5)); }; return (easeInSine(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5)); } public static function easeInOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ if (_arg1 == 0){ return (_arg2); }; if (_arg1 == _arg4){ return ((_arg2 + _arg3)); }; _arg1 = (_arg1 / (_arg4 / 2)); if (_arg1 < 1){ return (((((_arg3 / 2) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2) - (_arg3 * 0.0005))); }; --_arg1; return (((((_arg3 / 2) * 1.0005) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2)); } public static function easeOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ var _local7:Number; if (_arg1 == 0){ return (_arg2); }; _arg1 = (_arg1 / _arg4); if (_arg1 == 1){ return ((_arg2 + _arg3)); }; var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period; var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude; if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){ _local8 = _arg3; _local7 = (_local6 / 4); } else { _local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8))); }; return (((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) + _arg3) + _arg2)); } public static function easeOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ _arg1 = ((_arg1 / _arg4) - 1); return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2)); } public static function easeOutInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ if (_arg1 < (_arg4 / 2)){ return (easeOutQuart((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5)); }; return (easeInQuart(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5)); } public static function easeOutInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{ if (_arg1 < (_arg4 / 2)){ return (easeOutCirc((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5)); }; return (easeInCirc(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5)); } } }//package caurina.transitions
Section 5
//PropertyInfoObj (caurina.transitions.PropertyInfoObj) package caurina.transitions { public class PropertyInfoObj { public var modifierParameters:Array; public var isSpecialProperty:Boolean; public var valueComplete:Number; public var modifierFunction:Function; public var extra:Object; public var valueStart:Number; public var hasModifier:Boolean; public var arrayIndex:Number; public var originalValueComplete:Object; public function PropertyInfoObj(_arg1:Number, _arg2:Number, _arg3:Object, _arg4:Number, _arg5:Object, _arg6:Boolean, _arg7:Function, _arg8:Array){ valueStart = _arg1; valueComplete = _arg2; originalValueComplete = _arg3; arrayIndex = _arg4; extra = _arg5; isSpecialProperty = _arg6; hasModifier = Boolean(_arg7); modifierFunction = _arg7; modifierParameters = _arg8; } public function toString():String{ var _local1 = "\n[PropertyInfoObj "; _local1 = (_local1 + ("valueStart:" + String(valueStart))); _local1 = (_local1 + ", "); _local1 = (_local1 + ("valueComplete:" + String(valueComplete))); _local1 = (_local1 + ", "); _local1 = (_local1 + ("originalValueComplete:" + String(originalValueComplete))); _local1 = (_local1 + ", "); _local1 = (_local1 + ("arrayIndex:" + String(arrayIndex))); _local1 = (_local1 + ", "); _local1 = (_local1 + ("extra:" + String(extra))); _local1 = (_local1 + ", "); _local1 = (_local1 + ("isSpecialProperty:" + String(isSpecialProperty))); _local1 = (_local1 + ", "); _local1 = (_local1 + ("hasModifier:" + String(hasModifier))); _local1 = (_local1 + ", "); _local1 = (_local1 + ("modifierFunction:" + String(modifierFunction))); _local1 = (_local1 + ", "); _local1 = (_local1 + ("modifierParameters:" + String(modifierParameters))); _local1 = (_local1 + "]\n"); return (_local1); } public function clone():PropertyInfoObj{ var _local1:PropertyInfoObj = new PropertyInfoObj(valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, modifierFunction, modifierParameters); return (_local1); } } }//package caurina.transitions
Section 6
//SpecialProperty (caurina.transitions.SpecialProperty) package caurina.transitions { public class SpecialProperty { public var parameters:Array; public var getValue:Function; public var preProcess:Function; public var setValue:Function; public function SpecialProperty(_arg1:Function, _arg2:Function, _arg3:Array=null, _arg4:Function=null){ getValue = _arg1; setValue = _arg2; parameters = _arg3; preProcess = _arg4; } public function toString():String{ var _local1 = ""; _local1 = (_local1 + "[SpecialProperty "); _local1 = (_local1 + ("getValue:" + String(getValue))); _local1 = (_local1 + ", "); _local1 = (_local1 + ("setValue:" + String(setValue))); _local1 = (_local1 + ", "); _local1 = (_local1 + ("parameters:" + String(parameters))); _local1 = (_local1 + ", "); _local1 = (_local1 + ("preProcess:" + String(preProcess))); _local1 = (_local1 + "]"); return (_local1); } } }//package caurina.transitions
Section 7
//SpecialPropertyModifier (caurina.transitions.SpecialPropertyModifier) package caurina.transitions { public class SpecialPropertyModifier { public var getValue:Function; public var modifyValues:Function; public function SpecialPropertyModifier(_arg1:Function, _arg2:Function){ modifyValues = _arg1; getValue = _arg2; } public function toString():String{ var _local1 = ""; _local1 = (_local1 + "[SpecialPropertyModifier "); _local1 = (_local1 + ("modifyValues:" + String(modifyValues))); _local1 = (_local1 + ", "); _local1 = (_local1 + ("getValue:" + String(getValue))); _local1 = (_local1 + "]"); return (_local1); } } }//package caurina.transitions
Section 8
//SpecialPropertySplitter (caurina.transitions.SpecialPropertySplitter) package caurina.transitions { public class SpecialPropertySplitter { public var parameters:Array; public var splitValues:Function; public function SpecialPropertySplitter(_arg1:Function, _arg2:Array){ splitValues = _arg1; parameters = _arg2; } public function toString():String{ var _local1 = ""; _local1 = (_local1 + "[SpecialPropertySplitter "); _local1 = (_local1 + ("splitValues:" + String(splitValues))); _local1 = (_local1 + ", "); _local1 = (_local1 + ("parameters:" + String(parameters))); _local1 = (_local1 + "]"); return (_local1); } } }//package caurina.transitions
Section 9
//Tweener (caurina.transitions.Tweener) package caurina.transitions { import flash.events.*; import flash.display.*; import flash.utils.*; public class Tweener { private static var _timeScale:Number = 1; private static var _currentTimeFrame:Number; private static var _specialPropertySplitterList:Object; private static var _engineExists:Boolean = false; private static var _specialPropertyModifierList:Object; private static var _currentTime:Number; private static var _tweenList:Array; private static var _specialPropertyList:Object; private static var _transitionList:Object; private static var _inited:Boolean = false; private static var __tweener_controller__:MovieClip; public function Tweener(){ trace("Tweener is a static class and should not be instantiated."); } public static function registerSpecialPropertyModifier(_arg1:String, _arg2:Function, _arg3:Function):void{ if (!_inited){ init(); }; var _local4:SpecialPropertyModifier = new SpecialPropertyModifier(_arg2, _arg3); _specialPropertyModifierList[_arg1] = _local4; } public static function registerSpecialProperty(_arg1:String, _arg2:Function, _arg3:Function, _arg4:Array=null, _arg5:Function=null):void{ if (!_inited){ init(); }; var _local6:SpecialProperty = new SpecialProperty(_arg2, _arg3, _arg4, _arg5); _specialPropertyList[_arg1] = _local6; } public static function init(... _args):void{ _inited = true; _transitionList = new Object(); Equations.init(); _specialPropertyList = new Object(); _specialPropertyModifierList = new Object(); _specialPropertySplitterList = new Object(); } private static function updateTweens():Boolean{ var _local1:int; if (_tweenList.length == 0){ return (false); }; _local1 = 0; while (_local1 < _tweenList.length) { if ((((_tweenList[_local1] == undefined)) || (!(_tweenList[_local1].isPaused)))){ if (!updateTweenByIndex(_local1)){ removeTweenByIndex(_local1); }; if (_tweenList[_local1] == null){ removeTweenByIndex(_local1, true); _local1--; }; }; _local1++; }; return (true); } public static function addCaller(_arg1:Object=null, _arg2:Object=null):Boolean{ var _local3:Number; var _local4:Array; var _local8:Function; var _local9:TweenListObj; var _local10:Number; var _local11:String; if (!Boolean(_arg1)){ return (false); }; if ((_arg1 is Array)){ _local4 = _arg1.concat(); } else { _local4 = [_arg1]; }; var _local5:Object = _arg2; if (!_inited){ init(); }; if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){ startEngine(); }; var _local6:Number = (isNaN(_local5.time)) ? 0 : _local5.time; var _local7:Number = (isNaN(_local5.delay)) ? 0 : _local5.delay; if (typeof(_local5.transition) == "string"){ _local11 = _local5.transition.toLowerCase(); _local8 = _transitionList[_local11]; } else { _local8 = _local5.transition; }; if (!Boolean(_local8)){ _local8 = _transitionList["easeoutexpo"]; }; _local3 = 0; while (_local3 < _local4.length) { if (_local5.useFrames == true){ _local9 = new TweenListObj(_local4[_local3], (_currentTimeFrame + (_local7 / _timeScale)), (_currentTimeFrame + ((_local7 + _local6) / _timeScale)), true, _local8, _local5.transitionParams); } else { _local9 = new TweenListObj(_local4[_local3], (_currentTime + ((_local7 * 1000) / _timeScale)), (_currentTime + (((_local7 * 1000) + (_local6 * 1000)) / _timeScale)), false, _local8, _local5.transitionParams); }; _local9.properties = null; _local9.onStart = _local5.onStart; _local9.onUpdate = _local5.onUpdate; _local9.onComplete = _local5.onComplete; _local9.onOverwrite = _local5.onOverwrite; _local9.onStartParams = _local5.onStartParams; _local9.onUpdateParams = _local5.onUpdateParams; _local9.onCompleteParams = _local5.onCompleteParams; _local9.onOverwriteParams = _local5.onOverwriteParams; _local9.onStartScope = _local5.onStartScope; _local9.onUpdateScope = _local5.onUpdateScope; _local9.onCompleteScope = _local5.onCompleteScope; _local9.onOverwriteScope = _local5.onOverwriteScope; _local9.onErrorScope = _local5.onErrorScope; _local9.isCaller = true; _local9.count = _local5.count; _local9.waitFrames = _local5.waitFrames; _tweenList.push(_local9); if ((((_local6 == 0)) && ((_local7 == 0)))){ _local10 = (_tweenList.length - 1); updateTweenByIndex(_local10); removeTweenByIndex(_local10); }; _local3++; }; return (true); } public static function pauseAllTweens():Boolean{ var _local2:uint; if (!Boolean(_tweenList)){ return (false); }; var _local1:Boolean; _local2 = 0; while (_local2 < _tweenList.length) { pauseTweenByIndex(_local2); _local1 = true; _local2++; }; return (_local1); } public static function removeTweens(_arg1:Object, ... _args):Boolean{ var _local4:uint; var _local3:Array = new Array(); _local4 = 0; while (_local4 < _args.length) { if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){ _local3.push(_args[_local4]); }; _local4++; }; return (affectTweens(removeTweenByIndex, _arg1, _local3)); } public static function splitTweens(_arg1:Number, _arg2:Array):uint{ var _local5:uint; var _local6:String; var _local7:Boolean; var _local3:TweenListObj = _tweenList[_arg1]; var _local4:TweenListObj = _local3.clone(false); _local5 = 0; while (_local5 < _arg2.length) { _local6 = _arg2[_local5]; if (Boolean(_local3.properties[_local6])){ _local3.properties[_local6] = undefined; delete _local3.properties[_local6]; }; _local5++; }; for (_local6 in _local4.properties) { _local7 = false; _local5 = 0; while (_local5 < _arg2.length) { if (_arg2[_local5] == _local6){ _local7 = true; break; }; _local5++; }; if (!_local7){ _local4.properties[_local6] = undefined; delete _local4.properties[_local6]; }; }; _tweenList.push(_local4); return ((_tweenList.length - 1)); } public static function updateFrame():void{ _currentTimeFrame++; } public static function resumeTweenByIndex(_arg1:Number):Boolean{ var _local2:TweenListObj = _tweenList[_arg1]; if ((((_local2 == null)) || (!(_local2.isPaused)))){ return (false); }; var _local3:Number = getCurrentTweeningTime(_local2); _local2.timeStart = (_local2.timeStart + (_local3 - _local2.timePaused)); _local2.timeComplete = (_local2.timeComplete + (_local3 - _local2.timePaused)); _local2.timePaused = undefined; _local2.isPaused = false; return (true); } public static function getVersion():String{ return ("AS3 1.31.71"); } public static function onEnterFrame(_arg1:Event):void{ updateTime(); updateFrame(); var _local2:Boolean; _local2 = updateTweens(); if (!_local2){ stopEngine(); }; } public static function updateTime():void{ _currentTime = getTimer(); } private static function updateTweenByIndex(_arg1:Number):Boolean{ var tTweening:TweenListObj; var mustUpdate:Boolean; var nv:Number; var t:Number; var b:Number; var c:Number; var d:Number; var pName:String; var eventScope:Object; var tScope:Object; var tProperty:Object; var pv:Number; var i = _arg1; tTweening = _tweenList[i]; if ((((tTweening == null)) || (!(Boolean(tTweening.scope))))){ return (false); }; var isOver:Boolean; var cTime:Number = getCurrentTweeningTime(tTweening); if (cTime >= tTweening.timeStart){ tScope = tTweening.scope; if (tTweening.isCaller){ do { t = (((tTweening.timeComplete - tTweening.timeStart) / tTweening.count) * (tTweening.timesCalled + 1)); b = tTweening.timeStart; c = (tTweening.timeComplete - tTweening.timeStart); d = (tTweening.timeComplete - tTweening.timeStart); nv = tTweening.transition(t, b, c, d); } while (!(cTime >= nv)); } else { mustUpdate = (((((tTweening.skipUpdates < 1)) || (!(tTweening.skipUpdates)))) || ((tTweening.updatesSkipped >= tTweening.skipUpdates))); if (cTime >= tTweening.timeComplete){ isOver = true; mustUpdate = true; }; if (!tTweening.hasStarted){ if (Boolean(tTweening.onStart)){ eventScope = (Boolean(tTweening.onStartScope)) ? tTweening.onStartScope : tScope; try { tTweening.onStart.apply(eventScope, tTweening.onStartParams); } catch(e:Error) { handleError(tTweening, e, "onStart"); }; }; for (pName in tTweening.properties) { if (tTweening.properties[pName].isSpecialProperty){ if (Boolean(_specialPropertyList[pName].preProcess)){ tTweening.properties[pName].valueComplete = _specialPropertyList[pName].preProcess(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].originalValueComplete, tTweening.properties[pName].extra); }; pv = _specialPropertyList[pName].getValue(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra); } else { pv = tScope[pName]; }; tTweening.properties[pName].valueStart = (isNaN(pv)) ? tTweening.properties[pName].valueComplete : pv; }; mustUpdate = true; tTweening.hasStarted = true; }; if (mustUpdate){ for (pName in tTweening.properties) { tProperty = tTweening.properties[pName]; if (isOver){ nv = tProperty.valueComplete; } else { if (tProperty.hasModifier){ t = (cTime - tTweening.timeStart); d = (tTweening.timeComplete - tTweening.timeStart); nv = tTweening.transition(t, 0, 1, d, tTweening.transitionParams); nv = tProperty.modifierFunction(tProperty.valueStart, tProperty.valueComplete, nv, tProperty.modifierParameters); } else { t = (cTime - tTweening.timeStart); b = tProperty.valueStart; c = (tProperty.valueComplete - tProperty.valueStart); d = (tTweening.timeComplete - tTweening.timeStart); nv = tTweening.transition(t, b, c, d, tTweening.transitionParams); }; }; if (tTweening.rounded){ nv = Math.round(nv); }; if (tProperty.isSpecialProperty){ _specialPropertyList[pName].setValue(tScope, nv, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra); } else { tScope[pName] = nv; }; }; tTweening.updatesSkipped = 0; if (Boolean(tTweening.onUpdate)){ eventScope = (Boolean(tTweening.onUpdateScope)) ? tTweening.onUpdateScope : tScope; try { tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams); } catch(e:Error) { handleError(tTweening, e, "onUpdate"); }; }; } else { tTweening.updatesSkipped++; }; }; if (((isOver) && (Boolean(tTweening.onComplete)))){ eventScope = (Boolean(tTweening.onCompleteScope)) ? tTweening.onCompleteScope : tScope; try { tTweening.onComplete.apply(eventScope, tTweening.onCompleteParams); } catch(e:Error) { handleError(tTweening, e, "onComplete"); }; }; return (!(isOver)); }; return (true); } public static function setTimeScale(_arg1:Number):void{ var _local2:Number; var _local3:Number; if (isNaN(_arg1)){ _arg1 = 1; }; if (_arg1 < 1E-5){ _arg1 = 1E-5; }; if (_arg1 != _timeScale){ if (_tweenList != null){ _local2 = 0; while (_local2 < _tweenList.length) { _local3 = getCurrentTweeningTime(_tweenList[_local2]); _tweenList[_local2].timeStart = (_local3 - (((_local3 - _tweenList[_local2].timeStart) * _timeScale) / _arg1)); _tweenList[_local2].timeComplete = (_local3 - (((_local3 - _tweenList[_local2].timeComplete) * _timeScale) / _arg1)); if (_tweenList[_local2].timePaused != undefined){ _tweenList[_local2].timePaused = (_local3 - (((_local3 - _tweenList[_local2].timePaused) * _timeScale) / _arg1)); }; _local2++; }; }; _timeScale = _arg1; }; } public static function resumeAllTweens():Boolean{ var _local2:uint; if (!Boolean(_tweenList)){ return (false); }; var _local1:Boolean; _local2 = 0; while (_local2 < _tweenList.length) { resumeTweenByIndex(_local2); _local1 = true; _local2++; }; return (_local1); } private static function handleError(_arg1:TweenListObj, _arg2:Error, _arg3:String):void{ var eventScope:Object; var pTweening = _arg1; var pError = _arg2; var pCallBackName = _arg3; if (((Boolean(pTweening.onError)) && ((pTweening.onError is Function)))){ eventScope = (Boolean(pTweening.onErrorScope)) ? pTweening.onErrorScope : pTweening.scope; try { pTweening.onError.apply(eventScope, [pTweening.scope, pError]); } catch(metaError:Error) { printError(((((String(pTweening.scope) + " raised an error while executing the 'onError' handler. Original error:\n ") + pError.getStackTrace()) + "\nonError error: ") + metaError.getStackTrace())); }; } else { if (!Boolean(pTweening.onError)){ printError(((((String(pTweening.scope) + " raised an error while executing the '") + pCallBackName) + "'handler. \n") + pError.getStackTrace())); }; }; } private static function startEngine():void{ _engineExists = true; _tweenList = new Array(); __tweener_controller__ = new MovieClip(); __tweener_controller__.addEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame); _currentTimeFrame = 0; updateTime(); } public static function removeAllTweens():Boolean{ var _local2:uint; if (!Boolean(_tweenList)){ return (false); }; var _local1:Boolean; _local2 = 0; while (_local2 < _tweenList.length) { removeTweenByIndex(_local2); _local1 = true; _local2++; }; return (_local1); } public static function addTween(_arg1:Object=null, _arg2:Object=null):Boolean{ var _local3:Number; var _local4:Number; var _local5:String; var _local6:Array; var _local13:Function; var _local14:Object; var _local15:TweenListObj; var _local16:Number; var _local17:Array; var _local18:Array; var _local19:Array; var _local20:String; if (!Boolean(_arg1)){ return (false); }; if ((_arg1 is Array)){ _local6 = _arg1.concat(); } else { _local6 = [_arg1]; }; var _local7:Object = TweenListObj.makePropertiesChain(_arg2); if (!_inited){ init(); }; if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){ startEngine(); }; var _local8:Number = (isNaN(_local7.time)) ? 0 : _local7.time; var _local9:Number = (isNaN(_local7.delay)) ? 0 : _local7.delay; var _local10:Array = new Array(); var _local11:Object = {time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, transitionParams:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, onError:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams:true, onStartScope:true, onUpdateScope:true, onCompleteScope:true, onOverwriteScope:true, onErrorScope:true}; var _local12:Object = new Object(); for (_local5 in _local7) { if (!_local11[_local5]){ if (_specialPropertySplitterList[_local5]){ _local17 = _specialPropertySplitterList[_local5].splitValues(_local7[_local5], _specialPropertySplitterList[_local5].parameters); _local3 = 0; while (_local3 < _local17.length) { if (_specialPropertySplitterList[_local17[_local3].name]){ _local18 = _specialPropertySplitterList[_local17[_local3].name].splitValues(_local17[_local3].value, _specialPropertySplitterList[_local17[_local3].name].parameters); _local4 = 0; while (_local4 < _local18.length) { _local10[_local18[_local4].name] = {valueStart:undefined, valueComplete:_local18[_local4].value, arrayIndex:_local18[_local4].arrayIndex, isSpecialProperty:false}; _local4++; }; } else { _local10[_local17[_local3].name] = {valueStart:undefined, valueComplete:_local17[_local3].value, arrayIndex:_local17[_local3].arrayIndex, isSpecialProperty:false}; }; _local3++; }; } else { if (_specialPropertyModifierList[_local5] != undefined){ _local19 = _specialPropertyModifierList[_local5].modifyValues(_local7[_local5]); _local3 = 0; while (_local3 < _local19.length) { _local12[_local19[_local3].name] = {modifierParameters:_local19[_local3].parameters, modifierFunction:_specialPropertyModifierList[_local5].getValue}; _local3++; }; } else { _local10[_local5] = {valueStart:undefined, valueComplete:_local7[_local5]}; }; }; }; }; for (_local5 in _local10) { if (_specialPropertyList[_local5] != undefined){ _local10[_local5].isSpecialProperty = true; } else { if (_local6[0][_local5] == undefined){ printError((((("The property '" + _local5) + "' doesn't seem to be a normal object property of ") + String(_local6[0])) + " or a registered special property.")); }; }; }; for (_local5 in _local12) { if (_local10[_local5] != undefined){ _local10[_local5].modifierParameters = _local12[_local5].modifierParameters; _local10[_local5].modifierFunction = _local12[_local5].modifierFunction; }; }; if (typeof(_local7.transition) == "string"){ _local20 = _local7.transition.toLowerCase(); _local13 = _transitionList[_local20]; } else { _local13 = _local7.transition; }; if (!Boolean(_local13)){ _local13 = _transitionList["easeoutexpo"]; }; _local3 = 0; while (_local3 < _local6.length) { _local14 = new Object(); for (_local5 in _local10) { _local14[_local5] = new PropertyInfoObj(_local10[_local5].valueStart, _local10[_local5].valueComplete, _local10[_local5].valueComplete, _local10[_local5].arrayIndex, {}, _local10[_local5].isSpecialProperty, _local10[_local5].modifierFunction, _local10[_local5].modifierParameters); }; if (_local7.useFrames == true){ _local15 = new TweenListObj(_local6[_local3], (_currentTimeFrame + (_local9 / _timeScale)), (_currentTimeFrame + ((_local9 + _local8) / _timeScale)), true, _local13, _local7.transitionParams); } else { _local15 = new TweenListObj(_local6[_local3], (_currentTime + ((_local9 * 1000) / _timeScale)), (_currentTime + (((_local9 * 1000) + (_local8 * 1000)) / _timeScale)), false, _local13, _local7.transitionParams); }; _local15.properties = _local14; _local15.onStart = _local7.onStart; _local15.onUpdate = _local7.onUpdate; _local15.onComplete = _local7.onComplete; _local15.onOverwrite = _local7.onOverwrite; _local15.onError = _local7.onError; _local15.onStartParams = _local7.onStartParams; _local15.onUpdateParams = _local7.onUpdateParams; _local15.onCompleteParams = _local7.onCompleteParams; _local15.onOverwriteParams = _local7.onOverwriteParams; _local15.onStartScope = _local7.onStartScope; _local15.onUpdateScope = _local7.onUpdateScope; _local15.onCompleteScope = _local7.onCompleteScope; _local15.onOverwriteScope = _local7.onOverwriteScope; _local15.onErrorScope = _local7.onErrorScope; _local15.rounded = _local7.rounded; _local15.skipUpdates = _local7.skipUpdates; removeTweensByTime(_local15.scope, _local15.properties, _local15.timeStart, _local15.timeComplete); _tweenList.push(_local15); if ((((_local8 == 0)) && ((_local9 == 0)))){ _local16 = (_tweenList.length - 1); updateTweenByIndex(_local16); removeTweenByIndex(_local16); }; _local3++; }; return (true); } public static function registerTransition(_arg1:String, _arg2:Function):void{ if (!_inited){ init(); }; _transitionList[_arg1] = _arg2; } public static function printError(_arg1:String):void{ trace(("## [Tweener] Error: " + _arg1)); } private static function affectTweens(_arg1:Function, _arg2:Object, _arg3:Array):Boolean{ var _local5:uint; var _local6:Array; var _local7:uint; var _local8:uint; var _local9:uint; var _local4:Boolean; if (!Boolean(_tweenList)){ return (false); }; _local5 = 0; while (_local5 < _tweenList.length) { if (((_tweenList[_local5]) && ((_tweenList[_local5].scope == _arg2)))){ if (_arg3.length == 0){ _arg1(_local5); _local4 = true; } else { _local6 = new Array(); _local7 = 0; while (_local7 < _arg3.length) { if (Boolean(_tweenList[_local5].properties[_arg3[_local7]])){ _local6.push(_arg3[_local7]); }; _local7++; }; if (_local6.length > 0){ _local8 = AuxFunctions.getObjectLength(_tweenList[_local5].properties); if (_local8 == _local6.length){ _arg1(_local5); _local4 = true; } else { _local9 = splitTweens(_local5, _local6); _arg1(_local9); _local4 = true; }; }; }; }; _local5++; }; return (_local4); } public static function getTweens(_arg1:Object):Array{ var _local2:uint; var _local3:String; if (!Boolean(_tweenList)){ return ([]); }; var _local4:Array = new Array(); _local2 = 0; while (_local2 < _tweenList.length) { if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){ for (_local3 in _tweenList[_local2].properties) { _local4.push(_local3); }; }; _local2++; }; return (_local4); } public static function isTweening(_arg1:Object):Boolean{ var _local2:uint; if (!Boolean(_tweenList)){ return (false); }; _local2 = 0; while (_local2 < _tweenList.length) { if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){ return (true); }; _local2++; }; return (false); } public static function pauseTweenByIndex(_arg1:Number):Boolean{ var _local2:TweenListObj = _tweenList[_arg1]; if ((((_local2 == null)) || (_local2.isPaused))){ return (false); }; _local2.timePaused = getCurrentTweeningTime(_local2); _local2.isPaused = true; return (true); } public static function getCurrentTweeningTime(_arg1:Object):Number{ return ((_arg1.useFrames) ? _currentTimeFrame : _currentTime); } public static function getTweenCount(_arg1:Object):Number{ var _local2:uint; if (!Boolean(_tweenList)){ return (0); }; var _local3:Number = 0; _local2 = 0; while (_local2 < _tweenList.length) { if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){ _local3 = (_local3 + AuxFunctions.getObjectLength(_tweenList[_local2].properties)); }; _local2++; }; return (_local3); } private static function stopEngine():void{ _engineExists = false; _tweenList = null; _currentTime = 0; _currentTimeFrame = 0; __tweener_controller__.removeEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame); __tweener_controller__ = null; } public static function removeTweensByTime(_arg1:Object, _arg2:Object, _arg3:Number, _arg4:Number):Boolean{ var removedLocally:Boolean; var i:uint; var pName:String; var eventScope:Object; var p_scope = _arg1; var p_properties = _arg2; var p_timeStart = _arg3; var p_timeComplete = _arg4; var removed:Boolean; var tl:uint = _tweenList.length; i = 0; while (i < tl) { if (((Boolean(_tweenList[i])) && ((p_scope == _tweenList[i].scope)))){ if ((((p_timeComplete > _tweenList[i].timeStart)) && ((p_timeStart < _tweenList[i].timeComplete)))){ removedLocally = false; for (pName in _tweenList[i].properties) { if (Boolean(p_properties[pName])){ if (Boolean(_tweenList[i].onOverwrite)){ eventScope = (Boolean(_tweenList[i].onOverwriteScope)) ? _tweenList[i].onOverwriteScope : _tweenList[i].scope; try { _tweenList[i].onOverwrite.apply(eventScope, _tweenList[i].onOverwriteParams); } catch(e:Error) { handleError(_tweenList[i], e, "onOverwrite"); }; }; _tweenList[i].properties[pName] = undefined; delete _tweenList[i].properties[pName]; removedLocally = true; removed = true; }; }; if (removedLocally){ if (AuxFunctions.getObjectLength(_tweenList[i].properties) == 0){ removeTweenByIndex(i); }; }; }; }; i = (i + 1); }; return (removed); } public static function registerSpecialPropertySplitter(_arg1:String, _arg2:Function, _arg3:Array=null):void{ if (!_inited){ init(); }; var _local4:SpecialPropertySplitter = new SpecialPropertySplitter(_arg2, _arg3); _specialPropertySplitterList[_arg1] = _local4; } public static function removeTweenByIndex(_arg1:Number, _arg2:Boolean=false):Boolean{ _tweenList[_arg1] = null; if (_arg2){ _tweenList.splice(_arg1, 1); }; return (true); } public static function resumeTweens(_arg1:Object, ... _args):Boolean{ var _local4:uint; var _local3:Array = new Array(); _local4 = 0; while (_local4 < _args.length) { if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){ _local3.push(_args[_local4]); }; _local4++; }; return (affectTweens(resumeTweenByIndex, _arg1, _local3)); } public static function pauseTweens(_arg1:Object, ... _args):Boolean{ var _local4:uint; var _local3:Array = new Array(); _local4 = 0; while (_local4 < _args.length) { if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){ _local3.push(_args[_local4]); }; _local4++; }; return (affectTweens(pauseTweenByIndex, _arg1, _local3)); } } }//package caurina.transitions
Section 10
//TweenListObj (caurina.transitions.TweenListObj) package caurina.transitions { public class TweenListObj { public var hasStarted:Boolean; public var onUpdate:Function; public var useFrames:Boolean; public var count:Number; public var onOverwriteParams:Array; public var timeStart:Number; public var timeComplete:Number; public var onStartParams:Array; public var onUpdateScope:Object; public var rounded:Boolean; public var onUpdateParams:Array; public var properties:Object; public var onComplete:Function; public var transitionParams:Object; public var updatesSkipped:Number; public var onStart:Function; public var onOverwriteScope:Object; public var skipUpdates:Number; public var onStartScope:Object; public var scope:Object; public var isCaller:Boolean; public var timePaused:Number; public var transition:Function; public var onCompleteParams:Array; public var onError:Function; public var timesCalled:Number; public var onErrorScope:Object; public var onOverwrite:Function; public var isPaused:Boolean; public var waitFrames:Boolean; public var onCompleteScope:Object; public function TweenListObj(_arg1:Object, _arg2:Number, _arg3:Number, _arg4:Boolean, _arg5:Function, _arg6:Object){ scope = _arg1; timeStart = _arg2; timeComplete = _arg3; useFrames = _arg4; transition = _arg5; transitionParams = _arg6; properties = new Object(); isPaused = false; timePaused = undefined; isCaller = false; updatesSkipped = 0; timesCalled = 0; skipUpdates = 0; hasStarted = false; } public function clone(_arg1:Boolean):TweenListObj{ var _local3:String; var _local2:TweenListObj = new TweenListObj(scope, timeStart, timeComplete, useFrames, transition, transitionParams); _local2.properties = new Array(); for (_local3 in properties) { _local2.properties[_local3] = properties[_local3].clone(); }; _local2.skipUpdates = skipUpdates; _local2.updatesSkipped = updatesSkipped; if (!_arg1){ _local2.onStart = onStart; _local2.onUpdate = onUpdate; _local2.onComplete = onComplete; _local2.onOverwrite = onOverwrite; _local2.onError = onError; _local2.onStartParams = onStartParams; _local2.onUpdateParams = onUpdateParams; _local2.onCompleteParams = onCompleteParams; _local2.onOverwriteParams = onOverwriteParams; _local2.onStartScope = onStartScope; _local2.onUpdateScope = onUpdateScope; _local2.onCompleteScope = onCompleteScope; _local2.onOverwriteScope = onOverwriteScope; _local2.onErrorScope = onErrorScope; }; _local2.rounded = rounded; _local2.isPaused = isPaused; _local2.timePaused = timePaused; _local2.isCaller = isCaller; _local2.count = count; _local2.timesCalled = timesCalled; _local2.waitFrames = waitFrames; _local2.hasStarted = hasStarted; return (_local2); } public function toString():String{ var _local3:String; var _local1 = "\n[TweenListObj "; _local1 = (_local1 + ("scope:" + String(scope))); _local1 = (_local1 + ", properties:"); var _local2:Boolean; for (_local3 in properties) { if (!_local2){ _local1 = (_local1 + ","); }; _local1 = (_local1 + ("[name:" + properties[_local3].name)); _local1 = (_local1 + (",valueStart:" + properties[_local3].valueStart)); _local1 = (_local1 + (",valueComplete:" + properties[_local3].valueComplete)); _local1 = (_local1 + "]"); _local2 = false; }; _local1 = (_local1 + (", timeStart:" + String(timeStart))); _local1 = (_local1 + (", timeComplete:" + String(timeComplete))); _local1 = (_local1 + (", useFrames:" + String(useFrames))); _local1 = (_local1 + (", transition:" + String(transition))); _local1 = (_local1 + (", transitionParams:" + String(transitionParams))); if (skipUpdates){ _local1 = (_local1 + (", skipUpdates:" + String(skipUpdates))); }; if (updatesSkipped){ _local1 = (_local1 + (", updatesSkipped:" + String(updatesSkipped))); }; if (Boolean(onStart)){ _local1 = (_local1 + (", onStart:" + String(onStart))); }; if (Boolean(onUpdate)){ _local1 = (_local1 + (", onUpdate:" + String(onUpdate))); }; if (Boolean(onComplete)){ _local1 = (_local1 + (", onComplete:" + String(onComplete))); }; if (Boolean(onOverwrite)){ _local1 = (_local1 + (", onOverwrite:" + String(onOverwrite))); }; if (Boolean(onError)){ _local1 = (_local1 + (", onError:" + String(onError))); }; if (onStartParams){ _local1 = (_local1 + (", onStartParams:" + String(onStartParams))); }; if (onUpdateParams){ _local1 = (_local1 + (", onUpdateParams:" + String(onUpdateParams))); }; if (onCompleteParams){ _local1 = (_local1 + (", onCompleteParams:" + String(onCompleteParams))); }; if (onOverwriteParams){ _local1 = (_local1 + (", onOverwriteParams:" + String(onOverwriteParams))); }; if (onStartScope){ _local1 = (_local1 + (", onStartScope:" + String(onStartScope))); }; if (onUpdateScope){ _local1 = (_local1 + (", onUpdateScope:" + String(onUpdateScope))); }; if (onCompleteScope){ _local1 = (_local1 + (", onCompleteScope:" + String(onCompleteScope))); }; if (onOverwriteScope){ _local1 = (_local1 + (", onOverwriteScope:" + String(onOverwriteScope))); }; if (onErrorScope){ _local1 = (_local1 + (", onErrorScope:" + String(onErrorScope))); }; if (rounded){ _local1 = (_local1 + (", rounded:" + String(rounded))); }; if (isPaused){ _local1 = (_local1 + (", isPaused:" + String(isPaused))); }; if (timePaused){ _local1 = (_local1 + (", timePaused:" + String(timePaused))); }; if (isCaller){ _local1 = (_local1 + (", isCaller:" + String(isCaller))); }; if (count){ _local1 = (_local1 + (", count:" + String(count))); }; if (timesCalled){ _local1 = (_local1 + (", timesCalled:" + String(timesCalled))); }; if (waitFrames){ _local1 = (_local1 + (", waitFrames:" + String(waitFrames))); }; if (hasStarted){ _local1 = (_local1 + (", hasStarted:" + String(hasStarted))); }; _local1 = (_local1 + "]\n"); return (_local1); } public static function makePropertiesChain(_arg1:Object):Object{ var _local3:Object; var _local4:Object; var _local5:Object; var _local6:Number; var _local7:Number; var _local8:Number; var _local2:Object = _arg1.base; if (_local2){ _local3 = {}; if ((_local2 is Array)){ _local4 = []; _local8 = 0; while (_local8 < _local2.length) { _local4.push(_local2[_local8]); _local8++; }; } else { _local4 = [_local2]; }; _local4.push(_arg1); _local6 = _local4.length; _local7 = 0; while (_local7 < _local6) { if (_local4[_local7]["base"]){ _local5 = AuxFunctions.concatObjects(makePropertiesChain(_local4[_local7]["base"]), _local4[_local7]); } else { _local5 = _local4[_local7]; }; _local3 = AuxFunctions.concatObjects(_local3, _local5); _local7++; }; if (_local3["base"]){ delete _local3["base"]; }; return (_local3); //unresolved jump }; return (_arg1); } } }//package caurina.transitions
Section 11
//MochiAd (com.mochiads.MochiAd) package com.mochiads { import flash.events.*; import flash.display.*; import flash.utils.*; import flash.system.*; import flash.net.*; public class MochiAd { public static function getVersion():String{ return ("2.1"); } public static function showTimedAd(_arg1:Object):void{ MochiAd.showInterLevelAd(_arg1); } public static function _allowDomains(_arg1:String):String{ var _local2:String = _arg1.split("/")[2].split(":")[0]; Security.allowDomain("*"); Security.allowDomain(_local2); Security.allowInsecureDomain("*"); Security.allowInsecureDomain(_local2); return (_local2); } public static function load(_arg1:Object):MovieClip{ var clip:Object; var mc:MovieClip; var k:String; var server:String; var hostname:String; var lc:LocalConnection; var name:String; var loader:Loader; var f:Function; var g:Function; var req:URLRequest; var v:Object; var options = _arg1; var DEFAULTS:Object = {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); }; if (clip._mochiad_loaded){ return (null); }; var depth:Number = options.depth; delete options.depth; mc = createEmptyMovieClip(clip, "_mochiad", depth); var wh:Array = 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; }; var lv:URLVariables = 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; lv.lc = name; lv.st = getTimer(); loader = new Loader(); f = function (_arg1:Object):void{ mc._mochiad_ctr_failed = true; }; loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f); g = function (_arg1:Object):void{ MochiAd.unload(clip); }; loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g); req = new URLRequest((server + ".swf")); req.contentType = "application/x-www-form-urlencoded"; req.method = URLRequestMethod.POST; req.data = lv; loader.load(req); mc.addChild(loader); mc._mochiad_ctr = loader; return (mc); } public static function sendHighScore(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{ var _local4:MovieClip = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id}); if (!_local4){ return (false); }; _local4.doSend(["sendHighScore", _arg1], _arg2, _arg3); return (true); } public static function _parseOptions(_arg1:Object, _arg2:Object):Object{ var _local4:String; var _local5:Array; var _local6:Number; var _local7:Array; var _local3:Object = {}; for (_local4 in _arg2) { _local3[_local4] = _arg2[_local4]; }; if (_arg1){ for (_local4 in _arg1) { _local3[_local4] = _arg1[_local4]; }; }; _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++; }; }; return (_local3); } public static function _isNetworkAvailable():Boolean{ return (!((Security.sandboxType == "localWithFile"))); } public static function unload(_arg1:Object):Boolean{ if (((_arg1.clip) && (_arg1.clip._mochiad))){ _arg1 = _arg1.clip; }; if (!_arg1._mochiad){ return (false); }; if (_arg1._mochiad.onUnload){ _arg1._mochiad.onUnload(); }; _arg1.removeChild(_arg1._mochiad); delete _arg1._mochiad_loaded; delete _arg1._mochiad; return (true); } public static function showInterLevelAd(_arg1:Object):void{ var clip:Object; var mc:MovieClip; var chk:MovieClip; var options = _arg1; var DEFAULTS:Object = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{ this.clip.stop(); }, ad_finished:function ():void{ this.clip.play(); }}; options = MochiAd._parseOptions(options, DEFAULTS); clip = options.clip; var ad_msec:Number = 11000; var ad_timeout:Number = options.ad_timeout; delete options.ad_timeout; var fadeout_time:Number = options.fadeout_time; delete options.fadeout_time; if (!MochiAd.load(options)){ options.ad_finished(); return; }; options.ad_started(); mc = clip._mochiad; mc["onUnload"] = function ():void{ options.ad_finished(); }; var wh:Array = MochiAd._getRes(options, clip); var w:Number = wh[0]; var h:Number = 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 = (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.adjustProgress = function (_arg1:Number):void{ var _local2:Object = mc._mochiad_wait; _local2.server_control = true; _local2.started = getTimer(); _local2.ad_msec = (_arg1 - 250); }; chk["onEnterFrame"] = function ():void{ var _local4:Number; var _local1:Object = this.parent._mochiad_ctr; var _local2:Number = (getTimer() - this.started); var _local3:Boolean; if (!chk.showing){ _local4 = _local1.loaderInfo.bytesTotal; if ((((_local4 > 0)) || (("number" == "undefined")))){ chk.showing = true; chk.started = getTimer(); } else { if (_local2 > chk.ad_timeout){ _local3 = true; }; }; }; if ((((_local2 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){ _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 _getRes(_arg1:Object, _arg2:Object):Array{ var _local6:Array; var _local3:Object = _arg2.getBounds(_arg2.root); var _local4:Number = 0; var _local5:Number = 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 createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{ var _local4:MovieClip = new MovieClip(); if (((false) && (_arg3))){ _arg1.addChildAt(_local4, _arg3); } else { _arg1.addChild(_local4); }; _arg1[_arg2] = _local4; _local4["_name"] = _arg2; return (_local4); } public static function _loadCommunicator(_arg1:Object):MovieClip{ var mc:MovieClip; var k:String; var lc:LocalConnection; var name:String; var req:URLRequest; var loader:Loader; var options = _arg1; var DEFAULTS:Object = {com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"}; options = MochiAd._parseOptions(options, DEFAULTS); options.swfv = 9; options.mav = MochiAd.getVersion(); var clip:Object = options.clip; var clipname:String = ("_mochiad_com_" + options.id); if (!MochiAd._isNetworkAvailable()){ return (null); }; if (clip[clipname]){ return (clip[clipname]); }; var server:String = (options.com_server + options.id); MochiAd._allowDomains(server); delete options.id; delete options.com_server; var depth:Number = options.depth; delete options.depth; mc = createEmptyMovieClip(clip, clipname, depth); var lv:URLVariables = new URLVariables(); for (k in options) { lv[k] = options[k]; }; 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.name = name; mc.lc = lc; lv.lc = name; mc._id = 0; mc._queue = []; mc.rpcResult = function (_arg1:Object):void{ _arg1 = parseInt(_arg1.toString()); var _local3:Array = mc._callbacks[_arg1]; if (typeof(_local3) == "undefined"){ return; }; delete mc._callbacks[_arg1]; var _local4:Array = []; var _local5:Number = 2; while (_local5 < _local3.length) { _local4.push(_local3[_local5]); _local5++; }; _local5 = 1; while (_local5 < arguments.length) { _local4.push(arguments[_local5]); _local5++; }; var _local6:Object = _local3[1]; var _local7:Object = _local3[0]; if (((_local7) && ((typeof(_local6) == "string")))){ _local6 = _local7[_local6]; }; if (typeof(_local6) == "function"){ _local6.apply(_local7, _local4); }; }; mc._didConnect = function (_arg1:String):void{ var _local5:Array; mc._endpoint = _arg1; var _local2:Array = mc._queue; delete mc._queue; var _local3:Function = mc.doSend; var _local4:Number = 0; while (_local4 < _local2.length) { _local5 = _local2[_local4]; _local3.apply(this, _local5); _local4++; }; }; mc.doSend = function (_arg1:Array, _arg2:Object, _arg3:Object):void{ var _local7:Array; var _local8:Number; if (mc._endpoint == null){ _local7 = []; _local8 = 0; while (_local8 < arguments.length) { _local7.push(arguments[_local8]); _local8++; }; mc._queue.push(_local7); return; }; mc._id = (mc._id + 1); var _local5:Number = mc._id; mc._callbacks[_local5] = [_arg2, ((_arg3) || (_arg2))]; var _local6:LocalConnection = new LocalConnection(); _local6.send(mc._endpoint, "rpc", _local5, _arg1); }; mc._callbacks = {}; mc._callbacks[0] = [mc, "_didConnect"]; lv.st = getTimer(); req = new URLRequest((server + ".swf")); req.contentType = "application/x-www-form-urlencoded"; req.method = URLRequestMethod.POST; req.data = lv; loader = new Loader(); loader.load(req); mc.addChild(loader); mc._mochiad_com = loader; return (mc); } public static function showPreGameAd(_arg1:Object):void{ var clip:Object; var mc:MovieClip; var chk:MovieClip; var complete:Boolean; var unloaded:Boolean; var r:MovieClip; var options = _arg1; var DEFAULTS:Object = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, ad_started:function ():void{ this.clip.stop(); }, ad_finished:function ():void{ this.clip.play(); }}; options = MochiAd._parseOptions(options, DEFAULTS); clip = options.clip; var ad_msec:Number = 11000; var ad_timeout:Number = options.ad_timeout; delete options.ad_timeout; var fadeout_time:Number = options.fadeout_time; delete options.fadeout_time; if (!MochiAd.load(options)){ options.ad_finished(); return; }; options.ad_started(); mc = clip._mochiad; mc["onUnload"] = function ():void{ var fn:Function = function ():void{ options.ad_finished(); }; setTimeout(fn, 100); }; var wh:Array = MochiAd._getRes(options, clip); var w:Number = wh[0]; var h:Number = 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); var bar:MovieClip = createEmptyMovieClip(chk, "_mochiad_bar", 4); bar.x = 10; bar.y = (h - 20); var bar_color:Number = options.color; delete options.color; var bar_background:Number = options.background; delete options.background; var bar_outline:Number = options.outline; delete options.outline; var backing_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 1); var backing:Object = backing_mc.graphics; backing.beginFill(bar_background); backing.moveTo(0, 0); backing.lineTo((w - 20), 0); backing.lineTo((w - 20), 10); backing.lineTo(0, 10); backing.lineTo(0, 0); backing.endFill(); var inside_mc:MovieClip = createEmptyMovieClip(bar, "_inside", 2); var inside:Object = inside_mc.graphics; inside.beginFill(bar_color); inside.moveTo(0, 0); inside.lineTo((w - 20), 0); inside.lineTo((w - 20), 10); inside.lineTo(0, 10); inside.lineTo(0, 0); inside.endFill(); inside_mc.scaleX = 0; var outline_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 3); var outline:Object = outline_mc.graphics; outline.lineStyle(0, bar_outline, 100); outline.moveTo(0, 0); outline.lineTo((w - 20), 0); outline.lineTo((w - 20), 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 = (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; var f:Function = function (_arg1:Event):void{ complete = true; if (unloaded){ MochiAd.unload(clip); }; }; clip.loaderInfo.addEventListener(Event.COMPLETE, f); if ((clip.root is MovieClip)){ r = (clip.root as MovieClip); if (r.framesLoaded >= r.totalFrames){ complete = true; }; }; mc.unloadAd = function ():void{ unloaded = true; if (complete){ MochiAd.unload(clip); }; }; mc.adjustProgress = function (_arg1:Number):void{ var _local2:Object = mc._mochiad_wait; _local2.server_control = true; _local2.started = getTimer(); _local2.ad_msec = _arg1; }; chk["onEnterFrame"] = function ():void{ var _local11:Number; if (!this.parent.parent){ delete this["onEnterFrame"]; return; }; var _local1:Object = this.parent.parent.root; var _local2:Object = this.parent._mochiad_ctr; var _local3:Number = (getTimer() - this.started); var _local4:Boolean; var _local5:Number = _local1.loaderInfo.bytesTotal; var _local6:Number = _local1.loaderInfo.bytesLoaded; var _local7:Number = ((100 * _local6) / _local5); var _local8:Number = ((100 * _local3) / chk.ad_msec); var _local9:Object = this._mochiad_bar._inside; var _local10:Number = Math.min(100, Math.min(((_local7) || (0)), _local8)); _local10 = Math.max(this.last_pcnt, _local10); this.last_pcnt = _local10; _local9.scaleX = (_local10 * 0.01); if (!chk.showing){ _local11 = _local2.loaderInfo.bytesTotal; if ((((_local11 > 0)) || (("number" == "undefined")))){ chk.showing = true; chk.started = getTimer(); } else { if (_local3 > chk.ad_timeout){ _local4 = true; }; }; }; if ((((_local3 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){ _local4 = true; }; if (((complete) && (_local4))){ 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{ MochiAd.showPreGameAd(_arg1); } public static function fetchHighScores(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{ var _local4:MovieClip = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id}); if (!_local4){ return (false); }; _local4.doSend(["fetchHighScores", _arg1], _arg2, _arg3); return (true); } 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 { mc.removeEventListener(Event.ENTER_FRAME, f); }; }; mc.addEventListener(Event.ENTER_FRAME, f); } } }//package com.mochiads
Section 12
//MochiBot (com.mochibot.MochiBot) package com.mochibot { import flash.events.*; import flash.display.*; import flash.system.*; import flash.net.*; public dynamic class MochiBot extends Sprite { public static function track(_arg1:Sprite, _arg2:String):MochiBot{ var parent = _arg1; var tag = _arg2; var self:MochiBot = new (MochiBot); parent.addChild(self); Security.allowDomain("*"); Security.allowDomain("mochibot.com"); Security.allowInsecureDomain("*"); Security.allowInsecureDomain("mochibot.com"); var server = "http://core.mochibot.com/my/core.swf"; var lv:URLVariables = new URLVariables(); lv["sb"] = Security.sandboxType; lv["v"] = Capabilities.version; lv["swfid"] = tag; lv["mv"] = "8"; lv["fv"] = "9"; var url:String = self.root.loaderInfo.loaderURL; if (url.indexOf("http") == 0){ lv["url"] = url; } else { lv["url"] = "local"; }; var req:URLRequest = new URLRequest(server); req.contentType = "application/x-www-form-urlencoded"; req.method = URLRequestMethod.POST; req.data = lv; var loader:Loader = new Loader(); var f:Function = function (_arg1:Object):void{ }; loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f, false, 0, true); self.addChild(loader); loader.load(req); return (self); } } }//package com.mochibot
Section 13
//Array2 (de.polygonal.ds.Array2) package de.polygonal.ds { public class Array2 implements Collection { private var _a:Array; private var _h:int; private var _w:int; public function Array2(_arg1:int, _arg2:int){ if ((((_arg1 < 2)) || ((_arg2 < 2)))){ throw (new Error("illegal size")); }; _a = new Array((_w = _arg1), (_h = _arg2)); fill(null); } public function get size():int{ return ((_w * _h)); } public function fill(_arg1):void{ var _local3:int; var _local4:Class; var _local2:int = (_w * _h); if ((_arg1 is Class)){ _local4 = (_arg1 as Class); _local3 = 0; while (_local3 < _local2) { _a[_local3] = new (_local4); _local3++; }; } else { _local3 = 0; while (_local3 < _local2) { _a[_local3] = _arg1; _local3++; }; }; } public function get width():int{ return (_w); } public function getCol(_arg1:int):Array{ var _local2:Array = []; var _local3:int; while (_local3 < _h) { _local2[_local3] = _a[int(((_local3 * _w) + _arg1))]; _local3++; }; return (_local2); } public function shiftDown():void{ if (_h == 1){ return; }; var _local1:int = ((_h - 1) * _w); _a = _a.slice(_local1, (_local1 + _w)).concat(_a); _a.splice((_h * _w), _w); } public function set width(_arg1:int):void{ resize(_arg1, _h); } public function appendCol(_arg1:Array):void{ _arg1.length = _h; var _local2:int; while (_local2 < _h) { _a.splice((((_local2 * _w) + _w) + _local2), 0, _arg1[_local2]); _local2++; }; _w++; } public function set height(_arg1:int):void{ resize(_w, _arg1); } public function clear():void{ _a = new Array(size); } public function get(_arg1:int, _arg2:int){ return (_a[int(((_arg2 * _w) + _arg1))]); } public function setRow(_arg1:uint, _arg2:Array):void{ if ((((_arg1 < 0)) || ((_arg1 > _h)))){ throw (new Error("row index out of bounds")); }; var _local3:int = (_arg1 * _w); var _local4:int; while (_local4 < _w) { _a[int((_local3 + _local4))] = _arg2[_local4]; _local4++; }; } public function prependCol(_arg1:Array):void{ _arg1.length = _h; var _local2:int; while (_local2 < _h) { _a.splice(((_local2 * _w) + _local2), 0, _arg1[_local2]); _local2++; }; _w++; } public function isEmpty():Boolean{ return (false); } public function toArray():Array{ var _local1:Array = _a.concat(); var _local2:int = size; if (_local1.length > _local2){ _local1.length = _local2; }; return (_local1); } public function contains(_arg1):Boolean{ var _local2:int = size; var _local3:int; while (_local3 < _local2) { if (_a[_local3] === _arg1){ return (true); }; _local3++; }; return (false); } public function appendRow(_arg1:Array):void{ _arg1.length = _w; _a = _a.concat(_arg1); _h++; } public function dump():String{ var _local2:int; var _local3:*; var _local5:int; var _local1 = "Array2\n{"; var _local4:int; while (_local4 < _h) { _local1 = (_local1 + ("\n" + "\t")); _local2 = (_local4 * _w); _local5 = 0; while (_local5 < _w) { _local3 = _a[int((_local2 + _local5))]; _local1 = (_local1 + (("[" + ((_local3)!=undefined) ? _local3 : "?") + "]")); _local5++; }; _local4++; }; _local1 = (_local1 + "\n}"); return (_local1); } public function getArray():Array{ return (_a); } public function getRow(_arg1:int):Array{ var _local2:int = (_arg1 * _w); return (_a.slice(_local2, (_local2 + _w))); } public function get height():int{ return (_h); } public function shiftLeft():void{ var _local2:int; if (_w == 1){ return; }; var _local1:int = (_w - 1); var _local3:int; while (_local3 < _h) { _local2 = ((_local3 * _w) + _local1); _a.splice(_local2, 0, _a.splice((_local2 - _local1), 1)); _local3++; }; } public function getIterator():Iterator{ return (new Array2Iterator(this)); } public function prependRow(_arg1:Array):void{ _arg1.length = _w; _a = _arg1.concat(_a); _h++; } public function set(_arg1:int, _arg2:int, _arg3):void{ _a[int(((_arg2 * _w) + _arg1))] = _arg3; } public function resize(_arg1:int, _arg2:int):void{ var _local6:int; var _local7:int; var _local8:int; var _local9:int; if ((((_arg1 < 2)) || ((_arg2 < 2)))){ throw (new Error("illegal size")); }; var _local3:Array = _a.concat(); _a.length = 0; _a.length = (_arg1 * _arg2); var _local4:int = ((_arg1 < _w)) ? _arg1 : _w; var _local5:int = ((_arg2 < _h)) ? _arg2 : _h; _local7 = 0; while (_local7 < _local5) { _local8 = (_local7 * _arg1); _local9 = (_local7 * _w); _local6 = 0; while (_local6 < _local4) { _a[int((_local8 + _local6))] = _local3[int((_local9 + _local6))]; _local6++; }; _local7++; }; _w = _arg1; _h = _arg2; } public function transpose():void{ var _local3:int; var _local1:Array = _a.concat(); var _local2:int; while (_local2 < _h) { _local3 = 0; while (_local3 < _w) { _a[int(((_local3 * _w) + _local2))] = _local1[int(((_local2 * _w) + _local3))]; _local3++; }; _local2++; }; } public function shiftRight():void{ var _local2:int; if (_w == 1){ return; }; var _local1:int = (_w - 1); var _local3:int; while (_local3 < _h) { _local2 = ((_local3 * _w) + _local1); _a.splice((_local2 - _local1), 0, _a.splice(_local2, 1)); _local3++; }; } public function toString():String{ return ((((("[Array2, width=" + width) + ", height=") + height) + "]")); } public function shiftUp():void{ if (_h == 1){ return; }; _a = _a.concat(_a.slice(0, _w)); _a.splice(0, _w); } public function setCol(_arg1:int, _arg2:Array):void{ if ((((_arg1 < 0)) || ((_arg1 > _w)))){ throw (new Error("column index out of bounds")); }; var _local3:int; while (_local3 < _h) { _a[int(((_local3 * _w) + _arg1))] = _arg2[_local3]; _local3++; }; } } }//package de.polygonal.ds class Array2Iterator implements Iterator { private var _xCursor:int; private var _a2:Array2; private var _yCursor:int; private function Array2Iterator(_arg1:Array2){ _a2 = _arg1; _xCursor = (_yCursor = 0); } public function start():void{ _xCursor = (_yCursor = 0); } public function hasNext():Boolean{ return ((((_yCursor * _a2.width) + _xCursor) < _a2.size)); } public function get data(){ return (_a2.get(_xCursor, _yCursor)); } public function set data(_arg1):void{ _a2.set(_xCursor, _yCursor, _arg1); } public function next(){ var _local1:* = data; if (++_xCursor == _a2.width){ _yCursor++; _xCursor = 0; }; return (_local1); } }
Section 14
//Collection (de.polygonal.ds.Collection) package de.polygonal.ds { public interface Collection { function get size():int; function isEmpty():Boolean; function getIterator():Iterator; function clear():void; function toArray():Array; function contains(_arg1):Boolean; } }//package de.polygonal.ds
Section 15
//Iterator (de.polygonal.ds.Iterator) package de.polygonal.ds { public interface Iterator { function start():void; function set data(_arg1):void; function get data(); function next(); function hasNext():Boolean; } }//package de.polygonal.ds
Section 16
//Fader (Fader.Fader) package Fader { import caurina.transitions.*; import flash.display.*; public class Fader { private static var _instance:Fader = null; public function InOut(_arg1:DisplayObject, _arg2:Number=1, _arg3:Function=null):void{ _arg1.alpha = 1; Tweener.addTween(_arg1, {delay:0, time:_arg2, alpha:0, transition:"linear", onComplete:_arg3}); } public function OutIn(_arg1:DisplayObject, _arg2:Number=1, _arg3:Function=null):void{ _arg1.alpha = 0; Tweener.addTween(_arg1, {delay:0, time:_arg2, alpha:1, transition:"linear", onComplete:_arg3}); } public static function getSingleton():Fader{ if (!_instance){ _instance = new (Fader); }; return (_instance); } } }//package Fader
Section 17
//MochiScores (mochi.MochiScores) package mochi { 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 options = _arg1; if (options != null){ if (options.clip != null){ if ((options.clip is Sprite)){ MochiServices.setContainer(options.clip); }; delete options.clip; } else { MochiServices.setContainer(); }; MochiServices.stayOnTop(); 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; }; }; }; if (options.onDisplay != null){ options.onDisplay(); } else { if (MochiServices.clip != null){ if ((MochiServices.clip is MovieClip)){ MochiServices.clip.stop(); } else { trace("Warning: Container is not a MovieClip, cannot call default onDisplay."); }; }; }; } else { options = {}; if ((MochiServices.clip is MovieClip)){ MochiServices.clip.stop(); } else { trace("Warning: Container is not a MovieClip, cannot call default onDisplay."); }; }; if (options.onClose != null){ onCloseHandler = options.onClose; } else { onCloseHandler = function ():void{ if ((MochiServices.clip is MovieClip)){ MochiServices.clip.play(); } else { trace("Warning: Container is not a MovieClip, cannot call default onClose."); }; }; }; if (options.onError != null){ onErrorHandler = options.onError; } else { onErrorHandler = null; }; if (options.boardID == null){ if (MochiScores.boardID != null){ options.boardID = MochiScores.boardID; }; }; MochiServices.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 _local3:Number; var _local4:Number; var _local5:Object; var _local6:Object; var _local7:String; var _local8:String; var _local2:Object = {}; for (_local7 in _arg1) { if (typeof(_arg1[_local7]) == "object"){ if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){ _local2[_local7] = []; _local5 = _arg1[_local7]; _local4 = 0; while (_local4 < _local5.rows.length) { _local6 = {}; _local3 = 0; while (_local3 < _local5.cols.length) { _local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3]; _local3++; }; _local2[_local7].push(_local6); _local4++; }; } else { _local2[_local7] = {}; for (_local8 in _arg1[_local7]) { _local2[_local7][_local8] = _arg1[_local7][_local8]; }; }; } else { _local2[_local7] = _arg1[_local7]; }; }; return (_local2); } public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{ MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4); } public static function onClose(_arg1:Object=null):void{ if (_arg1 != null){ if (_arg1.error != null){ if (_arg1.error == true){ if (onErrorHandler != null){ if (_arg1.errorCode == null){ _arg1.errorCode = "IOError"; }; onErrorHandler(_arg1.errorCode); MochiServices.doClose(); return; }; }; }; }; onCloseHandler(); MochiServices.doClose(); } public static function setBoardID(_arg1:String):void{ MochiScores.boardID = _arg1; MochiServices.send("scores_setBoardID", {boardID:_arg1}); } } }//package mochi
Section 18
//MochiServices (mochi.MochiServices) package mochi { import flash.events.*; import flash.display.*; import flash.utils.*; import flash.net.*; import flash.system.*; public class MochiServices { private static var _container:Object; private static var _connected:Boolean = false; private static var _swfVersion:String; private static var _sendChannel:LocalConnection; private static var _rcvChannelName:String; private static var _gatewayURL:String = "http://www.mochiads.com/static/lib/services/services.swf"; private static var _clip:MovieClip; private static var _loader:Loader; private static var _id:String; private static var _listenChannel:LocalConnection; private static var _timer:Timer; private static var _sendChannelName:String; private static var _startTime:Number; private static var _connecting:Boolean = false; public static var onError:Object; private static var _listenChannelName:String = "__mochiservices"; private static var _rcvChannel:LocalConnection; public static function isNetworkAvailable():Boolean{ return (!((Security.sandboxType == "localWithFile"))); } public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{ if (_connected){ _sendChannel.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID}); } else { if ((((_clip == null)) || (!(_connecting)))){ onError("NotConnected"); 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++; }; }; } public static function get connected():Boolean{ return (_connected); } private static function flush(_arg1:Boolean):void{ var _local2:Object; var _local3:Object; if (_clip != null){ if (_clip._queue != null){ 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); }; }; }; }; }; } private static function init(_arg1:String, _arg2:Object):void{ _id = _arg1; if (_arg2 != null){ _container = _arg2; loadCommunicator(_arg1, _container); }; } public static function get childClip():Object{ return (_clip); } public static function get id():String{ return (_id); } public static function stayOnTop():void{ _container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true); if (_clip != null){ _clip.visible = true; }; } public static function getVersion():String{ return ("1.31"); } 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 { _listenChannel.close(); _rcvChannel.close(); } catch(error:Error) { }; }; if (_timer != null){ try { _timer.stop(); } catch(error:Error) { }; }; } public static function allowDomains(_arg1:String):String{ var _local2:String; Security.allowDomain("*"); Security.allowInsecureDomain("*"); if (_arg1.indexOf("http://") != -1){ _local2 = _arg1.split("/")[2].split(":")[0]; Security.allowDomain(_local2); Security.allowInsecureDomain(_local2); }; return (_local2); } public static function doClose():void{ _container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop); if (_clip.parent != null){ Sprite(_clip.parent).removeChild(_clip); }; } 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 onStatus(_arg1:StatusEvent):void{ switch (_arg1.level){ case "error": _connected = false; _listenChannel.connect(_listenChannelName); break; }; } private static function initComChannels():void{ if (!_connected){ _sendChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus); _sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"}); _sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_container, version:getVersion()}); _rcvChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus); _clip.onReceive = function (_arg1:Object):void{ var methodName:String; var pkg = _arg1; var cb:String = pkg.callbackID; var cblst:Object = this.client._callbacks[cb]; if (!cblst){ return; }; var method:* = cblst.callbackMethod; methodName = ""; var obj:Object = cblst.callbackObject; if (((obj) && ((typeof(method) == "string")))){ methodName = method; if (obj[method] != null){ method = obj[method]; } else { trace((("Error: Method " + method) + " does not exist.")); }; }; if (method != undefined){ try { method.apply(obj, pkg.args); } catch(error:Error) { trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString())); }; } else { if (obj != null){ try { obj(pkg.args); } catch(error:Error) { trace(("Error invoking method on object: " + error.toString())); }; }; }; delete this.client._callbacks[cb]; }; _clip.onError = function ():void{ MochiServices.onError("IOError"); }; _rcvChannel.connect(_rcvChannelName); trace("connected!"); _connecting = false; _connected = true; _listenChannel.close(); while (_clip._queue.length > 0) { _sendChannel.send(_sendChannelName, "onReceive", _clip._queue.shift()); }; }; } private static function listen():void{ _listenChannel = new LocalConnection(); _listenChannel.client = _clip; _clip.handshake = function (_arg1:Object):void{ MochiServices.comChannelName = _arg1.newChannel; }; _listenChannel.allowDomain("*", "localhost"); _listenChannel.allowInsecureDomain("*", "localhost"); _listenChannel.connect(_listenChannelName); trace("Waiting for MochiAds services to connect..."); } 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 (callbackMethod != null){ args = {}; args.error = true; args.errorCode = "NotConnected"; if (((!((callbackObject == null))) && ((callbackMethod is String)))){ try { var _local5 = callbackObject; _local5[callbackMethod](args); } catch(error:Error) { }; } else { if (callbackMethod != null){ try { callbackMethod.apply(args); } catch(error:Error) { }; }; }; }; } public static function get clip():Object{ return (_container); } public static function set comChannelName(_arg1:String):void{ if (_arg1 != null){ if (_arg1.length > 3){ _sendChannelName = (_arg1 + "_fromgame"); _rcvChannelName = _arg1; initComChannels(); }; }; } private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{ var id = _arg1; var clip = _arg2; var clipname:String = ("_mochiservices_com_" + id); if (_clip != null){ return (_clip); }; if (!MochiServices.isNetworkAvailable()){ return (null); }; MochiServices.allowDomains(_gatewayURL); _clip = createEmptyMovieClip(clip, clipname, 10336, false); _loader = new Loader(); _timer = new Timer(1000, 0); _startTime = getTimer(); _timer.addEventListener(TimerEvent.TIMER, connectWait); _timer.start(); var f:Function = function (_arg1:Object):void{ _clip._mochiad_ctr_failed = true; trace("MochiServices could not load."); MochiServices.disconnect(); MochiServices.onError("IOError"); }; _loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f); var req:URLRequest = new URLRequest(_gatewayURL); _loader.load(req); _clip.addChild(_loader); _clip._mochiservices_com = _loader; _sendChannel = new LocalConnection(); _clip._queue = []; _rcvChannel = new LocalConnection(); _rcvChannel.allowDomain("*", "localhost"); _rcvChannel.allowInsecureDomain("*", "localhost"); _rcvChannel.client = _clip; _clip._nextcallbackID = 0; _clip._callbacks = {}; listen(); return (_clip); } public static function bringToTop(_arg1:Event):void{ var e = _arg1; if (MochiServices.clip != null){ if (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 connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{ var id = _arg1; var clip = _arg2; var onError = _arg3; 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 parent = _arg1; var name = _arg2; var depth = _arg3; var doAdd = _arg4; var mc:MovieClip = 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 connectWait(_arg1:TimerEvent):void{ if ((getTimer() - _startTime) > 10000){ if (!_connected){ _clip._mochiad_ctr_failed = true; trace("MochiServices could not load."); MochiServices.disconnect(); MochiServices.onError("IOError"); }; _timer.stop(); }; } } }//package mochi
Section 19
//BitmapAsset (mx.core.BitmapAsset) package mx.core { import flash.display.*; public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject { mx_internal static const VERSION:String = "3.0.0.0"; public function BitmapAsset(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){ super(_arg1, _arg2, _arg3); } public function get measuredWidth():Number{ if (bitmapData){ return (bitmapData.width); }; return (0); } public function get measuredHeight():Number{ if (bitmapData){ return (bitmapData.height); }; return (0); } public function setActualSize(_arg1:Number, _arg2:Number):void{ width = _arg1; height = _arg2; } public function move(_arg1:Number, _arg2:Number):void{ this.x = _arg1; this.y = _arg2; } } }//package mx.core
Section 20
//FlexBitmap (mx.core.FlexBitmap) package mx.core { import flash.display.*; import mx.utils.*; public class FlexBitmap extends Bitmap { mx_internal static const VERSION:String = "3.0.0.0"; public function FlexBitmap(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){ var bitmapData = _arg1; var pixelSnapping = _arg2; var smoothing = _arg3; super(bitmapData, pixelSnapping, smoothing); try { name = NameUtil.createUniqueName(this); } catch(e:Error) { }; } override public function toString():String{ return (NameUtil.displayObjectToString(this)); } } }//package mx.core
Section 21
//FontAsset (mx.core.FontAsset) package mx.core { import flash.text.*; public class FontAsset extends Font implements IFlexAsset { mx_internal static const VERSION:String = "3.0.0.0"; } }//package mx.core
Section 22
//IFlexAsset (mx.core.IFlexAsset) package mx.core { public interface IFlexAsset { } }//package mx.core
Section 23
//IFlexDisplayObject (mx.core.IFlexDisplayObject) package mx.core { import flash.events.*; import flash.display.*; import flash.geom.*; import flash.accessibility.*; public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher { function get visible():Boolean; function get rotation():Number; function localToGlobal(_arg1:Point):Point; function get name():String; function set width(_arg1:Number):void; function get measuredHeight():Number; function get blendMode():String; function get scale9Grid():Rectangle; function set name(_arg1:String):void; function set scaleX(_arg1:Number):void; function set scaleY(_arg1:Number):void; function get measuredWidth():Number; function get accessibilityProperties():AccessibilityProperties; function set scrollRect(_arg1:Rectangle):void; function get cacheAsBitmap():Boolean; function globalToLocal(_arg1:Point):Point; function get height():Number; function set blendMode(_arg1:String):void; function get parent():DisplayObjectContainer; function getBounds(_arg1:DisplayObject):Rectangle; function get opaqueBackground():Object; function set scale9Grid(_arg1:Rectangle):void; function setActualSize(_arg1:Number, _arg2:Number):void; function set alpha(_arg1:Number):void; function set accessibilityProperties(_arg1:AccessibilityProperties):void; function get width():Number; function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean; function set cacheAsBitmap(_arg1:Boolean):void; function get scaleX():Number; function get scaleY():Number; function get scrollRect():Rectangle; function get mouseX():Number; function get mouseY():Number; function set height(_arg1:Number):void; function set mask(_arg1:DisplayObject):void; function getRect(_arg1:DisplayObject):Rectangle; function get alpha():Number; function set transform(_arg1:Transform):void; function move(_arg1:Number, _arg2:Number):void; function get loaderInfo():LoaderInfo; function get root():DisplayObject; function hitTestObject(_arg1:DisplayObject):Boolean; function set opaqueBackground(_arg1:Object):void; function set visible(_arg1:Boolean):void; function get mask():DisplayObject; function set x(_arg1:Number):void; function set y(_arg1:Number):void; function get transform():Transform; function set filters(_arg1:Array):void; function get x():Number; function get y():Number; function get filters():Array; function set rotation(_arg1:Number):void; function get stage():Stage; } }//package mx.core
Section 24
//IRepeaterClient (mx.core.IRepeaterClient) package mx.core { public interface IRepeaterClient { function get instanceIndices():Array; function set instanceIndices(_arg1:Array):void; function get isDocument():Boolean; function set repeaters(_arg1:Array):void; function initializeRepeaterArrays(_arg1:IRepeaterClient):void; function get repeaters():Array; function set repeaterIndices(_arg1:Array):void; function get repeaterIndices():Array; } }//package mx.core
Section 25
//mx_internal (mx.core.mx_internal) package mx.core { public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal"; }//package mx.core
Section 26
//SoundAsset (mx.core.SoundAsset) package mx.core { import flash.media.*; public class SoundAsset extends Sound implements IFlexAsset { mx_internal static const VERSION:String = "3.0.0.0"; } }//package mx.core
Section 27
//NameUtil (mx.utils.NameUtil) package mx.utils { import flash.display.*; import mx.core.*; import flash.utils.*; public class NameUtil { mx_internal static const VERSION:String = "3.0.0.0"; private static var counter:int = 0; public static function displayObjectToString(_arg1:DisplayObject):String{ var _local2:String; var _local4:String; var _local5:Array; var _local3:DisplayObject = _arg1; while (_local3 != null) { if (((((_local3.parent) && (_local3.stage))) && ((_local3.parent == _local3.stage)))){ break; }; _local4 = _local3.name; if ((_local3 is IRepeaterClient)){ _local5 = IRepeaterClient(_local3).instanceIndices; if (_local5){ _local4 = (_local4 + (("[" + _local5.join("][")) + "]")); }; }; _local2 = ((_local2 == null)) ? _local4 : ((_local4 + ".") + _local2); _local3 = _local3.parent; }; return (_local2); } public static function createUniqueName(_arg1:Object):String{ if (!_arg1){ return (null); }; var _local2:String = getQualifiedClassName(_arg1); var _local3:int = _local2.indexOf("::"); if (_local3 != -1){ _local2 = _local2.substr((_local3 + 2)); }; var _local4:int = _local2.charCodeAt((_local2.length - 1)); if ((((_local4 >= 48)) && ((_local4 <= 57)))){ _local2 = (_local2 + "_"); }; return ((_local2 + counter++)); } } }//package mx.utils
Section 28
//ActiveGraph (net.rezmason.utils.ActiveGraph) package net.rezmason.utils { import flash.events.*; import flash.display.*; import flash.text.*; import flash.utils.*; import flash.system.*; public class ActiveGraph extends Sprite { private const PAGE:Number = 0x1000; private const MEGABYTES:Number = 9.5367431640625E-7; private const WIDTH:Number = 50; private const HEIGHT:Number = 15; private var output:String; private var textFormat:TextFormat; private var numerator:Number; private var history:Array; private var graphBackground:Sprite; private var average:int; private var itr:Number; private var high:Number; private var lastPlot1:int; private var plotLength:int; private var sign:String; private var old:int; private var verboseMode:Boolean; private var fn:Function; private var returnVal:Boolean; private var backY:Number; private var low:Number; private var backX:Number; private var textBox:TextField; private var plot:int; private var caught2:Boolean;// = false private var denominator:Number; private var timer:Timer; private var plotLine:Shape; private var lastPlot2:int; public function ActiveGraph(_arg1:Number=0, _arg2:Boolean=false, _arg3:Boolean=true, _arg4:int=2):void{ _arg4 = Math.min(_arg4, 2); lastPlot1 = (lastPlot2 = (plot = (plotLength = 0))); history = new Array(); numerator = (denominator = (average = 0)); timer = new Timer(_arg1); verboseMode = _arg2; switch (_arg4){ case 0: fn = test0; break; case 2: fn = test2; break; default: fn = test1; break; }; if (_arg3){ textBox = new TextField(); textFormat = new TextFormat(); graphBackground = new Sprite(); plotLine = new Shape(); textFormat.size = 9; textFormat.font = "Monaco"; textFormat.color = 0xFFFFFF; textBox.selectable = false; textBox.autoSize = TextFieldAutoSize.LEFT; textBox.x = (WIDTH + 5); textBox.height = HEIGHT; graphBackground.graphics.beginFill(0); graphBackground.graphics.drawRect(0, 0, (WIDTH + 85), HEIGHT); graphBackground.graphics.endFill(); graphBackground.graphics.lineStyle(0.5, 0xFFFFFF); graphBackground.graphics.drawRect(0, 0, WIDTH, (HEIGHT - 1)); this.addChild(graphBackground); this.addChild(plotLine); this.addChild(textBox); timer.addEventListener(TimerEvent.TIMER, drawMem, false, 0, true); textBox.mouseEnabled = false; backX = x; backY = y; graphBackground.addEventListener(MouseEvent.MOUSE_DOWN, handleDrag, false, 0, true); graphBackground.addEventListener(MouseEvent.MOUSE_UP, handleDrag, false, 0, true); this.addEventListener(Event.ADDED_TO_STAGE, loadDrag, false, 0, true); } else { trace("ActiveGraph Running."); timer.addEventListener(TimerEvent.TIMER, trackMem, false, 0, true); }; timer.start(); } public function get data():Number{ return (plot); } private function trackMem(_arg1:TimerEvent=null):Boolean{ returnVal = false; plot = (System.totalMemory / PAGE); old = average; numerator = (numerator + plot); denominator++; average = (numerator / denominator); if (((fn()) && (verboseMode))){ trace(plot); }; return (returnVal); } private function loadDrag(_arg1:Event):void{ this.stage.addEventListener(Event.MOUSE_LEAVE, handleDrag, false, 0, true); } private function test1():Boolean{ returnVal = ((!(lastPlot1)) || ((lastPlot1 > plot))); lastPlot1 = plot; return (returnVal); } private function test2():Boolean{ if ((((lastPlot1 > plot)) || (!(lastPlot1)))){ if ((((lastPlot2 > plot)) || (!(lastPlot2)))){ caught2 = true; }; lastPlot2 = plot; } else { if ((((lastPlot1 < plot)) && (caught2))){ plot = lastPlot2; returnVal = true; caught2 = false; }; }; lastPlot1 = plot; return (returnVal); } private function test0():Boolean{ if (lastPlot1 != plot){ returnVal = true; lastPlot1 = plot; }; return (returnVal); } private function drawMem(_arg1:TimerEvent=null):void{ if (trackMem()){ plotLine.graphics.clear(); if (plotLength == 21){ history.shift(); plotLength--; }; if (plot > history[int((plotLength - 1))]){ sign = "+ , "; } else { if (plot < history[int((plotLength - 1))]){ sign = "- , "; } else { sign = " , "; }; }; history.push(plot); plotLength = history.length; if (plotLength > 1){ plotLine.graphics.lineStyle(2.5, 0xFF0000); high = 0; low = Infinity; itr = 0; while (itr < plotLength) { high = Math.max(history[itr], high); low = Math.min(history[itr], low); itr++; }; plotLine.graphics.moveTo(0, (HEIGHT * (1 - ((history[0] - low) / (high - low))))); itr = 1; while (itr < plotLength) { plotLine.graphics.lineTo(((WIDTH * itr) / (plotLength - 1)), (HEIGHT * (1 - ((history[itr] - low) / (high - low))))); itr++; }; }; output = (plot + sign); textBox.text = (String(output) + String(average)); textBox.setTextFormat(textFormat); }; } private function handleDrag(_arg1:Event):void{ switch (_arg1.type){ case MouseEvent.MOUSE_DOWN: backX = x; backY = y; startDrag(); break; case MouseEvent.MOUSE_UP: stopDrag(); break; case Event.MOUSE_LEAVE: stopDrag(); x = backX; y = backY; break; }; } } }//package net.rezmason.utils
Section 29
//ilMareGamesSplash (splashes.ilMareGamesSplash) package splashes { import caurina.transitions.*; import flash.display.*; import flash.geom.*; public class ilMareGamesSplash extends Splash implements ISplash { private const SIZE_WAVE:Number = 100; private var _curve1:Array; private var _curve2:Array; private var _time:Number; private var _ilMareGames:Bitmap; private var _curve1Canvas:Sprite; private var _curve2Canvas:Sprite; private var IMG_ilMareGames:Class; public function ilMareGamesSplash(){ IMG_ilMareGames = ilMareGamesSplash_IMG_ilMareGames; _curve1 = [new SpritePoint(0, 0), new SpritePoint(SIZE_WAVE, -(SIZE_WAVE)), new SpritePoint(SIZE_WAVE, -(SIZE_WAVE))]; _curve2 = [new SpritePoint(SIZE_WAVE, 0), new SpritePoint((SIZE_WAVE / 2), (-(SIZE_WAVE) / 4)), _curve1[2]]; super(); var _local1:Matrix = new Matrix(); _local1.createGradientBox(DEF.BACKGROUND_TILE_WIDTH, DEF.BACKGROUND_TILE_HEIGHT, (-(Math.PI) / 2), 0, 0); var _local2:Array = [11001855, 0xFFFFFF]; graphics.beginGradientFill("linear", _local2, [1, 1], [0, 0xFF], _local1, "pad", "RGB"); graphics.drawRect(0, 0, DEF.SCREEN_WIDTH, DEF.SCREEN_HEIGHT); graphics.endFill(); _curve1Canvas = new Sprite(); _curve1Canvas.x = ((DEF.SCREEN_WIDTH / 2) - SIZE_WAVE); _curve1Canvas.y = ((DEF.SCREEN_HEIGHT / 2) - 20); addChild(_curve1Canvas); _curve2Canvas = new Sprite(); _curve2Canvas.x = (_curve1Canvas.x + SIZE_WAVE); _curve2Canvas.y = _curve1Canvas.y; addChild(_curve2Canvas); _ilMareGames = (new IMG_ilMareGames() as Bitmap); addChild(_ilMareGames); _ilMareGames.x = ((DEF.SCREEN_WIDTH / 2) - (_ilMareGames.width / 2)); _ilMareGames.y = (DEF.SCREEN_HEIGHT / 2); _ilMareGames.alpha = 0; } protected function drawCurve(_arg1:Sprite, _arg2:Array):void{ _arg1.graphics.lineStyle(3, 6711039); _arg1.graphics.moveTo((_arg2[0] as SpritePoint).x, (_arg2[0] as SpritePoint).y); _arg1.graphics.curveTo((_arg2[1] as SpritePoint).x, (_arg2[1] as SpritePoint).y, (_arg2[2] as SpritePoint).x, (_arg2[2] as SpritePoint).y); _arg1.graphics.lineStyle(); } override public function init():void{ Tweener.addTween((_curve1[1] as Sprite), {delay:2, time:1, x:(SIZE_WAVE / 2), y:-(SIZE_WAVE), transition:"linear"}); Tweener.addTween((_curve1[2] as Sprite), {delay:2.5, time:1, x:SIZE_WAVE, y:(-(SIZE_WAVE) / 2), transition:"linear"}); Tweener.addTween(_ilMareGames, {delay:2, time:2, alpha:1, transition:"linear"}); this.alpha = 0; Tweener.addTween(this, {delay:0, time:2, alpha:1, transition:"linear"}); Tweener.addTween(this, {delay:5, time:2, alpha:0, transition:"linear", onComplete:skip}); _skipping = false; } override public function update():Boolean{ if (_skipping){ return (false); }; _curve1Canvas.graphics.clear(); drawCurve(_curve1Canvas, _curve1); drawCurve(_curve1Canvas, _curve2); _curve2Canvas.graphics.clear(); drawCurve(_curve2Canvas, _curve1); drawCurve(_curve2Canvas, _curve2); return (true); } } }//package splashes
Section 30
//ilMareGamesSplash_IMG_ilMareGames (splashes.ilMareGamesSplash_IMG_ilMareGames) package splashes { import mx.core.*; public class ilMareGamesSplash_IMG_ilMareGames extends BitmapAsset { } }//package splashes
Section 31
//ISplash (splashes.ISplash) package splashes { public interface ISplash { function init():void; function update():Boolean; function skip():void; } }//package splashes
Section 32
//Splash (splashes.Splash) package splashes { import flash.display.*; public class Splash extends Sprite implements ISplash { protected var _skipping:Boolean;// = false public function Splash(){ _skipping = false; super(); } public function skip():void{ _skipping = true; } public function init():void{ _skipping = false; } public function update():Boolean{ if (_skipping){ return (false); }; return (true); } } }//package splashes
Section 33
//SpritePoint (splashes.SpritePoint) package splashes { import flash.display.*; public class SpritePoint extends Sprite { public function SpritePoint(_arg1:Number, _arg2:Number){ this.x = _arg1; this.y = _arg2; } } }//package splashes
Section 34
//DamageBar (DamageBar) package { import flash.display.*; public class DamageBar { public var barra:Shape; private var _max:Number; private var _height:Number; private var realCount:Number;// = 0 private var _lowerPerCall:Number; private var _fakeCount:Number;// = 0 public function DamageBar(_arg1:Sprite, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=10, _arg6:Number=0.3){ barra = new Shape(); barra.x = _arg2; barra.y = _arg3; _max = _arg4; _height = _arg5; _lowerPerCall = _arg6; _arg1.addChild(barra); } public function get isFull():Boolean{ if (realCount >= _max){ return (true); }; return (false); } public function get isEmpty():Boolean{ if (realCount <= 0){ return (true); }; return (false); } public function set count(_arg1:Number):void{ realCount = _arg1; } public function get count():Number{ return (realCount); } public function set lowerPerCall(_arg1:Number):void{ _lowerPerCall = _arg1; } public function get fakeCount():Number{ return (_fakeCount); } public function paint():void{ if (_fakeCount < realCount){ _fakeCount = (_fakeCount + ((realCount - _fakeCount) / 10)); } else { _fakeCount = realCount; }; if (realCount > 0){ realCount = (realCount - _lowerPerCall); } else { realCount = 0; }; if (realCount > _max){ realCount = _max; }; barra.graphics.clear(); barra.graphics.lineStyle(1, 17); barra.graphics.beginFill(0xAA3300, 0.3); barra.graphics.drawRect(0, 0, _max, _height); barra.graphics.endFill(); if (realCount > 0){ barra.graphics.beginFill(0x990000, 0.3); barra.graphics.drawRect(0, 0, realCount, _height); barra.graphics.endFill(); barra.graphics.beginFill(0xFF0000, 0.8); barra.graphics.drawRect(0, 0, _fakeCount, _height); barra.graphics.endFill(); }; } } }//package
Section 35
//DEF (DEF) package { public class DEF { public static const MAX_VEL:Number = 1000; public static const MENUOPTION_NONE:Number = -1; public static const GRADIENT_SKY_HIGH_NIGHT:Array = [4022405, 0]; public static const MENUOPTION_ABOUT:Number = 4; public static const MENUOPTION_HELP:Number = 5; public static const HUD_MESSAGE_FONT:String = "casper"; public static const MENU_BUTTON_INITIAL_Y:Number = 150; public static const SCREEN_WIDTH:Number = 640; public static const MAP_X:Number = 215; public static const HUD_SCORE_SIZE:Number = 24; public static const HUD_TOP_PANEL_WIDTH:Number = 426.666666666667; public static const MAP_Y:Number = 50; public static const DEBUG:Boolean = false; public static const MENUOPTION_MAIN_MENU:Number = 8; public static const STALL_VEL:Number = 10; public static const HUD_BAR_INITIAL_STEP:Number = 0.04; public static const ABOUT_HORIZ_MARGIN:Number = 80; public static const BACKGROUND_TILE_HEIGHT:Number = 0x0400; public static const HUD_TOP_PANEL_X:Number = 106.666666666667; public static const HUD_TOP_PANEL_Y:Number = 0; public static const CLOUD_INITIAL_ALTITUDE:Number = 480; public static const HUD_TIMER_X:Number = (HUD_LEFT_PANEL_X + 5); public static const HUD_TIMER_Y:Number = ((HUD_LEFT_PANEL_Y + HUD_LEFT_PANEL_HEIGHT) - 40); public static const SCREEN_HEIGHT:Number = 480; public static const MENUOPTION_TIMED_MODE:Number = 0; public static const HUD_SCORE_X:Number = 60; public static const HUD_SCORE_Y:Number = 77; public static const MENU_BUTTON_GLOW_COLOR:Number = 0xFF00FF; public static const HUD_SCORE_FONT:String = "casper"; public static const HUD_LEVEL_SIZE:Number = 24; public static const DEBUG_FORCES:Boolean = false; public static const MAP_PIECE_WIDTH:Number = 50; public static const BACKGROUND_TILE_WIDTH:Number = 0x0400; public static const MAIN_MENU_OPTIONS:Array = new Array({string:"Play!", returnValue:DEF.MENUOPTION_FREE_MODE}, {string:"Highscores", returnValue:DEF.MENUOPTION_SHOW_HIGHSCORES}, {string:"Play More Games!", returnValue:DEF.MENUOPTION_PLAY_MORE_GAMES}, {string:"About", returnValue:DEF.MENUOPTION_ABOUT}); public static const HUD_MESSAGE_Y:Number = (HUD_TOP_PANEL_Y + ((HUD_TOP_PANEL_HEIGHT * 4) / 10)); public static const BACKGROUND_COUNT:Number = 3; public static const HUD_MESSAGE_X:Number = (((SCREEN_WIDTH / 2) - (DEF.HUD_TOP_PANEL_WIDTH / 2)) + 10); public static const ABOUT_VERT_MARGIN:Number = 60; public static const BACKGROUND_TOP:Number = 2; public static const HUD_VEL_X:Number = (HUD_LEFT_PANEL_X + 5); public static const HUD_VEL_Y:Number = (HUD_LEFT_PANEL_Y + 20); public static const HUD_LEVEL_FONT:String = "casper"; public static const DEBUG_FPS:Boolean = false; public static const ABOUT_TEXT:Array = new Array({color:0xFF0000, string:"SPIN MADNESS"}, {color:0, string:"v1.0.0"}, {color:0, string:""}, {color:5592575, string:"ilMare Games"}, {color:0, string:""}, {color:85, string:"Programmed by Juan Ignacio Albanesi"}, {color:2237183, string:"jalbanesi@gmail.com"}, {color:0, string:""}, {color:85, string:"Music by bebeto"}, {color:2237183, string:"http://saguarovideo.blogspot.com/"}); public static const MAP_PIECE_INITIAL_Y:Number = -20; public static const MENU_BUTTON_ALPHA:Number = 0.7; public static const MENU_BUTTON_COLOR:Number = 16737840; public static const MAP_WIDTH:Number = 7; public static const GRADIENT_SKY_NIGHT:Array = [4813208, 4022405]; public static const HUD_LEFT_PANEL_X:Number = 0; public static const HUD_LEFT_PANEL_Y:Number = 80; public static const MAP_HEIGTH:Number = 7; public static const MENU_BUTTON_SPACING:Number = (MENU_BUTTON_HEIGHT + 20); public static const ABOUT_BORDER_COLOR:Number = 0; public static const BACKGROUND_ALTITUDE_MODIFIER:Number = (Math.pow(BACKGROUND_COEFFICIENT, (BACKGROUND_COUNT - 1)) * BACKGROUND_TILE_HEIGHT); public static const HUD_MESSAGE_FONT_COLOR:Number = 0xFFFFFF; public static const HUD_TOP_PANEL_HEIGHT:Number = 80; public static const HUD_TIMER_FONT_COLOR:Number = 0xFFFFFF; public static const VEL_MACH1:Number = 100; public static const VEL_MACH2:Number = 200; public static const MENUOPTION_SHOW_HIGHSCORES:Number = 9; public static const VEL_MACH3:Number = 300; public static const GRADIENT_SKY_DAY:Array = [7780084, 4091050]; public static const MENU_BUTTON_WIDTH:Number = 222; public static const HUD_TIMER_SIZE:Number = 18; public static const ACROBATIC_TIMEOUT:Number = 3000; public static const HUD_BAR_HEIGHT:Number = 25; public static const FLOOR_SFX_ALT:Number = 280; public static const MENUOPTION_SUBMIT_SCORE:Number = 7; public static const HUD_SCORE_FONT_SHADOW_COLOR:Number = 0; public static const HUD_TIMER_FONT_SHADOW_COLOR:Number = 0; public static const MENU_BUTTON_X:Number = 398; public static const ENDGAME_MENU_OPTIONS:Array = new Array({string:"Try Again!", returnValue:DEF.MENUOPTION_TRY_AGAIN}, {string:"Submit Score", returnValue:DEF.MENUOPTION_SUBMIT_SCORE}, {string:"Play More Games!", returnValue:DEF.MENUOPTION_PLAY_MORE_GAMES}, {string:"Main Menu", returnValue:DEF.MENUOPTION_MAIN_MENU}); public static const POWERUP_RADIUS:Number = 75; public static const MENUOPTION_PLAY_MORE_GAMES:Number = 2; public static const HUD_SCORE_FINAL_Y:Number = 305; public static const HUD_SCORE_FINAL_X:Number = 120; public static const BACKGROUND_COEFFICIENT:Number = 2; public static const HUD_LEVEL_FONT_COLOR:Number = 15658751; public static const GRADIENT_SKY_HIGH_DAY:Array = [4091050, 0]; public static const HUD_BAR_MAX:Number = 388; public static const HUD_TIMER_FONT:String = "casper"; public static const HUD_MESSAGE_FONT_SHADOW_COLOR:Number = 0; public static const HUD_LEVEL_FONT_BACK_COLOR:Number = 3355460; public static const MANIOBRABILIDAD_MULT:Number = 6; public static const HUD_SCORE_FINAL_SIZE:Number = 50; public static const HUD_BAR_X:Number = 235; public static const HUD_BAR_Y:Number = 445; public static const HUD_SCORE_FONT_COLOR:Number = 0x222222; public static const DEBUG_MEM:Boolean = false; public static const MENUOPTION_FREE_MODE:Number = 1; public static const ABOUT_FONT_SIZE:Number = 16; public static const MENUOPTION_TRY_AGAIN:Number = 6; public static const HUD_LEFT_PANEL_HEIGHT:Number = 320; public static const HUD_ALT_X:Number = (HUD_LEFT_PANEL_X + 5); public static const HUD_LEFT_PANEL_WIDTH:Number = 80; public static const HUD_MESSAGE_SIZE:Number = 12; public static const HUD_ALT_Y:Number = (HUD_LEFT_PANEL_Y + 110); public static const MENUOPTION_OPTIONS:Number = 3; public static const GRADIENT_SKY_SPACE:Array = [0, 0]; public static const MAP_PIECE_HEIGHT:Number = 50; public static const ABOUT_FONT:String = "casper"; public static const MENU_BUTTON_TEXT_SIZE:Number = 18; public static const MAP_PIECE_SPACING:Number = 4; public static const MENU_BUTTON_HEIGHT:Number = 40; public static const ABOUT_BACK_COLOR:Number = 14540287; public static const MENU_BUTTON_TEXT_COLOR:Number = 0xFFFFFF; public static var BACKGROUND_ELEMENTS_COUNT:Number = 50; } }//package
Section 36
//FPS (FPS) package { import flash.text.*; import flash.utils.*; public class FPS extends TextField { private var _lastTime:Number;// = -1 private var _accumTime:Number;// = 0 public function update():void{ var _local1:Number = getTimer(); var _local2:Number = (_local1 - _lastTime); _lastTime = _local1; _accumTime = (_accumTime + _local2); if ((((_accumTime > 1000)) && ((_local2 > 0)))){ text = ("FPS: " + (1000 / _local2).toFixed(0)); _accumTime = 0; }; } } }//package
Section 37
//GenericAbout (GenericAbout) package { import flash.events.*; import flash.display.*; import Fader.*; import flash.filters.*; import flash.text.*; public class GenericAbout extends Sprite { private var exit:Boolean;// = false public function GenericAbout(){ var _local2:Object; var _local3:Sprite; var _local4:TextField; var _local5:TextFormat; super(); graphics.lineStyle(2, DEF.ABOUT_BORDER_COLOR); graphics.beginFill(DEF.ABOUT_BACK_COLOR, 0.8); graphics.drawRoundRect(DEF.ABOUT_HORIZ_MARGIN, DEF.ABOUT_VERT_MARGIN, (DEF.SCREEN_WIDTH - (2 * DEF.ABOUT_HORIZ_MARGIN)), (DEF.SCREEN_HEIGHT - (2 * DEF.ABOUT_VERT_MARGIN)), 30, 30); graphics.endFill(); var _local1:Number = 0; for each (_local2 in DEF.ABOUT_TEXT) { _local4 = new TextField(); _local5 = new TextFormat(DEF.ABOUT_FONT, DEF.ABOUT_FONT_SIZE); _local5.align = "center"; _local5.color = _local2.color; _local4.embedFonts = true; _local4.defaultTextFormat = _local5; _local4.selectable = false; _local4.autoSize = "center"; _local4.text = _local2.string; _local4.x = ((DEF.SCREEN_WIDTH / 2) - (_local4.width / 2)); _local4.y = ((DEF.ABOUT_HORIZ_MARGIN * 1.3) + _local1); addChild(_local4); _local1 = (_local1 + (DEF.ABOUT_FONT_SIZE * 1.5)); }; _local3 = new Sprite(); _local3.graphics.lineStyle(2, DEF.ABOUT_BORDER_COLOR); _local3.graphics.beginFill(DEF.ABOUT_BACK_COLOR, 0.8); _local3.graphics.drawRoundRect(0, 0, (DEF.ABOUT_HORIZ_MARGIN * 2), (DEF.ABOUT_VERT_MARGIN / 2), 20, 20); _local3.graphics.endFill(); _local3.x = (DEF.SCREEN_WIDTH - (3 * DEF.ABOUT_HORIZ_MARGIN)); _local3.y = (DEF.SCREEN_HEIGHT - DEF.ABOUT_VERT_MARGIN); _local4 = new TextField(); _local5 = new TextFormat("casper", DEF.ABOUT_FONT_SIZE); _local4.y = ((((DEF.ABOUT_VERT_MARGIN / 2) / 2) - (DEF.ABOUT_FONT_SIZE / 2)) - 3); _local4.width = (DEF.ABOUT_HORIZ_MARGIN * 2); _local4.autoSize = "center"; _local5.color = 0; _local5.align = "center"; _local4.embedFonts = true; _local4.defaultTextFormat = _local5; _local4.text = "BACK"; _local4.selectable = false; _local4.name = "ABOUT_BACK"; _local3.addChild(_local4); _local3.addEventListener(MouseEvent.CLICK, buttonClicked, false, 0, true); _local3.addEventListener(MouseEvent.MOUSE_OVER, buttonOver, false, 0, true); _local3.addEventListener(MouseEvent.MOUSE_OUT, buttonOut, false, 0, true); this.addChild(_local3); } public function hide():void{ this.visible = false; } public function buttonClicked(_arg1:MouseEvent):void{ exit = true; } public function buttonOver(_arg1:MouseEvent):void{ var _local2:BitmapFilter = new GlowFilter(0xFF, 0.5); var _local3:Array = new Array(); _local3.push(_local2); if ((_arg1.target is TextField)){ _arg1.target.parent.filters = _local3; } else { _arg1.target.getChildAt(0).filters = _local3; }; _arg1.target.filters = _local3; trace(("over " + _arg1.target.name)); } public function update():Boolean{ return (!(exit)); } public function buttonOut(_arg1:MouseEvent):void{ _arg1.target.filters = null; if ((_arg1.target is TextField)){ _arg1.target.parent.filters = null; } else { _arg1.target.getChildAt(0).filters = null; }; } public function show():void{ exit = false; this.visible = true; Fader.getSingleton().OutIn(this, 1); } } }//package
Section 38
//GenericButton (GenericButton) package { import flash.events.*; import caurina.transitions.*; import flash.display.*; import flash.filters.*; public class GenericButton extends Sprite { private var _bmpUp:BitmapData; private var _bmpDown:BitmapData; private var _state:Number;// = 1 private var _glowing:Boolean;// = false public static const BUTTON_UP:Number = 1; public static const BUTTON_CLICKED:Number = 2; public static const BUTTON_DOWN:Number = 0; public function GenericButton(_arg1:BitmapData, _arg2:BitmapData){ addEventListener(MouseEvent.MOUSE_DOWN, mouseDown); addEventListener(MouseEvent.MOUSE_UP, mouseUp); addEventListener(MouseEvent.CLICK, mouseClick); _bmpDown = _arg1; _bmpUp = _arg2; paint(); } public function mouseUp(_arg1:MouseEvent):void{ if (_state == BUTTON_DOWN){ _state = BUTTON_CLICKED; }; paint(); } public function mouseClick(_arg1:MouseEvent):void{ _state = BUTTON_CLICKED; paint(); } public function mouseDown(_arg1:MouseEvent):void{ _state = BUTTON_DOWN; paint(); } public function get isPressed():Boolean{ if (_state == BUTTON_CLICKED){ _state = BUTTON_UP; paint(); return (true); }; return (false); } public function startGlowing():void{ if (_glowing){ return; }; _glowing = true; var glowIn:GlowFilter = new GlowFilter(16724787, 0.8, 10, 10, 7, 2); var glowOut:GlowFilter = new GlowFilter(16724787, 0, 10, 10, 7, 2); Tweener.addTween(this, {_filter:glowIn, time:1}); Tweener.addTween(this, {_filter:glowOut, delay:1, time:0.5, onComplete:function ():void{ _glowing = false; }}); } public function paint():void{ graphics.clear(); switch (_state){ case BUTTON_CLICKED: case BUTTON_UP: graphics.beginBitmapFill(_bmpUp); break; case BUTTON_DOWN: graphics.beginBitmapFill(_bmpDown); break; }; graphics.drawRect(0, 0, _bmpUp.width, _bmpDown.height); graphics.endFill(); } } }//package
Section 39
//GenericMenu (GenericMenu) package { import flash.events.*; import caurina.transitions.*; import flash.display.*; import flash.filters.*; import flash.text.*; public class GenericMenu extends Sprite { private var _items:Array; private var returnValue:Number;// = -1 private var _buttons:Array; public function GenericMenu(_arg1:Array, _arg2:Bitmap=null){ var _local4:Sprite; var _local5:TextField; var _local6:TextFormat; super(); if (_arg2){ addChild(_arg2); }; _items = _arg1; _buttons = new Array(); var _local3:Number = 0; while (_local3 < _arg1.length) { _local4 = new Sprite(); _local4.graphics.beginFill(DEF.MENU_BUTTON_COLOR, DEF.MENU_BUTTON_ALPHA); _local4.graphics.drawRoundRect(0, 0, DEF.MENU_BUTTON_WIDTH, DEF.MENU_BUTTON_HEIGHT, 10, 10); _local4.graphics.endFill(); _local4.graphics.lineStyle(1, 0); _local4.graphics.drawRoundRect(0, 0, DEF.MENU_BUTTON_WIDTH, DEF.MENU_BUTTON_HEIGHT, 10, 10); _local4.name = _items[_local3].returnValue; _local5 = new TextField(); _local6 = new TextFormat("casper", DEF.MENU_BUTTON_TEXT_SIZE); _local5.y = (((DEF.MENU_BUTTON_HEIGHT / 2) - (DEF.MENU_BUTTON_TEXT_SIZE / 2)) - 3); _local5.width = DEF.MENU_BUTTON_WIDTH; _local5.autoSize = "center"; _local6.color = DEF.MENU_BUTTON_TEXT_COLOR; _local6.align = "center"; _local5.embedFonts = true; _local5.defaultTextFormat = _local6; _local5.text = _items[_local3].string; _local5.selectable = false; _local5.name = _local4.name; _local4.addChild(_local5); _local4.addEventListener(MouseEvent.CLICK, buttonClicked, false, 0, true); _local4.addEventListener(MouseEvent.MOUSE_OVER, buttonOver, false, 0, true); _local4.addEventListener(MouseEvent.MOUSE_OUT, buttonOut, false, 0, true); this.addChild(_local4); _buttons.push(_local4); _local3++; }; hide(); } public function buttonOver(_arg1:MouseEvent):void{ var _local2:BitmapFilter = new GlowFilter(DEF.MENU_BUTTON_GLOW_COLOR, 0.5); var _local3:Array = new Array(); _local3.push(_local2); if ((_arg1.target is TextField)){ _arg1.target.parent.filters = _local3; } else { _arg1.target.getChildAt(0).filters = _local3; }; _arg1.target.filters = _local3; trace(("over " + _arg1.target.name)); } public function update():Number{ var _local1:Number = returnValue; returnValue = DEF.MENUOPTION_NONE; return (_local1); } public function buttonClicked(_arg1:MouseEvent):void{ returnValue = _arg1.target.name; } public function hide():void{ this.visible = false; returnValue = DEF.MENUOPTION_NONE; } public function buttonOut(_arg1:MouseEvent):void{ _arg1.target.filters = null; if ((_arg1.target is TextField)){ _arg1.target.parent.filters = null; } else { _arg1.target.getChildAt(0).filters = null; }; trace(("out " + _arg1.target.name)); } public function show():void{ var _local1:Number = 0; while (_local1 < _items.length) { _buttons[_local1].x = DEF.SCREEN_WIDTH; _buttons[_local1].y = (DEF.MENU_BUTTON_INITIAL_Y + (_local1 * DEF.MENU_BUTTON_SPACING)); Tweener.addTween(_buttons[_local1], {time:1, delay:(0.2 * _local1), x:DEF.MENU_BUTTON_X}); _local1++; }; this.visible = true; returnValue = DEF.MENUOPTION_NONE; } } }//package
Section 40
//IMG (IMG) package { import flash.display.*; public class IMG { public var img_redButton_DOWN:Bitmap; private var IMG_speakerON:Class; private var IMG_splash:Class; private var IMG_go:Class; private var IMG_gameOver:Class; public var img_dos:Bitmap; private var IMG_speakerOFF:Class; public var img_redButton_UP:Bitmap; private var IMG_tres:Class; private var IMG_uno:Class; private var IMG_redButton_DOWN:Class; public var img_speakerON:Bitmap; public var img_splash:Bitmap; public var img_go:Bitmap; public var img_tres:Bitmap; public var img_gameOver:Bitmap; private var IMG_redButton_UP:Class; private var IMG_dos:Class; public var img_speakerOFF:Bitmap; public var img_uno:Bitmap; private static var _instance:IMG = null; public function IMG():void{ IMG_tres = IMG_IMG_tres; IMG_dos = IMG_IMG_dos; IMG_uno = IMG_IMG_uno; IMG_go = IMG_IMG_go; IMG_speakerON = IMG_IMG_speakerON; IMG_speakerOFF = IMG_IMG_speakerOFF; IMG_splash = IMG_IMG_splash; IMG_gameOver = IMG_IMG_gameOver; IMG_redButton_UP = IMG_IMG_redButton_UP; IMG_redButton_DOWN = IMG_IMG_redButton_DOWN; super(); img_tres = (new IMG_tres() as Bitmap); img_dos = (new IMG_dos() as Bitmap); img_uno = (new IMG_uno() as Bitmap); img_go = (new IMG_go() as Bitmap); img_speakerON = (new IMG_speakerON() as Bitmap); img_speakerOFF = (new IMG_speakerOFF() as Bitmap); img_splash = (new IMG_splash() as Bitmap); img_gameOver = (new IMG_gameOver() as Bitmap); img_redButton_DOWN = (new IMG_redButton_DOWN() as Bitmap); img_redButton_UP = (new IMG_redButton_UP() as Bitmap); } public static function getSingleton():IMG{ if (!_instance){ _instance = new (IMG); }; return (_instance); } } }//package
Section 41
//IMG_IMG_dos (IMG_IMG_dos) package { import mx.core.*; public class IMG_IMG_dos extends BitmapAsset { } }//package
Section 42
//IMG_IMG_gameOver (IMG_IMG_gameOver) package { import mx.core.*; public class IMG_IMG_gameOver extends BitmapAsset { } }//package
Section 43
//IMG_IMG_go (IMG_IMG_go) package { import mx.core.*; public class IMG_IMG_go extends BitmapAsset { } }//package
Section 44
//IMG_IMG_redButton_DOWN (IMG_IMG_redButton_DOWN) package { import mx.core.*; public class IMG_IMG_redButton_DOWN extends BitmapAsset { } }//package
Section 45
//IMG_IMG_redButton_UP (IMG_IMG_redButton_UP) package { import mx.core.*; public class IMG_IMG_redButton_UP extends BitmapAsset { } }//package
Section 46
//IMG_IMG_speakerOFF (IMG_IMG_speakerOFF) package { import mx.core.*; public class IMG_IMG_speakerOFF extends BitmapAsset { } }//package
Section 47
//IMG_IMG_speakerON (IMG_IMG_speakerON) package { import mx.core.*; public class IMG_IMG_speakerON extends BitmapAsset { } }//package
Section 48
//IMG_IMG_splash (IMG_IMG_splash) package { import mx.core.*; public class IMG_IMG_splash extends BitmapAsset { } }//package
Section 49
//IMG_IMG_tres (IMG_IMG_tres) package { import mx.core.*; public class IMG_IMG_tres extends BitmapAsset { } }//package
Section 50
//IMG_IMG_uno (IMG_IMG_uno) package { import mx.core.*; public class IMG_IMG_uno extends BitmapAsset { } }//package
Section 51
//Main (Main) package { import flash.events.*; import caurina.transitions.*; import flash.display.*; import Fader.*; import flash.geom.*; import flash.filters.*; import de.polygonal.ds.*; import flash.text.*; import caurina.transitions.properties.*; import splashes.*; import net.rezmason.utils.*; import flash.utils.*; import mochi.*; import flash.net.*; import com.roguedevelopment.pulse.*; import com.roguedevelopment.pulse.emitter.*; import com.roguedevelopment.pulse.initializers.*; import com.roguedevelopment.pulse.particle.*; import com.roguedevelopment.pulse.rule.*; import org.cove.ape.*; import flash.ui.*; public dynamic class Main extends Sprite { private const STATE_NEXTLEVEL:Number = 6; private const STATE_GAME:Number = 2; private const boardID:String = "11ad9cd6d23b4fee"; private const STATE_ABOUT:Number = 8; private const STATE_GAMEWIN:Number = 4; private const STATE_GAMEOVER:Number = 3; private const STATE_HIGHSCORES:Number = 7; private const STATE_MENU:Number = 1; private const STATE_INIT_GAME:Number = 5; private const STATE_INTRO:Number = 0; private var piecesPool:Array; private var splashesArray:Array; private var timeBar:DamageBar; public var debugCanvas:Sprite; private var state:Number; private var score:Number;// = 0 private var FONT_casper:Class; private var redButton:GenericButton; private var inGameMenu:GenericMenu; private var mainMenu:GenericMenu; private var currentSplash:Number;// = 0 private var endScoreText:TextField; private var pieces:Array2; private var levelText:TextField; private var aboutScreen:GenericAbout; private var scoreText:TextField; public var frontCanvas:Sprite; private var colorLevel:Number;// = 3 private var fps:FPS; private var endGameMenu:GenericMenu; private var levelNumber:Number;// = 1 public static var _instance:Main; public function Main(){ FONT_casper = Main_FONT_casper; splashesArray = [new ilMareGamesSplash()]; super(); } public function init():void{ var _local1:ActiveGraph; _instance = this; connectServices("42310d5149461e52"); TextShortcuts.init(); FilterShortcuts.init(); debugCanvas = new Sprite(); addChild(debugCanvas); frontCanvas = new Sprite(); addChild(frontCanvas); stage.frameRate = 40; stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler); stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler); stage.addEventListener(MouseEvent.CLICK, mouseClickHandler); addEventListener(Event.ENTER_FRAME, run); if (DEF.DEBUG_MEM){ _local1 = new ActiveGraph(); debugCanvas.addChild(_local1); }; if (DEF.DEBUG_FPS){ fps = new FPS(); fps.x = 10; fps.y = 40; debugCanvas.addChild(fps); }; setState(STATE_INTRO); } private function run(_arg1:Event):void{ var splash:ISplash; var xx:Number; var yy:Number; var piece:Piece; var evt = _arg1; frontCanvas.graphics.clear(); frontCanvas.graphics.beginFill(0xFFFFFF, 0); frontCanvas.graphics.drawRect(0, 0, DEF.SCREEN_WIDTH, DEF.SCREEN_HEIGHT); frontCanvas.graphics.endFill(); if (DEF.DEBUG_FPS){ fps.update(); }; switch (state){ case STATE_INTRO: splash = (splashesArray[currentSplash] as ISplash); if (!splash.update()){ removeChild((splash as Sprite)); currentSplash++; if (currentSplash >= splashesArray.length){ setState(STATE_MENU); } else { addChild((splashesArray[currentSplash] as Sprite)); (splashesArray[currentSplash] as ISplash).init(); }; }; break; case STATE_MENU: switch (mainMenu.update()){ case DEF.MENUOPTION_FREE_MODE: Fader.getSingleton().InOut(mainMenu, 1, mainMenu.hide); initLevel(0); setState(STATE_INIT_GAME); break; case DEF.MENUOPTION_SHOW_HIGHSCORES: Fader.getSingleton().InOut(mainMenu, 1, mainMenu.hide); setState(STATE_HIGHSCORES); MochiScores.showLeaderboard({boardID:boardID, onClose:function ():void{ setState(STATE_MENU); }}); break; case DEF.MENUOPTION_PLAY_MORE_GAMES: playMoreGames(); break; case DEF.MENUOPTION_ABOUT: Fader.getSingleton().InOut(mainMenu, 1, mainMenu.hide); setState(STATE_ABOUT); break; case DEF.MENUOPTION_NONE: default: break; }; break; case STATE_INIT_GAME: break; case STATE_NEXTLEVEL: xx = 0; while (xx < pieces.width) { yy = 0; while (yy < pieces.height) { piece = pieces.get(xx, yy); if (piece){ piece.update(-1); }; yy = (yy + 1); }; xx = (xx + 1); }; break; case STATE_GAME: updateSTATE_GAME(); break; case STATE_GAMEOVER: case STATE_GAMEWIN: switch (endGameMenu.update()){ case DEF.MENUOPTION_MAIN_MENU: endGameMenu.hide(); setState(STATE_MENU); break; case DEF.MENUOPTION_SUBMIT_SCORE: setState(STATE_HIGHSCORES); endGameMenu.hide(); MochiScores.showLeaderboard({boardID:boardID, score:score, onClose:function ():void{ setState(STATE_MENU); }}); break; case DEF.MENUOPTION_PLAY_MORE_GAMES: playMoreGames(); break; case DEF.MENUOPTION_TRY_AGAIN: endGameMenu.hide(); Fader.getSingleton().InOut(mainMenu, 1, mainMenu.hide); initLevel(levelNumber); setState(STATE_INIT_GAME); break; case DEF.MENUOPTION_NONE: default: break; }; break; case STATE_ABOUT: if (!aboutScreen.update()){ aboutScreen.hide(); setState(STATE_MENU); }; }; } private function updateSTATE_GAME():void{ var _local2:Number; var _local3:Number; var _local4:Piece; var _local5:Number; var _local6:Number; var _local7:Piece; var _local1:Number = getTimer(); timeBar.paint(); if (timeBar.isEmpty){ setState(STATE_GAMEOVER); return; }; if (timeBar.isFull){ setState(STATE_NEXTLEVEL); return; }; if (Piece.currentSpinningCount > 1){ redButton.startGlowing(); }; if (timeBar.count < (DEF.HUD_BAR_MAX / 4)){ if (!MediaPlayer.getSingleton().isPlaying(MediaPlayer.SND_INGAME_TENSE)){ MediaPlayer.getSingleton().stop(MediaPlayer.SND_INGAME_QUIET); MediaPlayer.getSingleton().play(MediaPlayer.SND_INGAME_TENSE, true); Tweener.addTween(frontCanvas, {time:0.5, delay:0, x:10, transition:"easeOutBounce"}); Tweener.addTween(frontCanvas, {time:0.5, delay:0.5, x:-10, transition:"easeOutBounce"}); Tweener.addTween(frontCanvas, {time:0.5, delay:1, x:0, transition:"easeOutBounce"}); }; } else { if (MediaPlayer.getSingleton().isPlaying(MediaPlayer.SND_INGAME_TENSE)){ MediaPlayer.getSingleton().stop(MediaPlayer.SND_INGAME_TENSE); MediaPlayer.getSingleton().play(MediaPlayer.SND_INGAME_QUIET, true); }; }; _local2 = 0; while (_local2 < pieces.width) { _local3 = 0; while (_local3 < pieces.height) { _local4 = pieces.get(_local2, _local3); if (_local4){ _local4.update(_local1); }; _local3++; }; _local2++; }; if (redButton.isPressed){ MediaPlayer.getSingleton().play(MediaPlayer.SND_RED_BUTTON); _local5 = 0; _local2 = 0; while (_local2 < pieces.width) { _local3 = 0; while (_local3 < pieces.height) { _local4 = pieces.get(_local2, _local3); if (_local4.spinning){ _local4.reset(); piecesPool.push(_local4); _local5++; pieces.set(_local2, _local3, null); }; _local3++; }; _local2++; }; if (_local5 > 0){ _local2 = 0; while (_local2 < pieces.width) { _local3 = (pieces.height - 2); while (_local3 >= 0) { _local4 = pieces.get(_local2, _local3); if (_local4){ _local6 = (_local3 + 1); while (((!(pieces.get(_local2, _local6))) && ((_local6 < pieces.height)))) { _local6++; }; if (!pieces.get(_local2, (_local6 - 1))){ trace((((((((("moving from (" + _local2) + ", ") + _local3) + ") to (") + _local2) + ", ") + (_local6 - 1)) + ")")); pieces.set(_local2, (_local6 - 1), _local4); _local4.fall((DEF.MAP_Y + ((_local6 - 1) * (DEF.MAP_PIECE_HEIGHT + DEF.MAP_PIECE_SPACING))), 1); pieces.set(_local2, _local3, null); }; }; _local3--; }; _local2++; }; _local2 = 0; while (_local2 < pieces.width) { _local3 = 0; while (_local3 < pieces.height) { _local4 = pieces.get(_local2, _local3); if (!_local4){ _local7 = piecesPool.pop(); _local7.color = Piece.getRandomColor(colorLevel); pieces.set(_local2, _local3, _local7); _local7.x = (DEF.MAP_X + (_local2 * (DEF.MAP_PIECE_WIDTH + DEF.MAP_PIECE_SPACING))); _local7.y = DEF.MAP_PIECE_INITIAL_Y; _local7.fall((DEF.MAP_Y + (_local3 * (DEF.MAP_PIECE_HEIGHT + DEF.MAP_PIECE_SPACING))), 1); }; _local3++; }; _local2++; }; }; Piece.currentSpinColor = Piece.PIECE_COLOR_NONE; score = (score + ((((9 / 10) + (_local5 / 10)) * _local5) * 100)); Tweener.addTween(scoreText, {time:0.5, delay:0, x:(DEF.HUD_SCORE_X + _local5), y:DEF.HUD_SCORE_Y, transition:"easeOutBounce"}); Tweener.addTween(scoreText, {time:0.5, delay:0.5, x:(DEF.HUD_SCORE_X - _local5), y:DEF.HUD_SCORE_Y, transition:"easeOutBounce"}); Tweener.addTween(scoreText, {time:0.5, delay:1, x:DEF.HUD_SCORE_X, y:DEF.HUD_SCORE_Y, transition:"easeOutBounce"}); scoreText.text = Math.floor(score).toString(); timeBar.count = (timeBar.count + (((1 + (_local5 / 10)) * _local5) * 7)); MediaPlayer.getSingleton().play(MediaPlayer.SND_SCORE); Piece.currentSpinningCount = 0; }; } private function playMoreGames():void{ var _local1:URLRequest = new URLRequest("http://www.ilmaregames.com.ar"); navigateToURL(_local1, "_self"); } private function keyDownHandler(_arg1:KeyboardEvent):void{ switch (state){ case STATE_GAME: switch (_arg1.keyCode){ case Keyboard.RIGHT: break; case Keyboard.LEFT: break; case Keyboard.SPACE: break; case Keyboard.UP: break; case Keyboard.DOWN: break; case Keyboard.TAB: break; case Keyboard.NUMPAD_0: break; default: break; }; break; }; } private function keyUpHandler(_arg1:KeyboardEvent):void{ switch (state){ case STATE_GAME: switch (_arg1.keyCode){ case Keyboard.RIGHT: break; case Keyboard.LEFT: break; case Keyboard.UP: break; case Keyboard.DOWN: break; case Keyboard.TAB: break; case Keyboard.NUMPAD_0: break; default: break; }; }; } private function setDifficulty():void{ timeBar.lowerPerCall = (DEF.HUD_BAR_INITIAL_STEP + (0.04 * levelNumber)); colorLevel = (Math.floor((levelNumber * 0.25)) + 3); Piece.spinTime = ((5 - (levelNumber * 0.1)) * 1000); if (Piece.spinTime < 1){ Piece.spinTime = 1; }; } private function setState(_arg1:Number):Boolean{ var splash:Sprite; var gradientMatrix:Matrix; var colors:Array; var xx:Number; var yy:Number; var piece:Piece; var format:TextFormat; var glowIn:GlowFilter; var _state = _arg1; state = _state; switch (_state){ case STATE_INTRO: currentSplash = 0; splash = splashesArray[currentSplash]; addChild(splash); (splash as ISplash).init(); break; case STATE_MENU: MediaPlayer.getSingleton().play(MediaPlayer.SND_INTRO, true); frontCanvas.visible = false; graphics.clear(); if (!mainMenu){ mainMenu = new GenericMenu(DEF.MAIN_MENU_OPTIONS, IMG.getSingleton().img_splash); addChild(mainMenu); }; mainMenu.show(); Fader.getSingleton().OutIn(mainMenu); break; case STATE_INIT_GAME: MediaPlayer.getSingleton().stopSounds(); MediaPlayer.getSingleton().play(MediaPlayer.SND_INGAME_QUIET, true); frontCanvas.visible = true; frontCanvas.alpha = 1; graphics.clear(); gradientMatrix = new Matrix(); gradientMatrix.createGradientBox(DEF.BACKGROUND_TILE_WIDTH, DEF.BACKGROUND_TILE_HEIGHT, (-(Math.PI) / 2), 0, 0); colors = [11001855, 0xFFFFFF]; graphics.beginGradientFill("linear", colors, [1, 1], [0, 0xFF], gradientMatrix, "pad", "RGB"); graphics.drawRect(0, 0, DEF.SCREEN_WIDTH, DEF.SCREEN_HEIGHT); graphics.endFill(); graphics.lineStyle(2, 0); graphics.beginFill(0xDDDDDD, 0.5); graphics.drawRoundRect(((DEF.MAP_X + (DEF.MAP_PIECE_WIDTH / 2)) - 5), (DEF.MAP_Y - 5), ((DEF.MAP_WIDTH * (DEF.MAP_PIECE_WIDTH + DEF.MAP_PIECE_SPACING)) + 10), ((DEF.MAP_HEIGTH * (DEF.MAP_PIECE_HEIGHT + DEF.MAP_PIECE_SPACING)) + 10), 10, 10); graphics.endFill(); if (!piecesPool){ piecesPool = new Array(); }; if (pieces){ xx = 0; while (xx < pieces.width) { yy = 0; while (yy < pieces.height) { piece = pieces.get(xx, yy); if (piece){ piece.reset(); piecesPool.push(piece); pieces.set(xx, yy, null); }; yy = (yy + 1); }; xx = (xx + 1); }; } else { pieces = new Array2(DEF.MAP_WIDTH, DEF.MAP_HEIGTH); }; xx = 0; while (xx < pieces.width) { yy = 0; while (yy < pieces.height) { piece = piecesPool.pop(); if (!piece){ piece = new Piece(Piece.getRandomColor(colorLevel)); frontCanvas.addChild(piece); }; piece.color = Piece.getRandomColor(colorLevel); piece.x = (DEF.MAP_X + (xx * (DEF.MAP_PIECE_WIDTH + DEF.MAP_PIECE_SPACING))); piece.y = DEF.MAP_PIECE_INITIAL_Y; piece.fall((DEF.MAP_Y + (yy * (DEF.MAP_PIECE_HEIGHT + DEF.MAP_PIECE_SPACING))), 3, Math.random()); pieces.set(xx, yy, piece); yy = (yy + 1); }; xx = (xx + 1); }; xx = 0; while (xx < pieces.width) { yy = 0; while (yy < pieces.height) { pieces.get(xx, yy).update(); yy = (yy + 1); }; xx = (xx + 1); }; if (!redButton){ redButton = new GenericButton(IMG.getSingleton().img_redButton_DOWN.bitmapData, IMG.getSingleton().img_redButton_UP.bitmapData); redButton.x = 10; redButton.y = ((DEF.SCREEN_HEIGHT / 2) - (redButton.height / 2)); frontCanvas.addChild(redButton); }; if (!scoreText){ scoreText = new TextField(); scoreText.selectable = false; scoreText.x = DEF.HUD_SCORE_X; scoreText.y = DEF.HUD_SCORE_Y; scoreText.autoSize = "center"; frontCanvas.addChild(scoreText); format = new TextFormat(DEF.HUD_SCORE_FONT, DEF.HUD_SCORE_SIZE); format.align = "left"; format.color = DEF.HUD_SCORE_FONT_COLOR; scoreText.embedFonts = true; scoreText.defaultTextFormat = format; }; scoreText.text = "0"; score = 0; if (!levelText){ levelText = new TextField(); levelText.selectable = false; levelText.x = 0; levelText.y = 0; levelText.width = DEF.SCREEN_WIDTH; levelText.height = (DEF.HUD_LEVEL_SIZE + 4); levelText.alpha = 0.8; levelText.background = true; levelText.backgroundColor = DEF.HUD_LEVEL_FONT_BACK_COLOR; frontCanvas.addChild(levelText); format = new TextFormat(DEF.HUD_SCORE_FONT, DEF.HUD_SCORE_SIZE); format.align = "center"; format.color = DEF.HUD_LEVEL_FONT_COLOR; levelText.embedFonts = true; levelText.defaultTextFormat = format; }; levelText.text = "LEVEL 1"; levelText.visible = false; if (!timeBar){ timeBar = new DamageBar(frontCanvas, DEF.HUD_BAR_X, DEF.HUD_BAR_Y, DEF.HUD_BAR_MAX, DEF.HUD_BAR_HEIGHT, DEF.HUD_BAR_INITIAL_STEP); }; timeBar.count = (DEF.HUD_BAR_MAX / 2); timeBar.paint(); levelNumber = 0; setState(STATE_NEXTLEVEL); break; case STATE_NEXTLEVEL: Piece.invalidate = true; levelNumber++; setDifficulty(); levelText.text = ("LEVEL " + levelNumber); levelText.y = 0; levelText.visible = true; Tweener.addTween(levelText, {time:1, delay:0, y:(DEF.SCREEN_HEIGHT / 2), transition:"easeOutCirc"}); Tweener.addTween(levelText, {time:1, delay:2, y:DEF.SCREEN_HEIGHT, transition:"easeInCirc", onComplete:function ():void{ levelText.visible = false; setState(STATE_GAME); }}); timeBar.count = (DEF.HUD_BAR_MAX / 2); timeBar.paint(); break; case STATE_GAME: Piece.invalidate = false; break; case STATE_GAMEOVER: MediaPlayer.getSingleton().stopSounds(); MediaPlayer.getSingleton().play(MediaPlayer.SND_INGAME_TENSE, false); frontCanvas.alpha = 0.5; if (!endGameMenu){ endGameMenu = new GenericMenu(DEF.ENDGAME_MENU_OPTIONS, IMG.getSingleton().img_gameOver); addChild(endGameMenu); }; endGameMenu.show(); if (!endScoreText){ endScoreText = new TextField(); endScoreText.selectable = false; endScoreText.autoSize = "center"; endGameMenu.addChild(endScoreText); }; format = new TextFormat(DEF.HUD_SCORE_FONT, DEF.HUD_SCORE_SIZE); format.align = "left"; format.color = DEF.HUD_SCORE_FONT_COLOR; endScoreText.embedFonts = true; endScoreText.x = DEF.HUD_SCORE_X; endScoreText.y = DEF.HUD_SCORE_Y; endScoreText.defaultTextFormat = format; endScoreText.text = scoreText.text; glowIn = new GlowFilter(16737583, 0.8, 10, 10, 4, 2); Tweener.addTween(endScoreText, {time:2, delay:0, x:DEF.HUD_SCORE_FINAL_X, y:DEF.HUD_SCORE_FINAL_Y, rotation:360, _text_size:DEF.HUD_SCORE_FINAL_SIZE, _filter:glowIn, transition:"linear"}); break; case STATE_GAMEWIN: frontCanvas.alpha = 0.5; if (!endGameMenu){ endGameMenu = new GenericMenu(DEF.ENDGAME_MENU_OPTIONS, null); addChild(endGameMenu); }; endGameMenu.show(); break; case STATE_ABOUT: if (!aboutScreen){ aboutScreen = new GenericAbout(); addChild(aboutScreen); }; aboutScreen.show(); break; }; return (true); } private function initLevel(_arg1:Number):void{ levelNumber = _arg1; } private function mouseClickHandler(_arg1:MouseEvent):void{ switch (state){ case STATE_INTRO: break; case STATE_GAME: break; case STATE_GAMEOVER: break; case STATE_GAMEWIN: break; }; } public function connectServices(_arg1:String):void{ MochiServices.connect(_arg1, this); MochiScores.setBoardID(boardID); } } }//package
Section 52
//Main_FONT_casper (Main_FONT_casper) package { import mx.core.*; public class Main_FONT_casper extends FontAsset { } }//package
Section 53
//MediaPlayer (MediaPlayer) package { import flash.events.*; import flash.display.*; import flash.media.*; public class MediaPlayer { private var _speaker:Sprite; private var SND_ingameTense_mp3:Class; private var SND_ingameQuiet_mp3:Class; private var SND_score:Class; private var _isPlaying:Array; public var SND_intro_mp3:Class; private var SND_redButton:Class; private var _channels:Array; private var _players:Array; private var _soundON:Boolean;// = true private var SND_spin1:Class; private var SND_spin2:Class; private var SND_spin3:Class; private static const SND_COUNT:Number = 8; public static const SND_INGAME_QUIET:Number = 1; public static const SND_RED_BUTTON:Number = 7; public static const SND_INTRO:Number = 0; public static const SND_SPIN1:Number = 3; public static const SND_SPIN2:Number = 4; public static const SND_SPIN3:Number = 5; public static const SND_SCORE:Number = 6; public static const SND_INGAME_TENSE:Number = 2; private static var _instance:MediaPlayer = null; public function MediaPlayer(){ SND_intro_mp3 = MediaPlayer_SND_intro_mp3; SND_ingameQuiet_mp3 = MediaPlayer_SND_ingameQuiet_mp3; SND_ingameTense_mp3 = MediaPlayer_SND_ingameTense_mp3; SND_spin1 = MediaPlayer_SND_spin1; SND_spin2 = MediaPlayer_SND_spin2; SND_spin3 = MediaPlayer_SND_spin3; SND_score = MediaPlayer_SND_score; SND_redButton = MediaPlayer_SND_redButton; _players = new Array(SND_COUNT); _channels = new Array(SND_COUNT); _isPlaying = new Array(SND_COUNT); super(); _players[SND_INTRO] = (new SND_intro_mp3() as Sound); _players[SND_INGAME_QUIET] = (new SND_ingameQuiet_mp3() as Sound); _players[SND_INGAME_TENSE] = (new SND_ingameTense_mp3() as Sound); _players[SND_SPIN1] = (new SND_spin1() as Sound); _players[SND_SPIN2] = (new SND_spin2() as Sound); _players[SND_SPIN3] = (new SND_spin3() as Sound); _players[SND_SCORE] = (new SND_score() as Sound); _players[SND_RED_BUTTON] = (new SND_redButton() as Sound); var _local1:Number = 0; while (_local1 < SND_COUNT) { _isPlaying[_local1] = false; _local1++; }; _speaker = new Sprite(); Main._instance.stage.addChild(_speaker); paintSpeaker(); _speaker.addEventListener(MouseEvent.CLICK, speakerClick); _speaker.x = 5; _speaker.y = (DEF.SCREEN_HEIGHT - _speaker.height); _speaker.alpha = 0.5; } private function paintSpeaker():void{ var _local1:BitmapData; _speaker.graphics.clear(); if (_soundON){ _local1 = IMG.getSingleton().img_speakerON.bitmapData; } else { _local1 = IMG.getSingleton().img_speakerOFF.bitmapData; }; _speaker.graphics.beginBitmapFill(_local1); _speaker.graphics.drawRect(0, 0, _local1.width, _local1.height); _speaker.graphics.endFill(); } public function play(_arg1:Number, _arg2:Boolean=false):void{ var _local3:Number; if (!_soundON){ return; }; if (_arg1 < SND_COUNT){ if (_isPlaying[_arg1]){ return; }; _local3 = 1; if (_arg2){ _local3 = 999; }; _channels[_arg1] = Sound(_players[_arg1]).play(0, _local3); _channels[_arg1].addEventListener(Event.SOUND_COMPLETE, soundPlayed); _isPlaying[_arg1] = true; }; } private function speakerClick(_arg1:MouseEvent):void{ _soundON = !(_soundON); paintSpeaker(); if (!_soundON){ stopSounds(); }; } public function soundPlayed(_arg1:Event):void{ var _local2:Number = 0; while (_local2 < SND_COUNT) { if (_arg1.target == _channels[_local2]){ _isPlaying[_local2] = false; }; _local2++; }; } public function stop(_arg1:Number):void{ if (_arg1 < SND_COUNT){ if (_isPlaying[_arg1]){ SoundChannel(_channels[_arg1]).stop(); _isPlaying[_arg1] = false; }; }; } public function isPlaying(_arg1:Number):Boolean{ return (_isPlaying[_arg1]); } public function stopSounds():void{ var _local1:Number = 0; while (_local1 < SND_COUNT) { stop(_local1); _local1++; }; } public static function getSingleton():MediaPlayer{ if (!_instance){ _instance = new (MediaPlayer); }; return (_instance); } } }//package
Section 54
//MediaPlayer_SND_ingameQuiet_mp3 (MediaPlayer_SND_ingameQuiet_mp3) package { import mx.core.*; public class MediaPlayer_SND_ingameQuiet_mp3 extends SoundAsset { } }//package
Section 55
//MediaPlayer_SND_ingameTense_mp3 (MediaPlayer_SND_ingameTense_mp3) package { import mx.core.*; public class MediaPlayer_SND_ingameTense_mp3 extends SoundAsset { } }//package
Section 56
//MediaPlayer_SND_intro_mp3 (MediaPlayer_SND_intro_mp3) package { import mx.core.*; public class MediaPlayer_SND_intro_mp3 extends SoundAsset { } }//package
Section 57
//MediaPlayer_SND_redButton (MediaPlayer_SND_redButton) package { import mx.core.*; public class MediaPlayer_SND_redButton extends SoundAsset { } }//package
Section 58
//MediaPlayer_SND_score (MediaPlayer_SND_score) package { import mx.core.*; public class MediaPlayer_SND_score extends SoundAsset { } }//package
Section 59
//MediaPlayer_SND_spin1 (MediaPlayer_SND_spin1) package { import mx.core.*; public class MediaPlayer_SND_spin1 extends SoundAsset { } }//package
Section 60
//MediaPlayer_SND_spin2 (MediaPlayer_SND_spin2) package { import mx.core.*; public class MediaPlayer_SND_spin2 extends SoundAsset { } }//package
Section 61
//MediaPlayer_SND_spin3 (MediaPlayer_SND_spin3) package { import mx.core.*; public class MediaPlayer_SND_spin3 extends SoundAsset { } }//package
Section 62
//Piece (Piece) package { import flash.events.*; import caurina.transitions.*; import flash.display.*; public class Piece extends Sprite { private var _spinVel:Number;// = 1 private var _spinSign:Number;// = 1 private var _endTime:Number;// = -1 private var _spinning:Boolean;// = false private var _startTime:Number;// = -1 private var _animating:Boolean;// = false private var _curSpin:Number;// = 0 private var _color:Number; private var _deltaTime:Number;// = -1 private var _curTime:Number;// = -1 public static const PIECE_COLORS:Array = [0xFF0000, 0xFF00, 0xFF, 0xFFFF00, 0xFF00FF, 0xFFFF]; public static const PIECE_COLOR_NONE:Number = -1; public static const PIECE_COLOR_BLACK:Number = -2; public static const SPIN_SOUND_COUNT:Number = 3; public static var currentSpinningCount:Number = 0; public static var currentSpinColor:Number = -1; public static var invalidated:Boolean = true; public static var spinTime:Number = 5000; public static var currentSound:Number = 0; public function Piece(_arg1:Number){ _color = _arg1; addEventListener(MouseEvent.CLICK, mouseClick); } public function startSpin(_arg1:Number):void{ _spinning = true; _startTime = _curTime; _endTime = (_curTime + _arg1); _deltaTime = _arg1; _spinVel = 10; currentSound++; currentSound = (currentSound % SPIN_SOUND_COUNT); MediaPlayer.getSingleton().play((MediaPlayer.SND_SPIN1 + currentSound)); currentSpinningCount++; } public function update(_arg1:Number=-1):void{ var _local3:Number; _curTime = _arg1; graphics.clear(); if (_endTime != -1){ if (_curTime > _endTime){ if (_curSpin > 0){ _curSpin--; } else { _spinning = false; _color = PIECE_COLOR_BLACK; }; }; }; if (((_spinning) && (((_curTime / _endTime) < 1)))){ _local3 = ((_spinVel * (1 - ((_curTime - _startTime) / (_endTime - _startTime)))) + 1); trace(("spinVel: " + _local3)); _curSpin = (_curSpin + (_spinSign * _local3)); if (_curSpin > DEF.MAP_PIECE_WIDTH){ _curSpin = DEF.MAP_PIECE_WIDTH; _spinSign = -(_spinSign); }; if (_curSpin < 0){ _curSpin = 0; _spinSign = -(_spinSign); }; }; var _local2:Number = (DEF.MAP_PIECE_WIDTH - _curSpin); graphics.lineStyle(2, 0x222222); if (_color != PIECE_COLOR_BLACK){ graphics.beginFill(PIECE_COLORS[_color]); } else { graphics.beginFill(0); }; graphics.drawEllipse((DEF.MAP_PIECE_WIDTH - (_local2 / 2)), 0, _local2, DEF.MAP_PIECE_HEIGHT); graphics.endFill(); } public function set color(_arg1:Number):void{ _color = _arg1; } public function reset():void{ _spinning = false; _curSpin = 0; _spinSign = 1; _spinVel = 1; _endTime = -1; _curTime = -1; _startTime = -1; _deltaTime = -1; _animating = false; _color = PIECE_COLOR_NONE; x = -1000; y = -1000; currentSpinningCount--; } public function mouseClick(_arg1:MouseEvent):void{ if (invalidated){ return; }; if (_color == PIECE_COLOR_BLACK){ return; }; if (!_animating){ if (currentSpinColor == PIECE_COLOR_NONE){ currentSpinColor = _color; startSpin(spinTime); } else { if (currentSpinColor == _color){ startSpin(spinTime); }; }; }; } public function canSpin():Boolean{ return (true); } public function get spinning():Boolean{ return (_spinning); } public function fall(_arg1:Number, _arg2:Number, _arg3:Number=0):void{ var finalY = _arg1; var time = _arg2; var delay = _arg3; _animating = true; Tweener.addTween(this, {time:time, delay:delay, y:finalY, transition:"easeOutBounce", onComplete:function ():void{ _animating = false; }}); } public static function getRandomColor(_arg1:Number):Number{ if (_arg1 > PIECE_COLORS.length){ _arg1 = PIECE_COLORS.length; }; return (Math.floor((Math.random() * _arg1))); } public static function set invalidate(_arg1:Boolean):void{ invalidated = _arg1; } } }//package
Section 63
//Preloader (Preloader) package { import flash.events.*; import flash.display.*; import com.mochibot.*; import com.mochiads.*; import flash.utils.*; public dynamic class Preloader extends MovieClip { private var did_load:Boolean; private static var mochibotID:String = "c3d5ae19"; private static var GAME_OPTIONS:Object = {id:"42310d5149461e52", res:"640x480"}; public static var MAIN_CLASS:String = "Main"; public function Preloader(){ var k:String; super(); var f:Function = function (_arg1:IOErrorEvent):void{ }; MochiBot.track(this, mochibotID); loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f); var opts:Object = {}; for (k in GAME_OPTIONS) { opts[k] = GAME_OPTIONS[k]; }; opts.ad_started = function ():void{ did_load = true; }; opts.ad_finished = function ():void{ var _local1:Class = Class(getDefinitionByName(MAIN_CLASS)); var _local2:Object = new (_local1); addChild((_local2 as DisplayObject)); if (_local2.init){ _local2.init(); }; }; opts.clip = this; MochiAd.showPreGameAd(opts); } } }//package

Library Items

Symbol 1 Sound {MediaPlayer_SND_redButton} [MediaPlayer_SND_redButton]
Symbol 2 Sound {MediaPlayer_SND_spin3} [MediaPlayer_SND_spin3]
Symbol 3 Sound {MediaPlayer_SND_spin1} [MediaPlayer_SND_spin1]
Symbol 4 Sound {MediaPlayer_SND_score} [MediaPlayer_SND_score]
Symbol 5 Sound {MediaPlayer_SND_ingameQuiet_mp3} [MediaPlayer_SND_ingameQuiet_mp3]
Symbol 6 Sound {MediaPlayer_SND_intro_mp3} [MediaPlayer_SND_intro_mp3]
Symbol 7 Sound {MediaPlayer_SND_spin2} [MediaPlayer_SND_spin2]
Symbol 8 Sound {MediaPlayer_SND_ingameTense_mp3} [MediaPlayer_SND_ingameTense_mp3]
Symbol 9 Bitmap {IMG_IMG_speakerOFF}
Symbol 10 Bitmap {IMG_IMG_redButton_UP}
Symbol 11 Bitmap {IMG_IMG_go}
Symbol 12 Bitmap {IMG_IMG_gameOver}
Symbol 13 Bitmap {IMG_IMG_dos}
Symbol 14 Bitmap {IMG_IMG_speakerON}
Symbol 15 Bitmap {IMG_IMG_splash}
Symbol 16 Bitmap {splashes.ilMareGamesSplash_IMG_ilMareGames}
Symbol 17 Bitmap {IMG_IMG_redButton_DOWN}
Symbol 18 Font {Main_FONT_casper}
Symbol 19 Bitmap {IMG_IMG_uno}
Symbol 20 Bitmap {IMG_IMG_tres}

Special Tags

FileAttributes (69)Timeline Frame 1Access network only, Metadata present, AS3.
SWFMetaData (77)Timeline Frame 1457 bytes "<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'><rdf:Description rdf:about='' xmlns ..."
ScriptLimits (65)Timeline Frame 1MaxRecursionDepth: 1000, ScriptTimeout: 60 seconds
ExportAssets (56)Timeline Frame 2Symbol 1 as "MediaPlayer_SND_redButton"
ExportAssets (56)Timeline Frame 2Symbol 2 as "MediaPlayer_SND_spin3"
ExportAssets (56)Timeline Frame 2Symbol 3 as "MediaPlayer_SND_spin1"
ExportAssets (56)Timeline Frame 2Symbol 4 as "MediaPlayer_SND_score"
ExportAssets (56)Timeline Frame 2Symbol 5 as "MediaPlayer_SND_ingameQuiet_mp3"
ExportAssets (56)Timeline Frame 2Symbol 6 as "MediaPlayer_SND_intro_mp3"
ExportAssets (56)Timeline Frame 2Symbol 7 as "MediaPlayer_SND_spin2"
ExportAssets (56)Timeline Frame 2Symbol 8 as "MediaPlayer_SND_ingameTense_mp3"
SerialNumber (41)Timeline Frame 1

Labels

"Preloader"Frame 1
"Main"Frame 2




http://swfchan.com/10/47138/info.shtml
Created: 2/5 -2019 10:41:26 Last modified: 2/5 -2019 10:41:26 Server time: 22/12 -2024 15:43:24