Section 1
//ColorShortcuts (caurina.transitions.properties.ColorShortcuts)
package caurina.transitions.properties {
import caurina.transitions.*;
import flash.geom.*;
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(){
super();
trace("This is an static class and should not be instantiated.");
}
public static function _color_splitter(p_value, p_parameters:Array):Array{
var nArray:Array = new Array();
if (p_value == null){
nArray.push({name:"_color_redMultiplier", value:1});
nArray.push({name:"_color_redOffset", value:0});
nArray.push({name:"_color_greenMultiplier", value:1});
nArray.push({name:"_color_greenOffset", value:0});
nArray.push({name:"_color_blueMultiplier", value:1});
nArray.push({name:"_color_blueOffset", value:0});
} else {
nArray.push({name:"_color_redMultiplier", value:0});
nArray.push({name:"_color_redOffset", value:AuxFunctions.numberToR(p_value)});
nArray.push({name:"_color_greenMultiplier", value:0});
nArray.push({name:"_color_greenOffset", value:AuxFunctions.numberToG(p_value)});
nArray.push({name:"_color_blueMultiplier", value:0});
nArray.push({name:"_color_blueOffset", value:AuxFunctions.numberToB(p_value)});
};
return (nArray);
}
public static function _contrast_set(p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object=null):void{
var mc:Number;
var co:Number;
mc = (p_value + 1);
co = Math.round((p_value * -128));
var cfm:ColorTransform = new ColorTransform(mc, mc, mc, 1, co, co, co, 0);
p_obj.transform.colorTransform = cfm;
}
public static function _brightness_get(p_obj:Object, p_parameters:Array, p_extra:Object=null):Number{
var isTint:Boolean = p_parameters[0];
var cfm:ColorTransform = p_obj.transform.colorTransform;
var mc:Number = (1 - (((cfm.redMultiplier + cfm.greenMultiplier) + cfm.blueMultiplier) / 3));
var co:Number = (((cfm.redOffset + cfm.greenOffset) + cfm.blueOffset) / 3);
if (isTint){
return (((co > 0)) ? (co / 0xFF) : -(mc));
//unresolved jump
};
return ((co / 100));
}
public static function _saturation_get(p_obj:Object, p_parameters:Array, p_extra:Object=null):Number{
var mtx:Array = getObjectMatrix(p_obj);
var isDumb:Boolean = p_parameters[0];
var rl:Number = (isDumb) ? (1 / 3) : LUMINANCE_R;
var gl:Number = (isDumb) ? (1 / 3) : LUMINANCE_G;
var bl:Number = (isDumb) ? (1 / 3) : LUMINANCE_B;
var mc:Number = (((((mtx[0] - rl) / (1 - rl)) + ((mtx[6] - gl) / (1 - gl))) + ((mtx[12] - bl) / (1 - bl))) / 3);
var cc:Number = (1 - (((((((mtx[1] / gl) + (mtx[2] / bl)) + (mtx[5] / rl)) + (mtx[7] / bl)) + (mtx[10] / rl)) + (mtx[11] / gl)) / 6));
return (((mc + cc) / 2));
}
public static function _oldColor_property_get(p_obj:Object, p_parameters:Array, p_extra:Object=null):Number{
return ((p_obj.transform.colorTransform[p_parameters[0]] * 100));
}
public static function _brightness_set(p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object=null):void{
var mc:Number;
var co:Number;
var isTint:Boolean = p_parameters[0];
if (isTint){
mc = (1 - Math.abs(p_value));
co = ((p_value > 0)) ? Math.round((p_value * 0xFF)) : 0;
} else {
mc = 1;
co = Math.round((p_value * 100));
};
var cfm:ColorTransform = new ColorTransform(mc, mc, mc, 1, co, co, co, 0);
p_obj.transform.colorTransform = cfm;
}
public static function _saturation_set(p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object=null):void{
var isDumb:Boolean = p_parameters[0];
var rl:Number = (isDumb) ? (1 / 3) : LUMINANCE_R;
var gl:Number = (isDumb) ? (1 / 3) : LUMINANCE_G;
var bl:Number = (isDumb) ? (1 / 3) : LUMINANCE_B;
var sf:Number = p_value;
var nf:Number = (1 - sf);
var nr:Number = (rl * nf);
var ng:Number = (gl * nf);
var nb:Number = (bl * nf);
var mtx:Array = [(nr + sf), ng, nb, 0, 0, nr, (ng + sf), nb, 0, 0, nr, ng, (nb + sf), 0, 0, 0, 0, 0, 1, 0];
setObjectMatrix(p_obj, mtx);
}
private static function getObjectMatrix(p_obj:Object):Array{
var i:Number = 0;
while (i < p_obj.filters.length) {
if ((p_obj.filters[i] is ColorMatrixFilter)){
return (p_obj.filters[i].matrix.concat());
};
i++;
};
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(mtx1:Array, mtx2:Array):Number{
return (((Math.abs((mtx1[0] - mtx2[0])) + Math.abs((mtx1[1] - mtx2[1]))) + Math.abs((mtx1[2] - mtx2[2]))));
}
public static function _hue_set(p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object=null):void{
setObjectMatrix(p_obj, getHueMatrix(p_value));
}
public static function _hue_get(p_obj:Object, p_parameters:Array, p_extra:Object=null):Number{
var i:Number;
var angleToSplit:Number;
var mtx:Array = getObjectMatrix(p_obj);
var hues:Array = [];
hues[0] = {angle:-179.9, matrix:getHueMatrix(-179.9)};
hues[1] = {angle:180, matrix:getHueMatrix(180)};
i = 0;
while (i < hues.length) {
hues[i].distance = getHueDistance(mtx, hues[i].matrix);
i++;
};
var maxTries:Number = 15;
i = 0;
while (i < maxTries) {
if (hues[0].distance < hues[1].distance){
angleToSplit = 1;
} else {
angleToSplit = 0;
};
hues[angleToSplit].angle = ((hues[0].angle + hues[1].angle) / 2);
hues[angleToSplit].matrix = getHueMatrix(hues[angleToSplit].angle);
hues[angleToSplit].distance = getHueDistance(mtx, hues[angleToSplit].matrix);
i++;
};
return (hues[angleToSplit].angle);
}
public static function getHueMatrix(hue:Number):Array{
var ha:Number = ((hue * Math.PI) / 180);
var rl:Number = LUMINANCE_R;
var gl:Number = LUMINANCE_G;
var bl:Number = LUMINANCE_B;
var c:Number = Math.cos(ha);
var s:Number = Math.sin(ha);
var mtx:Array = [((rl + (c * (1 - rl))) + (s * -(rl))), ((gl + (c * -(gl))) + (s * -(gl))), ((bl + (c * -(bl))) + (s * (1 - bl))), 0, 0, ((rl + (c * -(rl))) + (s * 0.143)), ((gl + (c * (1 - gl))) + (s * 0.14)), ((bl + (c * -(bl))) + (s * -0.283)), 0, 0, ((rl + (c * -(rl))) + (s * -((1 - rl)))), ((gl + (c * -(gl))) + (s * gl)), ((bl + (c * (1 - bl))) + (s * bl)), 0, 0, 0, 0, 0, 1, 0];
return (mtx);
}
public static function _color_property_get(p_obj:Object, p_parameters:Array, p_extra:Object=null):Number{
return (p_obj.transform.colorTransform[p_parameters[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(p_obj:Object, p_matrix:Array):void{
var cmtx:ColorMatrixFilter;
var objFilters:Array = p_obj.filters.concat();
var found:Boolean;
var i:Number = 0;
while (i < objFilters.length) {
if ((objFilters[i] is ColorMatrixFilter)){
objFilters[i].matrix = p_matrix.concat();
found = true;
};
i++;
};
if (!found){
cmtx = new ColorMatrixFilter(p_matrix);
objFilters[objFilters.length] = cmtx;
};
p_obj.filters = objFilters;
}
public static function _color_property_set(p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object=null):void{
var cfm:ColorTransform = p_obj.transform.colorTransform;
cfm[p_parameters[0]] = p_value;
p_obj.transform.colorTransform = cfm;
}
public static function _oldColor_property_set(p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object=null):void{
var tf:ColorTransform = p_obj.transform.colorTransform;
tf[p_parameters[0]] = (p_value / 100);
p_obj.transform.colorTransform = tf;
}
public static function _contrast_get(p_obj:Object, p_parameters:Array, p_extra:Object=null):Number{
var mc:Number;
var co:Number;
var cfm:ColorTransform = p_obj.transform.colorTransform;
mc = ((((cfm.redMultiplier + cfm.greenMultiplier) + cfm.blueMultiplier) / 3) - 1);
co = ((((cfm.redOffset + cfm.greenOffset) + cfm.blueOffset) / 3) / -128);
return (((mc + co) / 2));
}
public static function _colorTransform_splitter(p_value:Object, p_parameters:Array):Array{
var nArray:Array = new Array();
if (p_value == null){
nArray.push({name:"_color_redMultiplier", value:1});
nArray.push({name:"_color_redOffset", value:0});
nArray.push({name:"_color_greenMultiplier", value:1});
nArray.push({name:"_color_greenOffset", value:0});
nArray.push({name:"_color_blueMultiplier", value:1});
nArray.push({name:"_color_blueOffset", value:0});
} else {
nArray.push({name:"_color_redMultiplier", value:p_value.redMultiplier});
nArray.push({name:"_color_redOffset", value:p_value.redOffset});
nArray.push({name:"_color_blueMultiplier", value:p_value.blueMultiplier});
nArray.push({name:"_color_blueOffset", value:p_value.blueOffset});
nArray.push({name:"_color_greenMultiplier", value:p_value.greenMultiplier});
nArray.push({name:"_color_greenOffset", value:p_value.greenOffset});
nArray.push({name:"_color_alphaMultiplier", value:p_value.alphaMultiplier});
nArray.push({name:"_color_alphaOffset", value:p_value.alphaOffset});
};
return (nArray);
}
}
}//package caurina.transitions.properties
Section 2
//FilterShortcuts (caurina.transitions.properties.FilterShortcuts)
package caurina.transitions.properties {
import flash.display.*;
import caurina.transitions.*;
import flash.geom.*;
import flash.filters.*;
public class FilterShortcuts {
public function FilterShortcuts(){
super();
trace("This is an static class and should not be instantiated.");
}
public static function init():void{
Tweener.registerSpecialPropertySplitter("_filter", _filter_splitter);
Tweener.registerSpecialProperty("_Bevel_angle", _filter_property_get, _filter_property_set, [BevelFilter, "angle"]);
Tweener.registerSpecialProperty("_Bevel_blurX", _filter_property_get, _filter_property_set, [BevelFilter, "blurX"]);
Tweener.registerSpecialProperty("_Bevel_blurY", _filter_property_get, _filter_property_set, [BevelFilter, "blurY"]);
Tweener.registerSpecialProperty("_Bevel_distance", _filter_property_get, _filter_property_set, [BevelFilter, "distance"]);
Tweener.registerSpecialProperty("_Bevel_highlightAlpha", _filter_property_get, _filter_property_set, [BevelFilter, "highlightAlpha"]);
Tweener.registerSpecialPropertySplitter("_Bevel_highlightColor", _generic_color_splitter, ["_Bevel_highlightColor_r", "_Bevel_highlightColor_g", "_Bevel_highlightColor_b"]);
Tweener.registerSpecialProperty("_Bevel_highlightColor_r", _filter_property_get, _filter_property_set, [BevelFilter, "highlightColor", "color", "r"]);
Tweener.registerSpecialProperty("_Bevel_highlightColor_g", _filter_property_get, _filter_property_set, [BevelFilter, "highlightColor", "color", "g"]);
Tweener.registerSpecialProperty("_Bevel_highlightColor_b", _filter_property_get, _filter_property_set, [BevelFilter, "highlightColor", "color", "b"]);
Tweener.registerSpecialProperty("_Bevel_knockout", _filter_property_get, _filter_property_set, [BevelFilter, "knockout"]);
Tweener.registerSpecialProperty("_Bevel_quality", _filter_property_get, _filter_property_set, [BevelFilter, "quality"]);
Tweener.registerSpecialProperty("_Bevel_shadowAlpha", _filter_property_get, _filter_property_set, [BevelFilter, "shadowAlpha"]);
Tweener.registerSpecialPropertySplitter("_Bevel_shadowColor", _generic_color_splitter, ["_Bevel_shadowColor_r", "_Bevel_shadowColor_g", "_Bevel_shadowColor_b"]);
Tweener.registerSpecialProperty("_Bevel_shadowColor_r", _filter_property_get, _filter_property_set, [BevelFilter, "shadowColor", "color", "r"]);
Tweener.registerSpecialProperty("_Bevel_shadowColor_g", _filter_property_get, _filter_property_set, [BevelFilter, "shadowColor", "color", "g"]);
Tweener.registerSpecialProperty("_Bevel_shadowColor_b", _filter_property_get, _filter_property_set, [BevelFilter, "shadowColor", "color", "b"]);
Tweener.registerSpecialProperty("_Bevel_strength", _filter_property_get, _filter_property_set, [BevelFilter, "strength"]);
Tweener.registerSpecialProperty("_Bevel_type", _filter_property_get, _filter_property_set, [BevelFilter, "type"]);
Tweener.registerSpecialProperty("_Blur_blurX", _filter_property_get, _filter_property_set, [BlurFilter, "blurX"]);
Tweener.registerSpecialProperty("_Blur_blurY", _filter_property_get, _filter_property_set, [BlurFilter, "blurY"]);
Tweener.registerSpecialProperty("_Blur_quality", _filter_property_get, _filter_property_set, [BlurFilter, "quality"]);
Tweener.registerSpecialPropertySplitter("_ColorMatrix_matrix", _generic_matrix_splitter, [[1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0], ["_ColorMatrix_matrix_rr", "_ColorMatrix_matrix_rg", "_ColorMatrix_matrix_rb", "_ColorMatrix_matrix_ra", "_ColorMatrix_matrix_ro", "_ColorMatrix_matrix_gr", "_ColorMatrix_matrix_gg", "_ColorMatrix_matrix_gb", "_ColorMatrix_matrix_ga", "_ColorMatrix_matrix_go", "_ColorMatrix_matrix_br", "_ColorMatrix_matrix_bg", "_ColorMatrix_matrix_bb", "_ColorMatrix_matrix_ba", "_ColorMatrix_matrix_bo", "_ColorMatrix_matrix_ar", "_ColorMatrix_matrix_ag", "_ColorMatrix_matrix_ab", "_ColorMatrix_matrix_aa", "_ColorMatrix_matrix_ao"]]);
Tweener.registerSpecialProperty("_ColorMatrix_matrix_rr", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 0]);
Tweener.registerSpecialProperty("_ColorMatrix_matrix_rg", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 1]);
Tweener.registerSpecialProperty("_ColorMatrix_matrix_rb", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 2]);
Tweener.registerSpecialProperty("_ColorMatrix_matrix_ra", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 3]);
Tweener.registerSpecialProperty("_ColorMatrix_matrix_ro", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 4]);
Tweener.registerSpecialProperty("_ColorMatrix_matrix_gr", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 5]);
Tweener.registerSpecialProperty("_ColorMatrix_matrix_gg", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 6]);
Tweener.registerSpecialProperty("_ColorMatrix_matrix_gb", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 7]);
Tweener.registerSpecialProperty("_ColorMatrix_matrix_ga", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 8]);
Tweener.registerSpecialProperty("_ColorMatrix_matrix_go", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 9]);
Tweener.registerSpecialProperty("_ColorMatrix_matrix_br", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 10]);
Tweener.registerSpecialProperty("_ColorMatrix_matrix_bg", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 11]);
Tweener.registerSpecialProperty("_ColorMatrix_matrix_bb", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 12]);
Tweener.registerSpecialProperty("_ColorMatrix_matrix_ba", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 13]);
Tweener.registerSpecialProperty("_ColorMatrix_matrix_bo", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 14]);
Tweener.registerSpecialProperty("_ColorMatrix_matrix_ar", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 15]);
Tweener.registerSpecialProperty("_ColorMatrix_matrix_ag", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 16]);
Tweener.registerSpecialProperty("_ColorMatrix_matrix_ab", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 17]);
Tweener.registerSpecialProperty("_ColorMatrix_matrix_aa", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 18]);
Tweener.registerSpecialProperty("_ColorMatrix_matrix_ao", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 19]);
Tweener.registerSpecialProperty("_Convolution_alpha", _filter_property_get, _filter_property_set, [ConvolutionFilter, "alpha"]);
Tweener.registerSpecialProperty("_Convolution_bias", _filter_property_get, _filter_property_set, [ConvolutionFilter, "bias"]);
Tweener.registerSpecialProperty("_Convolution_clamp", _filter_property_get, _filter_property_set, [ConvolutionFilter, "clamp"]);
Tweener.registerSpecialPropertySplitter("_Convolution_color", _generic_color_splitter, ["_Convolution_color_r", "_Convolution_color_g", "_Convolution_color_b"]);
Tweener.registerSpecialProperty("_Convolution_color_r", _filter_property_get, _filter_property_set, [ConvolutionFilter, "color", "color", "r"]);
Tweener.registerSpecialProperty("_Convolution_color_g", _filter_property_get, _filter_property_set, [ConvolutionFilter, "color", "color", "g"]);
Tweener.registerSpecialProperty("_Convolution_color_b", _filter_property_get, _filter_property_set, [ConvolutionFilter, "color", "color", "b"]);
Tweener.registerSpecialProperty("_Convolution_divisor", _filter_property_get, _filter_property_set, [ConvolutionFilter, "divisor"]);
Tweener.registerSpecialProperty("_Convolution_matrixX", _filter_property_get, _filter_property_set, [ConvolutionFilter, "matrixX"]);
Tweener.registerSpecialProperty("_Convolution_matrixY", _filter_property_get, _filter_property_set, [ConvolutionFilter, "matrixY"]);
Tweener.registerSpecialProperty("_Convolution_preserveAlpha", _filter_property_get, _filter_property_set, [ConvolutionFilter, "preserveAlpha"]);
Tweener.registerSpecialProperty("_DisplacementMap_alpha", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "alpha"]);
Tweener.registerSpecialPropertySplitter("_DisplacementMap_color", _generic_color_splitter, ["_DisplacementMap_color_r", "_DisplacementMap_color_r", "_DisplacementMap_color_r"]);
Tweener.registerSpecialProperty("_DisplacementMap_color_r", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "color", "color", "r"]);
Tweener.registerSpecialProperty("_DisplacementMap_color_g", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "color", "color", "g"]);
Tweener.registerSpecialProperty("_DisplacementMap_color_b", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "color", "color", "b"]);
Tweener.registerSpecialProperty("_DisplacementMap_componentX", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "componentX"]);
Tweener.registerSpecialProperty("_DisplacementMap_componentY", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "componentY"]);
Tweener.registerSpecialProperty("_DisplacementMap_mapBitmap", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "mapBitmap"]);
Tweener.registerSpecialPropertySplitter("_DisplacementMap_mapPoint", _generic_point_splitter, ["_DisplacementMap_mapPoint_x", "_DisplacementMap_mapPoint_y"]);
Tweener.registerSpecialProperty("_DisplacementMap_mapPoint_x", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "mapPoint", "point", "x"]);
Tweener.registerSpecialProperty("_DisplacementMap_mapPoint_y", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "mapPoint", "point", "y"]);
Tweener.registerSpecialProperty("_DisplacementMap_mode", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "mode"]);
Tweener.registerSpecialProperty("_DisplacementMap_scaleX", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "scaleX"]);
Tweener.registerSpecialProperty("_DisplacementMap_scaleY", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "scaleY"]);
Tweener.registerSpecialProperty("_DropShadow_alpha", _filter_property_get, _filter_property_set, [DropShadowFilter, "alpha"]);
Tweener.registerSpecialProperty("_DropShadow_angle", _filter_property_get, _filter_property_set, [DropShadowFilter, "angle"]);
Tweener.registerSpecialProperty("_DropShadow_blurX", _filter_property_get, _filter_property_set, [DropShadowFilter, "blurX"]);
Tweener.registerSpecialProperty("_DropShadow_blurY", _filter_property_get, _filter_property_set, [DropShadowFilter, "blurY"]);
Tweener.registerSpecialPropertySplitter("_DropShadow_color", _generic_color_splitter, ["_DropShadow_color_r", "_DropShadow_color_g", "_DropShadow_color_b"]);
Tweener.registerSpecialProperty("_DropShadow_color_r", _filter_property_get, _filter_property_set, [DropShadowFilter, "color", "color", "r"]);
Tweener.registerSpecialProperty("_DropShadow_color_g", _filter_property_get, _filter_property_set, [DropShadowFilter, "color", "color", "g"]);
Tweener.registerSpecialProperty("_DropShadow_color_b", _filter_property_get, _filter_property_set, [DropShadowFilter, "color", "color", "b"]);
Tweener.registerSpecialProperty("_DropShadow_distance", _filter_property_get, _filter_property_set, [DropShadowFilter, "distance"]);
Tweener.registerSpecialProperty("_DropShadow_hideObject", _filter_property_get, _filter_property_set, [DropShadowFilter, "hideObject"]);
Tweener.registerSpecialProperty("_DropShadow_inner", _filter_property_get, _filter_property_set, [DropShadowFilter, "inner"]);
Tweener.registerSpecialProperty("_DropShadow_knockout", _filter_property_get, _filter_property_set, [DropShadowFilter, "knockout"]);
Tweener.registerSpecialProperty("_DropShadow_quality", _filter_property_get, _filter_property_set, [DropShadowFilter, "quality"]);
Tweener.registerSpecialProperty("_DropShadow_strength", _filter_property_get, _filter_property_set, [DropShadowFilter, "strength"]);
Tweener.registerSpecialProperty("_Glow_alpha", _filter_property_get, _filter_property_set, [GlowFilter, "alpha"]);
Tweener.registerSpecialProperty("_Glow_blurX", _filter_property_get, _filter_property_set, [GlowFilter, "blurX"]);
Tweener.registerSpecialProperty("_Glow_blurY", _filter_property_get, _filter_property_set, [GlowFilter, "blurY"]);
Tweener.registerSpecialPropertySplitter("_Glow_color", _generic_color_splitter, ["_Glow_color_r", "_Glow_color_g", "_Glow_color_b"]);
Tweener.registerSpecialProperty("_Glow_color_r", _filter_property_get, _filter_property_set, [GlowFilter, "color", "color", "r"]);
Tweener.registerSpecialProperty("_Glow_color_g", _filter_property_get, _filter_property_set, [GlowFilter, "color", "color", "g"]);
Tweener.registerSpecialProperty("_Glow_color_b", _filter_property_get, _filter_property_set, [GlowFilter, "color", "color", "b"]);
Tweener.registerSpecialProperty("_Glow_inner", _filter_property_get, _filter_property_set, [GlowFilter, "inner"]);
Tweener.registerSpecialProperty("_Glow_knockout", _filter_property_get, _filter_property_set, [GlowFilter, "knockout"]);
Tweener.registerSpecialProperty("_Glow_quality", _filter_property_get, _filter_property_set, [GlowFilter, "quality"]);
Tweener.registerSpecialProperty("_Glow_strength", _filter_property_get, _filter_property_set, [GlowFilter, "strength"]);
Tweener.registerSpecialProperty("_GradientBevel_angle", _filter_property_get, _filter_property_set, [GradientBevelFilter, "angle"]);
Tweener.registerSpecialProperty("_GradientBevel_blurX", _filter_property_get, _filter_property_set, [GradientBevelFilter, "blurX"]);
Tweener.registerSpecialProperty("_GradientBevel_blurY", _filter_property_get, _filter_property_set, [GradientBevelFilter, "blurY"]);
Tweener.registerSpecialProperty("_GradientBevel_distance", _filter_property_get, _filter_property_set, [GradientBevelFilter, "distance"]);
Tweener.registerSpecialProperty("_GradientBevel_quality", _filter_property_get, _filter_property_set, [GradientBevelFilter, "quality"]);
Tweener.registerSpecialProperty("_GradientBevel_strength", _filter_property_get, _filter_property_set, [GradientBevelFilter, "strength"]);
Tweener.registerSpecialProperty("_GradientBevel_type", _filter_property_get, _filter_property_set, [GradientBevelFilter, "type"]);
Tweener.registerSpecialProperty("_GradientGlow_angle", _filter_property_get, _filter_property_set, [GradientGlowFilter, "angle"]);
Tweener.registerSpecialProperty("_GradientGlow_blurX", _filter_property_get, _filter_property_set, [GradientGlowFilter, "blurX"]);
Tweener.registerSpecialProperty("_GradientGlow_blurY", _filter_property_get, _filter_property_set, [GradientGlowFilter, "blurY"]);
Tweener.registerSpecialProperty("_GradientGlow_distance", _filter_property_get, _filter_property_set, [GradientGlowFilter, "distance"]);
Tweener.registerSpecialProperty("_GradientGlow_knockout", _filter_property_get, _filter_property_set, [GradientGlowFilter, "knockout"]);
Tweener.registerSpecialProperty("_GradientGlow_quality", _filter_property_get, _filter_property_set, [GradientGlowFilter, "quality"]);
Tweener.registerSpecialProperty("_GradientGlow_strength", _filter_property_get, _filter_property_set, [GradientGlowFilter, "strength"]);
Tweener.registerSpecialProperty("_GradientGlow_type", _filter_property_get, _filter_property_set, [GradientGlowFilter, "type"]);
}
public static function _filter_property_get(p_obj:Object, p_parameters:Array, p_extra:Object=null):Number{
var i:Number;
var defaultValues:Object;
var colorComponent:String;
var f:Array = p_obj.filters;
var filterClass:Object = p_parameters[0];
var propertyName:String = p_parameters[1];
var splitType:String = p_parameters[2];
i = 0;
while (i < f.length) {
if ((f[i] is Class(filterClass))){
if (splitType == "color"){
colorComponent = p_parameters[3];
if (colorComponent == "r"){
return (AuxFunctions.numberToR(f[i][propertyName]));
};
if (colorComponent == "g"){
return (AuxFunctions.numberToG(f[i][propertyName]));
};
if (colorComponent == "b"){
return (AuxFunctions.numberToB(f[i][propertyName]));
};
} else {
if (splitType == "matrix"){
return (f[i][propertyName][p_parameters[3]]);
};
if (splitType == "point"){
return (f[i][propertyName][p_parameters[3]]);
};
return (f[i][propertyName]);
};
};
i++;
};
switch (filterClass){
case BevelFilter:
defaultValues = {angle:NaN, blurX:0, blurY:0, distance:0, highlightAlpha:1, highlightColor:NaN, knockout:null, quality:NaN, shadowAlpha:1, shadowColor:NaN, strength:2, type:null};
break;
case BlurFilter:
defaultValues = {blurX:0, blurY:0, quality:NaN};
break;
case ColorMatrixFilter:
defaultValues = {matrix:[1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]};
break;
case ConvolutionFilter:
defaultValues = {alpha:0, bias:0, clamp:null, color:NaN, divisor:1, matrix:[1], matrixX:1, matrixY:1, preserveAlpha:null};
break;
case DisplacementMapFilter:
defaultValues = {alpha:0, color:NaN, componentX:null, componentY:null, mapBitmap:null, mapPoint:null, mode:null, scaleX:0, scaleY:0};
break;
case DropShadowFilter:
defaultValues = {distance:0, angle:NaN, color:NaN, alpha:1, blurX:0, blurY:0, strength:1, quality:NaN, inner:null, knockout:null, hideObject:null};
break;
case GlowFilter:
defaultValues = {alpha:1, blurX:0, blurY:0, color:NaN, inner:null, knockout:null, quality:NaN, strength:2};
break;
case GradientBevelFilter:
defaultValues = {alphas:null, angle:NaN, blurX:0, blurY:0, colors:null, distance:0, knockout:null, quality:NaN, ratios:NaN, strength:1, type:null};
break;
case GradientGlowFilter:
defaultValues = {alphas:null, angle:NaN, blurX:0, blurY:0, colors:null, distance:0, knockout:null, quality:NaN, ratios:NaN, strength:1, type:null};
break;
};
if (splitType == "color"){
return (NaN);
};
if (splitType == "matrix"){
return (defaultValues[propertyName][p_parameters[3]]);
};
if (splitType == "point"){
return (defaultValues[propertyName][p_parameters[3]]);
};
return (defaultValues[propertyName]);
}
public static function _filter_property_set(p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object=null):void{
var i:Number;
var fi:BitmapFilter;
var colorComponent:String;
var mtx:Array;
var pt:Point;
var f:Array = p_obj.filters;
var filterClass:Object = p_parameters[0];
var propertyName:String = p_parameters[1];
var splitType:String = p_parameters[2];
i = 0;
while (i < f.length) {
if ((f[i] is Class(filterClass))){
if (splitType == "color"){
colorComponent = p_parameters[3];
if (colorComponent == "r"){
f[i][propertyName] = ((f[i][propertyName] & 0xFFFF) | (p_value << 16));
};
if (colorComponent == "g"){
f[i][propertyName] = ((f[i][propertyName] & 0xFF00FF) | (p_value << 8));
};
if (colorComponent == "b"){
f[i][propertyName] = ((f[i][propertyName] & 0xFFFF00) | p_value);
};
} else {
if (splitType == "matrix"){
mtx = f[i][propertyName];
mtx[p_parameters[3]] = p_value;
f[i][propertyName] = mtx;
} else {
if (splitType == "point"){
pt = Point(f[i][propertyName]);
pt[p_parameters[3]] = p_value;
f[i][propertyName] = pt;
} else {
f[i][propertyName] = p_value;
};
};
};
p_obj.filters = f;
return;
};
i++;
};
if (f == null){
f = new Array();
};
switch (filterClass){
case BevelFilter:
fi = new BevelFilter(0, 45, 0xFFFFFF, 1, 0, 1, 0, 0);
break;
case BlurFilter:
fi = new BlurFilter(0, 0);
break;
case ColorMatrixFilter:
fi = new ColorMatrixFilter([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]);
break;
case ConvolutionFilter:
fi = new ConvolutionFilter(1, 1, [1], 1, 0, true, true, 0, 0);
break;
case DisplacementMapFilter:
fi = new DisplacementMapFilter(new BitmapData(10, 10), new Point(0, 0), 0, 1, 0, 0);
break;
case DropShadowFilter:
fi = new DropShadowFilter(0, 45, 0, 1, 0, 0);
break;
case GlowFilter:
fi = new GlowFilter(0xFF0000, 1, 0, 0);
break;
case GradientBevelFilter:
fi = new GradientBevelFilter(0, 45, [0xFFFFFF, 0], [1, 1], [32, 223], 0, 0);
break;
case GradientGlowFilter:
fi = new GradientGlowFilter(0, 45, [0xFFFFFF, 0], [1, 1], [32, 223], 0, 0);
break;
};
f.push(fi);
p_obj.filters = f;
_filter_property_set(p_obj, p_value, p_parameters);
}
public static function _generic_color_splitter(p_value:Number, p_parameters:Array):Array{
var nArray:Array = new Array();
nArray.push({name:p_parameters[0], value:AuxFunctions.numberToR(p_value)});
nArray.push({name:p_parameters[1], value:AuxFunctions.numberToG(p_value)});
nArray.push({name:p_parameters[2], value:AuxFunctions.numberToB(p_value)});
return (nArray);
}
public static function _generic_point_splitter(p_value:Point, p_parameters:Array):Array{
var nArray:Array = new Array();
nArray.push({name:p_parameters[0], value:p_value.x});
nArray.push({name:p_parameters[1], value:p_value.y});
return (nArray);
}
public static function _generic_matrix_splitter(p_value:Array, p_parameters:Array):Array{
if (p_value == null){
p_value = p_parameters[0].concat();
};
var nArray:Array = new Array();
var i:Number = 0;
while (i < p_value.length) {
nArray.push({name:p_parameters[1][i], value:p_value[i]});
i++;
};
return (nArray);
}
public static function _filter_splitter(p_value:BitmapFilter, p_parameters:Array, p_extra:Object=null):Array{
var nArray:Array = new Array();
if ((p_value is BevelFilter)){
nArray.push({name:"_Bevel_angle", value:BevelFilter(p_value).angle});
nArray.push({name:"_Bevel_blurX", value:BevelFilter(p_value).blurX});
nArray.push({name:"_Bevel_blurY", value:BevelFilter(p_value).blurY});
nArray.push({name:"_Bevel_distance", value:BevelFilter(p_value).distance});
nArray.push({name:"_Bevel_highlightAlpha", value:BevelFilter(p_value).highlightAlpha});
nArray.push({name:"_Bevel_highlightColor", value:BevelFilter(p_value).highlightColor});
nArray.push({name:"_Bevel_knockout", value:BevelFilter(p_value).knockout});
nArray.push({name:"_Bevel_quality", value:BevelFilter(p_value).quality});
nArray.push({name:"_Bevel_shadowAlpha", value:BevelFilter(p_value).shadowAlpha});
nArray.push({name:"_Bevel_shadowColor", value:BevelFilter(p_value).shadowColor});
nArray.push({name:"_Bevel_strength", value:BevelFilter(p_value).strength});
nArray.push({name:"_Bevel_type", value:BevelFilter(p_value).type});
} else {
if ((p_value is BlurFilter)){
nArray.push({name:"_Blur_blurX", value:BlurFilter(p_value).blurX});
nArray.push({name:"_Blur_blurY", value:BlurFilter(p_value).blurY});
nArray.push({name:"_Blur_quality", value:BlurFilter(p_value).quality});
} else {
if ((p_value is ColorMatrixFilter)){
nArray.push({name:"_ColorMatrix_matrix", value:ColorMatrixFilter(p_value).matrix});
} else {
if ((p_value is ConvolutionFilter)){
nArray.push({name:"_Convolution_alpha", value:ConvolutionFilter(p_value).alpha});
nArray.push({name:"_Convolution_bias", value:ConvolutionFilter(p_value).bias});
nArray.push({name:"_Convolution_clamp", value:ConvolutionFilter(p_value).clamp});
nArray.push({name:"_Convolution_color", value:ConvolutionFilter(p_value).color});
nArray.push({name:"_Convolution_divisor", value:ConvolutionFilter(p_value).divisor});
nArray.push({name:"_Convolution_matrixX", value:ConvolutionFilter(p_value).matrixX});
nArray.push({name:"_Convolution_matrixY", value:ConvolutionFilter(p_value).matrixY});
nArray.push({name:"_Convolution_preserveAlpha", value:ConvolutionFilter(p_value).preserveAlpha});
} else {
if ((p_value is DisplacementMapFilter)){
nArray.push({name:"_DisplacementMap_alpha", value:DisplacementMapFilter(p_value).alpha});
nArray.push({name:"_DisplacementMap_color", value:DisplacementMapFilter(p_value).color});
nArray.push({name:"_DisplacementMap_componentX", value:DisplacementMapFilter(p_value).componentX});
nArray.push({name:"_DisplacementMap_componentY", value:DisplacementMapFilter(p_value).componentY});
nArray.push({name:"_DisplacementMap_mapBitmap", value:DisplacementMapFilter(p_value).mapBitmap});
nArray.push({name:"_DisplacementMap_mapPoint", value:DisplacementMapFilter(p_value).mapPoint});
nArray.push({name:"_DisplacementMap_mode", value:DisplacementMapFilter(p_value).mode});
nArray.push({name:"_DisplacementMap_scaleX", value:DisplacementMapFilter(p_value).scaleX});
nArray.push({name:"_DisplacementMap_scaleY", value:DisplacementMapFilter(p_value).scaleY});
} else {
if ((p_value is DropShadowFilter)){
nArray.push({name:"_DropShadow_alpha", value:DropShadowFilter(p_value).alpha});
nArray.push({name:"_DropShadow_angle", value:DropShadowFilter(p_value).angle});
nArray.push({name:"_DropShadow_blurX", value:DropShadowFilter(p_value).blurX});
nArray.push({name:"_DropShadow_blurY", value:DropShadowFilter(p_value).blurY});
nArray.push({name:"_DropShadow_color", value:DropShadowFilter(p_value).color});
nArray.push({name:"_DropShadow_distance", value:DropShadowFilter(p_value).distance});
nArray.push({name:"_DropShadow_hideObject", value:DropShadowFilter(p_value).hideObject});
nArray.push({name:"_DropShadow_inner", value:DropShadowFilter(p_value).inner});
nArray.push({name:"_DropShadow_knockout", value:DropShadowFilter(p_value).knockout});
nArray.push({name:"_DropShadow_quality", value:DropShadowFilter(p_value).quality});
nArray.push({name:"_DropShadow_strength", value:DropShadowFilter(p_value).strength});
} else {
if ((p_value is GlowFilter)){
nArray.push({name:"_Glow_alpha", value:GlowFilter(p_value).alpha});
nArray.push({name:"_Glow_blurX", value:GlowFilter(p_value).blurX});
nArray.push({name:"_Glow_blurY", value:GlowFilter(p_value).blurY});
nArray.push({name:"_Glow_color", value:GlowFilter(p_value).color});
nArray.push({name:"_Glow_inner", value:GlowFilter(p_value).inner});
nArray.push({name:"_Glow_knockout", value:GlowFilter(p_value).knockout});
nArray.push({name:"_Glow_quality", value:GlowFilter(p_value).quality});
nArray.push({name:"_Glow_strength", value:GlowFilter(p_value).strength});
} else {
if ((p_value is GradientBevelFilter)){
nArray.push({name:"_GradientBevel_angle", value:GradientBevelFilter(p_value).strength});
nArray.push({name:"_GradientBevel_blurX", value:GradientBevelFilter(p_value).blurX});
nArray.push({name:"_GradientBevel_blurY", value:GradientBevelFilter(p_value).blurY});
nArray.push({name:"_GradientBevel_distance", value:GradientBevelFilter(p_value).distance});
nArray.push({name:"_GradientBevel_quality", value:GradientBevelFilter(p_value).quality});
nArray.push({name:"_GradientBevel_strength", value:GradientBevelFilter(p_value).strength});
nArray.push({name:"_GradientBevel_type", value:GradientBevelFilter(p_value).type});
} else {
if ((p_value is GradientGlowFilter)){
nArray.push({name:"_GradientGlow_angle", value:GradientGlowFilter(p_value).strength});
nArray.push({name:"_GradientGlow_blurX", value:GradientGlowFilter(p_value).blurX});
nArray.push({name:"_GradientGlow_blurY", value:GradientGlowFilter(p_value).blurY});
nArray.push({name:"_GradientGlow_distance", value:GradientGlowFilter(p_value).distance});
nArray.push({name:"_GradientGlow_knockout", value:GradientGlowFilter(p_value).knockout});
nArray.push({name:"_GradientGlow_quality", value:GradientGlowFilter(p_value).quality});
nArray.push({name:"_GradientGlow_strength", value:GradientGlowFilter(p_value).strength});
nArray.push({name:"_GradientGlow_type", value:GradientGlowFilter(p_value).type});
} else {
trace("Tweener FilterShortcuts Error :: Unknown filter class used");
};
};
};
};
};
};
};
};
};
return (nArray);
}
}
}//package caurina.transitions.properties
Section 3
//SoundShortcuts (caurina.transitions.properties.SoundShortcuts)
package caurina.transitions.properties {
import caurina.transitions.*;
import flash.media.*;
public class SoundShortcuts {
public function SoundShortcuts(){
super();
trace("This is an static class and should not be instantiated.");
}
public static function init():void{
Tweener.registerSpecialProperty("_sound_volume", _sound_volume_get, _sound_volume_set);
Tweener.registerSpecialProperty("_sound_pan", _sound_pan_get, _sound_pan_set);
}
public static function _sound_pan_set(p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object=null):void{
var sndTransform:SoundTransform = p_obj.soundTransform;
sndTransform.pan = p_value;
p_obj.soundTransform = sndTransform;
}
public static function _sound_volume_set(p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object=null):void{
var sndTransform:SoundTransform = p_obj.soundTransform;
sndTransform.volume = p_value;
p_obj.soundTransform = sndTransform;
}
public static function _sound_pan_get(p_obj:Object, p_parameters:Array, p_extra:Object=null):Number{
return (p_obj.soundTransform.pan);
}
public static function _sound_volume_get(p_obj:Object, p_parameters:Array, p_extra:Object=null):Number{
return (p_obj.soundTransform.volume);
}
}
}//package caurina.transitions.properties
Section 4
//AuxFunctions (caurina.transitions.AuxFunctions)
package caurina.transitions {
public class AuxFunctions {
public static function getObjectLength(p_object:Object):uint{
var pName:String;
var totalProperties:uint;
for (pName in p_object) {
totalProperties++;
};
return (totalProperties);
}
public static function numberToG(p_num:Number):Number{
return (((p_num & 0xFF00) >> 8));
}
public static function numberToB(p_num:Number):Number{
return ((p_num & 0xFF));
}
public static function numberToR(p_num:Number):Number{
return (((p_num & 0xFF0000) >> 16));
}
public static function concatObjects(... _args):Object{
var currentObject:Object;
var prop:String;
var finalObject:Object = {};
var i:int;
while (i < _args.length) {
currentObject = _args[i];
for (prop in currentObject) {
if (currentObject[prop] == null){
delete finalObject[prop];
} else {
finalObject[prop] = currentObject[prop];
};
};
i++;
};
return (finalObject);
}
}
}//package caurina.transitions
Section 5
//Equations (caurina.transitions.Equations)
package caurina.transitions {
public class Equations {
public function Equations(){
super();
trace("Equations is a static class and should not be instantiated.");
}
public static function easeOutBounce(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
if (t < (1 / 2.75)){
return (((c * ((7.5625 * t) * t)) + b));
};
if (t < (2 / 2.75)){
t = (t - (1.5 / 2.75));
return (((c * (((7.5625 * t) * t) + 0.75)) + b));
};
if (t < (2.5 / 2.75)){
t = (t - (2.25 / 2.75));
return (((c * (((7.5625 * t) * t) + 0.9375)) + b));
};
t = (t - (2.625 / 2.75));
return (((c * (((7.5625 * t) * t) + 0.984375)) + b));
}
public static function easeInOutElastic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var s:Number;
if (t == 0){
return (b);
};
t = (t / (d / 2));
if (t == 2){
return ((b + c));
};
var p:Number = (((!(Boolean(p_params))) || (isNaN(p_params.period)))) ? (d * (0.3 * 1.5)) : p_params.period;
var a:Number = (((!(Boolean(p_params))) || (isNaN(p_params.amplitude)))) ? 0 : p_params.amplitude;
if (((!(Boolean(a))) || ((a < Math.abs(c))))){
a = c;
s = (p / 4);
} else {
s = ((p / (2 * Math.PI)) * Math.asin((c / a)));
};
if (t < 1){
--t;
return (((-0.5 * ((a * Math.pow(2, (10 * t))) * Math.sin(((((t * d) - s) * (2 * Math.PI)) / p)))) + b));
};
--t;
return ((((((a * Math.pow(2, (-10 * t))) * Math.sin(((((t * d) - s) * (2 * Math.PI)) / p))) * 0.5) + c) + b));
}
public static function easeInOutQuad(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / (d / 2));
if (t < 1){
return (((((c / 2) * t) * t) + b));
};
--t;
return ((((-(c) / 2) * ((t * (t - 2)) - 1)) + b));
}
public static function easeInOutBounce(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (((easeInBounce((t * 2), 0, c, d) * 0.5) + b));
};
return ((((easeOutBounce(((t * 2) - d), 0, c, d) * 0.5) + (c * 0.5)) + b));
}
public static function easeInOutBack(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var s:Number = (((!(Boolean(p_params))) || (isNaN(p_params.overshoot)))) ? 1.70158 : p_params.overshoot;
t = (t / (d / 2));
if (t < 1){
s = (s * 1.525);
return ((((c / 2) * ((t * t) * (((s + 1) * t) - s))) + b));
};
t = (t - 2);
s = (s * 1.525);
return ((((c / 2) * (((t * t) * (((s + 1) * t) + s)) + 2)) + b));
}
public static function easeOutInCubic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutCubic((t * 2), b, (c / 2), d, p_params));
};
return (easeInCubic(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeNone(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return ((((c * t) / d) + b));
}
public static function easeOutBack(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var s:Number = (((!(Boolean(p_params))) || (isNaN(p_params.overshoot)))) ? 1.70158 : p_params.overshoot;
t = ((t / d) - 1);
return (((c * (((t * t) * (((s + 1) * t) + s)) + 1)) + b));
}
public static function easeInOutSine(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return ((((-(c) / 2) * (Math.cos(((Math.PI * t) / d)) - 1)) + b));
}
public static function easeInBack(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var s:Number = (((!(Boolean(p_params))) || (isNaN(p_params.overshoot)))) ? 1.70158 : p_params.overshoot;
t = (t / d);
return (((((c * t) * t) * (((s + 1) * t) - s)) + b));
}
public static function easeInQuart(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return ((((((c * t) * t) * t) * t) + b));
}
public static function easeOutInQuint(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutQuint((t * 2), b, (c / 2), d, p_params));
};
return (easeInQuint(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeOutInBounce(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutBounce((t * 2), b, (c / 2), d, p_params));
};
return (easeInBounce(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
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(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return (((t)==d) ? (b + c) : (((c * 1.001) * (-(Math.pow(2, ((-10 * t) / d))) + 1)) + b));
}
public static function easeOutInBack(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutBack((t * 2), b, (c / 2), d, p_params));
};
return (easeInBack(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeInExpo(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return (((t)==0) ? b : (((c * Math.pow(2, (10 * ((t / d) - 1)))) + b) - (c * 0.001)));
}
public static function easeInCubic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return (((((c * t) * t) * t) + b));
}
public static function easeInQuint(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return (((((((c * t) * t) * t) * t) * t) + b));
}
public static function easeInOutCirc(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / (d / 2));
if (t < 1){
return ((((-(c) / 2) * (Math.sqrt((1 - (t * t))) - 1)) + b));
};
t = (t - 2);
return ((((c / 2) * (Math.sqrt((1 - (t * t))) + 1)) + b));
}
public static function easeInQuad(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return ((((c * t) * t) + b));
}
public static function easeInBounce(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return (((c - easeOutBounce((d - t), 0, c, d)) + b));
}
public static function easeOutInExpo(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutExpo((t * 2), b, (c / 2), d, p_params));
};
return (easeInExpo(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeOutQuart(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = ((t / d) - 1);
return (((-(c) * ((((t * t) * t) * t) - 1)) + b));
}
public static function easeInSine(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return ((((-(c) * Math.cos(((t / d) * (Math.PI / 2)))) + c) + b));
}
public static function easeInOutQuart(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / (d / 2));
if (t < 1){
return (((((((c / 2) * t) * t) * t) * t) + b));
};
t = (t - 2);
return ((((-(c) / 2) * ((((t * t) * t) * t) - 2)) + b));
}
public static function easeOutQuad(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return ((((-(c) * t) * (t - 2)) + b));
}
public static function easeOutInElastic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutElastic((t * 2), b, (c / 2), d, p_params));
};
return (easeInElastic(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeInElastic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var s:Number;
if (t == 0){
return (b);
};
t = (t / d);
if (t == 1){
return ((b + c));
};
var p:Number = (((!(Boolean(p_params))) || (isNaN(p_params.period)))) ? (d * 0.3) : p_params.period;
var a:Number = (((!(Boolean(p_params))) || (isNaN(p_params.amplitude)))) ? 0 : p_params.amplitude;
if (((!(Boolean(a))) || ((a < Math.abs(c))))){
a = c;
s = (p / 4);
} else {
s = ((p / (2 * Math.PI)) * Math.asin((c / a)));
};
--t;
return ((-(((a * Math.pow(2, (10 * t))) * Math.sin(((((t * d) - s) * (2 * Math.PI)) / p)))) + b));
}
public static function easeOutCubic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = ((t / d) - 1);
return (((c * (((t * t) * t) + 1)) + b));
}
public static function easeOutQuint(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = ((t / d) - 1);
return (((c * (((((t * t) * t) * t) * t) + 1)) + b));
}
public static function easeOutInQuad(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutQuad((t * 2), b, (c / 2), d, p_params));
};
return (easeInQuad(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeOutSine(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return (((c * Math.sin(((t / d) * (Math.PI / 2)))) + b));
}
public static function easeInOutCubic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / (d / 2));
if (t < 1){
return ((((((c / 2) * t) * t) * t) + b));
};
t = (t - 2);
return ((((c / 2) * (((t * t) * t) + 2)) + b));
}
public static function easeInOutQuint(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / (d / 2));
if (t < 1){
return ((((((((c / 2) * t) * t) * t) * t) * t) + b));
};
t = (t - 2);
return ((((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b));
}
public static function easeInCirc(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return (((-(c) * (Math.sqrt((1 - (t * t))) - 1)) + b));
}
public static function easeOutInSine(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutSine((t * 2), b, (c / 2), d, p_params));
};
return (easeInSine(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeInOutExpo(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t == 0){
return (b);
};
if (t == d){
return ((b + c));
};
t = (t / (d / 2));
if (t < 1){
return (((((c / 2) * Math.pow(2, (10 * (t - 1)))) + b) - (c * 0.0005)));
};
--t;
return (((((c / 2) * 1.0005) * (-(Math.pow(2, (-10 * t))) + 2)) + b));
}
public static function easeOutElastic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var s:Number;
if (t == 0){
return (b);
};
t = (t / d);
if (t == 1){
return ((b + c));
};
var p:Number = (((!(Boolean(p_params))) || (isNaN(p_params.period)))) ? (d * 0.3) : p_params.period;
var a:Number = (((!(Boolean(p_params))) || (isNaN(p_params.amplitude)))) ? 0 : p_params.amplitude;
if (((!(Boolean(a))) || ((a < Math.abs(c))))){
a = c;
s = (p / 4);
} else {
s = ((p / (2 * Math.PI)) * Math.asin((c / a)));
};
return (((((a * Math.pow(2, (-10 * t))) * Math.sin(((((t * d) - s) * (2 * Math.PI)) / p))) + c) + b));
}
public static function easeOutCirc(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = ((t / d) - 1);
return (((c * Math.sqrt((1 - (t * t)))) + b));
}
public static function easeOutInQuart(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutQuart((t * 2), b, (c / 2), d, p_params));
};
return (easeInQuart(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeOutInCirc(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutCirc((t * 2), b, (c / 2), d, p_params));
};
return (easeInCirc(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
}
}//package caurina.transitions
Section 6
//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(p_valueStart:Number, p_valueComplete:Number, p_originalValueComplete:Object, p_arrayIndex:Number, p_extra:Object, p_isSpecialProperty:Boolean, p_modifierFunction:Function, p_modifierParameters:Array){
super();
valueStart = p_valueStart;
valueComplete = p_valueComplete;
originalValueComplete = p_originalValueComplete;
arrayIndex = p_arrayIndex;
extra = p_extra;
isSpecialProperty = p_isSpecialProperty;
hasModifier = Boolean(p_modifierFunction);
modifierFunction = p_modifierFunction;
modifierParameters = p_modifierParameters;
}
public function toString():String{
var returnStr:String = "\n[PropertyInfoObj ";
returnStr = (returnStr + ("valueStart:" + String(valueStart)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("valueComplete:" + String(valueComplete)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("originalValueComplete:" + String(originalValueComplete)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("arrayIndex:" + String(arrayIndex)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("extra:" + String(extra)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("isSpecialProperty:" + String(isSpecialProperty)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("hasModifier:" + String(hasModifier)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("modifierFunction:" + String(modifierFunction)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("modifierParameters:" + String(modifierParameters)));
returnStr = (returnStr + "]\n");
return (returnStr);
}
public function clone():PropertyInfoObj{
var nProperty:PropertyInfoObj = new PropertyInfoObj(valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, modifierFunction, modifierParameters);
return (nProperty);
}
}
}//package caurina.transitions
Section 7
//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(p_getFunction:Function, p_setFunction:Function, p_parameters:Array=null, p_preProcessFunction:Function=null){
super();
getValue = p_getFunction;
setValue = p_setFunction;
parameters = p_parameters;
preProcess = p_preProcessFunction;
}
public function toString():String{
var value:String = "";
value = (value + "[SpecialProperty ");
value = (value + ("getValue:" + String(getValue)));
value = (value + ", ");
value = (value + ("setValue:" + String(setValue)));
value = (value + ", ");
value = (value + ("parameters:" + String(parameters)));
value = (value + ", ");
value = (value + ("preProcess:" + String(preProcess)));
value = (value + "]");
return (value);
}
}
}//package caurina.transitions
Section 8
//SpecialPropertyModifier (caurina.transitions.SpecialPropertyModifier)
package caurina.transitions {
public class SpecialPropertyModifier {
public var getValue:Function;
public var modifyValues:Function;
public function SpecialPropertyModifier(p_modifyFunction:Function, p_getFunction:Function){
super();
modifyValues = p_modifyFunction;
getValue = p_getFunction;
}
public function toString():String{
var value:String = "";
value = (value + "[SpecialPropertyModifier ");
value = (value + ("modifyValues:" + String(modifyValues)));
value = (value + ", ");
value = (value + ("getValue:" + String(getValue)));
value = (value + "]");
return (value);
}
}
}//package caurina.transitions
Section 9
//SpecialPropertySplitter (caurina.transitions.SpecialPropertySplitter)
package caurina.transitions {
public class SpecialPropertySplitter {
public var parameters:Array;
public var splitValues:Function;
public function SpecialPropertySplitter(p_splitFunction:Function, p_parameters:Array){
super();
splitValues = p_splitFunction;
parameters = p_parameters;
}
public function toString():String{
var value:String = "";
value = (value + "[SpecialPropertySplitter ");
value = (value + ("splitValues:" + String(splitValues)));
value = (value + ", ");
value = (value + ("parameters:" + String(parameters)));
value = (value + "]");
return (value);
}
}
}//package caurina.transitions
Section 10
//Tweener (caurina.transitions.Tweener)
package caurina.transitions {
import flash.display.*;
import flash.events.*;
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(){
super();
trace("Tweener is a static class and should not be instantiated.");
}
public static function registerSpecialPropertyModifier(p_name:String, p_modifyFunction:Function, p_getFunction:Function):void{
if (!_inited){
init();
};
var spm:SpecialPropertyModifier = new SpecialPropertyModifier(p_modifyFunction, p_getFunction);
_specialPropertyModifierList[p_name] = spm;
}
public static function registerSpecialProperty(p_name:String, p_getFunction:Function, p_setFunction:Function, p_parameters:Array=null, p_preProcessFunction:Function=null):void{
if (!_inited){
init();
};
var sp:SpecialProperty = new SpecialProperty(p_getFunction, p_setFunction, p_parameters, p_preProcessFunction);
_specialPropertyList[p_name] = sp;
}
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 i:int;
if (_tweenList.length == 0){
return (false);
};
i = 0;
while (i < _tweenList.length) {
if ((((_tweenList[i] == undefined)) || (!(_tweenList[i].isPaused)))){
if (!updateTweenByIndex(i)){
removeTweenByIndex(i);
};
if (_tweenList[i] == null){
removeTweenByIndex(i, true);
i--;
};
};
i++;
};
return (true);
}
public static function addCaller(p_scopes:Object=null, p_parameters:Object=null):Boolean{
var i:Number;
var rScopes:Array;
var rTransition:Function;
var nTween:TweenListObj;
var myT:Number;
var trans:String;
if (!Boolean(p_scopes)){
return (false);
};
if ((p_scopes is Array)){
rScopes = p_scopes.concat();
} else {
rScopes = [p_scopes];
};
var p_obj:Object = p_parameters;
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
var rTime:Number = (isNaN(p_obj.time)) ? 0 : p_obj.time;
var rDelay:Number = (isNaN(p_obj.delay)) ? 0 : p_obj.delay;
if (typeof(p_obj.transition) == "string"){
trans = p_obj.transition.toLowerCase();
rTransition = _transitionList[trans];
} else {
rTransition = p_obj.transition;
};
if (!Boolean(rTransition)){
rTransition = _transitionList["easeoutexpo"];
};
i = 0;
while (i < rScopes.length) {
if (p_obj.useFrames == true){
nTween = new TweenListObj(rScopes[i], (_currentTimeFrame + (rDelay / _timeScale)), (_currentTimeFrame + ((rDelay + rTime) / _timeScale)), true, rTransition, p_obj.transitionParams);
} else {
nTween = new TweenListObj(rScopes[i], (_currentTime + ((rDelay * 1000) / _timeScale)), (_currentTime + (((rDelay * 1000) + (rTime * 1000)) / _timeScale)), false, rTransition, p_obj.transitionParams);
};
nTween.properties = null;
nTween.onStart = p_obj.onStart;
nTween.onUpdate = p_obj.onUpdate;
nTween.onComplete = p_obj.onComplete;
nTween.onOverwrite = p_obj.onOverwrite;
nTween.onStartParams = p_obj.onStartParams;
nTween.onUpdateParams = p_obj.onUpdateParams;
nTween.onCompleteParams = p_obj.onCompleteParams;
nTween.onOverwriteParams = p_obj.onOverwriteParams;
nTween.onStartScope = p_obj.onStartScope;
nTween.onUpdateScope = p_obj.onUpdateScope;
nTween.onCompleteScope = p_obj.onCompleteScope;
nTween.onOverwriteScope = p_obj.onOverwriteScope;
nTween.onErrorScope = p_obj.onErrorScope;
nTween.isCaller = true;
nTween.count = p_obj.count;
nTween.waitFrames = p_obj.waitFrames;
_tweenList.push(nTween);
if ((((rTime == 0)) && ((rDelay == 0)))){
myT = (_tweenList.length - 1);
updateTweenByIndex(myT);
removeTweenByIndex(myT);
};
i++;
};
return (true);
}
public static function pauseAllTweens():Boolean{
var i:uint;
if (!Boolean(_tweenList)){
return (false);
};
var paused:Boolean;
i = 0;
while (i < _tweenList.length) {
pauseTweenByIndex(i);
paused = true;
i++;
};
return (paused);
}
public static function removeTweens(p_scope:Object, ... _args):Boolean{
var i:uint;
var sps:SpecialPropertySplitter;
var specialProps:Array;
var j:uint;
var properties:Array = new Array();
i = 0;
while (i < _args.length) {
if ((((typeof(_args[i]) == "string")) && ((properties.indexOf(_args[i]) == -1)))){
if (_specialPropertySplitterList[_args[i]]){
sps = _specialPropertySplitterList[_args[i]];
specialProps = sps.splitValues(p_scope, null);
j = 0;
while (j < specialProps.length) {
properties.push(specialProps[j].name);
j++;
};
} else {
properties.push(_args[i]);
};
};
i++;
};
return (affectTweens(removeTweenByIndex, p_scope, properties));
}
public static function updateFrame():void{
_currentTimeFrame++;
}
public static function splitTweens(p_tween:Number, p_properties:Array):uint{
var i:uint;
var pName:String;
var found:Boolean;
var originalTween:TweenListObj = _tweenList[p_tween];
var newTween:TweenListObj = originalTween.clone(false);
i = 0;
while (i < p_properties.length) {
pName = p_properties[i];
if (Boolean(originalTween.properties[pName])){
originalTween.properties[pName] = undefined;
delete originalTween.properties[pName];
};
i++;
};
for (pName in newTween.properties) {
found = false;
i = 0;
while (i < p_properties.length) {
if (p_properties[i] == pName){
found = true;
break;
};
i++;
};
if (!found){
newTween.properties[pName] = undefined;
delete newTween.properties[pName];
};
};
_tweenList.push(newTween);
return ((_tweenList.length - 1));
}
public static function resumeTweenByIndex(p_tween:Number):Boolean{
var tTweening:TweenListObj = _tweenList[p_tween];
if ((((tTweening == null)) || (!(tTweening.isPaused)))){
return (false);
};
var cTime:Number = getCurrentTweeningTime(tTweening);
tTweening.timeStart = (tTweening.timeStart + (cTime - tTweening.timePaused));
tTweening.timeComplete = (tTweening.timeComplete + (cTime - tTweening.timePaused));
tTweening.timePaused = undefined;
tTweening.isPaused = false;
return (true);
}
public static function getVersion():String{
return ("AS3 1.33.74");
}
public static function onEnterFrame(e:Event):void{
updateTime();
updateFrame();
var hasUpdated:Boolean;
hasUpdated = updateTweens();
if (!hasUpdated){
stopEngine();
};
}
public static function updateTime():void{
_currentTime = getTimer();
}
private static function updateTweenByIndex(i: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 = i;
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);
//unresolved if
if (Boolean(tTweening.onUpdate)){
eventScope = (Boolean(tTweening.onUpdateScope)) ? tTweening.onUpdateScope : tScope;
tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams);
continue;
var _slot1 = e1;
handleError(tTweening, _slot1, "onUpdate");
};
} while (tTweening.timesCalled++, !(tTweening.timesCalled >= tTweening.count));
} 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;
tTweening.onStart.apply(eventScope, tTweening.onStartParams);
//unresolved jump
var _slot1 = e2;
handleError(tTweening, _slot1, "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;
tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams);
//unresolved jump
var _slot1 = e3;
handleError(tTweening, _slot1, "onUpdate");
};
} else {
tTweening.updatesSkipped++;
};
};
if (((isOver) && (Boolean(tTweening.onComplete)))){
eventScope = (Boolean(tTweening.onCompleteScope)) ? tTweening.onCompleteScope : tScope;
tTweening.onComplete.apply(eventScope, tTweening.onCompleteParams);
//unresolved jump
var _slot1 = e4;
handleError(tTweening, _slot1, "onComplete");
};
return (!(isOver));
};
return (true);
}
public static function setTimeScale(p_time:Number):void{
var i:Number;
var cTime:Number;
if (isNaN(p_time)){
p_time = 1;
};
if (p_time < 1E-5){
p_time = 1E-5;
};
if (p_time != _timeScale){
if (_tweenList != null){
i = 0;
while (i < _tweenList.length) {
cTime = getCurrentTweeningTime(_tweenList[i]);
_tweenList[i].timeStart = (cTime - (((cTime - _tweenList[i].timeStart) * _timeScale) / p_time));
_tweenList[i].timeComplete = (cTime - (((cTime - _tweenList[i].timeComplete) * _timeScale) / p_time));
if (_tweenList[i].timePaused != undefined){
_tweenList[i].timePaused = (cTime - (((cTime - _tweenList[i].timePaused) * _timeScale) / p_time));
};
i++;
};
};
_timeScale = p_time;
};
}
public static function resumeAllTweens():Boolean{
var i:uint;
if (!Boolean(_tweenList)){
return (false);
};
var resumed:Boolean;
i = 0;
while (i < _tweenList.length) {
resumeTweenByIndex(i);
resumed = true;
i++;
};
return (resumed);
}
private static function handleError(pTweening:TweenListObj, pError:Error, pCallBackName:String):void{
var eventScope:Object;
var pTweening = pTweening;
var pError = pError;
var pCallBackName = pCallBackName;
if (((Boolean(pTweening.onError)) && ((pTweening.onError is Function)))){
eventScope = (Boolean(pTweening.onErrorScope)) ? pTweening.onErrorScope : pTweening.scope;
pTweening.onError.apply(eventScope, [pTweening.scope, pError]);
//unresolved jump
var _slot1 = metaError;
printError(((((String(pTweening.scope) + " raised an error while executing the 'onError' handler. Original error:\n ") + pError.getStackTrace()) + "\nonError error: ") + _slot1.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 i:uint;
if (!Boolean(_tweenList)){
return (false);
};
var removed:Boolean;
i = 0;
while (i < _tweenList.length) {
removeTweenByIndex(i);
removed = true;
i++;
};
return (removed);
}
public static function addTween(p_scopes:Object=null, p_parameters:Object=null):Boolean{
var i:Number;
var j:Number;
var istr:String;
var rScopes:Array;
var rTransition:Function;
var nProperties:Object;
var nTween:TweenListObj;
var myT:Number;
var splitProperties:Array;
var splitProperties2:Array;
var tempModifiedProperties:Array;
var trans:String;
if (!Boolean(p_scopes)){
return (false);
};
if ((p_scopes is Array)){
rScopes = p_scopes.concat();
} else {
rScopes = [p_scopes];
};
var p_obj:Object = TweenListObj.makePropertiesChain(p_parameters);
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
var rTime:Number = (isNaN(p_obj.time)) ? 0 : p_obj.time;
var rDelay:Number = (isNaN(p_obj.delay)) ? 0 : p_obj.delay;
var rProperties:Array = new Array();
var restrictedWords: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 modifiedProperties:Object = new Object();
for (istr in p_obj) {
if (!restrictedWords[istr]){
if (_specialPropertySplitterList[istr]){
splitProperties = _specialPropertySplitterList[istr].splitValues(p_obj[istr], _specialPropertySplitterList[istr].parameters);
i = 0;
while (i < splitProperties.length) {
if (_specialPropertySplitterList[splitProperties[i].name]){
splitProperties2 = _specialPropertySplitterList[splitProperties[i].name].splitValues(splitProperties[i].value, _specialPropertySplitterList[splitProperties[i].name].parameters);
j = 0;
while (j < splitProperties2.length) {
rProperties[splitProperties2[j].name] = {valueStart:undefined, valueComplete:splitProperties2[j].value, arrayIndex:splitProperties2[j].arrayIndex, isSpecialProperty:false};
j++;
};
} else {
rProperties[splitProperties[i].name] = {valueStart:undefined, valueComplete:splitProperties[i].value, arrayIndex:splitProperties[i].arrayIndex, isSpecialProperty:false};
};
i++;
};
} else {
if (_specialPropertyModifierList[istr] != undefined){
tempModifiedProperties = _specialPropertyModifierList[istr].modifyValues(p_obj[istr]);
i = 0;
while (i < tempModifiedProperties.length) {
modifiedProperties[tempModifiedProperties[i].name] = {modifierParameters:tempModifiedProperties[i].parameters, modifierFunction:_specialPropertyModifierList[istr].getValue};
i++;
};
} else {
rProperties[istr] = {valueStart:undefined, valueComplete:p_obj[istr]};
};
};
};
};
for (istr in rProperties) {
if (_specialPropertyList[istr] != undefined){
rProperties[istr].isSpecialProperty = true;
} else {
if (rScopes[0][istr] == undefined){
printError((((("The property '" + istr) + "' doesn't seem to be a normal object property of ") + String(rScopes[0])) + " or a registered special property."));
};
};
};
for (istr in modifiedProperties) {
if (rProperties[istr] != undefined){
rProperties[istr].modifierParameters = modifiedProperties[istr].modifierParameters;
rProperties[istr].modifierFunction = modifiedProperties[istr].modifierFunction;
};
};
if (typeof(p_obj.transition) == "string"){
trans = p_obj.transition.toLowerCase();
rTransition = _transitionList[trans];
} else {
rTransition = p_obj.transition;
};
if (!Boolean(rTransition)){
rTransition = _transitionList["easeoutexpo"];
};
i = 0;
while (i < rScopes.length) {
nProperties = new Object();
for (istr in rProperties) {
nProperties[istr] = new PropertyInfoObj(rProperties[istr].valueStart, rProperties[istr].valueComplete, rProperties[istr].valueComplete, rProperties[istr].arrayIndex, {}, rProperties[istr].isSpecialProperty, rProperties[istr].modifierFunction, rProperties[istr].modifierParameters);
};
if (p_obj.useFrames == true){
nTween = new TweenListObj(rScopes[i], (_currentTimeFrame + (rDelay / _timeScale)), (_currentTimeFrame + ((rDelay + rTime) / _timeScale)), true, rTransition, p_obj.transitionParams);
} else {
nTween = new TweenListObj(rScopes[i], (_currentTime + ((rDelay * 1000) / _timeScale)), (_currentTime + (((rDelay * 1000) + (rTime * 1000)) / _timeScale)), false, rTransition, p_obj.transitionParams);
};
nTween.properties = nProperties;
nTween.onStart = p_obj.onStart;
nTween.onUpdate = p_obj.onUpdate;
nTween.onComplete = p_obj.onComplete;
nTween.onOverwrite = p_obj.onOverwrite;
nTween.onError = p_obj.onError;
nTween.onStartParams = p_obj.onStartParams;
nTween.onUpdateParams = p_obj.onUpdateParams;
nTween.onCompleteParams = p_obj.onCompleteParams;
nTween.onOverwriteParams = p_obj.onOverwriteParams;
nTween.onStartScope = p_obj.onStartScope;
nTween.onUpdateScope = p_obj.onUpdateScope;
nTween.onCompleteScope = p_obj.onCompleteScope;
nTween.onOverwriteScope = p_obj.onOverwriteScope;
nTween.onErrorScope = p_obj.onErrorScope;
nTween.rounded = p_obj.rounded;
nTween.skipUpdates = p_obj.skipUpdates;
if (((p_obj.overwrite == undefined)) ? autoOverwrite : p_obj.overwrite){
removeTweensByTime(nTween.scope, nTween.properties, nTween.timeStart, nTween.timeComplete);
};
_tweenList.push(nTween);
if ((((rTime == 0)) && ((rDelay == 0)))){
myT = (_tweenList.length - 1);
updateTweenByIndex(myT);
removeTweenByIndex(myT);
};
i++;
};
return (true);
}
public static function registerTransition(p_name:String, p_function:Function):void{
if (!_inited){
init();
};
_transitionList[p_name] = p_function;
}
public static function printError(p_message:String):void{
trace(("## [Tweener] Error: " + p_message));
}
private static function affectTweens(p_affectFunction:Function, p_scope:Object, p_properties:Array):Boolean{
var i:uint;
var affectedProperties:Array;
var j:uint;
var objectProperties:uint;
var slicedTweenIndex:uint;
var affected:Boolean;
if (!Boolean(_tweenList)){
return (false);
};
i = 0;
while (i < _tweenList.length) {
if (((_tweenList[i]) && ((_tweenList[i].scope == p_scope)))){
if (p_properties.length == 0){
p_affectFunction(i);
affected = true;
} else {
affectedProperties = new Array();
j = 0;
while (j < p_properties.length) {
if (Boolean(_tweenList[i].properties[p_properties[j]])){
affectedProperties.push(p_properties[j]);
};
j++;
};
if (affectedProperties.length > 0){
objectProperties = AuxFunctions.getObjectLength(_tweenList[i].properties);
if (objectProperties == affectedProperties.length){
p_affectFunction(i);
affected = true;
} else {
slicedTweenIndex = splitTweens(i, affectedProperties);
p_affectFunction(slicedTweenIndex);
affected = true;
};
};
};
};
i++;
};
return (affected);
}
public static function getTweens(p_scope:Object):Array{
var i:uint;
var pName:String;
if (!Boolean(_tweenList)){
return ([]);
};
var tList:Array = new Array();
i = 0;
while (i < _tweenList.length) {
if (((Boolean(_tweenList[i])) && ((_tweenList[i].scope == p_scope)))){
for (pName in _tweenList[i].properties) {
tList.push(pName);
};
};
i++;
};
return (tList);
}
public static function isTweening(p_scope:Object):Boolean{
var i:uint;
if (!Boolean(_tweenList)){
return (false);
};
i = 0;
while (i < _tweenList.length) {
if (((Boolean(_tweenList[i])) && ((_tweenList[i].scope == p_scope)))){
return (true);
};
i++;
};
return (false);
}
public static function pauseTweenByIndex(p_tween:Number):Boolean{
var tTweening:TweenListObj = _tweenList[p_tween];
if ((((tTweening == null)) || (tTweening.isPaused))){
return (false);
};
tTweening.timePaused = getCurrentTweeningTime(tTweening);
tTweening.isPaused = true;
return (true);
}
public static function getCurrentTweeningTime(p_tweening:Object):Number{
return ((p_tweening.useFrames) ? _currentTimeFrame : _currentTime);
}
public static function getTweenCount(p_scope:Object):Number{
var i:uint;
if (!Boolean(_tweenList)){
return (0);
};
var c:Number = 0;
i = 0;
while (i < _tweenList.length) {
if (((Boolean(_tweenList[i])) && ((_tweenList[i].scope == p_scope)))){
c = (c + AuxFunctions.getObjectLength(_tweenList[i].properties));
};
i++;
};
return (c);
}
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(p_scope:Object, p_properties:Object, p_timeStart:Number, p_timeComplete:Number):Boolean{
var removedLocally:Boolean;
var i:uint;
var pName:String;
var eventScope:Object;
var p_scope = p_scope;
var p_properties = p_properties;
var p_timeStart = p_timeStart;
var p_timeComplete = p_timeComplete;
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;
_tweenList[i].onOverwrite.apply(eventScope, _tweenList[i].onOverwriteParams);
//unresolved jump
var _slot1 = e;
handleError(_tweenList[i], _slot1, "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(p_name:String, p_splitFunction:Function, p_parameters:Array=null):void{
if (!_inited){
init();
};
var sps:SpecialPropertySplitter = new SpecialPropertySplitter(p_splitFunction, p_parameters);
_specialPropertySplitterList[p_name] = sps;
}
public static function removeTweenByIndex(i:Number, p_finalRemoval:Boolean=false):Boolean{
_tweenList[i] = null;
if (p_finalRemoval){
_tweenList.splice(i, 1);
};
return (true);
}
public static function resumeTweens(p_scope:Object, ... _args):Boolean{
var i:uint;
var properties:Array = new Array();
i = 0;
while (i < _args.length) {
if ((((typeof(_args[i]) == "string")) && ((properties.indexOf(_args[i]) == -1)))){
properties.push(_args[i]);
};
i++;
};
return (affectTweens(resumeTweenByIndex, p_scope, properties));
}
public static function pauseTweens(p_scope:Object, ... _args):Boolean{
var i:uint;
var properties:Array = new Array();
i = 0;
while (i < _args.length) {
if ((((typeof(_args[i]) == "string")) && ((properties.indexOf(_args[i]) == -1)))){
properties.push(_args[i]);
};
i++;
};
return (affectTweens(pauseTweenByIndex, p_scope, properties));
}
}
}//package caurina.transitions
Section 11
//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(p_scope:Object, p_timeStart:Number, p_timeComplete:Number, p_useFrames:Boolean, p_transition:Function, p_transitionParams:Object){
super();
scope = p_scope;
timeStart = p_timeStart;
timeComplete = p_timeComplete;
useFrames = p_useFrames;
transition = p_transition;
transitionParams = p_transitionParams;
properties = new Object();
isPaused = false;
timePaused = undefined;
isCaller = false;
updatesSkipped = 0;
timesCalled = 0;
skipUpdates = 0;
hasStarted = false;
}
public function clone(omitEvents:Boolean):TweenListObj{
var pName:String;
var nTween:TweenListObj = new TweenListObj(scope, timeStart, timeComplete, useFrames, transition, transitionParams);
nTween.properties = new Array();
for (pName in properties) {
nTween.properties[pName] = properties[pName].clone();
};
nTween.skipUpdates = skipUpdates;
nTween.updatesSkipped = updatesSkipped;
if (!omitEvents){
nTween.onStart = onStart;
nTween.onUpdate = onUpdate;
nTween.onComplete = onComplete;
nTween.onOverwrite = onOverwrite;
nTween.onError = onError;
nTween.onStartParams = onStartParams;
nTween.onUpdateParams = onUpdateParams;
nTween.onCompleteParams = onCompleteParams;
nTween.onOverwriteParams = onOverwriteParams;
nTween.onStartScope = onStartScope;
nTween.onUpdateScope = onUpdateScope;
nTween.onCompleteScope = onCompleteScope;
nTween.onOverwriteScope = onOverwriteScope;
nTween.onErrorScope = onErrorScope;
};
nTween.rounded = rounded;
nTween.isPaused = isPaused;
nTween.timePaused = timePaused;
nTween.isCaller = isCaller;
nTween.count = count;
nTween.timesCalled = timesCalled;
nTween.waitFrames = waitFrames;
nTween.hasStarted = hasStarted;
return (nTween);
}
public function toString():String{
var i:String;
var returnStr:String = "\n[TweenListObj ";
returnStr = (returnStr + ("scope:" + String(scope)));
returnStr = (returnStr + ", properties:");
var isFirst:Boolean;
for (i in properties) {
if (!isFirst){
returnStr = (returnStr + ",");
};
returnStr = (returnStr + ("[name:" + properties[i].name));
returnStr = (returnStr + (",valueStart:" + properties[i].valueStart));
returnStr = (returnStr + (",valueComplete:" + properties[i].valueComplete));
returnStr = (returnStr + "]");
isFirst = false;
};
returnStr = (returnStr + (", timeStart:" + String(timeStart)));
returnStr = (returnStr + (", timeComplete:" + String(timeComplete)));
returnStr = (returnStr + (", useFrames:" + String(useFrames)));
returnStr = (returnStr + (", transition:" + String(transition)));
returnStr = (returnStr + (", transitionParams:" + String(transitionParams)));
if (skipUpdates){
returnStr = (returnStr + (", skipUpdates:" + String(skipUpdates)));
};
if (updatesSkipped){
returnStr = (returnStr + (", updatesSkipped:" + String(updatesSkipped)));
};
if (Boolean(onStart)){
returnStr = (returnStr + (", onStart:" + String(onStart)));
};
if (Boolean(onUpdate)){
returnStr = (returnStr + (", onUpdate:" + String(onUpdate)));
};
if (Boolean(onComplete)){
returnStr = (returnStr + (", onComplete:" + String(onComplete)));
};
if (Boolean(onOverwrite)){
returnStr = (returnStr + (", onOverwrite:" + String(onOverwrite)));
};
if (Boolean(onError)){
returnStr = (returnStr + (", onError:" + String(onError)));
};
if (onStartParams){
returnStr = (returnStr + (", onStartParams:" + String(onStartParams)));
};
if (onUpdateParams){
returnStr = (returnStr + (", onUpdateParams:" + String(onUpdateParams)));
};
if (onCompleteParams){
returnStr = (returnStr + (", onCompleteParams:" + String(onCompleteParams)));
};
if (onOverwriteParams){
returnStr = (returnStr + (", onOverwriteParams:" + String(onOverwriteParams)));
};
if (onStartScope){
returnStr = (returnStr + (", onStartScope:" + String(onStartScope)));
};
if (onUpdateScope){
returnStr = (returnStr + (", onUpdateScope:" + String(onUpdateScope)));
};
if (onCompleteScope){
returnStr = (returnStr + (", onCompleteScope:" + String(onCompleteScope)));
};
if (onOverwriteScope){
returnStr = (returnStr + (", onOverwriteScope:" + String(onOverwriteScope)));
};
if (onErrorScope){
returnStr = (returnStr + (", onErrorScope:" + String(onErrorScope)));
};
if (rounded){
returnStr = (returnStr + (", rounded:" + String(rounded)));
};
if (isPaused){
returnStr = (returnStr + (", isPaused:" + String(isPaused)));
};
if (timePaused){
returnStr = (returnStr + (", timePaused:" + String(timePaused)));
};
if (isCaller){
returnStr = (returnStr + (", isCaller:" + String(isCaller)));
};
if (count){
returnStr = (returnStr + (", count:" + String(count)));
};
if (timesCalled){
returnStr = (returnStr + (", timesCalled:" + String(timesCalled)));
};
if (waitFrames){
returnStr = (returnStr + (", waitFrames:" + String(waitFrames)));
};
if (hasStarted){
returnStr = (returnStr + (", hasStarted:" + String(hasStarted)));
};
returnStr = (returnStr + "]\n");
return (returnStr);
}
public static function makePropertiesChain(p_obj:Object):Object{
var chainedObject:Object;
var chain:Object;
var currChainObj:Object;
var len:Number;
var i:Number;
var k:Number;
var baseObject:Object = p_obj.base;
if (baseObject){
chainedObject = {};
if ((baseObject is Array)){
chain = [];
k = 0;
while (k < baseObject.length) {
chain.push(baseObject[k]);
k++;
};
} else {
chain = [baseObject];
};
chain.push(p_obj);
len = chain.length;
i = 0;
while (i < len) {
if (chain[i]["base"]){
currChainObj = AuxFunctions.concatObjects(makePropertiesChain(chain[i]["base"]), chain[i]);
} else {
currChainObj = chain[i];
};
chainedObject = AuxFunctions.concatObjects(chainedObject, currChainObj);
i++;
};
if (chainedObject["base"]){
delete chainedObject["base"];
};
return (chainedObject);
//unresolved jump
};
return (p_obj);
}
}
}//package caurina.transitions
Section 12
//CDK (com.coreyoneil.collision.CDK)
package com.coreyoneil.collision {
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import flash.text.*;
public class CDK {
private var colorTransform2:ColorTransform;
private var colorTransform1:ColorTransform;
private var _returnAngleType:String;
private var pixels1:ByteArray;
private var pixels2:ByteArray;
private var bmdResample:BitmapData;
private var _returnAngle:Boolean;
private var transMatrix2:Matrix;
private var rect1:Rectangle;
private var rect2:Rectangle;
private var transMatrix1:Matrix;
protected var objectCheckArray:Array;
private var _alphaThreshold:Number;
private var item1Registration:Point;
private var bmd1:BitmapData;
private var bmd2:BitmapData;
protected var objectArray:Array;
private var item2Registration:Point;
protected var objectCollisionArray:Array;
private var _numChildren:uint;
private var colorExclusionArray:Array;
public function CDK():void{
super();
if (getQualifiedClassName(this) == "com.coreyoneil.collision::CDK"){
throw (new Error("CDK is an abstract class and is not meant for instantiation - use CollisionGroup or CollisionList"));
};
init();
}
public function get returnAngle():Boolean{
return (_returnAngle);
}
public function set returnAngle(value:Boolean):void{
_returnAngle = value;
}
protected function findCollisions(item1, item2):void{
var item1xDiff:Number;
var item1yDiff:Number;
var locY:Number;
var locX:Number;
var locStage:Point;
var alpha1:uint;
var alpha2:uint;
var colorFlag:Boolean;
var red1:uint;
var red2:uint;
var green1:uint;
var green2:uint;
var blue1:uint;
var blue2:uint;
var colorObj:Object;
var aPlus:uint;
var aMinus:uint;
var rPlus:uint;
var rMinus:uint;
var gPlus:uint;
var gMinus:uint;
var bPlus:uint;
var bMinus:uint;
var item1Flags:uint;
var item2Flags:uint;
var n:uint;
var angle:Number;
var recordedCollision:Object;
var item1 = item1;
var item2 = item2;
var item1_isText:Boolean;
var item2_isText:Boolean;
if ((item1 is TextField)){
item1_isText = ((item1.antiAliasType)=="advanced") ? true : false;
item1.antiAliasType = ((item1.antiAliasType)=="advanced") ? "normal" : item1.antiAliasType;
};
if ((item2 is TextField)){
item2_isText = ((item2.antiAliasType)=="advanced") ? true : false;
item2.antiAliasType = ((item2.antiAliasType)=="advanced") ? "normal" : item2.antiAliasType;
};
colorTransform1 = item1.transform.colorTransform;
colorTransform2 = item2.transform.colorTransform;
item1Registration = new Point();
item2Registration = new Point();
item1Registration = item1.localToGlobal(item1Registration);
item2Registration = item2.localToGlobal(item2Registration);
bmd1 = new BitmapData(item1.width, item1.height, true, 0xFFFFFF);
bmd2 = new BitmapData(item1.width, item1.height, true, 0xFFFFFF);
transMatrix1 = item1.transform.matrix;
var currentObj:* = item1;
while (currentObj.parent != null) {
transMatrix1.concat(currentObj.parent.transform.matrix);
currentObj = currentObj.parent;
};
rect1 = item1.getBounds(currentObj);
if (item1 != currentObj){
rect1.x = (rect1.x + currentObj.x);
rect1.y = (rect1.y + currentObj.y);
};
var _local4 = (item1Registration.x - rect1.left);
item1xDiff = _local4;
transMatrix1.tx = _local4;
_local4 = (item1Registration.y - rect1.top);
item1yDiff = _local4;
transMatrix1.ty = _local4;
transMatrix2 = item2.transform.matrix;
currentObj = item2;
while (currentObj.parent != null) {
transMatrix2.concat(currentObj.parent.transform.matrix);
currentObj = currentObj.parent;
};
transMatrix2.tx = (item2Registration.x - rect1.left);
transMatrix2.ty = (item2Registration.y - rect1.top);
bmd1.draw(item1, transMatrix1, colorTransform1, null, null, true);
bmd2.draw(item2, transMatrix2, colorTransform2, null, null, true);
pixels1 = bmd1.getPixels(new Rectangle(0, 0, bmd1.width, bmd1.height));
pixels2 = bmd2.getPixels(new Rectangle(0, 0, bmd1.width, bmd1.height));
var k:uint;
var value1:uint;
var value2:uint;
var collisionPoint:Number = -1;
var overlap:Boolean;
var overlapping:Array = [];
var hasColors:int = colorExclusionArray.length;
pixels1.position = 0;
pixels2.position = 0;
var pixelLength:int = pixels1.length;
for (;k < pixelLength;(alpha1 = ((value1 >> 24) & 0xFF)), (alpha2 = ((value2 >> 24) & 0xFF)), if ((((alpha1 > _alphaThreshold)) && ((alpha2 > _alphaThreshold)))){
colorFlag = false;
if (hasColors){
red1 = ((value1 >> 16) & 0xFF);
red2 = ((value2 >> 16) & 0xFF);
green1 = ((value1 >> 8) & 0xFF);
green2 = ((value2 >> 8) & 0xFF);
blue1 = (value1 & 0xFF);
blue2 = (value2 & 0xFF);
n = 0;
while (n < hasColors) {
colorObj = Object(colorExclusionArray[n]);
item1Flags = 0;
item2Flags = 0;
if ((((blue1 >= colorObj.bMinus)) && ((blue1 <= colorObj.bPlus)))){
item1Flags = (item1Flags + 1);
};
if ((((blue2 >= colorObj.bMinus)) && ((blue2 <= colorObj.bPlus)))){
item2Flags = (item2Flags + 1);
};
if ((((green1 >= colorObj.gMinus)) && ((green1 <= colorObj.gPlus)))){
item1Flags = (item1Flags + 1);
};
if ((((green2 >= colorObj.gMinus)) && ((green2 <= colorObj.gPlus)))){
item2Flags = (item2Flags + 1);
};
if ((((red1 >= colorObj.rMinus)) && ((red1 <= colorObj.rPlus)))){
item1Flags = (item1Flags + 1);
};
if ((((red2 >= colorObj.rMinus)) && ((red2 <= colorObj.rPlus)))){
item2Flags = (item2Flags + 1);
};
if ((((alpha1 >= colorObj.aMinus)) && ((alpha1 <= colorObj.aPlus)))){
item1Flags = (item1Flags + 1);
};
if ((((alpha2 >= colorObj.aMinus)) && ((alpha2 <= colorObj.aPlus)))){
item2Flags = (item2Flags + 1);
};
if ((((item1Flags == 4)) || ((item2Flags == 4)))){
colorFlag = true;
};
n = (n + 1);
};
};
if (!colorFlag){
overlap = true;
collisionPoint = (k >> 2);
locY = (collisionPoint / bmd1.width);
locX = (collisionPoint % bmd1.width);
locY = (locY - item1yDiff);
locX = (locX - item1xDiff);
locStage = item1.localToGlobal(new Point(locX, locY));
overlapping.push(locStage);
};
}) {
k = pixels1.position;
value1 = pixels1.readUnsignedInt();
value2 = pixels2.readUnsignedInt();
continue;
var _slot1 = e;
break;
};
if (overlap){
angle = (_returnAngle) ? findAngle(item1, item2) : 0;
recordedCollision = {object1:item1, object2:item2, angle:angle, overlapping:overlapping};
objectCollisionArray.push(recordedCollision);
};
if (item1_isText){
item1.antiAliasType = "advanced";
};
if (item2_isText){
item2.antiAliasType = "advanced";
};
_local4 = false;
item2_isText = _local4;
item1_isText = _local4;
}
private function init():void{
objectCheckArray = [];
objectCollisionArray = [];
objectArray = [];
colorExclusionArray = [];
_alphaThreshold = 0;
_returnAngle = true;
_returnAngleType = "RADIANS";
}
public function dispose():void{
objectArray = [];
}
public function excludeColor(theColor:uint, alphaRange:uint=0xFF, redRange:uint=20, greenRange:uint=20, blueRange:uint=20):void{
var aPlus:uint;
var aMinus:uint;
var rPlus:uint;
var rMinus:uint;
var gPlus:uint;
var gMinus:uint;
var bPlus:uint;
var bMinus:uint;
var numColors:int = colorExclusionArray.length;
var i:uint;
while (i < numColors) {
if (colorExclusionArray[i].color == theColor){
throw (new Error((("Color could not be added - color already in the exclusion list [" + theColor) + "]")));
};
i++;
};
aPlus = (((theColor >> 24) & 0xFF) + alphaRange);
aMinus = (aPlus - (alphaRange << 1));
rPlus = (((theColor >> 16) & 0xFF) + redRange);
rMinus = (rPlus - (redRange << 1));
gPlus = (((theColor >> 8) & 0xFF) + greenRange);
gMinus = (gPlus - (greenRange << 1));
bPlus = ((theColor & 0xFF) + blueRange);
bMinus = (bPlus - (blueRange << 1));
var colorExclusion:Object = {color:theColor, aPlus:aPlus, aMinus:aMinus, rPlus:rPlus, rMinus:rMinus, gPlus:gPlus, gMinus:gMinus, bPlus:bPlus, bMinus:bMinus};
colorExclusionArray.push(colorExclusion);
}
public function get numChildren():uint{
return (objectArray.length);
}
public function get alphaThreshold():Number{
return (_alphaThreshold);
}
public function removeItem(obj):void{
var loc:int = objectArray.indexOf(obj);
if (loc > -1){
objectArray.splice(loc, 1);
} else {
throw (new Error((obj + " could not be removed - object not found in item list.")));
};
}
public function set returnAngleType(returnType:String):void{
returnType = returnType.toUpperCase();
switch (returnType){
case "DEGREES":
case "DEGREE":
case "DEG":
case "DEGS":
_returnAngleType = "DEGREES";
break;
case "RADIANS":
case "RADIAN":
case "RAD":
case "RADS":
_returnAngleType = "RADIANS";
break;
default:
throw (new Error("returnAngleType expects 'DEGREES' or 'RADIANS'"));
};
}
private function findAngle(item1:DisplayObject, item2:DisplayObject):Number{
var pixel:uint;
var thisAlpha:uint;
var lastAlpha:int;
var edgePoint:int;
var k:uint;
var upperLimit:int;
var colorFlag:Boolean;
var red1:uint;
var green1:uint;
var blue1:uint;
var colorObj:Object;
var a:uint;
var r:uint;
var g:uint;
var b:uint;
var item1Flags:uint;
var n:uint;
var item1 = item1;
var item2 = item2;
var center:Point = new Point((item1.width >> 1), (item1.height >> 1));
var pixels:ByteArray = pixels2;
transMatrix2.tx = (transMatrix2.tx + center.x);
transMatrix2.ty = (transMatrix2.ty + center.y);
bmdResample = new BitmapData((item1.width << 1), (item1.height << 1), true, 0xFFFFFF);
bmdResample.draw(item2, transMatrix2, colorTransform2, null, null, true);
pixels = bmdResample.getPixels(new Rectangle(0, 0, bmdResample.width, bmdResample.height));
center.x = (bmdResample.width >> 1);
center.y = (bmdResample.height >> 1);
var columnHeight:uint = Math.round(bmdResample.height);
var rowWidth:uint = Math.round(bmdResample.width);
var edgeArray:Array = [];
var hasColors:int = colorExclusionArray.length;
var j:uint;
while (j < columnHeight) {
k = ((j * rowWidth) << 2);
pixels.position = k;
lastAlpha = -1;
upperLimit = (((j + 1) * rowWidth) << 2);
for (;k < upperLimit;(thisAlpha = ((pixel >> 24) & 0xFF)), if (lastAlpha == -1){
lastAlpha = thisAlpha;
} else {
if (thisAlpha > _alphaThreshold){
colorFlag = false;
if (hasColors){
red1 = ((pixel >> 16) & 0xFF);
green1 = ((pixel >> 8) & 0xFF);
blue1 = (pixel & 0xFF);
n = 0;
while (n < hasColors) {
colorObj = Object(colorExclusionArray[n]);
item1Flags = 0;
if ((((blue1 >= colorObj.bMinus)) && ((blue1 <= colorObj.bPlus)))){
item1Flags = (item1Flags + 1);
};
if ((((green1 >= colorObj.gMinus)) && ((green1 <= colorObj.gPlus)))){
item1Flags = (item1Flags + 1);
};
if ((((red1 >= colorObj.rMinus)) && ((red1 <= colorObj.rPlus)))){
item1Flags = (item1Flags + 1);
};
if ((((thisAlpha >= colorObj.aMinus)) && ((thisAlpha <= colorObj.aPlus)))){
item1Flags = (item1Flags + 1);
};
if (item1Flags == 4){
colorFlag = true;
};
n = (n + 1);
};
};
if (!colorFlag){
edgeArray.push((k >> 2));
};
};
}) {
k = pixels.position;
pixel = pixels.readUnsignedInt();
continue;
var _slot1 = e;
break;
};
j = (j + 1);
};
var numEdges:int = edgeArray.length;
var slopeYAvg:Number = 0;
var slopeXAvg:Number = 0;
j = 0;
while (j < numEdges) {
edgePoint = int(edgeArray[j]);
slopeYAvg = (slopeYAvg + (center.y - (edgePoint / rowWidth)));
slopeXAvg = (slopeXAvg + ((edgePoint % rowWidth) - center.x));
j = (j + 1);
};
var average:Number = -(Math.atan2(slopeYAvg, slopeXAvg));
average = ((_returnAngleType == "RADIANS")) ? average : (average * 57.2957795);
return (average);
}
public function addItem(obj):void{
if ((obj is DisplayObject)){
objectArray.push(obj);
} else {
throw (new Error((("Cannot add item: " + obj) + " - item must be a Display Object.")));
};
}
public function get returnAngleType():String{
return (_returnAngleType);
}
public function set alphaThreshold(theAlpha:Number):void{
if ((((theAlpha <= 1)) && ((theAlpha >= 0)))){
_alphaThreshold = (theAlpha * 0xFF);
} else {
throw (new Error("alphaThreshold expects a value from 0 to 1"));
};
}
public function removeExcludeColor(theColor:uint):void{
var found:Boolean;
var numColors:int = colorExclusionArray.length;
var i:uint;
while (i < numColors) {
if (colorExclusionArray[i].color == theColor){
colorExclusionArray.splice(i, 1);
found = true;
break;
};
i++;
};
if (!found){
throw (new Error((("Color could not be removed - color not found in exclusion list [" + theColor) + "]")));
};
}
protected function clearArrays():void{
objectCheckArray = [];
objectCollisionArray = [];
}
}
}//package com.coreyoneil.collision
Section 13
//CollisionList (com.coreyoneil.collision.CollisionList)
package com.coreyoneil.collision {
import flash.display.*;
public class CollisionList extends CDK {
public function CollisionList(target, ... _args):void{
super();
addItem(target);
var i:uint;
while (i < _args.length) {
addItem(_args[i]);
i++;
};
}
public function checkCollisions():Array{
var item2:DisplayObject;
clearArrays();
var NUM_OBJS:uint = objectArray.length;
var item1:* = DisplayObject(objectArray[0]);
var i:uint = 1;
while (i < NUM_OBJS) {
item2 = DisplayObject(objectArray[i]);
if (item1.hitTestObject(item2)){
if ((item2.width * item2.height) > (item1.width * item1.height)){
objectCheckArray.push([item1, item2]);
} else {
objectCheckArray.push([item2, item1]);
};
};
i++;
};
NUM_OBJS = objectCheckArray.length;
i = 0;
while (i < NUM_OBJS) {
findCollisions(DisplayObject(objectCheckArray[i][0]), DisplayObject(objectCheckArray[i][1]));
i++;
};
return (objectCollisionArray);
}
public function swapTarget(target):void{
if ((target is DisplayObject)){
objectArray[0] = target;
} else {
throw (new Error((("Cannot swap target: " + target) + " - item must be a Display Object.")));
};
}
override public function removeItem(obj):void{
var loc:int = objectArray.indexOf(obj);
if (loc > 0){
objectArray.splice(loc, 1);
} else {
if (loc == 0){
throw (new Error("You cannot remove the target from CollisionList. Use swapTarget to change the target."));
};
throw (new Error((obj + " could not be removed - object not found in item list.")));
};
}
}
}//package com.coreyoneil.collision
Section 14
//Color (fl.motion.Color)
package fl.motion {
import flash.display.*;
import flash.geom.*;
public class Color extends ColorTransform {
private var _tintColor:Number;// = 0
private var _tintMultiplier:Number;// = 0
public function Color(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
private function deriveTintColor():uint{
var _local1:Number = (1 / this.tintMultiplier);
var _local2:uint = Math.round((this.redOffset * _local1));
var _local3:uint = Math.round((this.greenOffset * _local1));
var _local4:uint = Math.round((this.blueOffset * _local1));
var _local5:uint = (((_local2 << 16) | (_local3 << 8)) | _local4);
return (_local5);
}
public function set brightness(_arg1:Number):void{
if (_arg1 > 1){
_arg1 = 1;
} else {
if (_arg1 < -1){
_arg1 = -1;
};
};
var _local2:Number = (1 - Math.abs(_arg1));
var _local3:Number = 0;
if (_arg1 > 0){
_local3 = (_arg1 * 0xFF);
};
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = _local2));
this.redOffset = (this.greenOffset = (this.blueOffset = _local3));
}
private function parseXML(_arg1:XML=null):Color{
var _local3:XML;
var _local4:String;
var _local5:uint;
if (!_arg1){
return (this);
};
var _local2:XML = _arg1.elements()[0];
if (!_local2){
return (this);
};
for each (_local3 in _local2.attributes()) {
_local4 = _local3.localName();
if (_local4 == "tintColor"){
_local5 = (Number(_local3.toString()) as uint);
this.tintColor = _local5;
} else {
this[_local4] = Number(_local3.toString());
};
};
return (this);
}
public function get tintColor():uint{
return (this._tintColor);
}
public function set tintColor(_arg1:uint):void{
this.setTint(_arg1, this.tintMultiplier);
}
public function get brightness():Number{
return ((this.redOffset) ? (1 - this.redMultiplier) : (this.redMultiplier - 1));
}
public function set tintMultiplier(_arg1:Number):void{
this.setTint(this.tintColor, _arg1);
}
public function get tintMultiplier():Number{
return (this._tintMultiplier);
}
public function setTint(_arg1:uint, _arg2:Number):void{
this._tintColor = _arg1;
this._tintMultiplier = _arg2;
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = (1 - _arg2)));
var _local3:uint = ((_arg1 >> 16) & 0xFF);
var _local4:uint = ((_arg1 >> 8) & 0xFF);
var _local5:uint = (_arg1 & 0xFF);
this.redOffset = Math.round((_local3 * _arg2));
this.greenOffset = Math.round((_local4 * _arg2));
this.blueOffset = Math.round((_local5 * _arg2));
}
public static function interpolateColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number = (1 - _arg3);
var _local5:uint = ((_arg1 >> 24) & 0xFF);
var _local6:uint = ((_arg1 >> 16) & 0xFF);
var _local7:uint = ((_arg1 >> 8) & 0xFF);
var _local8:uint = (_arg1 & 0xFF);
var _local9:uint = ((_arg2 >> 24) & 0xFF);
var _local10:uint = ((_arg2 >> 16) & 0xFF);
var _local11:uint = ((_arg2 >> 8) & 0xFF);
var _local12:uint = (_arg2 & 0xFF);
var _local13:uint = ((_local5 * _local4) + (_local9 * _arg3));
var _local14:uint = ((_local6 * _local4) + (_local10 * _arg3));
var _local15:uint = ((_local7 * _local4) + (_local11 * _arg3));
var _local16:uint = ((_local8 * _local4) + (_local12 * _arg3));
var _local17:uint = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16);
return (_local17);
}
public static function interpolateTransform(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{
var _local4:Number = (1 - _arg3);
var _local5:ColorTransform = new ColorTransform(((_arg1.redMultiplier * _local4) + (_arg2.redMultiplier * _arg3)), ((_arg1.greenMultiplier * _local4) + (_arg2.greenMultiplier * _arg3)), ((_arg1.blueMultiplier * _local4) + (_arg2.blueMultiplier * _arg3)), ((_arg1.alphaMultiplier * _local4) + (_arg2.alphaMultiplier * _arg3)), ((_arg1.redOffset * _local4) + (_arg2.redOffset * _arg3)), ((_arg1.greenOffset * _local4) + (_arg2.greenOffset * _arg3)), ((_arg1.blueOffset * _local4) + (_arg2.blueOffset * _arg3)), ((_arg1.alphaOffset * _local4) + (_arg2.alphaOffset * _arg3)));
return (_local5);
}
public static function fromXML(_arg1:XML):Color{
return (Color(new (Color).parseXML(_arg1)));
}
}
}//package fl.motion
Section 15
//ARM_50 (snack_game_fla.ARM_50)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class ARM_50 extends MovieClip {
public function ARM_50(){
addFrameScript(0, frame1, 30, frame31, 38, frame39);
}
function frame39(){
gotoAndStop("shakeLoop");
}
function frame31(){
stop();
}
function frame1(){
stop();
}
}
}//package snack_game_fla
Section 16
//backarm_47 (snack_game_fla.backarm_47)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class backarm_47 extends MovieClip {
public function backarm_47(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package snack_game_fla
Section 17
//brady_49 (snack_game_fla.brady_49)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class brady_49 extends MovieClip {
public function brady_49(){
addFrameScript(0, frame1, 13, frame14);
}
function frame14(){
stop();
}
function frame1(){
stop();
}
}
}//package snack_game_fla
Section 18
//bradybody_38 (snack_game_fla.bradybody_38)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class bradybody_38 extends MovieClip {
public function bradybody_38(){
addFrameScript(0, frame1, 15, frame16, 36, frame37, 49, frame50);
}
function frame50(){
gotoAndStop("eaten");
}
function frame37(){
stop();
}
function frame16(){
gotoAndStop("normal");
}
function frame1(){
stop();
}
}
}//package snack_game_fla
Section 19
//burgermenu_3 (snack_game_fla.burgermenu_3)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class burgermenu_3 extends MovieClip {
public function burgermenu_3(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package snack_game_fla
Section 20
//cape_24 (snack_game_fla.cape_24)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class cape_24 extends MovieClip {
public function cape_24(){
addFrameScript(24, frame25);
}
function frame25(){
stop();
}
}
}//package snack_game_fla
Section 21
//capeglow_20 (snack_game_fla.capeglow_20)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class capeglow_20 extends MovieClip {
public function capeglow_20(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package snack_game_fla
Section 22
//crumbs_60 (snack_game_fla.crumbs_60)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class crumbs_60 extends MovieClip {
public function crumbs_60(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package snack_game_fla
Section 23
//dog2_19 (snack_game_fla.dog2_19)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class dog2_19 extends MovieClip {
public var cape_mc:MovieClip;
public var head_mc:MovieClip;
public var glow_mc:MovieClip;
public var float_mc:MovieClip;
public function dog2_19(){
addFrameScript(0, frame1, 21, frame22);
}
function frame1(){
stop();
}
function frame22(){
gotoAndPlay("run");
}
}
}//package snack_game_fla
Section 24
//dogfloatingsymbols_21 (snack_game_fla.dogfloatingsymbols_21)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class dogfloatingsymbols_21 extends MovieClip {
public function dogfloatingsymbols_21(){
addFrameScript(0, frame1, 34, frame35, 50, frame51);
}
function frame51(){
stop();
}
function frame1(){
stop();
}
function frame35(){
stop();
visible = false;
}
}
}//package snack_game_fla
Section 25
//head_48 (snack_game_fla.head_48)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class head_48 extends MovieClip {
public var message_mc:MovieClip;
public var hair_mc:MovieClip;
public function head_48(){
addFrameScript(0, frame1, 1, frame2, 86, frame87, 90, frame91, 96, frame97, 104, frame105, 145, frame146, 158, frame159, 172, frame173);
}
function frame173(){
gotoAndStop("smile");
}
function frame1(){
stop();
message_mc.visible = false;
}
function frame2(){
parent.parent.dog._isChewingObject = false;
parent.parent.dog._isConed = false;
}
function frame159(){
gotoAndStop("smile");
}
function frame105(){
gotoAndStop("smile");
}
function frame97(){
message_mc.visible = false;
}
function frame87(){
message_mc.visible = true;
}
function frame146(){
gotoAndStop("smile");
}
function frame91(){
stop();
}
}
}//package snack_game_fla
Section 26
//head2_22 (snack_game_fla.head2_22)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class head2_22 extends MovieClip {
public var message_mc:MovieClip;
public function head2_22(){
addFrameScript(0, frame1, 33, frame34, 52, frame53);
}
function frame1(){
stop();
message_mc.visible = false;
}
function frame53(){
gotoAndStop("smile");
}
function frame34(){
gotoAndPlay("smile");
}
}
}//package snack_game_fla
Section 27
//HELP_8 (snack_game_fla.HELP_8)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class HELP_8 extends MovieClip {
public var next_btn:SimpleButton;
public function HELP_8(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package snack_game_fla
Section 28
//hoop_68 (snack_game_fla.hoop_68)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class hoop_68 extends MovieClip {
public function hoop_68(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package snack_game_fla
Section 29
//horsebody_29 (snack_game_fla.horsebody_29)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class horsebody_29 extends MovieClip {
public function horsebody_29(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package snack_game_fla
Section 30
//horsehead_30 (snack_game_fla.horsehead_30)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class horsehead_30 extends MovieClip {
public function horsehead_30(){
addFrameScript(0, frame1, 119, frame120);
}
function frame120(){
parent.scream(false);
}
function frame1(){
stop();
}
}
}//package snack_game_fla
Section 31
//horseleg1_27 (snack_game_fla.horseleg1_27)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class horseleg1_27 extends MovieClip {
public function horseleg1_27(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package snack_game_fla
Section 32
//horseleg2_31 (snack_game_fla.horseleg2_31)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class horseleg2_31 extends MovieClip {
public function horseleg2_31(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package snack_game_fla
Section 33
//horseleg3_32 (snack_game_fla.horseleg3_32)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class horseleg3_32 extends MovieClip {
public function horseleg3_32(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package snack_game_fla
Section 34
//horseleg4_28 (snack_game_fla.horseleg4_28)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class horseleg4_28 extends MovieClip {
public function horseleg4_28(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package snack_game_fla
Section 35
//intro_1 (snack_game_fla.intro_1)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class intro_1 extends MovieClip {
public var points_mc:MovieClip;
public var facebook_btn:SimpleButton;
public var newScore_mc:MovieClip;
public var burgerMenu_mc:MovieClip;
public var play_btn:SimpleButton;
public var help_mc:MovieClip;
public var rexhead_mc:MovieClip;
public var leaderboard_mc:MovieClip;
public var loading_mc:MovieClip;
public var help_btn:SimpleButton;
public function intro_1(){
addFrameScript(26, frame27, 47, frame48, 77, frame78);
}
function frame48(){
if (parent._isLoading){
gotoAndPlay("loadLoop");
} else {
stop();
};
}
function frame78(){
stop();
}
function frame27(){
if (parent._isLoading){
gotoAndPlay("loadLoop");
} else {
stop();
};
}
}
}//package snack_game_fla
Section 36
//introinstructions_52 (snack_game_fla.introinstructions_52)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class introinstructions_52 extends MovieClip {
public var score_txt:TextField;
public function introinstructions_52(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package snack_game_fla
Section 37
//pointstotal_10 (snack_game_fla.pointstotal_10)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class pointstotal_10 extends MovieClip {
public var points_txt:TextField;
public function pointstotal_10(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package snack_game_fla
Section 38
//Rex_46 (snack_game_fla.Rex_46)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class Rex_46 extends MovieClip {
public var float_mc:MovieClip;
public var glow_mc:MovieClip;
public var head_mc:MovieClip;
public var arm_mc:MovieClip;
public var arm2_mc:MovieClip;
public function Rex_46(){
addFrameScript(0, frame1, 1, frame2, 15, frame16, 20, frame21, 42, frame43, 58, frame59);
}
function frame1(){
stop();
}
function frame2(){
parent.dog.armTo("fist");
}
function frame21(){
gotoAndPlay("run");
}
function frame59(){
parent.dog.armTo("open");
}
function frame43(){
parent.dog.armTo("open");
}
function frame16(){
parent.dog.armTo("open");
}
}
}//package snack_game_fla
Section 39
//rexintrohead_5 (snack_game_fla.rexintrohead_5)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class rexintrohead_5 extends MovieClip {
public function rexintrohead_5(){
addFrameScript(157, frame158, 493, frame494, 848, frame849);
}
function frame849(){
stop();
}
function frame494(){
stop();
}
function frame158(){
stop();
}
}
}//package snack_game_fla
Section 40
//scale_40 (snack_game_fla.scale_40)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class scale_40 extends MovieClip {
public function scale_40(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package snack_game_fla
Section 41
//tony_34 (snack_game_fla.tony_34)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class tony_34 extends MovieClip {
public function tony_34(){
addFrameScript(0, frame1, 18, frame19);
}
function frame1(){
stop();
}
function frame19(){
parent.parent.veggieBomb();
}
}
}//package snack_game_fla
Section 42
//tonyhead_33 (snack_game_fla.tonyhead_33)
package snack_game_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
public dynamic class tonyhead_33 extends MovieClip {
public function tonyhead_33(){
addFrameScript(0, frame1, 524, frame525);
}
function frame525(){
parent.speechDone();
}
function frame1(){
stop();
}
}
}//package snack_game_fla
Section 43
//Apple (Apple)
package {
public class Apple extends SpecialObject {
public function Apple(){
super();
}
}
}//package
Section 44
//bigeat1 (bigeat1)
package {
import flash.media.*;
public dynamic class bigeat1 extends Sound {
}
}//package
Section 45
//bigeat2 (bigeat2)
package {
import flash.media.*;
public dynamic class bigeat2 extends Sound {
}
}//package
Section 46
//bigeat3 (bigeat3)
package {
import flash.media.*;
public dynamic class bigeat3 extends Sound {
}
}//package
Section 47
//BigTreat (BigTreat)
package {
import flash.display.*;
public class BigTreat extends Treat {
public var bitesEaten:int;// = 0
public var bigTreat_mc:MovieClip;
public var bitesEaten_dog1:int;// = 0
public var bitesEaten_dog2:int;// = 0
public var totalBites:int;// = 4
public var btlt_mc;
public var crumbs_mc:MovieClip;
public var _isBiteable2:Boolean;
public var btrt_mc;
public var uplt_mc;
public var uprt_mc;
public var _isBiteable:Boolean;
public function BigTreat(){
super();
btlt_mc = bigTreat_mc.btlt_mc;
uplt_mc = bigTreat_mc.uplt_mc;
btrt_mc = bigTreat_mc.btrt_mc;
uprt_mc = bigTreat_mc.uprt_mc;
_isBiteable = true;
_isBiteable2 = true;
mass = 10;
pointValue = 100;
id = "BigTreat";
vr = 0;
}
public function activate():void{
_isBiteable = true;
}
public function activate2():void{
_isBiteable2 = true;
}
function eatBigTreat(side:String="lt", dogID:int=1):void{
var bite:MovieClip;
if ((((side == "lt")) && (((!(btlt_mc.visible)) && (!(uplt_mc.visible)))))){
side = "rt";
};
if ((((side == "rt")) && (((!(btrt_mc.visible)) && (!(uprt_mc.visible)))))){
side = "lt";
};
if (side == "lt"){
if (btlt_mc.visible){
bite = btlt_mc;
} else {
bite = uplt_mc;
};
} else {
if (btrt_mc.visible){
bite = btrt_mc;
} else {
bite = uprt_mc;
};
};
bite.visible = false;
bitesEaten++;
var _local4 = this;
var _local5 = ("bitesEaten_dog" + dogID);
var _local6 = (_local4[_local5] + 1);
_local4[_local5] = _local6;
}
}
}//package
Section 48
//Bill (Bill)
package {
import flash.display.*;
import flash.utils.*;
public class Bill extends MovieClip {
public var laser_mc:Laser;
public var head_mc:Billhead;
public var _isEatable:Boolean;// = false
public var rb:int;
public var _isDone:Boolean;// = false
public var _isWaitingToFire:Boolean;// = false
public var _isAboveGround:Boolean;// = false
public var maxDelay:int;// = 5000
public function Bill(){
addFrameScript(0, frame1, 25, frame26, 40, frame41, 41, frame42, 54, frame55, 55, frame56, 68, frame69, 76, frame77, 88, frame89, 119, frame120, 132, frame133, 157, frame158);
super();
}
public function done():void{
_isDone = true;
}
function frame42(){
_isWaitingToFire = false;
laser_mc.activate();
}
function frame133(){
laser_mc.activate(false);
}
function frame158(){
randomWait();
}
public function startBill():void{
enterScreen();
}
function frame55(){
_isWaitingToFire = true;
stop();
}
function frame56(){
_isWaitingToFire = false;
}
public function restart():void{
_isDone = false;
randomWait();
}
public function randomWait():void{
stop();
if (_isDone){
return;
};
setTimeout(enterScreen, (1200 + (Math.random() * maxDelay)));
_isAboveGround = false;
_isEatable = false;
}
function frame77(){
randomWait();
}
function frame120(){
laser_mc.activate();
parent.playFX("laser_", 2);
}
public function enterScreen():void{
var lbl:String;
var r:int = (Math.random() * 4);
parent.billEnteringScreen();
if (r == 0){
lbl = "enter_ground";
_isAboveGround = true;
} else {
lbl = "enter_side";
_isEatable = true;
};
gotoAndPlay(lbl);
}
function frame1(){
stop();
laser_mc.activate(false);
}
function frame89(){
y = 530;
x = (100 + (Math.random() * 650));
if (x < 300){
scaleX = -1;
} else {
scaleX = 1;
};
}
public function fire():void{
play();
_isWaitingToFire = false;
}
function frame69(){
laser_mc.activate(false);
}
function frame26(){
y = (75 + (Math.random() * 100));
rb = (Math.random() * 2);
if (rb == 0){
scaleX = -1;
x = 0;
} else {
scaleX = 1;
x = 930;
};
}
function frame41(){
_isWaitingToFire = true;
stop();
}
public function fasterDelay():void{
maxDelay = (maxDelay - 300);
if (maxDelay < 1500){
maxDelay = 1500;
};
}
}
}//package
Section 49
//bill_1 (bill_1)
package {
import flash.media.*;
public dynamic class bill_1 extends Sound {
}
}//package
Section 50
//bill_2 (bill_2)
package {
import flash.media.*;
public dynamic class bill_2 extends Sound {
}
}//package
Section 51
//bill_3 (bill_3)
package {
import flash.media.*;
public dynamic class bill_3 extends Sound {
}
}//package
Section 52
//bill_4 (bill_4)
package {
import flash.media.*;
public dynamic class bill_4 extends Sound {
}
}//package
Section 53
//bill_5 (bill_5)
package {
import flash.media.*;
public dynamic class bill_5 extends Sound {
}
}//package
Section 54
//Billhead (Billhead)
package {
import flash.display.*;
public dynamic class Billhead extends MovieClip {
}
}//package
Section 55
//Brady (Brady)
package {
import flash.display.*;
import flash.utils.*;
public class Brady extends MovieClip {
public var _isDead:Boolean;// = false
public var body_mc:MovieClip;
public var football_mc:MovieClip;
public var _isActive:Boolean;// = false
public var biteCount:int;// = 0
public var _isEaten:Boolean;// = false
public function Brady(){
addFrameScript(0, frame1, 57, frame58, 113, frame114, 155, frame156, 200, frame201, 239, frame240, 290, frame291, 335, frame336, 356, frame357);
super();
}
public function die():void{
_isDead = true;
if (currentFrame < 340){
gotoAndPlay("dead");
};
}
public function throwBall():void{
if (!_isEaten){
body_mc.gotoAndPlay("throw");
} else {
body_mc.gotoAndPlay("eatThrow");
};
if (_isDead){
die();
};
}
public function reActivate():void{
_isActive = true;
}
function frame114(){
throwBall();
}
function frame357(){
stop();
visible = false;
}
function frame336(){
if (_isDead){
die();
} else {
gotoAndPlay("loop2");
};
}
function frame156(){
gotoAndPlay("loop");
}
function frame58(){
throwBall();
}
public function eat():Boolean{
biteCount++;
if (!_isActive){
return (false);
};
if (!_isEaten){
trace("BITE");
_isEaten = true;
body_mc.gotoAndStop("bite");
gotoAndPlay("scramble");
_isActive = false;
setTimeout(reActivate, 1000);
parent.playFX("bigeat", 3);
parent.playFX("brady_scream1");
parent.playRexAudio("rex_brady_eat", -1, 1, false, true);
return (false);
};
_isDead = true;
_isActive = false;
die();
return (true);
}
function frame240(){
throwBall();
}
function frame1(){
stop();
}
public function go():void{
play();
_isActive = true;
}
function frame201(){
throwBall();
}
function frame291(){
throwBall();
}
}
}//package
Section 56
//brady_scream1 (brady_scream1)
package {
import flash.media.*;
public dynamic class brady_scream1 extends Sound {
}
}//package
Section 57
//brady_scream2 (brady_scream2)
package {
import flash.media.*;
public dynamic class brady_scream2 extends Sound {
}
}//package
Section 58
//Cape (Cape)
package {
public class Cape extends SpecialObject {
public function Cape(){
addFrameScript(90, frame91);
super();
}
function frame91(){
stop();
}
}
}//package
Section 59
//Carrot (Carrot)
package {
public class Carrot extends SpecialObject {
public function Carrot(){
super();
}
}
}//package
Section 60
//Dog (Dog)
package {
import flash.display.*;
import flash.utils.*;
public class Dog {
public var _isWeighted:Boolean;// = false
public var _isChewingObject:Boolean;// = false
public var tempX:Number;
public var power:Number;// = 7
public var prevY:Number;// = 0
public var chewToy:String;
public var max_xspeed:Number;// = 12
public var _isAssed:Boolean;// = false
public var max_xFlySpeed:Number;// = 24
public var tempY:Number;
public var xAcceleration:Number;// = 0
public var _isLasered:Boolean;// = false
public var yDiff:Number;// = 0
public var maxJumpHairPower:Number;// = 66
public var _isTired:Boolean;// = false
private var _mc:MovieClip;
public var _isRunning:Boolean;// = false
public var _isFlying:Boolean;// = false
public var defaultHeadLabel:String;// = "smile"
public var _isSmiling:Boolean;// = true
public var _isScreamed:Boolean;// = false
public var minJumpPower:Number;// = 61
public var minX:Number;// = 0
public var max_xHairspeed:Number;// = 16
public var floorY:Number;// = 405
public var xspeed:Number;// = 0
public var _isConed:Boolean;// = false
public var jumpPowerIncrease:Number;// = 12
public var _hasHair:Boolean;// = false
public var _isJumping:Boolean;// = false
public var yspeed:Number;// = 0
public var tired_xspeed:Number;// = 6
public var maxJumpPower:Number;// = 61
public var jumpPower:Number;// = 0
public var friction:Number;// = 0.8
public var maxX:Number;// = 920
public function Dog(){
super();
}
public function run(boo:Boolean=true):void{
if (((boo) && (((!(_isRunning)) || ((_mc.currentFrame <= 2)))))){
_mc.gotoAndPlay("run");
if (_mc.name == "dog2_mc"){
_mc.head_mc.gotoAndPlay(defaultHeadLabel);
};
} else {
if (((((!(boo)) && (_isRunning))) && (!(_isJumping)))){
_mc.gotoAndStop("stand");
if (_mc.name == "dog2_mc"){
_mc.head_mc.gotoAndStop(defaultHeadLabel);
};
};
};
_isRunning = boo;
}
public function smile():void{
if (_isOccupied){
return;
};
_mc.head_mc.gotoAndStop(defaultHeadLabel);
_isSmiling = true;
}
public function get _isOccupied():Boolean{
return (((((((((_isChewingObject) || (_isConed))) || (_isWeighted))) || (_isLasered))) || (_isAssed)));
}
public function fly(boo:Boolean=true):void{
_mc.parent.fart_mc.visible = boo;
_isFlying = boo;
if (boo){
_mc.glow_mc.gotoAndPlay(2);
};
if (boo){
defaultHeadLabel = "toot";
smile();
jump(true, true);
_mc.gotoAndStop("fly");
_mc.parent.fart_mc.play();
} else {
defaultHeadLabel = "smile";
_mc.parent.fart_mc.stop();
};
}
public function loseHair():void{
if (_hasHair){
_mc.head_mc.hair_mc.play();
_hasHair = false;
};
}
public function coned(boo:Boolean=true):void{
if (boo){
_mc.head_mc.gotoAndStop("cone");
armTo("open");
if (_hasHair){
_mc.head_mc.hair_mc.visible = false;
};
} else {
_mc.head_mc.gotoAndPlay("drop_cone");
if (_hasHair){
_mc.head_mc.hair_mc.visible = true;
};
};
_isConed = boo;
}
public function lasered(boo:Boolean=true):void{
_isLasered = boo;
if (boo){
defaultHeadLabel = "gross";
_mc.head_mc.gotoAndStop(defaultHeadLabel);
} else {
defaultHeadLabel = "smile";
smile();
};
}
public function set mc(m:MovieClip){
_mc = m;
}
public function shakeWeighted(boo:Boolean=true):void{
if (boo){
armTo("shake");
defaultHeadLabel = "maniac";
smile();
_isWeighted = true;
} else {
_isWeighted = false;
armTo("open");
defaultHeadLabel = "smile";
};
}
public function showHeart():void{
}
public function screamed(boo:Boolean=true):void{
_isScreamed = boo;
if (boo){
defaultHeadLabel = "blown";
_mc.head_mc.gotoAndStop(defaultHeadLabel);
} else {
defaultHeadLabel = "smile";
smile();
};
}
public function jump(boo:Boolean=true, flying:Boolean=false):void{
if (((boo) && (!(_isJumping)))){
if (!flying){
_mc.gotoAndStop("jump");
} else {
_mc.gotoAndStop("fly");
};
} else {
if (((((!(boo)) && (_isJumping))) && (!(_isRunning)))){
_mc.gotoAndStop("stand");
};
};
_isJumping = boo;
}
public function chomp():void{
if (((_isWeighted) || (_isTired))){
return;
};
_mc.head_mc.gotoAndStop("open");
setTimeout(smile, 600);
}
public function getHair():void{
_hasHair = true;
_mc.head_mc.hair_mc.visible = true;
}
public function assed(boo:Boolean=true):void{
_isAssed = boo;
if (boo){
defaultHeadLabel = "inez";
_mc.head_mc.gotoAndStop(defaultHeadLabel);
_mc.head_mc.message_mc.visible = true;
} else {
defaultHeadLabel = "smile";
smile();
_mc.head_mc.message_mc.visible = false;
};
}
public function exclaim(boo:Boolean):void{
_mc.float_mc.visible = boo;
if (boo){
_mc.float_mc.gotoAndPlay("exclaim");
};
}
public function tired(boo:Boolean):void{
if (boo){
defaultHeadLabel = "tired";
smile();
loseHair();
} else {
defaultHeadLabel = "smile";
};
_isTired = boo;
}
public function armTo(lbl:String):void{
if (_isConed){
return;
};
if (_isWeighted){
_mc.arm2_mc.gotoAndStop("none");
return;
};
_mc.arm_mc.gotoAndStop(lbl);
if ((((lbl == "open")) || ((lbl == "fist")))){
_mc.arm2_mc.gotoAndStop(lbl);
} else {
_mc.arm2_mc.gotoAndStop("none");
};
}
}
}//package
Section 61
//eat1 (eat1)
package {
import flash.media.*;
public dynamic class eat1 extends Sound {
}
}//package
Section 62
//eat2 (eat2)
package {
import flash.media.*;
public dynamic class eat2 extends Sound {
}
}//package
Section 63
//eat3 (eat3)
package {
import flash.media.*;
public dynamic class eat3 extends Sound {
}
}//package
Section 64
//eat4 (eat4)
package {
import flash.media.*;
public dynamic class eat4 extends Sound {
}
}//package
Section 65
//fart (fart)
package {
import flash.media.*;
public dynamic class fart extends Sound {
}
}//package
Section 66
//GameObject (GameObject)
package {
import flash.display.*;
public class GameObject extends MovieClip {
public var pointValue:int;
public var id:String;
public function GameObject(){
super();
}
}
}//package
Section 67
//Hoodie (Hoodie)
package {
public class Hoodie extends SpecialObject {
public function Hoodie(){
super();
}
}
}//package
Section 68
//Hoop (Hoop)
package {
import flash.display.*;
public class Hoop extends SpecialObject {
public var sensor_lt_mc:MovieClip;
public var foregroundHoop:Hoop;
public var hoop_mc:MovieClip;
public var sensor_rt_mc:MovieClip;
private var leftSensorHit:Boolean;
public var _isLive:Boolean;
private var rightSensorHit:Boolean;
public function Hoop(){
addFrameScript(22, frame23, 62, frame63);
super();
resetSensors();
_isLive = true;
}
function frame63(){
stop();
parent.removeChild(this);
}
public function outro(glow:Boolean=false):void{
if (!_isLive){
return;
};
_isLive = false;
var lbl:String = "outro";
if (glow){
lbl = "glow";
};
gotoAndPlay(lbl);
if (foregroundHoop != null){
foregroundHoop.visible = false;
};
}
function frame23(){
stop();
}
public function resetSensors():void{
leftSensorHit = (rightSensorHit = false);
}
public function get jumpedThrough():Boolean{
var hit:Boolean = ((leftSensorHit) && (rightSensorHit));
return (hit);
}
public function sensorHit(side:String):void{
if (side == "lt"){
leftSensorHit = true;
} else {
if (side == "rt"){
rightSensorHit = true;
};
};
}
}
}//package
Section 69
//horse_intro (horse_intro)
package {
import flash.media.*;
public dynamic class horse_intro extends Sound {
}
}//package
Section 70
//horse_leg_1 (horse_leg_1)
package {
import flash.media.*;
public dynamic class horse_leg_1 extends Sound {
}
}//package
Section 71
//horse_leg_2 (horse_leg_2)
package {
import flash.media.*;
public dynamic class horse_leg_2 extends Sound {
}
}//package
Section 72
//horse_leg_3 (horse_leg_3)
package {
import flash.media.*;
public dynamic class horse_leg_3 extends Sound {
}
}//package
Section 73
//horse_leg_4 (horse_leg_4)
package {
import flash.media.*;
public dynamic class horse_leg_4 extends Sound {
}
}//package
Section 74
//Inez (Inez)
package {
import flash.display.*;
import caurina.transitions.*;
public class Inez extends MovieClip {
public var assPower:Object;
public var _isOn:Boolean;// = false
public var _virgin:Boolean;// = true
public function Inez(){
addFrameScript(0, frame1, 41, frame42, 230, frame231);
super();
assPower = {p:0};
}
public function assOn():void{
_isOn = true;
assPower.p = 3;
Tweener.addTween(assPower, {p:15, time:3, transition:"easeInQuad"});
trace("assrex?");
parent.assRex();
}
function frame231(){
stop();
}
function frame1(){
stop();
}
public function assOff():void{
_isOn = false;
assPower.p = 0;
exit();
}
function frame42(){
assOn();
}
public function enterScreen():void{
trace("intro");
gotoAndPlay("intro");
_virgin = false;
}
public function exit():void{
gotoAndPlay("exit");
}
}
}//package
Section 75
//inez_1 (inez_1)
package {
import flash.media.*;
public dynamic class inez_1 extends Sound {
}
}//package
Section 76
//inez_2 (inez_2)
package {
import flash.media.*;
public dynamic class inez_2 extends Sound {
}
}//package
Section 77
//inez_3 (inez_3)
package {
import flash.media.*;
public dynamic class inez_3 extends Sound {
}
}//package
Section 78
//Key (Key)
package {
import flash.display.*;
import flash.events.*;
public class Key {
private static var initialized:Boolean = false;
private static var keysDown:Object = new Object();
public static function initialize(stage:Stage){
if (!initialized){
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
stage.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
stage.addEventListener(Event.DEACTIVATE, clearKeys);
initialized = true;
};
}
private static function clearKeys(event:Event):void{
keysDown = new Object();
}
public static function isDown(keyCode:uint):Boolean{
if (!initialized){
throw (new Error("Key class has yet been initialized."));
};
return (Boolean((keyCode in keysDown)));
}
private static function keyPressed(event:KeyboardEvent):void{
keysDown[event.keyCode] = true;
}
private static function keyReleased(event:KeyboardEvent):void{
if ((event.keyCode in keysDown)){
delete keysDown[event.keyCode];
};
}
}
}//package
Section 79
//Laser (Laser)
package {
import flash.display.*;
public class Laser extends MovieClip {
public var _isActive:Boolean;
public function Laser(){
super();
_isActive = false;
}
public function activate(boo:Boolean=true):void{
visible = boo;
_isActive = boo;
}
}
}//package
Section 80
//laser_1 (laser_1)
package {
import flash.media.*;
public dynamic class laser_1 extends Sound {
}
}//package
Section 81
//laser_2 (laser_2)
package {
import flash.media.*;
public dynamic class laser_2 extends Sound {
}
}//package
Section 82
//Newspaper (Newspaper)
package {
public class Newspaper extends SpecialObject {
public function Newspaper(){
super();
}
}
}//package
Section 83
//Pig (Pig)
package {
import flash.display.*;
public class Pig extends Treat {
public var bitesEaten:int;// = 0
public var pig_mc:MovieClip;
public var bitesEaten_dog2:int;// = 0
public var bitesEaten_dog1:int;// = 0
public var _isLive:Boolean;
public var totalBites:int;// = 4
public var _isBiteable:Boolean;
public var _isBiteable2:Boolean;
public function Pig(){
addFrameScript(122, frame123);
super();
_isLive = true;
_isBiteable = true;
_isBiteable2 = true;
mass = 10;
pointValue = 100;
id = "BigTreat";
vr = 0;
}
function frame123(){
stop();
parent.destroyPig(this);
}
function eatBigTreat(side:String="lt", dogID:int=1):void{
pig_mc.nextFrame();
bitesEaten++;
var _local3 = this;
var _local4 = ("bitesEaten_dog" + dogID);
var _local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
}
public function activate():void{
_isBiteable = true;
}
public function activate2():void{
_isBiteable2 = true;
}
}
}//package
Section 84
//pig_squeal_1 (pig_squeal_1)
package {
import flash.media.*;
public dynamic class pig_squeal_1 extends Sound {
}
}//package
Section 85
//pig_squeal_2 (pig_squeal_2)
package {
import flash.media.*;
public dynamic class pig_squeal_2 extends Sound {
}
}//package
Section 86
//PigMC (PigMC)
package {
import flash.display.*;
public class PigMC extends MovieClip {
public function PigMC(){
addFrameScript(0, frame1);
super();
}
function frame1(){
stop();
}
}
}//package
Section 87
//Points (Points)
package {
import flash.text.*;
public class Points extends PointsBase {
public var multiplier_txt:TextField;
public var points_txt:TextField;
public function Points(pnts:int=50, mult:int=1){
super();
points_txt.autoSize = "left";
multiplier_txt.autoSize = "left";
points_txt.text = String(pnts);
if (pnts == 0){
trace("NO POINTS, MULT:", mult);
points_txt.width = 0;
points_txt.text = "";
};
if (mult > 1){
multiplier_txt.text = ("x" + mult);
multiplier_txt.x = ((points_txt.x + points_txt.width) + 4);
} else {
multiplier_txt.text = "";
};
}
}
}//package
Section 88
//PointsBase (PointsBase)
package {
import flash.display.*;
import caurina.transitions.*;
public class PointsBase extends MovieClip {
public function PointsBase(){
super();
}
public function aniamte():void{
Tweener.addTween(this, {y:(y - 33), alpha:0, time:0.8, transition:"easeOutQuad", delay:0.3, onComplete:destroy});
}
private function destroy():void{
parent.removeChildAt(parent.getChildIndex(this));
}
}
}//package
Section 89
//PointsNegative (PointsNegative)
package {
import flash.text.*;
public class PointsNegative extends PointsBase {
public var points_txt:TextField;
public function PointsNegative(pnts:int=-25){
super();
points_txt.autoSize = "left";
points_txt.text = String(pnts);
}
}
}//package
Section 90
//rex_bill_1 (rex_bill_1)
package {
import flash.media.*;
public dynamic class rex_bill_1 extends Sound {
}
}//package
Section 91
//rex_bill_2 (rex_bill_2)
package {
import flash.media.*;
public dynamic class rex_bill_2 extends Sound {
}
}//package
Section 92
//rex_bill_3 (rex_bill_3)
package {
import flash.media.*;
public dynamic class rex_bill_3 extends Sound {
}
}//package
Section 93
//rex_bill_4 (rex_bill_4)
package {
import flash.media.*;
public dynamic class rex_bill_4 extends Sound {
}
}//package
Section 94
//rex_bill_5 (rex_bill_5)
package {
import flash.media.*;
public dynamic class rex_bill_5 extends Sound {
}
}//package
Section 95
//rex_bill_6 (rex_bill_6)
package {
import flash.media.*;
public dynamic class rex_bill_6 extends Sound {
}
}//package
Section 96
//rex_bill_7 (rex_bill_7)
package {
import flash.media.*;
public dynamic class rex_bill_7 extends Sound {
}
}//package
Section 97
//rex_bill_8 (rex_bill_8)
package {
import flash.media.*;
public dynamic class rex_bill_8 extends Sound {
}
}//package
Section 98
//rex_billeat (rex_billeat)
package {
import flash.media.*;
public dynamic class rex_billeat extends Sound {
}
}//package
Section 99
//rex_brady_1 (rex_brady_1)
package {
import flash.media.*;
public dynamic class rex_brady_1 extends Sound {
}
}//package
Section 100
//rex_brady_12 (rex_brady_12)
package {
import flash.media.*;
public dynamic class rex_brady_12 extends Sound {
}
}//package
Section 101
//rex_brady_3 (rex_brady_3)
package {
import flash.media.*;
public dynamic class rex_brady_3 extends Sound {
}
}//package
Section 102
//rex_brady_4 (rex_brady_4)
package {
import flash.media.*;
public dynamic class rex_brady_4 extends Sound {
}
}//package
Section 103
//rex_brady_5 (rex_brady_5)
package {
import flash.media.*;
public dynamic class rex_brady_5 extends Sound {
}
}//package
Section 104
//rex_brady_6 (rex_brady_6)
package {
import flash.media.*;
public dynamic class rex_brady_6 extends Sound {
}
}//package
Section 105
//rex_brady_7 (rex_brady_7)
package {
import flash.media.*;
public dynamic class rex_brady_7 extends Sound {
}
}//package
Section 106
//rex_brady_8 (rex_brady_8)
package {
import flash.media.*;
public dynamic class rex_brady_8 extends Sound {
}
}//package
Section 107
//rex_brady_9 (rex_brady_9)
package {
import flash.media.*;
public dynamic class rex_brady_9 extends Sound {
}
}//package
Section 108
//rex_brady_beat_1 (rex_brady_beat_1)
package {
import flash.media.*;
public dynamic class rex_brady_beat_1 extends Sound {
}
}//package
Section 109
//rex_brady_beat_2 (rex_brady_beat_2)
package {
import flash.media.*;
public dynamic class rex_brady_beat_2 extends Sound {
}
}//package
Section 110
//rex_brady_eat (rex_brady_eat)
package {
import flash.media.*;
public dynamic class rex_brady_eat extends Sound {
}
}//package
Section 111
//rex_eat_1 (rex_eat_1)
package {
import flash.media.*;
public dynamic class rex_eat_1 extends Sound {
}
}//package
Section 112
//rex_eat_10 (rex_eat_10)
package {
import flash.media.*;
public dynamic class rex_eat_10 extends Sound {
}
}//package
Section 113
//rex_eat_11 (rex_eat_11)
package {
import flash.media.*;
public dynamic class rex_eat_11 extends Sound {
}
}//package
Section 114
//rex_eat_12 (rex_eat_12)
package {
import flash.media.*;
public dynamic class rex_eat_12 extends Sound {
}
}//package
Section 115
//rex_eat_2 (rex_eat_2)
package {
import flash.media.*;
public dynamic class rex_eat_2 extends Sound {
}
}//package
Section 116
//rex_eat_3 (rex_eat_3)
package {
import flash.media.*;
public dynamic class rex_eat_3 extends Sound {
}
}//package
Section 117
//rex_eat_4 (rex_eat_4)
package {
import flash.media.*;
public dynamic class rex_eat_4 extends Sound {
}
}//package
Section 118
//rex_eat_5 (rex_eat_5)
package {
import flash.media.*;
public dynamic class rex_eat_5 extends Sound {
}
}//package
Section 119
//rex_eat_6 (rex_eat_6)
package {
import flash.media.*;
public dynamic class rex_eat_6 extends Sound {
}
}//package
Section 120
//rex_eat_7 (rex_eat_7)
package {
import flash.media.*;
public dynamic class rex_eat_7 extends Sound {
}
}//package
Section 121
//rex_eat_8 (rex_eat_8)
package {
import flash.media.*;
public dynamic class rex_eat_8 extends Sound {
}
}//package
Section 122
//rex_eat_9 (rex_eat_9)
package {
import flash.media.*;
public dynamic class rex_eat_9 extends Sound {
}
}//package
Section 123
//rex_eatpig_1 (rex_eatpig_1)
package {
import flash.media.*;
public dynamic class rex_eatpig_1 extends Sound {
}
}//package
Section 124
//rex_eatpig_2 (rex_eatpig_2)
package {
import flash.media.*;
public dynamic class rex_eatpig_2 extends Sound {
}
}//package
Section 125
//rex_eatpig_4 (rex_eatpig_4)
package {
import flash.media.*;
public dynamic class rex_eatpig_4 extends Sound {
}
}//package
Section 126
//rex_fly_1 (rex_fly_1)
package {
import flash.media.*;
public dynamic class rex_fly_1 extends Sound {
}
}//package
Section 127
//rex_fly_2 (rex_fly_2)
package {
import flash.media.*;
public dynamic class rex_fly_2 extends Sound {
}
}//package
Section 128
//rex_fly_3 (rex_fly_3)
package {
import flash.media.*;
public dynamic class rex_fly_3 extends Sound {
}
}//package
Section 129
//rex_fly_4 (rex_fly_4)
package {
import flash.media.*;
public dynamic class rex_fly_4 extends Sound {
}
}//package
Section 130
//rex_fly_5 (rex_fly_5)
package {
import flash.media.*;
public dynamic class rex_fly_5 extends Sound {
}
}//package
Section 131
//rex_fly_done (rex_fly_done)
package {
import flash.media.*;
public dynamic class rex_fly_done extends Sound {
}
}//package
Section 132
//rex_food_lasered_1 (rex_food_lasered_1)
package {
import flash.media.*;
public dynamic class rex_food_lasered_1 extends Sound {
}
}//package
Section 133
//rex_food_lasered_2 (rex_food_lasered_2)
package {
import flash.media.*;
public dynamic class rex_food_lasered_2 extends Sound {
}
}//package
Section 134
//rex_food_lasered_3 (rex_food_lasered_3)
package {
import flash.media.*;
public dynamic class rex_food_lasered_3 extends Sound {
}
}//package
Section 135
//rex_hoodie_1 (rex_hoodie_1)
package {
import flash.media.*;
public dynamic class rex_hoodie_1 extends Sound {
}
}//package
Section 136
//rex_hoodie_2 (rex_hoodie_2)
package {
import flash.media.*;
public dynamic class rex_hoodie_2 extends Sound {
}
}//package
Section 137
//rex_hoodie_3 (rex_hoodie_3)
package {
import flash.media.*;
public dynamic class rex_hoodie_3 extends Sound {
}
}//package
Section 138
//rex_hoodie_4 (rex_hoodie_4)
package {
import flash.media.*;
public dynamic class rex_hoodie_4 extends Sound {
}
}//package
Section 139
//rex_hoodie_5 (rex_hoodie_5)
package {
import flash.media.*;
public dynamic class rex_hoodie_5 extends Sound {
}
}//package
Section 140
//rex_hungry (rex_hungry)
package {
import flash.media.*;
public dynamic class rex_hungry extends Sound {
}
}//package
Section 141
//rex_inez_1 (rex_inez_1)
package {
import flash.media.*;
public dynamic class rex_inez_1 extends Sound {
}
}//package
Section 142
//rex_inez_2 (rex_inez_2)
package {
import flash.media.*;
public dynamic class rex_inez_2 extends Sound {
}
}//package
Section 143
//rex_inez_3 (rex_inez_3)
package {
import flash.media.*;
public dynamic class rex_inez_3 extends Sound {
}
}//package
Section 144
//rex_inez_4 (rex_inez_4)
package {
import flash.media.*;
public dynamic class rex_inez_4 extends Sound {
}
}//package
Section 145
//rex_inez_5 (rex_inez_5)
package {
import flash.media.*;
public dynamic class rex_inez_5 extends Sound {
}
}//package
Section 146
//rex_inez_7 (rex_inez_7)
package {
import flash.media.*;
public dynamic class rex_inez_7 extends Sound {
}
}//package
Section 147
//rex_see_pig_1 (rex_see_pig_1)
package {
import flash.media.*;
public dynamic class rex_see_pig_1 extends Sound {
}
}//package
Section 148
//rex_see_pig_2 (rex_see_pig_2)
package {
import flash.media.*;
public dynamic class rex_see_pig_2 extends Sound {
}
}//package
Section 149
//rex_shake_1 (rex_shake_1)
package {
import flash.media.*;
public dynamic class rex_shake_1 extends Sound {
}
}//package
Section 150
//rex_shake_2 (rex_shake_2)
package {
import flash.media.*;
public dynamic class rex_shake_2 extends Sound {
}
}//package
Section 151
//rex_shake_3 (rex_shake_3)
package {
import flash.media.*;
public dynamic class rex_shake_3 extends Sound {
}
}//package
Section 152
//rex_shake_4 (rex_shake_4)
package {
import flash.media.*;
public dynamic class rex_shake_4 extends Sound {
}
}//package
Section 153
//rex_shake_5 (rex_shake_5)
package {
import flash.media.*;
public dynamic class rex_shake_5 extends Sound {
}
}//package
Section 154
//rex_shakedone_1 (rex_shakedone_1)
package {
import flash.media.*;
public dynamic class rex_shakedone_1 extends Sound {
}
}//package
Section 155
//rex_veg_1 (rex_veg_1)
package {
import flash.media.*;
public dynamic class rex_veg_1 extends Sound {
}
}//package
Section 156
//rex_veg_10 (rex_veg_10)
package {
import flash.media.*;
public dynamic class rex_veg_10 extends Sound {
}
}//package
Section 157
//rex_veg_11 (rex_veg_11)
package {
import flash.media.*;
public dynamic class rex_veg_11 extends Sound {
}
}//package
Section 158
//rex_veg_12 (rex_veg_12)
package {
import flash.media.*;
public dynamic class rex_veg_12 extends Sound {
}
}//package
Section 159
//rex_veg_2 (rex_veg_2)
package {
import flash.media.*;
public dynamic class rex_veg_2 extends Sound {
}
}//package
Section 160
//rex_veg_5 (rex_veg_5)
package {
import flash.media.*;
public dynamic class rex_veg_5 extends Sound {
}
}//package
Section 161
//rex_veg_6 (rex_veg_6)
package {
import flash.media.*;
public dynamic class rex_veg_6 extends Sound {
}
}//package
Section 162
//rex_veg_7 (rex_veg_7)
package {
import flash.media.*;
public dynamic class rex_veg_7 extends Sound {
}
}//package
Section 163
//rex_veg_8 (rex_veg_8)
package {
import flash.media.*;
public dynamic class rex_veg_8 extends Sound {
}
}//package
Section 164
//rex_veg_9 (rex_veg_9)
package {
import flash.media.*;
public dynamic class rex_veg_9 extends Sound {
}
}//package
Section 165
//rex_whooo (rex_whooo)
package {
import flash.media.*;
public dynamic class rex_whooo extends Sound {
}
}//package
Section 166
//Shakeweight (Shakeweight)
package {
public class Shakeweight extends SpecialObject {
public function Shakeweight(){
super();
}
}
}//package
Section 167
//softeat1 (softeat1)
package {
import flash.media.*;
public dynamic class softeat1 extends Sound {
}
}//package
Section 168
//softeat2 (softeat2)
package {
import flash.media.*;
public dynamic class softeat2 extends Sound {
}
}//package
Section 169
//SpecialObject (SpecialObject)
package {
public class SpecialObject extends GameObject {
public var vx:Number;// = 0
public var vy:Number;// = 0
public var mass:Number;
public var vr:Number;// = 0
public function SpecialObject(){
super();
mass = 10;
id = "Special";
vr = (-0.3 + (Math.random() * 0.6));
}
}
}//package
Section 170
//Tony (Tony)
package {
import flash.display.*;
import caurina.transitions.*;
import flash.utils.*;
public class Tony extends MovieClip {
public var dog2_shadow_mc:MovieClip;
public var tonyhead_mc:MovieClip;
public var leg4_mc:MovieClip;
public var leg1_eaten:Boolean;// = false
public var leg3_eaten:Boolean;// = false
public var back_eaten:Boolean;// = false
public var _isEatable:Boolean;// = false
public var leg3_mc:MovieClip;
public var throwarm_mc:MovieClip;
public var leg2_mc:MovieClip;
public var body_mc:MovieClip;
public var head_mc:MovieClip;
public var screamPower:Object;
public var collapsed:Boolean;// = false
public var legs_eaten:int;// = 0
public var leg4_eaten:Boolean;// = false
public var front_eaten:Boolean;// = false
public var _isScreaming:Boolean;// = false
public var leg2_eaten:Boolean;// = false
public var leg1_mc:MovieClip;
public var _isTonyDead:Boolean;// = false
public function Tony(){
addFrameScript(0, frame1, 52, frame53, 62, frame63, 105, frame106, 127, frame128, 155, frame156, 182, frame183);
super();
screamPower = {p:0};
}
public function speechDone():void{
trace("speech done");
gotoAndPlay("introDone");
setTimeout(bomb, 330);
parent._isPaused = false;
parent.activateTony();
}
function frame156(){
stop();
}
public function eatLeg(id:int):void{
trace("eatLeg", id);
if (this[(("leg" + id) + "_eaten")] == true){
return;
};
this[(("leg" + id) + "_eaten")] = true;
legToEaten(id);
legs_eaten++;
if ((((((id == 1)) && (leg2_eaten))) || ((((id == 2)) && (leg1_eaten))))){
front_eaten = true;
if (back_eaten){
gotoAndPlay("fullCollapse-front");
deadHorse();
} else {
gotoAndPlay("collapse-front");
};
} else {
if ((((((id == 3)) && (leg4_eaten))) || ((((id == 4)) && (leg3_eaten))))){
back_eaten = true;
if (front_eaten){
gotoAndPlay("fullCollapse-back");
deadHorse();
} else {
gotoAndPlay("collapse-back");
};
};
};
if (!collapsed){
scream();
};
}
public function bomb():void{
if (((_isTonyDead) || (parent._gameIsOver))){
return;
};
throwarm_mc.play();
setTimeout(bomb, (1400 + (Math.random() * 4500)));
parent.playBossAudio("tony_", 10);
}
public function reactivate():void{
if (!collapsed){
_isEatable = true;
};
}
function frame128(){
stop();
}
function frame53(){
stop();
}
public function legToEaten(id:int):void{
var mc:MovieClip = this[(("leg" + id) + "_mc")];
frame = 3;
if (_isScreaming){
frame = 4;
};
mc.gotoAndStop(frame);
trace(mc, frame);
}
public function kill():void{
_isTonyDead = true;
gotoAndStop("dead");
}
function frame183(){
stop();
}
public function speech():void{
trace("tony speech");
parent._isPaused = true;
tonyhead_mc.gotoAndPlay("speech");
}
function frame63(){
stop();
}
public function scream(boo:Boolean=true):void{
if (collapsed){
return;
};
_isScreaming = boo;
var legFrame = 2;
if (!boo){
legFrame = 1;
};
if (leg1_eaten){
legToEaten(1);
} else {
leg1_mc.gotoAndStop(legFrame);
};
if (leg2_eaten){
legToEaten(2);
} else {
leg2_mc.gotoAndStop(legFrame);
};
if (leg3_eaten){
legToEaten(3);
} else {
leg3_mc.gotoAndStop(legFrame);
};
if (leg4_eaten){
legToEaten(4);
} else {
leg4_mc.gotoAndStop(legFrame);
};
body_mc.gotoAndStop(legFrame);
if (boo){
head_mc.gotoAndPlay("scream");
screamPower.p = 50;
Tweener.addTween(screamPower, {p:3, time:1.5, transition:"easeInCirc"});
} else {
head_mc.gotoAndStop("normal");
screamPower.p = 0;
parent.dog.screamed(false);
};
}
public function deadHorse():void{
head_mc.gotoAndStop("dead");
collapsed = true;
}
function frame106(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 171
//tony_1 (tony_1)
package {
import flash.media.*;
public dynamic class tony_1 extends Sound {
}
}//package
Section 172
//tony_10 (tony_10)
package {
import flash.media.*;
public dynamic class tony_10 extends Sound {
}
}//package
Section 173
//tony_2 (tony_2)
package {
import flash.media.*;
public dynamic class tony_2 extends Sound {
}
}//package
Section 174
//tony_3 (tony_3)
package {
import flash.media.*;
public dynamic class tony_3 extends Sound {
}
}//package
Section 175
//tony_4 (tony_4)
package {
import flash.media.*;
public dynamic class tony_4 extends Sound {
}
}//package
Section 176
//tony_5 (tony_5)
package {
import flash.media.*;
public dynamic class tony_5 extends Sound {
}
}//package
Section 177
//tony_6 (tony_6)
package {
import flash.media.*;
public dynamic class tony_6 extends Sound {
}
}//package
Section 178
//tony_7 (tony_7)
package {
import flash.media.*;
public dynamic class tony_7 extends Sound {
}
}//package
Section 179
//tony_8 (tony_8)
package {
import flash.media.*;
public dynamic class tony_8 extends Sound {
}
}//package
Section 180
//tony_9 (tony_9)
package {
import flash.media.*;
public dynamic class tony_9 extends Sound {
}
}//package
Section 181
//Treat (Treat)
package {
public class Treat extends GameObject {
public var vx:Number;// = 0
public var vy:Number;// = 0
public var mass:Number;
public var vr:Number;// = 0
public function Treat(){
super();
addFrameScript(0, frame1);
mass = 10;
pointValue = 50;
id = "Treat";
vr = (-0.3 + (Math.random() * 0.6));
}
function frame1(){
stop();
}
}
}//package
Section 182
//TreatsGame (TreatsGame)
package {
import flash.display.*;
import flash.events.*;
import caurina.transitions.*;
import flash.geom.*;
import flash.filters.*;
import fl.motion.*;
import caurina.transitions.properties.*;
import com.coreyoneil.collision.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
public class TreatsGame extends MovieClip {
private const MAX_GRAVITY:Number = 0.6;
private const gravity:Number = 7;
private const FRICTION:Number = 0.95;
private var _isBossTalking:Boolean;
private var specialObjectTypes:Array;
private var bill:Bill;
public var brady_mc:MovieClip;
private var veggieTypes:Array;
private var dispnserDelay:int;
private var nonTreatDrops:int;
private var music:Sound;
private var targetX2:int;
private var GRAVITY:Number;// = 0.1
private var hungerRate:int;
private var rexAudioQ:Object;
private var assFights:int;
private var scaleValue:int;
public var intro_mc:MovieClip;
private var hoops:Array;
public var _isPaused:Boolean;
private var hungerTimer:Timer;
private var fxMixer:SoundTransform;
public var score_mc:MovieClip;
private var capeTimout:int;
public var introInstructionStep:int;
public var instructions_mc:MovieClip;
private var brady:Brady;
public var dog2:Dog;
private var treatTypes:Array;
private var treatsCaughtThisJump:int;
public var dog2_shadow_mc:MovieClip;
private var score:int;
private var inez:Inez;
private var objectComplexity:int;
private var BOSSch:SoundChannel;
public var scale_mc:MovieClip;
private var FXch:SoundChannel;
private var _treats:Array;
private var _isBossTime:Boolean;
public var laser:Laser;
public var bill_mc:MovieClip;
public var fart_mc:MovieClip;
private var fx:Sound;
private var objectsDroppedThisLevel:int;
private var musicMixer:SoundChannel;
private var special_odds:int;
public var tony_mc:MovieClip;
private var _collisionList:CollisionList;
private var pointsToAdd:int;
private var currentBossSnd:String;
private var tempScore:Object;
public var _isLoading:Boolean;
private var hoopsJumpedThroughThisJump:int;
public var dog:Dog;
private var treatTimer:Timer;
public var _gameIsOver:Boolean;
public var inez_mc:MovieClip;
private var currentRexSnd:String;
private var _dog2_isLive:Boolean;
private var _collisionList2:CollisionList;
private var rexSound:Sound;
public var dog_mc:MovieClip;
private var level:int;
private var hoodieShakes:int;
private var tony:Tony;
private var bossSound:Sound;
private var REXch:SoundChannel;
private var veggie_odds:int;
public var dog_shadow_mc:MovieClip;
private var scoreMultiplier:int;
private var max_hungerRate:int;
private var youWon:Boolean;
private var _isRexTalking:Boolean;
public var dog2_mc:MovieClip;
public function TreatsGame():void{
super();
addFrameScript(0, frame1, 1, frame2, 28, frame29, 57, frame58, 58, frame59, 77, frame78);
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, readyToPreload, false, 0, true);
addEventListener(Event.REMOVED_FROM_STAGE, clean, false, 0, true);
} else {
fxMixer = new SoundTransform(1);
SoundMixer.soundTransform = fxMixer;
music = new Sound();
rexSound = new Sound();
bossSound = new Sound();
SoundShortcuts.init();
readyToPreload();
FilterShortcuts.init();
ColorShortcuts.init();
};
}
private function nextIntroInstructionStep(activateDog:Boolean=false):void{
introInstructionStep++;
trace("nextIntroInstructionStep", introInstructionStep);
if (introInstructionStep == 2){
showInstructions("jump", true);
} else {
if (introInstructionStep == 3){
showInstructions("healthy");
};
};
}
private function preload(e:Event):void{
var r:Number = (stage.loaderInfo.bytesLoaded / stage.loaderInfo.bytesTotal);
if ((((r == 1)) && ((stage.loaderInfo.bytesTotal > 500)))){
_isLoading = false;
intro_mc.loading_mc.stop();
intro_mc.loading_mc.visible = false;
intro_mc.play_btn.scaleX = (intro_mc.play_btn.scaleY = 0.7);
intro_mc.help_btn.scaleX = (intro_mc.help_btn.scaleY = 0.7);
intro_mc.play_btn.alpha = 0.4;
intro_mc.help_btn.alpha = 0.4;
intro_mc.play_btn.visible = true;
intro_mc.help_btn.visible = true;
Tweener.addTween(intro_mc.play_btn, {alpha:1, scaleX:1, scaleY:1, time:0.8, transition:"easeOutBack"});
Tweener.addTween(intro_mc.help_btn, {alpha:1, scaleX:1, scaleY:1, time:0.8, transition:"easeOutBack"});
removeEventListener(Event.ENTER_FRAME, preload);
nextFrame();
};
}
private function gameOver(win:Boolean=false):void{
trace("GAME OVER!");
gotoAndPlay("end");
_gameIsOver = true;
stage.removeEventListener(KeyboardEvent.KEY_UP, keyUpped);
hungerTimer.removeEventListener("timer", hungerPangsTimer);
playMusic(false);
if (win){
youWon = true;
};
}
private function RexSndCompleted(e:Event=null):void{
_isRexTalking = false;
currentRexSnd = "";
if (rexAudioQ != null){
playRexAudio(rexAudioQ.id, rexAudioQ.randomRange, rexAudioQ.priority);
};
rexAudioQ = null;
}
private function introHelpOver(e:MouseEvent):void{
intro_mc.burgerMenu_mc.gotoAndStop(2);
}
private function helpHidden():void{
intro_mc.help_mc.visible = false;
}
private function coinToss(odds:int=2):Boolean{
var coinToss:int = (Math.random() * odds);
return ((coinToss == 0));
}
private function destroyTreat(treat:GameObject):void{
var big:Pig;
removeChild(treat);
if ((treat is Pig)){
big = (treat as Pig);
} else {
_collisionList.removeItem(treat);
_collisionList2.removeItem(treat);
};
var loc:int = _treats.indexOf(treat);
if (loc >= 0){
_treats.splice(loc, 1);
};
}
private function clean(e:Event):void{
removeEventListener(Event.ENTER_FRAME, updateScene);
}
private function nextLevel():void{
if (!_isBossTime){
level++;
};
objectsDroppedThisLevel = 0;
nonTreatDrops = 0;
if (level == 1){
dispnserDelay = 1800;
objectComplexity = 0;
} else {
if (level == 2){
dispnserDelay = 1400;
objectComplexity = 1;
bill.startBill();
} else {
if (level == 3){
dispnserDelay = 1000;
objectComplexity = 1;
} else {
if (level >= 4){
dog2.maxJumpPower = (dog2.maxJumpPower + 0.2);
dog2.max_xspeed = (dog2.max_xspeed + 0.3);
if (dog2.max_xspeed > 35){
dog2.max_xspeed = 35;
};
if (dog2.maxJumpPower > 40){
dog2.maxJumpPower = 40;
};
objectComplexity = 2;
dispnserDelay = (dispnserDelay - 50);
if (dispnserDelay < 400){
dispnserDelay = 400;
};
bill.fasterDelay();
if ((level % 5) == 0){
veggie_odds = (veggie_odds - 1);
special_odds = (special_odds - 1);
if (veggie_odds < 4){
veggie_odds = 4;
};
if (special_odds < 7){
special_odds = 7;
};
};
if (level == 8){
hungerRate = 3;
};
if (level == 11){
inezTime();
};
if (level == 12){
hungerRate = 4;
};
if (level == 16){
hungerRate = 5;
};
if (level == 22){
tonyTime();
};
};
};
};
};
GRAVITY = (GRAVITY + 0.01);
if (GRAVITY > MAX_GRAVITY){
GRAVITY = MAX_GRAVITY;
};
trace("level", level);
trace("dog2.maxJumpPower", dog2.maxJumpPower, "dog2.max_xspeed", dog2.max_xspeed, "dispnserDelay", dispnserDelay, "objectComplexity", objectComplexity);
treatTimer.reset();
treatTimer.delay = dispnserDelay;
treatTimer.start();
}
private function bradyTime():void{
trace("BRADY TIME!");
_isBossTime = true;
brady.visible = true;
brady.go();
bill.done();
_collisionList.addItem(brady.football_mc);
_collisionList.addItem(brady.body_mc);
setTimeout(playRexAudio, 500, "rex_brady_", 12, 2, true);
showInstructions("brady");
}
private function stopFX():void{
if (FXch != null){
FXch.stop();
};
}
private function fightAss():void{
assFights++;
if (assFights == 40){
dog.assed(false);
dog_mc.head_mc.message_mc.visible = false;
assFights = 0;
inez.assOff();
setTimeout(bradyTime, 200);
} else {
dog_mc.head_mc.message_mc.visible = true;
playRexAudio("rex_inez_", 5, 2, true);
};
}
private function stopRexAudio():void{
_isRexTalking = false;
if (REXch == null){
return;
};
REXch.stop();
currentRexSnd = "";
rexAudioQ = null;
}
private function vegFactory(type:String, startPoint:Point):Veggie{
var veg:Veggie = new Veggie();
veg.gotoAndStop(type);
veg.rotation = (Math.random() * 180);
veg.x = ((startPoint.x - 10) - (Math.random() * 33));
veg.y = ((startPoint.y - (Math.random() * 20)) + 5);
veg.vx = (-25 - (Math.random() * 20));
veg.vy = (19 + (Math.random() * 15));
_collisionList.addItem(veg);
_collisionList2.addItem(veg);
_treats.push(veg);
addChild(veg);
return (veg);
}
private function showPoints(pnts:int, mult:int=1):void{
var points:PointsBase;
var pntA:Point = new Point(dog_mc.head_mc.x, (dog_mc.head_mc.y - 30));
var translated:Point = dog_mc.head_mc.localToGlobal(pntA);
if (pnts < 0){
points = new PointsNegative(pnts);
} else {
points = new Points(pnts, mult);
};
points.x = translated.x;
points.y = translated.y;
addChild(points);
points.aniamte();
}
public function assRex():void{
dog.assed();
assFights = 0;
}
function frame2(){
intro();
}
function frame1(){
stop();
}
public function intro():void{
gotoAndStop("intro");
intro_mc.play_btn.addEventListener("click", introPlayCLick);
intro_mc.help_btn.addEventListener("click", introHelpCLick);
intro_mc.play_btn.addEventListener("rollOver", introPlayOver);
intro_mc.help_btn.addEventListener("rollOver", introHelpOver);
dog_mc.scaleX = (fart_mc.scaleX = (dog_shadow_mc.scaleX = -1));
intro_mc.help_mc.mouseEnabled = false;
intro_mc.help_mc.visible = false;
instructions_mc.gotoAndStop(1);
instructions_mc.visible = true;
fart_mc.stop();
fart_mc.visible = false;
dog_mc.head_mc.hair_mc.visible = false;
var req:URLRequest = new URLRequest("http://cdn.tauntr.com/sites/default/files/mp3s/super_mom.mp3");
var context:SoundLoaderContext = new SoundLoaderContext(8000, false);
music.load(req, context);
intro_mc.rexhead_mc.gotoAndPlay("intro");
}
public function veggieBomb():void{
var bombPoint:Point = new Point((tony.throwarm_mc.x - 150), (tony.throwarm_mc.y - 10));
bombPoint = tony.localToGlobal(bombPoint);
var carrot:Veggie = vegFactory("carrot", bombPoint);
var radish:Veggie = vegFactory("radish", bombPoint);
var apple:Veggie = vegFactory("apple", bombPoint);
var brocoli:Veggie = vegFactory("brocoli", bombPoint);
}
function frame29(){
stop();
intro_mc.visible = false;
}
private function stopBossAudio():void{
trace("stopBossAudio");
if (BOSSch == null){
return;
};
BOSSch.stop();
_isBossTalking = false;
currentBossSnd = "";
}
public function inezTime():void{
if (!inez._virgin){
return;
};
trace("INEZ TIME!");
_isBossTime = true;
inez.visible = true;
bill.done();
inez.enterScreen();
playBossAudio("inez_", 3, true);
showInstructions("ass");
}
private function treatDropTimer(e:TimerEvent):void{
if (coinToss(veggie_odds)){
dropVeggie();
} else {
if (coinToss(special_odds)){
dropSpecialObject(objectComplexity);
} else {
dropTreats(1);
};
};
objectsDroppedThisLevel++;
if (objectsDroppedThisLevel >= 7){
if (((((level % 4) == 0)) && ((objectsDroppedThisLevel == 7)))){
trace("BOSS");
dropBigTreat();
};
nextLevel();
};
}
private function dropSpecialObject(maxObjectComplexity:int=0):void{
var difficulty:int = (Math.random() * (maxObjectComplexity + 1));
var r2:int = Math.round((Math.random() * (specialObjectTypes[difficulty].length - 1)));
var objType:Object = specialObjectTypes[difficulty][r2];
var objClass:Class = objType.objClass;
var special:SpecialObject = new (objClass);
special.y = (-(special.height) - (Math.random() * 100));
special.x = (Math.random() * stage.stageWidth);
special.rotation = (Math.random() * 180);
special.vx = (special.vy = 0);
_treats.push(special);
addChild(special);
_collisionList.addItem(special);
_collisionList2.addItem(special);
}
private function readyToPreload(e:Event=null):void{
_isLoading = true;
intro_mc.play_btn.visible = false;
intro_mc.help_btn.visible = false;
addEventListener(Event.ENTER_FRAME, preload);
}
private function introPlayOver(e:MouseEvent):void{
intro_mc.burgerMenu_mc.gotoAndStop(1);
}
private function loadLeaderboard(newName:String="", newScore:int=-1):void{
var leaderboardLoaded:*;
var variables:URLVariables;
var newName = newName;
var newScore = newScore;
leaderboardLoaded = function (e:Event):void{
var score_xml:XML;
trace(e.target.data);
leaderboard = XML(e.target.data);
trace(leaderboard);
var scores:XMLList = leaderboard.children();
var i:int;
while (i < 10) {
score_xml = scores[i];
if (score_xml != null){
intro_mc.leaderboard_mc[(("score" + (i + 1)) + "_mc")].name_txt.text = score_xml.@name;
intro_mc.leaderboard_mc[(("score" + (i + 1)) + "_mc")].score_txt.text = score_xml.@score;
};
i++;
};
if (newScore == -1){
if ((((score > int(scores[(scores.length() - 1)].@score))) || ((scores.length() < 10)))){
openTopScoreBox();
};
};
};
var req:URLRequest = new URLRequest("http://fortfranklin.com/share/treats_game_leaderboard.php");
if (newScore != -1){
trace(newName, newScore);
variables = new URLVariables();
variables.name = newName;
variables.score = score;
req.data = variables;
};
var leaderboardLoader:URLLoader = new URLLoader();
leaderboardLoader.addEventListener("complete", leaderboardLoaded);
leaderboardLoader.load(req);
}
private function newTopScoreEntered(name:String, score:int):void{
loadLeaderboard(name, score);
closeTopScoreBox();
}
private function doneChewing():void{
dog_mc.head_mc.gotoAndPlay(("drop_" + dog.chewToy));
dog.exclaim(false);
dog.chewToy = "";
setTimeout(dog.smile, 1100);
}
private function chewing(object:String):void{
dog_mc.head_mc.gotoAndStop(object);
dog._isChewingObject = true;
dog.chewToy = object;
dog.exclaim(true);
setTimeout(doneChewing, 3500);
playFX("dog1_chew", 2);
}
private function laserKill(treat:GameObject):void{
laserGlow(treat);
Tweener.addTween(treat, {alpha:0, scaleX:(treat.scaleX * 0.5), scaleY:(treat.scaleY * 0.5), time:0.25, delay:0.1});
_collisionList.removeItem(treat);
_collisionList2.removeItem(treat);
var loc:int = _treats.indexOf(treat);
if (loc >= 0){
_treats.splice(loc, 1);
};
}
function frame59(){
printEndScreen();
}
private function openLeaderboard():void{
Tweener.addTween(intro_mc.leaderboard_mc, {x:328, time:0.7, transition:"easeOutQuad"});
}
private function facebook(e:MouseEvent):void{
ExternalInterface.call("showStream", score);
}
public function hideIntroInstructionStep():void{
instructions_mc.visible = false;
}
function frame58(){
intro_mc.visible = true;
intro_mc.gotoAndPlay("end");
}
private function addToScore(pnts:int):void{
score = (score + pnts);
Tweener.addTween(tempScore, {score:score, time:0.25, transition:"easeOutQuart", onUpdate:printScore});
}
private function laserGlow(mc:MovieClip, boo:Boolean=true):void{
var bw_matrix:Array;
var filter:ColorMatrixFilter;
var my_filters:Array;
var c:Color;
var blankColor:Color;
if (boo){
bw_matrix = [0.518447995185852, 1.02379190921783, 0.137759998440742, 0, -29.7400016784668, 0.518447995185852, 1.02379190921783, 0.137759998440742, 0, -29.7400016784668, 0.518447995185852, 1.02379179000854, 0.137759998440742, 0, -29.7399997711182, 0, 0, 0, 1, 0];
filter = new ColorMatrixFilter(bw_matrix);
my_filters = new Array();
my_filters.push(filter);
mc.filters = my_filters;
Tweener.addTween(mc, {_Glow_alpha:1, time:0});
Tweener.addTween(mc, {_Glow_color:0xFF0000, time:0});
Tweener.addTween(mc, {_Glow_blurX:30, time:0});
Tweener.addTween(mc, {_Glow_blurY:30, time:0});
Tweener.addTween(mc, {_Glow_strength:1.22, time:0});
c = new Color();
c.setTint(0xFF0000, 0.75);
mc.transform.colorTransform = c;
} else {
mc.filters = new Array();
blankColor = new Color();
mc.transform.colorTransform = blankColor;
};
}
private function dropVeggie():void{
var r2:int = Math.round((Math.random() * (veggieTypes.length - 1)));
var vegType:Object = veggieTypes[r2];
var veg:Veggie = new Veggie();
veg.gotoAndStop(vegType.name);
veg.rotation = (Math.random() * 180);
veg.x = (50 + (Math.random() * (stage.stageWidth - 100)));
_collisionList.addItem(veg);
_collisionList2.addItem(veg);
veg.y = (-(veg.height) - (Math.random() * 100));
_treats.push(veg);
addChild(veg);
}
public function billEnteringScreen(){
if (coinToss(3)){
playFX("bill_", 5);
};
}
public function playFX(id:String, randomRange:int=-1, vol:int=1):void{
var rand:int;
if (randomRange != -1){
rand = (1 + (Math.random() * randomRange));
id = (id + rand);
};
var ClassRef:Class = (getDefinitionByName(id) as Class);
playAudio(ClassRef, "fx", vol);
}
private function playAudio(sndclass:Class, type:String, vol:int=1, stopAudio:Boolean=false){
var channel:SoundChannel;
trace("playAudio", sndclass, type, vol, stopAudio);
var trans:SoundTransform = new SoundTransform();
trans.volume = vol;
var snd:Sound = new (sndclass);
if (type == fx){
channel = FXch;
} else {
if (type == "rexSound"){
REXch.soundTransform = trans;
if (stopAudio){
stopRexAudio();
};
REXch = snd.play();
_isRexTalking = true;
currentRexSnd = sndclass.toString().slice(7, -1);
REXch.addEventListener("soundComplete", RexSndCompleted);
} else {
if (type == "bossSound"){
BOSSch.soundTransform = trans;
if (stopAudio){
stopBossAudio();
};
BOSSch = snd.play();
_isBossTalking = true;
currentBossSnd = sndclass.toString().slice(7, -1);
BOSSch.addEventListener("soundComplete", BossSndCompleted);
} else {
FXch.soundTransform = trans;
FXch = snd.play();
};
};
};
}
function frame78(){
stop();
}
private function BossSndCompleted(e:Event=null):void{
trace("BOSSSndCompleted", currentBossSnd);
_isBossTalking = false;
trace(currentBossSnd.indexOf("horse_"));
if (currentBossSnd.indexOf("horse_") == 0){
trace("horse done talking");
tony.scream(false);
if (currentBossSnd == "horse_intro"){
tony.speech();
pauseTimers();
};
};
if (currentBossSnd.indexOf("inez_") == 0){
};
currentBossSnd = "";
}
private function init(e:Event=null):void{
dog = new Dog();
dog.mc = dog_mc;
dog2 = new Dog();
dog2.mc = dog2_mc;
dog2.max_xspeed = 30;
dog2.maxJumpPower = 30;
dog2.power = 6;
positionDogs();
playMusic(true);
Key.initialize(stage);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpped);
treatTimer = new Timer(2200);
treatTimer.addEventListener("timer", treatDropTimer);
setTimeout(startTreatTimer, 1100);
hungerTimer = new Timer(2200);
hungerTimer.addEventListener("timer", hungerPangsTimer);
score = 0;
tempScore = {score:0};
score_mc.score_txt.text = score;
pointsToAdd = 0;
scoreMultiplier = 1;
treatsCaughtThisJump = 0;
hoopsJumpedThroughThisJump = 0;
scaleValue = 50;
scale_mc.gotoAndStop(scaleValue);
_gameIsOver = false;
youWon = false;
_dog2_isLive = false;
hungerRate = 2;
veggie_odds = 6;
special_odds = 15;
brady = brady_mc;
bill = bill_mc;
tony = tony_mc;
inez = inez_mc;
tony.visible = false;
brady.visible = false;
inez.visible = false;
_isBossTime = false;
_isRexTalking = false;
_isBossTalking = false;
_isPaused = false;
REXch = new SoundChannel();
BOSSch = new SoundChannel();
FXch = new SoundChannel();
level = 1;
objectsDroppedThisLevel = 0;
nonTreatDrops = 0;
objectComplexity = 0;
dispnserDelay = 1800;
hoodieShakes = 0;
assFights = 1;
introInstructionStep = 1;
targetX2 = 700;
intro_mc.help_mc.visible = false;
laser = bill_mc.laser_mc;
dog_mc.head_mc.hair_mc.visible = false;
_collisionList = new CollisionList(dog_mc);
_collisionList.returnAngle = false;
_collisionList.alphaThreshold = 0;
_collisionList.addItem(bill_mc.head_mc);
_collisionList2 = new CollisionList(laser);
_collisionList2.returnAngle = false;
_collisionList2.alphaThreshold = 0;
_collisionList2.addItem(dog_mc);
_treats = [];
hoops = [];
treatTypes = [[{name:"hotdog", points:50}, {name:"mcrib", points:50}, {name:"burger", points:50}, {name:"chicken", points:50}, {name:"pizza", points:50}, {name:"drink", points:50}, {name:"beer", points:50}]];
veggieTypes = [{name:"carrot", points:-25}, {name:"apple", points:-25}, {name:"radish", points:-25}, {name:"pepper", points:-25}, {name:"brocoli", points:-25}];
specialObjectTypes = [[{objClass:Hoodie}], [{objClass:Cape}], [{objClass:Shakeweight}]];
addEventListener(Event.ENTER_FRAME, updateScene);
}
public function activateTony():void{
_collisionList.addItem(tony.leg1_mc);
_collisionList.addItem(tony.leg2_mc);
_collisionList.addItem(tony.leg3_mc);
_collisionList.addItem(tony.leg4_mc);
tony._isEatable = true;
tony.bomb();
showInstructions("horse");
startTreatTimer();
}
private function printEndScreen():void{
clearScreen();
trace("printEndScreen-A");
removeEventListener(Event.ENTER_FRAME, updateScene);
trace("printEndScreen-B");
treatTimer.removeEventListener("timer", treatDropTimer);
intro_mc.points_mc.points_txt.text = (score + " points");
openLeaderboard();
loadLeaderboard();
if (youWon){
intro_mc.rexhead_mc.gotoAndPlay("win");
} else {
intro_mc.rexhead_mc.gotoAndPlay("lose");
};
}
private function clearScreen():void{
var child:DisplayObject;
var i:int = (numChildren - 1);
while (i >= 0) {
child = getChildAt(i);
if ((child is GameObject)){
removeChildAt(i);
};
i--;
};
}
private function dropBigTreat():void{
dropTreats(1, 1, true);
}
private function shakeWeight(done:Boolean=false):void{
weightShakes++;
if ((((weightShakes == 35)) || (done))){
dog.shakeWeighted(false);
dog_mc.head_mc.message_mc.visible = false;
weightShakes = 0;
playRexAudio("rex_shakedone_1");
} else {
dog_mc.head_mc.message_mc.visible = true;
dog_mc.arm_mc.gotoAndPlay("shakeLoop");
if (weightShakes == 1){
playRexAudio("rex_shake_", 5, 1, true, true);
};
};
}
private function stopFlying():void{
dog.fly(false);
setTimeout(playRexAudio, 200, "rex_fly_done");
}
private function closeTopScoreBox():void{
Tweener.addTween(intro_mc.newScore_mc, {x:480, time:0.7, transition:"easeOutQuad"});
Tweener.addTween(intro_mc.leaderboard_mc, {y:-10, time:1, transition:"easeInOutCirc"});
}
public function destroyPig(pig:Pig):void{
destroyTreat(pig);
}
private function showInstructions(lbl:String, stick:Boolean=false):void{
if (((!((instructions_mc.alpha == 0))) && ((((lbl == "jump")) || ((lbl == "healthy")))))){
comparams = [lbl, stick];
Tweener.addTween(instructions_mc, {alpha:0, time:0.5, transition:"easeOutQuad", onComplete:showInstructions, onCompleteParams:[lbl, stick]});
return;
};
instructions_mc.gotoAndStop(lbl);
Tweener.addTween(instructions_mc, {alpha:1, time:0.5, transition:"easeOutQuad"});
instructions_mc.visible = true;
if (!stick){
Tweener.addTween(instructions_mc, {alpha:0, time:0.5, transition:"easeOutQuad", delay:3, onComplete:hideIntroInstructionStep});
};
}
private function updateScene(e:Event):void{
var objectClass:Class;
var hoop:Hoop;
var collisions:Array;
var collision:Object;
var treat:GameObject;
var hitMC:MovieClip;
var big:Pig;
var side:String;
var i:uint;
var bill_xDiff:int;
var p1:Point;
var p2:Point;
var dist:int;
var yDiffBill:int;
var xDiffBill:int;
var gravityAdj:Number;
var range1:int;
var range2:int;
var pnts:int;
var legID:int;
var targetTreat:GameObject;
var targetY:int;
var xDiff:int;
var yDiff:int;
var yDiffInez:int;
var assPull:int;
var j:int;
var closestProximity = 5000;
var closestProximity2 = 5000;
var hitByBall:Boolean;
dog.floorY = 405;
if (bill._isAboveGround){
bill_xDiff = Math.abs((bill_mc.x - dog_mc.x));
if (bill_xDiff < 100){
dog.floorY = (405 + bill_mc.head_mc.y);
if (dog.floorY > 405){
dog.floorY = 405;
};
};
};
i = 0;
while (i < _treats.length) {
p1 = new Point(dog_mc.x, dog_mc.y);
p2 = new Point(_treats[i].x, _treats[i].y);
dist = Math.abs(Point.distance(p1, p2));
if (dist < closestProximity){
closestProximity = dist;
};
if (closestProximity < 300){
if (!dog._isOccupied){
dog.chomp();
};
};
if (((bill._isWaitingToFire) && ((_treats[i] is Treat)))){
yDiffBill = (bill.y - _treats[i].y);
xDiffBill = Math.abs((bill.x - _treats[i].x));
gravityAdj = (3 * (GRAVITY / MAX_GRAVITY));
range1 = (xDiffBill / (12 - gravityAdj));
range2 = (xDiffBill / (6 - gravityAdj));
if ((((yDiffBill > range1)) && ((yDiffBill < range2)))){
bill.fire();
playFX("laser_", 2);
};
};
i++;
};
if ((((closestProximity < 400)) && (!(_gameIsOver)))){
collisions = _collisionList.checkCollisions();
i = 0;
while (i < collisions.length) {
if (dog._isOccupied){
} else {
collision = collisions[i];
if (collision.object2 == dog_mc){
hitMC = collision.object1;
} else {
hitMC = collision.object2;
};
objectClass = Object(hitMC).constructor;
if (objectClass != MovieClip){
treat = (hitMC as GameObject);
};
if ((((objectClass == Treat)) && (!(dog._isLasered)))){
if (((dog._isJumping) || (dog._isFlying))){
treatsCaughtThisJump++;
scoreMultiplier = (treatsCaughtThisJump + (hoopsJumpedThroughThisJump * 4));
};
pointsToAdd = (treat.pointValue * scoreMultiplier);
if (!dog._isJumping){
addToScore(pointsToAdd);
};
showPoints(treat.pointValue, scoreMultiplier);
dog.showHeart();
addScalePoints(-3);
destroyTreat(treat);
dog.smile();
if (treat.currentFrame > 40){
playFX("softeat", 2);
} else {
playFX("eat", 3);
};
playRexAudio("rex_eat_", 12);
} else {
if ((((objectClass == PigMC)) && (!(dog._isLasered)))){
if (hitMC.name == "pig_mc"){
big = (hitMC.parent as Pig);
if (big._isBiteable){
big.eatBigTreat("lt", 1);
if (big.bitesEaten_dog1 == 1){
playFX("pig_squeal_1");
};
if (big.bitesEaten_dog1 == 3){
playFX("pig_squeal_2");
};
pnts = (big.bitesEaten_dog1 * 100);
if (big.bitesEaten == big.totalBites){
_collisionList.removeItem(big.pig_mc);
_collisionList2.removeItem(big.pig_mc);
pnts = (pnts + 50);
};
showPoints(pnts);
addToScore(pnts);
addScalePoints(-3);
big._isBiteable = false;
setTimeout(big.activate, 800);
dog.smile();
playFX("bigeat", 3);
playRexAudio("rex_eatpig_", 4);
};
};
} else {
if (((!((hitMC.name == null))) && ((hitMC.name == "body_mc")))){
if (brady.eat()){
trace("BEAT BRADY");
_collisionList.removeItem(brady.football_mc);
trace("removed football");
_collisionList.removeItem(brady.body_mc);
trace("BEAT BRADY - AND REMOVED COLISION SHIT");
showPoints(1000);
addToScore(1000);
addScalePoints(-15);
dog.showHeart();
dog.getHair();
showInstructions("hair");
dog_mc.glow_mc.gotoAndPlay(2);
playFX("bigeat", 3);
playFX("brady_scream2");
playRexAudio("rex_brady_beat_", 2, 2, false, true);
bill.restart();
brady.die();
_isBossTime = false;
};
if (brady._isDead){
brady.die();
};
} else {
if (((!((hitMC.name == null))) && ((hitMC.name == "football_mc")))){
hitByBall = true;
trace("PLAY FOOTBALL SND");
playRexAudio("rex_brady_", 12, 2);
} else {
if (((!((hitMC.name == null))) && (!((hitMC.name.indexOf("leg") == -1))))){
if (tony._isEatable){
legID = int(hitMC.name.charAt(3));
tony.eatLeg(legID);
playFX("bigeat", 3);
tony._isEatable = false;
setTimeout(tony.reactivate, 2000);
_collisionList.removeItem(hitMC);
playBossAudio(("horse_leg_" + tony.legs_eaten), -1, true);
showPoints(1000);
addToScore(1000);
addScalePoints(-10);
dog.showHeart();
if (tony.collapsed){
_collisionList.addItem(tony.tonyhead_mc);
};
};
} else {
if (((!((hitMC.name == null))) && ((hitMC.name == "tonyhead_mc")))){
tony.kill();
stopBossAudio();
_isBossTime = false;
playFX("bigeat", 3);
playRexAudio("rex_whooo");
showPoints(5000);
addToScore(5000);
addScalePoints(-50);
gameOver(true);
} else {
if (objectClass == Billhead){
if (bill._isEatable){
};
} else {
if ((((objectClass == Cape)) && (!(dog._isLasered)))){
dog.fly();
clearTimeout(capeTimout);
capeTimout = setTimeout(stopFlying, 8000);
if (dog_mc.y == dog.floorY){
dog.yspeed = (dog.yspeed - (dog.power * 4));
};
setTimeout(playRexAudio, 500, "rex_fly_", 5, 1, true);
playFX("fart");
} else {
if (objectClass == Hoodie){
dog.coned();
hoodieShakes = 0;
showPoints(-25);
addToScore(-25);
playRexAudio("rex_hoodie_", 5, 1, true, true);
} else {
if ((((objectClass == Veggie)) && (!(dog._isLasered)))){
showPoints(-25);
addToScore(-25);
addScalePoints(3);
playRexAudio("rex_veg_", 12);
} else {
if ((((objectClass == Shakeweight)) && (!(dog._isLasered)))){
showPoints(-25);
addToScore(-25);
weightShakes = 0;
dog.shakeWeighted();
};
};
};
};
destroyTreat(treat);
};
};
};
};
};
};
};
};
i++;
};
};
if (((laser._isActive) && (!(_gameIsOver)))){
collisions = _collisionList2.checkCollisions();
i = 0;
while (i < collisions.length) {
collision = collisions[i];
if (collision.object2 == laser){
hitMC = collision.object1;
} else {
hitMC = collision.object2;
};
objectClass = Object(hitMC).constructor;
if (((!((objectClass == MovieClip))) && (!((objectClass == Dog))))){
treat = (hitMC as GameObject);
};
if (objectClass == Treat){
laserKill(treat);
if (coinToss(3)){
playRexAudio("rex_bill_", 8);
} else {
playRexAudio("rex_food_lasered_", 3);
};
} else {
if (objectClass == PigMC){
} else {
if (((!((hitMC.name == null))) && ((hitMC.name == "dog_mc")))){
if (!dog._isLasered){
laserGlow(hitMC);
dog.lasered();
setTimeout(deLaserRex, 200);
playRexAudio("rex_bill_", 8);
addScalePoints(3);
};
} else {
laserKill(treat);
};
};
};
i++;
};
};
i = 0;
while (i < _treats.length) {
objectClass = Object(_treats[i]).constructor;
if (objectClass != Pig){
_treats[i].vy = (_treats[i].vy + GRAVITY);
_treats[i].y = (_treats[i].y + _treats[i].vy);
_treats[i].x = (_treats[i].x + _treats[i].vx);
_treats[i].rotation = (_treats[i].rotation + _treats[i].vr);
};
if (_treats[i].y > stage.stageHeight){
destroyTreat(_treats[i]);
};
i++;
};
var AI_RT:Boolean;
var AI_LT:Boolean;
if (((!(_gameIsOver)) && (_dog2_isLive))){
if ((((targetX2 == 100)) && ((dog2_mc.x <= 110)))){
targetX2 = 700;
if (coinToss(4)){
playFX("dog2_pant");
};
} else {
if ((((targetX2 == 700)) && ((dog2_mc.x >= 690)))){
targetX2 = 100;
};
};
targetY = dog2_mc.y;
if (_treats.length > 0){
targetTreat = _treats[0];
if ((((((targetTreat is Treat)) || ((targetTreat is Pig)))) || ((targetTreat is Cape)))){
if (targetTreat.y > 50){
targetX2 = targetTreat.x;
} else {
if (targetX2 != 100){
targetX2 = 700;
};
};
targetY = targetTreat.y;
} else {
if (targetX2 != 100){
targetX2 = 700;
};
};
} else {
if (targetX2 != 700){
targetX2 = 100;
};
};
xDiff = (dog2_mc.x - targetX2);
yDiff = (dog2_mc.y - targetY);
if (xDiff < -50){
AI_RT = true;
} else {
if (xDiff > 50){
AI_LT = true;
};
};
};
if (((AI_LT) && ((dog2.tempX > dog2.minX)))){
dog2_mc.scaleX = (dog2_shadow_mc.scaleX = (dog2_mc.head_mc.message_mc.scaleX = -1));
if (dog2.xAcceleration > 0){
dog2.xAcceleration = (dog2.xAcceleration * 0.6);
};
dog2.xAcceleration = (dog2.xAcceleration - dog2.power);
dog2.xspeed = (dog2.xspeed + dog2.xAcceleration);
if (!dog2._isJumping){
dog2.run(true);
};
} else {
if (((AI_RT) && ((dog2.tempX < dog2.maxX)))){
dog2_mc.scaleX = (dog2_shadow_mc.scaleX = (dog2_mc.head_mc.message_mc.scaleX = 1));
if (dog2.xAcceleration < 0){
dog2.xAcceleration = (dog2.xAcceleration * 0.6);
};
dog2.xAcceleration = (dog2.xAcceleration + dog2.power);
dog2.xspeed = (dog2.xspeed + dog2.xAcceleration);
if (!dog2._isJumping){
dog2.run(true);
};
} else {
if (((!(AI_RT)) && (!(AI_LT)))){
dog2.run(false);
};
dog2.xAcceleration = (dog2.xAcceleration * 0.5);
};
};
if (dog2.xspeed < -(dog2.max_xspeed)){
dog2.xspeed = -(dog2.max_xspeed);
} else {
if (dog2.xspeed > dog2.max_xspeed){
dog2.xspeed = dog2.max_xspeed;
};
};
dog2.xspeed = (dog2.xspeed * dog2.friction);
if (!dog2._isFlying){
dog2.yspeed = (dog2.yspeed + gravity);
} else {
dog2.yspeed = (dog2.yspeed * dog2.friction);
};
var jumpPressed:Boolean;
if ((((((((((((closestProximity2 < 400)) && ((yDiff < 250)))) && ((yDiff > 100)))) && (!(dog2._isJumping)))) && (!(_gameIsOver)))) && (_dog2_isLive))){
dog2.jumpPower = dog2.maxJumpPower;
dog2.yspeed = -(dog2.jumpPower);
dog2.jump();
dog2_mc.head_mc.gotoAndStop("open");
jumpPressed = true;
};
if (dog2._isJumping){
dog2_mc.rotation = ((dog2.yDiff * 0.3) * -(dog2_mc.scaleX));
} else {
dog2_mc.rotation = 0;
};
dog2.tempY = (dog2_mc.y + dog2.yspeed);
dog2.tempX = (dog2_mc.x + dog2.xspeed);
if (dog2.tempY > dog2.floorY){
dog2.tempY = dog2.floorY;
if (dog2._isJumping){
dog2_mc.gotoAndStop("stand");
dog2_mc.head_mc.gotoAndStop("smile");
};
dog2.jump(false);
};
if ((((dog2.tempX > dog2.maxX)) && (AI_RT))){
dog2.tempX = dog2.maxX;
} else {
if ((((dog2.tempX < dog2.minX)) && (AI_LT))){
dog2.tempX = dog2.minX;
};
};
dog2.prevY = dog2_mc.y;
dog2_mc.y = dog2.tempY;
dog2_mc.x = (dog2_shadow_mc.x = dog2.tempX);
dog2.yDiff = (dog2.prevY - dog2_mc.y);
if (((((((((Key.isDown(Keyboard.LEFT)) && ((dog.tempX > dog.minX)))) && (!(_gameIsOver)))) && (!(dog._isLasered)))) && (!(_isPaused)))){
dog_mc.scaleX = (dog_shadow_mc.scaleX = (dog_mc.head_mc.message_mc.scaleX = (fart_mc.scaleX = -1)));
if (dog.xAcceleration > 0){
dog.xAcceleration = (dog.xAcceleration * 0.6);
};
dog.xAcceleration = (dog.xAcceleration - dog.power);
dog.xspeed = (dog.xspeed + dog.xAcceleration);
if (!dog._isJumping){
dog.run(true);
};
if (introInstructionStep == 1){
nextIntroInstructionStep();
};
} else {
if (((((((((((Key.isDown(Keyboard.RIGHT)) && ((dog.tempX < dog.maxX)))) && (!(_gameIsOver)))) && (!(dog._isLasered)))) && (!(_isPaused)))) || (inez._isOn))){
dog_mc.scaleX = (dog_shadow_mc.scaleX = (dog_mc.head_mc.message_mc.scaleX = (fart_mc.scaleX = 1)));
if (dog.xAcceleration < 0){
dog.xAcceleration = (dog.xAcceleration * 0.6);
};
dog.xAcceleration = (dog.xAcceleration + dog.power);
dog.xspeed = (dog.xspeed + dog.xAcceleration);
if (!dog._isJumping){
dog.run(true);
};
if (introInstructionStep == 1){
nextIntroInstructionStep();
};
} else {
if (((((((!(Key.isDown(Keyboard.RIGHT))) && (!(Key.isDown(Keyboard.LEFT))))) || (dog._isLasered))) || (_isPaused))){
dog.run(false);
};
dog.xAcceleration = (dog.xAcceleration * 0.5);
};
};
if (((Key.isDown(Keyboard.UP)) && (!(_gameIsOver)))){
if (dog._isFlying){
dog.yspeed = (dog.yspeed - dog.power);
};
};
if (((Key.isDown(Keyboard.DOWN)) && (!(_gameIsOver)))){
if (dog._isFlying){
dog.yspeed = (dog.yspeed + dog.power);
};
};
var maxXSpeed:int = dog.max_xspeed;
if (dog._isFlying){
maxXSpeed = dog.max_xFlySpeed;
} else {
if (dog._isTired){
maxXSpeed = dog.tired_xspeed;
} else {
if (dog._hasHair){
maxXSpeed = dog.max_xHairspeed;
};
};
};
if (dog.xspeed < -(maxXSpeed)){
dog.xspeed = -(maxXSpeed);
} else {
if (dog.xspeed > maxXSpeed){
dog.xspeed = maxXSpeed;
};
};
if (dog._isJumping){
dog.jump();
dog_mc.rotation = ((dog.yDiff * 0.2) * -(dog_mc.scaleX));
} else {
dog_mc.rotation = 0;
};
if (dog_mc.y == dog.floorY){
if (dog.yspeed > 0){
dog.yspeed = 0;
};
if (Key.isDown(Keyboard.SPACE)){
dog.jumpPower = dog.maxJumpPower;
if (dog._isTired){
dog.jumpPower = (dog.jumpPower * 0.8);
} else {
if (dog._hasHair){
dog.jumpPower = dog.maxJumpHairPower;
};
};
};
} else {
dog.jumpPower = (dog.jumpPower * 0.8);
};
dog.xspeed = (dog.xspeed * dog.friction);
if (!dog._isFlying){
dog.yspeed = (dog.yspeed + gravity);
} else {
dog.yspeed = (dog.yspeed * dog.friction);
};
if (dog._isLasered){
return;
};
if (tony._isScreaming){
dog.xspeed = (dog.xspeed - tony.screamPower.p);
dog.loseHair();
dog.yspeed = (dog.yspeed - 0.2);
dog_mc.scaleX = (dog_shadow_mc.scaleX = (dog_mc.head_mc.message_mc.scaleX = (fart_mc.scaleX = 1)));
};
if (inez._isOn){
yDiffInez = ((inez.x - 400) - dog_mc.x);
assPull = inez.assPower.p;
if (assPull > yDiffInez){
assPull = (yDiffInez / 6);
};
dog.xspeed = (dog.xspeed + assPull);
dog_mc.scaleX = (dog_shadow_mc.scaleX = (dog_mc.head_mc.message_mc.scaleX = (fart_mc.scaleX = 1)));
};
if (hitByBall){
if (brady.currentFrame < 160){
dog.xspeed = (dog.xspeed + 100);
} else {
dog.xspeed = (dog.xspeed - 100);
};
};
dog.tempY = (dog_mc.y + dog.yspeed);
dog.tempX = (dog_mc.x + dog.xspeed);
if (dog.tempY > dog.floorY){
dog.tempY = dog.floorY;
if (dog._isJumping){
addToScore(pointsToAdd);
pointsToAdd = 0;
treatsCaughtThisJump = 0;
hoopsJumpedThroughThisJump = 0;
dog_mc.gotoAndStop("stand");
j = 0;
while (j < hoops.length) {
hoop = hoops[j];
hoop.resetSensors();
j++;
};
};
dog.jump(false);
};
if (dog.tempX > dog.maxX){
dog.tempX = dog.maxX;
} else {
if (dog.tempX < dog.minX){
dog.tempX = dog.minX;
};
};
if (dog.tempY < 225){
dog.tempY = 225;
};
if (((dog._isFlying) && ((dog.tempY > 320)))){
dog.tempY = 320;
};
dog.prevY = dog_mc.y;
dog_mc.y = (fart_mc.y = dog.tempY);
dog_mc.x = (dog_shadow_mc.x = (fart_mc.x = dog.tempX));
dog.yDiff = (dog.prevY - dog_mc.y);
}
private function startTreatTimer():void{
treatTimer.start();
hungerTimer.start();
}
private function playMusic(boo:Boolean):void{
if (boo){
musicMixer = music.play(0, int.MAX_VALUE);
Tweener.addTween(musicMixer, {_sound_volume:0});
Tweener.addTween(musicMixer, {_sound_volume:0.33, time:1, transition:"easeOutSine"});
} else {
Tweener.addTween(musicMixer, {_sound_volume:0, time:1.2, transition:"easeOutSine"});
};
}
function pauseTimers():void{
treatTimer.stop();
hungerTimer.stop();
}
private function dropTreats(amnt:int, maxDifficulty:int=0, big:Boolean=false):void{
var treat:Treat;
var bigOne:Pig;
var difficulty:int;
var r2:int;
var treatType:Object;
var i:uint;
while (i < amnt) {
if (big){
treat = new Pig();
treat.x = (200 + (Math.random() * (stage.stageWidth - 400)));
bigOne = (treat as Pig);
_collisionList.addItem(bigOne.pig_mc);
_collisionList2.addItem(bigOne.pig_mc);
treat.y = -187;
treat.gotoAndPlay(2);
setTimeout(playRexAudio, 800, "rex_see_pig_", 2);
playFX("pig_1");
} else {
difficulty = (Math.random() * maxDifficulty);
r2 = Math.round((Math.random() * (treatTypes[difficulty].length - 1)));
treatType = treatTypes[difficulty][r2];
treat = new Treat();
treat.gotoAndStop(treatType.name);
treat.rotation = (Math.random() * 180);
treat.x = (50 + (Math.random() * (stage.stageWidth - 100)));
_collisionList.addItem(treat);
_collisionList2.addItem(treat);
treat.y = (-(treat.height) - (Math.random() * 100));
};
_treats.push(treat);
addChild(treat);
i++;
};
}
private function addScalePoints(val:int):void{
scaleValue = (scaleValue + val);
if (scaleValue > 80){
if (!dog._isTired){
playRexAudio("rex_hungry");
};
dog.tired(true);
} else {
dog.tired(false);
};
if (scaleValue < 0){
scaleValue = 0;
} else {
if (scaleValue > 100){
scaleValue = 100;
gameOver();
};
};
scale_mc.gotoAndStop(scaleValue);
}
private function tonyTime():void{
if (tony.visible){
return;
};
trace("TONY TIME!");
_isBossTime = true;
tony.visible = true;
tony.gotoAndPlay("intro");
tony.scream();
dog.screamed();
playBossAudio("horse_intro", -1, true);
_isPaused = true;
bill.done();
if (dog._isConed){
shakeHoodie(true);
};
if (dog._isWeighted){
shakeWeight(true);
};
}
private function keyUpped(e:KeyboardEvent):void{
if (dog._isConed){
shakeHoodie();
} else {
if (dog._isWeighted){
shakeWeight();
} else {
if (dog._isAssed){
fightAss();
};
};
};
if ((((((((((((e.keyCode == Keyboard.SPACE)) && (!(dog._isJumping)))) && (!(dog._isConed)))) && (!(dog._isWeighted)))) && (!(dog._isAssed)))) && (!(_isPaused)))){
dog.jump();
dog.yspeed = (dog.yspeed - dog.jumpPower);
if (introInstructionStep == 2){
nextIntroInstructionStep();
};
};
}
private function deLaserRex():void{
dog.lasered(false);
laserGlow(dog_mc, false);
}
private function positionDogs():void{
dog_mc.x = (dog_shadow_mc.x = 750);
dog2_mc.x = (dog2_shadow_mc.x = -250);
dog_mc.scaleX = (fart_mc.scaleX = (dog_shadow_mc.scaleX = -1));
dog_mc.gotoAndStop("stand");
dog2_mc.gotoAndStop("stand");
}
public function playRexAudio(id:String, randomRange:int=-1, priority:int=1, addToQ:Boolean=false, stepOnLine:Boolean=false){
var rand:int;
trace("playRexAudio", id, randomRange, priority, addToQ, stepOnLine);
if (((_isBossTime) && (tony.visible))){
return;
};
if (_gameIsOver){
return;
};
if (addToQ){
rexAudioQ = {id:id, randomRange:randomRange, priority:priority};
};
if ((((priority < 2)) && (_isBossTime))){
trace("too low priority for boss");
return;
};
if (stepOnLine){
stopRexAudio();
stopBossAudio();
};
if (_isRexTalking){
trace("rex is talking");
return;
};
if ((((id.indexOf("rex_inez_") == 0)) && (!(inez._isOn)))){
return;
};
_isRexTalking = true;
if (randomRange != -1){
rand = (1 + (Math.random() * randomRange));
id = (id + rand);
};
var ClassRef:Class = (getDefinitionByName(id) as Class);
playAudio(ClassRef, "rexSound", 1, stepOnLine);
}
private function hungerPangsTimer(e:TimerEvent):void{
addScalePoints(hungerRate);
}
public function playBossAudio(id:String, randomRange:int=-1, stepOnLine:Boolean=false){
var rand:int;
if (stepOnLine){
stopRexAudio();
stopBossAudio();
};
if (((_isBossTalking) || (_isRexTalking))){
return;
};
_isBossTalking = true;
if (randomRange != -1){
rand = (1 + (Math.random() * randomRange));
id = (id + rand);
};
var ClassRef:Class = (getDefinitionByName(id) as Class);
trace("playBossAudio", id, stepOnLine);
playAudio(ClassRef, "bossSound", 1, stepOnLine);
}
private function openTopScoreBox():void{
Tweener.addTween(intro_mc.newScore_mc, {x:184, time:0.7, transition:"easeOutQuad"});
Tweener.addTween(intro_mc.leaderboard_mc, {y:75, time:0.7, transition:"easeInOutCirc"});
intro_mc.newScore_mc.submit_btn.addEventListener("click", newScoreClick);
}
private function nxtClick(e:MouseEvent):void{
if (intro_mc.help_mc.currentFrame == intro_mc.help_mc.totalFrames){
showHelp(false);
} else {
intro_mc.help_mc.nextFrame();
};
}
private function introPlayCLick(e:MouseEvent):void{
scale_mc.gotoAndStop(50);
positionDogs();
gotoAndPlay("intro-transition");
setTimeout(init, 500);
playRexAudio("rex_eat_", 12);
}
private function newScoreClick(e:MouseEvent):void{
newTopScoreEntered(intro_mc.newScore_mc.name_txt.text, score);
}
private function introHelpCLick(e:MouseEvent):void{
showHelp(true);
playRexAudio("rex_eat_", 12);
}
private function showHelp(boo:Boolean):void{
if (boo){
intro_mc.help_mc.gotoAndStop(1);
intro_mc.help_mc.visible = true;
intro_mc.help_mc.next_btn.addEventListener("click", nxtClick);
Tweener.addTween(intro_mc.help_mc, {alpha:1, time:0.5, transition:"easeOutQuad"});
} else {
intro_mc.help_mc.next_btn.removeEventListener("click", nxtClick);
Tweener.addTween(intro_mc.help_mc, {alpha:0, time:0.5, transition:"easeOutQuad"});
};
}
private function printScore():void{
score_mc.score_txt.text = Math.round(tempScore.score);
}
private function shakeHoodie(done:Boolean=false):void{
hoodieShakes++;
if ((((hoodieShakes == 20)) || (done))){
dog.coned(false);
dog_mc.head_mc.message_mc.visible = false;
hoodieShakes = 0;
} else {
dog_mc.head_mc.message_mc.visible = true;
dog_mc.head_mc.gotoAndPlay("coneShake");
};
}
}
}//package
Section 183
//Veggie (Veggie)
package {
public class Veggie extends GameObject {
public var vx:Number;// = 0
public var vy:Number;// = 0
public var mass:Number;
public var vr:Number;// = 0
public function Veggie(){
super();
addFrameScript(0, frame1);
mass = 10;
pointValue = -25;
id = "Veggie";
vr = (-0.3 + (Math.random() * 0.6));
}
function frame1(){
stop();
}
}
}//package