Section 1
//ColorShortcuts (caurina.transitions.properties.ColorShortcuts)
package caurina.transitions.properties {
import flash.geom.*;
import caurina.transitions.*;
import flash.filters.*;
public class ColorShortcuts {
private static var LUMINANCE_B:Number = 0.072169;
private static var LUMINANCE_G:Number = 0.71516;
private static var LUMINANCE_R:Number = 0.212671;
public function ColorShortcuts(){
trace("This is an static class and should not be instantiated.");
}
public static function _color_splitter(_arg1, _arg2:Array):Array{
var _local3:Array = new Array();
if (_arg1 == null){
_local3.push({name:"_color_redMultiplier", value:1});
_local3.push({name:"_color_redOffset", value:0});
_local3.push({name:"_color_greenMultiplier", value:1});
_local3.push({name:"_color_greenOffset", value:0});
_local3.push({name:"_color_blueMultiplier", value:1});
_local3.push({name:"_color_blueOffset", value:0});
} else {
_local3.push({name:"_color_redMultiplier", value:0});
_local3.push({name:"_color_redOffset", value:AuxFunctions.numberToR(_arg1)});
_local3.push({name:"_color_greenMultiplier", value:0});
_local3.push({name:"_color_greenOffset", value:AuxFunctions.numberToG(_arg1)});
_local3.push({name:"_color_blueMultiplier", value:0});
_local3.push({name:"_color_blueOffset", value:AuxFunctions.numberToB(_arg1)});
};
return (_local3);
}
public static function _contrast_set(_arg1:Object, _arg2:Number, _arg3:Array, _arg4:Object=null):void{
var _local5:Number;
var _local6:Number;
_local5 = (_arg2 + 1);
_local6 = Math.round((_arg2 * -128));
var _local7:ColorTransform = new ColorTransform(_local5, _local5, _local5, 1, _local6, _local6, _local6, 0);
_arg1.transform.colorTransform = _local7;
}
public static function _brightness_get(_arg1:Object, _arg2:Array, _arg3:Object=null):Number{
var _local4:Boolean = _arg2[0];
var _local5:ColorTransform = _arg1.transform.colorTransform;
var _local6:Number = (1 - (((_local5.redMultiplier + _local5.greenMultiplier) + _local5.blueMultiplier) / 3));
var _local7:Number = (((_local5.redOffset + _local5.greenOffset) + _local5.blueOffset) / 3);
if (_local4){
return (((_local7 > 0)) ? (_local7 / 0xFF) : -(_local6));
//unresolved jump
};
return ((_local7 / 100));
}
public static function _saturation_get(_arg1:Object, _arg2:Array, _arg3:Object=null):Number{
var _local4:Array = getObjectMatrix(_arg1);
var _local5:Boolean = _arg2[0];
var _local6:Number = (_local5) ? (1 / 3) : LUMINANCE_R;
var _local7:Number = (_local5) ? (1 / 3) : LUMINANCE_G;
var _local8:Number = (_local5) ? (1 / 3) : LUMINANCE_B;
var _local9:Number = (((((_local4[0] - _local6) / (1 - _local6)) + ((_local4[6] - _local7) / (1 - _local7))) + ((_local4[12] - _local8) / (1 - _local8))) / 3);
var _local10:Number = (1 - (((((((_local4[1] / _local7) + (_local4[2] / _local8)) + (_local4[5] / _local6)) + (_local4[7] / _local8)) + (_local4[10] / _local6)) + (_local4[11] / _local7)) / 6));
return (((_local9 + _local10) / 2));
}
public static function _oldColor_property_get(_arg1:Object, _arg2:Array, _arg3:Object=null):Number{
return ((_arg1.transform.colorTransform[_arg2[0]] * 100));
}
public static function _brightness_set(_arg1:Object, _arg2:Number, _arg3:Array, _arg4:Object=null):void{
var _local6:Number;
var _local7:Number;
var _local5:Boolean = _arg3[0];
if (_local5){
_local6 = (1 - Math.abs(_arg2));
_local7 = ((_arg2 > 0)) ? Math.round((_arg2 * 0xFF)) : 0;
} else {
_local6 = 1;
_local7 = Math.round((_arg2 * 100));
};
var _local8:ColorTransform = new ColorTransform(_local6, _local6, _local6, 1, _local7, _local7, _local7, 0);
_arg1.transform.colorTransform = _local8;
}
public static function _saturation_set(_arg1:Object, _arg2:Number, _arg3:Array, _arg4:Object=null):void{
var _local5:Boolean = _arg3[0];
var _local6:Number = (_local5) ? (1 / 3) : LUMINANCE_R;
var _local7:Number = (_local5) ? (1 / 3) : LUMINANCE_G;
var _local8:Number = (_local5) ? (1 / 3) : LUMINANCE_B;
var _local9:Number = _arg2;
var _local10:Number = (1 - _local9);
var _local11:Number = (_local6 * _local10);
var _local12:Number = (_local7 * _local10);
var _local13:Number = (_local8 * _local10);
var _local14:Array = [(_local11 + _local9), _local12, _local13, 0, 0, _local11, (_local12 + _local9), _local13, 0, 0, _local11, _local12, (_local13 + _local9), 0, 0, 0, 0, 0, 1, 0];
setObjectMatrix(_arg1, _local14);
}
private static function getObjectMatrix(_arg1:Object):Array{
var _local2:Number = 0;
while (_local2 < _arg1.filters.length) {
if ((_arg1.filters[_local2] is ColorMatrixFilter)){
return (_arg1.filters[_local2].matrix.concat());
};
_local2++;
};
return ([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]);
}
public static function getHueDistance(_arg1:Array, _arg2:Array):Number{
return (((Math.abs((_arg1[0] - _arg2[0])) + Math.abs((_arg1[1] - _arg2[1]))) + Math.abs((_arg1[2] - _arg2[2]))));
}
public static function _hue_set(_arg1:Object, _arg2:Number, _arg3:Array, _arg4:Object=null):void{
setObjectMatrix(_arg1, getHueMatrix(_arg2));
}
public static function _hue_get(_arg1:Object, _arg2:Array, _arg3:Object=null):Number{
var _local6:Number;
var _local8:Number;
var _local4:Array = getObjectMatrix(_arg1);
var _local5:Array = [];
_local5[0] = {angle:-179.9, matrix:getHueMatrix(-179.9)};
_local5[1] = {angle:180, matrix:getHueMatrix(180)};
_local6 = 0;
while (_local6 < _local5.length) {
_local5[_local6].distance = getHueDistance(_local4, _local5[_local6].matrix);
_local6++;
};
var _local7:Number = 15;
_local6 = 0;
while (_local6 < _local7) {
if (_local5[0].distance < _local5[1].distance){
_local8 = 1;
} else {
_local8 = 0;
};
_local5[_local8].angle = ((_local5[0].angle + _local5[1].angle) / 2);
_local5[_local8].matrix = getHueMatrix(_local5[_local8].angle);
_local5[_local8].distance = getHueDistance(_local4, _local5[_local8].matrix);
_local6++;
};
return (_local5[_local8].angle);
}
public static function getHueMatrix(_arg1:Number):Array{
var _local2:Number = ((_arg1 * Math.PI) / 180);
var _local3:Number = LUMINANCE_R;
var _local4:Number = LUMINANCE_G;
var _local5:Number = LUMINANCE_B;
var _local6:Number = Math.cos(_local2);
var _local7:Number = Math.sin(_local2);
var _local8:Array = [((_local3 + (_local6 * (1 - _local3))) + (_local7 * -(_local3))), ((_local4 + (_local6 * -(_local4))) + (_local7 * -(_local4))), ((_local5 + (_local6 * -(_local5))) + (_local7 * (1 - _local5))), 0, 0, ((_local3 + (_local6 * -(_local3))) + (_local7 * 0.143)), ((_local4 + (_local6 * (1 - _local4))) + (_local7 * 0.14)), ((_local5 + (_local6 * -(_local5))) + (_local7 * -0.283)), 0, 0, ((_local3 + (_local6 * -(_local3))) + (_local7 * -((1 - _local3)))), ((_local4 + (_local6 * -(_local4))) + (_local7 * _local4)), ((_local5 + (_local6 * (1 - _local5))) + (_local7 * _local5)), 0, 0, 0, 0, 0, 1, 0];
return (_local8);
}
public static function _color_property_get(_arg1:Object, _arg2:Array, _arg3:Object=null):Number{
return (_arg1.transform.colorTransform[_arg2[0]]);
}
public static function init():void{
Tweener.registerSpecialProperty("_color_ra", _oldColor_property_get, _oldColor_property_set, ["redMultiplier"]);
Tweener.registerSpecialProperty("_color_rb", _color_property_get, _color_property_set, ["redOffset"]);
Tweener.registerSpecialProperty("_color_ga", _oldColor_property_get, _oldColor_property_set, ["greenMultiplier"]);
Tweener.registerSpecialProperty("_color_gb", _color_property_get, _color_property_set, ["greenOffset"]);
Tweener.registerSpecialProperty("_color_ba", _oldColor_property_get, _oldColor_property_set, ["blueMultiplier"]);
Tweener.registerSpecialProperty("_color_bb", _color_property_get, _color_property_set, ["blueOffset"]);
Tweener.registerSpecialProperty("_color_aa", _oldColor_property_get, _oldColor_property_set, ["alphaMultiplier"]);
Tweener.registerSpecialProperty("_color_ab", _color_property_get, _color_property_set, ["alphaOffset"]);
Tweener.registerSpecialProperty("_color_redMultiplier", _color_property_get, _color_property_set, ["redMultiplier"]);
Tweener.registerSpecialProperty("_color_redOffset", _color_property_get, _color_property_set, ["redOffset"]);
Tweener.registerSpecialProperty("_color_greenMultiplier", _color_property_get, _color_property_set, ["greenMultiplier"]);
Tweener.registerSpecialProperty("_color_greenOffset", _color_property_get, _color_property_set, ["greenOffset"]);
Tweener.registerSpecialProperty("_color_blueMultiplier", _color_property_get, _color_property_set, ["blueMultiplier"]);
Tweener.registerSpecialProperty("_color_blueOffset", _color_property_get, _color_property_set, ["blueOffset"]);
Tweener.registerSpecialProperty("_color_alphaMultiplier", _color_property_get, _color_property_set, ["alphaMultiplier"]);
Tweener.registerSpecialProperty("_color_alphaOffset", _color_property_get, _color_property_set, ["alphaOffset"]);
Tweener.registerSpecialPropertySplitter("_color", _color_splitter);
Tweener.registerSpecialPropertySplitter("_colorTransform", _colorTransform_splitter);
Tweener.registerSpecialProperty("_brightness", _brightness_get, _brightness_set, [false]);
Tweener.registerSpecialProperty("_tintBrightness", _brightness_get, _brightness_set, [true]);
Tweener.registerSpecialProperty("_contrast", _contrast_get, _contrast_set);
Tweener.registerSpecialProperty("_hue", _hue_get, _hue_set);
Tweener.registerSpecialProperty("_saturation", _saturation_get, _saturation_set, [false]);
Tweener.registerSpecialProperty("_dumbSaturation", _saturation_get, _saturation_set, [true]);
}
private static function setObjectMatrix(_arg1:Object, _arg2:Array):void{
var _local6:ColorMatrixFilter;
var _local3:Array = _arg1.filters.concat();
var _local4:Boolean;
var _local5:Number = 0;
while (_local5 < _local3.length) {
if ((_local3[_local5] is ColorMatrixFilter)){
_local3[_local5].matrix = _arg2.concat();
_local4 = true;
};
_local5++;
};
if (!_local4){
_local6 = new ColorMatrixFilter(_arg2);
_local3[_local3.length] = _local6;
};
_arg1.filters = _local3;
}
public static function _color_property_set(_arg1:Object, _arg2:Number, _arg3:Array, _arg4:Object=null):void{
var _local5:ColorTransform = _arg1.transform.colorTransform;
_local5[_arg3[0]] = _arg2;
_arg1.transform.colorTransform = _local5;
}
public static function _oldColor_property_set(_arg1:Object, _arg2:Number, _arg3:Array, _arg4:Object=null):void{
var _local5:ColorTransform = _arg1.transform.colorTransform;
_local5[_arg3[0]] = (_arg2 / 100);
_arg1.transform.colorTransform = _local5;
}
public static function _contrast_get(_arg1:Object, _arg2:Array, _arg3:Object=null):Number{
var _local5:Number;
var _local6:Number;
var _local4:ColorTransform = _arg1.transform.colorTransform;
_local5 = ((((_local4.redMultiplier + _local4.greenMultiplier) + _local4.blueMultiplier) / 3) - 1);
_local6 = ((((_local4.redOffset + _local4.greenOffset) + _local4.blueOffset) / 3) / -128);
return (((_local5 + _local6) / 2));
}
public static function _colorTransform_splitter(_arg1:Object, _arg2:Array):Array{
var _local3:Array = new Array();
if (_arg1 == null){
_local3.push({name:"_color_redMultiplier", value:1});
_local3.push({name:"_color_redOffset", value:0});
_local3.push({name:"_color_greenMultiplier", value:1});
_local3.push({name:"_color_greenOffset", value:0});
_local3.push({name:"_color_blueMultiplier", value:1});
_local3.push({name:"_color_blueOffset", value:0});
} else {
_local3.push({name:"_color_redMultiplier", value:_arg1.redMultiplier});
_local3.push({name:"_color_redOffset", value:_arg1.redOffset});
_local3.push({name:"_color_blueMultiplier", value:_arg1.blueMultiplier});
_local3.push({name:"_color_blueOffset", value:_arg1.blueOffset});
_local3.push({name:"_color_greenMultiplier", value:_arg1.greenMultiplier});
_local3.push({name:"_color_greenOffset", value:_arg1.greenOffset});
_local3.push({name:"_color_alphaMultiplier", value:_arg1.alphaMultiplier});
_local3.push({name:"_color_alphaOffset", value:_arg1.alphaOffset});
};
return (_local3);
}
}
}//package caurina.transitions.properties
Section 2
//AuxFunctions (caurina.transitions.AuxFunctions)
package caurina.transitions {
public class AuxFunctions {
public static function getObjectLength(_arg1:Object):uint{
var _local3:String;
var _local2:uint;
for (_local3 in _arg1) {
_local2++;
};
return (_local2);
}
public static function numberToG(_arg1:Number):Number{
return (((_arg1 & 0xFF00) >> 8));
}
public static function numberToB(_arg1:Number):Number{
return ((_arg1 & 0xFF));
}
public static function numberToR(_arg1:Number):Number{
return (((_arg1 & 0xFF0000) >> 16));
}
public static function concatObjects(... _args):Object{
var _local3:Object;
var _local5:String;
var _local2:Object = {};
var _local4:int;
while (_local4 < _args.length) {
_local3 = _args[_local4];
for (_local5 in _local3) {
if (_local3[_local5] == null){
delete _local2[_local5];
} else {
_local2[_local5] = _local3[_local5];
};
};
_local4++;
};
return (_local2);
}
}
}//package caurina.transitions
Section 3
//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 4
//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 5
//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 6
//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 7
//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 8
//Tweener (caurina.transitions.Tweener)
package caurina.transitions {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Tweener {
private static var _timeScale:Number = 1;
private static var _currentTimeFrame:Number;
private static var _specialPropertySplitterList:Object;
public static var autoOverwrite:Boolean = true;
private static var _engineExists:Boolean = false;
private static var _currentTime:Number;
private static var _tweenList:Array;
private static var _specialPropertyModifierList:Object;
private static var _specialPropertyList:Object;
private static var _transitionList:Object;
private static var _inited:Boolean = false;
private static var __tweener_controller__:MovieClip;
public function Tweener(){
trace("Tweener is a static class and should not be instantiated.");
}
public static function registerSpecialPropertyModifier(_arg1:String, _arg2:Function, _arg3:Function):void{
if (!_inited){
init();
};
var _local4:SpecialPropertyModifier = new SpecialPropertyModifier(_arg2, _arg3);
_specialPropertyModifierList[_arg1] = _local4;
}
public static function registerSpecialProperty(_arg1:String, _arg2:Function, _arg3:Function, _arg4:Array=null, _arg5:Function=null):void{
if (!_inited){
init();
};
var _local6:SpecialProperty = new SpecialProperty(_arg2, _arg3, _arg4, _arg5);
_specialPropertyList[_arg1] = _local6;
}
public static function init(... _args):void{
_inited = true;
_transitionList = new Object();
Equations.init();
_specialPropertyList = new Object();
_specialPropertyModifierList = new Object();
_specialPropertySplitterList = new Object();
}
private static function updateTweens():Boolean{
var _local1:int;
if (_tweenList.length == 0){
return (false);
};
_local1 = 0;
while (_local1 < _tweenList.length) {
if ((((_tweenList[_local1] == undefined)) || (!(_tweenList[_local1].isPaused)))){
if (!updateTweenByIndex(_local1)){
removeTweenByIndex(_local1);
};
if (_tweenList[_local1] == null){
removeTweenByIndex(_local1, true);
_local1--;
};
};
_local1++;
};
return (true);
}
public static function addCaller(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local3:Number;
var _local4:Array;
var _local8:Function;
var _local9:TweenListObj;
var _local10:Number;
var _local11:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local4 = _arg1.concat();
} else {
_local4 = [_arg1];
};
var _local5:Object = _arg2;
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
var _local6:Number = (isNaN(_local5.time)) ? 0 : _local5.time;
var _local7:Number = (isNaN(_local5.delay)) ? 0 : _local5.delay;
if (typeof(_local5.transition) == "string"){
_local11 = _local5.transition.toLowerCase();
_local8 = _transitionList[_local11];
} else {
_local8 = _local5.transition;
};
if (!Boolean(_local8)){
_local8 = _transitionList["easeoutexpo"];
};
_local3 = 0;
while (_local3 < _local4.length) {
if (_local5.useFrames == true){
_local9 = new TweenListObj(_local4[_local3], (_currentTimeFrame + (_local7 / _timeScale)), (_currentTimeFrame + ((_local7 + _local6) / _timeScale)), true, _local8, _local5.transitionParams);
} else {
_local9 = new TweenListObj(_local4[_local3], (_currentTime + ((_local7 * 1000) / _timeScale)), (_currentTime + (((_local7 * 1000) + (_local6 * 1000)) / _timeScale)), false, _local8, _local5.transitionParams);
};
_local9.properties = null;
_local9.onStart = _local5.onStart;
_local9.onUpdate = _local5.onUpdate;
_local9.onComplete = _local5.onComplete;
_local9.onOverwrite = _local5.onOverwrite;
_local9.onStartParams = _local5.onStartParams;
_local9.onUpdateParams = _local5.onUpdateParams;
_local9.onCompleteParams = _local5.onCompleteParams;
_local9.onOverwriteParams = _local5.onOverwriteParams;
_local9.onStartScope = _local5.onStartScope;
_local9.onUpdateScope = _local5.onUpdateScope;
_local9.onCompleteScope = _local5.onCompleteScope;
_local9.onOverwriteScope = _local5.onOverwriteScope;
_local9.onErrorScope = _local5.onErrorScope;
_local9.isCaller = true;
_local9.count = _local5.count;
_local9.waitFrames = _local5.waitFrames;
_tweenList.push(_local9);
if ((((_local6 == 0)) && ((_local7 == 0)))){
_local10 = (_tweenList.length - 1);
updateTweenByIndex(_local10);
removeTweenByIndex(_local10);
};
_local3++;
};
return (true);
}
public static function pauseAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
pauseTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function removeTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local5:SpecialPropertySplitter;
var _local6:Array;
var _local7:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){
if (_specialPropertySplitterList[_args[_local4]]){
_local5 = _specialPropertySplitterList[_args[_local4]];
_local6 = _local5.splitValues(_arg1, null);
_local7 = 0;
while (_local7 < _local6.length) {
_local3.push(_local6[_local7].name);
_local7++;
};
} else {
_local3.push(_args[_local4]);
};
};
_local4++;
};
return (affectTweens(removeTweenByIndex, _arg1, _local3));
}
public static function updateFrame():void{
_currentTimeFrame++;
}
public static function splitTweens(_arg1:Number, _arg2:Array):uint{
var _local5:uint;
var _local6:String;
var _local7:Boolean;
var _local3:TweenListObj = _tweenList[_arg1];
var _local4:TweenListObj = _local3.clone(false);
_local5 = 0;
while (_local5 < _arg2.length) {
_local6 = _arg2[_local5];
if (Boolean(_local3.properties[_local6])){
_local3.properties[_local6] = undefined;
delete _local3.properties[_local6];
};
_local5++;
};
for (_local6 in _local4.properties) {
_local7 = false;
_local5 = 0;
while (_local5 < _arg2.length) {
if (_arg2[_local5] == _local6){
_local7 = true;
break;
};
_local5++;
};
if (!_local7){
_local4.properties[_local6] = undefined;
delete _local4.properties[_local6];
};
};
_tweenList.push(_local4);
return ((_tweenList.length - 1));
}
public static function resumeTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj = _tweenList[_arg1];
if ((((_local2 == null)) || (!(_local2.isPaused)))){
return (false);
};
var _local3:Number = getCurrentTweeningTime(_local2);
_local2.timeStart = (_local2.timeStart + (_local3 - _local2.timePaused));
_local2.timeComplete = (_local2.timeComplete + (_local3 - _local2.timePaused));
_local2.timePaused = undefined;
_local2.isPaused = false;
return (true);
}
public static function getVersion():String{
return ("AS3 1.33.74");
}
public static function onEnterFrame(_arg1:Event):void{
updateTime();
updateFrame();
var _local2:Boolean;
_local2 = updateTweens();
if (!_local2){
stopEngine();
};
}
public static function updateTime():void{
_currentTime = getTimer();
}
private static function updateTweenByIndex(_arg1:Number):Boolean{
var tTweening:TweenListObj;
var mustUpdate:Boolean;
var nv:Number;
var t:Number;
var b:Number;
var c:Number;
var d:Number;
var pName:String;
var eventScope:Object;
var tScope:Object;
var tProperty:Object;
var pv:Number;
var i = _arg1;
tTweening = _tweenList[i];
if ((((tTweening == null)) || (!(Boolean(tTweening.scope))))){
return (false);
};
var isOver:Boolean;
var cTime:Number = getCurrentTweeningTime(tTweening);
if (cTime >= tTweening.timeStart){
tScope = tTweening.scope;
if (tTweening.isCaller){
do {
t = (((tTweening.timeComplete - tTweening.timeStart) / tTweening.count) * (tTweening.timesCalled + 1));
b = tTweening.timeStart;
c = (tTweening.timeComplete - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d);
} while (!(cTime >= nv));
} else {
mustUpdate = (((((tTweening.skipUpdates < 1)) || (!(tTweening.skipUpdates)))) || ((tTweening.updatesSkipped >= tTweening.skipUpdates)));
if (cTime >= tTweening.timeComplete){
isOver = true;
mustUpdate = true;
};
if (!tTweening.hasStarted){
if (Boolean(tTweening.onStart)){
eventScope = (Boolean(tTweening.onStartScope)) ? tTweening.onStartScope : tScope;
try {
tTweening.onStart.apply(eventScope, tTweening.onStartParams);
} catch(e2:Error) {
handleError(tTweening, e2, "onStart");
};
};
for (pName in tTweening.properties) {
if (tTweening.properties[pName].isSpecialProperty){
if (Boolean(_specialPropertyList[pName].preProcess)){
tTweening.properties[pName].valueComplete = _specialPropertyList[pName].preProcess(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].originalValueComplete, tTweening.properties[pName].extra);
};
pv = _specialPropertyList[pName].getValue(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
pv = tScope[pName];
};
tTweening.properties[pName].valueStart = (isNaN(pv)) ? tTweening.properties[pName].valueComplete : pv;
};
mustUpdate = true;
tTweening.hasStarted = true;
};
if (mustUpdate){
for (pName in tTweening.properties) {
tProperty = tTweening.properties[pName];
if (isOver){
nv = tProperty.valueComplete;
} else {
if (tProperty.hasModifier){
t = (cTime - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, 0, 1, d, tTweening.transitionParams);
nv = tProperty.modifierFunction(tProperty.valueStart, tProperty.valueComplete, nv, tProperty.modifierParameters);
} else {
t = (cTime - tTweening.timeStart);
b = tProperty.valueStart;
c = (tProperty.valueComplete - tProperty.valueStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d, tTweening.transitionParams);
};
};
if (tTweening.rounded){
nv = Math.round(nv);
};
if (tProperty.isSpecialProperty){
_specialPropertyList[pName].setValue(tScope, nv, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
tScope[pName] = nv;
};
};
tTweening.updatesSkipped = 0;
if (Boolean(tTweening.onUpdate)){
eventScope = (Boolean(tTweening.onUpdateScope)) ? tTweening.onUpdateScope : tScope;
try {
tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams);
} catch(e3:Error) {
handleError(tTweening, e3, "onUpdate");
};
};
} else {
tTweening.updatesSkipped++;
};
};
if (((isOver) && (Boolean(tTweening.onComplete)))){
eventScope = (Boolean(tTweening.onCompleteScope)) ? tTweening.onCompleteScope : tScope;
try {
tTweening.onComplete.apply(eventScope, tTweening.onCompleteParams);
} catch(e4:Error) {
handleError(tTweening, e4, "onComplete");
};
};
return (!(isOver));
};
return (true);
}
public static function setTimeScale(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (isNaN(_arg1)){
_arg1 = 1;
};
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
if (_arg1 != _timeScale){
if (_tweenList != null){
_local2 = 0;
while (_local2 < _tweenList.length) {
_local3 = getCurrentTweeningTime(_tweenList[_local2]);
_tweenList[_local2].timeStart = (_local3 - (((_local3 - _tweenList[_local2].timeStart) * _timeScale) / _arg1));
_tweenList[_local2].timeComplete = (_local3 - (((_local3 - _tweenList[_local2].timeComplete) * _timeScale) / _arg1));
if (_tweenList[_local2].timePaused != undefined){
_tweenList[_local2].timePaused = (_local3 - (((_local3 - _tweenList[_local2].timePaused) * _timeScale) / _arg1));
};
_local2++;
};
};
_timeScale = _arg1;
};
}
public static function resumeAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
resumeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
private static function handleError(_arg1:TweenListObj, _arg2:Error, _arg3:String):void{
var eventScope:Object;
var pTweening = _arg1;
var pError = _arg2;
var pCallBackName = _arg3;
if (((Boolean(pTweening.onError)) && ((pTweening.onError is Function)))){
eventScope = (Boolean(pTweening.onErrorScope)) ? pTweening.onErrorScope : pTweening.scope;
try {
pTweening.onError.apply(eventScope, [pTweening.scope, pError]);
} catch(metaError:Error) {
printError(((((String(pTweening.scope) + " raised an error while executing the 'onError' handler. Original error:\n ") + pError.getStackTrace()) + "\nonError error: ") + metaError.getStackTrace()));
};
} else {
if (!Boolean(pTweening.onError)){
printError(((((String(pTweening.scope) + " raised an error while executing the '") + pCallBackName) + "'handler. \n") + pError.getStackTrace()));
};
};
}
private static function startEngine():void{
_engineExists = true;
_tweenList = new Array();
__tweener_controller__ = new MovieClip();
__tweener_controller__.addEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
_currentTimeFrame = 0;
updateTime();
}
public static function removeAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
removeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function addTween(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local3:Number;
var _local4:Number;
var _local5:String;
var _local6:Array;
var _local13:Function;
var _local14:Object;
var _local15:TweenListObj;
var _local16:Number;
var _local17:Array;
var _local18:Array;
var _local19:Array;
var _local20:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local6 = _arg1.concat();
} else {
_local6 = [_arg1];
};
var _local7:Object = TweenListObj.makePropertiesChain(_arg2);
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
var _local8:Number = (isNaN(_local7.time)) ? 0 : _local7.time;
var _local9:Number = (isNaN(_local7.delay)) ? 0 : _local7.delay;
var _local10:Array = new Array();
var _local11:Object = {overwrite:true, time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, transitionParams:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, onError:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams:true, onStartScope:true, onUpdateScope:true, onCompleteScope:true, onOverwriteScope:true, onErrorScope:true};
var _local12:Object = new Object();
for (_local5 in _local7) {
if (!_local11[_local5]){
if (_specialPropertySplitterList[_local5]){
_local17 = _specialPropertySplitterList[_local5].splitValues(_local7[_local5], _specialPropertySplitterList[_local5].parameters);
_local3 = 0;
while (_local3 < _local17.length) {
if (_specialPropertySplitterList[_local17[_local3].name]){
_local18 = _specialPropertySplitterList[_local17[_local3].name].splitValues(_local17[_local3].value, _specialPropertySplitterList[_local17[_local3].name].parameters);
_local4 = 0;
while (_local4 < _local18.length) {
_local10[_local18[_local4].name] = {valueStart:undefined, valueComplete:_local18[_local4].value, arrayIndex:_local18[_local4].arrayIndex, isSpecialProperty:false};
_local4++;
};
} else {
_local10[_local17[_local3].name] = {valueStart:undefined, valueComplete:_local17[_local3].value, arrayIndex:_local17[_local3].arrayIndex, isSpecialProperty:false};
};
_local3++;
};
} else {
if (_specialPropertyModifierList[_local5] != undefined){
_local19 = _specialPropertyModifierList[_local5].modifyValues(_local7[_local5]);
_local3 = 0;
while (_local3 < _local19.length) {
_local12[_local19[_local3].name] = {modifierParameters:_local19[_local3].parameters, modifierFunction:_specialPropertyModifierList[_local5].getValue};
_local3++;
};
} else {
_local10[_local5] = {valueStart:undefined, valueComplete:_local7[_local5]};
};
};
};
};
for (_local5 in _local10) {
if (_specialPropertyList[_local5] != undefined){
_local10[_local5].isSpecialProperty = true;
} else {
if (_local6[0][_local5] == undefined){
printError((((("The property '" + _local5) + "' doesn't seem to be a normal object property of ") + String(_local6[0])) + " or a registered special property."));
};
};
};
for (_local5 in _local12) {
if (_local10[_local5] != undefined){
_local10[_local5].modifierParameters = _local12[_local5].modifierParameters;
_local10[_local5].modifierFunction = _local12[_local5].modifierFunction;
};
};
if (typeof(_local7.transition) == "string"){
_local20 = _local7.transition.toLowerCase();
_local13 = _transitionList[_local20];
} else {
_local13 = _local7.transition;
};
if (!Boolean(_local13)){
_local13 = _transitionList["easeoutexpo"];
};
_local3 = 0;
while (_local3 < _local6.length) {
_local14 = new Object();
for (_local5 in _local10) {
_local14[_local5] = new PropertyInfoObj(_local10[_local5].valueStart, _local10[_local5].valueComplete, _local10[_local5].valueComplete, _local10[_local5].arrayIndex, {}, _local10[_local5].isSpecialProperty, _local10[_local5].modifierFunction, _local10[_local5].modifierParameters);
};
if (_local7.useFrames == true){
_local15 = new TweenListObj(_local6[_local3], (_currentTimeFrame + (_local9 / _timeScale)), (_currentTimeFrame + ((_local9 + _local8) / _timeScale)), true, _local13, _local7.transitionParams);
} else {
_local15 = new TweenListObj(_local6[_local3], (_currentTime + ((_local9 * 1000) / _timeScale)), (_currentTime + (((_local9 * 1000) + (_local8 * 1000)) / _timeScale)), false, _local13, _local7.transitionParams);
};
_local15.properties = _local14;
_local15.onStart = _local7.onStart;
_local15.onUpdate = _local7.onUpdate;
_local15.onComplete = _local7.onComplete;
_local15.onOverwrite = _local7.onOverwrite;
_local15.onError = _local7.onError;
_local15.onStartParams = _local7.onStartParams;
_local15.onUpdateParams = _local7.onUpdateParams;
_local15.onCompleteParams = _local7.onCompleteParams;
_local15.onOverwriteParams = _local7.onOverwriteParams;
_local15.onStartScope = _local7.onStartScope;
_local15.onUpdateScope = _local7.onUpdateScope;
_local15.onCompleteScope = _local7.onCompleteScope;
_local15.onOverwriteScope = _local7.onOverwriteScope;
_local15.onErrorScope = _local7.onErrorScope;
_local15.rounded = _local7.rounded;
_local15.skipUpdates = _local7.skipUpdates;
if (((_local7.overwrite == undefined)) ? autoOverwrite : _local7.overwrite){
removeTweensByTime(_local15.scope, _local15.properties, _local15.timeStart, _local15.timeComplete);
};
_tweenList.push(_local15);
if ((((_local8 == 0)) && ((_local9 == 0)))){
_local16 = (_tweenList.length - 1);
updateTweenByIndex(_local16);
removeTweenByIndex(_local16);
};
_local3++;
};
return (true);
}
public static function registerTransition(_arg1:String, _arg2:Function):void{
if (!_inited){
init();
};
_transitionList[_arg1] = _arg2;
}
public static function printError(_arg1:String):void{
trace(("## [Tweener] Error: " + _arg1));
}
private static function affectTweens(_arg1:Function, _arg2:Object, _arg3:Array):Boolean{
var _local5:uint;
var _local6:Array;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local4:Boolean;
if (!Boolean(_tweenList)){
return (false);
};
_local5 = 0;
while (_local5 < _tweenList.length) {
if (((_tweenList[_local5]) && ((_tweenList[_local5].scope == _arg2)))){
if (_arg3.length == 0){
_arg1(_local5);
_local4 = true;
} else {
_local6 = new Array();
_local7 = 0;
while (_local7 < _arg3.length) {
if (Boolean(_tweenList[_local5].properties[_arg3[_local7]])){
_local6.push(_arg3[_local7]);
};
_local7++;
};
if (_local6.length > 0){
_local8 = AuxFunctions.getObjectLength(_tweenList[_local5].properties);
if (_local8 == _local6.length){
_arg1(_local5);
_local4 = true;
} else {
_local9 = splitTweens(_local5, _local6);
_arg1(_local9);
_local4 = true;
};
};
};
};
_local5++;
};
return (_local4);
}
public static function getTweens(_arg1:Object):Array{
var _local2:uint;
var _local3:String;
if (!Boolean(_tweenList)){
return ([]);
};
var _local4:Array = new Array();
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
for (_local3 in _tweenList[_local2].properties) {
_local4.push(_local3);
};
};
_local2++;
};
return (_local4);
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public static function pauseTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj = _tweenList[_arg1];
if ((((_local2 == null)) || (_local2.isPaused))){
return (false);
};
_local2.timePaused = getCurrentTweeningTime(_local2);
_local2.isPaused = true;
return (true);
}
public static function getCurrentTweeningTime(_arg1:Object):Number{
return ((_arg1.useFrames) ? _currentTimeFrame : _currentTime);
}
public static function getTweenCount(_arg1:Object):Number{
var _local2:uint;
if (!Boolean(_tweenList)){
return (0);
};
var _local3:Number = 0;
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
_local3 = (_local3 + AuxFunctions.getObjectLength(_tweenList[_local2].properties));
};
_local2++;
};
return (_local3);
}
private static function stopEngine():void{
_engineExists = false;
_tweenList = null;
_currentTime = 0;
_currentTimeFrame = 0;
__tweener_controller__.removeEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
__tweener_controller__ = null;
}
public static function removeTweensByTime(_arg1:Object, _arg2:Object, _arg3:Number, _arg4:Number):Boolean{
var removedLocally:Boolean;
var i:uint;
var pName:String;
var eventScope:Object;
var p_scope = _arg1;
var p_properties = _arg2;
var p_timeStart = _arg3;
var p_timeComplete = _arg4;
var removed:Boolean;
var tl:uint = _tweenList.length;
i = 0;
while (i < tl) {
if (((Boolean(_tweenList[i])) && ((p_scope == _tweenList[i].scope)))){
if ((((p_timeComplete > _tweenList[i].timeStart)) && ((p_timeStart < _tweenList[i].timeComplete)))){
removedLocally = false;
for (pName in _tweenList[i].properties) {
if (Boolean(p_properties[pName])){
if (Boolean(_tweenList[i].onOverwrite)){
eventScope = (Boolean(_tweenList[i].onOverwriteScope)) ? _tweenList[i].onOverwriteScope : _tweenList[i].scope;
try {
_tweenList[i].onOverwrite.apply(eventScope, _tweenList[i].onOverwriteParams);
} catch(e:Error) {
handleError(_tweenList[i], e, "onOverwrite");
};
};
_tweenList[i].properties[pName] = undefined;
delete _tweenList[i].properties[pName];
removedLocally = true;
removed = true;
};
};
if (removedLocally){
if (AuxFunctions.getObjectLength(_tweenList[i].properties) == 0){
removeTweenByIndex(i);
};
};
};
};
i = (i + 1);
};
return (removed);
}
public static function registerSpecialPropertySplitter(_arg1:String, _arg2:Function, _arg3:Array=null):void{
if (!_inited){
init();
};
var _local4:SpecialPropertySplitter = new SpecialPropertySplitter(_arg2, _arg3);
_specialPropertySplitterList[_arg1] = _local4;
}
public static function removeTweenByIndex(_arg1:Number, _arg2:Boolean=false):Boolean{
_tweenList[_arg1] = null;
if (_arg2){
_tweenList.splice(_arg1, 1);
};
return (true);
}
public static function resumeTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(resumeTweenByIndex, _arg1, _local3));
}
public static function pauseTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(pauseTweenByIndex, _arg1, _local3));
}
}
}//package caurina.transitions
Section 9
//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 10
//MouseCursor (com.drimlike.games.color.cursor.MouseCursor)
package com.drimlike.games.color.cursor {
import flash.display.*;
import caurina.transitions.*;
public class MouseCursor extends Sprite {
private var overlay:Sprite;
private var color:Sprite;
private var isColorEnabled:Boolean;
public function MouseCursor(_arg1:Sprite, _arg2:Sprite=null){
color = _arg1;
color.mouseChildren = false;
color.mouseEnabled = false;
addChild(color);
if (_arg2 != null){
isColorEnabled = true;
overlay = _arg2;
overlay.mouseChildren = false;
overlay.mouseEnabled = false;
addChild(overlay);
};
}
public function hide():void{
Tweener.addTween(overlay, {alpha:0, time:0.5, transition:"easeOutExpo"});
Tweener.addTween(color, {alpha:0, time:0.5, transition:"easeOutExpo"});
}
public function changeColor(_arg1:uint):void{
if (isColorEnabled){
Tweener.addTween(color, {_color:_arg1, time:1, transition:"easeOutExpo"});
};
}
public function show():void{
Tweener.addTween(overlay, {alpha:1, time:0.5, transition:"easeOutExpo"});
Tweener.addTween(color, {alpha:1, time:0.5, transition:"easeOutExpo"});
}
}
}//package com.drimlike.games.color.cursor
Section 11
//GameData (com.drimlike.games.color.data.GameData)
package com.drimlike.games.color.data {
import flash.events.*;
import com.drimlike.games.sound.*;
public class GameData extends EventDispatcher {
public var stageHeight:Number;
public var TRACKING_KEY:String;// = "catColor"
public var stageWidth:Number;
public var soundManager:SoundManager;
public var language:String;
public static var SPANISH:String = "sp";
private static var _instance:GameData;
public static var GERMAN:String = "de";
public static var ENGLISH:String = "en";
public static var FRENCH:String = "fr";
public static function getInstance():GameData{
if (_instance == null){
_instance = new (GameData);
};
return (_instance);
}
}
}//package com.drimlike.games.color.data
Section 12
//GameUISystemEvent (com.drimlike.games.color.events.GameUISystemEvent)
package com.drimlike.games.color.events {
import flash.events.*;
public class GameUISystemEvent extends Event {
public static const ERASOR_TOOL_SELECTED_EVENT:String = "erasorToolSelectedEvent";
public static const FILL_TOOL_SELECTED_EVENT:String = "fillToolSelectedEvent";
public static const PENCIL_TOOL_SELECTED_EVENT:String = "pencilBrushSelectedEvent";
public static const RESET_TOOL_SELECTED_EVENT:String = "resetToolSelectedEvent";
public static const NEXT_SLIDE_SELECTED_EVENT:String = "nextSlideSelectedEvent";
public static const PAINT_TOOL_SELECTED_EVENT:String = "paintBrushSelectedEvent";
public function GameUISystemEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
}
}//package com.drimlike.games.color.events
Section 13
//ColorPalletteTile (com.drimlike.games.color.gameui.ColorPalletteTile)
package com.drimlike.games.color.gameui {
import caurina.transitions.*;
public class ColorPalletteTile extends ColorTile {
protected var defaultDepth:int;
public var isSelected:Boolean;
public function ColorPalletteTile(_arg1:uint, _arg2:int){
defaultDepth = _arg2;
super(_arg1);
}
public function get tileDefaultDepth():int{
return (defaultDepth);
}
public function setHighlightColor(_arg1:uint):void{
Tweener.addTween(overlay, {_color:_arg1});
}
}
}//package com.drimlike.games.color.gameui
Section 14
//ColorSelector (com.drimlike.games.color.gameui.ColorSelector)
package com.drimlike.games.color.gameui {
import flash.events.*;
import flash.display.*;
import caurina.transitions.*;
public class ColorSelector extends Sprite {
public var selectedHex:uint;
private var container:Sprite;
private var colorTiles:Array;
private var background:Sprite;
private var colors:Array;
public static const COLOR_SELECTED_EVENT:String = "colorSelectedEvent";
public function ColorSelector(){
var _local3:int;
var _local4:int;
var _local9:ColorPalletteTile;
colorTiles = new Array();
colors = new Array(16770252, 16572861, 15526590, 16443317, 16636341, 16764843, 16760200, 16426860, 13473141, 13472104, 14060121, 10840399, 9075037, 13453898, 13395558, 12344664, 16733001, 16604755, 16612462, 16628916, 16739914, 16752777, 15367773, 11822925, 10840399, 16741688, 16744265, 14521461, 16745027, 16753780, 10453360, 13473141, 15715768, 14060121, 14592648, 16426860, 16764843, 16760200, 16636341, 16753475, 15719365, 16758355, 15189655, 9075037, 16443317, 16764744, 16570741, 16636781, 16574595, 15788177, 15526590, 12236908, 16645236, 16777113, 12968836, 11725917, 8890731, 11068576, 1964308, 7798650, 7453816, 7188097, 10478271, 1879160, 3193487, 4574882, 3911823, 1889186, 1540205, 2084555, 7855591, 8444651, 4278860, 1679037, 1878473, 1944790, 10145515, 1722486, 1668306, 2845892, 2061822, 12964070, 11581382, 6125259, 10661328, 9935530, 11382230, 7562941, 7619272, 7885225, 10322362, 9596590, 13477086, 9392285, 12805317, 16482045, 16545021, 9323909, 16719310, 16730320, 15116503, 12600463, 7229792, 14501010, 16728996, 16147631, 16561365, 16760025, 16208788, 16755404, 14886251, 16635876, 13252455, 14572931, 16550316, 16220321, 13121626, 15605837, 16730476, 15702186, 16542853, 16525383, 16751530, 13320532, 0xEDEDED, 14407634, 13485506, 9802124, 0x232323, 0xFFFFFF);
super();
container = new Sprite();
container.x = 245;
container.y = 700;
addChild(container);
background = new ColorPalletteBackgroundAsset();
container.addChild(background);
var _local1 = 30;
var _local2 = 30;
_local3 = 14;
_local4 = 16;
var _local5 = 25;
var _local6:int;
var _local7:int;
var _local8:int;
while (_local8 < colors.length) {
_local9 = new ColorPalletteTile(uint(colors[_local8]), (_local8 + 1));
if (uint(colors[_local8]) == 0xFFFFFF){
_local9.setHighlightColor(0);
};
_local9.useHandCursor = true;
_local9.buttonMode = true;
_local9.addEventListener(MouseEvent.ROLL_OVER, onRollOver);
_local9.addEventListener(MouseEvent.ROLL_OUT, onRollOut);
_local9.addEventListener(MouseEvent.CLICK, onClick);
_local9.x = (_local1 + (_local3 * _local6));
_local9.y = (_local2 + (_local4 * _local7));
_local9.scaleX = (_local9.scaleY = 0.8);
_local9.rotation = 45;
container.addChild(_local9);
colorTiles.push(_local9);
if (_local6 == _local5){
_local6 = 0;
_local7++;
} else {
_local6++;
};
_local8++;
};
onClick();
}
public function enable():void{
}
public function disable():void{
}
private function onRollOver(_arg1:MouseEvent):void{
var _local2:ColorPalletteTile = ColorPalletteTile(_arg1.target);
if (!_local2.isSelected){
container.setChildIndex(_local2, (container.numChildren - 1));
Tweener.addTween(_local2, {rotation:90, time:1, scaleX:1.1, scaleY:1.1, transition:"easeOutExpo"});
};
}
public function hide():void{
}
private function onRollOut(_arg1:MouseEvent):void{
var _local2:ColorPalletteTile = ColorPalletteTile(_arg1.target);
if (!_local2.isSelected){
container.setChildIndex(_local2, _local2.tileDefaultDepth);
Tweener.addTween(_local2, {rotation:45, time:1, scaleX:0.8, scaleY:0.8, transition:"easeOutExpo"});
};
}
private function onClick(_arg1:MouseEvent=null):void{
var _local2:ColorPalletteTile;
var _local3:ColorPalletteTile;
if (_arg1 == null){
for each (_local2 in colorTiles) {
if (_local2.colorHex == 13252455){
container.setChildIndex(_local2, (container.numChildren - 1));
Tweener.addTween(_local2, {rotation:90, time:1, scaleX:1.1, scaleY:1.1, transition:"easeOutExpo"});
_local2.isSelected = true;
selectedHex = _local2.colorHex;
dispatchEvent(new Event(COLOR_SELECTED_EVENT, true, true));
};
};
} else {
_local3 = ColorPalletteTile(_arg1.target.parent);
for each (_local2 in colorTiles) {
if (_local2.isSelected){
container.setChildIndex(_local2, _local2.tileDefaultDepth);
Tweener.addTween(_local2, {rotation:45, time:1, scaleX:0.8, scaleY:0.8, transition:"easeOutExpo"});
_local2.isSelected = false;
};
};
_local3.isSelected = true;
container.setChildIndex(_local3, (container.numChildren - 1));
Tweener.addTween(_local3, {rotation:90, time:1, scaleX:1.1, scaleY:1.1, transition:"easeOutExpo"});
selectedHex = _local3.colorHex;
dispatchEvent(new Event(COLOR_SELECTED_EVENT, true, true));
};
}
public function show(_arg1:int=0):void{
Tweener.addTween(container, {y:400, time:1, delay:_arg1, transition:"easeOutExpo"});
}
}
}//package com.drimlike.games.color.gameui
Section 15
//ColorTile (com.drimlike.games.color.gameui.ColorTile)
package com.drimlike.games.color.gameui {
import flash.display.*;
import caurina.transitions.*;
public class ColorTile extends Sprite {
protected var overlay:Sprite;
protected var container:Sprite;
protected var color:Sprite;
protected var hex:uint;
public function ColorTile(_arg1:uint){
hex = _arg1;
container = new Sprite();
addChild(container);
color = new ColorTileColorAsset();
color.mouseChildren = false;
color.mouseEnabled = false;
container.addChild(color);
Tweener.addTween(color, {_color:_arg1});
overlay = new ColorTileOutlineAsset();
overlay.mouseChildren = false;
overlay.mouseEnabled = false;
container.addChild(overlay);
}
public function enable():void{
this.cacheAsBitmap = false;
color.cacheAsBitmap = false;
overlay.cacheAsBitmap = false;
}
public function get colorHex():uint{
return (hex);
}
public function disable():void{
this.cacheAsBitmap = true;
color.cacheAsBitmap = true;
overlay.cacheAsBitmap = true;
}
}
}//package com.drimlike.games.color.gameui
Section 16
//NextSlideButton (com.drimlike.games.color.gameui.NextSlideButton)
package com.drimlike.games.color.gameui {
import flash.events.*;
import com.drimlike.games.color.data.*;
import flash.display.*;
import flash.utils.*;
import caurina.transitions.*;
public class NextSlideButton extends Sprite {
private var asset2:Sprite;
private var hook:Number;// = 1
private var arrow:Sprite;
private var glint:Sprite;
private var twistInterval:Number;
private var asset:NextSlideButtonAsset;
public function NextSlideButton(){
asset = new NextSlideButtonAsset();
addChild(asset);
asset2 = new NextSlideButtonAsset();
asset2.mouseChildren = false;
asset2.mouseEnabled = false;
addChild(asset2);
glint = new HighlightGlintAsset();
glint.mouseChildren = false;
glint.mouseEnabled = false;
glint.y = -100;
addChild(glint);
addEventListener(MouseEvent.ROLL_OUT, onRollOut);
addEventListener(MouseEvent.ROLL_OVER, onRollOver);
buttonMode = true;
useHandCursor = true;
arrow = asset.arrow;
glint.mask = asset2;
twistInterval = setInterval(doTwist, 5000);
}
private function onRollOver(_arg1:MouseEvent):void{
glint.y = -100;
Tweener.addTween(glint, {y:100, time:1, transition:"easeOutExpo"});
GameData.getInstance().soundManager.playOldStyleButtonWhoosh();
}
private function onRollOut(_arg1:MouseEvent):void{
glint.y = 100;
Tweener.addTween(glint, {y:-100, time:1, transition:"easeOutExpo"});
}
private function doTwist():void{
if (hook == 1){
hook = -1;
Tweener.addTween(arrow, {scaleY:-1, time:1, transition:"easeOutExpo"});
} else {
if (hook == -1){
hook = 1;
Tweener.addTween(arrow, {scaleY:1, time:1, transition:"easeOutExpo"});
};
};
}
}
}//package com.drimlike.games.color.gameui
Section 17
//TollboxButton (com.drimlike.games.color.gameui.TollboxButton)
package com.drimlike.games.color.gameui {
import flash.events.*;
import com.drimlike.games.color.data.*;
import flash.display.*;
import caurina.transitions.*;
public class TollboxButton extends Sprite {
private var container:Sprite;
private var highlight:Sprite;
public var isSelected:Boolean;
private var backgroundForMask:Sprite;
protected var iconColor:Sprite;
private var background:Sprite;
public var isColorEnabled:Boolean;
private var glint:Sprite;
private var iconOverlay:Sprite;
public function TollboxButton(_arg1:Sprite, _arg2:Sprite=null){
container = new Sprite();
addChild(container);
background = new GameUIButtonBackgroundAsset();
background.mouseChildren = false;
background.mouseEnabled = false;
container.addChild(background);
backgroundForMask = new GameUIButtonBackgroundAsset();
backgroundForMask.mouseChildren = false;
backgroundForMask.mouseEnabled = false;
container.addChild(backgroundForMask);
highlight = new GameUIButtonHighliterAsset();
highlight.alpha = 0;
highlight.mouseChildren = false;
highlight.mouseEnabled = false;
container.addChild(highlight);
glint = new HighlightGlintAsset();
glint.mouseChildren = false;
glint.mouseEnabled = false;
glint.y = -100;
addChild(glint);
iconColor = _arg1;
iconColor.mouseChildren = false;
iconColor.mouseEnabled = false;
container.addChild(iconColor);
if (_arg2){
isColorEnabled = true;
iconOverlay = _arg2;
iconOverlay.mouseChildren = false;
iconOverlay.mouseEnabled = false;
container.addChild(_arg2);
Tweener.addTween(iconColor, {_color:13252455});
};
mouseChildren = false;
useHandCursor = true;
buttonMode = true;
addEventListener(MouseEvent.ROLL_OUT, onRollOut);
addEventListener(MouseEvent.ROLL_OVER, onRollOver);
glint.mask = background;
}
public function deselect():void{
isSelected = false;
Tweener.addTween(highlight, {alpha:0, time:0.5, transition:"easeOutExpo"});
}
public function select():void{
isSelected = true;
Tweener.addTween(highlight, {alpha:1, time:1, transition:"easeOutExpo"});
}
private function onRollOut(_arg1:MouseEvent):void{
glint.y = 100;
Tweener.addTween(glint, {y:-100, time:1, transition:"easeOutExpo"});
}
public function quickDeslect():void{
highlight.alpha = 1;
isSelected = false;
Tweener.addTween(highlight, {alpha:0, time:3, transition:"easeOutExpo"});
}
public function updateIconColor(_arg1:uint):void{
if (isColorEnabled){
Tweener.addTween(iconColor, {_color:_arg1, time:1, transition:"easeOutExpo"});
};
}
protected function onRollOver(_arg1:MouseEvent):void{
glint.y = -100;
Tweener.addTween(glint, {y:100, time:1, transition:"easeOutExpo"});
GameData.getInstance().soundManager.playOldStyleButtonWhoosh();
}
}
}//package com.drimlike.games.color.gameui
Section 18
//TollBoxButtonAnimated (com.drimlike.games.color.gameui.TollBoxButtonAnimated)
package com.drimlike.games.color.gameui {
import flash.events.*;
import flash.display.*;
public class TollBoxButtonAnimated extends TollboxButton {
public function TollBoxButtonAnimated(_arg1:Sprite, _arg2:Sprite=null){
super(_arg1, _arg2);
}
override protected function onRollOver(_arg1:MouseEvent):void{
super.onRollOver(_arg1);
if (MovieClip(iconColor).currentFrame == 1){
MovieClip(iconColor).gotoAndPlay(2);
};
}
}
}//package com.drimlike.games.color.gameui
Section 19
//ColorSlide (com.drimlike.games.color.slides.ColorSlide)
package com.drimlike.games.color.slides {
import flash.events.*;
import com.drimlike.games.color.data.*;
import flash.display.*;
import flash.utils.*;
import caurina.transitions.*;
public class ColorSlide extends Sprite {
private var nib:Sprite;
private var selectedColor:uint;// = 13252455
private var drawingToolEnabled:Boolean;
private var paper:Sprite;
private var overlay:Sprite;
private var erasorBitmap:Bitmap;
private var erasorBitmapData:BitmapData;
private var paperContainer:Sprite;
private var paperBitmap:Bitmap;
private var drawTimer:Timer;
private var paperBitmapData:BitmapData;
private var fillPieces:Array;
private var erasorSelected:Boolean;
public static const SLIDE_PIECE_CLICKED_EVENT:String = "slidePieceClickedEvent";
public function ColorSlide(_arg1:Sprite, _arg2:Array){
overlay = _arg1;
fillPieces = _arg2;
init();
}
private function onMouseUp(_arg1:MouseEvent=null):void{
if (nib){
nib.alpha = 0;
nib.visible = false;
nib.y = -200;
};
removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
}
public function reset():void{
var _local5:Sprite;
var _local6:Sprite;
var _local1:Array = new Array();
var _local2:int;
while (_local2 < fillPieces.length) {
_local5 = Sprite(fillPieces[_local2]);
_local1.push(_local5);
_local2++;
};
var _local3:Array = new Array();
while (_local1.length > 0) {
_local3.push(_local1.splice(Math.round((Math.random() * (_local1.length - 1))), 1)[0]);
};
var _local4:int;
while (_local4 < _local3.length) {
_local6 = Sprite(_local3[_local4]);
Tweener.addTween(_local6, {_color:0xFFFFFF, time:0.5, delay:((Math.random() * 0.02) * _local4)});
_local4++;
};
paperBitmap.bitmapData = new BitmapData(GameData.getInstance().stageWidth, 328, true, 0xFFFFFF);
erasorBitmap.bitmapData = new BitmapData(GameData.getInstance().stageWidth, 328, true, 0xFFFFFF);
}
public function changeColorTool(_arg1:uint):void{
selectedColor = _arg1;
if (nib != null){
Tweener.addTween(nib, {_color:_arg1});
};
}
public function noSelection():void{
mouseEnabled = false;
mouseChildren = false;
if (nib){
nib.visible = false;
};
drawingToolEnabled = false;
removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
}
public function enablePaperPaint():void{
var _local1:Sprite;
mouseEnabled = true;
mouseChildren = true;
paperContainer.mouseEnabled = true;
paperContainer.mouseChildren = true;
if (nib){
paper.removeChild(nib);
nib = null;
};
nib = new PaintNibAsset();
paper.addChild(nib);
Tweener.addTween(nib, {_color:selectedColor});
drawingToolEnabled = true;
erasorSelected = false;
nib.visible = false;
erasorBitmap.bitmapData = new BitmapData(GameData.getInstance().stageWidth, 328, true, 0xFFFFFF);
for each (_local1 in fillPieces) {
_local1.mouseChildren = false;
_local1.mouseEnabled = false;
};
}
public function enablePaperPencil():void{
var _local1:Sprite;
mouseEnabled = true;
mouseChildren = true;
paperContainer.mouseEnabled = true;
paperContainer.mouseChildren = true;
if (nib){
paper.removeChild(nib);
nib = null;
};
nib = new PencilNibAsset();
paper.addChild(nib);
Tweener.addTween(nib, {_color:selectedColor});
drawingToolEnabled = true;
erasorSelected = false;
nib.visible = false;
erasorBitmap.bitmapData = new BitmapData(GameData.getInstance().stageWidth, 328, true, 0xFFFFFF);
for each (_local1 in fillPieces) {
_local1.mouseChildren = false;
_local1.mouseEnabled = false;
};
}
private function onPaperRollOut(_arg1:MouseEvent):void{
removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
onMouseUp();
}
public function enableFill():void{
var _local1:Sprite;
mouseEnabled = true;
mouseChildren = true;
paperContainer.mouseEnabled = false;
paperContainer.mouseChildren = false;
for each (_local1 in fillPieces) {
_local1.mouseChildren = true;
_local1.mouseEnabled = true;
};
drawingToolEnabled = false;
erasorSelected = false;
}
private function onMouseClick(_arg1:MouseEvent):void{
_arg1.target.dispatchEvent(new Event(SLIDE_PIECE_CLICKED_EVENT, true, true));
}
public function enableErasor():void{
var _local1:Sprite;
mouseChildren = true;
mouseEnabled = true;
paperContainer.mouseEnabled = true;
paperContainer.mouseChildren = true;
if (nib){
paper.removeChild(nib);
nib = null;
};
nib = new ErasorNibAsset();
paper.addChild(nib);
Tweener.addTween(nib, {_color:0xFFFFFF});
drawingToolEnabled = true;
erasorSelected = true;
nib.visible = false;
for each (_local1 in fillPieces) {
_local1.mouseChildren = false;
_local1.mouseEnabled = false;
};
}
private function init():void{
var _local2:Sprite;
var _local1:Sprite = new Sprite();
_local1.graphics.beginFill(0);
_local1.graphics.drawRect(1, 1, 726, 326);
_local1.graphics.endFill();
_local1.mouseChildren = false;
_local1.mouseEnabled = false;
_local1.cacheAsBitmap = true;
addChild(_local1);
for each (_local2 in fillPieces) {
Tweener.addTween(_local2, {_color:0});
_local2.cacheAsBitmap = true;
_local2.addEventListener(MouseEvent.CLICK, onMouseClick);
addChild(_local2);
};
paperContainer = new Sprite();
addChild(paperContainer);
paper = new Sprite();
paperContainer.addChild(paper);
paperContainer.blendMode = BlendMode.LAYER;
paperBitmapData = new BitmapData(GameData.getInstance().stageWidth, 328, true, 0xFFFFFF);
paperBitmapData.draw(paper);
paperBitmap = new Bitmap(paperBitmapData);
paperBitmap.blendMode = BlendMode.NORMAL;
paperContainer.addChild(paperBitmap);
erasorBitmapData = new BitmapData(GameData.getInstance().stageWidth, 328, true, 0xFFFFFF);
erasorBitmapData.draw(erasorBitmapData);
erasorBitmap = new Bitmap(erasorBitmapData);
erasorBitmap.blendMode = BlendMode.ERASE;
paperContainer.addChild(erasorBitmap);
overlay.mouseChildren = false;
overlay.mouseEnabled = false;
addChild(overlay);
noSelection();
paperContainer.addEventListener(MouseEvent.ROLL_OVER, onPaperRollOver);
paperContainer.addEventListener(MouseEvent.ROLL_OUT, onPaperRollOut);
paperContainer.cacheAsBitmap = true;
paper.cacheAsBitmap = true;
}
private function onMouseDown(_arg1:MouseEvent):void{
if (drawingToolEnabled){
nib.x = mouseX;
nib.y = mouseY;
nib.alpha = 1;
nib.visible = true;
addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
};
}
private function onMouseMove(_arg1:MouseEvent):void{
nib.x = mouseX;
nib.y = mouseY;
if (erasorSelected){
paperBitmap.bitmapData.draw(paper, null, null, BlendMode.ERASE);
} else {
paperBitmap.bitmapData.draw(paper);
};
_arg1.updateAfterEvent();
}
private function onPaperRollOver(_arg1:MouseEvent):void{
addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
}
}
}//package com.drimlike.games.color.slides
Section 20
//CursorSystem (com.drimlike.games.color.systems.CursorSystem)
package com.drimlike.games.color.systems {
import flash.events.*;
import flash.display.*;
import com.drimlike.games.color.cursor.*;
public class CursorSystem extends Sprite {
private var container:Sprite;
private var pencilCursor:MouseCursor;
private var paintCursor:MouseCursor;
public var isActive:Boolean;
private var erasorCursor:MouseCursor;
private var fillCursor:MouseCursor;
public var cursorState:String;// = "nullState"
public static const PAINT_STATE:String = "paintState";
public static const ERASOR_STATE:String = "erasorState";
public static const FILL_STATE:String = "fillState";
public static const NULL_STATE:String = "nullState";
public static const PENCIL_STATE:String = "pencilState";
public function CursorSystem(){
if (stage){
init();
} else {
addEventListener(Event.ADDED_TO_STAGE, init);
};
}
public function selectPaintCursor():void{
fillCursor.hide();
pencilCursor.hide();
paintCursor.show();
erasorCursor.hide();
cursorState = PAINT_STATE;
}
public function selectPencilCursor():void{
fillCursor.hide();
pencilCursor.show();
paintCursor.hide();
erasorCursor.hide();
cursorState = PENCIL_STATE;
}
public function selectErasorcursor():void{
fillCursor.hide();
pencilCursor.hide();
paintCursor.hide();
erasorCursor.show();
cursorState = ERASOR_STATE;
}
public function hideAll():void{
fillCursor.hide();
paintCursor.hide();
pencilCursor.hide();
erasorCursor.hide();
cursorState = NULL_STATE;
}
public function selectFillCursor():void{
fillCursor.show();
pencilCursor.hide();
paintCursor.hide();
erasorCursor.hide();
cursorState = FILL_STATE;
}
public function changeCursorColor(_arg1:uint):void{
fillCursor.changeColor(_arg1);
pencilCursor.changeColor(_arg1);
paintCursor.changeColor(_arg1);
}
private function onMouseMove(_arg1:MouseEvent):void{
if (isActive){
container.x = stage.mouseX;
container.y = stage.mouseY;
};
}
private function init(_arg1:Event=null):void{
removeEventListener(Event.ADDED_TO_STAGE, init);
container = new Sprite();
addChild(container);
fillCursor = new MouseCursor(new CursorFillColorAsset(), new CursorFillOverlayAsset());
paintCursor = new MouseCursor(new CursorPaintColorAsset(), new CursorPaintOverlayAsset());
pencilCursor = new MouseCursor(new CursorPencilColorAsset(), new CursorPencilOverlayAsset());
erasorCursor = new MouseCursor(new CursorErasorAsset());
container.addChild(fillCursor);
container.addChild(paintCursor);
container.addChild(pencilCursor);
container.addChild(erasorCursor);
hideAll();
stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
}
}
}//package com.drimlike.games.color.systems
Section 21
//GameUISystem (com.drimlike.games.color.systems.GameUISystem)
package com.drimlike.games.color.systems {
import flash.events.*;
import com.drimlike.games.color.events.*;
import flash.display.*;
import com.drimlike.games.color.gameui.*;
import caurina.transitions.*;
public class GameUISystem extends Sprite {
private var nextSlideToolButton:TollBoxButtonAnimated;
private var erasorToolButton:TollboxButton;
private var fillToolButton:TollboxButton;
private var pencilToolButton:TollboxButton;
private var buttonsArray:Array;
private var resetToolButton:TollBoxButtonAnimated;
private var colorSelector:ColorSelector;
private var paintToolButton:TollboxButton;
public function GameUISystem(){
var _local1:TollboxButton;
buttonsArray = new Array();
super();
colorSelector = new ColorSelector();
addChild(colorSelector);
nextSlideToolButton = new TollBoxButtonAnimated(new GameUINextSlideAsset());
nextSlideToolButton.x = 370;
nextSlideToolButton.y = -50;
addChild(nextSlideToolButton);
resetToolButton = new TollBoxButtonAnimated(new GameUIResetAsset());
resetToolButton.x = 420;
resetToolButton.y = -50;
addChild(resetToolButton);
pencilToolButton = new TollboxButton(new GameUIPencilColorAsset(), new GameUIPencilBackgroundAsset());
pencilToolButton.x = 600;
pencilToolButton.y = -50;
addChild(pencilToolButton);
paintToolButton = new TollboxButton(new GameUIPaintColorAset(), new GameUIPaintBackgroundAsset());
paintToolButton.x = 650;
paintToolButton.y = -50;
addChild(paintToolButton);
fillToolButton = new TollboxButton(new GameUIPaintBucketColorAsset(), new GameUIPainBucketBackgroundAsset());
fillToolButton.x = 510;
fillToolButton.y = -50;
addChild(fillToolButton);
erasorToolButton = new TollboxButton(new GameUIErasorAsset());
erasorToolButton.x = 700;
erasorToolButton.y = -50;
addChild(erasorToolButton);
buttonsArray.push(nextSlideToolButton, resetToolButton, pencilToolButton, paintToolButton, fillToolButton, erasorToolButton);
for each (_local1 in buttonsArray) {
_local1.addEventListener(MouseEvent.CLICK, onButtonClick);
};
}
public function enable():void{
}
public function spawnButtons(_arg1:int=0):void{
Tweener.addTween(nextSlideToolButton, {y:32, time:1, transition:"easeOutExpo", delay:(0 + _arg1)});
Tweener.addTween(resetToolButton, {y:32, time:1, transition:"easeOutExpo", delay:(0.25 + _arg1)});
Tweener.addTween(fillToolButton, {y:32, time:1, transition:"easeOutExpo", delay:(0.5 + _arg1)});
Tweener.addTween(pencilToolButton, {y:32, time:1, transition:"easeOutExpo", delay:(0.75 + _arg1)});
Tweener.addTween(paintToolButton, {y:32, time:1, transition:"easeOutExpo", delay:(1 + _arg1)});
Tweener.addTween(erasorToolButton, {y:32, time:1, transition:"easeOutExpo", delay:(1.25 + _arg1)});
}
public function hideForPrint():void{
colorSelector.visible = false;
nextSlideToolButton.visible = false;
resetToolButton.visible = false;
pencilToolButton.visible = false;
paintToolButton.visible = false;
fillToolButton.visible = false;
erasorToolButton.visible = false;
}
public function showAfterPrint():void{
colorSelector.visible = true;
nextSlideToolButton.visible = true;
resetToolButton.visible = true;
pencilToolButton.visible = true;
paintToolButton.visible = true;
fillToolButton.visible = true;
erasorToolButton.visible = true;
}
public function getSelectedColor():uint{
return (colorSelector.selectedHex);
}
public function changeIconColors(_arg1:uint):void{
fillToolButton.updateIconColor(_arg1);
paintToolButton.updateIconColor(_arg1);
pencilToolButton.updateIconColor(_arg1);
}
private function onButtonClick(_arg1:MouseEvent):void{
var _local3:TollboxButton;
var _local2:TollboxButton = TollboxButton(_arg1.target);
if ((((((((_local2 == paintToolButton)) || ((_local2 == pencilToolButton)))) || ((_local2 == erasorToolButton)))) || ((_local2 == fillToolButton)))){
for each (_local3 in buttonsArray) {
_local3.deselect();
};
};
if (_local2 == nextSlideToolButton){
nextSlideToolButton.quickDeslect();
dispatchEvent(new GameUISystemEvent(GameUISystemEvent.NEXT_SLIDE_SELECTED_EVENT, true, true));
} else {
if (_local2 == resetToolButton){
resetToolButton.quickDeslect();
dispatchEvent(new GameUISystemEvent(GameUISystemEvent.RESET_TOOL_SELECTED_EVENT, true, true));
} else {
if (_local2 == pencilToolButton){
pencilToolButton.select();
dispatchEvent(new GameUISystemEvent(GameUISystemEvent.PENCIL_TOOL_SELECTED_EVENT, true, true));
} else {
if (_local2 == paintToolButton){
paintToolButton.select();
dispatchEvent(new GameUISystemEvent(GameUISystemEvent.PAINT_TOOL_SELECTED_EVENT, true, true));
} else {
if (_local2 == fillToolButton){
fillToolButton.select();
dispatchEvent(new GameUISystemEvent(GameUISystemEvent.FILL_TOOL_SELECTED_EVENT, true, true));
} else {
if (_local2 == erasorToolButton){
erasorToolButton.select();
dispatchEvent(new GameUISystemEvent(GameUISystemEvent.ERASOR_TOOL_SELECTED_EVENT, true, true));
};
};
};
};
};
};
}
public function disable():void{
}
public function show(_arg1:int=0):void{
colorSelector.show(_arg1);
spawnButtons(_arg1);
fillToolButton.select();
dispatchEvent(new GameUISystemEvent(GameUISystemEvent.FILL_TOOL_SELECTED_EVENT, true, true));
}
}
}//package com.drimlike.games.color.systems
Section 22
//SliderSystem (com.drimlike.games.color.systems.SliderSystem)
package com.drimlike.games.color.systems {
import flash.events.*;
import flash.display.*;
import com.drimlike.games.color.slides.*;
import flash.utils.*;
import caurina.transitions.*;
public class SliderSystem extends Sprite {
private var container:Sprite;
private var navigationCounter:int;
private var demoInterval:Number;
private var slideWidth:Number;// = 728
private var slides:Array;
public static const DEMO_REEL_COMPLETE_EVENT:String = "demoReelCompleteEvent";
public function SliderSystem(_arg1:Array){
var _local3:ColorSlide;
super();
slides = _arg1;
container = new Sprite();
addChild(container);
var _local2:int;
while (_local2 < _arg1.length) {
_local3 = ColorSlide(_arg1[_local2]);
_local3.x = (_local2 * slideWidth);
container.addChild(_local3);
_local2++;
};
container.x = (container.x - ((slideWidth * _arg1.length) - slideWidth));
}
public function removeSlideFromDisplay(_arg1:ColorSlide):void{
container.removeChild(_arg1);
}
public function hideForPrint():void{
var _local1:ColorSlide;
for each (_local1 in slides) {
if (_local1 != getCurrentSlide()){
_local1.visible = false;
};
};
}
public function noSelection():void{
var _local1:ColorSlide;
for each (_local1 in slides) {
_local1.noSelection();
};
}
public function removeSlide(_arg1:ColorSlide):void{
container.removeChild(_arg1);
}
public function showAfterPrint():void{
var _local1:ColorSlide;
for each (_local1 in slides) {
_local1.visible = true;
};
}
public function enablePaintTool():void{
var _local1:ColorSlide;
for each (_local1 in slides) {
_local1.enablePaperPaint();
};
}
public function changeToolColor(_arg1:uint):void{
var _local2:ColorSlide;
for each (_local2 in slides) {
_local2.changeColorTool(_arg1);
};
}
public function enableNoTool():void{
this.mouseEnabled = false;
this.mouseChildren = false;
noSelection();
}
public function enableErasorTool():void{
var _local1:ColorSlide;
for each (_local1 in slides) {
_local1.enableErasor();
};
}
public function enableFillTool():void{
var _local1:ColorSlide;
this.mouseChildren = true;
this.mouseEnabled = true;
for each (_local1 in slides) {
_local1.enableFill();
};
}
public function addSlide(_arg1:ColorSlide, _arg2:int, _arg3:int):void{
container.addChild(_arg1);
_arg1.x = _arg2;
_arg1.y = _arg3;
}
public function enablePencilTool():void{
var _local1:ColorSlide;
for each (_local1 in slides) {
_local1.enablePaperPencil();
};
}
public function resetSlide():void{
var _local1:ColorSlide = ColorSlide(slides[navigationCounter]);
_local1.reset();
}
public function nextCanvas():void{
var _local1:ColorSlide;
if (navigationCounter < (slides.length - 1)){
navigationCounter++;
} else {
navigationCounter = 0;
};
for each (_local1 in slides) {
if (_local1 != ColorSlide(slides[navigationCounter])){
_local1.cacheAsBitmap = true;
} else {
_local1.cacheAsBitmap = false;
};
};
Tweener.addTween(container, {x:(-(navigationCounter) * slideWidth), time:2, transition:"easeOutExpo"});
}
public function getCurrentSlide():ColorSlide{
return (ColorSlide(slides[navigationCounter]));
}
public function previousCanvas():void{
if (navigationCounter > 0){
navigationCounter--;
} else {
navigationCounter = (slides.length - 1);
};
Tweener.addTween(container, {x:(-(navigationCounter) * slideWidth), time:2, transition:"easeOutExpo"});
}
public function getIndexOfCurrentSlide():int{
return (slides.indexOf(ColorSlide(slides[navigationCounter])));
}
private function doShift():void{
var cs:ColorSlide;
var reset:Function;
reset = function ():void{
cs.reset();
};
navigationCounter--;
cs = ColorSlide(slides[navigationCounter]);
Tweener.addTween(container, {x:(navigationCounter * slideWidth), time:1.5, onComplete:reset});
if (navigationCounter == 0){
var readyToPlay:Function = function ():void{
clearInterval(demoInterval);
dispatchEvent(new Event(DEMO_REEL_COMPLETE_EVENT, true, true));
};
clearInterval(demoInterval);
demoInterval = setInterval(readyToPlay, 1500);
};
}
public function showDemoReel():void{
navigationCounter = (slides.length - 1);
var _local1:ColorSlide = ColorSlide(slides[navigationCounter]);
_local1.reset();
demoInterval = setInterval(doShift, 2000);
}
}
}//package com.drimlike.games.color.systems
Section 23
//UISystem (com.drimlike.games.color.systems.UISystem)
package com.drimlike.games.color.systems {
import flash.events.*;
import com.drimlike.games.color.data.*;
import flash.display.*;
import com.drimlike.games.color.gameui.*;
import com.drimlike.games.ui.oldstyle.*;
import com.drimlike.games.ui.*;
import com.drimlike.games.ui.xml.*;
import flash.net.*;
public class UISystem extends Sprite {
private var urlS:String;
private var rightSlideButton:NextSlideButton;
private var leftSlideButton:NextSlideButton;
private var moreGamesButton:OldStyleButton;
public var myGames4Girls:MyGames4Girls;
private var xmlFeed:XMLFeed;
private var soundButton:SoundButton;
private var printButton:OldStyleButton;
public static const RIGHT_ARROW_CLICK_EVENT:String = "rightArrowClickEvent";
public static const LEFT_ARROW_CLICK_EVENT:String = "leftArrowClickEvent";
public static const PRINTER_CLICKED_EVENT:String = "printerClickedEvent";
public function UISystem(){
createMyGames4Girls();
createMoreGamesButton();
createPrintButton();
createXMLFeed();
createSoundButton();
createArrowButtons();
}
public function enablePrintButton():void{
printButton.mouseEnabled = true;
}
private function createSoundButton():void{
soundButton = new SoundButton();
soundButton.x = 690;
soundButton.y = 490;
addChild(soundButton);
}
public function hideForPrint():void{
moreGamesButton.visible = false;
printButton.visible = false;
xmlFeed.visible = false;
soundButton.visible = false;
leftSlideButton.visible = false;
rightSlideButton.visible = false;
}
private function onLeftSlide(_arg1:MouseEvent):void{
dispatchEvent(new Event(LEFT_ARROW_CLICK_EVENT, true, true));
}
private function createArrowButtons():void{
leftSlideButton = new NextSlideButton();
leftSlideButton.x = 18;
leftSlideButton.scaleX = -1;
leftSlideButton.y = 390;
leftSlideButton.addEventListener(MouseEvent.CLICK, onLeftSlide);
leftSlideButton.useHandCursor = true;
leftSlideButton.buttonMode = true;
addChild(leftSlideButton);
rightSlideButton = new NextSlideButton();
rightSlideButton.useHandCursor = true;
rightSlideButton.buttonMode = true;
rightSlideButton.addEventListener(MouseEvent.CLICK, onRightSlide);
rightSlideButton.x = 710;
rightSlideButton.y = 390;
addChild(rightSlideButton);
}
private function onPrintClick(_arg1:MouseEvent):void{
dispatchEvent(new Event(PRINTER_CLICKED_EVENT, true, true));
}
private function createMyGames4Girls():void{
myGames4Girls = new MyGames4Girls();
myGames4Girls.x = 145;
myGames4Girls.y = 30;
addChild(myGames4Girls);
}
public function showAfterPrint():void{
moreGamesButton.visible = true;
printButton.visible = true;
xmlFeed.visible = true;
soundButton.visible = true;
leftSlideButton.visible = true;
rightSlideButton.visible = true;
}
private function createMoreGamesButton():void{
switch (GameData.getInstance().language){
default:
moreGamesButton = new OldStyleButton("MORE GAMES", false);
break;
case GameData.FRENCH:
moreGamesButton = new OldStyleButton("PLUS DE JEUX", false);
break;
case GameData.GERMAN:
moreGamesButton = new OldStyleButton("MEHR SPIELE", false);
break;
case GameData.SPANISH:
moreGamesButton = new OldStyleButton("MÁS JUEGOS", false);
break;
};
moreGamesButton.x = 140;
moreGamesButton.y = 430;
moreGamesButton.addEventListener(MouseEvent.CLICK, onMoreGamesClick, false, 0, true);
addChild(moreGamesButton);
}
private function createPrintButton():void{
switch (GameData.getInstance().language){
default:
printButton = new OldStyleButton("PRINT", false);
break;
case GameData.FRENCH:
printButton = new OldStyleButton("IMPRIMER", false);
break;
case GameData.GERMAN:
printButton = new OldStyleButton("DRUCK", false);
break;
case GameData.SPANISH:
printButton = new OldStyleButton("IMPRIMIR", false);
break;
};
printButton.x = 140;
printButton.y = 485;
printButton.mouseChildren = false;
printButton.mouseEnabled = false;
printButton.addEventListener(MouseEvent.CLICK, onPrintClick, false, 0, true);
addChild(printButton);
}
private function onRightSlide(_arg1:MouseEvent):void{
dispatchEvent(new Event(RIGHT_ARROW_CLICK_EVENT, true, true));
}
private function createXMLFeed():void{
xmlFeed = new XMLFeed();
xmlFeed.x = 710;
xmlFeed.y = 425;
addChild(xmlFeed);
}
private function onMoreGamesClick(_arg1:MouseEvent):void{
var _local4:Boolean;
var _local5:String;
var _local6:LocalConnection;
var _local7:String;
var _local8:String;
var _local9:String;
var _local10:Number;
var _local2:Array = new Array("jeux2filles.fr", "juegosxachicas.com", "mygames4girls.de", "mygames4girls.com", "drimlike.com");
var _local3:String = loaderInfo.url;
for each (_local5 in _local2) {
_local8 = _local5.toLowerCase();
_local9 = _local3.toLowerCase();
_local10 = _local9.indexOf(_local8, 0);
if (_local10 != -1){
_local4 = true;
};
};
_local6 = new LocalConnection();
_local7 = _local6.domain;
switch (GameData.getInstance().language){
default:
if (_local4){
urlS = "http://www.mygames4girls.com";
} else {
urlS = ((("http://www.mygames4girls.com/?utm_source=" + _local7) + "&utm_medium=our_games&utm_campaign=") + GameData.getInstance().TRACKING_KEY);
};
break;
case GameData.FRENCH:
if (_local4){
urlS = "http://www.jeux2filles.fr";
} else {
urlS = ((("http://www.jeux2filles.fr/?utm_source=" + _local7) + "&utm_medium=our_games&utm_campaign=") + GameData.getInstance().TRACKING_KEY);
};
break;
case GameData.GERMAN:
if (_local4){
urlS = "http://www.mygames4girls.de";
} else {
urlS = ((("http://www.mygames4girls.de/?utm_source=" + _local7) + "&utm_medium=our_games&utm_campaign=") + GameData.getInstance().TRACKING_KEY);
};
break;
case GameData.SPANISH:
if (_local4){
urlS = "http://www.juegosxachicas.com";
} else {
urlS = ((("http://www.juegosxachicas.com/?utm_source=" + _local7) + "&utm_medium=our_games&utm_campaign=") + GameData.getInstance().TRACKING_KEY);
};
break;
};
navigateToURL(new URLRequest(urlS), "_blank");
}
}
}//package com.drimlike.games.color.systems
Section 24
//Sandbox (com.drimlike.games.color.Sandbox)
package com.drimlike.games.color {
import flash.events.*;
import com.drimlike.games.color.events.*;
import com.drimlike.games.color.data.*;
import flash.display.*;
import com.drimlike.games.color.slides.*;
import com.drimlike.games.color.systems.*;
import com.drimlike.games.color.gameui.*;
import flash.geom.*;
import flash.ui.*;
import caurina.transitions.*;
import flash.printing.*;
public class Sandbox extends Sprite {
private var foreground:Sprite;
private var gameUISystem:GameUISystem;
private var uiSystem:UISystem;
private var cursorSystem:CursorSystem;
private var background:Sprite;
private var sliderSystem:SliderSystem;
public function Sandbox(){
if (stage){
init();
} else {
addEventListener(Event.ADDED_TO_STAGE, init);
};
}
private function createCursorSystem():void{
cursorSystem = new CursorSystem();
cursorSystem.mouseChildren = false;
cursorSystem.mouseEnabled = false;
addChild(cursorSystem);
}
private function onPencilTool(_arg1:GameUISystemEvent):void{
cursorSystem.selectPencilCursor();
sliderSystem.enablePencilTool();
}
private function createSlideReel():void{
var _local2:Sprite;
var _local3:Sprite;
var _local7:ColorSlide;
var _local8:ColorSlide;
var _local1:int;
var _local4:Array = new Array();
var _local5:ColorSlide1Asset = new ColorSlide1Asset();
var _local6:ColorSlide2Asset = new ColorSlide2Asset();
_local1 = 0;
while (_local1 < _local5.numChildren) {
_local2 = Sprite(_local5.getChildAt(_local1));
if (_local2 == _local5.overlay){
_local3 = _local2;
} else {
_local4.push(_local2);
};
_local1++;
};
trace(_local3);
_local7 = new ColorSlide(_local3, _local4);
_local1 = 0;
_local2 = null;
_local3 = null;
_local4 = new Array();
_local1 = 0;
while (_local1 < _local6.numChildren) {
_local2 = Sprite(_local6.getChildAt(_local1));
if (_local2 == _local6.overlay){
_local3 = _local2;
} else {
_local4.push(_local2);
};
_local1++;
};
_local8 = new ColorSlide(_local3, _local4);
sliderSystem = new SliderSystem(new Array(_local7, _local8));
sliderSystem.y = 63;
sliderSystem.addEventListener(MouseEvent.ROLL_OUT, onCursorRollOut);
sliderSystem.addEventListener(MouseEvent.ROLL_OVER, onCursorRollOver);
sliderSystem.addEventListener(SliderSystem.DEMO_REEL_COMPLETE_EVENT, onDemoReelComplete);
addChild(sliderSystem);
sliderSystem.showDemoReel();
sliderSystem.noSelection();
addEventListener(ColorSlide.SLIDE_PIECE_CLICKED_EVENT, onFillPieceClick);
}
private function init(_arg1:Event=null):void{
removeEventListener(Event.ADDED_TO_STAGE, init);
createBackground();
createSlideReel();
createForeground();
createCursorSystem();
createGameUI();
createUISystem();
}
private function createBackground():void{
background = new Sprite();
background.graphics.beginFill(0);
background.graphics.drawRect(0, 0, GameData.getInstance().stageWidth, GameData.getInstance().stageHeight);
background.graphics.endFill();
}
private function onPrinterClick(_arg1:Event):void{
var _local2:Sprite = new Sprite();
addChild(_local2);
var _local3:Sprite = new Sprite();
_local3.graphics.beginFill(0xFFFFFF);
_local3.graphics.drawRect(0, 0, 728, 530);
_local3.graphics.endFill();
_local2.addChild(_local3);
uiSystem.hideForPrint();
gameUISystem.hideForPrint();
sliderSystem.hideForPrint();
var _local4:Bitmap = new Bitmap();
_local4.bitmapData = new BitmapData(728, 530);
_local4.bitmapData.draw(sliderSystem);
_local4.bitmapData.draw(uiSystem);
_local4.bitmapData;
_local2.addChild(_local4);
var _local5:PrintJob = new PrintJob();
var _local6:PrintJobOptions = new PrintJobOptions();
var _local7:Boolean = _local5.start();
if (_local7){
if (_local5.orientation == PrintJobOrientation.LANDSCAPE){
} else {
_local2.rotation = 90;
};
_local5.addPage(_local2);
_local5.send();
};
uiSystem.showAfterPrint();
gameUISystem.showAfterPrint();
sliderSystem.showAfterPrint();
_local2.removeChild(_local4);
removeChild(_local2);
_local2 = null;
}
private function onNextSlideTool(_arg1:GameUISystemEvent):void{
sliderSystem.nextCanvas();
GameData.getInstance().soundManager.playOpenCloseSound();
}
private function createUISystem():void{
uiSystem = new UISystem();
uiSystem.addEventListener(UISystem.PRINTER_CLICKED_EVENT, onPrinterClick);
uiSystem.addEventListener(UISystem.LEFT_ARROW_CLICK_EVENT, onLeftSlideClick);
uiSystem.addEventListener(UISystem.RIGHT_ARROW_CLICK_EVENT, onRightSlideClick);
uiSystem.mouseEnabled = false;
uiSystem.mouseChildren = false;
addChild(uiSystem);
}
private function createGameUI():void{
gameUISystem = new GameUISystem();
addChild(gameUISystem);
addEventListener(GameUISystemEvent.ERASOR_TOOL_SELECTED_EVENT, onErasorTool);
addEventListener(GameUISystemEvent.FILL_TOOL_SELECTED_EVENT, onFillTool);
addEventListener(GameUISystemEvent.NEXT_SLIDE_SELECTED_EVENT, onNextSlideTool);
addEventListener(GameUISystemEvent.PAINT_TOOL_SELECTED_EVENT, onPaintTool);
addEventListener(GameUISystemEvent.PENCIL_TOOL_SELECTED_EVENT, onPencilTool);
addEventListener(GameUISystemEvent.RESET_TOOL_SELECTED_EVENT, onResetTool);
addEventListener(ColorSelector.COLOR_SELECTED_EVENT, onColorSelected);
}
private function createForeground():void{
foreground = new ForegroundAsset();
addChild(foreground);
}
private function onResetTool(_arg1:GameUISystemEvent):void{
sliderSystem.resetSlide();
GameData.getInstance().soundManager.playJingle();
}
private function onFillPieceClick(_arg1:Event):void{
var _local2:Sprite;
if (cursorSystem.cursorState == CursorSystem.FILL_STATE){
_local2 = Sprite(_arg1.target);
Tweener.addTween(_local2, {_color:gameUISystem.getSelectedColor(), time:1, transition:"easeOutExpo"});
};
}
private function onCursorRollOver(_arg1:MouseEvent):void{
trace(cursorSystem.cursorState);
if (cursorSystem.cursorState != CursorSystem.NULL_STATE){
Mouse.hide();
};
cursorSystem.visible = true;
cursorSystem.isActive = true;
}
private function onRightSlideClick(_arg1:Event):void{
sliderSystem.nextCanvas();
GameData.getInstance().soundManager.playOpenCloseSound();
}
private function onDemoReelComplete(_arg1:Event):void{
var _local2:ColorSlide = sliderSystem.getCurrentSlide();
var _local3:Rectangle = _local2.getBounds(this);
if ((((((((mouseX > _local3.x)) && ((mouseY > _local3.y)))) && ((mouseX < _local3.width)))) && ((mouseY < (_local3.height + 50))))){
Mouse.hide();
};
uiSystem.mouseChildren = true;
uiSystem.mouseEnabled = true;
gameUISystem.show(2);
uiSystem.enablePrintButton();
}
private function onPaintTool(_arg1:GameUISystemEvent):void{
cursorSystem.selectPaintCursor();
sliderSystem.enablePaintTool();
cursorSystem.selectPaintCursor();
}
private function onErasorTool(_arg1:GameUISystemEvent):void{
sliderSystem.enableErasorTool();
cursorSystem.selectErasorcursor();
}
private function onFillTool(_arg1:GameUISystemEvent):void{
cursorSystem.selectFillCursor();
sliderSystem.enableFillTool();
}
private function onCursorRollOut(_arg1:MouseEvent):void{
Mouse.show();
cursorSystem.visible = false;
cursorSystem.isActive = false;
}
private function onLeftSlideClick(_arg1:Event):void{
sliderSystem.previousCanvas();
GameData.getInstance().soundManager.playOpenCloseSound();
}
private function onColorSelected(_arg1:Event):void{
var _local2:ColorSelector = ColorSelector(_arg1.target);
gameUISystem.changeIconColors(_local2.selectedHex);
cursorSystem.changeCursorColor(_local2.selectedHex);
sliderSystem.changeToolColor(_local2.selectedHex);
}
}
}//package com.drimlike.games.color
Section 25
//SoundManager (com.drimlike.games.sound.SoundManager)
package com.drimlike.games.sound {
import flash.media.*;
public class SoundManager {
private var theme:Sound;
private var sectionButtonSound:Sound;
private var oldStyleClick:Sound;
private var tinkleChannel:SoundChannel;
private var openCloseSound:Sound;
private var tinkleSound:Sound;
private var whooshSound:Sound;
private var papparazi:Sound;
private var jingle:Sound;
private var themeChannel:SoundChannel;
public function SoundManager(){
sectionButtonSound = (new SectionClickAsset() as Sound);
papparazi = (new PapAsset() as Sound);
openCloseSound = (new CupboardOpenCloseAsset() as Sound);
tinkleSound = (new TinkleSoundAsset() as Sound);
whooshSound = (new OldStyleMouseOverSoundAsset2() as Sound);
oldStyleClick = (new OldStyleMouseOverSoundAsset() as Sound);
jingle = (new JingleAsset() as Sound);
theme = (new ThemeTuneAsset() as Sound);
}
public function playPapSound():void{
papparazi.play();
}
public function playJingle():void{
jingle.play(0, 0);
}
public function stopThemeTune():void{
themeChannel.stop();
themeChannel = null;
}
public function playThemeTune():void{
var _local1:SoundTransform;
if (themeChannel == null){
_local1 = new SoundTransform(0.7, 0);
themeChannel = theme.play(0, 9999, _local1);
};
}
public function playTinkleSound():void{
tinkleChannel = tinkleSound.play(0, 100);
}
public function stopTinkleSound():void{
if (tinkleChannel){
tinkleChannel.stop();
tinkleChannel = null;
};
}
public function playOldStyleButtonWhoosh():void{
whooshSound.play(0.1, 0);
}
public function playOpenCloseSound():void{
openCloseSound.play();
}
public function playSectionClick():void{
sectionButtonSound.play();
}
public function playOldStyleButtonClick():void{
oldStyleClick.play(0, 0);
}
}
}//package com.drimlike.games.sound
Section 26
//AbstractButton (com.drimlike.games.ui.base.AbstractButton)
package com.drimlike.games.ui.base {
import flash.events.*;
import flash.display.*;
public class AbstractButton extends Sprite {
public function AbstractButton(){
init();
}
protected function init():void{
useHandCursor = true;
mouseChildren = false;
buttonMode = true;
addEventListener(MouseEvent.ROLL_OUT, onRollOut);
addEventListener(MouseEvent.ROLL_OVER, onRollOver);
addEventListener(MouseEvent.CLICK, onMouseClick);
}
protected function onMouseClick(_arg1:MouseEvent):void{
}
protected function onRollOver(_arg1:MouseEvent):void{
}
protected function onRollOut(_arg1:MouseEvent):void{
}
public function destroy():void{
}
public function reset():void{
}
}
}//package com.drimlike.games.ui.base
Section 27
//ButtonEvent (com.drimlike.games.ui.events.ButtonEvent)
package com.drimlike.games.ui.events {
import flash.events.*;
public class ButtonEvent extends Event {
public static var BUTTON_CLICKED_EVENT:String = "buttonClickedEvent";
public function ButtonEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
}
}//package com.drimlike.games.ui.events
Section 28
//OldStyleButton (com.drimlike.games.ui.oldstyle.OldStyleButton)
package com.drimlike.games.ui.oldstyle {
import flash.events.*;
import com.drimlike.games.color.data.*;
import flash.display.*;
import org.flintparticles.twoD.zones.*;
import flash.utils.*;
import org.flintparticles.twoD.renderers.*;
import org.flintparticles.twoD.emitters.*;
import com.drimlike.games.ui.base.*;
import com.drimlike.games.ui.textfields.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.twoD.actions.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.twoD.particles.*;
import com.drimlike.games.ui.events.*;
import org.flintparticles.twoD.initializers.*;
import caurina.transitions.*;
import flash.filters.*;
import org.flintparticles.common.counters.*;
public class OldStyleButton extends AbstractButton {
protected var autoResize:Boolean;
protected var backgroundSprite:Sprite;
private var buttonLabel:String;
protected var containerSprite:Sprite;
protected var glint:OldStyleGlintHighlightAsset;
private var particleInterval:Number;
protected var labelField:CoconField;
protected var emitter:Emitter2D;
protected var particleRender:DisplayObjectRenderer;
protected var buttonMask:Sprite;
public function OldStyleButton(_arg1:String, _arg2:Boolean=false){
buttonLabel = _arg1;
autoResize = _arg2;
super();
}
override public function reset():void{
}
override protected function init():void{
super.init();
containerSprite = new Sprite();
addChild(containerSprite);
backgroundSprite = new OldStyleButtonBackgroundAsset();
backgroundSprite.cacheAsBitmap = true;
containerSprite.addChild(backgroundSprite);
labelField = new CoconField(20);
labelField.text = buttonLabel;
labelField.x = (-(labelField.width) / 2);
labelField.y = (-(labelField.height) / 2);
containerSprite.addChild(labelField);
var _local1:GlowFilter = new GlowFilter(9503365, 5, 1.5, 1.5, 10, BitmapFilterQuality.HIGH);
labelField.filters = new Array(_local1);
labelField.cacheAsBitmap = true;
if (autoResize){
backgroundSprite.width = (labelField.width + 40);
} else {
backgroundSprite.width = 150;
};
glint = new OldStyleGlintHighlightAsset();
glint.cacheAsBitmap = true;
glint.x = ((-(backgroundSprite.width) / 2) - 50);
glint.y = (-(backgroundSprite.height) / 2);
glint.height = backgroundSprite.height;
glint.mouseChildren = false;
glint.mouseEnabled = false;
addChild(glint);
buttonMask = new Sprite();
buttonMask.graphics.beginFill(0, 0.5);
buttonMask.graphics.drawRect((-(backgroundSprite.width) / 2), (-(backgroundSprite.height) / 2), backgroundSprite.width, backgroundSprite.height);
buttonMask.graphics.endFill();
addChild(buttonMask);
glint.mask = buttonMask;
}
private function createParticles():void{
destroy();
emitter = new Emitter2D();
emitter.counter = new Steady(50);
var _local1:Array = new Array(Star10Asset, Star4Asset, Star5Asset, Star6Asset, Star7Asset, Star8Asset, Star9Asset);
var _local2:ImageClasses = new ImageClasses(_local1);
emitter.addInitializer(_local2);
var _local3:RectangleZone = new RectangleZone((-(backgroundSprite.width) / 2), (-(backgroundSprite.height) / 2), (backgroundSprite.width / 2), (backgroundSprite.height / 2));
var _local4:RectangleZone = new RectangleZone((-((backgroundSprite.width - 10)) / 2), (-((backgroundSprite.height - 10)) / 2), ((backgroundSprite.width / 2) - 5), ((backgroundSprite.height / 2) - 5));
var _local5:RotateVelocity = new RotateVelocity(5, 15);
var _local6:Lifetime = new Lifetime(1, 2);
emitter.addInitializer(new Position(_local3));
emitter.addInitializer(_local5);
emitter.addInitializer(_local6);
emitter.addInitializer(new Velocity(_local3));
emitter.addInitializer(new ScaleImageInit(0.1, 0.7));
var _local7:Fade = new Fade(0.7, 0);
var _local8:Age = new Age();
var _local9:Friction = new Friction(0.4);
var _local10:Rotate = new Rotate();
emitter.addAction(_local10);
emitter.addAction(_local8);
emitter.addAction(_local7);
emitter.addAction(_local9);
emitter.addAction(new Move());
emitter.addAction(new DeathZone(_local4, true));
particleRender = new DisplayObjectRenderer();
containerSprite.addChild(particleRender);
particleRender.addEmitter(emitter);
emitter.start();
emitter.counter.resume();
}
override protected function onMouseClick(_arg1:MouseEvent):void{
GameData.getInstance().soundManager.playOldStyleButtonClick();
dispatchEvent(new ButtonEvent(ButtonEvent.BUTTON_CLICKED_EVENT, true, true));
}
override protected function onRollOver(_arg1:MouseEvent):void{
GameData.getInstance().soundManager.playOldStyleButtonWhoosh();
GameData.getInstance().soundManager.playTinkleSound();
clearInterval(particleInterval);
createParticles();
Tweener.removeTweens(glint);
Tweener.addTween(glint, {x:(backgroundSprite.width / 2), time:1, transition:"easeOutExpo"});
}
override protected function onRollOut(_arg1:MouseEvent):void{
var stopEmitter:Function;
var e = _arg1;
stopEmitter = function ():void{
clearInterval(particleInterval);
destroy();
};
GameData.getInstance().soundManager.stopTinkleSound();
if (emitter){
emitter.counter.stop();
};
particleInterval = setInterval(stopEmitter, 1000);
Tweener.removeTweens(glint);
Tweener.addTween(glint, {x:((-(backgroundSprite.width) / 2) - 50), time:1, transition:"easeOutExpo"});
}
public function get buttonWidth():Number{
return (backgroundSprite.width);
}
public function get buttonHeight():Number{
return (backgroundSprite.height);
}
override public function destroy():void{
if (emitter){
emitter.killAllParticles();
ParticleCreator2D(emitter.particleFactory).clearAllParticles();
emitter = null;
containerSprite.removeChild(particleRender);
particleRender = null;
};
}
}
}//package com.drimlike.games.ui.oldstyle
Section 29
//CoconField (com.drimlike.games.ui.textfields.CoconField)
package com.drimlike.games.ui.textfields {
import flash.text.*;
public class CoconField extends TextField {
public function CoconField(_arg1:int=30, _arg2:uint=0xFFFFFF){
var _local3:Font = new CoconFontAsset();
var _local4:TextFormat = new TextFormat();
_local4.align = TextFormatAlign.CENTER;
_local4.bold = false;
_local4.color = _arg2;
_local4.size = _arg1;
_local4.font = _local3.fontName;
defaultTextFormat = _local4;
autoSize = TextFieldAutoSize.CENTER;
embedFonts = true;
super();
}
}
}//package com.drimlike.games.ui.textfields
Section 30
//XMLFeed (com.drimlike.games.ui.xml.XMLFeed)
package com.drimlike.games.ui.xml {
import flash.events.*;
import com.drimlike.games.color.data.*;
import flash.display.*;
import org.flintparticles.twoD.renderers.*;
import flash.net.*;
import org.flintparticles.twoD.emitters.*;
import caurina.transitions.*;
public class XMLFeed extends Sprite {
private var items:Array;
private var container:Sprite;
protected var particleRender:DisplayObjectRenderer;
private var itemContainer:Sprite;
private var firstRun:Boolean;// = true
private var isScrolling:Boolean;
private var itemsXML:XMLList;
private var isOpen:Boolean;
private var urlRequest:URLRequest;
private var totalWidth:int;// = 0
private var targetBackgroundWidth:int;
private var background:Sprite;
protected var emitter:Emitter2D;
private var defaultBackgroundWidth:int;
private var icon:MovieClip;
private var backgroundMask:Sprite;
private var highlight:MovieClip;
private var homepage:String;
private var defaultIconX:int;// = 0
public function XMLFeed(_arg1:int=300){
targetBackgroundWidth = _arg1;
this.visible = false;
addEventListener(Event.ADDED_TO_STAGE, init);
}
private function onFeedRollOver(_arg1:Event):void{
isScrolling = false;
}
private function initScroll():void{
var _local3:Boolean;
var _local4:String;
var _local5:String;
var _local6:String;
var _local7:Number;
var _local1:Array = new Array("jeux2filles.fr", "juegosxachicas.com", "mygames4girls.de", "mygames4girls.com", "drimlike.com");
var _local2:String = loaderInfo.url;
for each (_local4 in _local1) {
_local5 = _local4.toLowerCase();
_local6 = _local2.toLowerCase();
_local7 = _local6.indexOf(_local5, 0);
if (_local7 != -1){
_local3 = true;
};
};
if (firstRun){
} else {
open();
};
}
private function onXMLComplete(_arg1:Event):void{
var _local3:Array;
var _local4:String;
var _local5:Boolean;
var _local6:String;
var _local7:LocalConnection;
var _local8:String;
var _local9:int;
var _local10:int;
var _local11:String;
var _local12:String;
var _local13:Number;
var _local14:XMLFeedItem;
var _local2:XML = XML(URLLoader(_arg1.target).data);
itemsXML = XMLList(_local2.data.item);
if (_local2.options.xmlFeedEnabled == 1){
this.visible = true;
background = new XMLFeedButton();
defaultBackgroundWidth = background.width;
background.mouseChildren = false;
container.addChild(background);
backgroundMask = new Sprite();
backgroundMask.graphics.beginFill(0xFFFFFF);
backgroundMask.graphics.drawRect(-1, 2, -35, 28);
backgroundMask.graphics.endFill();
container.addChild(backgroundMask);
itemContainer = new Sprite();
container.addChild(itemContainer);
itemContainer.mask = backgroundMask;
highlight = (new XMLFeedHighlight() as MovieClip);
highlight.mouseChildren = false;
highlight.mouseEnabled = false;
highlight.x = 0;
highlight.y = 0;
container.addChild(highlight);
icon = (new XMLFeedIcon() as MovieClip);
icon.buttonMode = true;
icon.mouseChildren = false;
icon.useHandCursor = true;
icon.addEventListener(MouseEvent.CLICK, onMouseClick);
icon.x = (-(background.width) / 2);
icon.y = (background.y + (background.height / 2));
container.addChild(icon);
_local3 = new Array("jeux2filles.fr", "juegosxachicas.com", "mygames4girls.de", "mygames4girls.com", "drimlike.com");
_local4 = loaderInfo.url;
for each (_local6 in _local3) {
_local11 = _local6.toLowerCase();
_local12 = _local4.toLowerCase();
_local13 = _local12.indexOf(_local11, 0);
if (_local13 != -1){
_local5 = true;
};
};
_local7 = new LocalConnection();
_local8 = _local7.domain;
_local9 = 0;
_local10 = 0;
while (_local10 < itemsXML.length()) {
if (_local5){
_local14 = new XMLFeedItem(String(homepage), String(itemsXML[_local10].@title));
} else {
_local14 = new XMLFeedItem(String(((((itemsXML[_local10].@linkURL + "?utm_source=") + _local8) + "&utm_medium=our_games&utm_campaign=") + GameData.getInstance().TRACKING_KEY)), String(itemsXML[_local10].@title));
};
_local14.x = _local9;
_local14.y = 8;
itemContainer.addChild(_local14);
_local9 = (_local9 + (_local14.width + 25));
items.push(_local14);
_local10++;
};
totalWidth = _local9;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
addEventListener(XMLFeedItem.FEED_ROLL_OUT, onFeedRollOut);
addEventListener(XMLFeedItem.FEED_ROLL_OVER, onFeedRollOver);
};
}
private function init(_arg1:Event):void{
container = new Sprite();
addChild(container);
items = new Array();
switch (GameData.getInstance().language){
default:
urlRequest = new URLRequest("http://www.mygames4girls.com/games.xml");
homepage = "http://www.mygames4girls.com";
break;
case GameData.GERMAN:
urlRequest = new URLRequest("http://www.mygames4girls.de/games.xml");
homepage = "http://www.mygames4girls.de";
break;
case GameData.SPANISH:
urlRequest = new URLRequest("http://www.juegosxachicas.com/games.xml");
homepage = "http://www.juegosxachicas.com";
break;
case GameData.FRENCH:
urlRequest = new URLRequest("http://www.jeux2filles.fr/games.xml");
homepage = "http://www.jeux2filles.fr";
break;
};
var _local2:URLLoader = new URLLoader();
_local2.addEventListener(Event.COMPLETE, onXMLComplete);
_local2.addEventListener(IOErrorEvent.IO_ERROR, onError);
_local2.load(urlRequest);
}
private function open():void{
var deleteHighlight:Function;
deleteHighlight = function ():void{
container.removeChild(highlight);
highlight = null;
};
isScrolling = true;
isOpen = true;
Tweener.addTween(background, {width:targetBackgroundWidth, time:1, transition:"easeOutExpo"});
Tweener.addTween(backgroundMask, {width:(targetBackgroundWidth - 40), time:1, transition:"easeOutExpo"});
Tweener.addTween(icon, {x:(-(targetBackgroundWidth) + 20), time:1, transition:"easeOutExpo"});
if (firstRun){
firstRun = false;
Tweener.addTween(highlight, {width:targetBackgroundWidth, time:1, transition:"easeOutExpo"});
Tweener.addTween(highlight, {alpha:0, time:1, delay:1, transition:"easeOutExpo", onComplete:deleteHighlight});
icon.gotoAndStop(0);
};
GameData.getInstance().soundManager.playOpenCloseSound();
}
private function onEnterFrame(_arg1:Event):void{
var _local2:int;
var _local3:XMLFeedItem;
var _local4:XMLFeedItem;
if (isScrolling){
_local2 = 0;
while (_local2 < items.length) {
_local3 = XMLFeedItem(items[_local2]);
if (_local2 == 0){
_local4 = XMLFeedItem(items[(items.length - 1)]);
} else {
_local4 = XMLFeedItem(items[(_local2 - 1)]);
};
_local3.x--;
if (_local3.x < (-(targetBackgroundWidth) - 100)){
_local3.x = ((_local4.x + _local4.width) + 25);
};
_local2++;
};
};
}
private function onError(_arg1:IOErrorEvent):void{
}
private function onFeedRollOut(_arg1:Event):void{
if (isOpen){
isScrolling = true;
};
}
private function onMouseClick(_arg1:MouseEvent):void{
if (isOpen){
close();
} else {
open();
};
}
private function close():void{
isScrolling = false;
isOpen = false;
Tweener.addTween(background, {width:defaultBackgroundWidth, time:1, transition:"easeOutExpo"});
backgroundMask.width = 0;
Tweener.addTween(icon, {x:(defaultIconX - 20), time:1, transition:"easeOutExpo"});
GameData.getInstance().soundManager.playOpenCloseSound();
}
}
}//package com.drimlike.games.ui.xml
Section 31
//XMLFeedItem (com.drimlike.games.ui.xml.XMLFeedItem)
package com.drimlike.games.ui.xml {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.text.*;
import caurina.transitions.*;
public class XMLFeedItem extends Sprite {
private var link:String;
private var textField:TextField;
private var text:String;
private var background:Sprite;
private var highlightSprite:Sprite;
public static const FEED_ROLL_OUT:String = "feedRollOut";
public static const FEED_ROLL_OVER:String = "feedRollOver";
public function XMLFeedItem(_arg1:String, _arg2:String){
link = _arg1;
text = _arg2;
addEventListener(Event.ADDED_TO_STAGE, init);
}
private function onMouseClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(link), "_blank");
}
private function onRollOut(_arg1:MouseEvent):void{
dispatchEvent(new Event(FEED_ROLL_OUT, true, true));
Tweener.addTween(highlightSprite, {_color:0xFFFFFF, y:20, time:1, height:1, y:(highlightSprite.y + 5), transition:"easeOutExpo"});
}
private function init(_arg1:Event):void{
var _local3:TextField;
background = new Sprite();
addChild(background);
highlightSprite = new Sprite();
addChild(highlightSprite);
var _local2:TextFormat = new TextFormat();
_local2.bold = true;
_local2.font = "Trebuchet MS";
_local2.size = 12;
_local3 = new TextField();
_local3.defaultTextFormat = _local2;
_local3.text = text;
_local3.autoSize = TextFieldAutoSize.LEFT;
_local3.x = 0;
_local3.y = 0;
_local3.selectable = false;
_local3.mouseEnabled = false;
_local3.cacheAsBitmap = true;
addChild(_local3);
background.graphics.beginFill(0xFFFFFF, 0);
background.graphics.drawRect(0, 0, _local3.width, _local3.height);
background.graphics.endFill();
background.addEventListener(MouseEvent.CLICK, onMouseClick);
background.addEventListener(MouseEvent.ROLL_OVER, onRollOver);
background.addEventListener(MouseEvent.ROLL_OUT, onRollOut);
background.buttonMode = true;
background.useHandCursor = true;
highlightSprite.mouseChildren = false;
highlightSprite.mouseEnabled = false;
highlightSprite.graphics.beginFill(0xFFFFFF, 1);
highlightSprite.graphics.drawRect(0, 0, _local3.width, 1);
highlightSprite.graphics.endFill();
highlightSprite.y = 20;
}
private function onRollOver(_arg1:MouseEvent):void{
dispatchEvent(new Event(FEED_ROLL_OVER, true, true));
Tweener.addTween(highlightSprite, {_color:9503365, y:18, time:1, height:2, transition:"easeOutExpo"});
}
}
}//package com.drimlike.games.ui.xml
Section 32
//MyGames4Girls (com.drimlike.games.ui.MyGames4Girls)
package com.drimlike.games.ui {
import flash.events.*;
import com.drimlike.games.color.data.*;
import flash.display.*;
import flash.net.*;
import flash.geom.*;
import caurina.transitions.*;
public class MyGames4Girls extends Sprite {
private var container:Sprite;
private var sprite:Sprite;
private var spriteDuplicate:Sprite;
private var glint:Sprite;
private var hitzone:Sprite;
public function MyGames4Girls(){
container = new Sprite();
container.mouseChildren = false;
container.mouseEnabled = false;
addChild(container);
var _local1:String = GameData.getInstance().language;
switch (_local1){
default:
sprite = new MyGamesForGirlsCOM();
spriteDuplicate = new MyGamesForGirlsCOM();
break;
case GameData.FRENCH:
sprite = new MyGamesForGirlsFR();
spriteDuplicate = new MyGamesForGirlsFR();
break;
case GameData.GERMAN:
sprite = new MyGamesForGirlsDE();
spriteDuplicate = new MyGamesForGirlsDE();
break;
case GameData.SPANISH:
sprite = new MyGamesForGirlsSP();
spriteDuplicate = new MyGamesForGirlsSP();
break;
};
sprite.mouseChildren = false;
sprite.mouseEnabled = false;
spriteDuplicate.mouseChildren = false;
spriteDuplicate.mouseEnabled = false;
container.addChild(sprite);
container.addChild(spriteDuplicate);
var _local2:Rectangle = sprite.getRect(this);
hitzone = new Sprite();
hitzone.graphics.beginFill(0xFFFFFF, 0);
hitzone.graphics.drawRect(_local2.x, _local2.y, _local2.width, _local2.height);
hitzone.graphics.endFill();
hitzone.useHandCursor = true;
hitzone.buttonMode = true;
hitzone.addEventListener(MouseEvent.ROLL_OUT, onRollOut);
hitzone.addEventListener(MouseEvent.ROLL_OVER, onRollOver);
hitzone.addEventListener(MouseEvent.CLICK, onClick);
addChild(hitzone);
glint = new OldStyleGlintHighlightAsset();
glint.mouseChildren = false;
glint.mouseEnabled = false;
glint.height = hitzone.height;
glint.y = (-(hitzone.height) / 2);
glint.x = -200;
container.addChild(glint);
glint.mask = spriteDuplicate;
}
private function onClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(getURLLink()), "_blank");
GameData.getInstance().soundManager.playOldStyleButtonClick();
}
private function onRollOver(_arg1:MouseEvent):void{
Tweener.removeTweens(glint);
Tweener.removeTweens(container);
Tweener.addTween(glint, {x:150, time:1, transition:"easeOutExpo"});
Tweener.addTween(container, {scaleX:1.1, scaleY:1.1, time:1, transition:"easeOutExpo"});
GameData.getInstance().soundManager.playOldStyleButtonWhoosh();
GameData.getInstance().soundManager.playTinkleSound();
}
private function onRollOut(_arg1:MouseEvent):void{
Tweener.removeTweens(glint);
Tweener.removeTweens(container);
Tweener.addTween(glint, {x:-190, time:1, transition:"easeOutExpo"});
Tweener.addTween(container, {scaleX:1, scaleY:1, time:1, transition:"easeOutExpo"});
GameData.getInstance().soundManager.stopTinkleSound();
}
protected function getURLLink():String{
var _local3:Boolean;
var _local4:String;
var _local5:LocalConnection;
var _local6:String;
var _local7:String;
var _local8:String;
var _local9:Number;
var _local1:Array = new Array("jeux2filles.fr", "juegosxachicas.com", "mygames4girls.de", "mygames4girls.com", "drimlike.com");
var _local2:String = loaderInfo.url;
for each (_local4 in _local1) {
_local7 = _local4.toLowerCase();
_local8 = _local2.toLowerCase();
_local9 = _local8.indexOf(_local7, 0);
if (_local9 != -1){
_local3 = true;
};
};
_local5 = new LocalConnection();
_local6 = _local5.domain;
_local4 = "";
switch (GameData.getInstance().language){
default:
if (_local3){
_local4 = "http://www.mygames4girls.com";
} else {
_local4 = ((("http://www.mygames4girls.com/?utm_source=" + _local6) + "&utm_medium=our_games&utm_campaign=") + GameData.getInstance().TRACKING_KEY);
};
break;
case GameData.GERMAN:
if (_local3){
_local4 = "http://www.mygames4girls.de";
} else {
_local4 = ((("http://www.mygames4girls.de/?utm_source=" + _local6) + "&utm_medium=our_games&utm_campaign=") + GameData.getInstance().TRACKING_KEY);
};
break;
case GameData.FRENCH:
if (_local3){
_local4 = "http://www.jeux2filles.fr";
} else {
_local4 = ((("http://www.jeux2filles.fr/?utm_source=" + _local6) + "&utm_medium=our_games&utm_campaign=") + GameData.getInstance().TRACKING_KEY);
};
break;
case GameData.SPANISH:
if (_local3){
_local4 = "http://www.juegosxachicas.com";
} else {
_local4 = ((("http://www.juegosxachicas.com/?utm_source=" + _local6) + "&utm_medium=our_games&utm_campaign=") + GameData.getInstance().TRACKING_KEY);
};
break;
};
return (_local4);
}
}
}//package com.drimlike.games.ui
Section 33
//SoundButton (com.drimlike.games.ui.SoundButton)
package com.drimlike.games.ui {
import flash.events.*;
import com.drimlike.games.color.data.*;
import flash.display.*;
import flash.media.*;
public class SoundButton extends Sprite {
private var soundOff:Sprite;
private var isSoundOn:Boolean;
private var soundOn:Sprite;
private var sound:Sound;
private var sponge:Sprite;
public function SoundButton(){
addEventListener(Event.ADDED_TO_STAGE, init);
}
private function onMouseClick(_arg1:MouseEvent):void{
soundToggle();
}
public function soundToggle():void{
if (isSoundOn){
isSoundOn = false;
GameData.getInstance().soundManager.stopThemeTune();
soundOn.visible = false;
soundOff.visible = true;
} else {
isSoundOn = true;
GameData.getInstance().soundManager.playThemeTune();
soundOn.visible = true;
soundOff.visible = false;
};
}
private function init(_arg1:Event):void{
soundOn = new SoundOn();
soundOff = new SoundOff();
addChild(soundOn);
addChild(soundOff);
sponge = new Sprite();
sponge.graphics.beginFill(0xFFFFFF, 1);
sponge.graphics.drawRect(-2, -2, 4, 4);
sponge.graphics.endFill();
addChildAt(sponge, 0);
isSoundOn = true;
soundOff.visible = false;
GameData.getInstance().soundManager.playThemeTune();
this.mouseChildren = false;
this.buttonMode = true;
this.useHandCursor = true;
this.addEventListener(MouseEvent.CLICK, onMouseClick);
}
}
}//package com.drimlike.games.ui
Section 34
//EdgeMetrics (mx.core.EdgeMetrics)
package mx.core {
public class EdgeMetrics {
public var top:Number;
public var left:Number;
public var bottom:Number;
public var right:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
;
public function EdgeMetrics(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
this.left = _arg1;
this.top = _arg2;
this.right = _arg3;
this.bottom = _arg4;
}
public function clone():EdgeMetrics{
return (new EdgeMetrics(left, top, right, bottom));
}
}
}//package mx.core
Section 35
//FlexMovieClip (mx.core.FlexMovieClip)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexMovieClip extends MovieClip {
mx_internal static const VERSION:String = "3.2.0.3958";
public function FlexMovieClip(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 36
//FlexSprite (mx.core.FlexSprite)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexSprite extends Sprite {
mx_internal static const VERSION:String = "3.2.0.3958";
public function FlexSprite(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 37
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 38
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 39
//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 40
//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 41
//MovieClipAsset (mx.core.MovieClipAsset)
package mx.core {
public class MovieClipAsset extends FlexMovieClip implements IFlexAsset, IFlexDisplayObject, IBorder {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
public function MovieClipAsset(){
_measuredWidth = width;
_measuredHeight = height;
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
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;
}
public function get borderMetrics():EdgeMetrics{
if (scale9Grid == null){
return (EdgeMetrics.EMPTY);
};
return (new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil((measuredWidth - scale9Grid.right)), Math.ceil((measuredHeight - scale9Grid.bottom))));
}
}
}//package mx.core
Section 42
//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 43
//SoundAsset (mx.core.SoundAsset)
package mx.core {
import flash.media.*;
public class SoundAsset extends Sound implements IFlexAsset {
mx_internal static const VERSION:String = "3.2.0.3958";
}
}//package mx.core
Section 44
//SpriteAsset (mx.core.SpriteAsset)
package mx.core {
public class SpriteAsset extends FlexSprite implements IFlexAsset, IFlexDisplayObject, IBorder {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
public function SpriteAsset(){
_measuredWidth = width;
_measuredHeight = height;
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
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;
}
public function get borderMetrics():EdgeMetrics{
if (scale9Grid == null){
return (EdgeMetrics.EMPTY);
};
return (new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil((measuredWidth - scale9Grid.right)), Math.ceil((measuredHeight - scale9Grid.bottom))));
}
}
}//package mx.core
Section 45
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import mx.core.*;
import flash.display.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var result:String;
var o:DisplayObject;
var s:String;
var indices:Array;
var displayObject = _arg1;
try {
o = displayObject;
while (o != null) {
if (((((o.parent) && (o.stage))) && ((o.parent == o.stage)))){
break;
};
s = o.name;
if ((o is IRepeaterClient)){
indices = IRepeaterClient(o).instanceIndices;
if (indices){
s = (s + (("[" + indices.join("][")) + "]"));
};
};
result = ((result == null)) ? s : ((s + ".") + result);
o = o.parent;
};
} catch(e:SecurityError) {
};
return (result);
}
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 46
//Action (org.flintparticles.common.actions.Action)
package org.flintparticles.common.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.behaviours.*;
public interface Action extends Behaviour {
function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void;
}
}//package org.flintparticles.common.actions
Section 47
//ActionBase (org.flintparticles.common.actions.ActionBase)
package org.flintparticles.common.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public class ActionBase implements Action {
protected var _priority:int;// = 0
public function set priority(_arg1:int):void{
_priority = _arg1;
}
public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
}
public function removedFromEmitter(_arg1:Emitter):void{
}
public function addedToEmitter(_arg1:Emitter):void{
}
public function get priority():int{
return (_priority);
}
}
}//package org.flintparticles.common.actions
Section 48
//Age (org.flintparticles.common.actions.Age)
package org.flintparticles.common.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.energyEasing.*;
public class Age extends ActionBase {
private var _easing:Function;
public function Age(_arg1:Function=null){
if (_arg1 == null){
_easing = Linear.easeNone;
} else {
_easing = _arg1;
};
}
public function set easing(_arg1:Function):void{
_easing = _arg1;
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
_arg2.age = (_arg2.age + _arg3);
if (_arg2.age >= _arg2.lifetime){
_arg2.energy = 0;
_arg2.isDead = true;
} else {
_arg2.energy = _easing(_arg2.age, _arg2.lifetime);
};
}
public function get easing():Function{
return (_easing);
}
}
}//package org.flintparticles.common.actions
Section 49
//Fade (org.flintparticles.common.actions.Fade)
package org.flintparticles.common.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public class Fade extends ActionBase {
private var _endAlpha:Number;
private var _diffAlpha:Number;
public function Fade(_arg1:Number=1, _arg2:Number=0){
priority = -5;
_diffAlpha = (_arg1 - _arg2);
_endAlpha = _arg2;
}
public function get endAlpha():Number{
return (_endAlpha);
}
public function set endAlpha(_arg1:Number):void{
_diffAlpha = ((_endAlpha + _diffAlpha) - _arg1);
_endAlpha = _arg1;
}
public function set startAlpha(_arg1:Number):void{
_diffAlpha = (_arg1 - _endAlpha);
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
var _local4:Number = (_endAlpha + (_diffAlpha * _arg2.energy));
_arg2.color = ((_arg2.color & 0xFFFFFF) | (Math.round((_local4 * 0xFF)) << 24));
}
public function get startAlpha():Number{
return ((_endAlpha + _diffAlpha));
}
}
}//package org.flintparticles.common.actions
Section 50
//Activity (org.flintparticles.common.activities.Activity)
package org.flintparticles.common.activities {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.behaviours.*;
public interface Activity extends Behaviour {
function initialize(_arg1:Emitter):void;
function update(_arg1:Emitter, _arg2:Number):void;
}
}//package org.flintparticles.common.activities
Section 51
//ActivityBase (org.flintparticles.common.activities.ActivityBase)
package org.flintparticles.common.activities {
import org.flintparticles.common.emitters.*;
public class ActivityBase implements Activity {
protected var _priority:int;// = 0
public function set priority(_arg1:int):void{
_priority = _arg1;
}
public function update(_arg1:Emitter, _arg2:Number):void{
}
public function initialize(_arg1:Emitter):void{
}
public function removedFromEmitter(_arg1:Emitter):void{
}
public function addedToEmitter(_arg1:Emitter):void{
}
public function get priority():int{
return (_priority);
}
}
}//package org.flintparticles.common.activities
Section 52
//FrameUpdatable (org.flintparticles.common.activities.FrameUpdatable)
package org.flintparticles.common.activities {
import org.flintparticles.common.emitters.*;
public interface FrameUpdatable {
function frameUpdate(_arg1:Emitter, _arg2:Number):void;
}
}//package org.flintparticles.common.activities
Section 53
//UpdateOnFrame (org.flintparticles.common.activities.UpdateOnFrame)
package org.flintparticles.common.activities {
import org.flintparticles.common.emitters.*;
public class UpdateOnFrame extends ActivityBase {
private var action:FrameUpdatable;
public function UpdateOnFrame(_arg1:FrameUpdatable){
action = _arg1;
}
override public function update(_arg1:Emitter, _arg2:Number):void{
action.frameUpdate(_arg1, _arg2);
}
}
}//package org.flintparticles.common.activities
Section 54
//Behaviour (org.flintparticles.common.behaviours.Behaviour)
package org.flintparticles.common.behaviours {
import org.flintparticles.common.emitters.*;
public interface Behaviour {
function set priority(_arg1:int):void;
function addedToEmitter(_arg1:Emitter):void;
function get priority():int;
function removedFromEmitter(_arg1:Emitter):void;
}
}//package org.flintparticles.common.behaviours
Section 55
//BehaviourArrayUtils (org.flintparticles.common.behaviours.BehaviourArrayUtils)
package org.flintparticles.common.behaviours {
public class BehaviourArrayUtils {
public static function add(_arg1:Array, _arg2:Behaviour):uint{
var _local3:uint = _arg1.length;
var _local4:uint;
while (_local4 < _local3) {
if (Behaviour(_arg1[_local4]).priority < _arg2.priority){
break;
};
_local4++;
};
_arg1.splice(_local4, 0, _arg2);
return ((_local3 + 1));
}
public static function remove(_arg1:Array, _arg2:Behaviour):Boolean{
var _local3:int = _arg1.indexOf(_arg2);
if (_local3 != -1){
_arg1.splice(_local3, 1);
return (true);
};
return (false);
}
public static function removeAt(_arg1:Array, _arg2:uint):Behaviour{
var _local3:Behaviour = (_arg1[_arg2] as Behaviour);
_arg1.splice(_arg2, 1);
return (_local3);
}
public static function containsType(_arg1:Array, _arg2:Class):Boolean{
var _local3:uint = _arg1.length;
var _local4:uint;
while (_local4 < _local3) {
if ((_arg1[_local4] is _arg2)){
return (true);
};
_local4++;
};
return (false);
}
public static function sortArray(_arg1:Array):void{
_arg1.sortOn("priority", Array.NUMERIC);
}
public static function clear(_arg1:Array):void{
_arg1.length = 0;
}
public static function contains(_arg1:Array, _arg2:Behaviour):Boolean{
return (!((_arg1.indexOf(_arg2) == -1)));
}
}
}//package org.flintparticles.common.behaviours
Section 56
//Resetable (org.flintparticles.common.behaviours.Resetable)
package org.flintparticles.common.behaviours {
public interface Resetable {
function reset():void;
}
}//package org.flintparticles.common.behaviours
Section 57
//Blast (org.flintparticles.common.counters.Blast)
package org.flintparticles.common.counters {
import org.flintparticles.common.emitters.*;
public class Blast implements Counter {
private var _done:Boolean;// = false
private var _startCount:uint;
public function Blast(_arg1:uint=0){
_startCount = _arg1;
}
public function updateEmitter(_arg1:Emitter, _arg2:Number):uint{
return (0);
}
public function startEmitter(_arg1:Emitter):uint{
_arg1.dispatchCounterComplete();
return (_startCount);
}
public function resume():void{
}
public function stop():void{
}
public function get startCount():Number{
return (_startCount);
}
public function get complete():Boolean{
return (_done);
}
public function set startCount(_arg1:Number):void{
_startCount = _arg1;
}
}
}//package org.flintparticles.common.counters
Section 58
//Counter (org.flintparticles.common.counters.Counter)
package org.flintparticles.common.counters {
import org.flintparticles.common.emitters.*;
public interface Counter {
function stop():void;
function updateEmitter(_arg1:Emitter, _arg2:Number):uint;
function get complete():Boolean;
function startEmitter(_arg1:Emitter):uint;
function resume():void;
}
}//package org.flintparticles.common.counters
Section 59
//Steady (org.flintparticles.common.counters.Steady)
package org.flintparticles.common.counters {
import org.flintparticles.common.emitters.*;
public class Steady implements Counter {
private var _stop:Boolean;
private var _rateInv:Number;
private var _timeToNext:Number;
private var _rate:Number;
public function Steady(_arg1:Number=0){
_stop = false;
_rate = _arg1;
_rateInv = (1 / _rate);
}
public function get rate():Number{
return (_rate);
}
public function updateEmitter(_arg1:Emitter, _arg2:Number):uint{
if (_stop){
return (0);
};
var _local3:uint;
_timeToNext = (_timeToNext - _arg2);
while (_timeToNext <= 0) {
_local3++;
_timeToNext = (_timeToNext + _rateInv);
};
return (_local3);
}
public function set rate(_arg1:Number):void{
_rate = _arg1;
_rateInv = (1 / _arg1);
}
public function stop():void{
_stop = true;
}
public function startEmitter(_arg1:Emitter):uint{
_timeToNext = _rateInv;
return (0);
}
public function resume():void{
_stop = false;
}
public function get complete():Boolean{
return (false);
}
}
}//package org.flintparticles.common.counters
Section 60
//ZeroCounter (org.flintparticles.common.counters.ZeroCounter)
package org.flintparticles.common.counters {
import org.flintparticles.common.emitters.*;
public class ZeroCounter implements Counter {
public function get complete():Boolean{
return (true);
}
public function stop():void{
}
public function updateEmitter(_arg1:Emitter, _arg2:Number):uint{
return (0);
}
public function startEmitter(_arg1:Emitter):uint{
return (0);
}
public function resume():void{
}
}
}//package org.flintparticles.common.counters
Section 61
//Emitter (org.flintparticles.common.emitters.Emitter)
package org.flintparticles.common.emitters {
import flash.events.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.activities.*;
import org.flintparticles.common.counters.*;
import org.flintparticles.common.events.*;
import org.flintparticles.common.utils.*;
import org.flintparticles.common.behaviours.*;
public class Emitter extends EventDispatcher {
protected var _running:Boolean;// = false
protected var _activities:Array;
protected var _particles:Array;
protected var _initializers:Array;
protected var _dispatchCounterComplete:Boolean;// = false
protected var _counter:Counter;
protected var _started:Boolean;// = false
protected var _actions:Array;
protected var _useInternalTick:Boolean;// = true
protected var _particleFactory:ParticleFactory;
protected var _fixedFrameTime:Number;// = 0
protected var _maximumFrameTime:Number;// = 0.1
public function Emitter(){
_particles = new Array();
_actions = new Array();
_initializers = new Array();
_activities = new Array();
_counter = new ZeroCounter();
}
public function addInitializer(_arg1:Initializer):void{
BehaviourArrayUtils.add(_initializers, _arg1);
_arg1.addedToEmitter(this);
}
public function stop():void{
if (_useInternalTick){
FrameUpdater.instance.removeEventListener(UpdateEvent.UPDATE, updateEventListener);
};
_started = false;
killAllParticles();
}
public function pause():void{
_running = false;
}
public function killAllParticles():void{
var _local1:int = _particles.length;
var _local2:int;
while (_local2 < _local1) {
dispatchEvent(new ParticleEvent(ParticleEvent.PARTICLE_DEAD, _particles[_local2]));
_particleFactory.disposeParticle(_particles[_local2]);
_local2++;
};
_particles.length = 0;
}
public function runAhead(_arg1:Number, _arg2:Number=10):void{
var _local3:Number = _maximumFrameTime;
var _local4:Number = (1 / _arg2);
_maximumFrameTime = _local4;
while (_arg1 > 0) {
_arg1 = (_arg1 - _local4);
update(_local4);
};
_maximumFrameTime = _local3;
}
public function set fixedFrameTime(_arg1:Number):void{
_fixedFrameTime = _arg1;
}
public function get maximumFrameTime():Number{
return (_maximumFrameTime);
}
public function set particles(_arg1:Array):void{
killAllParticles();
addExistingParticles(_arg1, false);
}
public function get useInternalTick():Boolean{
return (_useInternalTick);
}
public function set initializers(_arg1:Array):void{
var _local2:Initializer;
for each (_local2 in _initializers) {
_local2.removedFromEmitter(this);
};
_initializers = _arg1.slice();
BehaviourArrayUtils.sortArray(_initializers);
for each (_local2 in _arg1) {
_local2.addedToEmitter(this);
};
}
public function get particleFactory():ParticleFactory{
return (_particleFactory);
}
private function updateEventListener(_arg1:UpdateEvent):void{
if (_fixedFrameTime){
update(_fixedFrameTime);
} else {
update(_arg1.time);
};
}
protected function createParticle():Particle{
var _local1:Particle = _particleFactory.createParticle();
var _local2:int = _initializers.length;
initParticle(_local1);
var _local3:int;
while (_local3 < _local2) {
Initializer(_initializers[_local3]).initialize(this, _local1);
_local3++;
};
_particles.push(_local1);
dispatchEvent(new ParticleEvent(ParticleEvent.PARTICLE_CREATED, _local1));
return (_local1);
}
public function get particles():Array{
return (_particles);
}
protected function sortParticles():void{
}
public function removeActivity(_arg1:Activity):void{
if (BehaviourArrayUtils.remove(_activities, _arg1)){
_arg1.removedFromEmitter(this);
};
}
public function set maximumFrameTime(_arg1:Number):void{
_maximumFrameTime = _arg1;
}
protected function initParticle(_arg1:Particle):void{
}
public function addAction(_arg1:Action):void{
BehaviourArrayUtils.add(_actions, _arg1);
_arg1.addedToEmitter(this);
}
public function hasInitializerOfType(_arg1:Class):Boolean{
return (BehaviourArrayUtils.containsType(_initializers, _arg1));
}
public function removeInitializer(_arg1:Initializer):void{
if (BehaviourArrayUtils.remove(_initializers, _arg1)){
_arg1.removedFromEmitter(this);
};
}
public function get running():Boolean{
return (_running);
}
public function hasActionOfType(_arg1:Class):Boolean{
return (BehaviourArrayUtils.containsType(_actions, _arg1));
}
public function get fixedFrameTime():Number{
return (_fixedFrameTime);
}
public function set particleFactory(_arg1:ParticleFactory):void{
_particleFactory = _arg1;
}
public function set useInternalTick(_arg1:Boolean):void{
if (_useInternalTick != _arg1){
_useInternalTick = _arg1;
if (_started){
if (_useInternalTick){
FrameUpdater.instance.addEventListener(UpdateEvent.UPDATE, updateEventListener, false, 0, true);
} else {
FrameUpdater.instance.removeEventListener(UpdateEvent.UPDATE, updateEventListener);
};
};
};
}
public function resume():void{
_running = true;
}
public function addActivity(_arg1:Activity):void{
BehaviourArrayUtils.add(_activities, _arg1);
_arg1.addedToEmitter(this);
}
public function get initializers():Array{
return (_initializers);
}
public function addExistingParticles(_arg1:Array, _arg2:Boolean=false):void{
var _local4:int;
var _local5:int;
var _local6:int;
var _local3:int = _arg1.length;
if (_arg2){
_local5 = _initializers.length;
_local6 = 0;
while (_local6 < _local5) {
_local4 = 0;
while (_local4 < _local3) {
Initializer(_initializers[_local6]).initialize(this, _arg1[_local4]);
_local4++;
};
_local6++;
};
};
_local4 = 0;
while (_local4 < _local3) {
_particles.push(_arg1[_local4]);
dispatchEvent(new ParticleEvent(ParticleEvent.PARTICLE_ADDED, _arg1[_local4]));
_local4++;
};
}
public function hasActivityOfType(_arg1:Class):Boolean{
return (BehaviourArrayUtils.containsType(_activities, _arg1));
}
public function set activities(_arg1:Array):void{
var _local2:Activity;
for each (_local2 in _activities) {
_local2.removedFromEmitter(this);
};
_activities = _arg1.slice();
BehaviourArrayUtils.sortArray(_activities);
for each (_local2 in _activities) {
_local2.addedToEmitter(this);
};
}
public function hasInitializer(_arg1:Initializer):Boolean{
return (BehaviourArrayUtils.contains(_initializers, _arg1));
}
public function removeAction(_arg1:Action):void{
if (BehaviourArrayUtils.remove(_actions, _arg1)){
_arg1.removedFromEmitter(this);
};
}
public function hasActivity(_arg1:Activity):Boolean{
return (BehaviourArrayUtils.contains(_activities, _arg1));
}
public function get activities():Array{
return (_activities);
}
public function hasAction(_arg1:Action):Boolean{
return (BehaviourArrayUtils.contains(_actions, _arg1));
}
public function start():void{
if (_useInternalTick){
FrameUpdater.instance.addEventListener(UpdateEvent.UPDATE, updateEventListener, false, 0, true);
};
_started = true;
_running = true;
var _local1:int = _activities.length;
var _local2:int;
while (_local2 < _local1) {
Activity(_activities[_local2]).initialize(this);
_local2++;
};
_local1 = _counter.startEmitter(this);
_local2 = 0;
while (_local2 < _local1) {
createParticle();
_local2++;
};
}
public function update(_arg1:Number):void{
var _local2:int;
var _local3:Particle;
var _local5:Action;
var _local6:int;
var _local7:int;
if (!_running){
return;
};
if (_arg1 > _maximumFrameTime){
_arg1 = _maximumFrameTime;
};
var _local4:int = _counter.updateEmitter(this, _arg1);
_local2 = 0;
while (_local2 < _local4) {
createParticle();
_local2++;
};
sortParticles();
_local4 = _activities.length;
_local2 = 0;
while (_local2 < _local4) {
Activity(_activities[_local2]).update(this, _arg1);
_local2++;
};
if (_particles.length > 0){
_local4 = _actions.length;
_local6 = _particles.length;
_local7 = 0;
while (_local7 < _local4) {
_local5 = _actions[_local7];
_local2 = 0;
while (_local2 < _local6) {
_local3 = _particles[_local2];
_local5.update(this, _local3, _arg1);
_local2++;
};
_local7++;
};
_local2 = _local6;
while (_local2--) {
_local3 = _particles[_local2];
if (_local3.isDead){
dispatchEvent(new ParticleEvent(ParticleEvent.PARTICLE_DEAD, _local3));
_particleFactory.disposeParticle(_local3);
_particles.splice(_local2, 1);
};
};
} else {
dispatchEvent(new EmitterEvent(EmitterEvent.EMITTER_EMPTY));
};
dispatchEvent(new EmitterEvent(EmitterEvent.EMITTER_UPDATED));
if (_dispatchCounterComplete){
_dispatchCounterComplete = false;
dispatchEvent(new EmitterEvent(EmitterEvent.COUNTER_COMPLETE));
};
}
public function set counter(_arg1:Counter):void{
_counter = _arg1;
if (running){
_counter.startEmitter(this);
};
}
public function set actions(_arg1:Array):void{
var _local2:Action;
for each (_local2 in _actions) {
_local2.removedFromEmitter(this);
};
_actions = _arg1.slice();
BehaviourArrayUtils.sortArray(_actions);
for each (_local2 in _arg1) {
_local2.addedToEmitter(this);
};
}
public function dispatchCounterComplete():void{
_dispatchCounterComplete = true;
}
public function get counter():Counter{
return (_counter);
}
public function get actions():Array{
return (_actions);
}
}
}//package org.flintparticles.common.emitters
Section 62
//Linear (org.flintparticles.common.energyEasing.Linear)
package org.flintparticles.common.energyEasing {
public class Linear {
public static function easeOut(_arg1:Number, _arg2:Number):Number{
return ((1 - (_arg1 / _arg2)));
}
public static function easeIn(_arg1:Number, _arg2:Number):Number{
return ((1 - (_arg1 / _arg2)));
}
public static function easeInOut(_arg1:Number, _arg2:Number):Number{
return ((1 - (_arg1 / _arg2)));
}
public static function easeNone(_arg1:Number, _arg2:Number):Number{
return ((1 - (_arg1 / _arg2)));
}
}
}//package org.flintparticles.common.energyEasing
Section 63
//EmitterEvent (org.flintparticles.common.events.EmitterEvent)
package org.flintparticles.common.events {
import flash.events.*;
public class EmitterEvent extends Event {
public static var COUNTER_COMPLETE:String = "counterComplete";
public static var EMITTER_UPDATED:String = "emitterUpdated";
public static var EMITTER_EMPTY:String = "emitterEmpty";
public function EmitterEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
}
}//package org.flintparticles.common.events
Section 64
//ParticleEvent (org.flintparticles.common.events.ParticleEvent)
package org.flintparticles.common.events {
import flash.events.*;
import org.flintparticles.common.particles.*;
public class ParticleEvent extends Event {
public var particle:Particle;
public var otherObject;
public static var PARTICLES_COLLISION:String = "particlesCollision";
public static var PARTICLE_ADDED:String = "particleAdded";
public static var PARTICLE_DEAD:String = "particleDead";
public static var PARTICLE_CREATED:String = "particleCreated";
public function ParticleEvent(_arg1:String, _arg2:Particle=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.particle = _arg2;
}
override public function clone():Event{
var _local1:ParticleEvent = new ParticleEvent(type, particle, bubbles, cancelable);
_local1.otherObject = otherObject;
return (_local1);
}
}
}//package org.flintparticles.common.events
Section 65
//UpdateEvent (org.flintparticles.common.events.UpdateEvent)
package org.flintparticles.common.events {
import flash.events.*;
public class UpdateEvent extends Event {
public var time:Number;
public static var UPDATE:String = "update";
public function UpdateEvent(_arg1:String, _arg2:Number=NaN, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.time = _arg2;
}
override public function clone():Event{
return (new UpdateEvent(type, time, bubbles, cancelable));
}
}
}//package org.flintparticles.common.events
Section 66
//ImageClass (org.flintparticles.common.initializers.ImageClass)
package org.flintparticles.common.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.utils.*;
public class ImageClass extends InitializerBase {
private var _parameters:Array;
private var _imageClass:Class;
public function ImageClass(_arg1:Class=null, ... _args){
_imageClass = _arg1;
_parameters = _args;
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
_arg2.image = construct(_imageClass, _parameters);
}
public function get parameters():Array{
return (_parameters);
}
public function set parameters(_arg1:Array):void{
_parameters = _arg1;
}
public function set imageClass(_arg1:Class):void{
_imageClass = _arg1;
}
public function get imageClass():Class{
return (_imageClass);
}
}
}//package org.flintparticles.common.initializers
Section 67
//ImageClasses (org.flintparticles.common.initializers.ImageClasses)
package org.flintparticles.common.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.utils.*;
public class ImageClasses extends InitializerBase {
private var _mxmlImages:Array;
private var _mxmlWeights:Array;
private var _images:WeightedArray;
public function ImageClasses(_arg1:Array=null, _arg2:Array=null){
_images = new WeightedArray();
if (_arg1 == null){
return;
};
init(_arg1, _arg2);
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
var _local3:Pair = _images.getRandomValue();
_arg2.image = construct(_local3.image, _local3.parameters);
}
public function addImage(_arg1, _arg2:Number=1):void{
var _local3:Array;
var _local4:Class;
if ((_arg1 is Array)){
_local3 = (_arg1 as Array).concat();
_local4 = _local3.shift();
_images.add(new Pair(_local4, _local3), _arg2);
} else {
_images.add(new Pair(_arg1, []), _arg2);
};
}
private function init(_arg1:Array=null, _arg2:Array=null):void{
var _local4:int;
_images.clear();
var _local3:int = _arg1.length;
if (((!((_arg2 == null))) && ((_arg2.length == _local3)))){
_local4 = 0;
while (_local4 < _local3) {
addImage(_arg1[_local4], _arg2[_local4]);
_local4++;
};
} else {
_local4 = 0;
while (_local4 < _local3) {
addImage(_arg1[_local4], 1);
_local4++;
};
};
}
public function set weights(_arg1:Array):void{
if ((((_arg1.length == 1)) && ((_arg1[0] is String)))){
_mxmlWeights = String(_arg1[0]).split(",");
} else {
_mxmlWeights = _arg1;
};
checkStartValues();
}
public function removeImage(_arg1):void{
_images.remove(_arg1);
}
override public function addedToEmitter(_arg1:Emitter):void{
if (_mxmlImages){
init(_mxmlImages, _mxmlWeights);
_mxmlImages = null;
_mxmlWeights = null;
};
}
private function checkStartValues():void{
if (((_mxmlImages) && (_mxmlWeights))){
init(_mxmlImages, _mxmlWeights);
_mxmlImages = null;
_mxmlWeights = null;
};
}
public function set images(_arg1:Array):void{
_mxmlImages = _arg1;
checkStartValues();
}
}
}//package org.flintparticles.common.initializers
class Pair {
private var parameters:Array;
private var image:Class;
private function Pair(_arg1:Class, _arg2:Array){
this.image = _arg1;
this.parameters = _arg2;
}
}
Section 68
//Initializer (org.flintparticles.common.initializers.Initializer)
package org.flintparticles.common.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.behaviours.*;
public interface Initializer extends Behaviour {
function initialize(_arg1:Emitter, _arg2:Particle):void;
}
}//package org.flintparticles.common.initializers
Section 69
//InitializerBase (org.flintparticles.common.initializers.InitializerBase)
package org.flintparticles.common.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public class InitializerBase implements Initializer {
protected var _priority:int;// = 0
public function set priority(_arg1:int):void{
_priority = _arg1;
}
public function initialize(_arg1:Emitter, _arg2:Particle):void{
}
public function removedFromEmitter(_arg1:Emitter):void{
}
public function addedToEmitter(_arg1:Emitter):void{
}
public function get priority():int{
return (_priority);
}
}
}//package org.flintparticles.common.initializers
Section 70
//Lifetime (org.flintparticles.common.initializers.Lifetime)
package org.flintparticles.common.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public class Lifetime extends InitializerBase {
private var _max:Number;
private var _min:Number;
public function Lifetime(_arg1:Number=1.79769313486232E308, _arg2:Number=NaN){
_max = _arg2;
_min = _arg1;
}
public function get lifetime():Number{
return (((_min == _max)) ? _min : ((_max + _min) * 0.5));
}
public function get maxLifetime():Number{
return (_max);
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
if (isNaN(_max)){
_arg2.lifetime = _min;
} else {
_arg2.lifetime = (_min + (Math.random() * (_max - _min)));
};
}
public function set lifetime(_arg1:Number):void{
_max = (_min = _arg1);
}
public function set minLifetime(_arg1:Number):void{
_min = _arg1;
}
public function set maxLifetime(_arg1:Number):void{
_max = _arg1;
}
public function get minLifetime():Number{
return (_min);
}
}
}//package org.flintparticles.common.initializers
Section 71
//ScaleImageInit (org.flintparticles.common.initializers.ScaleImageInit)
package org.flintparticles.common.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public class ScaleImageInit extends InitializerBase {
private var _max:Number;
private var _min:Number;
public function ScaleImageInit(_arg1:Number=1, _arg2:Number=NaN){
_min = _arg1;
if (isNaN(_arg2)){
_max = _min;
} else {
_max = _arg2;
};
}
public function get scale():Number{
return (((_min == _max)) ? _min : ((_max + _min) / 2));
}
public function set maxScale(_arg1:Number):void{
_max = _arg1;
}
public function get maxScale():Number{
return (_max);
}
public function set minScale(_arg1:Number):void{
_min = _arg1;
}
public function set scale(_arg1:Number):void{
_max = (_min = _arg1);
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
if (_max == _min){
_arg2.scale = _min;
} else {
_arg2.scale = (_min + (Math.random() * (_max - _min)));
};
}
public function get minScale():Number{
return (_min);
}
}
}//package org.flintparticles.common.initializers
Section 72
//Particle (org.flintparticles.common.particles.Particle)
package org.flintparticles.common.particles {
import flash.geom.*;
import flash.utils.*;
public class Particle {
public var energy:Number;// = 1
public var lifetime:Number;// = 0
public var scale:Number;// = 1
public var image;// = null
public var color:uint;// = 4294967295
public var collisionRadius:Number;// = 1
private var _colorTransform:ColorTransform;// = null
private var _previousColor:uint;
public var isDead:Boolean;// = false
public var mass:Number;// = 1
private var _dictionary:Dictionary;// = null
public var age:Number;// = 0
public function get dictionary():Dictionary{
if (_dictionary == null){
_dictionary = new Dictionary(true);
};
return (_dictionary);
}
public function get colorTransform():ColorTransform{
if (((!(_colorTransform)) || (!((_previousColor == color))))){
_colorTransform = new ColorTransform((((color >>> 16) & 0xFF) / 0xFF), (((color >>> 8) & 0xFF) / 0xFF), ((color & 0xFF) / 0xFF), (((color >>> 24) & 0xFF) / 0xFF), 0, 0, 0, 0);
_previousColor = color;
};
return (_colorTransform);
}
protected function cloneInto(_arg1:Particle):Particle{
var _local2:Object;
_arg1.color = color;
_arg1.scale = scale;
_arg1.mass = mass;
_arg1.collisionRadius = collisionRadius;
_arg1.lifetime = lifetime;
_arg1.age = age;
_arg1.energy = energy;
_arg1.isDead = isDead;
_arg1.image = image;
if (_dictionary){
_arg1._dictionary = new Dictionary(true);
for (_local2 in _dictionary) {
_arg1._dictionary[_local2] = _dictionary[_local2];
};
};
return (_arg1);
}
public function get alpha():Number{
return ((((color & 4278190080) >>> 24) / 0xFF));
}
public function initialize():void{
color = 4294967295;
scale = 1;
mass = 1;
collisionRadius = 1;
lifetime = 0;
age = 0;
energy = 1;
isDead = false;
image = null;
_dictionary = null;
_colorTransform = null;
}
public function clone(_arg1:ParticleFactory=null):Particle{
var _local2:Particle;
if (_arg1){
_local2 = _arg1.createParticle();
} else {
_local2 = new Particle();
};
return (cloneInto(_local2));
}
}
}//package org.flintparticles.common.particles
Section 73
//ParticleFactory (org.flintparticles.common.particles.ParticleFactory)
package org.flintparticles.common.particles {
public interface ParticleFactory {
function clearAllParticles():void;
function createParticle():Particle;
function disposeParticle(_arg1:Particle):void;
}
}//package org.flintparticles.common.particles
Section 74
//Renderer (org.flintparticles.common.renderers.Renderer)
package org.flintparticles.common.renderers {
import org.flintparticles.common.emitters.*;
public interface Renderer {
function removeEmitter(_arg1:Emitter):void;
function addEmitter(_arg1:Emitter):void;
}
}//package org.flintparticles.common.renderers
Section 75
//SpriteRendererBase (org.flintparticles.common.renderers.SpriteRendererBase)
package org.flintparticles.common.renderers {
import flash.events.*;
import flash.display.*;
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.events.*;
public class SpriteRendererBase extends Sprite implements Renderer {
protected var _emitters:Array;
public function SpriteRendererBase(){
_emitters = new Array();
mouseEnabled = false;
mouseChildren = false;
addEventListener(Event.ADDED_TO_STAGE, addedToStage, false, 0, true);
}
private function particleAdded(_arg1:ParticleEvent):void{
addParticle(_arg1.particle);
if (stage){
stage.invalidate();
};
}
public function set emitters(_arg1:Array):void{
var _local2:Emitter;
for each (_local2 in _emitters) {
removeEmitter(_local2);
};
for each (_local2 in _arg1) {
addEmitter(_local2);
};
}
private function addedToStage(_arg1:Event):void{
if (stage){
stage.invalidate();
};
}
public function get emitters():Array{
return (_emitters);
}
protected function addParticle(_arg1:Particle):void{
}
protected function updateParticles(_arg1:Event):void{
var _local2:Array = new Array();
var _local3:int;
while (_local3 < _emitters.length) {
_local2 = _local2.concat(Emitter(_emitters[_local3]).particles);
_local3++;
};
renderParticles(_local2);
}
protected function emitterUpdated(_arg1:EmitterEvent):void{
if (stage){
stage.invalidate();
};
}
public function removeEmitter(_arg1:Emitter):void{
var _local3:Particle;
var _local2:int;
while (_local2 < _emitters.length) {
if (_emitters[_local2] == _arg1){
_emitters.splice(_local2, 1);
_arg1.removeEventListener(EmitterEvent.EMITTER_UPDATED, emitterUpdated);
_arg1.removeEventListener(ParticleEvent.PARTICLE_CREATED, particleAdded);
_arg1.removeEventListener(ParticleEvent.PARTICLE_ADDED, particleAdded);
_arg1.removeEventListener(ParticleEvent.PARTICLE_DEAD, particleRemoved);
for each (_local3 in _arg1.particles) {
removeParticle(_local3);
};
if (_emitters.length == 0){
removeEventListener(Event.RENDER, updateParticles);
renderParticles([]);
} else {
if (stage){
stage.invalidate();
};
};
return;
};
_local2++;
};
}
protected function renderParticles(_arg1:Array):void{
}
protected function removeParticle(_arg1:Particle):void{
}
private function particleRemoved(_arg1:ParticleEvent):void{
removeParticle(_arg1.particle);
if (stage){
stage.invalidate();
};
}
public function addEmitter(_arg1:Emitter):void{
var _local2:Particle;
_emitters.push(_arg1);
if (stage){
stage.invalidate();
};
_arg1.addEventListener(EmitterEvent.EMITTER_UPDATED, emitterUpdated, false, 0, true);
_arg1.addEventListener(ParticleEvent.PARTICLE_CREATED, particleAdded, false, 0, true);
_arg1.addEventListener(ParticleEvent.PARTICLE_ADDED, particleAdded, false, 0, true);
_arg1.addEventListener(ParticleEvent.PARTICLE_DEAD, particleRemoved, false, 0, true);
for each (_local2 in _arg1.particles) {
addParticle(_local2);
};
if (_emitters.length == 1){
addEventListener(Event.RENDER, updateParticles, false, 0, true);
};
}
}
}//package org.flintparticles.common.renderers
Section 76
//construct (org.flintparticles.common.utils.construct)
package org.flintparticles.common.utils {
public function construct(_arg1:Class, _arg2:Array){
switch (_arg2.length){
case 0:
return (new (_arg1));
case 1:
return (new _arg1(_arg2[0]));
case 2:
return (new _arg1(_arg2[0], _arg2[1]));
case 3:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2]));
case 4:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3]));
case 5:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4]));
case 6:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5]));
case 7:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5], _arg2[6]));
case 8:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5], _arg2[6], _arg2[7]));
case 9:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5], _arg2[6], _arg2[7], _arg2[8]));
case 10:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5], _arg2[6], _arg2[7], _arg2[8], _arg2[9]));
default:
return (null);
};
}
}//package org.flintparticles.common.utils
Section 77
//FrameUpdater (org.flintparticles.common.utils.FrameUpdater)
package org.flintparticles.common.utils {
import flash.events.*;
import flash.display.*;
import org.flintparticles.common.events.*;
import flash.utils.*;
public class FrameUpdater extends EventDispatcher {
private var _shape:Shape;
private var _running:Boolean;// = false
private var _time:Number;
private static var _instance:FrameUpdater;
public function FrameUpdater(){
_shape = new Shape();
}
private function startTimer():void{
_shape.addEventListener(Event.ENTER_FRAME, frameUpdate, false, 0, true);
_time = getTimer();
_running = true;
}
private function stopTimer():void{
_shape.removeEventListener(Event.ENTER_FRAME, frameUpdate);
_running = false;
}
override public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
super.removeEventListener(_arg1, _arg2, _arg3);
if (((_running) && (!(hasEventListener(UpdateEvent.UPDATE))))){
stopTimer();
};
}
override public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
super.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
if (((!(_running)) && (hasEventListener(UpdateEvent.UPDATE)))){
startTimer();
};
}
private function frameUpdate(_arg1:Event):void{
var _local2:int = _time;
_time = getTimer();
var _local3:Number = ((_time - _local2) * 0.001);
dispatchEvent(new UpdateEvent(UpdateEvent.UPDATE, _local3));
}
public static function get instance():FrameUpdater{
if (_instance == null){
_instance = new (FrameUpdater);
};
return (_instance);
}
}
}//package org.flintparticles.common.utils
Section 78
//Maths (org.flintparticles.common.utils.Maths)
package org.flintparticles.common.utils {
public class Maths {
private static const DEGTORAD:Number = 0.0174532925199433;
private static const RADTODEG:Number = 57.2957795130823;
public static function asRadians(_arg1:Number):Number{
return ((_arg1 * DEGTORAD));
}
public static function asDegrees(_arg1:Number):Number{
return ((_arg1 * RADTODEG));
}
}
}//package org.flintparticles.common.utils
Section 79
//WeightedArray (org.flintparticles.common.utils.WeightedArray)
package org.flintparticles.common.utils {
import flash.utils.*;
public class WeightedArray extends Proxy {
private var _values:Array;
private var _totalWeights:Number;
public function WeightedArray(){
_values = new Array();
_totalWeights = 0;
}
public function remove(_arg1):Boolean{
var _local2:uint = _values.length;
while (_local2--) {
if (Pair(_values[_local2]).value == _arg1){
_totalWeights = (_totalWeights - Pair(_values[_local2]).weight);
_values.splice(_local2, 1);
return (true);
};
};
return (false);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(_arg1:int):String{
return ((_arg1 - 1).toString());
}
public function removeAt(_arg1:uint){
var _local2:* = Pair(_values[_arg1]).value;
_totalWeights = (_totalWeights - Pair(_values[_arg1]).weight);
_values.splice(_arg1, 1);
return (_local2);
}
public function add(_arg1, _arg2:Number):uint{
_totalWeights = (_totalWeights + _arg2);
_values.push(new Pair(_arg2, _arg1));
return (_values.length);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
var _local2:int = int(_arg1);
if ((((((_local2 == _arg1)) && ((_local2 < _values.length)))) && (_values[_local2]))){
return (Pair(_values[_local2]).value);
};
return (undefined);
}
public function clear():void{
_values.length = 0;
_totalWeights = 0;
}
public function get totalWeights():Number{
return (_totalWeights);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(_arg1:int):int{
if (_arg1 < _values.length){
return ((_arg1 + 1));
};
return (0);
}
public function get length():uint{
return (_values.length);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:uint = uint(_arg1);
if ((((_local3 == _arg1)) && ((_local3 < _values.length)))){
Pair(_values[_local3]).value = _arg2;
};
}
public function getRandomValue(){
var _local1:Number = (Math.random() * _totalWeights);
var _local2:Number = 0;
var _local3:int = _values.length;
var _local4:int;
while (_local4 < _local3) {
_local2 = (_local2 + Pair(_values[_local4]).weight);
if (_local2 >= _local1){
return (Pair(_values[_local4]).value);
};
_local4++;
};
return (Pair(_values[(_local3 - 1)]).value);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextValue(_arg1:int){
return (Pair(_values[(_arg1 - 1)]).value);
}
public function contains(_arg1):Boolean{
var _local2:uint = _values.length;
while (_local2--) {
if (Pair(_values[_local2]).value == _arg1){
return (true);
};
};
return (false);
}
}
}//package org.flintparticles.common.utils
class Pair {
private var weight:Number;
private var value;
private function Pair(_arg1:Number, _arg2){
this.weight = _arg1;
this.value = _arg2;
}
}
Section 80
//DeathZone (org.flintparticles.twoD.actions.DeathZone)
package org.flintparticles.twoD.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.twoD.zones.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.twoD.particles.*;
public class DeathZone extends ActionBase {
private var _invertZone:Boolean;
private var _zone:Zone2D;
private var p:Particle2D;
private var inside:Boolean;
public function DeathZone(_arg1:Zone2D=null, _arg2:Boolean=false){
priority = -20;
this.zone = _arg1;
this.zoneIsSafe = _arg2;
}
public function get zoneIsSafe():Boolean{
return (_invertZone);
}
public function set zoneIsSafe(_arg1:Boolean):void{
_invertZone = _arg1;
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
p = Particle2D(_arg2);
inside = _zone.contains(p.x, p.y);
if (_invertZone){
if (!inside){
p.isDead = true;
};
} else {
if (inside){
p.isDead = true;
};
};
}
public function get zone():Zone2D{
return (_zone);
}
public function set zone(_arg1:Zone2D):void{
_zone = _arg1;
}
}
}//package org.flintparticles.twoD.actions
Section 81
//Explosion (org.flintparticles.twoD.actions.Explosion)
package org.flintparticles.twoD.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.activities.*;
import org.flintparticles.common.behaviours.*;
import org.flintparticles.twoD.particles.*;
public class Explosion extends ActionBase implements Resetable, FrameUpdatable {
private var _expansionRate:Number;// = 500
private var _radiusChange:Number;// = 0
private var _depth:Number;
private var _power:Number;
private var _radius:Number;// = 0
private var _updateActivity:UpdateOnFrame;
private var _oldRadius:Number;// = 0
private var _epsilonSq:Number;
private var _invDepth:Number;
private var _x:Number;
private var _y:Number;
private static const POWER_FACTOR:Number = 100000;
public function Explosion(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=300, _arg5:Number=10, _arg6:Number=1){
this.power = _arg1;
this.x = _arg2;
this.y = _arg3;
this.expansionRate = _arg4;
this.depth = _arg5;
this.epsilon = _arg6;
}
public function get depth():Number{
return ((_depth * 2));
}
public function get power():Number{
return ((_power / POWER_FACTOR));
}
public function set power(_arg1:Number):void{
_power = (_arg1 * POWER_FACTOR);
}
public function set depth(_arg1:Number):void{
_depth = (_arg1 * 0.5);
_invDepth = (1 / _depth);
}
public function reset():void{
_radius = 0;
_oldRadius = 0;
_radiusChange = 0;
}
public function get x():Number{
return (_x);
}
public function get y():Number{
return (_y);
}
override public function addedToEmitter(_arg1:Emitter):void{
_updateActivity = new UpdateOnFrame(this);
_arg1.addActivity(_updateActivity);
}
public function set y(_arg1:Number):void{
_y = _arg1;
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local4:Particle2D = Particle2D(_arg2);
var _local5:Number = (_local4.x - _x);
var _local6:Number = (_local4.y - _y);
var _local7:Number = ((_local5 * _local5) + (_local6 * _local6));
if (_local7 == 0){
_local7 = 0.02;
_local5 = 0.1;
_local6 = 0.1;
};
var _local8:Number = Math.sqrt(_local7);
if (_local8 < (_oldRadius - _depth)){
return;
};
if (_local8 > (_radius + _depth)){
return;
};
var _local9:Number = ((_local8 < _radius)) ? ((_depth - _radius) + _local8) : ((_depth - _local8) + _radius);
var _local10:Number = ((_local8 < _oldRadius)) ? ((_depth - _oldRadius) + _local8) : ((_depth - _local8) + _oldRadius);
_local9 = (_local9 * _invDepth);
_local10 = (_local10 * _invDepth);
if (_local9 < 0){
_arg3 = ((_arg3 * (_radiusChange + _local9)) / _radiusChange);
_local9 = 0;
};
if (_local10 < 0){
_arg3 = ((_arg3 * (_radiusChange + _local10)) / _radiusChange);
_local10 = 0;
};
if ((((_local8 < _oldRadius)) || ((_local8 > _radius)))){
_local11 = (((_arg3 * _power) * (_local9 + _local10)) / (((_radius * 2) * _local8) * _local4.mass));
} else {
_local12 = ((1 - _local10) / _radiusChange);
_local13 = (((_local12 * _arg3) * _power) * (_local10 + 1));
_local14 = ((((1 - _local12) * _arg3) * _power) * (_local9 + 1));
_local11 = ((_local13 + _local14) / (((_radius * 2) * _local8) * _local4.mass));
};
_local4.velX = (_local4.velX + (_local5 * _local11));
_local4.velY = (_local4.velY + (_local6 * _local11));
}
public function set epsilon(_arg1:Number):void{
_epsilonSq = (_arg1 * _arg1);
}
public function frameUpdate(_arg1:Emitter, _arg2:Number):void{
_oldRadius = _radius;
_radiusChange = (_expansionRate * _arg2);
_radius = (_radius + _radiusChange);
}
override public function removedFromEmitter(_arg1:Emitter):void{
if (_updateActivity){
_arg1.removeActivity(_updateActivity);
};
}
public function get epsilon():Number{
return (Math.sqrt(_epsilonSq));
}
public function set x(_arg1:Number):void{
_x = _arg1;
}
public function set expansionRate(_arg1:Number):void{
_expansionRate = _arg1;
}
public function get expansionRate():Number{
return (_expansionRate);
}
}
}//package org.flintparticles.twoD.actions
Section 82
//Friction (org.flintparticles.twoD.actions.Friction)
package org.flintparticles.twoD.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.twoD.particles.*;
public class Friction extends ActionBase {
private var _friction:Number;
public function Friction(_arg1:Number=0){
this.friction = _arg1;
}
public function set friction(_arg1:Number):void{
_friction = _arg1;
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
var _local6:Number;
var _local4:Particle2D = Particle2D(_arg2);
var _local5:Number = ((_local4.velX * _local4.velX) + (_local4.velY * _local4.velY));
if (_local5 == 0){
return;
};
_local6 = (1 - ((_friction * _arg3) / (Math.sqrt(_local5) * _local4.mass)));
if (_local6 < 0){
_local4.velX = 0;
_local4.velY = 0;
} else {
_local4.velX = (_local4.velX * _local6);
_local4.velY = (_local4.velY * _local6);
};
}
public function get friction():Number{
return (_friction);
}
}
}//package org.flintparticles.twoD.actions
Section 83
//Move (org.flintparticles.twoD.actions.Move)
package org.flintparticles.twoD.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.twoD.particles.*;
public class Move extends ActionBase {
public function Move(){
priority = -10;
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
var _local4:Particle2D = Particle2D(_arg2);
Particle2D(_arg2).previousX = _local4.x;
_local4.previousY = _local4.y;
_local4.x = (_local4.x + (_local4.velX * _arg3));
_local4.y = (_local4.y + (_local4.velY * _arg3));
}
}
}//package org.flintparticles.twoD.actions
Section 84
//RandomDrift (org.flintparticles.twoD.actions.RandomDrift)
package org.flintparticles.twoD.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.twoD.particles.*;
public class RandomDrift extends ActionBase {
private var _sizeX:Number;
private var _sizeY:Number;
public function RandomDrift(_arg1:Number=0, _arg2:Number=0){
this.driftX = _arg1;
this.driftY = _arg2;
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
var _local4:Particle2D;
_local4 = Particle2D(_arg2);
Particle2D(_arg2).velX = (_local4.velX + (((Math.random() - 0.5) * _sizeX) * _arg3));
_local4.velY = (_local4.velY + (((Math.random() - 0.5) * _sizeY) * _arg3));
}
public function get driftY():Number{
return ((_sizeY / 2));
}
public function set driftY(_arg1:Number):void{
_sizeY = (_arg1 * 2);
}
public function set driftX(_arg1:Number):void{
_sizeX = (_arg1 * 2);
}
public function get driftX():Number{
return ((_sizeX / 2));
}
}
}//package org.flintparticles.twoD.actions
Section 85
//Rotate (org.flintparticles.twoD.actions.Rotate)
package org.flintparticles.twoD.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.twoD.particles.*;
public class Rotate extends ActionBase {
public function Rotate(){
priority = -10;
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
var _local4:Particle2D = Particle2D(_arg2);
Particle2D(_arg2).rotation = (_local4.rotation + (_local4.angVelocity * _arg3));
}
}
}//package org.flintparticles.twoD.actions
Section 86
//Emitter2D (org.flintparticles.twoD.emitters.Emitter2D)
package org.flintparticles.twoD.emitters {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.utils.*;
import org.flintparticles.twoD.particles.*;
public class Emitter2D extends Emitter {
protected var _y:Number;// = 0
public var spaceSort:Boolean;// = false
public var spaceSortedX:Array;
protected var _x:Number;// = 0
protected var _rotation:Number;// = 0
protected static var _creator:ParticleCreator2D = new ParticleCreator2D();
public function Emitter2D(){
_particleFactory = _creator;
}
public function get y():Number{
return (_y);
}
override protected function initParticle(_arg1:Particle):void{
var _local2:Particle2D = Particle2D(_arg1);
_local2.x = _x;
_local2.y = _y;
_local2.previousX = _x;
_local2.previousY = _y;
_local2.rotation = _rotation;
}
override protected function sortParticles():void{
var _local1:int;
var _local2:int;
if (spaceSort){
spaceSortedX = _particles.sortOn("x", (Array.NUMERIC | Array.RETURNINDEXEDARRAY));
_local1 = _particles.length;
_local2 = 0;
while (_local2 < _local1) {
Particle2D(_particles[spaceSortedX[_local2]]).sortID = _local2;
_local2++;
};
};
}
public function set x(_arg1:Number):void{
_x = _arg1;
}
public function set rotRadians(_arg1:Number):void{
_rotation = _arg1;
}
public function get x():Number{
return (_x);
}
public function get rotRadians():Number{
return (_rotation);
}
public function set rotation(_arg1:Number):void{
_rotation = Maths.asRadians(_arg1);
}
public function get rotation():Number{
return (Maths.asDegrees(_rotation));
}
public function set y(_arg1:Number):void{
_y = _arg1;
}
public static function get defaultParticleFactory():ParticleFactory{
return (_creator);
}
}
}//package org.flintparticles.twoD.emitters
Section 87
//Position (org.flintparticles.twoD.initializers.Position)
package org.flintparticles.twoD.initializers {
import flash.geom.*;
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.twoD.zones.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.twoD.particles.*;
public class Position extends InitializerBase {
private var _zone:Zone2D;
public function Position(_arg1:Zone2D=null){
this.zone = _arg1;
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
var _local3:Particle2D;
var _local5:Number;
var _local6:Number;
_local3 = Particle2D(_arg2);
var _local4:Point = _zone.getLocation();
if (_local3.rotation == 0){
_local3.x = (_local3.x + _local4.x);
_local3.y = (_local3.y + _local4.y);
} else {
_local5 = Math.sin(_local3.rotation);
_local6 = Math.cos(_local3.rotation);
_local3.x = (_local3.x + ((_local6 * _local4.x) - (_local5 * _local4.y)));
_local3.y = (_local3.y + ((_local6 * _local4.y) + (_local5 * _local4.x)));
};
_local3.previousX = _local3.x;
_local3.previousY = _local3.y;
}
public function set zone(_arg1:Zone2D):void{
_zone = _arg1;
}
public function get zone():Zone2D{
return (_zone);
}
}
}//package org.flintparticles.twoD.initializers
Section 88
//RotateVelocity (org.flintparticles.twoD.initializers.RotateVelocity)
package org.flintparticles.twoD.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.twoD.particles.*;
public class RotateVelocity extends InitializerBase {
private var _max:Number;
private var _min:Number;
public function RotateVelocity(_arg1:Number=0, _arg2:Number=NaN){
this.minAngVelocity = _arg1;
this.maxAngVelocity = _arg2;
}
public function get maxAngVelocity():Number{
return (_max);
}
public function get minAngVelocity():Number{
return (_min);
}
public function set minAngVelocity(_arg1:Number):void{
_min = _arg1;
}
public function set maxAngVelocity(_arg1:Number):void{
_max = _arg1;
}
public function set angVelocity(_arg1:Number):void{
_max = (_min = _arg1);
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
var _local3:Particle2D = Particle2D(_arg2);
if (isNaN(_max)){
_local3.angVelocity = _min;
} else {
_local3.angVelocity = (_min + (Math.random() * (_max - _min)));
};
}
public function get angVelocity():Number{
return (((_min == _max)) ? _min : ((_max + _min) / 2));
}
}
}//package org.flintparticles.twoD.initializers
Section 89
//Rotation (org.flintparticles.twoD.initializers.Rotation)
package org.flintparticles.twoD.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.twoD.particles.*;
public class Rotation extends InitializerBase {
private var _max:Number;
private var _min:Number;
public function Rotation(_arg1:Number=0, _arg2:Number=NaN){
this.minAngle = _arg1;
this.maxAngle = _arg2;
}
public function get minAngle():Number{
return (_min);
}
public function set minAngle(_arg1:Number):void{
_min = _arg1;
}
public function get angle():Number{
return (((_min == _max)) ? _min : ((_max + _min) / 2));
}
public function set angle(_arg1:Number):void{
_max = (_min = _arg1);
}
public function get maxAngle():Number{
return (_max);
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
var _local3:Particle2D = Particle2D(_arg2);
if (isNaN(_max)){
_local3.rotation = (_local3.rotation + _min);
} else {
_local3.rotation = (_local3.rotation + (_min + (Math.random() * (_max - _min))));
};
}
public function set maxAngle(_arg1:Number):void{
_max = _arg1;
}
}
}//package org.flintparticles.twoD.initializers
Section 90
//Velocity (org.flintparticles.twoD.initializers.Velocity)
package org.flintparticles.twoD.initializers {
import flash.geom.*;
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.twoD.zones.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.twoD.particles.*;
public class Velocity extends InitializerBase {
private var _zone:Zone2D;
public function Velocity(_arg1:Zone2D=null){
this.zone = _arg1;
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
var _local5:Number;
var _local6:Number;
var _local3:Particle2D = Particle2D(_arg2);
var _local4:Point = _zone.getLocation();
if (_local3.rotation == 0){
_local3.velX = _local4.x;
_local3.velY = _local4.y;
} else {
_local5 = Math.sin(_local3.rotation);
_local6 = Math.cos(_local3.rotation);
_local3.velX = ((_local6 * _local4.x) - (_local5 * _local4.y));
_local3.velY = ((_local6 * _local4.y) + (_local5 * _local4.x));
};
}
public function set zone(_arg1:Zone2D):void{
_zone = _arg1;
}
public function get zone():Zone2D{
return (_zone);
}
}
}//package org.flintparticles.twoD.initializers
Section 91
//Particle2D (org.flintparticles.twoD.particles.Particle2D)
package org.flintparticles.twoD.particles {
import flash.geom.*;
import org.flintparticles.common.particles.*;
public class Particle2D extends Particle {
public var y:Number;// = 0
public var previousX:Number;// = 0
public var previousY:Number;// = 0
private var _previousRadius:Number;
public var angVelocity:Number;// = 0
public var velX:Number;// = 0
public var velY:Number;// = 0
private var _previousMass:Number;
public var x:Number;// = 0
public var sortID:int;// = -1
private var _inertia:Number;
public var rotation:Number;// = 0
override public function clone(_arg1:ParticleFactory=null):Particle{
var _local2:Particle2D;
if (_arg1){
_local2 = (_arg1.createParticle() as Particle2D);
} else {
_local2 = new Particle2D();
};
cloneInto(_local2);
_local2.x = x;
_local2.y = y;
_local2.velX = velX;
_local2.velY = velY;
_local2.rotation = rotation;
_local2.angVelocity = angVelocity;
return (_local2);
}
override public function initialize():void{
super.initialize();
x = 0;
y = 0;
previousX = 0;
previousY = 0;
velX = 0;
velY = 0;
rotation = 0;
angVelocity = 0;
sortID = -1;
}
public function get matrixTransform():Matrix{
var _local1:Number = (scale * Math.cos(rotation));
var _local2:Number = (scale * Math.sin(rotation));
return (new Matrix(_local1, _local2, -(_local2), _local1, x, y));
}
public function get inertia():Number{
if (((!((mass == _previousMass))) || (!((collisionRadius == _previousRadius))))){
_inertia = (((mass * collisionRadius) * collisionRadius) * 0.5);
_previousMass = mass;
_previousRadius = collisionRadius;
};
return (_inertia);
}
}
}//package org.flintparticles.twoD.particles
Section 92
//ParticleCreator2D (org.flintparticles.twoD.particles.ParticleCreator2D)
package org.flintparticles.twoD.particles {
import org.flintparticles.common.particles.*;
public class ParticleCreator2D implements ParticleFactory {
private var _particles:Array;
public function ParticleCreator2D(){
_particles = new Array();
}
public function clearAllParticles():void{
_particles = new Array();
}
public function disposeParticle(_arg1:Particle):void{
if ((_arg1 is Particle2D)){
_arg1.initialize();
_particles.push(_arg1);
};
}
public function createParticle():Particle{
if (_particles.length){
return (_particles.pop());
};
return (new Particle2D());
}
}
}//package org.flintparticles.twoD.particles
Section 93
//DisplayObjectRenderer (org.flintparticles.twoD.renderers.DisplayObjectRenderer)
package org.flintparticles.twoD.renderers {
import flash.display.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.twoD.particles.*;
import org.flintparticles.common.renderers.*;
public class DisplayObjectRenderer extends SpriteRendererBase {
override protected function removeParticle(_arg1:Particle):void{
removeChild(_arg1.image);
}
override protected function addParticle(_arg1:Particle):void{
var _local2:Particle2D = (_arg1 as Particle2D);
addChildAt(_local2.image, 0);
var _local3:DisplayObject = _local2.image;
_local3.transform.colorTransform = _local2.colorTransform;
_local3.transform.matrix = _local2.matrixTransform;
}
override protected function renderParticles(_arg1:Array):void{
var _local2:Particle2D;
var _local3:DisplayObject;
var _local4:int = _arg1.length;
var _local5:int;
while (_local5 < _local4) {
_local2 = _arg1[_local5];
_local3 = _local2.image;
_local3.transform.colorTransform = _local2.colorTransform;
_local3.transform.matrix = _local2.matrixTransform;
_local5++;
};
}
}
}//package org.flintparticles.twoD.renderers
Section 94
//LineZone (org.flintparticles.twoD.zones.LineZone)
package org.flintparticles.twoD.zones {
import flash.geom.*;
public class LineZone implements Zone2D {
private var _start:Point;
private var _length:Point;
private var _end:Point;
public function LineZone(_arg1:Point=null, _arg2:Point=null){
if (_arg1 == null){
_start = new Point(0, 0);
} else {
_start = _arg1;
};
if (_arg2 == null){
_end = new Point(0, 0);
} else {
_end = _arg2;
};
_length = _end.subtract(_start);
}
public function get start():Point{
return (_start);
}
public function set start(_arg1:Point):void{
_start = _arg1;
_length = _end.subtract(_start);
}
public function set endY(_arg1:Number):void{
_end.y = _arg1;
_length = _end.subtract(_start);
}
public function set startX(_arg1:Number):void{
_start.x = _arg1;
_length = _end.subtract(_start);
}
public function set startY(_arg1:Number):void{
_start.y = _arg1;
_length = _end.subtract(_start);
}
public function getArea():Number{
return (_length.length);
}
public function getLocation():Point{
var _local1:Point = _start.clone();
var _local2:Number = Math.random();
_local1.x = (_local1.x + (_length.x * _local2));
_local1.y = (_local1.y + (_length.y * _local2));
return (_local1);
}
public function get endX():Number{
return (_end.x);
}
public function set end(_arg1:Point):void{
_end = _arg1;
_length = _end.subtract(_start);
}
public function get startY():Number{
return (_start.y);
}
public function set endX(_arg1:Number):void{
_end.x = _arg1;
_length = _end.subtract(_start);
}
public function get end():Point{
return (_end);
}
public function get startX():Number{
return (_start.x);
}
public function get endY():Number{
return (_end.y);
}
public function contains(_arg1:Number, _arg2:Number):Boolean{
if ((((_arg1 - _start.x) * _length.y) - ((_arg2 - _start.y) * _length.x)) != 0){
return (false);
};
return (((((_arg1 - _start.x) * (_arg1 - _end.x)) + ((_arg2 - _start.y) * (_arg2 - _end.y))) <= 0));
}
}
}//package org.flintparticles.twoD.zones
Section 95
//PointZone (org.flintparticles.twoD.zones.PointZone)
package org.flintparticles.twoD.zones {
import flash.geom.*;
public class PointZone implements Zone2D {
private var _point:Point;
public function PointZone(_arg1:Point=null){
if (_arg1 == null){
_point = new Point(0, 0);
} else {
_point = _arg1;
};
}
public function set point(_arg1:Point):void{
_point = _arg1;
}
public function getArea():Number{
return (1);
}
public function getLocation():Point{
return (_point.clone());
}
public function get point():Point{
return (_point);
}
public function set y(_arg1:Number):void{
_point.y = _arg1;
}
public function set x(_arg1:Number):void{
_point.x = _arg1;
}
public function get x():Number{
return (_point.x);
}
public function get y():Number{
return (_point.y);
}
public function contains(_arg1:Number, _arg2:Number):Boolean{
return ((((_point.x == _arg1)) && ((_point.y == _arg2))));
}
}
}//package org.flintparticles.twoD.zones
Section 96
//RectangleZone (org.flintparticles.twoD.zones.RectangleZone)
package org.flintparticles.twoD.zones {
import flash.geom.*;
public class RectangleZone implements Zone2D {
private var _height:Number;
private var _width:Number;
private var _bottom:Number;
private var _right:Number;
private var _top:Number;
private var _left:Number;
public function RectangleZone(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
_left = _arg1;
_top = _arg2;
_right = _arg3;
_bottom = _arg4;
_width = (_arg3 - _arg1);
_height = (_arg4 - _arg2);
}
public function getArea():Number{
return ((_width * _height));
}
public function get top():Number{
return (_top);
}
public function set bottom(_arg1:Number):void{
_bottom = _arg1;
if (((!(isNaN(_top))) && (!(isNaN(_bottom))))){
_height = (bottom - top);
};
}
public function get right():Number{
return (_right);
}
public function set left(_arg1:Number):void{
_left = _arg1;
if (((!(isNaN(_right))) && (!(isNaN(_left))))){
_width = (right - left);
};
}
public function get left():Number{
return (_left);
}
public function set top(_arg1:Number):void{
_top = _arg1;
if (((!(isNaN(_top))) && (!(isNaN(_bottom))))){
_height = (bottom - top);
};
}
public function contains(_arg1:Number, _arg2:Number):Boolean{
return ((((((((_arg1 >= _left)) && ((_arg1 <= _right)))) && ((_arg2 >= _top)))) && ((_arg2 <= _bottom))));
}
public function get bottom():Number{
return (_bottom);
}
public function set right(_arg1:Number):void{
_right = _arg1;
if (((!(isNaN(_right))) && (!(isNaN(_left))))){
_width = (right - left);
};
}
public function getLocation():Point{
return (new Point((_left + (Math.random() * _width)), (_top + (Math.random() * _height))));
}
}
}//package org.flintparticles.twoD.zones
Section 97
//Zone2D (org.flintparticles.twoD.zones.Zone2D)
package org.flintparticles.twoD.zones {
import flash.geom.*;
public interface Zone2D {
function getArea():Number;
function getLocation():Point;
function contains(_arg1:Number, _arg2:Number):Boolean;
}
}//package org.flintparticles.twoD.zones
Section 98
//CoBrandKibaAsset (CoBrandKibaAsset)
package {
import flash.display.*;
public dynamic class CoBrandKibaAsset extends MovieClip {
}
}//package
Section 99
//CoconFontAsset (CoconFontAsset)
package {
import flash.text.*;
public dynamic class CoconFontAsset extends Font {
}
}//package
Section 100
//ColorPalletteBackgroundAsset (ColorPalletteBackgroundAsset)
package {
import flash.display.*;
public dynamic class ColorPalletteBackgroundAsset extends MovieClip {
}
}//package
Section 101
//ColorSlide1Asset (ColorSlide1Asset)
package {
import flash.display.*;
public dynamic class ColorSlide1Asset extends MovieClip {
public var overlay:MovieClip;
}
}//package
Section 102
//ColorSlide2Asset (ColorSlide2Asset)
package {
import flash.display.*;
public dynamic class ColorSlide2Asset extends MovieClip {
public var overlay:MovieClip;
}
}//package
Section 103
//ColorTileColorAsset (ColorTileColorAsset)
package {
import flash.display.*;
public dynamic class ColorTileColorAsset extends MovieClip {
}
}//package
Section 104
//ColorTileOutlineAsset (ColorTileOutlineAsset)
package {
import flash.display.*;
public dynamic class ColorTileOutlineAsset extends MovieClip {
}
}//package
Section 105
//CupboardOpenCloseAsset (CupboardOpenCloseAsset)
package {
import flash.media.*;
public dynamic class CupboardOpenCloseAsset extends Sound {
}
}//package
Section 106
//CursorErasorAsset (CursorErasorAsset)
package {
import flash.display.*;
public dynamic class CursorErasorAsset extends MovieClip {
}
}//package
Section 107
//CursorFillColorAsset (CursorFillColorAsset)
package {
import flash.display.*;
public dynamic class CursorFillColorAsset extends MovieClip {
}
}//package
Section 108
//CursorFillOverlayAsset (CursorFillOverlayAsset)
package {
import flash.display.*;
public dynamic class CursorFillOverlayAsset extends MovieClip {
}
}//package
Section 109
//CursorPaintColorAsset (CursorPaintColorAsset)
package {
import flash.display.*;
public dynamic class CursorPaintColorAsset extends MovieClip {
}
}//package
Section 110
//CursorPaintOverlayAsset (CursorPaintOverlayAsset)
package {
import flash.display.*;
public dynamic class CursorPaintOverlayAsset extends MovieClip {
}
}//package
Section 111
//CursorPencilColorAsset (CursorPencilColorAsset)
package {
import flash.display.*;
public dynamic class CursorPencilColorAsset extends MovieClip {
}
}//package
Section 112
//CursorPencilOverlayAsset (CursorPencilOverlayAsset)
package {
import flash.display.*;
public dynamic class CursorPencilOverlayAsset extends MovieClip {
}
}//package
Section 113
//ErasorNibAsset (ErasorNibAsset)
package {
import flash.display.*;
public dynamic class ErasorNibAsset extends MovieClip {
}
}//package
Section 114
//ForegroundAsset (ForegroundAsset)
package {
import flash.display.*;
public dynamic class ForegroundAsset extends MovieClip {
}
}//package
Section 115
//GameUIButtonBackgroundAsset (GameUIButtonBackgroundAsset)
package {
import flash.display.*;
public dynamic class GameUIButtonBackgroundAsset extends MovieClip {
}
}//package
Section 116
//GameUIButtonHighliterAsset (GameUIButtonHighliterAsset)
package {
import flash.display.*;
public dynamic class GameUIButtonHighliterAsset extends MovieClip {
}
}//package
Section 117
//GameUIErasorAsset (GameUIErasorAsset)
package {
import flash.display.*;
public dynamic class GameUIErasorAsset extends MovieClip {
}
}//package
Section 118
//GameUINextSlideAsset (GameUINextSlideAsset)
package {
import flash.display.*;
public dynamic class GameUINextSlideAsset extends MovieClip {
public function GameUINextSlideAsset(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package
Section 119
//GameUIPainBucketBackgroundAsset (GameUIPainBucketBackgroundAsset)
package {
import flash.display.*;
public dynamic class GameUIPainBucketBackgroundAsset extends MovieClip {
}
}//package
Section 120
//GameUIPaintBackgroundAsset (GameUIPaintBackgroundAsset)
package {
import flash.display.*;
public dynamic class GameUIPaintBackgroundAsset extends MovieClip {
}
}//package
Section 121
//GameUIPaintBucketColorAsset (GameUIPaintBucketColorAsset)
package {
import flash.display.*;
public dynamic class GameUIPaintBucketColorAsset extends MovieClip {
}
}//package
Section 122
//GameUIPaintColorAset (GameUIPaintColorAset)
package {
import flash.display.*;
public dynamic class GameUIPaintColorAset extends MovieClip {
}
}//package
Section 123
//GameUIPencilBackgroundAsset (GameUIPencilBackgroundAsset)
package {
import flash.display.*;
public dynamic class GameUIPencilBackgroundAsset extends MovieClip {
}
}//package
Section 124
//GameUIPencilColorAsset (GameUIPencilColorAsset)
package {
import flash.display.*;
public dynamic class GameUIPencilColorAsset extends MovieClip {
}
}//package
Section 125
//GameUIResetAsset (GameUIResetAsset)
package {
import flash.display.*;
public dynamic class GameUIResetAsset extends MovieClip {
public function GameUIResetAsset(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package
Section 126
//HighlightGlintAsset (HighlightGlintAsset)
package {
import flash.display.*;
public dynamic class HighlightGlintAsset extends MovieClip {
}
}//package
Section 127
//JingleAsset (JingleAsset)
package {
import flash.media.*;
public dynamic class JingleAsset extends Sound {
}
}//package
Section 128
//Main (Main)
package {
import com.drimlike.games.color.data.*;
import flash.display.*;
import com.drimlike.games.color.*;
import com.drimlike.games.sound.*;
import caurina.transitions.properties.*;
import flash.system.*;
public class Main extends Sprite {
private var sandbox:Sandbox;
public function Main(){
ColorShortcuts.init();
init();
}
private function init():void{
languageCheck();
GameData.getInstance().soundManager = new SoundManager();
GameData.getInstance().stageWidth = 728;
GameData.getInstance().stageHeight = 530;
sandbox = new Sandbox();
addChild(sandbox);
}
private function languageCheck():void{
switch (Capabilities.language){
default:
GameData.getInstance().language = GameData.ENGLISH;
break;
case "de":
GameData.getInstance().language = GameData.GERMAN;
break;
case "fr":
GameData.getInstance().language = GameData.FRENCH;
break;
case "es":
GameData.getInstance().language = GameData.SPANISH;
break;
};
}
}
}//package
Section 129
//MyGamesForGirlsCOM (MyGamesForGirlsCOM)
package {
import flash.display.*;
public dynamic class MyGamesForGirlsCOM extends MovieClip {
}
}//package
Section 130
//MyGamesForGirlsDE (MyGamesForGirlsDE)
package {
import flash.display.*;
public dynamic class MyGamesForGirlsDE extends MovieClip {
}
}//package
Section 131
//MyGamesForGirlsFR (MyGamesForGirlsFR)
package {
import flash.display.*;
public dynamic class MyGamesForGirlsFR extends MovieClip {
}
}//package
Section 132
//MyGamesForGirlsSP (MyGamesForGirlsSP)
package {
import flash.display.*;
public dynamic class MyGamesForGirlsSP extends MovieClip {
}
}//package
Section 133
//NextSlideButtonAsset (NextSlideButtonAsset)
package {
import flash.display.*;
public dynamic class NextSlideButtonAsset extends MovieClip {
public var arrow:MovieClip;
}
}//package
Section 134
//OldStyleButtonBackgroundAsset (OldStyleButtonBackgroundAsset)
package {
import flash.display.*;
public dynamic class OldStyleButtonBackgroundAsset extends MovieClip {
}
}//package
Section 135
//OldStyleGlintHighlightAsset (OldStyleGlintHighlightAsset)
package {
import flash.display.*;
public dynamic class OldStyleGlintHighlightAsset extends MovieClip {
}
}//package
Section 136
//OldStyleMouseOverSoundAsset (OldStyleMouseOverSoundAsset)
package {
import flash.media.*;
public dynamic class OldStyleMouseOverSoundAsset extends Sound {
}
}//package
Section 137
//OldStyleMouseOverSoundAsset2 (OldStyleMouseOverSoundAsset2)
package {
import flash.media.*;
public dynamic class OldStyleMouseOverSoundAsset2 extends Sound {
}
}//package
Section 138
//PaintNibAsset (PaintNibAsset)
package {
import flash.display.*;
public dynamic class PaintNibAsset extends MovieClip {
}
}//package
Section 139
//PapAsset (PapAsset)
package {
import flash.media.*;
public dynamic class PapAsset extends Sound {
}
}//package
Section 140
//PencilNibAsset (PencilNibAsset)
package {
import flash.display.*;
public dynamic class PencilNibAsset extends MovieClip {
}
}//package
Section 141
//Preload (Preload)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import caurina.transitions.*;
import org.flintparticles.twoD.zones.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.counters.*;
import flash.utils.*;
import flash.media.*;
import org.flintparticles.twoD.emitters.*;
import flash.text.*;
import org.flintparticles.twoD.renderers.*;
import org.flintparticles.twoD.initializers.*;
import org.flintparticles.twoD.actions.*;
import org.flintparticles.twoD.particles.*;
import flash.net.*;
import flash.system.*;
public class Preload extends MovieClip {
private const TRACKING_KEY:String = "catColoring";
private var PlaySPData:Class;
private var channel:SoundChannel;
private var emitter2:Emitter2D;
private var emitter3:Emitter2D;
private var loadingText:TextField;
private var sound:Sound;
private var MyGames4GirlsCOMData:Class;
private var emitter1:Emitter2D;
private var BackgroundData:Class;
private var LoadingBarData:Class;
private var cobrand:Sprite;
private var MyGames4GirlsCOMGlintData:Class;
private var CoBrandData:Class;
private var MyGames4GirlsDEGlintData:Class;
private var titleHittest:Sprite;
private var loadText:TextField;
private var background:Sprite;
private var LoadingBarHolderData:Class;
private var loadingBar:Sprite;
private var MyGames4GirlsSPData:Class;
private var PlayDEData:Class;
private var loadingBarHolder:Sprite;
private var PlayENData:Class;
private var MyGames4GirlsFRGlintData:Class;
private var MyGames4GirlsSPGlintData:Class;
private var isCoBranded:Boolean;// = false
private var Glint:Class;
private var girls:Sprite;
private var title:Sprite;
private var BurstData:Class;
private var render1:DisplayObjectRenderer;
private var urlString:String;
private var render2:DisplayObjectRenderer;
private var Stars1Data:Class;
private var glint:MovieClip;
private var GirlsHeadsData:Class;
private var PlayFRData:Class;
private var titleGlint:MovieClip;
private var MyGames4GirlsFRData:Class;
private var MyGames4GirlsDEData:Class;
private var buttonText:Sprite;
public function Preload(){
var _local8:Boolean;
var _local9:String;
var _local10:LocalConnection;
var _local11:String;
var _local14:String;
var _local15:String;
var _local16:Number;
MyGames4GirlsCOMData = Preload_MyGames4GirlsCOMData;
MyGames4GirlsDEData = Preload_MyGames4GirlsDEData;
MyGames4GirlsFRData = Preload_MyGames4GirlsFRData;
MyGames4GirlsSPData = Preload_MyGames4GirlsSPData;
MyGames4GirlsCOMGlintData = Preload_MyGames4GirlsCOMGlintData;
MyGames4GirlsDEGlintData = Preload_MyGames4GirlsDEGlintData;
MyGames4GirlsFRGlintData = Preload_MyGames4GirlsFRGlintData;
MyGames4GirlsSPGlintData = Preload_MyGames4GirlsSPGlintData;
BackgroundData = Preload_BackgroundData;
GirlsHeadsData = Preload_GirlsHeadsData;
LoadingBarHolderData = Preload_LoadingBarHolderData;
LoadingBarData = Preload_LoadingBarData;
PlayDEData = Preload_PlayDEData;
PlayENData = Preload_PlayENData;
PlayFRData = Preload_PlayFRData;
PlaySPData = Preload_PlaySPData;
Glint = Preload_Glint;
BurstData = Preload_BurstData;
Stars1Data = Preload_Stars1Data;
CoBrandData = Preload_CoBrandData;
super();
stop();
stage.scaleMode = StageScaleMode.SHOW_ALL;
stage.align = StageAlign.TOP_LEFT;
background = (new BackgroundData() as Sprite);
addChild(background);
emitter1 = new Emitter2D();
emitter1.counter = new Steady(20);
emitter1.addInitializer(new ImageClass(Stars1Data));
var _local1:LineZone = new LineZone(new Point(110, 150), new Point(590, 150));
var _local2:Position = new Position(_local1);
var _local3:Lifetime = new Lifetime(4, 8);
var _local4:Rotation = new Rotation(0, 360);
emitter1.addInitializer(_local3);
emitter1.addInitializer(_local2);
emitter1.addInitializer(_local4);
emitter1.addInitializer(new Velocity(new PointZone(new Point(10, 10))));
emitter1.addInitializer(new ScaleImageInit(0.25, 1));
emitter1.addAction(new Move());
emitter1.addAction(new RandomDrift(15, 15));
emitter1.addAction(new Age());
emitter1.addAction(new Rotate());
render1 = new DisplayObjectRenderer();
addChild(render1);
render1.addEmitter(emitter1);
emitter1.start();
emitter1.runAhead(10);
emitter2 = new Emitter2D();
emitter2.counter = new Blast(100);
emitter2.addInitializer(new ImageClass(Stars1Data));
var _local5:RectangleZone = new RectangleZone((364 - 125), (390 - 25), (364 + 125), (390 + 25));
_local2 = new Position(_local5);
_local3 = new Lifetime(1.6, 2.4);
emitter2.addInitializer(_local3);
emitter2.addInitializer(_local2);
emitter2.addInitializer(_local4);
emitter2.addInitializer(new Velocity(new PointZone(new Point(0, 0))));
emitter2.addInitializer(new ScaleImageInit(0.25, 1));
emitter2.addAction(new Move());
emitter2.addAction(new RandomDrift(0, 0));
emitter2.addAction(new Age());
emitter2.addAction(new Rotate());
emitter2.addAction(new Explosion(0.5, 364, 390));
emitter3 = new Emitter2D();
emitter3.counter = new Steady(20);
emitter3.addInitializer(new ImageClass(Stars1Data));
_local1 = new LineZone(new Point((364 - 150), 280), new Point((364 + 150), 280));
_local2 = new Position(_local1);
_local3 = new Lifetime(4, 7);
_local4 = new Rotation(0, 360);
emitter3.addInitializer(_local3);
emitter3.addInitializer(_local2);
emitter3.addInitializer(_local4);
emitter3.addInitializer(new Velocity(new PointZone(new Point(10, 10))));
emitter3.addInitializer(new ScaleImageInit(0.25, 1));
emitter3.addAction(new Move());
emitter3.addAction(new RandomDrift(15, 15));
emitter3.addAction(new Age());
emitter3.addAction(new Rotate());
render2 = new DisplayObjectRenderer();
addChild(render2);
render2.addEmitter(emitter3);
emitter3.start();
emitter3.runAhead(10);
var _local6:Array = new Array("jeux2filles.fr", "juegosxachicas.com", "mygames4girls.de", "mygames4girls.com", "drimlike.com");
var _local7:String = loaderInfo.url;
for each (_local9 in _local6) {
_local14 = _local9.toLowerCase();
_local15 = _local7.toLowerCase();
_local16 = _local15.indexOf(_local14, 0);
if (_local16 != -1){
_local8 = true;
};
};
_local10 = new LocalConnection();
_local11 = _local10.domain;
switch (Capabilities.language){
case "fr":
title = (new MyGames4GirlsFRData() as Sprite);
if (_local8){
urlString = "http://www.jeux2filles.fr";
} else {
urlString = ((("http://www.jeux2filles.fr/?utm_source=" + _local11) + "&utm_medium=our_games&utm_campaign=") + TRACKING_KEY);
};
titleGlint = (new MyGames4GirlsFRGlintData() as MovieClip);
buttonText = (new PlayFRData() as Sprite);
break;
case "es":
title = (new MyGames4GirlsSPData() as Sprite);
if (_local8){
urlString = "http://www.juegosxachicas.com";
} else {
urlString = ((("http://www.juegosxachicas.com/?utm_source=" + _local11) + "&utm_medium=our_games&utm_campaign=") + TRACKING_KEY);
};
titleGlint = (new MyGames4GirlsSPGlintData() as MovieClip);
buttonText = (new PlaySPData() as Sprite);
break;
case "de":
title = (new MyGames4GirlsDEData() as Sprite);
if (_local8){
urlString = "http://www.mygames4girls.de";
} else {
urlString = ((("http://www.mygames4girls.de/?utm_source=" + _local11) + "&utm_medium=our_games&utm_campaign=") + TRACKING_KEY);
};
titleGlint = (new MyGames4GirlsDEGlintData() as MovieClip);
buttonText = (new PlayDEData() as Sprite);
break;
default:
title = (new MyGames4GirlsCOMData() as Sprite);
if (_local8){
urlString = "http://www.mygames4girls.com";
} else {
urlString = ((("http://www.mygames4girls.com/?utm_source=" + _local11) + "&utm_medium=our_games&utm_campaign=") + TRACKING_KEY);
};
titleGlint = (new MyGames4GirlsCOMGlintData() as MovieClip);
buttonText = (new PlayENData() as Sprite);
break;
};
title.x = 362;
title.y = 147;
title.mouseEnabled = false;
title.mouseChildren = false;
addChild(title);
titleGlint.x = 362;
titleGlint.y = 147;
titleGlint.mouseEnabled = false;
titleGlint.mouseChildren = false;
addChild(titleGlint);
titleHittest = new Sprite();
titleHittest.x = title.x;
titleHittest.y = title.y;
titleHittest.graphics.beginFill(0xFFFFFF, 0);
titleHittest.graphics.drawRect((-(title.width) / 2), (-(title.height) / 2), title.width, title.height);
titleHittest.buttonMode = true;
titleHittest.useHandCursor = true;
titleHittest.addEventListener(MouseEvent.CLICK, onTitleClick);
titleHittest.addEventListener(MouseEvent.ROLL_OVER, onTitleRollOver);
titleHittest.addEventListener(MouseEvent.ROLL_OUT, onTitleRollOut);
addChildAt(titleHittest, 1);
girls = (new GirlsHeadsData() as Sprite);
girls.x = 362;
girls.y = 288;
girls.buttonMode = true;
girls.useHandCursor = true;
girls.addEventListener(MouseEvent.CLICK, onTitleClick);
addChild(girls);
var _local12:DisplayObjectRenderer = new DisplayObjectRenderer();
addChild(_local12);
_local12.addEmitter(emitter2);
loadingBarHolder = (new LoadingBarHolderData() as Sprite);
loadingBarHolder.x = 194;
loadingBarHolder.y = 363;
addChild(loadingBarHolder);
loadingBar = (new LoadingBarData() as Sprite);
loadingBar.x = (loadingBarHolder.x + 6);
loadingBar.y = (loadingBarHolder.y + 6);
loadingBar.width = 1;
addChild(loadingBar);
var _local13:TextFormat = new TextFormat();
_local13.font = "Trebuchet MS";
_local13.bold = true;
_local13.size = 13;
_local13.color = 0xFFFFFF;
loadingText = new TextField();
loadingText.defaultTextFormat = _local13;
loadingText.x = loadingBar.x;
loadingText.y = (loadingBar.y - 3);
loadingText.autoSize = TextFieldAutoSize.LEFT;
loadingText.text = "";
addChild(loadingText);
if (isCoBranded){
cobrand = new CoBrandKibaAsset();
cobrand.scaleX = (cobrand.scaleY = 0.8);
cobrand.x = 5;
cobrand.y = 5;
cobrand.useHandCursor = true;
cobrand.buttonMode = true;
cobrand.addEventListener(MouseEvent.CLICK, onCoBrandClick);
addChild(cobrand);
};
sound = (new BurstData() as Sound);
channel = sound.play(0);
channel.stop();
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onTitleRollOut(_arg1:MouseEvent):void{
Tweener.addTween(title, {scaleX:1, scaleY:1, time:0.5, transition:"easeOutExpo"});
}
private function onButtonMouseOver(_arg1:MouseEvent):void{
glint.gotoAndPlay(1);
}
private function onEnterFrame(_arg1:Event):void{
trace("enter frame");
var _local2:int = Math.round(((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal) * 100));
var _local3:int = ((loadingBarHolder.width - 12) / 100);
loadingBar.width = (_local2 * _local3);
if (this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal){
loadingBar.width = (loadingBarHolder.width - 12);
loadingText.visible = false;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
convertToButton();
};
if (loadingText != null){
if (_local2 > 10){
loadingText.x = ((loadingBar.width + loadingBar.x) - 40);
};
loadingText.text = (String(_local2) + "%");
};
}
private function onButtonMouseClick(_arg1:MouseEvent):void{
nextFrame();
var _local2:Class = (getDefinitionByName("Main") as Class);
addChild((new (_local2) as DisplayObject));
emitter1.stop();
emitter2.stop();
emitter3.stop();
ParticleCreator2D(emitter1.particleFactory).clearAllParticles();
ParticleCreator2D(emitter2.particleFactory).clearAllParticles();
ParticleCreator2D(emitter3.particleFactory).clearAllParticles();
render1.removeEmitter(emitter1);
render1.removeEmitter(emitter2);
render2.removeEmitter(emitter3);
removeChild(render1);
removeChild(render2);
removeChild(title);
removeChild(girls);
removeChild(loadingBar);
removeChild(loadingBarHolder);
removeChild(background);
removeChild(buttonText);
removeChild(loadingText);
removeChild(glint);
removeChild(titleGlint);
title = null;
girls = null;
loadingBar = null;
loadingBarHolder = null;
background = null;
buttonText = null;
loadingText = null;
glint = null;
render1 = null;
render2 = null;
titleGlint = null;
emitter1 = null;
emitter2 = null;
emitter3 = null;
}
private function addGlint():void{
channel = sound.play(0, 0);
emitter2.start();
glint = (new Glint() as MovieClip);
glint.gotoAndStop(0);
glint.x = (728 / 2);
glint.y = (loadingBar.y + 25);
glint.mouseEnabled = false;
glint.mouseChildren = false;
addChild(glint);
}
private function onTitleRollOver(_arg1:MouseEvent):void{
Tweener.addTween(title, {scaleX:1.1, scaleY:1.1, time:0.5, transition:"easeOutExpo"});
}
private function onCoBrandClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.kibagames.com/"), "_blank");
}
private function onTitleClick(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest(urlString);
navigateToURL(_local2, "_blank");
}
private function convertToButton():void{
Tweener.addTween(loadingBarHolder, {width:262, x:232, height:60, time:1, transition:"easeOutElastic"});
Tweener.addTween(loadingBar, {width:250, x:238, height:48, time:1, transition:"easeOutElastic", onComplete:addGlint()});
loadingBarHolder.mouseEnabled = false;
loadingBarHolder.mouseChildren = false;
loadingBar.buttonMode = true;
loadingBar.useHandCursor = true;
loadingBar.addEventListener(MouseEvent.MOUSE_OVER, onButtonMouseOver);
loadingBar.addEventListener(MouseEvent.MOUSE_OUT, onButtonMouseOut);
loadingBar.addEventListener(MouseEvent.CLICK, onButtonMouseClick);
buttonText.x = 364;
buttonText.y = loadingBar.y;
buttonText.alpha = 0;
buttonText.mouseEnabled = false;
buttonText.mouseChildren = false;
addChild(buttonText);
Tweener.addTween(buttonText, {y:(buttonText.y + 25), time:0.5, alpha:1, transition:"easeOutExpo"});
}
private function onButtonMouseOut(_arg1:MouseEvent):void{
if (glint != null){
glint.gotoAndStop(0);
};
}
}
}//package
Section 142
//Preload_BackgroundData (Preload_BackgroundData)
package {
import mx.core.*;
public class Preload_BackgroundData extends SpriteAsset {
}
}//package
Section 143
//Preload_BurstData (Preload_BurstData)
package {
import mx.core.*;
public class Preload_BurstData extends SoundAsset {
}
}//package
Section 144
//Preload_CoBrandData (Preload_CoBrandData)
package {
import mx.core.*;
public class Preload_CoBrandData extends SpriteAsset {
}
}//package
Section 145
//Preload_GirlsHeadsData (Preload_GirlsHeadsData)
package {
import mx.core.*;
public class Preload_GirlsHeadsData extends SpriteAsset {
}
}//package
Section 146
//Preload_Glint (Preload_Glint)
package {
import mx.core.*;
public class Preload_Glint extends MovieClipAsset {
}
}//package
Section 147
//Preload_LoadingBarData (Preload_LoadingBarData)
package {
import mx.core.*;
public class Preload_LoadingBarData extends SpriteAsset {
}
}//package
Section 148
//Preload_LoadingBarHolderData (Preload_LoadingBarHolderData)
package {
import mx.core.*;
public class Preload_LoadingBarHolderData extends SpriteAsset {
}
}//package
Section 149
//Preload_MyGames4GirlsCOMData (Preload_MyGames4GirlsCOMData)
package {
import mx.core.*;
public class Preload_MyGames4GirlsCOMData extends SpriteAsset {
}
}//package
Section 150
//Preload_MyGames4GirlsCOMGlintData (Preload_MyGames4GirlsCOMGlintData)
package {
import mx.core.*;
public class Preload_MyGames4GirlsCOMGlintData extends MovieClipAsset {
}
}//package
Section 151
//Preload_MyGames4GirlsDEData (Preload_MyGames4GirlsDEData)
package {
import mx.core.*;
public class Preload_MyGames4GirlsDEData extends SpriteAsset {
}
}//package
Section 152
//Preload_MyGames4GirlsDEGlintData (Preload_MyGames4GirlsDEGlintData)
package {
import mx.core.*;
public class Preload_MyGames4GirlsDEGlintData extends MovieClipAsset {
}
}//package
Section 153
//Preload_MyGames4GirlsFRData (Preload_MyGames4GirlsFRData)
package {
import mx.core.*;
public class Preload_MyGames4GirlsFRData extends SpriteAsset {
}
}//package
Section 154
//Preload_MyGames4GirlsFRGlintData (Preload_MyGames4GirlsFRGlintData)
package {
import mx.core.*;
public class Preload_MyGames4GirlsFRGlintData extends MovieClipAsset {
}
}//package
Section 155
//Preload_MyGames4GirlsSPData (Preload_MyGames4GirlsSPData)
package {
import mx.core.*;
public class Preload_MyGames4GirlsSPData extends SpriteAsset {
}
}//package
Section 156
//Preload_MyGames4GirlsSPGlintData (Preload_MyGames4GirlsSPGlintData)
package {
import mx.core.*;
public class Preload_MyGames4GirlsSPGlintData extends MovieClipAsset {
}
}//package
Section 157
//Preload_PlayDEData (Preload_PlayDEData)
package {
import mx.core.*;
public class Preload_PlayDEData extends SpriteAsset {
}
}//package
Section 158
//Preload_PlayENData (Preload_PlayENData)
package {
import mx.core.*;
public class Preload_PlayENData extends SpriteAsset {
}
}//package
Section 159
//Preload_PlayFRData (Preload_PlayFRData)
package {
import mx.core.*;
public class Preload_PlayFRData extends SpriteAsset {
}
}//package
Section 160
//Preload_PlaySPData (Preload_PlaySPData)
package {
import mx.core.*;
public class Preload_PlaySPData extends SpriteAsset {
}
}//package
Section 161
//Preload_Stars1Data (Preload_Stars1Data)
package {
import mx.core.*;
public class Preload_Stars1Data extends SpriteAsset {
}
}//package
Section 162
//SectionClickAsset (SectionClickAsset)
package {
import flash.media.*;
public dynamic class SectionClickAsset extends Sound {
}
}//package
Section 163
//SoundOff (SoundOff)
package {
import flash.display.*;
public dynamic class SoundOff extends MovieClip {
}
}//package
Section 164
//SoundOn (SoundOn)
package {
import flash.display.*;
public dynamic class SoundOn extends MovieClip {
}
}//package
Section 165
//Star10Asset (Star10Asset)
package {
import flash.display.*;
public dynamic class Star10Asset extends MovieClip {
}
}//package
Section 166
//Star4Asset (Star4Asset)
package {
import flash.display.*;
public dynamic class Star4Asset extends MovieClip {
}
}//package
Section 167
//Star5Asset (Star5Asset)
package {
import flash.display.*;
public dynamic class Star5Asset extends MovieClip {
}
}//package
Section 168
//Star6Asset (Star6Asset)
package {
import flash.display.*;
public dynamic class Star6Asset extends MovieClip {
}
}//package
Section 169
//Star7Asset (Star7Asset)
package {
import flash.display.*;
public dynamic class Star7Asset extends MovieClip {
}
}//package
Section 170
//Star8Asset (Star8Asset)
package {
import flash.display.*;
public dynamic class Star8Asset extends MovieClip {
}
}//package
Section 171
//Star9Asset (Star9Asset)
package {
import flash.display.*;
public dynamic class Star9Asset extends MovieClip {
}
}//package
Section 172
//ThemeTuneAsset (ThemeTuneAsset)
package {
import flash.media.*;
public dynamic class ThemeTuneAsset extends Sound {
}
}//package
Section 173
//TinkleSoundAsset (TinkleSoundAsset)
package {
import flash.media.*;
public dynamic class TinkleSoundAsset extends Sound {
}
}//package
Section 174
//XMLFeedButton (XMLFeedButton)
package {
import flash.display.*;
public dynamic class XMLFeedButton extends MovieClip {
}
}//package
Section 175
//XMLFeedHighlight (XMLFeedHighlight)
package {
import flash.display.*;
public dynamic class XMLFeedHighlight extends MovieClip {
}
}//package
Section 176
//XMLFeedIcon (XMLFeedIcon)
package {
import flash.display.*;
public dynamic class XMLFeedIcon extends MovieClip {
}
}//package