Section 1
//AuxFunctions (caurina.transitions.AuxFunctions)
package caurina.transitions {
public class AuxFunctions {
public function AuxFunctions(){
super();
}
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 2
//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 3
//PropertyInfoObj (caurina.transitions.PropertyInfoObj)
package caurina.transitions {
public class PropertyInfoObj {
public var modifierParameters:Array;
public var isSpecialProperty:Boolean;
public var valueComplete:Number;
public var modifierFunction:Function;
public var extra:Object;
public var valueStart:Number;
public var hasModifier:Boolean;
public var arrayIndex:Number;
public var originalValueComplete:Object;
public function PropertyInfoObj(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 4
//SpecialProperty (caurina.transitions.SpecialProperty)
package caurina.transitions {
public class SpecialProperty {
public var parameters:Array;
public var getValue:Function;
public var preProcess:Function;
public var setValue:Function;
public function SpecialProperty(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 5
//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 6
//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 7
//Tweener (caurina.transitions.Tweener)
package caurina.transitions {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
public class Tweener {
private static var _timeScale:Number = 1;
private static var _currentTimeFrame:Number;
private static var _specialPropertySplitterList:Object;
public static var autoOverwrite:Boolean = true;
private static var _engineExists:Boolean = false;
private static var _currentTime:Number;
private static var _tweenList:Array;
private static var _specialPropertyModifierList:Object;
private static var _specialPropertyList:Object;
private static var _transitionList:Object;
private static var _inited:Boolean = false;
private static var __tweener_controller__:MovieClip;
public function Tweener(){
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 8
//TweenListObj (caurina.transitions.TweenListObj)
package caurina.transitions {
public class TweenListObj {
public var hasStarted:Boolean;
public var onUpdate:Function;
public var useFrames:Boolean;
public var count:Number;
public var onOverwriteParams:Array;
public var timeStart:Number;
public var timeComplete:Number;
public var onStartParams:Array;
public var onUpdateScope:Object;
public var rounded:Boolean;
public var onUpdateParams:Array;
public var properties:Object;
public var onComplete:Function;
public var transitionParams:Object;
public var updatesSkipped:Number;
public var onStart:Function;
public var onOverwriteScope:Object;
public var skipUpdates:Number;
public var onStartScope:Object;
public var scope:Object;
public var isCaller:Boolean;
public var timePaused:Number;
public var transition:Function;
public var onCompleteParams:Array;
public var onError:Function;
public var timesCalled:Number;
public var onErrorScope:Object;
public var onOverwrite:Function;
public var isPaused:Boolean;
public var waitFrames:Boolean;
public var onCompleteScope:Object;
public function TweenListObj(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 9
//HUD (com.mw.hud.HUD)
package com.mw.hud {
import com.mw.*;
import org.flixel.*;
public class HUD extends FlxGroup {
protected const BUTTON_OFFSET:uint = 8;
protected const BUTTON_TEXT_SIZE:uint = 12;
protected const TEXT_WIDTH:uint = 100;
protected const BUTTON_WIDTH:uint = 66;
protected const WIDTH:uint = 700;
protected const HEIGHT:uint = 45;
private var Background:Class;
private var MuteBg:Class;
protected var muteButton:FlxButton;
protected var starsText:FlxText;
private var ButtonHoverBg:Class;
protected var pointsText:FlxText;
private var UnmuteBg:Class;
protected var tint:FlxSprite;
private var ButtonBg:Class;
public function HUD(){
Background = HUD_Background;
ButtonBg = HUD_ButtonBg;
ButtonHoverBg = HUD_ButtonHoverBg;
MuteBg = HUD_MuteBg;
UnmuteBg = HUD_UnmuteBg;
super();
tint = new FlxSprite(0, 0);
tint.createGraphic(FlxG.width, (HEIGHT + 4), 285212672);
tint.scrollFactor.x = (tint.scrollFactor.y = 0);
add(tint);
starsText = makeTextField(0, -20, 0, "left", ("Stars:\t" + (FlxG.state as Game).getSave("numStars")));
add(starsText);
pointsText = makeTextField(0, -20, 0, "left", ("Points:\t" + (FlxG.state as Game).getSave("overallPoints")));
add(pointsText);
var muteBg:FlxSprite = new FlxSprite(0, 0, MuteBg);
var unmuteBg:FlxSprite = new FlxSprite(0, 0, UnmuteBg);
muteButton = new FlxButton(165, 12, function ():void{
FlxG.mute = !(FlxG.mute);
muteButton.on = FlxG.mute;
});
muteButton.loadGraphic(unmuteBg, muteBg);
add(muteButton);
this.y = 505;
}
override public function update():void{
starsText.text = ("Stars:\t" + (FlxG.state as Game).getSave("numStars"));
pointsText.text = ("Points:\t" + (FlxG.state as Game).getSave("overallPoints"));
muteButton.on = FlxG.mute;
super.update();
}
protected function makeButton(idx:uint, callback:Function, content:String, yOffset:int=0):FlxButton{
var button:FlxButton = new FlxButton((((BUTTON_WIDTH * idx) + BUTTON_OFFSET) + (idx * 10)), (((HEIGHT / 2) - 8) + yOffset), callback);
button.width = BUTTON_WIDTH;
var bg:FlxSprite = new FlxSprite(0, 0, ButtonBg);
var hoverBg:FlxSprite = new FlxSprite(0, 0, ButtonHoverBg);
button.loadGraphic(bg, hoverBg);
var text:FlxText = new FlxText(0, ((button.height / 2) - 8), button.width, content);
text.setFormat(Game.FONT_NAME, BUTTON_TEXT_SIZE, 4278190080, "center");
button.loadText(text);
button.scrollFactor.x = (button.scrollFactor.y = 0);
return (button);
}
protected function makeTextField(idx:uint, xOffset:int, yOffset:int, alignment:String, content:String, textWidth:int=100, fontSize:int=14):FlxText{
++idx;
var text:FlxText = new FlxText(((WIDTH - (TEXT_WIDTH * idx)) + xOffset), (((HEIGHT / 2) - 8) + yOffset), textWidth, content);
text.setFormat(Game.FONT_NAME, fontSize, 4278190080, alignment);
text.scrollFactor.x = (text.scrollFactor.y = 0);
return (text);
}
}
}//package com.mw.hud
Section 10
//HUD_Background (com.mw.hud.HUD_Background)
package com.mw.hud {
import mx.core.*;
public class HUD_Background extends BitmapAsset {
}
}//package com.mw.hud
Section 11
//HUD_ButtonBg (com.mw.hud.HUD_ButtonBg)
package com.mw.hud {
import mx.core.*;
public class HUD_ButtonBg extends BitmapAsset {
}
}//package com.mw.hud
Section 12
//HUD_ButtonHoverBg (com.mw.hud.HUD_ButtonHoverBg)
package com.mw.hud {
import mx.core.*;
public class HUD_ButtonHoverBg extends BitmapAsset {
}
}//package com.mw.hud
Section 13
//HUD_MuteBg (com.mw.hud.HUD_MuteBg)
package com.mw.hud {
import mx.core.*;
public class HUD_MuteBg extends BitmapAsset {
}
}//package com.mw.hud
Section 14
//HUD_UnmuteBg (com.mw.hud.HUD_UnmuteBg)
package com.mw.hud {
import mx.core.*;
public class HUD_UnmuteBg extends BitmapAsset {
}
}//package com.mw.hud
Section 15
//LevelHUD (com.mw.hud.LevelHUD)
package com.mw.hud {
import com.mw.*;
import org.flixel.*;
public class LevelHUD extends HUD {
private var level:Level;
private var rewindButton:FlxButton;
private var timerText:FlxText;
private var coinsText:FlxText;
private var nameText:FlxText;
private var parTimeText:FlxText;
private var comboButton:FlxButton;
private var resetButton:FlxButton;
private var quitButton:FlxButton;
private var inTimeTrial:Boolean;
private var timeTrialY:int;
public function LevelHUD(level:Level):void{
var level = level;
super();
this.level = level;
inTimeTrial = false;
quitButton = makeButton(0, quitCallback, "Quit", 9);
add(quitButton);
resetButton = makeButton(1, restartCallback, "Restart(R)", 9);
add(resetButton);
comboButton = makeButton(0, function ():void{
}, "Combo(C)", -12);
add(comboButton);
rewindButton = makeButton(1, function ():void{
}, "Rewind(V)", -12);
add(rewindButton);
coinsText = makeTextField(0, -20, 12, "left", "Coins: 0");
add(coinsText);
starsText.y = (starsText.y - 12);
nameText = makeTextField(3, -20, -6, "center", level.name, 300, 18);
add(nameText);
parTimeText = makeTextField(4, -10, 8, "left", ("Par Time: " + level.parTime));
add(parTimeText);
timeTrialY = (FlxG.height - 45);
timerText = makeTextField(4, -10, -8, "left", "Time: 0");
add(timerText);
}
public function getRewindButton():FlxButton{
return (rewindButton);
}
override public function update():void{
var elapsedTimeTrial:Number;
var elapsedTime:uint;
if (FlxG.keys.justReleased("R")){
restartCallback();
} else {
if (rewindButton.isPressed()){
level.doRewind = true;
} else {
if (comboButton.isPressed()){
level.doCombo = true;
};
};
};
coinsText.text = ((("Coins:\t" + level.collectedCoins) + "/") + level.totalCoins);
if (level.collectedCoins >= level.totalCoins){
coinsText.color = 4294967091;
};
if (level.inTimeTrial()){
timerText.visible = false;
elapsedTimeTrial = level.getElapsedTimeTrial();
parTimeText.setFormat(Game.FONT_NAME, 18, 0x7FFF00, "center");
parTimeText.solid = false;
parTimeText.y = timeTrialY;
if (elapsedTimeTrial <= level.timeTrial){
parTimeText.text = ("Time Trial: \n" + Math.round((level.timeTrial - elapsedTimeTrial)));
} else {
parTimeText.text = ("Time Trial: \n" + 0);
parTimeText.color = 4294901760;
};
} else {
elapsedTime = level.getElapsedTime();
timerText.text = ("Time: " + elapsedTime);
if (elapsedTime > level.parTime){
parTimeText.color = 4294901760;
};
};
super.update();
}
public function setName(name:String):void{
nameText.text = name;
}
private function quitCallback():void{
if (active){
(FlxG.state as Game).quitLevel();
};
}
private function restartCallback():void{
if (active){
(FlxG.state as Game).restartLevel();
};
}
}
}//package com.mw.hud
Section 16
//OverworldHUD (com.mw.hud.OverworldHUD)
package com.mw.hud {
import com.mw.*;
import org.flixel.*;
public class OverworldHUD extends HUD {
private const OVERWORLD_HUD_HEIGHT:uint = 46;
private var newGameButton:FlxButton;
private var rewindButton:FlxButton;
private var overworld:Overworld;
public function OverworldHUD(overworld:Overworld):void{
var overworld = overworld;
super();
this.overworld = overworld;
y = (y - 4);
newGameButton = makeButton(0, newGameCallback, "New Game", 0);
add(newGameButton);
rewindButton = makeButton(1, function ():void{
}, "Rewind(V)", 0);
add(rewindButton);
starsText.x = (starsText.x - 100);
}
private function newGameCallback():void{
var prompt:Prompt;
prompt = new Prompt("Are you sure you want to restart the game?\nYou will lose all of your progress!");
FlxG.state.addEventListener("cancel", function ():void{
remove(prompt);
prompt.destroy();
});
FlxG.state.addEventListener("confirm", function ():void{
(FlxG.state as Game).resetGame();
});
add(prompt);
}
override public function update():void{
if (rewindButton.isPressed()){
overworld.doRewind = true;
};
super.update();
}
}
}//package com.mw.hud
Section 17
//Bridge (com.mw.inhabitants.Bridge)
package com.mw.inhabitants {
import flash.events.*;
import net.pixelpracht.tmx.*;
import com.mw.*;
import org.flixel.*;
public class Bridge extends Inhabitant {
private var obj:TmxObject;
private var bridgeImg:Class;
private var bridgeSprite:FlxSprite;
public function Bridge(obj:TmxObject, world:World){
bridgeImg = Bridge_bridgeImg;
this.obj = obj;
super(obj, world, true);
bridgeSprite = new FlxSprite(0, 0);
bridgeSprite.loadGraphic(bridgeImg, false, false);
createGraphic(obj.width, 16, 0xFFFFFF);
visible = true;
fixed = true;
height = 4;
offset.y = (offset.y + 12);
collideLeft = (collideRight = false);
}
override public function activateInhabitant(event:Event):void{
if ((FlxG.state as Game).getSave("numStars") >= starsRequired){
collideTop = (collideBottom = true);
};
super.activateInhabitant(event);
}
override public function render():void{
var i:int;
while (i < (obj.width / 8)) {
draw(bridgeSprite, (i * 8), 0);
i++;
};
super.render();
}
override public function deactivateInhabitant():void{
if ((FlxG.state as Game).getSave("numStars") < starsRequired){
collideTop = (collideBottom = false);
};
super.deactivateInhabitant();
}
}
}//package com.mw.inhabitants
Section 18
//Bridge_bridgeImg (com.mw.inhabitants.Bridge_bridgeImg)
package com.mw.inhabitants {
import mx.core.*;
public class Bridge_bridgeImg extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 19
//Cannon (com.mw.inhabitants.Cannon)
package com.mw.inhabitants {
import flash.events.*;
import net.pixelpracht.tmx.*;
import com.mw.*;
import org.flixel.*;
public class Cannon extends Inhabitant implements Restorable {
private var inCannon:Boolean;
private var cannonImg:Class;
private var cannonSprite:FlxSprite;
private var obj:TmxObject;
private var CANNON_VELOCITY:int;// = 500
public function Cannon(obj:TmxObject, world:World){
cannonImg = Cannon_cannonImg;
this.obj = obj;
obj.height = 20;
var shouldMove:Boolean;
if (((((obj.custom) && (obj.custom.hasOwnProperty("float")))) && (obj.custom.float))){
shouldMove = false;
};
super(obj, world, false, shouldMove);
inCannon = false;
if (((obj.custom) && (obj.custom.hasOwnProperty("strength")))){
CANNON_VELOCITY = obj.custom.strength;
};
loadGraphic(cannonImg, false, false, 18, 20);
fixed = true;
solid = false;
level.history.register(this);
}
override public function hitBottom(Contact:FlxObject, Velocity:Number):void{
enterCannon(Contact, Velocity);
super.hitBottom(Contact, Velocity);
}
public function getState():Array{
return ([inCannon, angle]);
}
override public function deactivateInhabitant():void{
if ((FlxG.state as Game).getSave("numStars") < starsRequired){
collideLeft = (collideRight = (collideBottom = (collideTop = false)));
};
super.deactivateInhabitant();
}
public function setState(state:Array):void{
inCannon = state[0];
angle = state[1];
}
override public function hitRight(Contact:FlxObject, Velocity:Number):void{
enterCannon(Contact, Velocity);
super.hitRight(Contact, Velocity);
}
override public function hitTop(Contact:FlxObject, Velocity:Number):void{
enterCannon(Contact, Velocity);
super.hitTop(Contact, Velocity);
}
override public function activateInhabitant(event:Event):void{
if ((FlxG.state as Game).getSave("numStars") >= starsRequired){
collideLeft = (collideRight = (collideBottom = (collideTop = true)));
};
super.activateInhabitant(event);
}
private function enterCannon(Contact:FlxObject, Velocity:Number):void{
if ((Contact is Character)){
level.character.x = (obj.x + 5);
level.character.y = (obj.y + 5);
level.character.startCannon(this);
inCannon = true;
};
}
override public function update():void{
if (inCannon){
if (((FlxG.keys.SPACE) || (FlxG.keys.UP))){
level.character.endCannon(this);
level.character.velocity.y = (-(CANNON_VELOCITY) * Math.cos(((angle * Math.PI) / 180)));
level.character.velocity.x = (CANNON_VELOCITY * Math.cos((((angle - 90) * Math.PI) / 180)));
inCannon = false;
} else {
if (FlxG.keys.LEFT){
angle = (angle - 5);
} else {
if (FlxG.keys.RIGHT){
angle = (angle + 5);
};
};
};
};
super.update();
}
override public function hitLeft(Contact:FlxObject, Velocity:Number):void{
enterCannon(Contact, Velocity);
super.hitLeft(Contact, Velocity);
}
}
}//package com.mw.inhabitants
Section 20
//Cannon_cannonImg (com.mw.inhabitants.Cannon_cannonImg)
package com.mw.inhabitants {
import mx.core.*;
public class Cannon_cannonImg extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 21
//Coin (com.mw.inhabitants.Coin)
package com.mw.inhabitants {
import net.pixelpracht.tmx.*;
import com.mw.*;
import org.flixel.*;
public class Coin extends Inhabitant implements Restorable {
private var sparkleImg:Class;
private var coinImg:Class;
private var coinSound:Class;
public function Coin(obj:TmxObject, world:World){
coinImg = Coin_coinImg;
sparkleImg = Coin_sparkleImg;
coinSound = Coin_coinSound;
obj.height = 16;
var shouldMove:Boolean;
if (((((obj.custom) && (obj.custom.hasOwnProperty("float")))) && (obj.custom.float))){
shouldMove = false;
};
super(obj, world, false, shouldMove);
loadGraphic(coinImg);
collideTop = (collideLeft = (collideBottom = (collideRight = false)));
fixed = true;
level.history.register(this);
level.totalCoins++;
}
public function getState():Array{
return (new Array(visible, active));
}
override public function update():void{
if (((((overlaps(level.character)) && (world.isActive()))) && (active))){
collectCoin();
};
super.update();
}
private function collectCoin():void{
var emitter:FlxEmitter;
if (!dead){
level.collectedCoins++;
visible = (active = false);
FlxG.play(coinSound, 0.2);
emitter = new FlxEmitter((this.x + world.getCurrentOffset().x), ((this.y + world.getCurrentOffset().y) - 8));
emitter.createSprites(sparkleImg, 10);
emitter.setSize(20, 20);
FlxG.state.add(emitter);
emitter.start();
};
}
public function setState(state:Array):void{
visible = state[0];
active = state[1];
}
}
}//package com.mw.inhabitants
Section 22
//Coin_coinImg (com.mw.inhabitants.Coin_coinImg)
package com.mw.inhabitants {
import mx.core.*;
public class Coin_coinImg extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 23
//Coin_coinSound (com.mw.inhabitants.Coin_coinSound)
package com.mw.inhabitants {
import mx.core.*;
public class Coin_coinSound extends SoundAsset {
}
}//package com.mw.inhabitants
Section 24
//Coin_sparkleImg (com.mw.inhabitants.Coin_sparkleImg)
package com.mw.inhabitants {
import mx.core.*;
public class Coin_sparkleImg extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 25
//CrumblingPlatform (com.mw.inhabitants.CrumblingPlatform)
package com.mw.inhabitants {
import net.pixelpracht.tmx.*;
import com.mw.*;
import org.flixel.*;
public class CrumblingPlatform extends Inhabitant implements Restorable {
private const RESPAWN_TIME:Number = 3;
private var crumblingPlatformImg:Class;
private var isCrumbling:Boolean;
private var crumblingPlatformSprite:FlxSprite;
private var obj:TmxObject;
private var elapsedCrumbledTime:Number;
private var isCrumbled:Boolean;
private var crumbledStartTime:Number;
public function CrumblingPlatform(obj:TmxObject, world:World){
crumblingPlatformImg = CrumblingPlatform_crumblingPlatformImg;
this.obj = obj;
super(obj, world);
crumbledStartTime = 0;
elapsedCrumbledTime = 0;
crumblingPlatformSprite = new FlxSprite(0, 0);
crumblingPlatformSprite.loadGraphic(crumblingPlatformImg, true, false);
createGraphic(obj.width, obj.height, 0xFFFFFF);
active = true;
visible = true;
fixed = true;
crumblingPlatformSprite.addAnimation("normal", [0], 0, false);
crumblingPlatformSprite.addAnimation("crumble", [1, 2], 1, false);
crumblingPlatformSprite.addAnimation("crumbled", [3, 4], 10, false);
crumblingPlatformSprite.addAnimation("respawn", [4, 3, 2, 1, 0], 20, false);
crumblingPlatformSprite.play("normal");
crumblingPlatformSprite.visible = false;
crumblingPlatformSprite.solid = false;
FlxG.state.add(crumblingPlatformSprite);
}
override public function hitTop(Contact:FlxObject, Velocity:Number):void{
if (((((!(isCrumbling)) && (!(isCrumbled)))) && ((Contact is Character)))){
crumblingPlatformSprite.play("crumble");
isCrumbling = true;
};
super.hitTop(Contact, Velocity);
}
public function setState(state:Array):void{
isCrumbled = state[0];
isCrumbled = state[1];
elapsedCrumbledTime = state[2];
crumbledStartTime = (new Date().getTime() - elapsedCrumbledTime);
}
override public function update():void{
var date:Date = new Date();
if (((isCrumbling) && (crumblingPlatformSprite.finished))){
isCrumbling = false;
solid = false;
isCrumbled = true;
crumblingPlatformSprite.play("crumbled");
} else {
if (((isCrumbled) && (crumblingPlatformSprite.finished))){
isCrumbled = false;
visible = false;
crumbledStartTime = date.getTime();
};
};
if (crumbledStartTime != 0){
elapsedCrumbledTime = (date.getTime() - crumbledStartTime);
if ((elapsedCrumbledTime / 1000) > RESPAWN_TIME){
visible = true;
solid = true;
isCrumbled = false;
crumblingPlatformSprite.play("respawn");
crumbledStartTime = 0;
};
};
super.update();
}
override public function render():void{
fill(0xFFFFFF);
var i:int;
while (i < (obj.width / 8)) {
draw(crumblingPlatformSprite, (i * 8), 0);
i++;
};
super.render();
}
public function getState():Array{
return ([isCrumbling, isCrumbled, elapsedCrumbledTime]);
}
}
}//package com.mw.inhabitants
Section 26
//CrumblingPlatform_crumblingPlatformImg (com.mw.inhabitants.CrumblingPlatform_crumblingPlatformImg)
package com.mw.inhabitants {
import mx.core.*;
public class CrumblingPlatform_crumblingPlatformImg extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 27
//Door (com.mw.inhabitants.Door)
package com.mw.inhabitants {
import flash.events.*;
import net.pixelpracht.tmx.*;
import com.mw.*;
import org.flixel.*;
import flash.net.*;
public class Door extends Inhabitant {
private var doorSound:Class;
private var ImgOverworldSilver:Class;
private var ImgLevelSilver:Class;
private var ImgFinish:Class;
private var ImgOverworld:Class;
private var ImgStar:Class;
private var applauseSound:Class;
private var ImgLevel:Class;
private var ImgOverworldGold:Class;
private var errorSound:Class;
private var ImgLevelGold:Class;
private var ImgNormal:Class;
public var props:TmxPropertySet;
public function Door(obj:TmxObject, world:World){
ImgNormal = Door_ImgNormal;
ImgStar = Door_ImgStar;
ImgFinish = Door_ImgFinish;
ImgLevelGold = Door_ImgLevelGold;
ImgLevelSilver = Door_ImgLevelSilver;
ImgLevel = Door_ImgLevel;
ImgOverworldGold = Door_ImgOverworldGold;
ImgOverworldSilver = Door_ImgOverworldSilver;
ImgOverworld = Door_ImgOverworld;
doorSound = Door_doorSound;
errorSound = Door_errorSound;
applauseSound = Door_applauseSound;
obj.height = 25;
var shouldMove:Boolean;
if (((obj.custom.hasOwnProperty("float")) && ((obj.custom.float == "true")))){
shouldMove = false;
};
super(obj, world, false, shouldMove);
props = obj.custom;
switch (props.type){
case "normal":
loadGraphic(ImgNormal);
break;
case "star":
loadGraphic(ImgStar);
break;
case "map":
loadGraphic(ImgStar);
break;
case "finish":
loadGraphic(ImgFinish);
break;
case "url":
loadGraphic(ImgOverworld);
break;
case "overworld":
case "victory":
loadGraphic(ImgOverworld);
updateDoor(null);
break;
case "level":
case "next":
loadGraphic(ImgLevel);
updateDoor(null);
break;
case "credits":
loadGraphic(ImgOverworld);
break;
default:
loadGraphic(ImgNormal);
break;
};
collideTop = (collideLeft = (collideBottom = (collideRight = false)));
fixed = true;
FlxG.state.addEventListener("updatedAchievements", updateDoor);
}
private function openMapDoor():void{
var mapping:String;
var validMap:Boolean;
var currentWorlds:Array;
var nextWorlds:String;
var eyeD:String;
var worlds:Array = level.getActiveWorlds().map(function (wor:World, index:int, arr:Array):int{
return (wor.id);
});
trace(worlds.indexOf(1));
var toOpen = "";
var map:Array = props.opens.split(";");
for each (mapping in map) {
validMap = true;
currentWorlds = mapping.split(">")[0].split(",");
nextWorlds = mapping.split(">")[1];
trace(("current: " + currentWorlds));
trace(("next: " + nextWorlds));
for each (eyeD in currentWorlds) {
validMap = (((worlds.indexOf(int(eyeD)) >= 0)) && (validMap));
};
if (validMap){
level.closeAndOpenWorlds(world, nextWorlds);
return;
};
};
}
private function openVictoryDoor():void{
level.win(false);
}
private function openStarDoor():void{
level.closeAndOpenWorlds(world, props.opens);
}
private function openFinishDoor():void{
FlxG.play(applauseSound, 0.7);
level.finish();
}
private function openURLDoor():void{
var uwCseUrl:URLRequest = new URLRequest("http://www.cs.washington.edu/research/projects/instr/cse481d/10sp/games/");
navigateToURL(uwCseUrl);
}
public function updateDoor(event:Event):void{
var achievements:Object;
var _local5:Boolean;
var _local6:Array;
var _local7:Object;
var _local8:Array;
var _local9:Boolean;
var x:Object;
var i:int;
achievements = (FlxG.state as Game).getSave("achievements");
switch (props.type){
case "level":
_local5 = true;
_local6 = achievements[props.level];
for each (x in _local6) {
if ((x is Boolean)){
if (!x){
_local5 = false;
break;
};
};
};
if (((achievements.hasOwnProperty(props.level)) && (_local5))){
loadGraphic(ImgLevelGold);
} else {
if (((_local6) && (_local6["finish"]))){
loadGraphic(ImgLevelSilver);
} else {
loadGraphic(ImgLevel);
};
};
break;
case "overworld":
_local7 = (FlxG.state as Game).getSave("levelGroups");
_local8 = _local7[props.opens];
_local5 = true;
_local9 = true;
if (_local8){
i = 0;
while (i < _local8.length) {
_local6 = achievements[_local8[i]];
for each (x in _local6) {
if ((x is Boolean)){
if (!x){
_local5 = false;
};
};
};
if (((!(_local6)) || (!(_local6["finish"])))){
_local5 = false;
_local9 = false;
break;
};
i++;
};
} else {
_local5 = false;
_local9 = false;
};
if (_local5){
loadGraphic(ImgOverworldGold);
} else {
if (_local9){
loadGraphic(ImgOverworldSilver);
} else {
loadGraphic(ImgOverworld);
};
};
break;
};
}
override public function update():void{
var starsRequired:uint;
var game:Game = (FlxG.state as Game);
if (((((overlaps(level.character)) && (world.isActive()))) && (!(level.isAnimating())))){
if (props.hasOwnProperty("description")){
world.showName(props.description);
} else {
if (props.hasOwnProperty("level")){
world.showName(props.level);
};
};
if (((props.hasOwnProperty("starsRequired")) && (((FlxG.state as Game).getSave("numStars") < props.starsRequired)))){
world.showStarsRequired(props.starsRequired);
};
if (((props.hasOwnProperty("cost")) && ((level.collectedCoins < props.cost)))){
world.showDoorCost(props.cost);
};
if (props.type == "level"){
world.showAchievements(this.props.level);
};
starsRequired = Number(props.starsRequired);
if (FlxG.keys.justReleased("SPACE")){
if (((((props.hasOwnProperty("starsRequired")) && ((game.getSave("numStars") < props.starsRequired)))) || (((props.hasOwnProperty("cost")) && ((level.collectedCoins < props.cost)))))){
FlxG.quake.start(0.01);
FlxG.play(errorSound);
} else {
FlxG.play(doorSound);
Game.log.addEvent(("open_door_" + props.type), "");
openDoor();
};
};
};
super.update();
}
public function openDoor():void{
Level.credits = null;
switch (props.type){
case "normal":
openNormalDoor();
break;
case "star":
openStarDoor();
break;
case "map":
openMapDoor();
break;
case "finish":
openFinishDoor();
break;
case "victory":
openVictoryDoor();
break;
case "level":
openLevelDoor();
break;
case "overworld":
openStarDoor();
break;
case "credits":
openCreditsDoor();
break;
case "next":
openNextDoor();
break;
case "url":
openURLDoor();
};
}
private function openNormalDoor():void{
level.closeAndOpenWorlds(world, null);
}
private function openNextDoor():void{
level.win(true);
}
private function openLevelDoor():void{
(FlxG.state as Game).startLevel(props.level);
}
private function openCreditsDoor():void{
openStarDoor();
Level.credits = new Credits(FlxG.width, FlxG.height);
this.level.add(Level.credits);
}
}
}//package com.mw.inhabitants
Section 28
//Door_applauseSound (com.mw.inhabitants.Door_applauseSound)
package com.mw.inhabitants {
import mx.core.*;
public class Door_applauseSound extends SoundAsset {
}
}//package com.mw.inhabitants
Section 29
//Door_doorSound (com.mw.inhabitants.Door_doorSound)
package com.mw.inhabitants {
import mx.core.*;
public class Door_doorSound extends SoundAsset {
}
}//package com.mw.inhabitants
Section 30
//Door_errorSound (com.mw.inhabitants.Door_errorSound)
package com.mw.inhabitants {
import mx.core.*;
public class Door_errorSound extends SoundAsset {
}
}//package com.mw.inhabitants
Section 31
//Door_ImgFinish (com.mw.inhabitants.Door_ImgFinish)
package com.mw.inhabitants {
import mx.core.*;
public class Door_ImgFinish extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 32
//Door_ImgLevel (com.mw.inhabitants.Door_ImgLevel)
package com.mw.inhabitants {
import mx.core.*;
public class Door_ImgLevel extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 33
//Door_ImgLevelGold (com.mw.inhabitants.Door_ImgLevelGold)
package com.mw.inhabitants {
import mx.core.*;
public class Door_ImgLevelGold extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 34
//Door_ImgLevelSilver (com.mw.inhabitants.Door_ImgLevelSilver)
package com.mw.inhabitants {
import mx.core.*;
public class Door_ImgLevelSilver extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 35
//Door_ImgNormal (com.mw.inhabitants.Door_ImgNormal)
package com.mw.inhabitants {
import mx.core.*;
public class Door_ImgNormal extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 36
//Door_ImgOverworld (com.mw.inhabitants.Door_ImgOverworld)
package com.mw.inhabitants {
import mx.core.*;
public class Door_ImgOverworld extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 37
//Door_ImgOverworldGold (com.mw.inhabitants.Door_ImgOverworldGold)
package com.mw.inhabitants {
import mx.core.*;
public class Door_ImgOverworldGold extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 38
//Door_ImgOverworldSilver (com.mw.inhabitants.Door_ImgOverworldSilver)
package com.mw.inhabitants {
import mx.core.*;
public class Door_ImgOverworldSilver extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 39
//Door_ImgStar (com.mw.inhabitants.Door_ImgStar)
package com.mw.inhabitants {
import mx.core.*;
public class Door_ImgStar extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 40
//Hint (com.mw.inhabitants.Hint)
package com.mw.inhabitants {
import net.pixelpracht.tmx.*;
import com.mw.*;
import org.flixel.*;
public class Hint extends Inhabitant {
private var hintImg:Class;
private var textHeight:int;// = 100
private var textObject:FlxText;
private var object:TmxObject;
public function Hint(obj:TmxObject, world:World){
hintImg = Hint_hintImg;
obj.width = (obj.height = 20);
super(obj, world, false, true);
object = obj;
loadGraphic(hintImg);
textObject = new FlxText(60, 60, obj.custom.width, obj.custom.text);
textObject.setFormat(Game.FONT_NAME, (Number(obj.custom.size) + 2), 4278190080, "center");
textObject.visible = false;
world.add(textObject);
if (((obj.custom) && (obj.custom.hasOwnProperty("height")))){
textHeight = obj.custom.height;
};
collideTop = (collideLeft = (collideBottom = (collideRight = false)));
fixed = true;
}
override public function render():void{
var worldOffset:FlxPoint = world.getCurrentOffset();
if (overlaps(level.character)){
textObject.visible = true;
textObject.x = ((object.x - (textObject.width / 2)) + worldOffset.x);
textObject.y = ((object.y - textHeight) + worldOffset.y);
} else {
textObject.visible = false;
};
super.render();
}
}
}//package com.mw.inhabitants
Section 41
//Hint_hintImg (com.mw.inhabitants.Hint_hintImg)
package com.mw.inhabitants {
import mx.core.*;
public class Hint_hintImg extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 42
//Inhabitant (com.mw.inhabitants.Inhabitant)
package com.mw.inhabitants {
import flash.events.*;
import net.pixelpracht.tmx.*;
import com.mw.*;
import org.flixel.*;
public class Inhabitant extends FlxSprite {
public var world:World;
protected var starsRequired:int;
protected var level:Level;
public function Inhabitant(obj:TmxObject, world:World, doAdjustSize:Boolean=false, doAdjustLocation:Boolean=false):void{
var obj = obj;
var world = world;
var doAdjustSize = doAdjustSize;
var doAdjustLocation = doAdjustLocation;
this.world = world;
level = world.level;
if (doAdjustSize){
adjustSize(obj);
};
if (doAdjustLocation){
adjustLocation(obj);
};
super(obj.x, obj.y);
starsRequired = obj.custom.starsRequired;
//unresolved jump
var _slot1 = e;
starsRequired = 0;
deactivateInhabitant();
FlxG.state.addEventListener("updatedAchievements", activateInhabitant);
}
protected function adjustLocation(obj:TmxObject):void{
var x:int = (obj.x / 8);
var y:int = (obj.y / 8);
var map:FlxTilemap = world.map;
while ((((y < map.heightInTiles)) && ((map.getTile(x, y) < map.collideIndex)))) {
y++;
};
obj.x = (x * 8);
obj.y = ((y * 8) - obj.height);
}
override public function render():void{
var worldOffset:FlxPoint;
worldOffset = world.getCurrentOffset();
offset.x = (offset.x - worldOffset.x);
offset.y = (offset.y - worldOffset.y);
super.render();
offset.x = (offset.x + worldOffset.x);
offset.y = (offset.y + worldOffset.y);
}
public function activateInhabitant(event:Event):void{
if ((FlxG.state as Game).getSave("numStars") >= starsRequired){
alpha = 1;
active = true;
};
}
public function deactivateInhabitant():void{
if ((FlxG.state as Game).getSave("numStars") < starsRequired){
alpha = 0.2;
active = false;
};
}
protected function adjustSize(obj:TmxObject):void{
obj.height = (obj.height - (obj.height % 8));
obj.width = (obj.width - (obj.width % 8));
if (obj.height <= 0){
obj.height = 8;
};
if (obj.width <= 0){
obj.width = 8;
};
obj.x = (obj.x - (obj.x % 8));
obj.y = (obj.y - (obj.y % 8));
}
}
}//package com.mw.inhabitants
Section 43
//Ladder (com.mw.inhabitants.Ladder)
package com.mw.inhabitants {
import net.pixelpracht.tmx.*;
import com.mw.*;
import org.flixel.*;
public class Ladder extends Inhabitant {
private var ladderImg:Class;
private var ladderSprite:FlxSprite;
private var ladderTopImg:Class;
private var obj:TmxObject;
private var ladderTopSprite:FlxSprite;
private var topDetector:OneWayPlatform;
public function Ladder(obj:TmxObject, world:World){
ladderImg = Ladder_ladderImg;
ladderTopImg = Ladder_ladderTopImg;
this.obj = obj;
var shouldMove:Boolean;
if (((((obj.custom) && (obj.custom.hasOwnProperty("float")))) && (obj.custom.float))){
shouldMove = false;
};
super(obj, world, true, shouldMove);
y = (y + 1);
ladderTopSprite = new FlxSprite(0, 0, ladderTopImg);
ladderSprite = new FlxSprite(0, 0, ladderImg);
topDetector = new OneWayPlatform(obj, world);
topDetector.visible = false;
world.inhabitants.add(topDetector);
createGraphic(obj.width, obj.height, 0xFFFFFF);
visible = true;
fixed = true;
collideLeft = (collideRight = (collideBottom = false));
}
override public function update():void{
if (((overlaps(level.character)) && (world.isActive()))){
level.character.startClimbing(this);
} else {
level.character.stopClimbing(this);
};
super.update();
}
override public function render():void{
draw(ladderTopSprite, 0, 0);
var i = 1;
while (i < (obj.height / 8)) {
draw(ladderSprite, 0, ((i * 8) - 1));
i++;
};
super.render();
}
}
}//package com.mw.inhabitants
Section 44
//Ladder_ladderImg (com.mw.inhabitants.Ladder_ladderImg)
package com.mw.inhabitants {
import mx.core.*;
public class Ladder_ladderImg extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 45
//Ladder_ladderTopImg (com.mw.inhabitants.Ladder_ladderTopImg)
package com.mw.inhabitants {
import mx.core.*;
public class Ladder_ladderTopImg extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 46
//Mover (com.mw.inhabitants.Mover)
package com.mw.inhabitants {
import flash.events.*;
import net.pixelpracht.tmx.*;
import com.mw.*;
import org.flixel.*;
public class Mover extends Inhabitant implements Restorable {
private var lastYError:int;
private var speed:uint;
private var sprite:FlxSprite;
private var segments:uint;
private var pointIndex:uint;
private var points:Array;
private var lastXError:int;
private var MoverImg:Class;
private var type:String;
public function Mover(obj:TmxObject, world:World, tmx:TmxMap){
var object:TmxObject;
MoverImg = Mover_MoverImg;
super(obj, world, true);
level.history.register(this);
fixed = true;
if (((obj.custom.hasOwnProperty("moving")) && (active))){
active = ((obj.custom.moving)=="true") ? true : false;
};
createGraphic(obj.custom.width, obj.custom.height, 0xFFFFFF);
sprite = new FlxSprite(0, 0, MoverImg);
segments = (obj.custom.width / sprite.width);
type = obj.custom.type;
speed = 40;
if (obj.custom.hasOwnProperty("speed")){
speed = obj.custom.speed;
};
points = new Array();
var objectGroup:TmxObjectGroup = tmx.getObjectGroup(("Objects " + world.id));
for each (object in objectGroup.objects) {
if ((((object.type == "moverPoint")) && ((object.name == obj.name)))){
adjustSize(object);
points.push({index:object.custom.index, x:object.x, y:object.y});
};
};
points.sortOn("index");
points.unshift({index:0, x:obj.x, y:obj.y});
pointIndex = 1;
lastXError = (x - points[pointIndex].x);
lastYError = (y - points[pointIndex].y);
if (obj.custom.hasOwnProperty("respondsTo")){
FlxG.state.addEventListener((obj.custom.respondsTo + "_on"), respondToSwitchOn);
FlxG.state.addEventListener((obj.custom.respondsTo + "_off"), respondToSwitchOff);
};
}
private function respondToSwitchOn(evt:Event):void{
active = true;
}
override public function update():void{
if (level.isAnimating()){
return;
};
var xError:Number = (x - points[pointIndex].x);
var yError:Number = (y - points[pointIndex].y);
var totalError:Number = Math.sqrt((Math.pow(xError, 2) + Math.pow(yError, 2)));
var xSpeed:Number = (((-1 * xError) / totalError) * speed);
var ySpeed:Number = (((-1 * yError) / totalError) * speed);
if (totalError < 2){
pointIndex++;
if (pointIndex >= points.length){
if (type == "bounce"){
pointIndex = 1;
points.reverse();
} else {
if (type == "loop"){
pointIndex = 0;
} else {
if (type == "stop"){
pointIndex--;
active = false;
velocity.x = (velocity.y = 0);
};
};
};
};
} else {
if (moves){
velocity.x = xSpeed;
velocity.y = ySpeed;
} else {
velocity.x = (velocity.y = 0);
};
};
super.update();
}
public function setState(state:Array):void{
active = state.shift();
x = state.shift();
y = state.shift();
velocity.x = state.shift();
velocity.y = state.shift();
pointIndex = state.shift();
points = new Array();
points = points.concat(state);
}
private function respondToSwitchOff(evt:Event):void{
velocity.x = (velocity.y = 0);
active = false;
}
public function getState():Array{
var state:Array = new Array(active, x, y, velocity.x, velocity.y, pointIndex);
return (state.concat(points));
}
override public function render():void{
var i:uint;
while (i < segments) {
draw(sprite, (sprite.width * i), 0);
i++;
};
super.render();
}
override public function activateInhabitant(event:Event):void{
if ((FlxG.state as Game).getSave("numStars") >= starsRequired){
collideLeft = (collideRight = (collideTop = (collideBottom = true)));
};
super.activateInhabitant(event);
}
override public function deactivateInhabitant():void{
if ((FlxG.state as Game).getSave("numStars") < starsRequired){
collideLeft = (collideRight = (collideTop = (collideBottom = false)));
};
super.deactivateInhabitant();
}
}
}//package com.mw.inhabitants
Section 47
//Mover_MoverImg (com.mw.inhabitants.Mover_MoverImg)
package com.mw.inhabitants {
import mx.core.*;
public class Mover_MoverImg extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 48
//OneWayPlatform (com.mw.inhabitants.OneWayPlatform)
package com.mw.inhabitants {
import net.pixelpracht.tmx.*;
import com.mw.*;
public class OneWayPlatform extends Inhabitant {
public function OneWayPlatform(obj:TmxObject, world:World){
super(obj, world, false, false);
createGraphic(obj.width, obj.height, 4278190080);
fixed = true;
collideLeft = (collideRight = (collideBottom = false));
}
}
}//package com.mw.inhabitants
Section 49
//Spikes (com.mw.inhabitants.Spikes)
package com.mw.inhabitants {
import net.pixelpracht.tmx.*;
import com.mw.*;
import org.flixel.*;
public class Spikes extends Inhabitant {
private var segments:uint;
private var sprite:FlxSprite;
private var SpikesImg:Class;
public function Spikes(obj:TmxObject, world:World){
SpikesImg = Spikes_SpikesImg;
obj.height = 8;
super(obj, world, true, true);
createGraphic(obj.width, obj.height, 0xFFFFFF);
fixed = true;
sprite = new FlxSprite(0, 0, SpikesImg);
segments = (obj.width / sprite.width);
}
override public function render():void{
var i:uint;
while (i < segments) {
draw(sprite, (sprite.width * i), 0);
i++;
};
super.render();
}
}
}//package com.mw.inhabitants
Section 50
//Spikes_SpikesImg (com.mw.inhabitants.Spikes_SpikesImg)
package com.mw.inhabitants {
import mx.core.*;
public class Spikes_SpikesImg extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 51
//Switch (com.mw.inhabitants.Switch)
package com.mw.inhabitants {
import flash.events.*;
import net.pixelpracht.tmx.*;
import com.mw.*;
import org.flixel.*;
public class Switch extends Inhabitant implements Restorable {
private var name:String;
private var isOn:Boolean;
private var suffix:String;
private var ImgSwitch:Class;
private var switchSound:Class;
public function Switch(obj:TmxObject, world:World){
ImgSwitch = Switch_ImgSwitch;
switchSound = Switch_switchSound;
obj.height = 32;
var shouldMove:Boolean;
if (((((obj.custom) && (obj.custom.hasOwnProperty("float")))) && (obj.custom.float))){
shouldMove = false;
};
super(obj, world, true, shouldMove);
level.history.register(this);
loadGraphic(ImgSwitch, true);
addAnimation("on", [1], 0, false);
addAnimation("off", [0], 0, false);
fixed = true;
collideLeft = (collideRight = (collideTop = (collideBottom = false)));
name = obj.name;
isOn = false;
if (obj.custom.start == "on"){
isOn = true;
play("on");
} else {
play("off");
};
suffix = "_on";
}
override public function update():void{
if (((FlxG.keys.justReleased("SPACE")) && (overlaps(level.character)))){
FlxG.play(switchSound);
FlxG.state.dispatchEvent(new Event((name + suffix)));
isOn = !(isOn);
suffix = (isOn) ? "_off" : "_on";
if (isOn){
play("on");
} else {
play("off");
};
};
super.update();
}
public function getState():Array{
return (new Array(isOn, _curAnim.name));
}
public function setState(state:Array):void{
isOn = state[0];
play(state[1]);
}
}
}//package com.mw.inhabitants
Section 52
//Switch_ImgSwitch (com.mw.inhabitants.Switch_ImgSwitch)
package com.mw.inhabitants {
import mx.core.*;
public class Switch_ImgSwitch extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 53
//Switch_switchSound (com.mw.inhabitants.Switch_switchSound)
package com.mw.inhabitants {
import mx.core.*;
public class Switch_switchSound extends SoundAsset {
}
}//package com.mw.inhabitants
Section 54
//TimeTrialStarter (com.mw.inhabitants.TimeTrialStarter)
package com.mw.inhabitants {
import net.pixelpracht.tmx.*;
import com.mw.*;
import org.flixel.*;
public class TimeTrialStarter extends Inhabitant {
private var timeIcon:Class;
public function TimeTrialStarter(obj:TmxObject, world:World){
timeIcon = TimeTrialStarter_timeIcon;
super(obj, world);
createGraphic(16, 16, 0xFFFFFF);
loadGraphic(timeIcon);
visible = true;
fixed = true;
}
override public function hitBottom(Contact:FlxObject, Velocity:Number):void{
if ((Contact is Character)){
if (!level.inTimeTrial()){
level.startTimeTrial();
};
};
super.hitBottom(Contact, Velocity);
}
}
}//package com.mw.inhabitants
Section 55
//TimeTrialStarter_timeIcon (com.mw.inhabitants.TimeTrialStarter_timeIcon)
package com.mw.inhabitants {
import mx.core.*;
public class TimeTrialStarter_timeIcon extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 56
//Trampoline (com.mw.inhabitants.Trampoline)
package com.mw.inhabitants {
import flash.events.*;
import net.pixelpracht.tmx.*;
import com.mw.*;
import org.flixel.*;
public class Trampoline extends Inhabitant {
private var rightSprite:FlxSprite;
private var trampolineRightImg:Class;
private var trampolineSingleImg:Class;
private var trampolineMiddleImg:Class;
private var trampolineLeftImg:Class;
private var boingSound:Class;
private var leftSprite:FlxSprite;
private var singleSprite:FlxSprite;
private var obj:TmxObject;
private var middleSprite:FlxSprite;
public function Trampoline(obj:TmxObject, world:World){
trampolineLeftImg = Trampoline_trampolineLeftImg;
trampolineMiddleImg = Trampoline_trampolineMiddleImg;
trampolineRightImg = Trampoline_trampolineRightImg;
trampolineSingleImg = Trampoline_trampolineSingleImg;
boingSound = Trampoline_boingSound;
this.obj = obj;
super(obj, world, true, true);
leftSprite = new FlxSprite(0, 0, trampolineLeftImg);
middleSprite = new FlxSprite(0, 0, trampolineMiddleImg);
rightSprite = new FlxSprite(0, 0, trampolineRightImg);
singleSprite = new FlxSprite(0, 0, trampolineSingleImg);
createGraphic(obj.width, obj.height, 0xFFFFFF);
visible = true;
fixed = true;
}
override public function hitTop(Contact:FlxObject, Velocity:Number):void{
if (((active) && ((Contact is Character)))){
FlxG.play(boingSound, 0.3);
level.character.velocity.y = (-(level.character.acceleration.y) * 1.25);
};
super.hitTop(Contact, Velocity);
}
override public function update():void{
super.update();
}
override public function render():void{
var i:int;
var segments:int = (obj.width / 8);
if (segments <= 1){
draw(singleSprite, 0, 0);
} else {
draw(leftSprite, 0, 0);
i = 1;
while (i < (segments - 1)) {
draw(middleSprite, (i * 8), 0);
i++;
};
draw(rightSprite, ((segments - 1) * 8), 0);
};
super.render();
}
override public function activateInhabitant(event:Event):void{
if ((FlxG.state as Game).getSave("numStars") >= starsRequired){
collideLeft = (collideRight = (collideBottom = (collideTop = true)));
};
super.activateInhabitant(event);
}
override public function deactivateInhabitant():void{
if ((FlxG.state as Game).getSave("numStars") < starsRequired){
collideLeft = (collideRight = (collideBottom = (collideTop = false)));
};
super.deactivateInhabitant();
}
}
}//package com.mw.inhabitants
Section 57
//Trampoline_boingSound (com.mw.inhabitants.Trampoline_boingSound)
package com.mw.inhabitants {
import mx.core.*;
public class Trampoline_boingSound extends SoundAsset {
}
}//package com.mw.inhabitants
Section 58
//Trampoline_trampolineLeftImg (com.mw.inhabitants.Trampoline_trampolineLeftImg)
package com.mw.inhabitants {
import mx.core.*;
public class Trampoline_trampolineLeftImg extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 59
//Trampoline_trampolineMiddleImg (com.mw.inhabitants.Trampoline_trampolineMiddleImg)
package com.mw.inhabitants {
import mx.core.*;
public class Trampoline_trampolineMiddleImg extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 60
//Trampoline_trampolineRightImg (com.mw.inhabitants.Trampoline_trampolineRightImg)
package com.mw.inhabitants {
import mx.core.*;
public class Trampoline_trampolineRightImg extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 61
//Trampoline_trampolineSingleImg (com.mw.inhabitants.Trampoline_trampolineSingleImg)
package com.mw.inhabitants {
import mx.core.*;
public class Trampoline_trampolineSingleImg extends BitmapAsset {
}
}//package com.mw.inhabitants
Section 62
//Background (com.mw.Background)
package com.mw {
import org.flixel.*;
public class Background extends FlxSprite {
private var welcomeScreen:Class;
public function Background(){
welcomeScreen = Background_welcomeScreen;
super();
fixed = true;
loadGraphic(welcomeScreen);
}
}
}//package com.mw
Section 63
//Background_welcomeScreen (com.mw.Background_welcomeScreen)
package com.mw {
import mx.core.*;
public class Background_welcomeScreen extends BitmapAsset {
}
}//package com.mw
Section 64
//Character (com.mw.Character)
package com.mw {
import com.mw.inhabitants.*;
import org.flixel.*;
public class Character extends FlxSprite implements Restorable {
private var inCannon:Boolean;
private var level:Level;
private var crushBottom:Boolean;
private var falling:Boolean;
public var alive:Boolean;
public var deadtext:FlxText;
private var climbing:Array;
private var flying:Boolean;
private var crushTop:Boolean;
private var jumpTime:Number;
private var crushRight:Boolean;
private var crushLeft:Boolean;
private var ImgPlayer:Class;
private var jumping:Boolean;
public function Character(x:Number, y:Number, lvl:Level){
ImgPlayer = Character_ImgPlayer;
super(x, y);
loadGraphic(ImgPlayer, true, true);
facing = RIGHT;
level = lvl;
level.history.register(this);
maxVelocity.x = 100;
acceleration.y = 1200;
drag.x = (maxVelocity.x * 10);
width = 8;
height = 10;
offset.x = 3;
offset.y = 3;
jumping = false;
jumpTime = 0;
falling = false;
inCannon = false;
flying = false;
alive = true;
climbing = new Array();
crushTop = (crushLeft = (crushBottom = (crushRight = false)));
addAnimation("idle", [0], 0, false);
addAnimation("walk", [1, 2, 3, 0], 10, true);
addAnimation("flail", [1, 2, 3, 0], 18, true);
addAnimation("jump", [4], 0, false);
}
override public function hitRight(other:FlxObject, velo:Number):void{
if (other.collideLeft){
crushRight = true;
};
super.hitRight(other, velo);
}
public function isClimbing(ladder:Ladder=null):Boolean{
if (ladder){
return ((climbing.indexOf(ladder) >= 0));
};
return ((climbing.length > 0));
}
override public function update():void{
if (((((crushTop) && (crushBottom))) || (((crushLeft) && (crushRight))))){
Game.log.addEvent("char_died", ((("crush" + this.x) + ",") + this.y));
alive = false;
};
crushTop = (crushLeft = (crushBottom = (crushRight = false)));
maxVelocity.x = 100;
drag.x = (maxVelocity.x * 4);
if (level.isAnimating()){
return;
};
if (((onFloor) || (isClimbing()))){
falling = false;
};
if (((FlxG.keys.DOWN) || (FlxG.keys.S))){
falling = true;
};
if (inCannon){
velocity.x = 0;
velocity.y = 0;
acceleration.y = 0;
} else {
if (isClimbing()){
acceleration.y = 0;
maxVelocity.y = 100;
drag.y = (maxVelocity.y * 4);
if (((FlxG.keys.UP) || (FlxG.keys.W))){
acceleration.y = (acceleration.y - drag.y);
} else {
if (((FlxG.keys.DOWN) || (FlxG.keys.S))){
acceleration.y = (acceleration.y + drag.y);
};
};
} else {
if (((((((FlxG.keys.UP) || (FlxG.keys.W))) && ((velocity.y < 0)))) && (jumping))){
acceleration.y = 300;
} else {
acceleration.y = 500;
};
maxVelocity.y = 300;
drag.y = 0;
};
};
acceleration.x = 0;
if (((((((FlxG.keys.LEFT) || (FlxG.keys.A))) && (!(inCannon)))) && (!(flying)))){
facing = LEFT;
acceleration.x = (acceleration.x - drag.x);
};
if (((((((FlxG.keys.RIGHT) || (FlxG.keys.D))) && (!(inCannon)))) && (!(flying)))){
facing = RIGHT;
acceleration.x = (acceleration.x + drag.x);
};
if (velocity.y >= 0){
jumping = false;
};
if (((onFloor) && (((FlxG.keys.justPressed("UP")) || (((FlxG.keys.justPressed("W")) && (!(jumping)))))))){
jumping = true;
velocity.y = -180;
};
if (flying){
if ((Math.abs(velocity.x) + Math.abs(velocity.y)) < 300){
flying = false;
trace("done");
} else {
if (velocity.x < 0){
drag.x = 20;
} else {
drag.y = -20;
};
maxVelocity.x = 500;
if (((FlxG.keys.LEFT) || (FlxG.keys.A))){
facing = LEFT;
if (velocity.x >= 0){
acceleration.x = (acceleration.x - 20);
};
};
if (((FlxG.keys.RIGHT) || (FlxG.keys.D))){
facing = RIGHT;
if (velocity.x <= 0){
acceleration.x = (acceleration.x + 20);
};
};
};
};
if ((((((velocity.y < 0)) && (!(onFloor)))) && (!(isClimbing())))){
play("jump");
} else {
if ((((((velocity.y > 0)) && (!(onFloor)))) || (((!((velocity.y == 0))) && (isClimbing()))))){
play("flail");
} else {
if (((!((velocity.x == 0))) && (onFloor))){
play("walk");
} else {
play("idle");
};
};
};
super.update();
}
override public function render():void{
var world:World;
var worldOffset:FlxPoint;
var activeWorlds:Array = level.getActiveWorlds();
for each (world in activeWorlds) {
worldOffset = world.getCurrentOffset();
x = (x + worldOffset.x);
y = (y + worldOffset.y);
super.render();
x = (x - worldOffset.x);
y = (y - worldOffset.y);
};
}
override public function hitBottom(other:FlxObject, velo:Number):void{
if (other.collideTop){
crushBottom = true;
};
jumpTime = 0;
flying = false;
if ((((other is Spikes)) && (other.active))){
if (alive){
Game.log.addEvent("char_died", ((("spikes" + this.x) + ",") + this.y));
alive = false;
};
} else {
if (!(((other is Trampoline)) && (other.active))){
super.hitBottom(other, velo);
};
};
}
public function startClimbing(ladder:Ladder):void{
if (!isClimbing(ladder)){
climbing.push(ladder);
};
}
override public function preCollide(other:FlxObject):void{
collideBottom = !(((falling) && ((((other is Ladder)) || ((other is OneWayPlatform))))));
super.preCollide(other);
}
override public function hitTop(other:FlxObject, velo:Number):void{
if (other.collideBottom){
crushTop = true;
};
super.hitBottom(other, velo);
}
public function endCannon(cannon:Cannon):void{
if (inCannon){
inCannon = false;
flying = true;
};
}
override public function hitLeft(other:FlxObject, velo:Number):void{
if (other.collideRight){
crushLeft = true;
};
super.hitLeft(other, velo);
}
public function setState(state:Array):void{
x = state[0];
y = state[1];
velocity.x = state[2];
velocity.y = state[3];
alive = state[4];
active = state[5];
_curFrame = state[6];
inCannon = state[7];
flying = state[8];
}
public function getState():Array{
return (new Array(x, y, velocity.x, velocity.y, alive, active, _curFrame, inCannon, flying));
}
public function stopClimbing(ladder:Ladder):void{
var idx:uint = climbing.indexOf(ladder);
if (idx >= 0){
climbing.splice(idx, 1);
};
}
public function startCannon(cannon:Cannon):void{
if (!inCannon){
inCannon = true;
};
}
}
}//package com.mw
Section 65
//Character_ImgPlayer (com.mw.Character_ImgPlayer)
package com.mw {
import mx.core.*;
public class Character_ImgPlayer extends BitmapAsset {
}
}//package com.mw
Section 66
//Credits (com.mw.Credits)
package com.mw {
import org.flixel.*;
public class Credits extends FlxGroup {
protected const BUTTON_TEXT_SIZE:uint = 12;
protected const BUTTON_WIDTH:uint = 66;
protected const TEXT_WIDTH:uint = 100;
private const CREDITS_SPEED:int = 1;
private const CREDITS_SIZE:int = 20;
private const HEADER_SIZE:int = 35;
private const SEPARATOR_SIZE:int = 50;
private var newGameBtn:FlxButton;
private var moreGamesBtn:FlxButton;
private var titleText:FlxText;
private var creditsText:FlxText;
private var backBG:Class;
private var ButtonHoverBg:Class;
private var endingText:FlxText;
private var continueBtn:FlxButton;
private var ButtonBg:Class;
private var moreGamesText:FlxText;
private var background:FlxSprite;
public function Credits(width:int, height:int, x:int=0, y:int=0){
ButtonBg = Credits_ButtonBg;
ButtonHoverBg = Credits_ButtonHoverBg;
backBG = Credits_backBG;
super();
this.width = width;
this.height = height;
this.x = x;
this.y = y;
visible = false;
background = new FlxSprite(0, 0);
background.loadGraphic(backBG);
titleText = new FlxText(x, height, width, "Hello Worlds!");
titleText.setFormat(Game.FONT_NAME, HEADER_SIZE, 4278190080, "center");
add(titleText);
creditsText = new FlxText(x, (height + SEPARATOR_SIZE), width, createCreditsText());
creditsText.setFormat(Game.FONT_NAME, CREDITS_SIZE, 4278190080, "center");
add(creditsText);
endingText = new FlxText(x, ((height / 2) - 200), width, "Thanks For Playing!\nCheck back soon for more levels!");
endingText.setFormat(Game.FONT_NAME, HEADER_SIZE, 4278190080, "center");
endingText.visible = false;
add(endingText);
}
override public function update():void{
if ((creditsText.y + creditsText.height) > 0){
titleText.y = (titleText.y - CREDITS_SPEED);
creditsText.y = (creditsText.y - CREDITS_SPEED);
} else {
endingText.visible = true;
};
super.update();
}
private function createCreditsText():String{
var txt:String = "";
txt = (txt + "A University of Washington CSE Production\n\n");
txt = (txt + "Developed by:\n");
txt = (txt + "Jeff Flatten\t\tMichael Eng\n");
txt = (txt + " Rich Snider\t\tBlake Thomson\n\n");
txt = (txt + "Art By:\n");
txt = (txt + "Marianne Lee\n\n");
txt = (txt + "Music from ccmixter.org\n");
txt = (txt + "Artists:\n");
txt = (txt + "khidir\n\n");
txt = (txt + "Sound Effects:\n");
txt = (txt + "findsounds.com");
return (txt);
}
override public function render():void{
super.render();
background.render();
}
}
}//package com.mw
Section 67
//Credits_backBG (com.mw.Credits_backBG)
package com.mw {
import mx.core.*;
public class Credits_backBG extends BitmapAsset {
}
}//package com.mw
Section 68
//Credits_ButtonBg (com.mw.Credits_ButtonBg)
package com.mw {
import mx.core.*;
public class Credits_ButtonBg extends BitmapAsset {
}
}//package com.mw
Section 69
//Credits_ButtonHoverBg (com.mw.Credits_ButtonHoverBg)
package com.mw {
import mx.core.*;
public class Credits_ButtonHoverBg extends BitmapAsset {
}
}//package com.mw
Section 70
//Game (com.mw.Game)
package com.mw {
import flash.events.*;
import flash.utils.*;
import net.pixelpracht.tmx.*;
import com.mw.inhabitants.*;
import org.flixel.*;
import FGReplay.*;
import com.mw.hud.*;
import flash.net.*;
import org.flixel.data.*;
public class Game extends FlxState {
private const LEVEL_ORDER:Array;
public const RELEASE:Boolean = true;
private var Begins:Class;
private var Switching:Class;
private var Planetside:Class;
private var Beta:Class;
private var Elevator:Class;
private var CrumblingPlatforms:Class;
private var OverworldXml:Class;
private var Acrobatics:Class;
private var Teardown:Class;
private var Xtreme:Class;
private var SuperJump:Class;
private var background:Class;
private var Hanoi:Class;
private var rewindBubble:RewindBubble;
private var Alpha:Class;
private var Tetris:Class;
private var overworld:Overworld;
public var SketchyFont:Class;
private var DropDown:Class;
private var Alternate:Class;
private var CyclicalParadise:Class;
private var Sideways:Class;
private var Walkway:Class;
private var Ladders:Class;
private var AroundAgain:Class;
private var MemoryMap:Class;
public var level:Level;
private var Gamma:Class;
private var Stairstepper:Class;
private var Slide:Class;
private var Climb:Class;
private var Lattice:Class;
private var TheDestructionOfWorlds:Class;
private var MultiWorlds:Class;
private var Coinage:Class;
private var Equalizer:Class;
private var Bouncy:Class;
private var LeapOfFaith:Class;
private var activeLevelString:String;
private var levelHud:LevelHUD;
private var overworldHud:OverworldHUD;
private var Mirror:Class;
private var Floater:Class;
private var HiddenStairway:Class;
private var Movers:Class;
private var MoreWorlds:Class;
public static const SONG_URL:String = "http://www.cs.washington.edu/research/projects/instr/cse481d/10sp/games/HelloWorlds/why.mp3";
public static const NAME:String = "hw.v1.4.33";
public static const BETA:Boolean = false;
public static const FONT_NAME:String = "Sketchy";
public static var log:CapstoneReplay;
public static var loglvl:GameLevel;
public function Game():void{
OverworldXml = Game_OverworldXml;
Begins = Game_Begins;
Coinage = Game_Coinage;
MultiWorlds = Game_MultiWorlds;
TheDestructionOfWorlds = Game_TheDestructionOfWorlds;
MoreWorlds = Game_MoreWorlds;
Ladders = Game_Ladders;
Movers = Game_Movers;
Switching = Game_Switching;
Walkway = Game_Walkway;
HiddenStairway = Game_HiddenStairway;
CyclicalParadise = Game_CyclicalParadise;
Bouncy = Game_Bouncy;
Acrobatics = Game_Acrobatics;
Elevator = Game_Elevator;
LeapOfFaith = Game_LeapOfFaith;
SuperJump = Game_SuperJump;
Teardown = Game_Teardown;
Alpha = Game_Alpha;
Beta = Game_Beta;
Gamma = Game_Gamma;
Planetside = Game_Planetside;
DropDown = Game_DropDown;
Sideways = Game_Sideways;
Stairstepper = Game_Stairstepper;
CrumblingPlatforms = Game_CrumblingPlatforms;
Slide = Game_Slide;
Lattice = Game_Lattice;
AroundAgain = Game_AroundAgain;
Xtreme = Game_Xtreme;
Alternate = Game_Alternate;
Equalizer = Game_Equalizer;
Climb = Game_Climb;
MemoryMap = Game_MemoryMap;
Hanoi = Game_Hanoi;
Mirror = Game_Mirror;
Tetris = Game_Tetris;
Floater = Game_Floater;
background = Game_background;
SketchyFont = Game_SketchyFont;
LEVEL_ORDER = ["Alpha", "Beta", "Gamma", "The Destruction Of Worlds", "Teardown", "Planetside", "Around Again", "More Worlds", "Hidden Stairway", "Equalizer", "Ladders", "Bouncy", "Leap Of Faith", "Alternate", "Climb", "Lattice", "Sideways", "Slide", "Cyclical Paradise", "Super Jump", "Drop Down"];
super();
var id:uint = (Math.random() * uint.MAX_VALUE);
initSave("numCoins", 0);
initSave("numStars", 0);
initSave("numPoints", 0);
initSave("overallPoints", 0);
initSave("totalLevels", 0);
initSave("completedLevels", 0);
initSave("playedCredits", false);
initSave("playtime", 0);
initSave("playerID", id);
initSave("achievements", new Object());
initSave("levelGroups", new Object());
processLevelAchievements();
log = new CapstoneReplay(getSave("playerID"), getSave("playtime"));
loglvl = new GameLevel(getSave("playerID"), _slot1.NAME, getSave("playerID"));
loglvl.reportGame();
addEventListener("updatedAchievements", updatedAchievementsListener);
}
public function startOverworld():void{
FlxG.fade.start(4278190080, 0.25, startOverworldHelper, true);
}
private function processLevelAchievements():void{
var objects:Array;
var object:TmxObject;
var levelName:String;
var levelClassName:String;
var levelBytes:ByteArray;
var levelXml:XML;
var levelTmx:TmxMap;
var levelAchievements:Array;
var levelProperties:TmxPropertySet;
var achievements:Object = getSave("achievements");
var totalLevels:int = getSave("totalLevels");
if (((!(achievements)) || ((getSave("numStars") == 0)))){
achievements = new Object();
};
totalLevels = 0;
var bytes:ByteArray = new (this["OverworldXml"]);
var xml:XML = new XML(bytes.readUTFBytes(bytes.length));
var tmx:TmxMap = new TmxMap(xml);
var i = 1;
while (i <= tmx.getNumLayers()) {
objects = tmx.getObjectGroup(("Objects " + i.toString())).objects;
for each (object in objects) {
if ((((object.type == "door")) && ((object.custom.type == "level")))){
levelName = object.custom.level;
levelClassName = strip(levelName);
levelBytes = new (this[levelClassName]);
levelXml = new XML(levelBytes.readUTFBytes(levelBytes.length));
levelTmx = new TmxMap(levelXml);
levelAchievements = achievements[levelName];
if (!levelAchievements){
levelAchievements = new Array();
};
achievements[levelName] = levelAchievements;
levelProperties = levelTmx.properties;
if (i < tmx.getNumLayers()){
totalLevels = (totalLevels + 1);
};
if (!levelAchievements["finish"]){
levelAchievements["finish"] = false;
};
if (!levelAchievements["points"]){
levelAchievements["points"] = 0;
};
if (levelProperties.timeTrial){
if (!levelAchievements["timeTrial"]){
if (BETA){
levelAchievements["timeTrial"] = false;
} else {
levelAchievements["timeTrial"] = true;
};
};
};
//unresolved jump
var _slot1 = e;
if (levelProperties.parTime){
if (!levelAchievements["parTime"]){
levelAchievements["parTime"] = false;
};
};
//unresolved jump
var _slot1 = e;
if (levelProperties.coins){
if (!levelAchievements["coins"]){
levelAchievements["coins"] = false;
};
};
//unresolved jump
var _slot1 = e;
};
};
i = (i + 1);
};
setSave("achievements", achievements);
setSave("totalLevels", totalLevels);
}
public function pauseLevel():void{
level.active = false;
level.update();
}
private function startInFirstLevel():void{
overworld.closeAndOpenWorlds(overworld.worlds.members[0], "2", 0);
overworld.character.x = 217;
overworld.character.y = 480;
startLevel("Alpha", 0);
}
public function startNextLevel():void{
var idx:uint = LEVEL_ORDER.indexOf(level.name);
if (idx < 0){
startOverworld();
} else {
activeLevelString = LEVEL_ORDER[(idx + 1)];
FlxG.fade.start(4278190080, 0.25, startNextLevelHelper, true);
};
}
private function incrementPoints(amount:int):void{
setSave("numPoints", (getSave("numPoints") + amount));
}
public function startLevel(levelString:String, delay:Number=0.25):void{
activeLevelString = levelString;
FlxG.fade.start(4278190080, delay, startLevelHelper, true);
}
public function incrementStars():void{
var numStars:uint = getSave("numStars");
++numStars;
setSave("numStars", numStars);
}
private function updatedAchievementsListener(event:Event):void{
if (getSave("totalLevels") > 0){
};
}
public function quitLevel():void{
if (level != overworld){
_slot1.log.addEvent("quit_level", this.level.name);
startOverworld();
};
}
public function unpauseLevel():void{
level.active = true;
level.update();
}
private function startLevelHelper():void{
remove(overworld);
level = new Level(this[strip(activeLevelString)], activeLevelString);
add(level);
remove(overworldHud);
overworldHud.destroy();
levelHud = new LevelHUD(level);
add(levelHud);
FlxG.fade.start(4278190080, 0.25, null, true, true);
}
private function startNextLevelHelper():void{
remove(level);
level = new Level(this[strip(activeLevelString)], activeLevelString);
add(level);
remove(levelHud);
levelHud.destroy();
levelHud = new LevelHUD(level);
add(levelHud);
FlxG.fade.start(4278190080, 0.25, null, true, true);
var door:Door = overworld.findLevelDoor(activeLevelString);
overworld.closeAndOpenWorlds(overworld.getActiveWorlds()[0], door.world.id.toString(), 0);
overworld.character.x = (door.x + 5);
overworld.character.y = door.y;
}
override public function render():void{
super.render();
if (rewindBubble.visible){
rewindBubble.render();
};
}
public function initSave(property:String, defaultVal):void{
if (!FlxG.FlxSave.data.hasOwnProperty(property)){
FlxG.FlxSave.data[property] = defaultVal;
};
FlxG.FlxSave.flush();
}
public function finishLevel(collectedCoins:uint, awardCoinsStar:Boolean, awardParTimeStar:Boolean, awardTimeTrialStar:Boolean, goToNext:Boolean):void{
var levelname:Object;
var achieves:Object;
incrementCoins(collectedCoins);
incrementPoints(level.totalPoints);
var achievements:Object = getSave("achievements");
var name:String = level.name;
if (level.inTimeTrial()){
if (((((!((achievements[name]["timeTrial"] == null))) && (!(achievements[name]["timeTrial"])))) && (awardTimeTrialStar))){
achievements[name]["timeTrial"] = true;
incrementStars();
};
} else {
if (!achievements[name]["finish"]){
achievements[name]["finish"] = true;
incrementStars();
setSave("completedLevels", (getSave("completedLevels") + 1));
};
if (((((!((achievements[name]["coins"] == null))) && (!(achievements[name]["coins"])))) && (awardCoinsStar))){
achievements[name]["coins"] = true;
incrementStars();
};
if (((((!((achievements[name]["parTime"] == null))) && (!(achievements[name]["parTime"])))) && (awardParTimeStar))){
achievements[name]["parTime"] = true;
incrementStars();
};
};
if (level.totalPoints > achievements[name]["points"]){
achievements[name]["points"] = level.totalPoints;
};
setSave("achievements", achievements);
dispatchEvent(new Event("updatedAchievements"));
if (goToNext){
startNextLevel();
} else {
startOverworld();
};
var totalTTS:int;
var totalCS:int;
var totalLC:int;
var overallPoints:int;
for (levelname in achievements) {
for (achieves in achievements[levelname]) {
totalTTS = (totalTTS + ((((achieves == "finish")) && (achievements[levelname][achieves]))) ? 1 : 0);
totalCS = (totalCS + ((((achieves == "coins")) && (achievements[levelname][achieves]))) ? 1 : 0);
totalLC = (totalLC + ((((achieves == "parTime")) && (achievements[levelname][achieves]))) ? 1 : 0);
overallPoints = (overallPoints + ((achieves)=="points") ? achievements[levelname][achieves] : 0);
};
};
FlxG.kong.API.stats.submit("levels_complete", totalLC);
FlxG.kong.API.stats.submit("time_trials_complete", totalTTS);
FlxG.kong.API.stats.submit("coins_complete", totalCS);
FlxG.kong.API.stats.submit("total_stars", getSave("numStars"));
FlxG.kong.API.stats.submit("overall_points", overallPoints);
setSave("overallPoints", overallPoints);
}
public function restartLevel(timeTrialMode:Boolean=false):void{
_slot1.log.addEvent("restart_level", this.level.name);
if (timeTrialMode){
restartLevelHelper(timeTrialMode);
} else {
FlxG.fade.start(4278190080, 0.5, restartLevelHelper, true);
};
}
override public function update():void{
if (!FlxG.kong){
(FlxG.kong = (parent.addChild(new FlxKong()) as FlxKong)).init();
};
if (!RELEASE){
if (FlxG.keys.justReleased("ONE")){
startLevel("Tetris");
} else {
if (FlxG.keys.justReleased("TWO")){
startLevel("Floater");
} else {
if (FlxG.keys.justReleased("THREE")){
startLevel("CyclicalParadise");
} else {
if (FlxG.keys.justReleased("FOUR")){
startLevel("LeapOfFaith");
} else {
if (FlxG.keys.justReleased("FIVE")){
startLevel("Climb");
} else {
if (FlxG.keys.justReleased("SIX")){
startLevel("Slide");
} else {
if (FlxG.keys.justPressed("I")){
resetGame();
} else {
if (FlxG.keys.justPressed("O")){
FlxG.FlxSave.clear();
} else {
if (FlxG.keys.justPressed("G")){
setSave("numStars", (getSave("numStars") - 1));
setSave("completedLevels", (getSave("completedLevels") - 1));
dispatchEvent(new Event("updatedAchievements"));
} else {
if (FlxG.keys.justPressed("H")){
setSave("numStars", (getSave("numStars") + 1));
setSave("completedLevels", (getSave("completedLevels") + 1));
dispatchEvent(new Event("updatedAchievements"));
} else {
if (FlxG.keys.justReleased("J")){
stage.frameRate = (stage.frameRate - 10);
} else {
if (FlxG.keys.justReleased("K")){
stage.frameRate = (stage.frameRate + 10);
} else {
if (FlxG.keys.justReleased("NINE")){
add(new Credits(FlxG.width, FlxG.height));
};
};
};
};
};
};
};
};
};
};
};
};
};
};
super.update();
}
private function startOverworldHelper():void{
remove(levelHud);
levelHud.destroy();
remove(level);
level.destroy();
level = overworld;
add(level);
overworldHud = new OverworldHUD(overworld);
add(overworldHud);
FlxG.fade.start(4278190080, 0.25, null, true, true);
}
public function incrementCoins(amount:uint):void{
var numCoins:uint = getSave("numCoins");
setSave("numCoins", (numCoins + amount));
}
public function restartLevelHelper(timeTrialMode:Boolean=false):void{
remove(level);
level = new Level(this[strip(activeLevelString)], activeLevelString, false, timeTrialMode);
add(level);
remove(levelHud);
levelHud.destroy();
levelHud = new LevelHUD(level);
add(levelHud);
FlxG.fade.start(4278190080, 0.5, null, true, true);
}
public function resetGame():void{
setSave("numCoins", 0);
setSave("numStars", 0);
setSave("numPoints", 0);
setSave("completedLevels", 0);
setSave("playedCredits", false);
setSave("overallPoints", 0);
setSave("totalLevels", 0);
setSave("achievements", new Object());
this.dispatchEvent(new Event("updatedAchievements"));
FlxG.state = new Game();
}
public function getSave(property:String){
return (FlxG.FlxSave.data[property]);
}
override public function create():void{
var background:FlxSprite = new FlxSprite(0, 0, background);
background.scrollFactor.x = (background.scrollFactor.y = 0);
add(background);
FlxG.stream(SONG_URL, 1, true);
level = (overworld = new Overworld());
add(overworld);
overworldHud = new OverworldHUD(overworld);
add(overworldHud);
if (getSave("numStars") == 0){
startInFirstLevel();
};
log.addEvent("game_startup", new Date().toString());
rewindBubble = new RewindBubble();
add(rewindBubble);
}
public function setSave(property:String, val){
FlxG.FlxSave.data[property] = val;
FlxG.FlxSave.flush();
}
public static function strip(target:String):String{
var temp:Array = target.split(" ");
target = "";
var i:int;
while (i < temp.length) {
target = (target + temp[i]);
i++;
};
return (target);
}
}
}//package com.mw
Section 71
//Game_Acrobatics (com.mw.Game_Acrobatics)
package com.mw {
import mx.core.*;
public class Game_Acrobatics extends ByteArrayAsset {
}
}//package com.mw
Section 72
//Game_Alpha (com.mw.Game_Alpha)
package com.mw {
import mx.core.*;
public class Game_Alpha extends ByteArrayAsset {
}
}//package com.mw
Section 73
//Game_Alternate (com.mw.Game_Alternate)
package com.mw {
import mx.core.*;
public class Game_Alternate extends ByteArrayAsset {
}
}//package com.mw
Section 74
//Game_AroundAgain (com.mw.Game_AroundAgain)
package com.mw {
import mx.core.*;
public class Game_AroundAgain extends ByteArrayAsset {
}
}//package com.mw
Section 75
//Game_background (com.mw.Game_background)
package com.mw {
import mx.core.*;
public class Game_background extends BitmapAsset {
}
}//package com.mw
Section 76
//Game_Begins (com.mw.Game_Begins)
package com.mw {
import mx.core.*;
public class Game_Begins extends ByteArrayAsset {
}
}//package com.mw
Section 77
//Game_Beta (com.mw.Game_Beta)
package com.mw {
import mx.core.*;
public class Game_Beta extends ByteArrayAsset {
}
}//package com.mw
Section 78
//Game_Bouncy (com.mw.Game_Bouncy)
package com.mw {
import mx.core.*;
public class Game_Bouncy extends ByteArrayAsset {
}
}//package com.mw
Section 79
//Game_Climb (com.mw.Game_Climb)
package com.mw {
import mx.core.*;
public class Game_Climb extends ByteArrayAsset {
}
}//package com.mw
Section 80
//Game_Coinage (com.mw.Game_Coinage)
package com.mw {
import mx.core.*;
public class Game_Coinage extends ByteArrayAsset {
}
}//package com.mw
Section 81
//Game_CrumblingPlatforms (com.mw.Game_CrumblingPlatforms)
package com.mw {
import mx.core.*;
public class Game_CrumblingPlatforms extends ByteArrayAsset {
}
}//package com.mw
Section 82
//Game_CyclicalParadise (com.mw.Game_CyclicalParadise)
package com.mw {
import mx.core.*;
public class Game_CyclicalParadise extends ByteArrayAsset {
}
}//package com.mw
Section 83
//Game_DropDown (com.mw.Game_DropDown)
package com.mw {
import mx.core.*;
public class Game_DropDown extends ByteArrayAsset {
}
}//package com.mw
Section 84
//Game_Elevator (com.mw.Game_Elevator)
package com.mw {
import mx.core.*;
public class Game_Elevator extends ByteArrayAsset {
}
}//package com.mw
Section 85
//Game_Equalizer (com.mw.Game_Equalizer)
package com.mw {
import mx.core.*;
public class Game_Equalizer extends ByteArrayAsset {
}
}//package com.mw
Section 86
//Game_Floater (com.mw.Game_Floater)
package com.mw {
import mx.core.*;
public class Game_Floater extends ByteArrayAsset {
}
}//package com.mw
Section 87
//Game_Gamma (com.mw.Game_Gamma)
package com.mw {
import mx.core.*;
public class Game_Gamma extends ByteArrayAsset {
}
}//package com.mw
Section 88
//Game_Hanoi (com.mw.Game_Hanoi)
package com.mw {
import mx.core.*;
public class Game_Hanoi extends ByteArrayAsset {
}
}//package com.mw
Section 89
//Game_HiddenStairway (com.mw.Game_HiddenStairway)
package com.mw {
import mx.core.*;
public class Game_HiddenStairway extends ByteArrayAsset {
}
}//package com.mw
Section 90
//Game_Ladders (com.mw.Game_Ladders)
package com.mw {
import mx.core.*;
public class Game_Ladders extends ByteArrayAsset {
}
}//package com.mw
Section 91
//Game_Lattice (com.mw.Game_Lattice)
package com.mw {
import mx.core.*;
public class Game_Lattice extends ByteArrayAsset {
}
}//package com.mw
Section 92
//Game_LeapOfFaith (com.mw.Game_LeapOfFaith)
package com.mw {
import mx.core.*;
public class Game_LeapOfFaith extends ByteArrayAsset {
}
}//package com.mw
Section 93
//Game_MemoryMap (com.mw.Game_MemoryMap)
package com.mw {
import mx.core.*;
public class Game_MemoryMap extends ByteArrayAsset {
}
}//package com.mw
Section 94
//Game_Mirror (com.mw.Game_Mirror)
package com.mw {
import mx.core.*;
public class Game_Mirror extends ByteArrayAsset {
}
}//package com.mw
Section 95
//Game_MoreWorlds (com.mw.Game_MoreWorlds)
package com.mw {
import mx.core.*;
public class Game_MoreWorlds extends ByteArrayAsset {
}
}//package com.mw
Section 96
//Game_Movers (com.mw.Game_Movers)
package com.mw {
import mx.core.*;
public class Game_Movers extends ByteArrayAsset {
}
}//package com.mw
Section 97
//Game_MultiWorlds (com.mw.Game_MultiWorlds)
package com.mw {
import mx.core.*;
public class Game_MultiWorlds extends ByteArrayAsset {
}
}//package com.mw
Section 98
//Game_OverworldXml (com.mw.Game_OverworldXml)
package com.mw {
import mx.core.*;
public class Game_OverworldXml extends ByteArrayAsset {
}
}//package com.mw
Section 99
//Game_Planetside (com.mw.Game_Planetside)
package com.mw {
import mx.core.*;
public class Game_Planetside extends ByteArrayAsset {
}
}//package com.mw
Section 100
//Game_Sideways (com.mw.Game_Sideways)
package com.mw {
import mx.core.*;
public class Game_Sideways extends ByteArrayAsset {
}
}//package com.mw
Section 101
//Game_SketchyFont (com.mw.Game_SketchyFont)
package com.mw {
import mx.core.*;
public class Game_SketchyFont extends FontAsset {
}
}//package com.mw
Section 102
//Game_Slide (com.mw.Game_Slide)
package com.mw {
import mx.core.*;
public class Game_Slide extends ByteArrayAsset {
}
}//package com.mw
Section 103
//Game_Stairstepper (com.mw.Game_Stairstepper)
package com.mw {
import mx.core.*;
public class Game_Stairstepper extends ByteArrayAsset {
}
}//package com.mw
Section 104
//Game_SuperJump (com.mw.Game_SuperJump)
package com.mw {
import mx.core.*;
public class Game_SuperJump extends ByteArrayAsset {
}
}//package com.mw
Section 105
//Game_Switching (com.mw.Game_Switching)
package com.mw {
import mx.core.*;
public class Game_Switching extends ByteArrayAsset {
}
}//package com.mw
Section 106
//Game_Teardown (com.mw.Game_Teardown)
package com.mw {
import mx.core.*;
public class Game_Teardown extends ByteArrayAsset {
}
}//package com.mw
Section 107
//Game_Tetris (com.mw.Game_Tetris)
package com.mw {
import mx.core.*;
public class Game_Tetris extends ByteArrayAsset {
}
}//package com.mw
Section 108
//Game_TheDestructionOfWorlds (com.mw.Game_TheDestructionOfWorlds)
package com.mw {
import mx.core.*;
public class Game_TheDestructionOfWorlds extends ByteArrayAsset {
}
}//package com.mw
Section 109
//Game_Walkway (com.mw.Game_Walkway)
package com.mw {
import mx.core.*;
public class Game_Walkway extends ByteArrayAsset {
}
}//package com.mw
Section 110
//Game_Xtreme (com.mw.Game_Xtreme)
package com.mw {
import mx.core.*;
public class Game_Xtreme extends ByteArrayAsset {
}
}//package com.mw
Section 111
//Icons (com.mw.Icons)
package com.mw {
import org.flixel.*;
public class Icons extends FlxGroup {
private const PADDING:int = 10;
private var icons:Array;
private var timeIcon:Class;
private var coinIcon:Class;
private var finishIcon:Class;
private var levelName:String;
private var starsIcon:Class;
private var bestScoreText:FlxText;
public function Icons(x:int, y:int, width:int, name:String):void{
var sprite:FlxSprite;
finishIcon = Icons_finishIcon;
coinIcon = Icons_coinIcon;
timeIcon = Icons_timeIcon;
starsIcon = Icons_starsIcon;
super();
this.x = x;
this.y = y;
this.levelName = name;
icons = new Array();
sprite = new FlxSprite(((16 * 0) + (PADDING * 0)), 0, finishIcon);
sprite.solid = false;
icons["finish"] = sprite;
this.add(icons["finish"]);
sprite = new FlxSprite(((16 * 1) + (PADDING * 1)), 0, coinIcon);
sprite.solid = false;
icons["coins"] = sprite;
this.add(icons["coins"]);
sprite = new FlxSprite(((16 * 2) + (PADDING * 2)), 0, timeIcon);
sprite.solid = false;
icons["parTime"] = sprite;
this.add(icons["parTime"]);
sprite = new FlxSprite(((16 * 3) + (PADDING * 3)), 0, starsIcon);
sprite.solid = false;
icons["special"] = sprite;
this.add(icons["special"]);
bestScoreText = new FlxText(6, 25, 120, "Best Score: 0");
bestScoreText.setFormat(Game.FONT_NAME, 14, 0, "center");
bestScoreText.solid = false;
this.add(bestScoreText);
updateAchievements();
}
public function updateAchievements():void{
var allAchievements:Object = (FlxG.state as Game).getSave("achievements");
var achievements:Array = allAchievements[levelName];
updateAchievementsHelper(achievements, "finish");
updateAchievementsHelper(achievements, "coins");
updateAchievementsHelper(achievements, "parTime");
updateAchievementsHelper(achievements, "special");
if (((achievements) && (!((achievements["points"] == null))))){
bestScoreText.text = ("Best Score: " + achievements["points"]);
};
}
override public function update():void{
updateAchievements();
super.update();
}
public function updateIconsPositions():void{
var i:int;
while (i < icons.length) {
(icons["finish"] as FlxSprite).x = ((this.x + (16 * i)) + (PADDING * i));
(icons["finish"] as FlxSprite).y = this.y;
i++;
};
}
public function setLevelName(levelName:String):void{
this.levelName = levelName;
updateAchievements();
}
private function updateAchievementsHelper(achievements:Array, achievementName:String):void{
if (((achievements) && (!((achievements[achievementName] == null))))){
(icons[achievementName] as FlxSprite).visible = true;
if (achievements[achievementName]){
(icons[achievementName] as FlxSprite).alpha = 1;
} else {
(icons[achievementName] as FlxSprite).alpha = 0.2;
};
} else {
(icons[achievementName] as FlxSprite).visible = false;
};
}
}
}//package com.mw
Section 112
//Icons_coinIcon (com.mw.Icons_coinIcon)
package com.mw {
import mx.core.*;
public class Icons_coinIcon extends BitmapAsset {
}
}//package com.mw
Section 113
//Icons_finishIcon (com.mw.Icons_finishIcon)
package com.mw {
import mx.core.*;
public class Icons_finishIcon extends BitmapAsset {
}
}//package com.mw
Section 114
//Icons_starsIcon (com.mw.Icons_starsIcon)
package com.mw {
import mx.core.*;
public class Icons_starsIcon extends BitmapAsset {
}
}//package com.mw
Section 115
//Icons_timeIcon (com.mw.Icons_timeIcon)
package com.mw {
import mx.core.*;
public class Icons_timeIcon extends BitmapAsset {
}
}//package com.mw
Section 116
//LayoutManager (com.mw.LayoutManager)
package com.mw {
import org.flixel.*;
import caurina.transitions.*;
public class LayoutManager implements Restorable {
private const OFF_SCREEN_VICTORY_OFFSET:Array;
private const TALL_OFFSETS:Array;
private const VICTORY_OFFSET:Array;
private const OFFSETS:Array;
private const WIDE_OFFSETS:Array;
private const OFF_SCREEN_OFFSETS:Array;
private var slots:Array;
public function LayoutManager(level:Level):void{
var idx:uint;
OFFSETS = [[4, 4], [352, 4], [4, 0x0100], [352, 0x0100]];
WIDE_OFFSETS = [[4, 4], [4, 0x0100]];
TALL_OFFSETS = [[4, 4], [352, 4]];
OFF_SCREEN_OFFSETS = [[-708, 4], [1408, 4], [-708, 252], [1408, 252]];
VICTORY_OFFSET = [108, 50];
OFF_SCREEN_VICTORY_OFFSET = [-592, 50];
slots = new Array();
super();
level.history.register(this);
slots = new Array();
var activeWorlds:Array = level.getActiveWorlds();
var i:uint;
while (i < activeWorlds.length) {
idx = getFirstAvailableSlot(activeWorlds[i].size);
setSlot(idx, activeWorlds[i], activeWorlds[i].size);
activeWorlds[i].offset.x = OFFSETS[idx][0];
activeWorlds[i].offset.y = OFFSETS[idx][1];
i++;
};
}
private function setSlot(idx:int, world:World, size:String):void{
slots[idx] = world;
if (size == "wide"){
slots[(idx + 1)] = world;
} else {
if (size == "tall"){
slots[(idx + 2)] = world;
} else {
if (size == "all"){
slots[(idx + 1)] = (slots[(idx + 2)] = (slots[(idx + 3)] = world));
};
};
};
}
public function closeAllAndOpenVictory(victory:World):void{
var victory = victory;
var i:uint;
while (i < 4) {
if (slots[i]){
closeWorld(slots[i], 0.5);
};
i = (i + 1);
};
FlxG.fade.start(4278190080, 0.5, function ():void{
victory.offset.x = VICTORY_OFFSET[0];
victory.offset.y = VICTORY_OFFSET[1];
victory.open();
FlxG.fade.start(4278190080, 0.25, null, true, true);
}, true);
}
public function getFirstAvailableSlot(size:String="normal"):uint{
var slot:uint;
var i:uint;
while (i < 4) {
if (!slots[i]){
if ((((size == "wide")) && (!(slots[(i + 1)])))){
return (i);
};
if ((((size == "tall")) && (!(slots[(i + 2)])))){
return (i);
};
if ((((((((size == "all")) && (!(slots[(i + 1)])))) && (!(slots[(i + 3)])))) && (!(slots[(i + 4)])))){
return (i);
};
return (i);
};
i++;
};
return (slot);
}
public function setState(state:Array):void{
var i = 3;
while (i >= 0) {
if (slots[i] != state[i]){
if (slots[i]){
slots[i].close();
slots[i] = null;
};
if (state[i]){
slots[i] = state[i];
slots[i].open;
slots[i].offset.x = OFFSETS[i][0];
slots[i].offset.y = OFFSETS[i][1];
};
};
i--;
};
}
public function getState():Array{
var state:Array = new Array();
var i:uint;
while (i < 4) {
state[i] = slots[i];
i++;
};
return (state);
}
public function closeAndOpen(toClose:World, toOpen:Array, speed:Number=0.5):void{
var world:World;
var toClose = toClose;
var toOpen = toOpen;
var speed = speed;
if (((toClose) && ((slots.indexOf(toClose) >= 0)))){
closeWorld(toClose, speed, function ():void{
var world:World;
for each (world in toOpen) {
openWorld(world, speed);
};
});
} else {
for each (world in toOpen) {
openWorld(world, speed);
};
};
}
private function openWorld(world:World, speed:Number):void{
world.open();
var idx:uint = getFirstAvailableSlot(world.size);
setSlot(idx, world, world.size);
world.offset.x = OFF_SCREEN_OFFSETS[idx][0];
world.offset.y = OFF_SCREEN_OFFSETS[idx][1];
Tweener.addTween(world.offset, {x:OFFSETS[idx][0], y:OFFSETS[idx][1], time:speed, transition:"easeInOutExpo"});
}
private function openStart(world:World):uint{
var idx:uint = getFirstAvailableSlot(world.size);
setSlot(idx, world, world.size);
world.offset.x = OFF_SCREEN_OFFSETS[idx][0];
world.offset.y = OFF_SCREEN_OFFSETS[idx][1];
return (idx);
}
private function closeWorld(world:World, speed:Number, callback:Function=null):void{
var idx:uint;
var world = world;
var speed = speed;
var callback = callback;
idx = slots.indexOf(world);
Tweener.addTween(world.offset, {x:OFF_SCREEN_OFFSETS[idx][0], y:OFF_SCREEN_OFFSETS[idx][1], time:speed, transition:"easeInOutExpo", onComplete:function ():void{
world.close();
setSlot(idx, null, world.size);
if (callback != null){
callback();
};
}});
}
}
}//package com.mw
Section 117
//Level (com.mw.Level)
package com.mw {
import flash.utils.*;
import net.pixelpracht.tmx.*;
import org.flixel.*;
import FGReplay.*;
public class Level extends FlxGroup implements Restorable {
private const SCROLL_DURATION:uint = 45;
public var name:String;
public var parTime:Number;
private var timeTrialMode:Boolean;
public var history:Replay;
private var timeTrialStart:Number;
public var totalCoins:uint;
public var doRewind:Boolean;
public var character:Character;
private var elapsedTimeTrial:Number;
public var worlds:FlxGroup;
private var layout:LayoutManager;
private var victory:VictoryWorld;
public var collectedCoins:uint;
public var doCombo:Boolean;
private var VictoryXml:Class;
public var totalPoints:int;
private var completionTime:Number;
public var timeTrial:Number;
public var record:Boolean;
public var debug:Boolean;
private var elapsedTime:Number;
private var counter:int;
public static var credits:Credits;
public function Level(LevelXml:Class, name:String, isOverworld:Boolean=false, timeTrialMode:Boolean=false):void{
var LevelXml = LevelXml;
var name = name;
var isOverworld = isOverworld;
var timeTrialMode = timeTrialMode;
VictoryXml = Level_VictoryXml;
super();
history = new Replay();
history.register(this);
add(history);
counter = 0;
doRewind = false;
doCombo = false;
var bytes:ByteArray = new (LevelXml);
var xml:XML = new XML(bytes.readUTFBytes(bytes.length));
var tmx:TmxMap = new TmxMap(xml);
this.name = name;
totalCoins = 0;
collectedCoins = 0;
elapsedTime = 0;
parTime = tmx.properties.parTime;
//unresolved jump
var _slot1 = e;
parTime = 0;
timeTrial = tmx.properties.timeTrial;
//unresolved jump
var _slot1 = e;
timeTrial = 0;
if (tmx.properties.background){
add(new Background());
};
//unresolved jump
var _slot1 = e;
this.timeTrialMode = timeTrialMode;
this.timeTrialStart = 0;
this.elapsedTimeTrial = 0;
if (isOverworld){
createRoomToLevelMap(tmx);
};
worlds = new FlxGroup();
var numWorlds:uint = tmx.getNumLayers();
var i:uint = 1;
while (i <= numWorlds) {
worlds.add(new World(tmx, i, this));
i = (i + 1);
};
add(worlds);
bytes = new VictoryXml();
xml = new XML(bytes.readUTFBytes(bytes.length));
victory = new VictoryWorld(new TmxMap(xml), 1, this);
victory.close();
add(victory);
layout = new LayoutManager(this);
var charObj:TmxObject = tmx.getObjectGroup("Character").objects[0];
character = new Character(charObj.x, charObj.y, this);
add(character);
debug = false;
record = true;
if (name != "Overworld"){
Game.log.addEvent("start_level", name);
};
if (timeTrialMode){
timeTrialStart = elapsedTime;
};
}
public function startTimeTrial():void{
if (!timeTrialMode){
(FlxG.state as Game).restartLevel(true);
};
}
public function finish():void{
recordCompletionTime();
if (inTimeTrial()){
recordTimeTrial();
};
layout.closeAllAndOpenVictory(victory);
totalPoints = ((5 * collectedCoins) + (3 * Math.max(0, (parTime - getElapsedTime()))));
victory.victory(this);
}
override public function render():void{
if (credits){
credits.render();
};
super.render();
}
public function getElapsedTimeTrial():Number{
if (elapsedTimeTrial != 0){
return (elapsedTimeTrial);
};
var time:Number = (elapsedTime - timeTrialStart);
return (time);
}
private function createRoomToLevelMap(tmx:TmxMap):void{
var obj:TmxObject;
var door:TmxPropertySet;
var levels:Array;
var roomObjects:Array;
var j:int;
var roomObject:TmxObject;
var levelDoor:TmxPropertySet;
var levelGroups:Object = (FlxG.state as Game).getSave("levelGroups");
var objectGroup:Array = tmx.getObjectGroup("Objects 1").objects;
var i:int;
while (i < objectGroup.length) {
obj = objectGroup[i];
if (obj.type == "door"){
door = obj.custom;
if (door.type == "overworld"){
levels = new Array();
levelGroups[door.opens] = levels;
roomObjects = tmx.getObjectGroup(("Objects " + door.opens)).objects;
j = 0;
while (j < roomObjects.length) {
roomObject = roomObjects[j];
if (roomObject.type == "door"){
levelDoor = roomObject.custom;
if (levelDoor.type == "level"){
levels.push(levelDoor.level);
};
};
j++;
};
};
};
i++;
};
(FlxG.state as Game).setSave("levelGroups", levelGroups);
}
public function inTimeTrial():Boolean{
return (timeTrialMode);
}
public function getElapsedTime():uint{
if (completionTime){
return (completionTime);
};
return (elapsedTime);
}
public function getActiveWorlds():Array{
var world:World;
var activeWorlds:Array = new Array();
for each (world in worlds.members) {
if (world.isActive()){
activeWorlds.push(world);
};
};
if (victory.isActive()){
activeWorlds.push(victory);
};
return (activeWorlds);
}
public function setState(state:Array):void{
collectedCoins = state[0];
}
public function closeAndOpenWorlds(toClose:World, toOpen:String, speed:Number=0.5):void{
var idx:String;
var world:World;
var newWorlds:Array = new Array();
if (toOpen){
for each (idx in toOpen.split(",")) {
world = worlds.members[(Number(idx) - 1)];
if (((!(world.isActive())) || ((world == toClose)))){
newWorlds.push(world);
};
};
};
layout.closeAndOpen(toClose, newWorlds, speed);
}
override public function update():void{
var world:World;
if (!character.alive){
if (FlxG.keys.V){
history.visible = true;
history.popState();
};
return;
};
collide();
if (((FlxG.keys.justReleased("Z")) && (!((FlxG.state as Game).RELEASE)))){
debug = !(debug);
};
super.update();
if (((FlxG.keys.V) || (doRewind))){
doRewind = false;
history.popState();
history.visible = true;
} else {
if (((((++counter % 2) == 0)) && (record))){
history.pushState();
history.visible = false;
counter = 0;
};
};
if (((FlxG.keys.C) || (doCombo))){
doCombo = false;
for each (world in worlds.members) {
world.doCombo = true;
};
};
elapsedTime = (elapsedTime + FlxG.elapsed);
}
public function isAnimating():Boolean{
var world:World;
var isAnimating:Boolean;
for each (world in getActiveWorlds()) {
isAnimating = ((isAnimating) || (world.isAnimating()));
};
isAnimating = ((isAnimating) || (victory.isAnimating()));
return (isAnimating);
}
public function win(goToNext:Boolean):void{
var allStars:int;
var achieve:Boolean;
var n:Object;
var levelAchievements:Array = getEndOfLevelAchievements();
Game.log.addEvent("finish_level", ((((((((((((name + ",") + getElapsedTime()) + ",") + history.used) + ",") + levelAchievements["finish"]) + ",") + levelAchievements["coins"]) + ",") + levelAchievements["parTime"]) + ",") + levelAchievements["special"]));
if (FlxG.kong){
allStars = 1;
for each (achieve in levelAchievements) {
if (!achieve){
allStars = 0;
};
};
FlxG.kong.API.stats.submit((Game.strip(name) + "_all_stars"), allStars);
FlxG.kong.API.stats.submit((Game.strip(name) + "_min_time"), getElapsedTime());
FlxG.kong.API.stats.submit((Game.strip(name) + "_max_coins"), collectedCoins);
FlxG.kong.API.stats.submit((Game.strip(name) + "_max_points"), totalPoints);
for (n in levelAchievements) {
if (levelAchievements[n] != "undefined"){
FlxG.kong.API.stats.submit(((Game.strip(name) + "_") + n), (levelAchievements[n]) ? 1 : 0);
};
};
FlxG.kong.API.stats.submit("total_coins", collectedCoins);
};
(FlxG.state as Game).finishLevel(collectedCoins, levelAchievements["coins"], levelAchievements["parTime"], levelAchievements["timeTrial"], goToNext);
}
public function getState():Array{
return ([collectedCoins]);
}
public function getEndOfLevelAchievements():Array{
var possibleAchievements:Array = (FlxG.state as Game).getSave("achievements")[name];
var achievements:Array = new Array();
if (inTimeTrial()){
trace(possibleAchievements["timeTrial"]);
trace(((elapsedTime + " ") + timeTrial));
if (((!((possibleAchievements["timeTrial"] == null))) && ((elapsedTimeTrial <= timeTrial)))){
achievements["timeTrial"] = true;
};
} else {
if (possibleAchievements["finish"] != null){
achievements["finish"] = true;
};
if (possibleAchievements["coins"] != null){
achievements["coins"] = (((collectedCoins >= totalCoins)) && ((totalCoins > 0)));
};
if (possibleAchievements["parTime"] != null){
achievements["parTime"] = (getElapsedTime() <= parTime);
};
if (possibleAchievements["special"]){
achievements["special"] = [false];
};
};
return (achievements);
}
public function recordCompletionTime():void{
completionTime = elapsedTime;
}
public function recordTimeTrial():void{
elapsedTimeTrial = (elapsedTime - timeTrialStart);
}
}
}//package com.mw
Section 118
//Level_VictoryXml (com.mw.Level_VictoryXml)
package com.mw {
import mx.core.*;
public class Level_VictoryXml extends ByteArrayAsset {
}
}//package com.mw
Section 119
//LevelState (com.mw.LevelState)
package com.mw {
public class LevelState {
public var state:Array;
public var replay:Replay;
public function LevelState(replay:Replay){
var obj:Restorable;
super();
this.state = new Array();
this.replay = replay;
for each (obj in replay.registered) {
state.push(obj.getState());
};
}
public function restoreState():void{
var i:int;
i = 0;
while (i < replay.registered.length) {
(replay.registered[i] as Restorable).setState(state[i]);
i++;
};
}
public function toXML():XML{
var array:Array;
var child:XML;
var variable:Object;
var xml:XML = <state>
</state>
;
for each (array in state) {
child = <object>
</object>
;
for each (variable in array) {
child.appendChild(new XML(variable));
};
xml.appendChild(child);
};
return (xml);
}
}
}//package com.mw
Section 120
//Overworld (com.mw.Overworld)
package com.mw {
import com.mw.inhabitants.*;
import org.flixel.*;
public class Overworld extends Level {
private var OverworldXml:Class;
public function Overworld():void{
OverworldXml = Overworld_OverworldXml;
super(OverworldXml, "Overworld", true);
}
public function findLevelDoor(levelName:String):Door{
var world:World;
var inhabitant:Inhabitant;
for each (world in worlds.members) {
for each (inhabitant in world.inhabitants.members) {
if ((((((inhabitant is Door)) && (((inhabitant as Door).props.type == "level")))) && (((inhabitant as Door).props.level == levelName)))){
return ((inhabitant as Door));
};
};
};
return (null);
}
}
}//package com.mw
Section 121
//Overworld_OverworldXml (com.mw.Overworld_OverworldXml)
package com.mw {
import mx.core.*;
public class Overworld_OverworldXml extends ByteArrayAsset {
}
}//package com.mw
Section 122
//Pause (com.mw.Pause)
package com.mw {
import org.flixel.*;
import org.flixel.data.*;
public class Pause extends FlxGroup {
private var PauseScreen:Class;
public function Pause():void{
var pause:FlxPause;
PauseScreen = Pause_PauseScreen;
super();
add(new FlxSprite(0, 0, PauseScreen));
pause = new FlxPause();
pause.y = (pause.y - 200);
add(pause);
}
}
}//package com.mw
Section 123
//Pause_PauseScreen (com.mw.Pause_PauseScreen)
package com.mw {
import mx.core.*;
public class Pause_PauseScreen extends BitmapAsset {
}
}//package com.mw
Section 124
//Prompt (com.mw.Prompt)
package com.mw {
import flash.events.*;
import org.flixel.*;
public class Prompt extends FlxGroup {
private const BUTTON_TEXT_SIZE:uint = 12;
private const MESSAGE_SIZE:uint = 24;
private var ButtonBg:Class;
private var ButtonHoverBg:Class;
public function Prompt(message:String){
var message = message;
ButtonBg = Prompt_ButtonBg;
ButtonHoverBg = Prompt_ButtonHoverBg;
super();
var tintBg:FlxSprite = new FlxSprite(0, 0);
tintBg.createGraphic(FlxG.width, FlxG.height, 2566914048);
add(tintBg);
var text:FlxText = new FlxText(0, ((FlxG.height / 2) - 150), FlxG.width, message);
text.setFormat(Game.FONT_NAME, MESSAGE_SIZE, 4294967295, "center");
add(text);
var cancelBtn:FlxButton = new FlxButton(((FlxG.width / 2) - 80), ((text.y + text.height) + 20), function ():void{
FlxG.state.dispatchEvent(new Event("cancel"));
});
var cancelBg:FlxSprite = new FlxSprite(0, 0, ButtonBg);
var cancelHoverBg:FlxSprite = new FlxSprite(0, 0, ButtonHoverBg);
cancelBtn.loadGraphic(cancelBg, cancelHoverBg);
var cancelTxt:FlxText = new FlxText(0, ((cancelBtn.height / 2) - 8), cancelBtn.width, "Cancel");
cancelTxt.setFormat(Game.FONT_NAME, BUTTON_TEXT_SIZE, 4278190080, "center");
cancelBtn.loadText(cancelTxt);
add(cancelBtn);
var confirmBtn:FlxButton = new FlxButton(((FlxG.width / 2) + 5), ((text.y + text.height) + 20), function ():void{
FlxG.state.dispatchEvent(new Event("confirm"));
});
var confirmBg:FlxSprite = new FlxSprite(0, 0, ButtonBg);
var confirmHoverBg:FlxSprite = new FlxSprite(0, 0, ButtonHoverBg);
confirmBtn.loadGraphic(confirmBg, confirmHoverBg);
var confirmTxt:FlxText = new FlxText(0, ((confirmBtn.height / 2) - 8), confirmBtn.width, "OK");
confirmTxt.setFormat(Game.FONT_NAME, BUTTON_TEXT_SIZE, 4278190080, "center");
confirmBtn.loadText(confirmTxt);
add(confirmBtn);
}
}
}//package com.mw
Section 125
//Prompt_ButtonBg (com.mw.Prompt_ButtonBg)
package com.mw {
import mx.core.*;
public class Prompt_ButtonBg extends BitmapAsset {
}
}//package com.mw
Section 126
//Prompt_ButtonHoverBg (com.mw.Prompt_ButtonHoverBg)
package com.mw {
import mx.core.*;
public class Prompt_ButtonHoverBg extends BitmapAsset {
}
}//package com.mw
Section 127
//Replay (com.mw.Replay)
package com.mw {
import org.flixel.*;
public class Replay extends FlxSprite {
public var registered:Array;
private var history:Array;
public var used:uint;
public function Replay(){
super();
solid = false;
used = 0;
x = 200;
y = 50;
moves = false;
origin.x = -50;
registered = new Array();
history = new Array();
createGraphic(300, 15, 2281701376);
}
public function popState():void{
var hist:LevelState = history.pop();
used++;
if (hist){
hist.restoreState();
};
}
public function register(r:Restorable):void{
registered.push(r);
}
public function pushState():void{
history.push(new LevelState(this));
if (history.length > 500){
history.shift();
};
}
override public function update():void{
createGraphic(Math.floor((((history.length / 500) * 300) + 1)), 15, 2281701376);
}
}
}//package com.mw
Section 128
//Restorable (com.mw.Restorable)
package com.mw {
public interface Restorable {
function getState():Array;
function setState(C:\Users\Windows User\Documents\HelloWorlds\src;com\mw;Restorable.as:Array):void;
}
}//package com.mw
Section 129
//RewindBubble (com.mw.RewindBubble)
package com.mw {
import org.flixel.*;
public class RewindBubble extends FlxSprite {
private var rewind_bubble:Class;
public function RewindBubble(){
rewind_bubble = RewindBubble_rewind_bubble;
super();
x = ((700 / 2) - 145);
y = ((550 / 2) - 62);
fixed = true;
solid = false;
loadGraphic(rewind_bubble);
}
override public function update():void{
visible = !((FlxG.state as Game).level.character.alive);
super.update();
}
}
}//package com.mw
Section 130
//RewindBubble_rewind_bubble (com.mw.RewindBubble_rewind_bubble)
package com.mw {
import mx.core.*;
public class RewindBubble_rewind_bubble extends BitmapAsset {
}
}//package com.mw
Section 131
//VictoryWorld (com.mw.VictoryWorld)
package com.mw {
import net.pixelpracht.tmx.*;
import com.mw.inhabitants.*;
import org.flixel.*;
public class VictoryWorld extends World {
private const SIZE:int = 24;
private const CHARACTER_OFFSET:int = 10;
private const TEXT_SPACING:int = 30;
private const WIDTH:int = 460;
private const SHADOW:int = 0;
private const VICTORY_COMBO_OFFSET:FlxPoint;
private const STATIC_TEXT_COLOR:uint = 4278190080;
private const NUMBER_OFFSET:int = 300;
private const POINT_TEXT_COLOR:uint = 4281545727;
private const TEXT_OFFSET:int = 45;
private var bestScore:int;// = 0
private var pointsCounter:int;// = 0
private var timeText:FlxText;
private var totalCoins:int;// = 0
private var statsGroup:FlxGroup;
private var bestScoreCount:FlxText;
private var coinCounter:int;// = 0
private var starsText:FlxText;
private var pointsText:FlxText;
private var collectedCoins:int;// = 0
public var charX:Number;// = 0
public var charY:Number;// = 0
private var totalPoints:int;// = 0
private var timeCount:FlxText;
private var obtainedText:FlxText;
private var bestScoreText:FlxText;
private var coinText:FlxText;
private var pointsCount:FlxText;
private var timeCounter:int;// = 0
private var timeLeft:int;// = 0
private var coinCount:FlxText;
public function VictoryWorld(tmx:TmxMap, idx:uint, level:Level){
VICTORY_COMBO_OFFSET = new FlxPoint(108, 50);
super(tmx, idx, level, true);
statsGroup = new FlxGroup();
starsText = new FlxText(0, 0, WIDTH, "Star Gained!");
starsText.setFormat(Game.FONT_NAME, SIZE, STATIC_TEXT_COLOR, "left", 0);
starsText.shadow = SHADOW;
starsText.visible = false;
add(starsText);
obtainedText = new FlxText(0, 0, WIDTH, "(Already Obtained)");
obtainedText.setFormat(Game.FONT_NAME, SIZE, POINT_TEXT_COLOR, "left", 0);
obtainedText.shadow = SHADOW;
obtainedText.visible = false;
add(obtainedText);
coinText = new FlxText(0, 0, WIDTH, "Coins Collected(x5): \t");
coinText.setFormat(Game.FONT_NAME, SIZE, STATIC_TEXT_COLOR, "left", 0);
coinText.shadow = SHADOW;
coinText.visible = false;
add(coinText);
statsGroup.add(coinText);
timeText = new FlxText(0, 0, WIDTH, "Seconds Under Par(x3): \t");
timeText.setFormat(Game.FONT_NAME, SIZE, STATIC_TEXT_COLOR, "left", 0);
timeText.shadow = SHADOW;
timeText.visible = false;
add(timeText);
statsGroup.add(timeText);
pointsText = new FlxText(0, 0, WIDTH, "Total Points: \t\t\t");
pointsText.setFormat(Game.FONT_NAME, SIZE, STATIC_TEXT_COLOR, "left", 0);
pointsText.shadow = SHADOW;
pointsText.visible = false;
add(pointsText);
statsGroup.add(pointsText);
bestScoreText = new FlxText(0, 0, WIDTH, "Best Score: \t\t\t");
bestScoreText.setFormat(Game.FONT_NAME, SIZE, STATIC_TEXT_COLOR, "left", 0);
bestScoreText.shadow = SHADOW;
bestScoreText.visible = false;
add(bestScoreText);
statsGroup.add(bestScoreText);
coinCount = new FlxText(0, 0, WIDTH, "0");
coinCount.setFormat(Game.FONT_NAME, SIZE, POINT_TEXT_COLOR, "left", 0);
coinCount.shadow = SHADOW;
coinCount.visible = false;
add(coinCount);
statsGroup.add(coinCount);
timeCount = new FlxText(0, 0, WIDTH, "0");
timeCount.setFormat(Game.FONT_NAME, SIZE, POINT_TEXT_COLOR, "left", 0);
timeCount.shadow = SHADOW;
timeCount.visible = false;
add(timeCount);
statsGroup.add(timeCount);
pointsCount = new FlxText(0, 0, WIDTH, "0");
pointsCount.setFormat(Game.FONT_NAME, SIZE, POINT_TEXT_COLOR, "left", 0);
pointsCount.shadow = SHADOW;
pointsCount.visible = false;
add(pointsCount);
statsGroup.add(pointsCount);
bestScoreCount = new FlxText(0, 0, WIDTH, "0");
bestScoreCount.setFormat(Game.FONT_NAME, SIZE, POINT_TEXT_COLOR, "left", 0);
bestScoreCount.shadow = SHADOW;
bestScoreCount.visible = false;
add(bestScoreCount);
statsGroup.add(bestScoreCount);
starsText.x = TEXT_OFFSET;
starsText.y = TEXT_OFFSET;
obtainedText.y = starsText.y;
coinText.x = (timeText.x = (pointsText.x = (bestScoreText.x = TEXT_OFFSET)));
obtainedText.x = (coinCount.x = (timeCount.x = (pointsCount.x = (bestScoreCount.x = (coinText.x + NUMBER_OFFSET)))));
coinText.y = (starsText.y + TEXT_SPACING);
coinCount.y = coinText.y;
timeText.y = (coinText.y + TEXT_SPACING);
timeCount.y = timeText.y;
pointsText.y = (timeText.y + (2 * TEXT_SPACING));
pointsCount.y = pointsText.y;
bestScoreText.y = (pointsText.y + TEXT_SPACING);
bestScoreCount.y = bestScoreText.y;
}
override public function render():void{
if (coinCounter < collectedCoins){
coinCounter++;
coinCount.text = ((coinCounter.toString() + "/") + totalCoins);
};
if (timeCounter < timeLeft){
timeCounter++;
timeCount.text = timeCounter.toString();
};
if (pointsCounter < totalPoints){
pointsCounter++;
pointsCount.text = pointsCounter.toString();
};
if (pointsCounter > bestScore){
bestScoreCount.text = (pointsCounter.toString() + "!");
} else {
bestScoreCount.text = bestScore.toString();
};
super.render();
}
public function victory(level:Level):void{
var gameAchievements:Object = (FlxG.state as Game).getSave("achievements");
var prevLevelAchievements:Array = gameAchievements[level.name];
var levelAchievements:Array = level.getEndOfLevelAchievements();
timeLeft = (level.parTime - level.getElapsedTime());
if (timeLeft < 0){
timeLeft = 0;
};
totalPoints = level.totalPoints;
collectedCoins = level.collectedCoins;
totalCoins = level.totalCoins;
bestScore = prevLevelAchievements["points"];
var numAchievements:int;
starsText.text = "";
obtainedText.text = "";
if (level.inTimeTrial()){
numAchievements = (numAchievements + 1);
if (((!((prevLevelAchievements["timeTrial"] == null))) && (levelAchievements["timeTrial"]))){
starsText.text = (starsText.text + "Beat Time Trial!\n");
if (prevLevelAchievements["timeTrial"]){
obtainedText.text = (obtainedText.text + "Done\n");
obtainedText.visible = true;
} else {
obtainedText.text = (obtainedText.text + "+1 Star\n");
obtainedText.visible = true;
};
} else {
starsText.text = (starsText.text + "Over Time Trial\n");
obtainedText.text = (obtainedText.text + "Try Again\n");
obtainedText.visible = true;
};
} else {
if (((!((prevLevelAchievements["finish"] == null))) && (levelAchievements["finish"]))){
numAchievements = (numAchievements + 1);
starsText.text = (starsText.text + "Level Completed\n");
if (prevLevelAchievements["finish"]){
obtainedText.text = (obtainedText.text + "Done\n");
obtainedText.visible = true;
} else {
obtainedText.text = (obtainedText.text + "+1 Star\n");
obtainedText.visible = true;
};
};
if (((!((prevLevelAchievements["coins"] == null))) && (levelAchievements["coins"]))){
numAchievements = (numAchievements + 1);
starsText.text = (starsText.text + "Collected All Coins\n");
if (prevLevelAchievements["coins"]){
obtainedText.text = (obtainedText.text + "Done\n");
obtainedText.visible = true;
} else {
obtainedText.text = (obtainedText.text + "+1 Star\n");
obtainedText.visible = true;
};
};
if (((!((prevLevelAchievements["parTime"] == null))) && (levelAchievements["parTime"]))){
numAchievements = (numAchievements + 1);
starsText.text = (starsText.text + "Under Par Time\n");
if (prevLevelAchievements["parTime"]){
obtainedText.text = (obtainedText.text + "Done\n");
obtainedText.visible = true;
} else {
obtainedText.text = (obtainedText.text + "+1 Star\n");
obtainedText.visible = true;
};
};
if (((!((prevLevelAchievements["special"] == null))) && (levelAchievements["special"]))){
numAchievements = (numAchievements + 1);
starsText.text = (starsText.text + "Found Special Star\n");
if (prevLevelAchievements["special"]){
obtainedText.text = (obtainedText.text + "Done\n");
obtainedText.visible = true;
} else {
obtainedText.text = (obtainedText.text + "+1 Star\n");
obtainedText.visible = true;
};
};
};
statsGroup.y = (statsGroup.y + (numAchievements * TEXT_SPACING));
statsGroup.update();
starsText.visible = true;
coinText.visible = true;
coinCount.visible = true;
timeText.visible = true;
timeCount.visible = true;
pointsText.visible = true;
pointsCount.visible = true;
bestScoreText.visible = true;
bestScoreCount.visible = true;
}
override protected function spawnObject(obj:TmxObject, tmx:TmxMap):void{
if (obj.type == "door"){
charX = obj.x;
charY = (obj.y - CHARACTER_OFFSET);
};
super.spawnObject(obj, tmx);
}
override public function open():void{
super.open();
level.character.x = charX;
level.character.y = charY;
}
override protected function getTargetOffset():FlxPoint{
return (VICTORY_COMBO_OFFSET);
}
}
}//package com.mw
Section 132
//World (com.mw.World)
package com.mw {
import net.pixelpracht.tmx.*;
import com.mw.inhabitants.*;
import org.flixel.*;
import caurina.transitions.*;
public class World extends FlxGroup implements Restorable {
private const ALL_COMBO_OFFSET:FlxPoint;
private const COMBO_SPEED:FlxPoint;
private const TALL_COMBO_OFFSET:FlxPoint;
private const NORMAL_COMBO_OFFSET:FlxPoint;
private const WIDE_COMBO_OFFSET:FlxPoint;
private const BORDER_COLOR:Number = 4278190080;
private const NORMAL_TALL_COMBO_OFFSET:FlxPoint;
public var size:String;// = "normal"
public var level:Level;
public var offset:FlxPoint;
private var icons:Icons;
public var id:uint;
private var ImgTiles:Class;
private var leftBorder:FlxSprite;
private var bottomBorder:FlxSprite;
private var comboOffset:FlxPoint;
public var doCombo:Boolean;
private var requiredStarsText:FlxText;
private var nameText:FlxText;
public var inhabitants:FlxGroup;
private var topBorder:FlxSprite;
public var map:FlxTilemap;
private var rightBorder:FlxSprite;
private var tint:FlxSprite;
public function World(tmx:TmxMap, idx:uint, lvl:Level, victory:Boolean=false){
var layer:TmxLayer;
var object:TmxObject;
ImgTiles = World_ImgTiles;
NORMAL_COMBO_OFFSET = new FlxPoint(172, 124);
WIDE_COMBO_OFFSET = new FlxPoint(4, 124);
TALL_COMBO_OFFSET = new FlxPoint(172, 4);
NORMAL_TALL_COMBO_OFFSET = new FlxPoint(172, 206);
ALL_COMBO_OFFSET = new FlxPoint(4, 4);
COMBO_SPEED = new FlxPoint(7, 4);
super();
id = idx;
level = lvl;
level.history.register(this);
doCombo = false;
layer = tmx.getLayer(("Layer " + idx));
var mapCsv:String = layer.toCsv(tmx.getTileSet("tiles"));
map = new FlxTilemap();
map.loadMap(mapCsv, ImgTiles, 8, 8);
map.collideIndex = 1;
add(map);
if (layer.properties.size){
size = layer.properties.size;
};
tint = new FlxSprite(0, 0);
tint.solid = false;
if ((((level.name == "Overworld")) || ((size == "all")))){
tint.createGraphic(696, 496, 570425344);
} else {
if (victory){
tint.createGraphic(480, 400, 570425344);
} else {
if (size == "tall"){
tint.createGraphic(344, 496, 570425344);
} else {
if (size == "wide"){
tint.createGraphic(696, 248, 570425344);
} else {
tint.createGraphic(344, 248, 570425344);
};
};
};
};
add(tint);
inhabitants = new FlxGroup();
var tmxObjects:TmxObjectGroup = tmx.getObjectGroup(("Objects " + idx));
if (tmxObjects){
for each (object in tmxObjects.objects) {
spawnObject(object, tmx);
};
};
add(inhabitants);
nameText = new FlxText(map.x, ((map.y + (map.height / 2)) - 36), map.width, "Level Name Placeholder");
nameText.setFormat(Game.FONT_NAME, 36, 4278190080, "center");
nameText.visible = false;
add(nameText);
requiredStarsText = new FlxText(map.x, ((map.y + (map.height / 2)) + 10), map.width, "Required Stars: XX");
requiredStarsText.setFormat(Game.FONT_NAME, 14, 4278190080, "center");
requiredStarsText.visible = false;
add(requiredStarsText);
icons = new Icons(((map.x + (map.width / 2)) - 60), ((map.y + (map.height / 2)) + 20), map.width, level.name);
icons.visible = false;
add(icons);
offset = new FlxPoint(0, 0);
comboOffset = new FlxPoint(0, 0);
topBorder = new FlxSprite(0, 0);
topBorder.createGraphic(map.width, 4, BORDER_COLOR);
topBorder.fixed = true;
topBorder.visible = false;
add(topBorder);
bottomBorder = new FlxSprite(0, map.height);
bottomBorder.createGraphic(map.width, 4, BORDER_COLOR);
bottomBorder.fixed = true;
bottomBorder.visible = false;
add(bottomBorder);
leftBorder = new FlxSprite(-4, -4);
leftBorder.createGraphic(4, (map.height + 8), BORDER_COLOR);
leftBorder.fixed = true;
leftBorder.visible = false;
add(leftBorder);
rightBorder = new FlxSprite(map.width, -4);
rightBorder.createGraphic(4, (map.height + 8), BORDER_COLOR);
rightBorder.fixed = true;
rightBorder.visible = false;
add(rightBorder);
close();
if (layer.properties.active == "true"){
open();
};
}
override public function render():void{
var member:*;
var currentOffset:FlxPoint = getCurrentOffset();
for each (member in members) {
member.x = (member.x + currentOffset.x);
member.y = (member.y + currentOffset.y);
};
icons.updateIconsPositions();
super.render();
for each (member in members) {
member.x = (member.x - currentOffset.x);
member.y = (member.y - currentOffset.y);
};
}
protected function spawnObject(obj:TmxObject, tmx:TmxMap):void{
switch (obj.type){
case "trampoline":
inhabitants.add(new Trampoline(obj, this));
break;
case "spikes":
inhabitants.add(new Spikes(obj, this));
break;
case "door":
if (((Game.BETA) || (!((obj.custom.type == "next"))))){
inhabitants.add(new Door(obj, this));
};
break;
case "ladder":
inhabitants.add(new Ladder(obj, this));
break;
case "coin":
inhabitants.add(new Coin(obj, this));
break;
case "mover":
inhabitants.add(new Mover(obj, this, tmx));
break;
case "switch":
inhabitants.add(new Switch(obj, this));
break;
case "oneway":
inhabitants.add(new OneWayPlatform(obj, this));
break;
case "hint":
inhabitants.add(new Hint(obj, this));
break;
case "crumblingPlatform":
inhabitants.add(new CrumblingPlatform(obj, this));
break;
case "bridge":
inhabitants.add(new Bridge(obj, this));
break;
case "cannon":
inhabitants.add(new Cannon(obj, this));
break;
case "timeTrialStarter":
if (Game.BETA){
inhabitants.add(new TimeTrialStarter(obj, this));
};
break;
};
}
public function showStarsRequired(requiredStars:uint):void{
requiredStarsText.text = ("Required Stars: " + requiredStars);
var numStars:uint = (FlxG.state as Game).getSave("numStars");
requiredStarsText.color = ((numStars)>=requiredStars) ? 4278190080 : 4294901760;
requiredStarsText.visible = true;
}
public function showName(name:String):void{
nameText.text = name;
nameText.visible = true;
}
private function floatToCenter():void{
level.record = false;
var currentOffset:FlxPoint = getCurrentOffset();
var targetOffset:FlxPoint = getTargetOffset();
var xError:int = (currentOffset.x - targetOffset.x);
var xSpeed:uint = ((Math.abs(xError))>COMBO_SPEED.x) ? COMBO_SPEED.x : 1;
if (xError > 0){
comboOffset.x = (comboOffset.x - xSpeed);
} else {
if (xError < 0){
comboOffset.x = (comboOffset.x + xSpeed);
};
};
var yError:int = (currentOffset.y - targetOffset.y);
var ySpeed:uint = ((Math.abs(yError))>COMBO_SPEED.y) ? COMBO_SPEED.y : 1;
if (yError > 0){
comboOffset.y = (comboOffset.y - ySpeed);
} else {
if (yError < 0){
comboOffset.y = (comboOffset.y + ySpeed);
};
};
}
public function getCurrentOffset():FlxPoint{
return (new FlxPoint((offset.x + comboOffset.x), (offset.y + comboOffset.y)));
}
public function showDoorCost(cost:uint):void{
requiredStarsText.text = ("Coins required: " + cost);
requiredStarsText.color = ((level.collectedCoins)>=cost) ? 4278190080 : 4294901760;
requiredStarsText.visible = true;
}
public function showAchievements(levelName:String):void{
this.icons.setLevelName(levelName);
icons.visible = true;
}
override public function update():void{
if (((FlxG.keys.pressed("C")) || (doCombo))){
floatToCenter();
doCombo = false;
} else {
floatToHome();
};
nameText.visible = (requiredStarsText.visible = (icons.visible = false));
super.update();
}
public function open():void{
var inhabitant:Inhabitant;
visible = (map.solid = (topBorder.solid = (bottomBorder.solid = (leftBorder.solid = (rightBorder.solid = true)))));
for each (inhabitant in inhabitants.members) {
inhabitant.solid = true;
};
}
public function isAnimating():Boolean{
return (((((Tweener.isTweening(offset)) || (!((comboOffset.x == 0))))) || (!((comboOffset.y == 0)))));
}
public function isActive():Boolean{
return (map.solid);
}
public function setState(state:Array):void{
if (state[0]){
open();
} else {
close();
};
}
public function getState():Array{
return (new Array(isActive()));
}
public function close():void{
var inhabitant:Inhabitant;
visible = (map.solid = (topBorder.solid = (bottomBorder.solid = (leftBorder.solid = (rightBorder.solid = false)))));
for each (inhabitant in inhabitants.members) {
inhabitant.solid = false;
};
}
protected function getTargetOffset():FlxPoint{
var world:World;
var activeWorlds:Array = level.getActiveWorlds();
var size:String = "normal";
for each (world in activeWorlds) {
if ((((((world.size == "tall")) || ((world.size == "wide")))) || ((world.size == "all")))){
size = world.size;
};
};
if (size == "wide"){
return (WIDE_COMBO_OFFSET);
};
if (size == "tall"){
if (this.size == "tall"){
return (TALL_COMBO_OFFSET);
};
return (NORMAL_TALL_COMBO_OFFSET);
//unresolved jump
};
if (size == "all"){
return (ALL_COMBO_OFFSET);
};
return (NORMAL_COMBO_OFFSET);
}
private function floatToHome():void{
level.record = true;
var currentOffset:FlxPoint = getCurrentOffset();
var targetOffset:FlxPoint = offset;
var xError:int = (currentOffset.x - targetOffset.x);
var xSpeed:uint = ((Math.abs(xError))>COMBO_SPEED.x) ? COMBO_SPEED.x : 1;
if (xError > 0){
comboOffset.x = (comboOffset.x - xSpeed);
} else {
if (xError < 0){
comboOffset.x = (comboOffset.x + xSpeed);
};
};
var yError:int = (currentOffset.y - targetOffset.y);
var ySpeed:uint = ((Math.abs(yError))>COMBO_SPEED.y) ? COMBO_SPEED.y : 1;
if (yError > 0){
comboOffset.y = (comboOffset.y - ySpeed);
} else {
if (yError < 0){
comboOffset.y = (comboOffset.y + ySpeed);
};
};
}
}
}//package com.mw
Section 133
//World_ImgTiles (com.mw.World_ImgTiles)
package com.mw {
import mx.core.*;
public class World_ImgTiles extends BitmapAsset {
}
}//package com.mw
Section 134
//CapstoneEvent (FGReplay.CapstoneEvent)
package FGReplay {
import flash.events.*;
import flash.net.*;
public class CapstoneEvent {
public var data:String;
public var time:Number;
private var m_urlLoader:URLLoader;
private var m_urlRequest:URLRequest;
public var type:String;
public function CapstoneEvent():void{
super();
}
public function sendToServer(lid:uint, _url:String):void{
var lid = lid;
var _url = _url;
if (_url == null){
trace("passed in url cannot be null.");
};
var url:String = ((((((((((((_url + "?") + "lid=") + lid) + "&") + "type=") + escape(type)) + "&") + "data=") + escape(data)) + "&") + "time=") + time);
trace(("Sending to server: " + url));
m_urlRequest = new URLRequest(url);
m_urlRequest.method = URLRequestMethod.GET;
m_urlLoader = new URLLoader();
m_urlLoader.load(m_urlRequest);
m_urlLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, function (e:HTTPStatusEvent):void{
if (e.status != 200){
trace(("Unable to store event to server: " + e.status));
};
});
m_urlLoader.addEventListener(Event.COMPLETE, function (e:Event):void{
});
m_urlLoader.addEventListener(IOErrorEvent.IO_ERROR, function (e:IOErrorEvent):void{
trace(e.text);
});
}
public function toString():String{
return (((((type + "|") + data) + "|") + time.toString()));
}
public static function fromString(s:String):CapstoneEvent{
if (s == null){
trace("Attempting to populate CapstoneEvent with null string.");
return (null);
};
var a:Array = s.split("|");
if (a.length != 3){
trace("Attempting to populate CapstoneEvent with malformed string.");
return (null);
};
var d:CapstoneEvent = new (CapstoneEvent);
d.type = a[0];
d.data = a[1];
d.time = a[2];
return (d);
}
}
}//package FGReplay
Section 135
//CapstoneReplay (FGReplay.CapstoneReplay)
package FGReplay {
import flash.events.*;
import flash.utils.*;
import com.mw.*;
import org.flixel.*;
import flash.net.*;
public class CapstoneReplay {
protected var m_startTime:int;
protected var m_map:Object;
protected var m_urlLoader:URLLoader;
protected var m_buffer:Array;
protected var m_bufferTimer:Timer;
protected var m_urlRequest:URLRequest;
protected var m_lid:uint;
protected var m_bufferInterval:int;
protected var m_lock:Boolean;// = false
public static const MIN_BUFFER_INTERVAL:uint = 2000;
public static const MAX_BUFFER_INTERVAL:Number = 60000;
public function CapstoneReplay(lid:uint, time:uint):void{
m_buffer = new Array();
super();
m_startTime = (new Date().time - time);
m_lid = lid;
m_bufferInterval = MIN_BUFFER_INTERVAL;
resetTimer();
}
private function sendResultBad():void{
trace(("Increasing interval: " + m_bufferInterval));
m_bufferInterval = (2 * m_bufferInterval);
m_bufferInterval = Math.max(m_bufferInterval, MIN_BUFFER_INTERVAL);
if (m_bufferInterval > MAX_BUFFER_INTERVAL){
m_lock = true;
};
resetTimer();
}
public function sendEvents(e:Event=null):void{
var t:Timer;
var ce:CapstoneEvent;
var e = e;
m_bufferTimer = null;
if (m_lock){
m_buffer = new Array();
return;
};
if (m_buffer.length == 0){
resetTimer();
return;
};
var _url = "http://foldit-web01.cs.washington.edu/comm/real_capstone_event";
var url = ((((_url + "?") + "numEvents=") + m_buffer.length) + "&");
var i:uint;
while (i < m_buffer.length) {
ce = (m_buffer[i] as CapstoneEvent);
url = (url + (((((((((((((((((("lid" + i) + "=") + m_lid) + "&") + "type") + i) + "=") + escape(ce.type)) + "&") + "data") + i) + "=") + escape(ce.data)) + "&") + "time") + i) + "=") + ce.time));
if (i < (m_buffer.length - 1)){
url = (url + "&");
};
i = (i + 1);
};
trace(("Sending to server: " + url));
m_urlRequest = new URLRequest(url);
m_urlRequest.method = URLRequestMethod.GET;
m_urlLoader = new URLLoader();
t = new Timer(20000, 1);
with ({}) {
with ({}) {
!ERROR!.f = function (e:TimerEvent):void{
t.removeEventListener(TimerEvent.TIMER_COMPLETE, f);
sendResultBad();
};
};
t.addEventListener(TimerEvent.TIMER_COMPLETE, function (e:TimerEvent):void{
t.removeEventListener(TimerEvent.TIMER_COMPLETE, f);
sendResultBad();
});
t.start();
m_buffer = new Array();
m_urlLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, function (e:HTTPStatusEvent):void{
if (((!((e.status == 200))) && (!((e.status == 0))))){
trace(("Unable to store event to server: " + e.status));
} else {
t.stop();
sendResultGood();
};
});
m_urlLoader.addEventListener(Event.COMPLETE, function (e:Event):void{
});
m_urlLoader.addEventListener(IOErrorEvent.IO_ERROR, function (e:IOErrorEvent):void{
sendResultBad();
trace(e.text);
});
m_urlLoader.load(m_urlRequest);
}
public function getTime():uint{
return ((new Date().time - m_startTime));
}
private function resetTimer():void{
if (m_bufferTimer == null){
m_bufferTimer = new Timer(m_bufferInterval, 1);
m_bufferTimer.start();
m_bufferTimer.addEventListener(TimerEvent.TIMER, sendEvents);
};
}
private function sendResultGood():void{
trace("success");
m_bufferInterval = (m_bufferInterval - 10000);
m_bufferInterval = Math.max(m_bufferInterval, MIN_BUFFER_INTERVAL);
resetTimer();
}
public function restartTimer():void{
m_startTime = new Date().time;
}
public function addEvent(type:String, data:String=""):void{
trace(("add event. size: " + m_buffer.length));
if (data == null){
trace("Data passed into addEvent should not be null.");
};
var ce:CapstoneEvent = new CapstoneEvent();
ce.type = type;
ce.data = data;
ce.time = (new Date().time - m_startTime);
m_buffer.push(ce);
resetTimer();
(FlxG.state as Game).setSave("playtime", getTime());
}
public static function loadLevels(game:String, callback:Function):void{
var parseResponse:Function;
var m_urlRequest:URLRequest;
var m_urlLoader:URLLoader;
var game = game;
var callback = callback;
parseResponse = function (e:Event):void{
var s:String;
var urlLoader:URLLoader = (e.target as URLLoader);
var data:String = urlLoader.data;
var splitData:Array = data.split("\n");
var gameData:Array = new Array();
var i:int;
while (i < splitData.length) {
s = (splitData[i] as String);
if (s.length != 0){
gameData.push(GameLevel.fromString(s));
};
i++;
};
callback(gameData);
};
var url:String = ("http://foldit-web01.cs.washington.edu/comm/capstone_replay?type=levels&game=" + game);
m_urlRequest = new URLRequest(url);
m_urlRequest.method = URLRequestMethod.GET;
m_urlLoader = new URLLoader();
m_urlLoader.addEventListener(Event.COMPLETE, parseResponse);
m_urlLoader.load(m_urlRequest);
}
public static function loadEvents(lid:uint, callback:Function):void{
var parseResponse:Function;
var m_urlRequest:URLRequest;
var m_urlLoader:URLLoader;
var lid = lid;
var callback = callback;
parseResponse = function (e:Event):void{
var s:String;
var urlLoader:URLLoader = (e.target as URLLoader);
var data:String = urlLoader.data;
var splitData:Array = data.split("\n");
var eventData:Array = new Array();
var i:int;
while (i < splitData.length) {
s = (splitData[i] as String);
if (s.length != 0){
eventData.push(CapstoneEvent.fromString(s));
};
i++;
};
callback(eventData);
};
var url:String = ("http://foldit-web01.cs.washington.edu/comm/capstone_replay?type=events&lid=" + lid);
m_urlRequest = new URLRequest(url);
m_urlRequest.method = URLRequestMethod.GET;
m_urlLoader = new URLLoader();
m_urlLoader.addEventListener(Event.COMPLETE, parseResponse);
m_urlLoader.load(m_urlRequest);
}
}
}//package FGReplay
Section 136
//GameLevel (FGReplay.GameLevel)
package FGReplay {
import flash.events.*;
import flash.net.*;
public class GameLevel {
public var lid:uint;
public var parameters:String;
private var m_urlLoader:URLLoader;
public var game:String;
private var m_urlRequest:URLRequest;
public function GameLevel(_lid:uint, _game:String, _params:String){
super();
if (_params.indexOf("|") != -1){
trace("Params should not have the | character.");
};
lid = _lid;
game = _game;
parameters = _params;
}
public function reportGame():void{
var url:String = (((((((("http://foldit-web01.cs.washington.edu/comm/real_capstone_level?" + "lid=") + lid) + "&") + "game=") + game) + "&") + "parameters=") + parameters);
trace(("Reporting game level: " + url));
m_urlRequest = new URLRequest(url);
m_urlRequest.method = URLRequestMethod.GET;
m_urlLoader = new URLLoader();
m_urlLoader.load(m_urlRequest);
m_urlLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, function (e:HTTPStatusEvent):void{
if (((!((e.status == 200))) && (!((e.status == 0))))){
trace(("Unable to store game to server: " + e.status));
};
});
m_urlLoader.addEventListener(Event.COMPLETE, function (e:Event):void{
});
m_urlLoader.addEventListener(IOErrorEvent.IO_ERROR, function (e:IOErrorEvent):void{
trace(e.text);
});
}
public function toString():String{
return (((((lid + "|") + game) + "|") + parameters));
}
public static function fromString(s:String):GameLevel{
var data:Array = s.split("|");
if (data.length != 3){
trace(("Incorrect amount of data when creating GameLevel from string: " + s));
};
return (new GameLevel(uint(data[0]), data[1], data[2]));
}
}
}//package FGReplay
Section 137
//BitmapAsset (mx.core.BitmapAsset)
package mx.core {
import flash.display.*;
public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject {
mx_internal static const VERSION:String = "3.5.0.12683";
public function BitmapAsset(bitmapData:BitmapData=null, pixelSnapping:String="auto", smoothing:Boolean=false){
super(bitmapData, pixelSnapping, smoothing);
}
public function get measuredWidth():Number{
if (bitmapData){
return (bitmapData.width);
};
return (0);
}
public function get measuredHeight():Number{
if (bitmapData){
return (bitmapData.height);
};
return (0);
}
public function setActualSize(newWidth:Number, newHeight:Number):void{
width = newWidth;
height = newHeight;
}
public function move(x:Number, y:Number):void{
this.x = x;
this.y = y;
}
}
}//package mx.core
Section 138
//ByteArrayAsset (mx.core.ByteArrayAsset)
package mx.core {
import flash.utils.*;
public class ByteArrayAsset extends ByteArray implements IFlexAsset {
mx_internal static const VERSION:String = "3.5.0.12683";
public function ByteArrayAsset(){
super();
}
}
}//package mx.core
Section 139
//EdgeMetrics (mx.core.EdgeMetrics)
package mx.core {
public class EdgeMetrics {
public var top:Number;
public var left:Number;
public var bottom:Number;
public var right:Number;
mx_internal static const VERSION:String = "3.5.0.12683";
public static const EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
;
public function EdgeMetrics(left:Number=0, top:Number=0, right:Number=0, bottom:Number=0){
super();
this.left = left;
this.top = top;
this.right = right;
this.bottom = bottom;
}
public function clone():EdgeMetrics{
return (new EdgeMetrics(left, top, right, bottom));
}
}
}//package mx.core
Section 140
//FlexBitmap (mx.core.FlexBitmap)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexBitmap extends Bitmap {
mx_internal static const VERSION:String = "3.5.0.12683";
public function FlexBitmap(bitmapData:BitmapData=null, pixelSnapping:String="auto", smoothing:Boolean=false){
var bitmapData = bitmapData;
var pixelSnapping = pixelSnapping;
var smoothing = smoothing;
super(bitmapData, pixelSnapping, smoothing);
name = NameUtil.createUniqueName(this);
//unresolved jump
var _slot1 = e;
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 141
//FlexLoader (mx.core.FlexLoader)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexLoader extends Loader {
mx_internal static const VERSION:String = "3.5.0.12683";
public function FlexLoader(){
super();
name = NameUtil.createUniqueName(this);
//unresolved jump
var _slot1 = e;
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 142
//FlexShape (mx.core.FlexShape)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexShape extends Shape {
mx_internal static const VERSION:String = "3.5.0.12683";
public function FlexShape(){
super();
name = NameUtil.createUniqueName(this);
//unresolved jump
var _slot1 = e;
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 143
//FlexVersion (mx.core.FlexVersion)
package mx.core {
import mx.resources.*;
public class FlexVersion {
public static const VERSION_2_0_1:uint = 33554433;
public static const CURRENT_VERSION:uint = 50331648;
public static const VERSION_3_0:uint = 50331648;
public static const VERSION_2_0:uint = 33554432;
public static const VERSION_ALREADY_READ:String = "versionAlreadyRead";
public static const VERSION_ALREADY_SET:String = "versionAlreadySet";
mx_internal static const VERSION:String = "3.5.0.12683";
private static var compatibilityVersionChanged:Boolean = false;
private static var _compatibilityErrorFunction:Function;
private static var _compatibilityVersion:uint = 50331648;
private static var compatibilityVersionRead:Boolean = false;
public function FlexVersion(){
super();
}
mx_internal static function changeCompatibilityVersionString(value:String):void{
var pieces:Array = value.split(".");
var major:uint = parseInt(pieces[0]);
var minor:uint = parseInt(pieces[1]);
var update:uint = parseInt(pieces[2]);
_compatibilityVersion = (((major << 24) + (minor << 16)) + update);
}
public static function set compatibilityVersion(value:uint):void{
var s:String;
if (value == _compatibilityVersion){
return;
};
if (compatibilityVersionChanged){
if (compatibilityErrorFunction == null){
s = ResourceManager.getInstance().getString("core", VERSION_ALREADY_SET);
throw (new Error(s));
};
compatibilityErrorFunction(value, VERSION_ALREADY_SET);
};
if (compatibilityVersionRead){
if (compatibilityErrorFunction == null){
s = ResourceManager.getInstance().getString("core", VERSION_ALREADY_READ);
throw (new Error(s));
};
compatibilityErrorFunction(value, VERSION_ALREADY_READ);
};
_compatibilityVersion = value;
compatibilityVersionChanged = true;
}
public static function get compatibilityVersion():uint{
compatibilityVersionRead = true;
return (_compatibilityVersion);
}
public static function set compatibilityErrorFunction(value:Function):void{
_compatibilityErrorFunction = value;
}
public static function set compatibilityVersionString(value:String):void{
var pieces:Array = value.split(".");
var major:uint = parseInt(pieces[0]);
var minor:uint = parseInt(pieces[1]);
var update:uint = parseInt(pieces[2]);
compatibilityVersion = (((major << 24) + (minor << 16)) + update);
}
public static function get compatibilityErrorFunction():Function{
return (_compatibilityErrorFunction);
}
public static function get compatibilityVersionString():String{
var major:uint = ((compatibilityVersion >> 24) & 0xFF);
var minor:uint = ((compatibilityVersion >> 16) & 0xFF);
var update:uint = (compatibilityVersion & 0xFFFF);
return (((((major.toString() + ".") + minor.toString()) + ".") + update.toString()));
}
}
}//package mx.core
Section 144
//FontAsset (mx.core.FontAsset)
package mx.core {
import flash.text.*;
public class FontAsset extends Font implements IFlexAsset {
mx_internal static const VERSION:String = "3.5.0.12683";
public function FontAsset(){
super();
}
}
}//package mx.core
Section 145
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 146
//IButton (mx.core.IButton)
package mx.core {
public interface IButton extends IUIComponent {
function get emphasized():Boolean;
function set emphasized(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IButton.as:Boolean):void;
function callLater(_arg1:Function, _arg2:Array=null):void;
}
}//package mx.core
Section 147
//IChildList (mx.core.IChildList)
package mx.core {
import flash.display.*;
import flash.geom.*;
public interface IChildList {
function get numChildren():int;
function removeChild(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IChildList.as:DisplayObject):DisplayObject;
function getChildByName(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IChildList.as:String):DisplayObject;
function removeChildAt(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IChildList.as:int):DisplayObject;
function getChildIndex(:DisplayObject):int;
function addChildAt(_arg1:DisplayObject, _arg2:int):DisplayObject;
function getObjectsUnderPoint(child:Point):Array;
function setChildIndex(_arg1:DisplayObject, _arg2:int):void;
function getChildAt(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IChildList.as:int):DisplayObject;
function addChild(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IChildList.as:DisplayObject):DisplayObject;
function contains(flash.display:DisplayObject):Boolean;
}
}//package mx.core
Section 148
//IContainer (mx.core.IContainer)
package mx.core {
import flash.display.*;
import flash.geom.*;
import mx.managers.*;
import flash.media.*;
import flash.text.*;
public interface IContainer extends IUIComponent {
function set hitArea(mx.core:IContainer/mx.core:IContainer:graphics/get:Sprite):void;
function swapChildrenAt(_arg1:int, _arg2:int):void;
function getChildByName(Graphics:String):DisplayObject;
function get doubleClickEnabled():Boolean;
function get graphics():Graphics;
function get useHandCursor():Boolean;
function addChildAt(_arg1:DisplayObject, _arg2:int):DisplayObject;
function set mouseChildren(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function set creatingContentPane(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function get textSnapshot():TextSnapshot;
function getChildIndex(value:DisplayObject):int;
function set doubleClickEnabled(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function getObjectsUnderPoint(lockCenter:Point):Array;
function get creatingContentPane():Boolean;
function setChildIndex(_arg1:DisplayObject, _arg2:int):void;
function get soundTransform():SoundTransform;
function set useHandCursor(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function get numChildren():int;
function contains(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ISpriteInterface.as:DisplayObject):Boolean;
function get verticalScrollPosition():Number;
function set defaultButton(mx.core:IContainer/mx.core:IContainer:graphics/get:IFlexDisplayObject):void;
function swapChildren(_arg1:DisplayObject, _arg2:DisplayObject):void;
function set horizontalScrollPosition(mx.core:IContainer/mx.core:IContainer:graphics/get:Number):void;
function get focusManager():IFocusManager;
function startDrag(_arg1:Boolean=false, _arg2:Rectangle=null):void;
function set mouseEnabled(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function getChildAt(Graphics:int):DisplayObject;
function set soundTransform(mx.core:IContainer/mx.core:IContainer:graphics/get:SoundTransform):void;
function get tabChildren():Boolean;
function get tabIndex():int;
function set focusRect(mx.core:IContainer/mx.core:IContainer:graphics/get:Object):void;
function get hitArea():Sprite;
function get mouseChildren():Boolean;
function removeChildAt(Graphics:int):DisplayObject;
function get defaultButton():IFlexDisplayObject;
function stopDrag():void;
function set tabEnabled(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function get horizontalScrollPosition():Number;
function get focusRect():Object;
function get viewMetrics():EdgeMetrics;
function set verticalScrollPosition(mx.core:IContainer/mx.core:IContainer:graphics/get:Number):void;
function get dropTarget():DisplayObject;
function get mouseEnabled():Boolean;
function set tabChildren(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function set buttonMode(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function get tabEnabled():Boolean;
function get buttonMode():Boolean;
function removeChild(Graphics:DisplayObject):DisplayObject;
function set tabIndex(mx.core:IContainer/mx.core:IContainer:graphics/get:int):void;
function addChild(Graphics:DisplayObject):DisplayObject;
function areInaccessibleObjectsUnderPoint(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ISpriteInterface.as:Point):Boolean;
}
}//package mx.core
Section 149
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 150
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.accessibility.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get visible():Boolean;
function get rotation():Number;
function localToGlobal(void:Point):Point;
function get name():String;
function set width(flash.display:Number):void;
function get measuredHeight():Number;
function get blendMode():String;
function get scale9Grid():Rectangle;
function set name(flash.display:String):void;
function set scaleX(flash.display:Number):void;
function set scaleY(flash.display:Number):void;
function get measuredWidth():Number;
function get accessibilityProperties():AccessibilityProperties;
function set scrollRect(flash.display:Rectangle):void;
function get cacheAsBitmap():Boolean;
function globalToLocal(void:Point):Point;
function get height():Number;
function set blendMode(flash.display:String):void;
function get parent():DisplayObjectContainer;
function getBounds(String:DisplayObject):Rectangle;
function get opaqueBackground():Object;
function set scale9Grid(flash.display:Rectangle):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set alpha(flash.display:Number):void;
function set accessibilityProperties(flash.display:AccessibilityProperties):void;
function get width():Number;
function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean;
function set cacheAsBitmap(flash.display:Boolean):void;
function get scaleX():Number;
function get scaleY():Number;
function get scrollRect():Rectangle;
function get mouseX():Number;
function get mouseY():Number;
function set height(flash.display:Number):void;
function set mask(flash.display:DisplayObject):void;
function getRect(String:DisplayObject):Rectangle;
function get alpha():Number;
function set transform(flash.display:Transform):void;
function move(_arg1:Number, _arg2:Number):void;
function get loaderInfo():LoaderInfo;
function get root():DisplayObject;
function hitTestObject(mx.core:IFlexDisplayObject/mx.core:IFlexDisplayObject:stage/get:DisplayObject):Boolean;
function set opaqueBackground(flash.display:Object):void;
function set visible(flash.display:Boolean):void;
function get mask():DisplayObject;
function set x(flash.display:Number):void;
function set y(flash.display:Number):void;
function get transform():Transform;
function set filters(flash.display:Array):void;
function get x():Number;
function get y():Number;
function get filters():Array;
function set rotation(flash.display:Number):void;
function get stage():Stage;
}
}//package mx.core
Section 151
//IFlexModuleFactory (mx.core.IFlexModuleFactory)
package mx.core {
import flash.utils.*;
public interface IFlexModuleFactory {
function get preloadedRSLs():Dictionary;
function allowInsecureDomain(... _args):void;
function create(... _args):Object;
function allowDomain(... _args):void;
function info():Object;
}
}//package mx.core
Section 152
//IInvalidating (mx.core.IInvalidating)
package mx.core {
public interface IInvalidating {
function validateNow():void;
function invalidateSize():void;
function invalidateDisplayList():void;
function invalidateProperties():void;
}
}//package mx.core
Section 153
//IProgrammaticSkin (mx.core.IProgrammaticSkin)
package mx.core {
public interface IProgrammaticSkin {
function validateNow():void;
function validateDisplayList():void;
}
}//package mx.core
Section 154
//IRawChildrenContainer (mx.core.IRawChildrenContainer)
package mx.core {
public interface IRawChildrenContainer {
function get rawChildren():IChildList;
}
}//package mx.core
Section 155
//IRectangularBorder (mx.core.IRectangularBorder)
package mx.core {
import flash.geom.*;
public interface IRectangularBorder extends IBorder {
function get backgroundImageBounds():Rectangle;
function get hasBackgroundImage():Boolean;
function set backgroundImageBounds(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IRectangularBorder.as:Rectangle):void;
function layoutBackgroundImage():void;
}
}//package mx.core
Section 156
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function get instanceIndices():Array;
function set instanceIndices(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void;
function get isDocument():Boolean;
function set repeaters(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void;
function initializeRepeaterArrays(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:IRepeaterClient):void;
function get repeaters():Array;
function set repeaterIndices(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 157
//ISWFBridgeGroup (mx.core.ISWFBridgeGroup)
package mx.core {
import flash.events.*;
public interface ISWFBridgeGroup {
function getChildBridgeProvider(mx.core:ISWFBridgeGroup/mx.core:ISWFBridgeGroup:parentBridge/get:IEventDispatcher):ISWFBridgeProvider;
function removeChildBridge(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ISWFBridgeGroup.as:IEventDispatcher):void;
function get parentBridge():IEventDispatcher;
function addChildBridge(_arg1:IEventDispatcher, _arg2:ISWFBridgeProvider):void;
function set parentBridge(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ISWFBridgeGroup.as:IEventDispatcher):void;
function containsBridge(IEventDispatcher:IEventDispatcher):Boolean;
function getChildBridges():Array;
}
}//package mx.core
Section 158
//ISWFBridgeProvider (mx.core.ISWFBridgeProvider)
package mx.core {
import flash.events.*;
public interface ISWFBridgeProvider {
function get childAllowsParent():Boolean;
function get swfBridge():IEventDispatcher;
function get parentAllowsChild():Boolean;
}
}//package mx.core
Section 159
//IUIComponent (mx.core.IUIComponent)
package mx.core {
import flash.display.*;
import mx.managers.*;
public interface IUIComponent extends IFlexDisplayObject {
function set focusPane(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Sprite):void;
function get enabled():Boolean;
function set enabled(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Boolean):void;
function set isPopUp(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Boolean):void;
function get explicitMinHeight():Number;
function get percentWidth():Number;
function get isPopUp():Boolean;
function get owner():DisplayObjectContainer;
function get percentHeight():Number;
function get baselinePosition():Number;
function owns(Number:DisplayObject):Boolean;
function initialize():void;
function get maxWidth():Number;
function get minWidth():Number;
function getExplicitOrMeasuredWidth():Number;
function get explicitMaxWidth():Number;
function get explicitMaxHeight():Number;
function set percentHeight(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function get minHeight():Number;
function set percentWidth(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function get document():Object;
function get focusPane():Sprite;
function getExplicitOrMeasuredHeight():Number;
function set tweeningProperties(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Array):void;
function set explicitWidth(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function set measuredMinHeight(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function get explicitMinWidth():Number;
function get tweeningProperties():Array;
function get maxHeight():Number;
function set owner(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:DisplayObjectContainer):void;
function set includeInLayout(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Boolean):void;
function setVisible(_arg1:Boolean, _arg2:Boolean=false):void;
function parentChanged(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:DisplayObjectContainer):void;
function get explicitWidth():Number;
function get measuredMinHeight():Number;
function set measuredMinWidth(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function set explicitHeight(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function get includeInLayout():Boolean;
function get measuredMinWidth():Number;
function get explicitHeight():Number;
function set systemManager(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:ISystemManager):void;
function set document(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Object):void;
function get systemManager():ISystemManager;
}
}//package mx.core
Section 160
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 161
//Singleton (mx.core.Singleton)
package mx.core {
public class Singleton {
mx_internal static const VERSION:String = "3.5.0.12683";
private static var classMap:Object = {};
public function Singleton(){
super();
}
public static function registerClass(interfaceName:String, clazz:Class):void{
var c:Class = classMap[interfaceName];
if (!c){
classMap[interfaceName] = clazz;
};
}
public static function getClass(interfaceName:String):Class{
return (classMap[interfaceName]);
}
public static function getInstance(interfaceName:String):Object{
var c:Class = classMap[interfaceName];
if (!c){
throw (new Error((("No class registered for interface '" + interfaceName) + "'.")));
};
return (c["getInstance"]());
}
}
}//package mx.core
Section 162
//SoundAsset (mx.core.SoundAsset)
package mx.core {
import flash.media.*;
public class SoundAsset extends Sound implements IFlexAsset {
mx_internal static const VERSION:String = "3.5.0.12683";
public function SoundAsset(){
super();
}
}
}//package mx.core
Section 163
//UIComponentGlobals (mx.core.UIComponentGlobals)
package mx.core {
import flash.display.*;
import flash.geom.*;
import mx.managers.*;
public class UIComponentGlobals {
mx_internal static var callLaterSuspendCount:int = 0;
mx_internal static var layoutManager:ILayoutManager;
mx_internal static var nextFocusObject:InteractiveObject;
mx_internal static var designTime:Boolean = false;
mx_internal static var tempMatrix:Matrix = new Matrix();
mx_internal static var callLaterDispatcherCount:int = 0;
private static var _catchCallLaterExceptions:Boolean = false;
public function UIComponentGlobals(){
super();
}
public static function set catchCallLaterExceptions(value:Boolean):void{
_catchCallLaterExceptions = value;
}
public static function get designMode():Boolean{
return (designTime);
}
public static function set designMode(value:Boolean):void{
designTime = value;
}
public static function get catchCallLaterExceptions():Boolean{
return (_catchCallLaterExceptions);
}
}
}//package mx.core
Section 164
//ModuleEvent (mx.events.ModuleEvent)
package mx.events {
import flash.events.*;
import mx.modules.*;
public class ModuleEvent extends ProgressEvent {
public var errorText:String;
private var _module:IModuleInfo;
public static const READY:String = "ready";
public static const ERROR:String = "error";
public static const PROGRESS:String = "progress";
mx_internal static const VERSION:String = "3.5.0.12683";
public static const SETUP:String = "setup";
public static const UNLOAD:String = "unload";
public function ModuleEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, bytesLoaded:uint=0, bytesTotal:uint=0, errorText:String=null, module:IModuleInfo=null){
super(type, bubbles, cancelable, bytesLoaded, bytesTotal);
this.errorText = errorText;
this._module = module;
}
public function get module():IModuleInfo{
if (_module){
return (_module);
};
return ((target as IModuleInfo));
}
override public function clone():Event{
return (new ModuleEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, errorText, module));
}
}
}//package mx.events
Section 165
//ResourceEvent (mx.events.ResourceEvent)
package mx.events {
import flash.events.*;
public class ResourceEvent extends ProgressEvent {
public var errorText:String;
mx_internal static const VERSION:String = "3.5.0.12683";
public static const COMPLETE:String = "complete";
public static const PROGRESS:String = "progress";
public static const ERROR:String = "error";
public function ResourceEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, bytesLoaded:uint=0, bytesTotal:uint=0, errorText:String=null){
super(type, bubbles, cancelable, bytesLoaded, bytesTotal);
this.errorText = errorText;
}
override public function clone():Event{
return (new ResourceEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, errorText));
}
}
}//package mx.events
Section 166
//StyleEvent (mx.events.StyleEvent)
package mx.events {
import flash.events.*;
public class StyleEvent extends ProgressEvent {
public var errorText:String;
mx_internal static const VERSION:String = "3.5.0.12683";
public static const COMPLETE:String = "complete";
public static const PROGRESS:String = "progress";
public static const ERROR:String = "error";
public function StyleEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, bytesLoaded:uint=0, bytesTotal:uint=0, errorText:String=null){
super(type, bubbles, cancelable, bytesLoaded, bytesTotal);
this.errorText = errorText;
}
override public function clone():Event{
return (new StyleEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, errorText));
}
}
}//package mx.events
Section 167
//RectangularDropShadow (mx.graphics.RectangularDropShadow)
package mx.graphics {
import mx.core.*;
import flash.display.*;
import flash.geom.*;
import mx.utils.*;
import flash.filters.*;
public class RectangularDropShadow {
private var leftShadow:BitmapData;
private var _tlRadius:Number;// = 0
private var _trRadius:Number;// = 0
private var _angle:Number;// = 45
private var topShadow:BitmapData;
private var _distance:Number;// = 4
private var rightShadow:BitmapData;
private var _alpha:Number;// = 0.4
private var shadow:BitmapData;
private var _brRadius:Number;// = 0
private var _blRadius:Number;// = 0
private var _color:int;// = 0
private var bottomShadow:BitmapData;
private var changed:Boolean;// = true
mx_internal static const VERSION:String = "3.5.0.12683";
public function RectangularDropShadow(){
super();
}
public function get blRadius():Number{
return (_blRadius);
}
public function set brRadius(value:Number):void{
if (_brRadius != value){
_brRadius = value;
changed = true;
};
}
public function set color(value:int):void{
if (_color != value){
_color = value;
changed = true;
};
}
public function drawShadow(g:Graphics, x:Number, y:Number, width:Number, height:Number):void{
var tlWidth:Number;
var tlHeight:Number;
var trWidth:Number;
var trHeight:Number;
var blWidth:Number;
var blHeight:Number;
var brWidth:Number;
var brHeight:Number;
if (changed){
createShadowBitmaps();
changed = false;
};
width = Math.ceil(width);
height = Math.ceil(height);
var leftThickness:int = (leftShadow) ? leftShadow.width : 0;
var rightThickness:int = (rightShadow) ? rightShadow.width : 0;
var topThickness:int = (topShadow) ? topShadow.height : 0;
var bottomThickness:int = (bottomShadow) ? bottomShadow.height : 0;
var widthThickness:int = (leftThickness + rightThickness);
var heightThickness:int = (topThickness + bottomThickness);
var maxCornerHeight:Number = ((height + heightThickness) / 2);
var maxCornerWidth:Number = ((width + widthThickness) / 2);
var matrix:Matrix = new Matrix();
if (((leftShadow) || (topShadow))){
tlWidth = Math.min((tlRadius + widthThickness), maxCornerWidth);
tlHeight = Math.min((tlRadius + heightThickness), maxCornerHeight);
matrix.tx = (x - leftThickness);
matrix.ty = (y - topThickness);
g.beginBitmapFill(shadow, matrix);
g.drawRect((x - leftThickness), (y - topThickness), tlWidth, tlHeight);
g.endFill();
};
if (((rightShadow) || (topShadow))){
trWidth = Math.min((trRadius + widthThickness), maxCornerWidth);
trHeight = Math.min((trRadius + heightThickness), maxCornerHeight);
matrix.tx = (((x + width) + rightThickness) - shadow.width);
matrix.ty = (y - topThickness);
g.beginBitmapFill(shadow, matrix);
g.drawRect((((x + width) + rightThickness) - trWidth), (y - topThickness), trWidth, trHeight);
g.endFill();
};
if (((leftShadow) || (bottomShadow))){
blWidth = Math.min((blRadius + widthThickness), maxCornerWidth);
blHeight = Math.min((blRadius + heightThickness), maxCornerHeight);
matrix.tx = (x - leftThickness);
matrix.ty = (((y + height) + bottomThickness) - shadow.height);
g.beginBitmapFill(shadow, matrix);
g.drawRect((x - leftThickness), (((y + height) + bottomThickness) - blHeight), blWidth, blHeight);
g.endFill();
};
if (((rightShadow) || (bottomShadow))){
brWidth = Math.min((brRadius + widthThickness), maxCornerWidth);
brHeight = Math.min((brRadius + heightThickness), maxCornerHeight);
matrix.tx = (((x + width) + rightThickness) - shadow.width);
matrix.ty = (((y + height) + bottomThickness) - shadow.height);
g.beginBitmapFill(shadow, matrix);
g.drawRect((((x + width) + rightThickness) - brWidth), (((y + height) + bottomThickness) - brHeight), brWidth, brHeight);
g.endFill();
};
if (leftShadow){
matrix.tx = (x - leftThickness);
matrix.ty = 0;
g.beginBitmapFill(leftShadow, matrix);
g.drawRect((x - leftThickness), ((y - topThickness) + tlHeight), leftThickness, ((((height + topThickness) + bottomThickness) - tlHeight) - blHeight));
g.endFill();
};
if (rightShadow){
matrix.tx = (x + width);
matrix.ty = 0;
g.beginBitmapFill(rightShadow, matrix);
g.drawRect((x + width), ((y - topThickness) + trHeight), rightThickness, ((((height + topThickness) + bottomThickness) - trHeight) - brHeight));
g.endFill();
};
if (topShadow){
matrix.tx = 0;
matrix.ty = (y - topThickness);
g.beginBitmapFill(topShadow, matrix);
g.drawRect(((x - leftThickness) + tlWidth), (y - topThickness), ((((width + leftThickness) + rightThickness) - tlWidth) - trWidth), topThickness);
g.endFill();
};
if (bottomShadow){
matrix.tx = 0;
matrix.ty = (y + height);
g.beginBitmapFill(bottomShadow, matrix);
g.drawRect(((x - leftThickness) + blWidth), (y + height), ((((width + leftThickness) + rightThickness) - blWidth) - brWidth), bottomThickness);
g.endFill();
};
}
public function get brRadius():Number{
return (_brRadius);
}
public function get angle():Number{
return (_angle);
}
private function createShadowBitmaps():void{
var roundRectWidth:Number = ((Math.max(tlRadius, blRadius) + (2 * distance)) + Math.max(trRadius, brRadius));
var roundRectHeight:Number = ((Math.max(tlRadius, trRadius) + (2 * distance)) + Math.max(blRadius, brRadius));
if ((((roundRectWidth < 0)) || ((roundRectHeight < 0)))){
return;
};
var roundRect:Shape = new FlexShape();
var g:Graphics = roundRect.graphics;
g.beginFill(0xFFFFFF);
GraphicsUtil.drawRoundRectComplex(g, 0, 0, roundRectWidth, roundRectHeight, tlRadius, trRadius, blRadius, brRadius);
g.endFill();
var roundRectBitmap:BitmapData = new BitmapData(roundRectWidth, roundRectHeight, true, 0);
roundRectBitmap.draw(roundRect, new Matrix());
var filter:DropShadowFilter = new DropShadowFilter(distance, angle, color, alpha);
filter.knockout = true;
var inputRect:Rectangle = new Rectangle(0, 0, roundRectWidth, roundRectHeight);
var outputRect:Rectangle = roundRectBitmap.generateFilterRect(inputRect, filter);
var leftThickness:Number = (inputRect.left - outputRect.left);
var rightThickness:Number = (outputRect.right - inputRect.right);
var topThickness:Number = (inputRect.top - outputRect.top);
var bottomThickness:Number = (outputRect.bottom - inputRect.bottom);
shadow = new BitmapData(outputRect.width, outputRect.height);
shadow.applyFilter(roundRectBitmap, inputRect, new Point(leftThickness, topThickness), filter);
var origin:Point = new Point(0, 0);
var rect:Rectangle = new Rectangle();
if (leftThickness > 0){
rect.x = 0;
rect.y = ((tlRadius + topThickness) + bottomThickness);
rect.width = leftThickness;
rect.height = 1;
leftShadow = new BitmapData(leftThickness, 1);
leftShadow.copyPixels(shadow, rect, origin);
} else {
leftShadow = null;
};
if (rightThickness > 0){
rect.x = (shadow.width - rightThickness);
rect.y = ((trRadius + topThickness) + bottomThickness);
rect.width = rightThickness;
rect.height = 1;
rightShadow = new BitmapData(rightThickness, 1);
rightShadow.copyPixels(shadow, rect, origin);
} else {
rightShadow = null;
};
if (topThickness > 0){
rect.x = ((tlRadius + leftThickness) + rightThickness);
rect.y = 0;
rect.width = 1;
rect.height = topThickness;
topShadow = new BitmapData(1, topThickness);
topShadow.copyPixels(shadow, rect, origin);
} else {
topShadow = null;
};
if (bottomThickness > 0){
rect.x = ((blRadius + leftThickness) + rightThickness);
rect.y = (shadow.height - bottomThickness);
rect.width = 1;
rect.height = bottomThickness;
bottomShadow = new BitmapData(1, bottomThickness);
bottomShadow.copyPixels(shadow, rect, origin);
} else {
bottomShadow = null;
};
}
public function get alpha():Number{
return (_alpha);
}
public function get color():int{
return (_color);
}
public function set angle(value:Number):void{
if (_angle != value){
_angle = value;
changed = true;
};
}
public function set trRadius(value:Number):void{
if (_trRadius != value){
_trRadius = value;
changed = true;
};
}
public function set tlRadius(value:Number):void{
if (_tlRadius != value){
_tlRadius = value;
changed = true;
};
}
public function get trRadius():Number{
return (_trRadius);
}
public function set distance(value:Number):void{
if (_distance != value){
_distance = value;
changed = true;
};
}
public function get distance():Number{
return (_distance);
}
public function get tlRadius():Number{
return (_tlRadius);
}
public function set alpha(value:Number):void{
if (_alpha != value){
_alpha = value;
changed = true;
};
}
public function set blRadius(value:Number):void{
if (_blRadius != value){
_blRadius = value;
changed = true;
};
}
}
}//package mx.graphics
Section 168
//IFocusManager (mx.managers.IFocusManager)
package mx.managers {
import mx.core.*;
import flash.events.*;
import flash.display.*;
public interface IFocusManager {
function get focusPane():Sprite;
function getFocus():IFocusManagerComponent;
function deactivate():void;
function set defaultButton(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:IButton):void;
function set focusPane(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:Sprite):void;
function set showFocusIndicator(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:Boolean):void;
function moveFocus(_arg1:String, _arg2:DisplayObject=null):void;
function addSWFBridge(_arg1:IEventDispatcher, _arg2:DisplayObject):void;
function removeSWFBridge(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:IEventDispatcher):void;
function get defaultButtonEnabled():Boolean;
function findFocusManagerComponent(value:InteractiveObject):IFocusManagerComponent;
function get nextTabIndex():int;
function get defaultButton():IButton;
function get showFocusIndicator():Boolean;
function setFocus(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:IFocusManagerComponent):void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:Boolean):void;
function hideFocus():void;
function getNextFocusManagerComponent(value:Boolean=false):IFocusManagerComponent;
}
}//package mx.managers
Section 169
//IFocusManagerComponent (mx.managers.IFocusManagerComponent)
package mx.managers {
public interface IFocusManagerComponent {
function set focusEnabled(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IFocusManagerComponent.as:Boolean):void;
function drawFocus(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IFocusManagerComponent.as:Boolean):void;
function setFocus():void;
function get focusEnabled():Boolean;
function get tabEnabled():Boolean;
function get tabIndex():int;
function get mouseFocusEnabled():Boolean;
}
}//package mx.managers
Section 170
//IFocusManagerContainer (mx.managers.IFocusManagerContainer)
package mx.managers {
import flash.events.*;
import flash.display.*;
public interface IFocusManagerContainer extends IEventDispatcher {
function set focusManager(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IFocusManagerContainer.as:IFocusManager):void;
function get focusManager():IFocusManager;
function get systemManager():ISystemManager;
function contains(mx.managers:DisplayObject):Boolean;
}
}//package mx.managers
Section 171
//ILayoutManager (mx.managers.ILayoutManager)
package mx.managers {
import flash.events.*;
public interface ILayoutManager extends IEventDispatcher {
function validateNow():void;
function validateClient(_arg1:ILayoutManagerClient, _arg2:Boolean=false):void;
function isInvalid():Boolean;
function invalidateDisplayList(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:ILayoutManagerClient):void;
function set usePhasedInstantiation(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:Boolean):void;
function invalidateSize(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:ILayoutManagerClient):void;
function get usePhasedInstantiation():Boolean;
function invalidateProperties(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:ILayoutManagerClient):void;
}
}//package mx.managers
Section 172
//ILayoutManagerClient (mx.managers.ILayoutManagerClient)
package mx.managers {
import flash.events.*;
public interface ILayoutManagerClient extends IEventDispatcher {
function get updateCompletePendingFlag():Boolean;
function set updateCompletePendingFlag(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean):void;
function set initialized(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean):void;
function validateProperties():void;
function validateDisplayList():void;
function get nestLevel():int;
function get initialized():Boolean;
function get processedDescriptors():Boolean;
function validateSize(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean=false):void;
function set nestLevel(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:int):void;
function set processedDescriptors(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean):void;
}
}//package mx.managers
Section 173
//ISystemManager (mx.managers.ISystemManager)
package mx.managers {
import mx.core.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.text.*;
public interface ISystemManager extends IEventDispatcher, IChildList, IFlexModuleFactory {
function set focusPane(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:Sprite):void;
function get toolTipChildren():IChildList;
function useSWFBridge():Boolean;
function isFontFaceEmbedded(flash.display:TextFormat):Boolean;
function deployMouseShields(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:Boolean):void;
function get rawChildren():IChildList;
function get topLevelSystemManager():ISystemManager;
function dispatchEventFromSWFBridges(_arg1:Event, _arg2:IEventDispatcher=null, _arg3:Boolean=false, _arg4:Boolean=false):void;
function getSandboxRoot():DisplayObject;
function get swfBridgeGroup():ISWFBridgeGroup;
function removeFocusManager(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IFocusManagerContainer):void;
function addChildToSandboxRoot(_arg1:String, _arg2:DisplayObject):void;
function get document():Object;
function get focusPane():Sprite;
function get loaderInfo():LoaderInfo;
function addChildBridge(_arg1:IEventDispatcher, _arg2:DisplayObject):void;
function getTopLevelRoot():DisplayObject;
function removeChildBridge(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IEventDispatcher):void;
function isDisplayObjectInABridgedApplication(flash.display:DisplayObject):Boolean;
function get popUpChildren():IChildList;
function get screen():Rectangle;
function removeChildFromSandboxRoot(_arg1:String, _arg2:DisplayObject):void;
function getDefinitionByName(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ISystemManager.as:String):Object;
function activate(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IFocusManagerContainer):void;
function deactivate(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IFocusManagerContainer):void;
function get cursorChildren():IChildList;
function set document(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:Object):void;
function get embeddedFontList():Object;
function set numModalWindows(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:int):void;
function isTopLevel():Boolean;
function isTopLevelRoot():Boolean;
function get numModalWindows():int;
function addFocusManager(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IFocusManagerContainer):void;
function get stage():Stage;
function getVisibleApplicationRect(value:Rectangle=null):Rectangle;
}
}//package mx.managers
Section 174
//SystemManagerGlobals (mx.managers.SystemManagerGlobals)
package mx.managers {
public class SystemManagerGlobals {
public static var topLevelSystemManagers:Array = [];
public static var changingListenersInOtherSystemManagers:Boolean;
public static var bootstrapLoaderInfoURL:String;
public static var showMouseCursor:Boolean;
public static var dispatchingEventToOtherSystemManagers:Boolean;
public function SystemManagerGlobals(){
super();
}
}
}//package mx.managers
Section 175
//IModuleInfo (mx.modules.IModuleInfo)
package mx.modules {
import mx.core.*;
import flash.events.*;
import flash.utils.*;
import flash.system.*;
public interface IModuleInfo extends IEventDispatcher {
function get ready():Boolean;
function get loaded():Boolean;
function load(_arg1:ApplicationDomain=null, _arg2:SecurityDomain=null, _arg3:ByteArray=null):void;
function release():void;
function get error():Boolean;
function get data():Object;
function publish(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\modules;IModuleInfo.as:IFlexModuleFactory):void;
function get factory():IFlexModuleFactory;
function set data(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\modules;IModuleInfo.as:Object):void;
function get url():String;
function get setup():Boolean;
function unload():void;
}
}//package mx.modules
Section 176
//ModuleManager (mx.modules.ModuleManager)
package mx.modules {
import mx.core.*;
public class ModuleManager {
mx_internal static const VERSION:String = "3.5.0.12683";
public function ModuleManager(){
super();
}
public static function getModule(url:String):IModuleInfo{
return (getSingleton().getModule(url));
}
private static function getSingleton():Object{
if (!ModuleManagerGlobals.managerSingleton){
ModuleManagerGlobals.managerSingleton = new ModuleManagerImpl();
};
return (ModuleManagerGlobals.managerSingleton);
}
public static function getAssociatedFactory(object:Object):IFlexModuleFactory{
return (getSingleton().getAssociatedFactory(object));
}
}
}//package mx.modules
import mx.core.*;
import flash.events.*;
import flash.utils.*;
import flash.system.*;
import flash.display.*;
import mx.events.*;
import flash.net.*;
class ModuleInfoProxy extends EventDispatcher implements IModuleInfo {
private var _data:Object;
private var info:ModuleInfo;
private var referenced:Boolean;// = false
private function ModuleInfoProxy(info:ModuleInfo){
super();
this.info = info;
info.addEventListener(ModuleEvent.SETUP, moduleEventHandler, false, 0, true);
info.addEventListener(ModuleEvent.PROGRESS, moduleEventHandler, false, 0, true);
info.addEventListener(ModuleEvent.READY, moduleEventHandler, false, 0, true);
info.addEventListener(ModuleEvent.ERROR, moduleEventHandler, false, 0, true);
info.addEventListener(ModuleEvent.UNLOAD, moduleEventHandler, false, 0, true);
}
public function get loaded():Boolean{
return (info.loaded);
}
public function release():void{
if (referenced){
info.removeReference();
referenced = false;
};
}
public function get error():Boolean{
return (info.error);
}
public function get factory():IFlexModuleFactory{
return (info.factory);
}
public function publish(factory:IFlexModuleFactory):void{
info.publish(factory);
}
public function set data(value:Object):void{
_data = value;
}
public function get ready():Boolean{
return (info.ready);
}
public function load(applicationDomain:ApplicationDomain=null, securityDomain:SecurityDomain=null, bytes:ByteArray=null):void{
var moduleEvent:ModuleEvent;
info.resurrect();
if (!referenced){
info.addReference();
referenced = true;
};
if (info.error){
dispatchEvent(new ModuleEvent(ModuleEvent.ERROR));
} else {
if (info.loaded){
if (info.setup){
dispatchEvent(new ModuleEvent(ModuleEvent.SETUP));
if (info.ready){
moduleEvent = new ModuleEvent(ModuleEvent.PROGRESS);
moduleEvent.bytesLoaded = info.size;
moduleEvent.bytesTotal = info.size;
dispatchEvent(moduleEvent);
dispatchEvent(new ModuleEvent(ModuleEvent.READY));
};
};
} else {
info.load(applicationDomain, securityDomain, bytes);
};
};
}
private function moduleEventHandler(event:ModuleEvent):void{
dispatchEvent(event);
}
public function get url():String{
return (info.url);
}
public function get data():Object{
return (_data);
}
public function get setup():Boolean{
return (info.setup);
}
public function unload():void{
info.unload();
info.removeEventListener(ModuleEvent.SETUP, moduleEventHandler);
info.removeEventListener(ModuleEvent.PROGRESS, moduleEventHandler);
info.removeEventListener(ModuleEvent.READY, moduleEventHandler);
info.removeEventListener(ModuleEvent.ERROR, moduleEventHandler);
info.removeEventListener(ModuleEvent.UNLOAD, moduleEventHandler);
}
}
class ModuleManagerImpl extends EventDispatcher {
private var moduleList:Object;
private function ModuleManagerImpl(){
moduleList = {};
super();
}
public function getModule(url:String):IModuleInfo{
var info:ModuleInfo = (moduleList[url] as ModuleInfo);
if (!info){
info = new ModuleInfo(url);
moduleList[url] = info;
};
return (new ModuleInfoProxy(info));
}
public function getAssociatedFactory(object:Object):IFlexModuleFactory{
var m:Object;
var info:ModuleInfo;
var domain:ApplicationDomain;
var cls:Class;
var object = object;
var className:String = getQualifiedClassName(object);
for each (m in moduleList) {
info = (m as ModuleInfo);
if (!info.ready){
} else {
domain = info.applicationDomain;
cls = Class(domain.getDefinition(className));
if ((object is cls)){
return (info.factory);
};
//unresolved jump
var _slot1 = error;
};
};
return (null);
}
}
class ModuleInfo extends EventDispatcher {
private var _error:Boolean;// = false
private var loader:Loader;
private var factoryInfo:FactoryInfo;
private var limbo:Dictionary;
private var _loaded:Boolean;// = false
private var _ready:Boolean;// = false
private var numReferences:int;// = 0
private var _url:String;
private var _setup:Boolean;// = false
private function ModuleInfo(url:String){
super();
_url = url;
}
private function clearLoader():void{
if (loader){
if (loader.contentLoaderInfo){
loader.contentLoaderInfo.removeEventListener(Event.INIT, initHandler);
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, completeHandler);
loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
loader.contentLoaderInfo.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
};
if (loader.content){
loader.content.removeEventListener("ready", readyHandler);
loader.content.removeEventListener("error", moduleErrorHandler);
};
//unresolved jump
var _slot1 = error;
if (_loaded){
loader.close();
//unresolved jump
var _slot1 = error;
};
loader.unload();
//unresolved jump
var _slot1 = error;
loader = null;
};
}
public function get size():int{
return ((((!(limbo)) && (factoryInfo))) ? factoryInfo.bytesTotal : 0);
}
public function get loaded():Boolean{
return ((limbo) ? false : _loaded);
}
public function release():void{
if (((_ready) && (!(limbo)))){
limbo = new Dictionary(true);
limbo[factoryInfo] = 1;
factoryInfo = null;
} else {
unload();
};
}
public function get error():Boolean{
return ((limbo) ? false : _error);
}
public function get factory():IFlexModuleFactory{
return ((((!(limbo)) && (factoryInfo))) ? factoryInfo.factory : null);
}
public function completeHandler(event:Event):void{
var moduleEvent:ModuleEvent = new ModuleEvent(ModuleEvent.PROGRESS, event.bubbles, event.cancelable);
moduleEvent.bytesLoaded = loader.contentLoaderInfo.bytesLoaded;
moduleEvent.bytesTotal = loader.contentLoaderInfo.bytesTotal;
dispatchEvent(moduleEvent);
}
public function publish(factory:IFlexModuleFactory):void{
if (factoryInfo){
return;
};
if (_url.indexOf("published://") != 0){
return;
};
factoryInfo = new FactoryInfo();
factoryInfo.factory = factory;
_loaded = true;
_setup = true;
_ready = true;
_error = false;
dispatchEvent(new ModuleEvent(ModuleEvent.SETUP));
dispatchEvent(new ModuleEvent(ModuleEvent.PROGRESS));
dispatchEvent(new ModuleEvent(ModuleEvent.READY));
}
public function initHandler(event:Event):void{
var moduleEvent:ModuleEvent;
var event = event;
factoryInfo = new FactoryInfo();
factoryInfo.factory = (loader.content as IFlexModuleFactory);
//unresolved jump
var _slot1 = error;
if (!factoryInfo.factory){
moduleEvent = new ModuleEvent(ModuleEvent.ERROR, event.bubbles, event.cancelable);
moduleEvent.bytesLoaded = 0;
moduleEvent.bytesTotal = 0;
moduleEvent.errorText = "SWF is not a loadable module";
dispatchEvent(moduleEvent);
return;
};
loader.content.addEventListener("ready", readyHandler);
loader.content.addEventListener("error", moduleErrorHandler);
factoryInfo.applicationDomain = loader.contentLoaderInfo.applicationDomain;
//unresolved jump
var _slot1 = error;
_setup = true;
dispatchEvent(new ModuleEvent(ModuleEvent.SETUP));
}
public function resurrect():void{
var f:Object;
if (((!(factoryInfo)) && (limbo))){
for (f in limbo) {
factoryInfo = (f as FactoryInfo);
break;
};
limbo = null;
};
if (!factoryInfo){
if (_loaded){
dispatchEvent(new ModuleEvent(ModuleEvent.UNLOAD));
};
loader = null;
_loaded = false;
_setup = false;
_ready = false;
_error = false;
};
}
public function errorHandler(event:ErrorEvent):void{
_error = true;
var moduleEvent:ModuleEvent = new ModuleEvent(ModuleEvent.ERROR, event.bubbles, event.cancelable);
moduleEvent.bytesLoaded = 0;
moduleEvent.bytesTotal = 0;
moduleEvent.errorText = event.text;
dispatchEvent(moduleEvent);
}
public function get ready():Boolean{
return ((limbo) ? false : _ready);
}
private function loadBytes(applicationDomain:ApplicationDomain, bytes:ByteArray):void{
var c:LoaderContext = new LoaderContext();
c.applicationDomain = (applicationDomain) ? applicationDomain : new ApplicationDomain(ApplicationDomain.currentDomain);
if (("allowLoadBytesCodeExecution" in c)){
c["allowLoadBytesCodeExecution"] = true;
};
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
loader.loadBytes(bytes, c);
}
public function removeReference():void{
numReferences--;
if (numReferences == 0){
release();
};
}
public function addReference():void{
numReferences++;
}
public function progressHandler(event:ProgressEvent):void{
var moduleEvent:ModuleEvent = new ModuleEvent(ModuleEvent.PROGRESS, event.bubbles, event.cancelable);
moduleEvent.bytesLoaded = event.bytesLoaded;
moduleEvent.bytesTotal = event.bytesTotal;
dispatchEvent(moduleEvent);
}
public function load(applicationDomain:ApplicationDomain=null, securityDomain:SecurityDomain=null, bytes:ByteArray=null):void{
if (_loaded){
return;
};
_loaded = true;
limbo = null;
if (bytes){
loadBytes(applicationDomain, bytes);
return;
};
if (_url.indexOf("published://") == 0){
return;
};
var r:URLRequest = new URLRequest(_url);
var c:LoaderContext = new LoaderContext();
c.applicationDomain = (applicationDomain) ? applicationDomain : new ApplicationDomain(ApplicationDomain.currentDomain);
c.securityDomain = securityDomain;
if ((((securityDomain == null)) && ((Security.sandboxType == Security.REMOTE)))){
c.securityDomain = SecurityDomain.currentDomain;
};
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
loader.load(r, c);
}
public function get url():String{
return (_url);
}
public function get applicationDomain():ApplicationDomain{
return ((((!(limbo)) && (factoryInfo))) ? factoryInfo.applicationDomain : null);
}
public function moduleErrorHandler(event:Event):void{
var errorEvent:ModuleEvent;
_ready = true;
factoryInfo.bytesTotal = loader.contentLoaderInfo.bytesTotal;
clearLoader();
if ((event is ModuleEvent)){
errorEvent = ModuleEvent(event);
} else {
errorEvent = new ModuleEvent(ModuleEvent.ERROR);
};
dispatchEvent(errorEvent);
}
public function readyHandler(event:Event):void{
_ready = true;
factoryInfo.bytesTotal = loader.contentLoaderInfo.bytesTotal;
var moduleEvent:ModuleEvent = new ModuleEvent(ModuleEvent.READY);
moduleEvent.bytesLoaded = loader.contentLoaderInfo.bytesLoaded;
moduleEvent.bytesTotal = loader.contentLoaderInfo.bytesTotal;
clearLoader();
dispatchEvent(moduleEvent);
}
public function get setup():Boolean{
return ((limbo) ? false : _setup);
}
public function unload():void{
clearLoader();
if (_loaded){
dispatchEvent(new ModuleEvent(ModuleEvent.UNLOAD));
};
limbo = null;
factoryInfo = null;
_loaded = false;
_setup = false;
_ready = false;
_error = false;
}
}
class FactoryInfo {
public var bytesTotal:int;// = 0
public var factory:IFlexModuleFactory;
public var applicationDomain:ApplicationDomain;
private function FactoryInfo(){
super();
}
}
Section 177
//ModuleManagerGlobals (mx.modules.ModuleManagerGlobals)
package mx.modules {
public class ModuleManagerGlobals {
public static var managerSingleton:Object = null;
public function ModuleManagerGlobals(){
super();
}
}
}//package mx.modules
Section 178
//IResourceBundle (mx.resources.IResourceBundle)
package mx.resources {
public interface IResourceBundle {
function get content():Object;
function get locale():String;
function get bundleName():String;
}
}//package mx.resources
Section 179
//IResourceManager (mx.resources.IResourceManager)
package mx.resources {
import flash.events.*;
import flash.system.*;
public interface IResourceManager extends IEventDispatcher {
function loadResourceModule(_arg1:String, _arg2:Boolean=true, _arg3:ApplicationDomain=null, _arg4:SecurityDomain=null):IEventDispatcher;
function getBoolean(_arg1:String, _arg2:String, _arg3:String=null):Boolean;
function getClass(_arg1:String, _arg2:String, _arg3:String=null):Class;
function getLocales():Array;
function removeResourceBundlesForLocale(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\resources;IResourceManager.as:String):void;
function getResourceBundle(_arg1:String, _arg2:String):IResourceBundle;
function get localeChain():Array;
function getInt(_arg1:String, _arg2:String, _arg3:String=null):int;
function update():void;
function set localeChain(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\resources;IResourceManager.as:Array):void;
function getUint(_arg1:String, _arg2:String, _arg3:String=null):uint;
function addResourceBundle(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\resources;IResourceManager.as:IResourceBundle):void;
function getStringArray(_arg1:String, _arg2:String, _arg3:String=null):Array;
function getBundleNamesForLocale(:String):Array;
function removeResourceBundle(_arg1:String, _arg2:String):void;
function getObject(_arg1:String, _arg2:String, _arg3:String=null);
function getString(_arg1:String, _arg2:String, _arg3:Array=null, _arg4:String=null):String;
function installCompiledResourceBundles(_arg1:ApplicationDomain, _arg2:Array, _arg3:Array):void;
function unloadResourceModule(_arg1:String, _arg2:Boolean=true):void;
function getPreferredLocaleChain():Array;
function findResourceBundleWithResource(_arg1:String, _arg2:String):IResourceBundle;
function initializeLocaleChain(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\resources;IResourceManager.as:Array):void;
function getNumber(_arg1:String, _arg2:String, _arg3:String=null):Number;
}
}//package mx.resources
Section 180
//IResourceModule (mx.resources.IResourceModule)
package mx.resources {
public interface IResourceModule {
function get resourceBundles():Array;
}
}//package mx.resources
Section 181
//LocaleSorter (mx.resources.LocaleSorter)
package mx.resources {
public class LocaleSorter {
mx_internal static const VERSION:String = "3.5.0.12683";
public function LocaleSorter(){
super();
}
private static function normalizeLocale(locale:String):String{
return (locale.toLowerCase().replace(/-/g, "_"));
}
public static function sortLocalesByPreference(appLocales:Array, systemPreferences:Array, ultimateFallbackLocale:String=null, addAll:Boolean=false):Array{
var result:Array;
var hasLocale:Object;
var i:int;
var j:int;
var k:int;
var l:int;
var locale:String;
var plocale:LocaleID;
var appLocales = appLocales;
var systemPreferences = systemPreferences;
var ultimateFallbackLocale = ultimateFallbackLocale;
var addAll = addAll;
var promote:Function = function (locale:String):void{
if (typeof(hasLocale[locale]) != "undefined"){
result.push(appLocales[hasLocale[locale]]);
delete hasLocale[locale];
};
};
result = [];
hasLocale = {};
var locales:Array = trimAndNormalize(appLocales);
var preferenceLocales:Array = trimAndNormalize(systemPreferences);
addUltimateFallbackLocale(preferenceLocales, ultimateFallbackLocale);
j = 0;
while (j < locales.length) {
hasLocale[locales[j]] = j;
j = (j + 1);
};
i = 0;
l = preferenceLocales.length;
while (i < l) {
plocale = LocaleID.fromString(preferenceLocales[i]);
promote(preferenceLocales[i]);
promote(plocale.toString());
while (plocale.transformToParent()) {
promote(plocale.toString());
};
plocale = LocaleID.fromString(preferenceLocales[i]);
j = 0;
while (j < l) {
locale = preferenceLocales[j];
if (plocale.isSiblingOf(LocaleID.fromString(locale))){
promote(locale);
};
j = (j + 1);
};
j = 0;
k = locales.length;
while (j < k) {
locale = locales[j];
if (plocale.isSiblingOf(LocaleID.fromString(locale))){
promote(locale);
};
j = (j + 1);
};
i = (i + 1);
};
if (addAll){
j = 0;
k = locales.length;
while (j < k) {
promote(locales[j]);
j = (j + 1);
};
};
return (result);
}
private static function addUltimateFallbackLocale(preferenceLocales:Array, ultimateFallbackLocale:String):void{
var locale:String;
if (((!((ultimateFallbackLocale == null))) && (!((ultimateFallbackLocale == ""))))){
locale = normalizeLocale(ultimateFallbackLocale);
if (preferenceLocales.indexOf(locale) == -1){
preferenceLocales.push(locale);
};
};
}
private static function trimAndNormalize(list:Array):Array{
var resultList:Array = [];
var i:int;
while (i < list.length) {
resultList.push(normalizeLocale(list[i]));
i++;
};
return (resultList);
}
}
}//package mx.resources
class LocaleID {
private var privateLangs:Boolean;// = false
private var script:String;// = ""
private var variants:Array;
private var privates:Array;
private var extensions:Object;
private var lang:String;// = ""
private var region:String;// = ""
private var extended_langs:Array;
public static const STATE_PRIMARY_LANGUAGE:int = 0;
public static const STATE_REGION:int = 3;
public static const STATE_EXTENDED_LANGUAGES:int = 1;
public static const STATE_EXTENSIONS:int = 5;
public static const STATE_SCRIPT:int = 2;
public static const STATE_VARIANTS:int = 4;
public static const STATE_PRIVATES:int = 6;
private function LocaleID(){
extended_langs = [];
variants = [];
extensions = {};
privates = [];
super();
}
public function equals(locale:LocaleID):Boolean{
return ((toString() == locale.toString()));
}
public function canonicalize():void{
var i:String;
for (i in extensions) {
if (extensions.hasOwnProperty(i)){
if (extensions[i].length == 0){
delete extensions[i];
} else {
extensions[i] = extensions[i].sort();
};
};
};
extended_langs = extended_langs.sort();
variants = variants.sort();
privates = privates.sort();
if (script == ""){
script = LocaleRegistry.getScriptByLang(lang);
};
if ((((script == "")) && (!((region == ""))))){
script = LocaleRegistry.getScriptByLangAndRegion(lang, region);
};
if ((((region == "")) && (!((script == ""))))){
region = LocaleRegistry.getDefaultRegionForLangAndScript(lang, script);
};
}
public function toString():String{
var i:String;
var stack:Array = [lang];
appendElements(stack, extended_langs);
if (script != ""){
stack.push(script);
};
if (region != ""){
stack.push(region);
};
appendElements(stack, variants);
for (i in extensions) {
if (extensions.hasOwnProperty(i)){
stack.push(i);
appendElements(stack, extensions[i]);
};
};
if (privates.length > 0){
stack.push("x");
appendElements(stack, privates);
};
return (stack.join("_"));
}
public function isSiblingOf(other:LocaleID):Boolean{
return ((((lang == other.lang)) && ((script == other.script))));
}
public function transformToParent():Boolean{
var i:String;
var lastExtension:Array;
var defaultRegion:String;
if (privates.length > 0){
privates.splice((privates.length - 1), 1);
return (true);
};
var lastExtensionName:String;
for (i in extensions) {
if (extensions.hasOwnProperty(i)){
lastExtensionName = i;
};
};
if (lastExtensionName){
lastExtension = extensions[lastExtensionName];
if (lastExtension.length == 1){
delete extensions[lastExtensionName];
return (true);
};
lastExtension.splice((lastExtension.length - 1), 1);
return (true);
};
if (variants.length > 0){
variants.splice((variants.length - 1), 1);
return (true);
};
if (script != ""){
if (LocaleRegistry.getScriptByLang(lang) != ""){
script = "";
return (true);
};
if (region == ""){
defaultRegion = LocaleRegistry.getDefaultRegionForLangAndScript(lang, script);
if (defaultRegion != ""){
region = defaultRegion;
script = "";
return (true);
};
};
};
if (region != ""){
if (!(((script == "")) && ((LocaleRegistry.getScriptByLang(lang) == "")))){
region = "";
return (true);
};
};
if (extended_langs.length > 0){
extended_langs.splice((extended_langs.length - 1), 1);
return (true);
};
return (false);
}
private static function appendElements(dest:Array, src:Array):void{
var i:uint;
var argc:uint = src.length;
while (i < argc) {
dest.push(src[i]);
i++;
};
}
public static function fromString(str:String):LocaleID{
var last_extension:Array;
var subtag:String;
var subtag_length:int;
var firstChar:String;
var localeID:LocaleID = new (LocaleID);
var state:int = STATE_PRIMARY_LANGUAGE;
var subtags:Array = str.replace(/-/g, "_").split("_");
var i:int;
var l:int = subtags.length;
while (i < l) {
subtag = subtags[i].toLowerCase();
if (state == STATE_PRIMARY_LANGUAGE){
if (subtag == "x"){
localeID.privateLangs = true;
} else {
if (subtag == "i"){
localeID.lang = (localeID.lang + "i-");
} else {
localeID.lang = (localeID.lang + subtag);
state = STATE_EXTENDED_LANGUAGES;
};
};
} else {
subtag_length = subtag.length;
if (subtag_length == 0){
} else {
firstChar = subtag.charAt(0).toLowerCase();
if ((((state <= STATE_EXTENDED_LANGUAGES)) && ((subtag_length == 3)))){
localeID.extended_langs.push(subtag);
if (localeID.extended_langs.length == 3){
state = STATE_SCRIPT;
};
} else {
if ((((state <= STATE_SCRIPT)) && ((subtag_length == 4)))){
localeID.script = subtag;
state = STATE_REGION;
} else {
if ((((state <= STATE_REGION)) && ((((subtag_length == 2)) || ((subtag_length == 3)))))){
localeID.region = subtag;
state = STATE_VARIANTS;
} else {
if ((((state <= STATE_VARIANTS)) && ((((((((firstChar >= "a")) && ((firstChar <= "z")))) && ((subtag_length >= 5)))) || ((((((firstChar >= "0")) && ((firstChar <= "9")))) && ((subtag_length >= 4)))))))){
localeID.variants.push(subtag);
state = STATE_VARIANTS;
} else {
if ((((state < STATE_PRIVATES)) && ((subtag_length == 1)))){
if (subtag == "x"){
state = STATE_PRIVATES;
last_extension = localeID.privates;
} else {
state = STATE_EXTENSIONS;
last_extension = ((localeID.extensions[subtag]) || ([]));
localeID.extensions[subtag] = last_extension;
};
} else {
if (state >= STATE_EXTENSIONS){
last_extension.push(subtag);
};
};
};
};
};
};
};
};
i++;
};
localeID.canonicalize();
return (localeID);
}
}
class LocaleRegistry {
private static const SCRIPT_ID_BY_LANG:Object = {ab:5, af:1, am:2, ar:3, as:4, ay:1, be:5, bg:5, bn:4, bs:1, ca:1, ch:1, cs:1, cy:1, da:1, de:1, dv:6, dz:7, el:8, en:1, eo:1, es:1, et:1, eu:1, fa:3, fi:1, fj:1, fo:1, fr:1, frr:1, fy:1, ga:1, gl:1, gn:1, gu:9, gv:1, he:10, hi:11, hr:1, ht:1, hu:1, hy:12, id:1, in:1, is:1, it:1, iw:10, ja:13, ka:14, kk:5, kl:1, km:15, kn:16, ko:17, la:1, lb:1, ln:1, lo:18, lt:1, lv:1, mg:1, mh:1, mk:5, ml:19, mo:1, mr:11, ms:1, mt:1, my:20, na:1, nb:1, nd:1, ne:11, nl:1, nn:1, no:1, nr:1, ny:1, om:1, or:21, pa:22, pl:1, ps:3, pt:1, qu:1, rn:1, ro:1, ru:5, rw:1, sg:1, si:23, sk:1, sl:1, sm:1, so:1, sq:1, ss:1, st:1, sv:1, sw:1, ta:24, te:25, th:26, ti:2, tl:1, tn:1, to:1, tr:1, ts:1, uk:5, ur:3, ve:1, vi:1, wo:1, xh:1, yi:10, zu:1, cpe:1, dsb:1, frs:1, gsw:1, hsb:1, kok:11, mai:11, men:1, nds:1, niu:1, nqo:27, nso:1, son:1, tem:1, tkl:1, tmh:1, tpi:1, tvl:1, zbl:28};
private static const SCRIPTS:Array = ["", "latn", "ethi", "arab", "beng", "cyrl", "thaa", "tibt", "grek", "gujr", "hebr", "deva", "armn", "jpan", "geor", "khmr", "knda", "kore", "laoo", "mlym", "mymr", "orya", "guru", "sinh", "taml", "telu", "thai", "nkoo", "blis", "hans", "hant", "mong", "syrc"];
private static const DEFAULT_REGION_BY_LANG_AND_SCRIPT:Object = {bg:{5:"bg"}, ca:{1:"es"}, zh:{30:"tw", 29:"cn"}, cs:{1:"cz"}, da:{1:"dk"}, de:{1:"de"}, el:{8:"gr"}, en:{1:"us"}, es:{1:"es"}, fi:{1:"fi"}, fr:{1:"fr"}, he:{10:"il"}, hu:{1:"hu"}, is:{1:"is"}, it:{1:"it"}, ja:{13:"jp"}, ko:{17:"kr"}, nl:{1:"nl"}, nb:{1:"no"}, pl:{1:"pl"}, pt:{1:"br"}, ro:{1:"ro"}, ru:{5:"ru"}, hr:{1:"hr"}, sk:{1:"sk"}, sq:{1:"al"}, sv:{1:"se"}, th:{26:"th"}, tr:{1:"tr"}, ur:{3:"pk"}, id:{1:"id"}, uk:{5:"ua"}, be:{5:"by"}, sl:{1:"si"}, et:{1:"ee"}, lv:{1:"lv"}, lt:{1:"lt"}, fa:{3:"ir"}, vi:{1:"vn"}, hy:{12:"am"}, az:{1:"az", 5:"az"}, eu:{1:"es"}, mk:{5:"mk"}, af:{1:"za"}, ka:{14:"ge"}, fo:{1:"fo"}, hi:{11:"in"}, ms:{1:"my"}, kk:{5:"kz"}, ky:{5:"kg"}, sw:{1:"ke"}, uz:{1:"uz", 5:"uz"}, tt:{5:"ru"}, pa:{22:"in"}, gu:{9:"in"}, ta:{24:"in"}, te:{25:"in"}, kn:{16:"in"}, mr:{11:"in"}, sa:{11:"in"}, mn:{5:"mn"}, gl:{1:"es"}, kok:{11:"in"}, syr:{32:"sy"}, dv:{6:"mv"}, nn:{1:"no"}, sr:{1:"cs", 5:"cs"}, cy:{1:"gb"}, mi:{1:"nz"}, mt:{1:"mt"}, quz:{1:"bo"}, tn:{1:"za"}, xh:{1:"za"}, zu:{1:"za"}, nso:{1:"za"}, se:{1:"no"}, smj:{1:"no"}, sma:{1:"no"}, sms:{1:"fi"}, smn:{1:"fi"}, bs:{1:"ba"}};
private static const SCRIPT_BY_ID:Object = {latn:1, ethi:2, arab:3, beng:4, cyrl:5, thaa:6, tibt:7, grek:8, gujr:9, hebr:10, deva:11, armn:12, jpan:13, geor:14, khmr:15, knda:16, kore:17, laoo:18, mlym:19, mymr:20, orya:21, guru:22, sinh:23, taml:24, telu:25, thai:26, nkoo:27, blis:28, hans:29, hant:30, mong:31, syrc:32};
private static const SCRIPT_ID_BY_LANG_AND_REGION:Object = {zh:{cn:29, sg:29, tw:30, hk:30, mo:30}, mn:{cn:31, sg:5}, pa:{pk:3, in:22}, ha:{gh:1, ne:1}};
private function LocaleRegistry(){
super();
}
public static function getScriptByLangAndRegion(lang:String, region:String):String{
var langRegions:Object = SCRIPT_ID_BY_LANG_AND_REGION[lang];
if (langRegions == null){
return ("");
};
var scriptID:Object = langRegions[region];
if (scriptID == null){
return ("");
};
return (SCRIPTS[int(scriptID)].toLowerCase());
}
public static function getScriptByLang(lang:String):String{
var scriptID:Object = SCRIPT_ID_BY_LANG[lang];
if (scriptID == null){
return ("");
};
return (SCRIPTS[int(scriptID)].toLowerCase());
}
public static function getDefaultRegionForLangAndScript(lang:String, script:String):String{
var langObj:Object = DEFAULT_REGION_BY_LANG_AND_SCRIPT[lang];
var scriptID:Object = SCRIPT_BY_ID[script];
if ((((langObj == null)) || ((scriptID == null)))){
return ("");
};
return (((langObj[int(scriptID)]) || ("")));
}
}
Section 182
//ResourceBundle (mx.resources.ResourceBundle)
package mx.resources {
import mx.core.*;
import flash.system.*;
import mx.utils.*;
public class ResourceBundle implements IResourceBundle {
mx_internal var _locale:String;
private var _content:Object;
mx_internal var _bundleName:String;
mx_internal static const VERSION:String = "3.5.0.12683";
mx_internal static var backupApplicationDomain:ApplicationDomain;
mx_internal static var locale:String;
public function ResourceBundle(locale:String=null, bundleName:String=null){
_content = {};
super();
mx_internal::_locale = locale;
mx_internal::_bundleName = bundleName;
_content = getContent();
}
protected function getContent():Object{
return ({});
}
public function getString(key:String):String{
return (String(_getObject(key)));
}
public function get content():Object{
return (_content);
}
public function getBoolean(key:String, defaultValue:Boolean=true):Boolean{
var temp:String = _getObject(key).toLowerCase();
if (temp == "false"){
return (false);
};
if (temp == "true"){
return (true);
};
return (defaultValue);
}
public function getStringArray(key:String):Array{
var array:Array = _getObject(key).split(",");
var n:int = array.length;
var i:int;
while (i < n) {
array[i] = StringUtil.trim(array[i]);
i++;
};
return (array);
}
public function getObject(key:String):Object{
return (_getObject(key));
}
private function _getObject(key:String):Object{
var value:Object = content[key];
if (!value){
throw (new Error(((("Key " + key) + " was not found in resource bundle ") + bundleName)));
};
return (value);
}
public function get locale():String{
return (mx_internal::_locale);
}
public function get bundleName():String{
return (mx_internal::_bundleName);
}
public function getNumber(key:String):Number{
return (Number(_getObject(key)));
}
private static function getClassByName(name:String, domain:ApplicationDomain):Class{
var c:Class;
if (domain.hasDefinition(name)){
c = (domain.getDefinition(name) as Class);
};
return (c);
}
public static function getResourceBundle(baseName:String, currentDomain:ApplicationDomain=null):ResourceBundle{
var className:String;
var bundleClass:Class;
var bundleObj:Object;
var bundle:ResourceBundle;
if (!currentDomain){
currentDomain = ApplicationDomain.currentDomain;
};
className = (((mx_internal::locale + "$") + baseName) + "_properties");
bundleClass = getClassByName(className, currentDomain);
if (!bundleClass){
className = (baseName + "_properties");
bundleClass = getClassByName(className, currentDomain);
};
if (!bundleClass){
className = baseName;
bundleClass = getClassByName(className, currentDomain);
};
if (((!(bundleClass)) && (mx_internal::backupApplicationDomain))){
className = (baseName + "_properties");
bundleClass = getClassByName(className, mx_internal::backupApplicationDomain);
if (!bundleClass){
className = baseName;
bundleClass = getClassByName(className, mx_internal::backupApplicationDomain);
};
};
if (bundleClass){
bundleObj = new (bundleClass);
if ((bundleObj is ResourceBundle)){
bundle = ResourceBundle(bundleObj);
return (bundle);
};
};
throw (new Error(("Could not find resource bundle " + baseName)));
}
}
}//package mx.resources
Section 183
//ResourceManager (mx.resources.ResourceManager)
package mx.resources {
import mx.core.*;
public class ResourceManager {
mx_internal static const VERSION:String = "3.5.0.12683";
private static var implClassDependency:ResourceManagerImpl;
private static var instance:IResourceManager;
public function ResourceManager(){
super();
}
public static function getInstance():IResourceManager{
if (!instance){
instance = IResourceManager(Singleton.getInstance("mx.resources::IResourceManager"));
//unresolved jump
var _slot1 = e;
instance = new ResourceManagerImpl();
};
return (instance);
}
}
}//package mx.resources
Section 184
//ResourceManagerImpl (mx.resources.ResourceManagerImpl)
package mx.resources {
import mx.core.*;
import flash.events.*;
import flash.utils.*;
import flash.system.*;
import mx.modules.*;
import mx.events.*;
import mx.utils.*;
public class ResourceManagerImpl extends EventDispatcher implements IResourceManager {
private var resourceModules:Object;
private var initializedForNonFrameworkApp:Boolean;// = false
private var localeMap:Object;
private var _localeChain:Array;
mx_internal static const VERSION:String = "3.5.0.12683";
private static var instance:IResourceManager;
public function ResourceManagerImpl(){
localeMap = {};
resourceModules = {};
super();
}
public function get localeChain():Array{
return (_localeChain);
}
public function set localeChain(value:Array):void{
_localeChain = value;
update();
}
public function getStringArray(bundleName:String, resourceName:String, locale:String=null):Array{
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (null);
};
var value:* = resourceBundle.content[resourceName];
var array:Array = String(value).split(",");
var n:int = array.length;
var i:int;
while (i < n) {
array[i] = StringUtil.trim(array[i]);
i++;
};
return (array);
}
mx_internal function installCompiledResourceBundle(applicationDomain:ApplicationDomain, locale:String, bundleName:String):void{
var packageName:String;
var localName:String = bundleName;
var colonIndex:int = bundleName.indexOf(":");
if (colonIndex != -1){
packageName = bundleName.substring(0, colonIndex);
localName = bundleName.substring((colonIndex + 1));
};
if (getResourceBundle(locale, bundleName)){
return;
};
var resourceBundleClassName = (((locale + "$") + localName) + "_properties");
if (packageName != null){
resourceBundleClassName = ((packageName + ".") + resourceBundleClassName);
};
var bundleClass:Class;
if (applicationDomain.hasDefinition(resourceBundleClassName)){
bundleClass = Class(applicationDomain.getDefinition(resourceBundleClassName));
};
if (!bundleClass){
resourceBundleClassName = bundleName;
if (applicationDomain.hasDefinition(resourceBundleClassName)){
bundleClass = Class(applicationDomain.getDefinition(resourceBundleClassName));
};
};
if (!bundleClass){
resourceBundleClassName = (bundleName + "_properties");
if (applicationDomain.hasDefinition(resourceBundleClassName)){
bundleClass = Class(applicationDomain.getDefinition(resourceBundleClassName));
};
};
if (!bundleClass){
throw (new Error((((("Could not find compiled resource bundle '" + bundleName) + "' for locale '") + locale) + "'.")));
};
var resourceBundle:ResourceBundle = ResourceBundle(new (bundleClass));
resourceBundle.mx_internal::_locale = locale;
resourceBundle.mx_internal::_bundleName = bundleName;
addResourceBundle(resourceBundle);
}
public function getString(bundleName:String, resourceName:String, parameters:Array=null, locale:String=null):String{
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (null);
};
var value:String = String(resourceBundle.content[resourceName]);
if (parameters){
value = StringUtil.substitute(value, parameters);
};
return (value);
}
public function loadResourceModule(url:String, updateFlag:Boolean=true, applicationDomain:ApplicationDomain=null, securityDomain:SecurityDomain=null):IEventDispatcher{
var moduleInfo:IModuleInfo;
var resourceEventDispatcher:ResourceEventDispatcher;
var timer:Timer;
var timerHandler:Function;
var url = url;
var updateFlag = updateFlag;
var applicationDomain = applicationDomain;
var securityDomain = securityDomain;
moduleInfo = ModuleManager.getModule(url);
resourceEventDispatcher = new ResourceEventDispatcher(moduleInfo);
var readyHandler:Function = function (event:ModuleEvent):void{
var resourceModule:* = event.module.factory.create();
resourceModules[event.module.url].resourceModule = resourceModule;
if (updateFlag){
update();
};
};
moduleInfo.addEventListener(ModuleEvent.READY, readyHandler, false, 0, true);
var errorHandler:Function = function (event:ModuleEvent):void{
var resourceEvent:ResourceEvent;
var message:String = ("Unable to load resource module from " + url);
if (resourceEventDispatcher.willTrigger(ResourceEvent.ERROR)){
resourceEvent = new ResourceEvent(ResourceEvent.ERROR, event.bubbles, event.cancelable);
resourceEvent.bytesLoaded = 0;
resourceEvent.bytesTotal = 0;
resourceEvent.errorText = message;
resourceEventDispatcher.dispatchEvent(resourceEvent);
} else {
throw (new Error(message));
};
};
moduleInfo.addEventListener(ModuleEvent.ERROR, errorHandler, false, 0, true);
resourceModules[url] = new ResourceModuleInfo(moduleInfo, readyHandler, errorHandler);
timer = new Timer(0);
timerHandler = function (event:TimerEvent):void{
timer.removeEventListener(TimerEvent.TIMER, timerHandler);
timer.stop();
moduleInfo.load(applicationDomain, securityDomain);
};
timer.addEventListener(TimerEvent.TIMER, timerHandler, false, 0, true);
timer.start();
return (resourceEventDispatcher);
}
public function getLocales():Array{
var p:String;
var locales:Array = [];
for (p in localeMap) {
locales.push(p);
};
return (locales);
}
public function removeResourceBundlesForLocale(locale:String):void{
delete localeMap[locale];
}
public function getResourceBundle(locale:String, bundleName:String):IResourceBundle{
var bundleMap:Object = localeMap[locale];
if (!bundleMap){
return (null);
};
return (bundleMap[bundleName]);
}
private function dumpResourceModule(resourceModule):void{
var bundle:ResourceBundle;
var p:String;
for each (bundle in resourceModule.resourceBundles) {
trace(bundle.locale, bundle.bundleName);
for (p in bundle.content) {
};
};
}
public function addResourceBundle(resourceBundle:IResourceBundle):void{
var locale:String = resourceBundle.locale;
var bundleName:String = resourceBundle.bundleName;
if (!localeMap[locale]){
localeMap[locale] = {};
};
localeMap[locale][bundleName] = resourceBundle;
}
public function getObject(bundleName:String, resourceName:String, locale:String=null){
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (undefined);
};
return (resourceBundle.content[resourceName]);
}
public function getInt(bundleName:String, resourceName:String, locale:String=null):int{
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (0);
};
var value:* = resourceBundle.content[resourceName];
return (int(value));
}
private function findBundle(bundleName:String, resourceName:String, locale:String):IResourceBundle{
supportNonFrameworkApps();
return (((locale)!=null) ? getResourceBundle(locale, bundleName) : findResourceBundleWithResource(bundleName, resourceName));
}
private function supportNonFrameworkApps():void{
if (initializedForNonFrameworkApp){
return;
};
initializedForNonFrameworkApp = true;
if (getLocales().length > 0){
return;
};
var applicationDomain:ApplicationDomain = ApplicationDomain.currentDomain;
if (!applicationDomain.hasDefinition("_CompiledResourceBundleInfo")){
return;
};
var c:Class = Class(applicationDomain.getDefinition("_CompiledResourceBundleInfo"));
var locales:Array = c.compiledLocales;
var bundleNames:Array = c.compiledResourceBundleNames;
installCompiledResourceBundles(applicationDomain, locales, bundleNames);
localeChain = locales;
}
public function getBundleNamesForLocale(locale:String):Array{
var p:String;
var bundleNames:Array = [];
for (p in localeMap[locale]) {
bundleNames.push(p);
};
return (bundleNames);
}
public function getPreferredLocaleChain():Array{
return (LocaleSorter.sortLocalesByPreference(getLocales(), getSystemPreferredLocales(), null, true));
}
public function getNumber(bundleName:String, resourceName:String, locale:String=null):Number{
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (NaN);
};
var value:* = resourceBundle.content[resourceName];
return (Number(value));
}
public function update():void{
dispatchEvent(new Event(Event.CHANGE));
}
public function getClass(bundleName:String, resourceName:String, locale:String=null):Class{
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (null);
};
var value:* = resourceBundle.content[resourceName];
return ((value as Class));
}
public function removeResourceBundle(locale:String, bundleName:String):void{
delete localeMap[locale][bundleName];
if (getBundleNamesForLocale(locale).length == 0){
delete localeMap[locale];
};
}
public function initializeLocaleChain(compiledLocales:Array):void{
localeChain = LocaleSorter.sortLocalesByPreference(compiledLocales, getSystemPreferredLocales(), null, true);
}
public function findResourceBundleWithResource(bundleName:String, resourceName:String):IResourceBundle{
var locale:String;
var bundleMap:Object;
var bundle:ResourceBundle;
if (!_localeChain){
return (null);
};
var n:int = _localeChain.length;
var i:int;
while (i < n) {
locale = localeChain[i];
bundleMap = localeMap[locale];
if (!bundleMap){
} else {
bundle = bundleMap[bundleName];
if (!bundle){
} else {
if ((resourceName in bundle.content)){
return (bundle);
};
};
};
i++;
};
return (null);
}
public function getUint(bundleName:String, resourceName:String, locale:String=null):uint{
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (0);
};
var value:* = resourceBundle.content[resourceName];
return (uint(value));
}
private function getSystemPreferredLocales():Array{
var systemPreferences:Array;
if (Capabilities["languages"]){
systemPreferences = Capabilities["languages"];
} else {
systemPreferences = [Capabilities.language];
};
return (systemPreferences);
}
public function installCompiledResourceBundles(applicationDomain:ApplicationDomain, locales:Array, bundleNames:Array):void{
var locale:String;
var j:int;
var bundleName:String;
var n:int = (locales) ? locales.length : 0;
var m:int = (bundleNames) ? bundleNames.length : 0;
var i:int;
while (i < n) {
locale = locales[i];
j = 0;
while (j < m) {
bundleName = bundleNames[j];
mx_internal::installCompiledResourceBundle(applicationDomain, locale, bundleName);
j++;
};
i++;
};
}
public function getBoolean(bundleName:String, resourceName:String, locale:String=null):Boolean{
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (false);
};
var value:* = resourceBundle.content[resourceName];
return ((String(value).toLowerCase() == "true"));
}
public function unloadResourceModule(url:String, update:Boolean=true):void{
var bundles:Array;
var n:int;
var i:int;
var locale:String;
var bundleName:String;
var rmi:ResourceModuleInfo = resourceModules[url];
if (!rmi){
return;
};
if (rmi.resourceModule){
bundles = rmi.resourceModule.resourceBundles;
if (bundles){
n = bundles.length;
i = 0;
while (i < n) {
locale = bundles[i].locale;
bundleName = bundles[i].bundleName;
removeResourceBundle(locale, bundleName);
i++;
};
};
};
resourceModules[url] = null;
delete resourceModules[url];
rmi.moduleInfo.unload();
if (update){
this.update();
};
}
public static function getInstance():IResourceManager{
if (!instance){
instance = new (ResourceManagerImpl);
};
return (instance);
}
}
}//package mx.resources
import flash.events.*;
import mx.modules.*;
import mx.events.*;
class ResourceModuleInfo {
public var resourceModule:IResourceModule;
public var errorHandler:Function;
public var readyHandler:Function;
public var moduleInfo:IModuleInfo;
private function ResourceModuleInfo(moduleInfo:IModuleInfo, readyHandler:Function, errorHandler:Function){
super();
this.moduleInfo = moduleInfo;
this.readyHandler = readyHandler;
this.errorHandler = errorHandler;
}
}
class ResourceEventDispatcher extends EventDispatcher {
private function ResourceEventDispatcher(moduleInfo:IModuleInfo){
super();
moduleInfo.addEventListener(ModuleEvent.ERROR, moduleInfo_errorHandler, false, 0, true);
moduleInfo.addEventListener(ModuleEvent.PROGRESS, moduleInfo_progressHandler, false, 0, true);
moduleInfo.addEventListener(ModuleEvent.READY, moduleInfo_readyHandler, false, 0, true);
}
private function moduleInfo_progressHandler(event:ModuleEvent):void{
var resourceEvent:ResourceEvent = new ResourceEvent(ResourceEvent.PROGRESS, event.bubbles, event.cancelable);
resourceEvent.bytesLoaded = event.bytesLoaded;
resourceEvent.bytesTotal = event.bytesTotal;
dispatchEvent(resourceEvent);
}
private function moduleInfo_readyHandler(event:ModuleEvent):void{
var resourceEvent:ResourceEvent = new ResourceEvent(ResourceEvent.COMPLETE);
dispatchEvent(resourceEvent);
}
private function moduleInfo_errorHandler(event:ModuleEvent):void{
var resourceEvent:ResourceEvent = new ResourceEvent(ResourceEvent.ERROR, event.bubbles, event.cancelable);
resourceEvent.bytesLoaded = event.bytesLoaded;
resourceEvent.bytesTotal = event.bytesTotal;
resourceEvent.errorText = event.errorText;
dispatchEvent(resourceEvent);
}
}
Section 185
//HaloBorder (mx.skins.halo.HaloBorder)
package mx.skins.halo {
import mx.core.*;
import mx.styles.*;
import flash.display.*;
import mx.skins.*;
import mx.graphics.*;
import mx.utils.*;
public class HaloBorder extends RectangularBorder {
mx_internal var radiusObj:Object;
mx_internal var backgroundHole:Object;
mx_internal var radius:Number;
mx_internal var bRoundedCorners:Boolean;
mx_internal var backgroundColor:Object;
private var dropShadow:RectangularDropShadow;
protected var _borderMetrics:EdgeMetrics;
mx_internal var backgroundAlphaName:String;
mx_internal static const VERSION:String = "3.5.0.12683";
private static var BORDER_WIDTHS:Object = {none:0, solid:1, inset:2, outset:2, alert:3, dropdown:2, menuBorder:1, comboNonEdit:2};
public function HaloBorder(){
super();
BORDER_WIDTHS["default"] = 3;
}
override public function styleChanged(styleProp:String):void{
if ((((((((((styleProp == null)) || ((styleProp == "styleName")))) || ((styleProp == "borderStyle")))) || ((styleProp == "borderThickness")))) || ((styleProp == "borderSides")))){
_borderMetrics = null;
};
invalidateDisplayList();
}
override protected function updateDisplayList(w:Number, h:Number):void{
if (((isNaN(w)) || (isNaN(h)))){
return;
};
super.updateDisplayList(w, h);
backgroundColor = getBackgroundColor();
bRoundedCorners = false;
backgroundAlphaName = "backgroundAlpha";
backgroundHole = null;
radius = 0;
radiusObj = null;
drawBorder(w, h);
drawBackground(w, h);
}
mx_internal function drawBorder(w:Number, h:Number):void{
var backgroundAlpha:Number;
var borderCapColor:uint;
var borderColor:uint;
var borderSides:String;
var borderThickness:Number;
var buttonColor:uint;
var docked:Boolean;
var dropdownBorderColor:uint;
var fillColors:Array;
var footerColors:Array;
var highlightColor:uint;
var shadowCapColor:uint;
var shadowColor:uint;
var themeColor:uint;
var translucent:Boolean;
var hole:Object;
var borderColorDrk1:Number;
var borderColorDrk2:Number;
var borderColorLt1:Number;
var borderInnerColor:Object;
var contentAlpha:Number;
var br:Number;
var parentContainer:IContainer;
var vm:EdgeMetrics;
var showChrome:Boolean;
var borderAlpha:Number;
var fillAlphas:Array;
var backgroundColorNum:uint;
var bHasAllSides:Boolean;
var holeRadius:Number;
var borderStyle:String = getStyle("borderStyle");
var highlightAlphas:Array = getStyle("highlightAlphas");
var drawTopHighlight:Boolean;
var g:Graphics = graphics;
g.clear();
if (borderStyle){
switch (borderStyle){
case "none":
break;
case "inset":
borderColor = getStyle("borderColor");
borderColorDrk1 = ColorUtil.adjustBrightness2(borderColor, -40);
borderColorDrk2 = ColorUtil.adjustBrightness2(borderColor, 25);
borderColorLt1 = ColorUtil.adjustBrightness2(borderColor, 40);
borderInnerColor = backgroundColor;
if ((((borderInnerColor === null)) || ((borderInnerColor === "")))){
borderInnerColor = borderColor;
};
draw3dBorder(borderColorDrk2, borderColorDrk1, borderColorLt1, Number(borderInnerColor), Number(borderInnerColor), Number(borderInnerColor));
break;
case "outset":
borderColor = getStyle("borderColor");
borderColorDrk1 = ColorUtil.adjustBrightness2(borderColor, -40);
borderColorDrk2 = ColorUtil.adjustBrightness2(borderColor, -25);
borderColorLt1 = ColorUtil.adjustBrightness2(borderColor, 40);
borderInnerColor = backgroundColor;
if ((((borderInnerColor === null)) || ((borderInnerColor === "")))){
borderInnerColor = borderColor;
};
draw3dBorder(borderColorDrk2, borderColorLt1, borderColorDrk1, Number(borderInnerColor), Number(borderInnerColor), Number(borderInnerColor));
break;
case "alert":
case "default":
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
contentAlpha = getStyle("backgroundAlpha");
backgroundAlpha = getStyle("borderAlpha");
backgroundAlphaName = "borderAlpha";
radius = getStyle("cornerRadius");
bRoundedCorners = (getStyle("roundedBottomCorners").toString().toLowerCase() == "true");
br = (bRoundedCorners) ? radius : 0;
drawDropShadow(0, 0, w, h, radius, radius, br, br);
if (!bRoundedCorners){
radiusObj = {};
};
parentContainer = (parent as IContainer);
if (parentContainer){
vm = parentContainer.viewMetrics;
backgroundHole = {x:vm.left, y:vm.top, w:Math.max(0, ((w - vm.left) - vm.right)), h:Math.max(0, ((h - vm.top) - vm.bottom)), r:0};
if ((((backgroundHole.w > 0)) && ((backgroundHole.h > 0)))){
if (contentAlpha != backgroundAlpha){
drawDropShadow(backgroundHole.x, backgroundHole.y, backgroundHole.w, backgroundHole.h, 0, 0, 0, 0);
};
g.beginFill(Number(backgroundColor), contentAlpha);
g.drawRect(backgroundHole.x, backgroundHole.y, backgroundHole.w, backgroundHole.h);
g.endFill();
};
};
backgroundColor = getStyle("borderColor");
};
break;
case "dropdown":
dropdownBorderColor = getStyle("dropdownBorderColor");
drawDropShadow(0, 0, w, h, 4, 0, 0, 4);
drawRoundRect(0, 0, w, h, {tl:4, tr:0, br:0, bl:4}, 5068126, 1);
drawRoundRect(0, 0, w, h, {tl:4, tr:0, br:0, bl:4}, [0xFFFFFF, 0xFFFFFF], [0.7, 0], verticalGradientMatrix(0, 0, w, h));
drawRoundRect(1, 1, (w - 1), (h - 2), {tl:3, tr:0, br:0, bl:3}, 0xFFFFFF, 1);
drawRoundRect(1, 2, (w - 1), (h - 3), {tl:3, tr:0, br:0, bl:3}, [0xEEEEEE, 0xFFFFFF], 1, verticalGradientMatrix(0, 0, (w - 1), (h - 3)));
if (!isNaN(dropdownBorderColor)){
drawRoundRect(0, 0, (w + 1), h, {tl:4, tr:0, br:0, bl:4}, dropdownBorderColor, 0.5);
drawRoundRect(1, 1, (w - 1), (h - 2), {tl:3, tr:0, br:0, bl:3}, 0xFFFFFF, 1);
drawRoundRect(1, 2, (w - 1), (h - 3), {tl:3, tr:0, br:0, bl:3}, [0xEEEEEE, 0xFFFFFF], 1, verticalGradientMatrix(0, 0, (w - 1), (h - 3)));
};
backgroundColor = null;
break;
case "menuBorder":
borderColor = getStyle("borderColor");
drawRoundRect(0, 0, w, h, 0, borderColor, 1);
drawDropShadow(1, 1, (w - 2), (h - 2), 0, 0, 0, 0);
break;
case "comboNonEdit":
break;
case "controlBar":
if ((((w == 0)) || ((h == 0)))){
backgroundColor = null;
break;
};
footerColors = getStyle("footerColors");
showChrome = !((footerColors == null));
borderAlpha = getStyle("borderAlpha");
if (showChrome){
g.lineStyle(0, ((footerColors.length > 0)) ? footerColors[1] : footerColors[0], borderAlpha);
g.moveTo(0, 0);
g.lineTo(w, 0);
g.lineStyle(0, 0, 0);
if (((((parent) && (parent.parent))) && ((parent.parent is IStyleClient)))){
radius = IStyleClient(parent.parent).getStyle("cornerRadius");
borderAlpha = IStyleClient(parent.parent).getStyle("borderAlpha");
};
if (isNaN(radius)){
radius = 0;
};
if (IStyleClient(parent.parent).getStyle("roundedBottomCorners").toString().toLowerCase() != "true"){
radius = 0;
};
drawRoundRect(0, 1, w, (h - 1), {tl:0, tr:0, bl:radius, br:radius}, footerColors, borderAlpha, verticalGradientMatrix(0, 0, w, h));
if ((((footerColors.length > 1)) && (!((footerColors[0] == footerColors[1]))))){
drawRoundRect(0, 1, w, (h - 1), {tl:0, tr:0, bl:radius, br:radius}, [0xFFFFFF, 0xFFFFFF], highlightAlphas, verticalGradientMatrix(0, 0, w, h));
drawRoundRect(1, 2, (w - 2), (h - 3), {tl:0, tr:0, bl:(radius - 1), br:(radius - 1)}, footerColors, borderAlpha, verticalGradientMatrix(0, 0, w, h));
};
};
backgroundColor = null;
break;
case "applicationControlBar":
fillColors = getStyle("fillColors");
backgroundAlpha = getStyle("backgroundAlpha");
highlightAlphas = getStyle("highlightAlphas");
fillAlphas = getStyle("fillAlphas");
docked = getStyle("docked");
backgroundColorNum = uint(backgroundColor);
radius = getStyle("cornerRadius");
if (!radius){
radius = 0;
};
drawDropShadow(0, 1, w, (h - 1), radius, radius, radius, radius);
if (((!((backgroundColor === null))) && (StyleManager.isValidStyleValue(backgroundColor)))){
drawRoundRect(0, 1, w, (h - 1), radius, backgroundColorNum, backgroundAlpha, verticalGradientMatrix(0, 0, w, h));
};
drawRoundRect(0, 1, w, (h - 1), radius, fillColors, fillAlphas, verticalGradientMatrix(0, 0, w, h));
drawRoundRect(0, 1, w, ((h / 2) - 1), {tl:radius, tr:radius, bl:0, br:0}, [0xFFFFFF, 0xFFFFFF], highlightAlphas, verticalGradientMatrix(0, 0, w, ((h / 2) - 1)));
drawRoundRect(0, 1, w, (h - 1), {tl:radius, tr:radius, bl:0, br:0}, 0xFFFFFF, 0.3, null, GradientType.LINEAR, null, {x:0, y:2, w:w, h:(h - 2), r:{tl:radius, tr:radius, bl:0, br:0}});
backgroundColor = null;
break;
default:
borderColor = getStyle("borderColor");
borderThickness = getStyle("borderThickness");
borderSides = getStyle("borderSides");
bHasAllSides = true;
radius = getStyle("cornerRadius");
bRoundedCorners = (getStyle("roundedBottomCorners").toString().toLowerCase() == "true");
holeRadius = Math.max((radius - borderThickness), 0);
hole = {x:borderThickness, y:borderThickness, w:(w - (borderThickness * 2)), h:(h - (borderThickness * 2)), r:holeRadius};
if (!bRoundedCorners){
radiusObj = {tl:radius, tr:radius, bl:0, br:0};
hole.r = {tl:holeRadius, tr:holeRadius, bl:0, br:0};
};
if (borderSides != "left top right bottom"){
hole.r = {tl:holeRadius, tr:holeRadius, bl:(bRoundedCorners) ? holeRadius : 0, br:(bRoundedCorners) ? holeRadius : 0};
radiusObj = {tl:radius, tr:radius, bl:(bRoundedCorners) ? radius : 0, br:(bRoundedCorners) ? radius : 0};
borderSides = borderSides.toLowerCase();
if (borderSides.indexOf("left") == -1){
hole.x = 0;
hole.w = (hole.w + borderThickness);
hole.r.tl = 0;
hole.r.bl = 0;
radiusObj.tl = 0;
radiusObj.bl = 0;
bHasAllSides = false;
};
if (borderSides.indexOf("top") == -1){
hole.y = 0;
hole.h = (hole.h + borderThickness);
hole.r.tl = 0;
hole.r.tr = 0;
radiusObj.tl = 0;
radiusObj.tr = 0;
bHasAllSides = false;
};
if (borderSides.indexOf("right") == -1){
hole.w = (hole.w + borderThickness);
hole.r.tr = 0;
hole.r.br = 0;
radiusObj.tr = 0;
radiusObj.br = 0;
bHasAllSides = false;
};
if (borderSides.indexOf("bottom") == -1){
hole.h = (hole.h + borderThickness);
hole.r.bl = 0;
hole.r.br = 0;
radiusObj.bl = 0;
radiusObj.br = 0;
bHasAllSides = false;
};
};
if ((((radius == 0)) && (bHasAllSides))){
drawDropShadow(0, 0, w, h, 0, 0, 0, 0);
g.beginFill(borderColor);
g.drawRect(0, 0, w, h);
g.drawRect(borderThickness, borderThickness, (w - (2 * borderThickness)), (h - (2 * borderThickness)));
g.endFill();
} else {
if (radiusObj){
drawDropShadow(0, 0, w, h, radiusObj.tl, radiusObj.tr, radiusObj.br, radiusObj.bl);
drawRoundRect(0, 0, w, h, radiusObj, borderColor, 1, null, null, null, hole);
radiusObj.tl = Math.max((radius - borderThickness), 0);
radiusObj.tr = Math.max((radius - borderThickness), 0);
radiusObj.bl = (bRoundedCorners) ? Math.max((radius - borderThickness), 0) : 0;
radiusObj.br = (bRoundedCorners) ? Math.max((radius - borderThickness), 0) : 0;
} else {
drawDropShadow(0, 0, w, h, radius, radius, radius, radius);
drawRoundRect(0, 0, w, h, radius, borderColor, 1, null, null, null, hole);
radius = Math.max((getStyle("cornerRadius") - borderThickness), 0);
};
};
};
};
}
mx_internal function drawBackground(w:Number, h:Number):void{
var nd:Number;
var alpha:Number;
var bm:EdgeMetrics;
var g:Graphics;
var bottom:Number;
var topRadius:Number;
var bottomRadius:Number;
var highlightAlphas:Array;
var highlightAlpha:Number;
if (((((((!((backgroundColor === null))) && (!((backgroundColor === ""))))) || (getStyle("mouseShield")))) || (getStyle("mouseShieldChildren")))){
nd = Number(backgroundColor);
alpha = 1;
bm = getBackgroundColorMetrics();
g = graphics;
if (((((isNaN(nd)) || ((backgroundColor === "")))) || ((backgroundColor === null)))){
alpha = 0;
nd = 0xFFFFFF;
} else {
alpha = getStyle(backgroundAlphaName);
};
if (((!((radius == 0))) || (backgroundHole))){
bottom = bm.bottom;
if (radiusObj){
topRadius = Math.max((radius - Math.max(bm.top, bm.left, bm.right)), 0);
bottomRadius = (bRoundedCorners) ? Math.max((radius - Math.max(bm.bottom, bm.left, bm.right)), 0) : 0;
radiusObj = {tl:topRadius, tr:topRadius, bl:bottomRadius, br:bottomRadius};
drawRoundRect(bm.left, bm.top, (width - (bm.left + bm.right)), (height - (bm.top + bottom)), radiusObj, nd, alpha, null, GradientType.LINEAR, null, backgroundHole);
} else {
drawRoundRect(bm.left, bm.top, (width - (bm.left + bm.right)), (height - (bm.top + bottom)), radius, nd, alpha, null, GradientType.LINEAR, null, backgroundHole);
};
} else {
g.beginFill(nd, alpha);
g.drawRect(bm.left, bm.top, ((w - bm.right) - bm.left), ((h - bm.bottom) - bm.top));
g.endFill();
};
};
var borderStyle:String = getStyle("borderStyle");
if ((((((FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)) && ((((borderStyle == "alert")) || ((borderStyle == "default")))))) && ((getStyle("headerColors") == null)))){
highlightAlphas = getStyle("highlightAlphas");
highlightAlpha = (highlightAlphas) ? highlightAlphas[0] : 0.3;
drawRoundRect(0, 0, w, h, {tl:radius, tr:radius, bl:0, br:0}, 0xFFFFFF, highlightAlpha, null, GradientType.LINEAR, null, {x:0, y:1, w:w, h:(h - 1), r:{tl:radius, tr:radius, bl:0, br:0}});
};
}
mx_internal function drawDropShadow(x:Number, y:Number, width:Number, height:Number, tlRadius:Number, trRadius:Number, brRadius:Number, blRadius:Number):void{
var angle:Number;
var docked:Boolean;
if ((((((((getStyle("dropShadowEnabled") == false)) || ((getStyle("dropShadowEnabled") == "false")))) || ((width == 0)))) || ((height == 0)))){
return;
};
var distance:Number = getStyle("shadowDistance");
var direction:String = getStyle("shadowDirection");
if (getStyle("borderStyle") == "applicationControlBar"){
docked = getStyle("docked");
angle = (docked) ? 90 : getDropShadowAngle(distance, direction);
distance = Math.abs(distance);
} else {
angle = getDropShadowAngle(distance, direction);
distance = (Math.abs(distance) + 2);
};
if (!dropShadow){
dropShadow = new RectangularDropShadow();
};
dropShadow.distance = distance;
dropShadow.angle = angle;
dropShadow.color = getStyle("dropShadowColor");
dropShadow.alpha = 0.4;
dropShadow.tlRadius = tlRadius;
dropShadow.trRadius = trRadius;
dropShadow.blRadius = blRadius;
dropShadow.brRadius = brRadius;
dropShadow.drawShadow(graphics, x, y, width, height);
}
mx_internal function getBackgroundColor():Object{
var color:Object;
var p:IUIComponent = (parent as IUIComponent);
if (((p) && (!(p.enabled)))){
color = getStyle("backgroundDisabledColor");
if (((!((color === null))) && (StyleManager.isValidStyleValue(color)))){
return (color);
};
};
return (getStyle("backgroundColor"));
}
mx_internal function draw3dBorder(c1:Number, c2:Number, c3:Number, c4:Number, c5:Number, c6:Number):void{
var w:Number = width;
var h:Number = height;
drawDropShadow(0, 0, width, height, 0, 0, 0, 0);
var g:Graphics = graphics;
g.beginFill(c1);
g.drawRect(0, 0, w, h);
g.drawRect(1, 0, (w - 2), h);
g.endFill();
g.beginFill(c2);
g.drawRect(1, 0, (w - 2), 1);
g.endFill();
g.beginFill(c3);
g.drawRect(1, (h - 1), (w - 2), 1);
g.endFill();
g.beginFill(c4);
g.drawRect(1, 1, (w - 2), 1);
g.endFill();
g.beginFill(c5);
g.drawRect(1, (h - 2), (w - 2), 1);
g.endFill();
g.beginFill(c6);
g.drawRect(1, 2, (w - 2), (h - 4));
g.drawRect(2, 2, (w - 4), (h - 4));
g.endFill();
}
mx_internal function getBackgroundColorMetrics():EdgeMetrics{
return (borderMetrics);
}
mx_internal function getDropShadowAngle(distance:Number, direction:String):Number{
if (direction == "left"){
return (((distance >= 0)) ? 135 : 225);
} else {
if (direction == "right"){
return (((distance >= 0)) ? 45 : 315);
//unresolved jump
};
};
return (!NULL!);
}
override public function get borderMetrics():EdgeMetrics{
var borderThickness:Number;
var borderSides:String;
if (_borderMetrics){
return (_borderMetrics);
};
var borderStyle:String = getStyle("borderStyle");
if ((((borderStyle == "default")) || ((borderStyle == "alert")))){
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
_borderMetrics = new EdgeMetrics(0, 0, 0, 0);
} else {
return (EdgeMetrics.EMPTY);
};
} else {
if ((((borderStyle == "controlBar")) || ((borderStyle == "applicationControlBar")))){
_borderMetrics = new EdgeMetrics(1, 1, 1, 1);
} else {
if (borderStyle == "solid"){
borderThickness = getStyle("borderThickness");
if (isNaN(borderThickness)){
borderThickness = 0;
};
_borderMetrics = new EdgeMetrics(borderThickness, borderThickness, borderThickness, borderThickness);
borderSides = getStyle("borderSides");
if (borderSides != "left top right bottom"){
if (borderSides.indexOf("left") == -1){
_borderMetrics.left = 0;
};
if (borderSides.indexOf("top") == -1){
_borderMetrics.top = 0;
};
if (borderSides.indexOf("right") == -1){
_borderMetrics.right = 0;
};
if (borderSides.indexOf("bottom") == -1){
_borderMetrics.bottom = 0;
};
};
} else {
borderThickness = BORDER_WIDTHS[borderStyle];
if (isNaN(borderThickness)){
borderThickness = 0;
};
_borderMetrics = new EdgeMetrics(borderThickness, borderThickness, borderThickness, borderThickness);
};
};
};
return (_borderMetrics);
}
}
}//package mx.skins.halo
Section 186
//HaloFocusRect (mx.skins.halo.HaloFocusRect)
package mx.skins.halo {
import mx.styles.*;
import flash.display.*;
import mx.skins.*;
import mx.utils.*;
public class HaloFocusRect extends ProgrammaticSkin implements IStyleClient {
private var _focusColor:Number;
mx_internal static const VERSION:String = "3.5.0.12683";
public function HaloFocusRect(){
super();
}
public function get inheritingStyles():Object{
return (styleName.inheritingStyles);
}
public function set inheritingStyles(value:Object):void{
}
public function notifyStyleChangeInChildren(styleProp:String, recursive:Boolean):void{
}
public function registerEffects(effects:Array):void{
}
public function regenerateStyleCache(recursive:Boolean):void{
}
public function get styleDeclaration():CSSStyleDeclaration{
return (CSSStyleDeclaration(styleName));
}
public function getClassStyleDeclarations():Array{
return ([]);
}
public function get className():String{
return ("HaloFocusRect");
}
public function clearStyle(styleProp:String):void{
if (styleProp == "focusColor"){
_focusColor = NaN;
};
}
public function setStyle(styleProp:String, newValue):void{
if (styleProp == "focusColor"){
_focusColor = newValue;
};
}
public function set nonInheritingStyles(value:Object):void{
}
public function get nonInheritingStyles():Object{
return (styleName.nonInheritingStyles);
}
override protected function updateDisplayList(w:Number, h:Number):void{
var tl:Number;
var bl:Number;
var tr:Number;
var br:Number;
var nr:Number;
var ellipseSize:Number;
super.updateDisplayList(w, h);
var focusBlendMode:String = getStyle("focusBlendMode");
var focusAlpha:Number = getStyle("focusAlpha");
var focusColor:Number = getStyle("focusColor");
var cornerRadius:Number = getStyle("cornerRadius");
var focusThickness:Number = getStyle("focusThickness");
var focusRoundedCorners:String = getStyle("focusRoundedCorners");
var themeColor:Number = getStyle("themeColor");
var rectColor:Number = focusColor;
if (isNaN(rectColor)){
rectColor = themeColor;
};
var g:Graphics = graphics;
g.clear();
if (focusBlendMode){
blendMode = focusBlendMode;
};
if (((!((focusRoundedCorners == "tl tr bl br"))) && ((cornerRadius > 0)))){
tl = 0;
bl = 0;
tr = 0;
br = 0;
nr = (cornerRadius + focusThickness);
if (focusRoundedCorners.indexOf("tl") >= 0){
tl = nr;
};
if (focusRoundedCorners.indexOf("tr") >= 0){
tr = nr;
};
if (focusRoundedCorners.indexOf("bl") >= 0){
bl = nr;
};
if (focusRoundedCorners.indexOf("br") >= 0){
br = nr;
};
g.beginFill(rectColor, focusAlpha);
GraphicsUtil.drawRoundRectComplex(g, 0, 0, w, h, tl, tr, bl, br);
tl = (tl) ? cornerRadius : 0;
tr = (tr) ? cornerRadius : 0;
bl = (bl) ? cornerRadius : 0;
br = (br) ? cornerRadius : 0;
GraphicsUtil.drawRoundRectComplex(g, focusThickness, focusThickness, (w - (2 * focusThickness)), (h - (2 * focusThickness)), tl, tr, bl, br);
g.endFill();
nr = (cornerRadius + (focusThickness / 2));
tl = (tl) ? nr : 0;
tr = (tr) ? nr : 0;
bl = (bl) ? nr : 0;
br = (br) ? nr : 0;
g.beginFill(rectColor, focusAlpha);
GraphicsUtil.drawRoundRectComplex(g, (focusThickness / 2), (focusThickness / 2), (w - focusThickness), (h - focusThickness), tl, tr, bl, br);
tl = (tl) ? cornerRadius : 0;
tr = (tr) ? cornerRadius : 0;
bl = (bl) ? cornerRadius : 0;
br = (br) ? cornerRadius : 0;
GraphicsUtil.drawRoundRectComplex(g, focusThickness, focusThickness, (w - (2 * focusThickness)), (h - (2 * focusThickness)), tl, tr, bl, br);
g.endFill();
} else {
g.beginFill(rectColor, focusAlpha);
ellipseSize = (((cornerRadius > 0)) ? (cornerRadius + focusThickness) : 0 * 2);
g.drawRoundRect(0, 0, w, h, ellipseSize, ellipseSize);
ellipseSize = (cornerRadius * 2);
g.drawRoundRect(focusThickness, focusThickness, (w - (2 * focusThickness)), (h - (2 * focusThickness)), ellipseSize, ellipseSize);
g.endFill();
g.beginFill(rectColor, focusAlpha);
ellipseSize = (((cornerRadius > 0)) ? (cornerRadius + (focusThickness / 2)) : 0 * 2);
g.drawRoundRect((focusThickness / 2), (focusThickness / 2), (w - focusThickness), (h - focusThickness), ellipseSize, ellipseSize);
ellipseSize = (cornerRadius * 2);
g.drawRoundRect(focusThickness, focusThickness, (w - (2 * focusThickness)), (h - (2 * focusThickness)), ellipseSize, ellipseSize);
g.endFill();
};
}
override public function getStyle(styleProp:String){
return (((styleProp == "focusColor")) ? _focusColor : super.getStyle(styleProp));
}
public function set styleDeclaration(value:CSSStyleDeclaration):void{
}
}
}//package mx.skins.halo
Section 187
//Border (mx.skins.Border)
package mx.skins {
import mx.core.*;
public class Border extends ProgrammaticSkin implements IBorder {
mx_internal static const VERSION:String = "3.5.0.12683";
public function Border(){
super();
}
public function get borderMetrics():EdgeMetrics{
return (EdgeMetrics.EMPTY);
}
}
}//package mx.skins
Section 188
//ProgrammaticSkin (mx.skins.ProgrammaticSkin)
package mx.skins {
import mx.core.*;
import mx.styles.*;
import flash.display.*;
import flash.geom.*;
import mx.managers.*;
import mx.utils.*;
public class ProgrammaticSkin extends FlexShape implements IFlexDisplayObject, IInvalidating, ILayoutManagerClient, ISimpleStyleClient, IProgrammaticSkin {
private var _initialized:Boolean;// = false
private var _height:Number;
private var invalidateDisplayListFlag:Boolean;// = false
private var _styleName:IStyleClient;
private var _nestLevel:int;// = 0
private var _processedDescriptors:Boolean;// = false
private var _updateCompletePendingFlag:Boolean;// = true
private var _width:Number;
mx_internal static const VERSION:String = "3.5.0.12683";
private static var tempMatrix:Matrix = new Matrix();
public function ProgrammaticSkin(){
super();
_width = measuredWidth;
_height = measuredHeight;
}
public function getStyle(styleProp:String){
return ((_styleName) ? _styleName.getStyle(styleProp) : null);
}
protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
}
public function get nestLevel():int{
return (_nestLevel);
}
public function set nestLevel(value:int):void{
_nestLevel = value;
invalidateDisplayList();
}
override public function get height():Number{
return (_height);
}
public function get updateCompletePendingFlag():Boolean{
return (_updateCompletePendingFlag);
}
protected function verticalGradientMatrix(x:Number, y:Number, width:Number, height:Number):Matrix{
return (rotatedGradientMatrix(x, y, width, height, 90));
}
public function validateSize(recursive:Boolean=false):void{
}
public function invalidateDisplayList():void{
if (((!(invalidateDisplayListFlag)) && ((nestLevel > 0)))){
invalidateDisplayListFlag = true;
UIComponentGlobals.layoutManager.invalidateDisplayList(this);
};
}
public function set updateCompletePendingFlag(value:Boolean):void{
_updateCompletePendingFlag = value;
}
protected function horizontalGradientMatrix(x:Number, y:Number, width:Number, height:Number):Matrix{
return (rotatedGradientMatrix(x, y, width, height, 0));
}
override public function set height(value:Number):void{
_height = value;
invalidateDisplayList();
}
public function set processedDescriptors(value:Boolean):void{
_processedDescriptors = value;
}
public function validateDisplayList():void{
invalidateDisplayListFlag = false;
updateDisplayList(width, height);
}
public function get measuredWidth():Number{
return (0);
}
override public function set width(value:Number):void{
_width = value;
invalidateDisplayList();
}
public function get measuredHeight():Number{
return (0);
}
public function set initialized(value:Boolean):void{
_initialized = value;
}
protected function drawRoundRect(x:Number, y:Number, width:Number, height:Number, cornerRadius:Object=null, color:Object=null, alpha:Object=null, gradientMatrix:Matrix=null, gradientType:String="linear", gradientRatios:Array=null, hole:Object=null):void{
var ellipseSize:Number;
var alphas:Array;
var holeR:Object;
var g:Graphics = graphics;
if ((((width == 0)) || ((height == 0)))){
return;
};
if (color !== null){
if ((color is uint)){
g.beginFill(uint(color), Number(alpha));
} else {
if ((color is Array)){
alphas = ((alpha is Array)) ? (alpha as Array) : [alpha, alpha];
if (!gradientRatios){
gradientRatios = [0, 0xFF];
};
g.beginGradientFill(gradientType, (color as Array), alphas, gradientRatios, gradientMatrix);
};
};
};
if (!cornerRadius){
g.drawRect(x, y, width, height);
} else {
if ((cornerRadius is Number)){
ellipseSize = (Number(cornerRadius) * 2);
g.drawRoundRect(x, y, width, height, ellipseSize, ellipseSize);
} else {
GraphicsUtil.drawRoundRectComplex(g, x, y, width, height, cornerRadius.tl, cornerRadius.tr, cornerRadius.bl, cornerRadius.br);
};
};
if (hole){
holeR = hole.r;
if ((holeR is Number)){
ellipseSize = (Number(holeR) * 2);
g.drawRoundRect(hole.x, hole.y, hole.w, hole.h, ellipseSize, ellipseSize);
} else {
GraphicsUtil.drawRoundRectComplex(g, hole.x, hole.y, hole.w, hole.h, holeR.tl, holeR.tr, holeR.bl, holeR.br);
};
};
if (color !== null){
g.endFill();
};
}
public function get processedDescriptors():Boolean{
return (_processedDescriptors);
}
public function set styleName(value:Object):void{
if (_styleName != value){
_styleName = (value as IStyleClient);
invalidateDisplayList();
};
}
public function setActualSize(newWidth:Number, newHeight:Number):void{
var changed:Boolean;
if (_width != newWidth){
_width = newWidth;
changed = true;
};
if (_height != newHeight){
_height = newHeight;
changed = true;
};
if (changed){
invalidateDisplayList();
};
}
public function styleChanged(styleProp:String):void{
invalidateDisplayList();
}
override public function get width():Number{
return (_width);
}
public function invalidateProperties():void{
}
public function get initialized():Boolean{
return (_initialized);
}
protected function rotatedGradientMatrix(x:Number, y:Number, width:Number, height:Number, rotation:Number):Matrix{
tempMatrix.createGradientBox(width, height, ((rotation * Math.PI) / 180), x, y);
return (tempMatrix);
}
public function move(x:Number, y:Number):void{
this.x = x;
this.y = y;
}
public function get styleName():Object{
return (_styleName);
}
public function validateNow():void{
if (invalidateDisplayListFlag){
validateDisplayList();
};
}
public function invalidateSize():void{
}
public function validateProperties():void{
}
}
}//package mx.skins
Section 189
//RectangularBorder (mx.skins.RectangularBorder)
package mx.skins {
import mx.core.*;
import flash.events.*;
import flash.utils.*;
import mx.styles.*;
import flash.system.*;
import flash.display.*;
import flash.geom.*;
import mx.resources.*;
import flash.net.*;
public class RectangularBorder extends Border implements IRectangularBorder {
private var backgroundImage:DisplayObject;
private var backgroundImageHeight:Number;
private var _backgroundImageBounds:Rectangle;
private var backgroundImageStyle:Object;
private var backgroundImageWidth:Number;
private var resourceManager:IResourceManager;
mx_internal static const VERSION:String = "3.5.0.12683";
public function RectangularBorder(){
resourceManager = ResourceManager.getInstance();
super();
addEventListener(Event.REMOVED, removedHandler);
}
public function layoutBackgroundImage():void{
var sW:Number;
var sH:Number;
var sX:Number;
var sY:Number;
var scale:Number;
var g:Graphics;
var p:DisplayObject = parent;
var bm:EdgeMetrics = ((p is IContainer)) ? IContainer(p).viewMetrics : borderMetrics;
var scrollableBk = !((getStyle("backgroundAttachment") == "fixed"));
if (_backgroundImageBounds){
sW = _backgroundImageBounds.width;
sH = _backgroundImageBounds.height;
} else {
sW = ((width - bm.left) - bm.right);
sH = ((height - bm.top) - bm.bottom);
};
var percentage:Number = getBackgroundSize();
if (isNaN(percentage)){
sX = 1;
sY = 1;
} else {
scale = (percentage * 0.01);
sX = ((scale * sW) / backgroundImageWidth);
sY = ((scale * sH) / backgroundImageHeight);
};
backgroundImage.scaleX = sX;
backgroundImage.scaleY = sY;
var offsetX:Number = Math.round((0.5 * (sW - (backgroundImageWidth * sX))));
var offsetY:Number = Math.round((0.5 * (sH - (backgroundImageHeight * sY))));
backgroundImage.x = bm.left;
backgroundImage.y = bm.top;
var backgroundMask:Shape = Shape(backgroundImage.mask);
backgroundMask.x = bm.left;
backgroundMask.y = bm.top;
if (((scrollableBk) && ((p is IContainer)))){
offsetX = (offsetX - IContainer(p).horizontalScrollPosition);
offsetY = (offsetY - IContainer(p).verticalScrollPosition);
};
backgroundImage.alpha = getStyle("backgroundAlpha");
backgroundImage.x = (backgroundImage.x + offsetX);
backgroundImage.y = (backgroundImage.y + offsetY);
var maskWidth:Number = ((width - bm.left) - bm.right);
var maskHeight:Number = ((height - bm.top) - bm.bottom);
if (((!((backgroundMask.width == maskWidth))) || (!((backgroundMask.height == maskHeight))))){
g = backgroundMask.graphics;
g.clear();
g.beginFill(0xFFFFFF);
g.drawRect(0, 0, maskWidth, maskHeight);
g.endFill();
};
}
public function set backgroundImageBounds(value:Rectangle):void{
if (((((_backgroundImageBounds) && (value))) && (_backgroundImageBounds.equals(value)))){
return;
};
_backgroundImageBounds = value;
invalidateDisplayList();
}
private function getBackgroundSize():Number{
var index:int;
var percentage:Number = NaN;
var backgroundSize:Object = getStyle("backgroundSize");
if (((backgroundSize) && ((backgroundSize is String)))){
index = backgroundSize.indexOf("%");
if (index != -1){
percentage = Number(backgroundSize.substr(0, index));
};
};
return (percentage);
}
private function removedHandler(event:Event):void{
var childrenList:IChildList;
if (backgroundImage){
childrenList = ((parent is IRawChildrenContainer)) ? IRawChildrenContainer(parent).rawChildren : IChildList(parent);
childrenList.removeChild(backgroundImage.mask);
childrenList.removeChild(backgroundImage);
backgroundImage = null;
};
}
private function initBackgroundImage(image:DisplayObject):void{
backgroundImage = image;
if ((image is Loader)){
backgroundImageWidth = Loader(image).contentLoaderInfo.width;
backgroundImageHeight = Loader(image).contentLoaderInfo.height;
} else {
backgroundImageWidth = backgroundImage.width;
backgroundImageHeight = backgroundImage.height;
if ((image is ISimpleStyleClient)){
ISimpleStyleClient(image).styleName = styleName;
};
};
var childrenList:IChildList = ((parent is IRawChildrenContainer)) ? IRawChildrenContainer(parent).rawChildren : IChildList(parent);
var backgroundMask:Shape = new FlexShape();
backgroundMask.name = "backgroundMask";
backgroundMask.x = 0;
backgroundMask.y = 0;
childrenList.addChild(backgroundMask);
var myIndex:int = childrenList.getChildIndex(this);
childrenList.addChildAt(backgroundImage, (myIndex + 1));
backgroundImage.mask = backgroundMask;
}
public function get backgroundImageBounds():Rectangle{
return (_backgroundImageBounds);
}
public function get hasBackgroundImage():Boolean{
return (!((backgroundImage == null)));
}
private function completeEventHandler(event:Event):void{
if (!parent){
return;
};
var target:DisplayObject = DisplayObject(LoaderInfo(event.target).loader);
initBackgroundImage(target);
layoutBackgroundImage();
dispatchEvent(event.clone());
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
var cls:Class;
var newStyleObj:DisplayObject;
var loader:Loader;
var loaderContext:LoaderContext;
var message:String;
var unscaledWidth = unscaledWidth;
var unscaledHeight = unscaledHeight;
if (!parent){
return;
};
var newStyle:Object = getStyle("backgroundImage");
if (newStyle != backgroundImageStyle){
removedHandler(null);
backgroundImageStyle = newStyle;
if (((newStyle) && ((newStyle as Class)))){
cls = Class(newStyle);
initBackgroundImage(new (cls));
} else {
if (((newStyle) && ((newStyle is String)))){
cls = Class(getDefinitionByName(String(newStyle)));
//unresolved jump
var _slot1 = e;
if (cls){
newStyleObj = new (cls);
initBackgroundImage(newStyleObj);
} else {
loader = new FlexLoader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeEventHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorEventHandler);
loader.contentLoaderInfo.addEventListener(ErrorEvent.ERROR, errorEventHandler);
loaderContext = new LoaderContext();
loaderContext.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
loader.load(new URLRequest(String(newStyle)), loaderContext);
};
} else {
if (newStyle){
message = resourceManager.getString("skins", "notLoaded", [newStyle]);
throw (new Error(message));
};
};
};
};
if (backgroundImage){
layoutBackgroundImage();
};
}
private function errorEventHandler(event:Event):void{
}
}
}//package mx.skins
Section 190
//CSSStyleDeclaration (mx.styles.CSSStyleDeclaration)
package mx.styles {
import mx.core.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import mx.managers.*;
public class CSSStyleDeclaration extends EventDispatcher {
mx_internal var effects:Array;
protected var overrides:Object;
public var defaultFactory:Function;
public var factory:Function;
mx_internal var selectorRefCount:int;// = 0
private var styleManager:IStyleManager2;
private var clones:Dictionary;
mx_internal static const VERSION:String = "3.5.0.12683";
private static const NOT_A_COLOR:uint = 4294967295;
private static const FILTERMAP_PROP:String = "__reserved__filterMap";
public function CSSStyleDeclaration(selector:String=null){
clones = new Dictionary(true);
super();
if (selector){
styleManager = (Singleton.getInstance("mx.styles::IStyleManager2") as IStyleManager2);
styleManager.setStyleDeclaration(selector, this, false);
};
}
mx_internal function addStyleToProtoChain(chain:Object, target:DisplayObject, filterMap:Object=null):Object{
var p:String;
var emptyObjectFactory:Function;
var filteredChain:Object;
var filterObjectFactory:Function;
var i:String;
var chain = chain;
var target = target;
var filterMap = filterMap;
var nodeAddedToChain:Boolean;
var originalChain:Object = chain;
if (filterMap){
chain = {};
};
if (defaultFactory != null){
defaultFactory.prototype = chain;
chain = new defaultFactory();
nodeAddedToChain = true;
};
if (factory != null){
factory.prototype = chain;
chain = new factory();
nodeAddedToChain = true;
};
if (overrides){
if ((((defaultFactory == null)) && ((factory == null)))){
emptyObjectFactory = function ():void{
};
emptyObjectFactory.prototype = chain;
chain = new (emptyObjectFactory);
nodeAddedToChain = true;
};
for (p in overrides) {
if (overrides[p] === undefined){
delete chain[p];
} else {
chain[p] = overrides[p];
};
};
};
if (filterMap){
if (nodeAddedToChain){
filteredChain = {};
filterObjectFactory = function ():void{
};
filterObjectFactory.prototype = originalChain;
filteredChain = new (filterObjectFactory);
for (i in chain) {
if (filterMap[i] != null){
filteredChain[filterMap[i]] = chain[i];
};
};
chain = filteredChain;
chain[FILTERMAP_PROP] = filterMap;
} else {
chain = originalChain;
};
};
if (nodeAddedToChain){
clones[chain] = 1;
};
return (chain);
}
public function getStyle(styleProp:String){
var o:*;
var v:*;
if (overrides){
if ((((styleProp in overrides)) && ((overrides[styleProp] === undefined)))){
return (undefined);
};
v = overrides[styleProp];
if (v !== undefined){
return (v);
};
};
if (factory != null){
factory.prototype = {};
o = new factory();
v = o[styleProp];
if (v !== undefined){
return (v);
};
};
if (defaultFactory != null){
defaultFactory.prototype = {};
o = new defaultFactory();
v = o[styleProp];
if (v !== undefined){
return (v);
};
};
return (undefined);
}
public function clearStyle(styleProp:String):void{
setStyle(styleProp, undefined);
}
public function setStyle(styleProp:String, newValue):void{
var i:int;
var sm:Object;
var oldValue:Object = getStyle(styleProp);
var regenerate:Boolean;
if ((((((((((selectorRefCount > 0)) && ((factory == null)))) && ((defaultFactory == null)))) && (!(overrides)))) && (!((oldValue === newValue))))){
regenerate = true;
};
if (newValue !== undefined){
setStyle(styleProp, newValue);
} else {
if (newValue == oldValue){
return;
};
setStyle(styleProp, newValue);
};
var sms:Array = SystemManagerGlobals.topLevelSystemManagers;
var n:int = sms.length;
if (regenerate){
i = 0;
while (i < n) {
sm = sms[i];
sm.regenerateStyleCache(true);
i++;
};
};
i = 0;
while (i < n) {
sm = sms[i];
sm.notifyStyleChangeInChildren(styleProp, true);
i++;
};
}
private function clearStyleAttr(styleProp:String):void{
var clone:*;
if (!overrides){
overrides = {};
};
overrides[styleProp] = undefined;
for (clone in clones) {
delete clone[styleProp];
};
}
mx_internal function createProtoChainRoot():Object{
var root:Object = {};
if (defaultFactory != null){
defaultFactory.prototype = root;
root = new defaultFactory();
};
if (factory != null){
factory.prototype = root;
root = new factory();
};
clones[root] = 1;
return (root);
}
mx_internal function clearOverride(styleProp:String):void{
if (((overrides) && (overrides[styleProp]))){
delete overrides[styleProp];
};
}
mx_internal function setStyle(styleProp:String, value):void{
var o:Object;
var clone:*;
var colorNumber:Number;
var cloneFilter:Object;
if (value === undefined){
clearStyleAttr(styleProp);
return;
};
if ((value is String)){
if (!styleManager){
styleManager = (Singleton.getInstance("mx.styles::IStyleManager2") as IStyleManager2);
};
colorNumber = styleManager.getColorName(value);
if (colorNumber != NOT_A_COLOR){
value = colorNumber;
};
};
if (defaultFactory != null){
o = new defaultFactory();
if (o[styleProp] !== value){
if (!overrides){
overrides = {};
};
overrides[styleProp] = value;
} else {
if (overrides){
delete overrides[styleProp];
};
};
};
if (factory != null){
o = new factory();
if (o[styleProp] !== value){
if (!overrides){
overrides = {};
};
overrides[styleProp] = value;
} else {
if (overrides){
delete overrides[styleProp];
};
};
};
if ((((defaultFactory == null)) && ((factory == null)))){
if (!overrides){
overrides = {};
};
overrides[styleProp] = value;
};
for (clone in clones) {
cloneFilter = clone[FILTERMAP_PROP];
if (cloneFilter){
if (cloneFilter[styleProp] != null){
clone[cloneFilter[styleProp]] = value;
};
} else {
clone[styleProp] = value;
};
};
}
}
}//package mx.styles
Section 191
//ISimpleStyleClient (mx.styles.ISimpleStyleClient)
package mx.styles {
public interface ISimpleStyleClient {
function set styleName(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\styles;ISimpleStyleClient.as:Object):void;
function styleChanged(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\styles;ISimpleStyleClient.as:String):void;
function get styleName():Object;
}
}//package mx.styles
Section 192
//IStyleClient (mx.styles.IStyleClient)
package mx.styles {
public interface IStyleClient extends ISimpleStyleClient {
function regenerateStyleCache(mx.styles:IStyleClient/mx.styles:IStyleClient:className/get:Boolean):void;
function get className():String;
function clearStyle(mx.styles:IStyleClient/mx.styles:IStyleClient:className/get:String):void;
function getClassStyleDeclarations():Array;
function get inheritingStyles():Object;
function set nonInheritingStyles(mx.styles:IStyleClient/mx.styles:IStyleClient:className/get:Object):void;
function setStyle(_arg1:String, _arg2):void;
function get styleDeclaration():CSSStyleDeclaration;
function set styleDeclaration(mx.styles:IStyleClient/mx.styles:IStyleClient:className/get:CSSStyleDeclaration):void;
function get nonInheritingStyles():Object;
function set inheritingStyles(mx.styles:IStyleClient/mx.styles:IStyleClient:className/get:Object):void;
function getStyle(*:String);
function notifyStyleChangeInChildren(_arg1:String, _arg2:Boolean):void;
function registerEffects(mx.styles:IStyleClient/mx.styles:IStyleClient:className/get:Array):void;
}
}//package mx.styles
Section 193
//IStyleManager (mx.styles.IStyleManager)
package mx.styles {
import flash.events.*;
public interface IStyleManager {
function isColorName(value:String):Boolean;
function registerParentDisplayListInvalidatingStyle(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void;
function registerInheritingStyle(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void;
function set stylesRoot(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:Object):void;
function get typeSelectorCache():Object;
function styleDeclarationsChanged():void;
function setStyleDeclaration(_arg1:String, _arg2:CSSStyleDeclaration, _arg3:Boolean):void;
function isParentDisplayListInvalidatingStyle(value:String):Boolean;
function isSizeInvalidatingStyle(value:String):Boolean;
function get inheritingStyles():Object;
function isValidStyleValue(value):Boolean;
function isParentSizeInvalidatingStyle(value:String):Boolean;
function getColorName(mx.styles:IStyleManager/mx.styles:IStyleManager:inheritingStyles/set:Object):uint;
function set typeSelectorCache(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:Object):void;
function unloadStyleDeclarations(_arg1:String, _arg2:Boolean=true):void;
function getColorNames(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:Array):void;
function loadStyleDeclarations(_arg1:String, _arg2:Boolean=true, _arg3:Boolean=false):IEventDispatcher;
function isInheritingStyle(value:String):Boolean;
function set inheritingStyles(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:Object):void;
function get stylesRoot():Object;
function initProtoChainRoots():void;
function registerColorName(_arg1:String, _arg2:uint):void;
function registerParentSizeInvalidatingStyle(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void;
function registerSizeInvalidatingStyle(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void;
function clearStyleDeclaration(_arg1:String, _arg2:Boolean):void;
function isInheritingTextFormatStyle(value:String):Boolean;
function getStyleDeclaration(mx.styles:IStyleManager/mx.styles:IStyleManager:inheritingStyles/get:String):CSSStyleDeclaration;
}
}//package mx.styles
Section 194
//IStyleManager2 (mx.styles.IStyleManager2)
package mx.styles {
import flash.events.*;
import flash.system.*;
public interface IStyleManager2 extends IStyleManager {
function get selectors():Array;
function loadStyleDeclarations2(_arg1:String, _arg2:Boolean=true, _arg3:ApplicationDomain=null, _arg4:SecurityDomain=null):IEventDispatcher;
}
}//package mx.styles
Section 195
//IStyleModule (mx.styles.IStyleModule)
package mx.styles {
public interface IStyleModule {
function unload():void;
}
}//package mx.styles
Section 196
//StyleManager (mx.styles.StyleManager)
package mx.styles {
import mx.core.*;
import flash.events.*;
import flash.system.*;
public class StyleManager {
mx_internal static const VERSION:String = "3.5.0.12683";
public static const NOT_A_COLOR:uint = 4294967295;
private static var _impl:IStyleManager2;
private static var implClassDependency:StyleManagerImpl;
public function StyleManager(){
super();
}
public static function isParentSizeInvalidatingStyle(styleName:String):Boolean{
return (impl.isParentSizeInvalidatingStyle(styleName));
}
public static function registerInheritingStyle(styleName:String):void{
impl.registerInheritingStyle(styleName);
}
mx_internal static function set stylesRoot(value:Object):void{
impl.stylesRoot = value;
}
mx_internal static function get inheritingStyles():Object{
return (impl.inheritingStyles);
}
mx_internal static function styleDeclarationsChanged():void{
impl.styleDeclarationsChanged();
}
public static function setStyleDeclaration(selector:String, styleDeclaration:CSSStyleDeclaration, update:Boolean):void{
impl.setStyleDeclaration(selector, styleDeclaration, update);
}
public static function registerParentDisplayListInvalidatingStyle(styleName:String):void{
impl.registerParentDisplayListInvalidatingStyle(styleName);
}
mx_internal static function get typeSelectorCache():Object{
return (impl.typeSelectorCache);
}
mx_internal static function set inheritingStyles(value:Object):void{
impl.inheritingStyles = value;
}
public static function isColorName(colorName:String):Boolean{
return (impl.isColorName(colorName));
}
public static function isParentDisplayListInvalidatingStyle(styleName:String):Boolean{
return (impl.isParentDisplayListInvalidatingStyle(styleName));
}
public static function isSizeInvalidatingStyle(styleName:String):Boolean{
return (impl.isSizeInvalidatingStyle(styleName));
}
public static function getColorName(colorName:Object):uint{
return (impl.getColorName(colorName));
}
mx_internal static function set typeSelectorCache(value:Object):void{
impl.typeSelectorCache = value;
}
public static function unloadStyleDeclarations(url:String, update:Boolean=true):void{
impl.unloadStyleDeclarations(url, update);
}
public static function getColorNames(colors:Array):void{
impl.getColorNames(colors);
}
public static function loadStyleDeclarations(url:String, update:Boolean=true, trustContent:Boolean=false, applicationDomain:ApplicationDomain=null, securityDomain:SecurityDomain=null):IEventDispatcher{
return (impl.loadStyleDeclarations2(url, update, applicationDomain, securityDomain));
}
private static function get impl():IStyleManager2{
if (!_impl){
_impl = IStyleManager2(Singleton.getInstance("mx.styles::IStyleManager2"));
};
return (_impl);
}
public static function isValidStyleValue(value):Boolean{
return (impl.isValidStyleValue(value));
}
mx_internal static function get stylesRoot():Object{
return (impl.stylesRoot);
}
public static function isInheritingStyle(styleName:String):Boolean{
return (impl.isInheritingStyle(styleName));
}
mx_internal static function initProtoChainRoots():void{
impl.initProtoChainRoots();
}
public static function registerParentSizeInvalidatingStyle(styleName:String):void{
impl.registerParentSizeInvalidatingStyle(styleName);
}
public static function get selectors():Array{
return (impl.selectors);
}
public static function registerSizeInvalidatingStyle(styleName:String):void{
impl.registerSizeInvalidatingStyle(styleName);
}
public static function clearStyleDeclaration(selector:String, update:Boolean):void{
impl.clearStyleDeclaration(selector, update);
}
public static function registerColorName(colorName:String, colorValue:uint):void{
impl.registerColorName(colorName, colorValue);
}
public static function isInheritingTextFormatStyle(styleName:String):Boolean{
return (impl.isInheritingTextFormatStyle(styleName));
}
public static function getStyleDeclaration(selector:String):CSSStyleDeclaration{
return (impl.getStyleDeclaration(selector));
}
}
}//package mx.styles
Section 197
//StyleManagerImpl (mx.styles.StyleManagerImpl)
package mx.styles {
import mx.core.*;
import flash.events.*;
import flash.utils.*;
import flash.system.*;
import mx.modules.*;
import mx.events.*;
import mx.resources.*;
import mx.managers.*;
public class StyleManagerImpl implements IStyleManager2 {
private var _stylesRoot:Object;
private var _selectors:Object;
private var styleModules:Object;
private var _inheritingStyles:Object;
private var resourceManager:IResourceManager;
private var _typeSelectorCache:Object;
mx_internal static const VERSION:String = "3.5.0.12683";
private static var parentSizeInvalidatingStyles:Object = {bottom:true, horizontalCenter:true, left:true, right:true, top:true, verticalCenter:true, baseline:true};
private static var colorNames:Object = {transparent:"transparent", black:0, blue:0xFF, green:0x8000, gray:0x808080, silver:0xC0C0C0, lime:0xFF00, olive:0x808000, white:0xFFFFFF, yellow:0xFFFF00, maroon:0x800000, navy:128, red:0xFF0000, purple:0x800080, teal:0x8080, fuchsia:0xFF00FF, aqua:0xFFFF, magenta:0xFF00FF, cyan:0xFFFF, halogreen:8453965, haloblue:40447, haloorange:0xFFB600, halosilver:11455193};
private static var inheritingTextFormatStyles:Object = {align:true, bold:true, color:true, font:true, indent:true, italic:true, size:true};
private static var instance:IStyleManager2;
private static var parentDisplayListInvalidatingStyles:Object = {bottom:true, horizontalCenter:true, left:true, right:true, top:true, verticalCenter:true, baseline:true};
private static var sizeInvalidatingStyles:Object = {borderStyle:true, borderThickness:true, fontAntiAliasType:true, fontFamily:true, fontGridFitType:true, fontSharpness:true, fontSize:true, fontStyle:true, fontThickness:true, fontWeight:true, headerHeight:true, horizontalAlign:true, horizontalGap:true, kerning:true, leading:true, letterSpacing:true, paddingBottom:true, paddingLeft:true, paddingRight:true, paddingTop:true, strokeWidth:true, tabHeight:true, tabWidth:true, verticalAlign:true, verticalGap:true};
public function StyleManagerImpl(){
_selectors = {};
styleModules = {};
resourceManager = ResourceManager.getInstance();
_inheritingStyles = {};
_typeSelectorCache = {};
super();
}
public function setStyleDeclaration(selector:String, styleDeclaration:CSSStyleDeclaration, update:Boolean):void{
styleDeclaration.selectorRefCount++;
_selectors[selector] = styleDeclaration;
typeSelectorCache = {};
if (update){
styleDeclarationsChanged();
};
}
public function registerParentDisplayListInvalidatingStyle(styleName:String):void{
parentDisplayListInvalidatingStyles[styleName] = true;
}
public function getStyleDeclaration(selector:String):CSSStyleDeclaration{
var index:int;
if (selector.charAt(0) != "."){
index = selector.lastIndexOf(".");
if (index != -1){
selector = selector.substr((index + 1));
};
};
return (_selectors[selector]);
}
public function set typeSelectorCache(value:Object):void{
_typeSelectorCache = value;
}
public function isColorName(colorName:String):Boolean{
return (!((colorNames[colorName.toLowerCase()] === undefined)));
}
public function set inheritingStyles(value:Object):void{
_inheritingStyles = value;
}
public function getColorNames(colors:Array):void{
var colorNumber:uint;
if (!colors){
return;
};
var n:int = colors.length;
var i:int;
while (i < n) {
if (((!((colors[i] == null))) && (isNaN(colors[i])))){
colorNumber = getColorName(colors[i]);
if (colorNumber != StyleManager.NOT_A_COLOR){
colors[i] = colorNumber;
};
};
i++;
};
}
public function isInheritingTextFormatStyle(styleName:String):Boolean{
return ((inheritingTextFormatStyles[styleName] == true));
}
public function registerParentSizeInvalidatingStyle(styleName:String):void{
parentSizeInvalidatingStyles[styleName] = true;
}
public function registerColorName(colorName:String, colorValue:uint):void{
colorNames[colorName.toLowerCase()] = colorValue;
}
public function isParentSizeInvalidatingStyle(styleName:String):Boolean{
return ((parentSizeInvalidatingStyles[styleName] == true));
}
public function registerInheritingStyle(styleName:String):void{
inheritingStyles[styleName] = true;
}
public function set stylesRoot(value:Object):void{
_stylesRoot = value;
}
public function get typeSelectorCache():Object{
return (_typeSelectorCache);
}
public function isParentDisplayListInvalidatingStyle(styleName:String):Boolean{
return ((parentDisplayListInvalidatingStyles[styleName] == true));
}
public function isSizeInvalidatingStyle(styleName:String):Boolean{
return ((sizeInvalidatingStyles[styleName] == true));
}
public function styleDeclarationsChanged():void{
var sm:Object;
var sms:Array = SystemManagerGlobals.topLevelSystemManagers;
var n:int = sms.length;
var i:int;
while (i < n) {
sm = sms[i];
sm.regenerateStyleCache(true);
sm.notifyStyleChangeInChildren(null, true);
i++;
};
}
public function isValidStyleValue(value):Boolean{
return (!((value === undefined)));
}
public function loadStyleDeclarations(url:String, update:Boolean=true, trustContent:Boolean=false):IEventDispatcher{
return (loadStyleDeclarations2(url, update));
}
public function get inheritingStyles():Object{
return (_inheritingStyles);
}
public function unloadStyleDeclarations(url:String, update:Boolean=true):void{
var module:IModuleInfo;
var styleModuleInfo:StyleModuleInfo = styleModules[url];
if (styleModuleInfo){
styleModuleInfo.styleModule.unload();
module = styleModuleInfo.module;
module.unload();
module.removeEventListener(ModuleEvent.READY, styleModuleInfo.readyHandler);
module.removeEventListener(ModuleEvent.ERROR, styleModuleInfo.errorHandler);
styleModules[url] = null;
};
if (update){
styleDeclarationsChanged();
};
}
public function getColorName(colorName:Object):uint{
var n:Number;
var c:*;
if ((colorName is String)){
if (colorName.charAt(0) == "#"){
n = Number(("0x" + colorName.slice(1)));
return ((isNaN(n)) ? StyleManager.NOT_A_COLOR : uint(n));
};
if ((((colorName.charAt(1) == "x")) && ((colorName.charAt(0) == "0")))){
n = Number(colorName);
return ((isNaN(n)) ? StyleManager.NOT_A_COLOR : uint(n));
};
c = colorNames[colorName.toLowerCase()];
if (c === undefined){
return (StyleManager.NOT_A_COLOR);
};
return (uint(c));
};
return (uint(colorName));
}
public function isInheritingStyle(styleName:String):Boolean{
return ((inheritingStyles[styleName] == true));
}
public function get stylesRoot():Object{
return (_stylesRoot);
}
public function initProtoChainRoots():void{
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
delete _inheritingStyles["textDecoration"];
delete _inheritingStyles["leading"];
};
if (!stylesRoot){
stylesRoot = _selectors["global"].addStyleToProtoChain({}, null);
};
}
public function loadStyleDeclarations2(url:String, update:Boolean=true, applicationDomain:ApplicationDomain=null, securityDomain:SecurityDomain=null):IEventDispatcher{
var module:IModuleInfo;
var styleEventDispatcher:StyleEventDispatcher;
var timer:Timer;
var timerHandler:Function;
var url = url;
var update = update;
var applicationDomain = applicationDomain;
var securityDomain = securityDomain;
module = ModuleManager.getModule(url);
var readyHandler:Function = function (moduleEvent:ModuleEvent):void{
var styleModule:IStyleModule = IStyleModule(moduleEvent.module.factory.create());
styleModules[moduleEvent.module.url].styleModule = styleModule;
if (update){
styleDeclarationsChanged();
};
};
module.addEventListener(ModuleEvent.READY, readyHandler, false, 0, true);
styleEventDispatcher = new StyleEventDispatcher(module);
var errorHandler:Function = function (moduleEvent:ModuleEvent):void{
var styleEvent:StyleEvent;
var errorText:String = resourceManager.getString("styles", "unableToLoad", [moduleEvent.errorText, url]);
if (styleEventDispatcher.willTrigger(StyleEvent.ERROR)){
styleEvent = new StyleEvent(StyleEvent.ERROR, moduleEvent.bubbles, moduleEvent.cancelable);
styleEvent.bytesLoaded = 0;
styleEvent.bytesTotal = 0;
styleEvent.errorText = errorText;
styleEventDispatcher.dispatchEvent(styleEvent);
} else {
throw (new Error(errorText));
};
};
module.addEventListener(ModuleEvent.ERROR, errorHandler, false, 0, true);
styleModules[url] = new StyleModuleInfo(module, readyHandler, errorHandler);
timer = new Timer(0);
timerHandler = function (event:TimerEvent):void{
timer.removeEventListener(TimerEvent.TIMER, timerHandler);
timer.stop();
module.load(applicationDomain, securityDomain);
};
timer.addEventListener(TimerEvent.TIMER, timerHandler, false, 0, true);
timer.start();
return (styleEventDispatcher);
}
public function registerSizeInvalidatingStyle(styleName:String):void{
sizeInvalidatingStyles[styleName] = true;
}
public function clearStyleDeclaration(selector:String, update:Boolean):void{
var styleDeclaration:CSSStyleDeclaration = getStyleDeclaration(selector);
if (((styleDeclaration) && ((styleDeclaration.selectorRefCount > 0)))){
styleDeclaration.selectorRefCount--;
};
delete _selectors[selector];
if (update){
styleDeclarationsChanged();
};
}
public function get selectors():Array{
var i:String;
var theSelectors:Array = [];
for (i in _selectors) {
theSelectors.push(i);
};
return (theSelectors);
}
public static function getInstance():IStyleManager2{
if (!instance){
instance = new (StyleManagerImpl);
};
return (instance);
}
}
}//package mx.styles
import flash.events.*;
import mx.modules.*;
import mx.events.*;
class StyleEventDispatcher extends EventDispatcher {
private function StyleEventDispatcher(moduleInfo:IModuleInfo){
super();
moduleInfo.addEventListener(ModuleEvent.ERROR, moduleInfo_errorHandler, false, 0, true);
moduleInfo.addEventListener(ModuleEvent.PROGRESS, moduleInfo_progressHandler, false, 0, true);
moduleInfo.addEventListener(ModuleEvent.READY, moduleInfo_readyHandler, false, 0, true);
}
private function moduleInfo_progressHandler(event:ModuleEvent):void{
var styleEvent:StyleEvent = new StyleEvent(StyleEvent.PROGRESS, event.bubbles, event.cancelable);
styleEvent.bytesLoaded = event.bytesLoaded;
styleEvent.bytesTotal = event.bytesTotal;
dispatchEvent(styleEvent);
}
private function moduleInfo_readyHandler(event:ModuleEvent):void{
var styleEvent:StyleEvent = new StyleEvent(StyleEvent.COMPLETE);
styleEvent.bytesLoaded = event.bytesLoaded;
styleEvent.bytesTotal = event.bytesTotal;
dispatchEvent(styleEvent);
}
private function moduleInfo_errorHandler(event:ModuleEvent):void{
var styleEvent:StyleEvent = new StyleEvent(StyleEvent.ERROR, event.bubbles, event.cancelable);
styleEvent.bytesLoaded = event.bytesLoaded;
styleEvent.bytesTotal = event.bytesTotal;
styleEvent.errorText = event.errorText;
dispatchEvent(styleEvent);
}
}
class StyleModuleInfo {
public var errorHandler:Function;
public var readyHandler:Function;
public var module:IModuleInfo;
public var styleModule:IStyleModule;
private function StyleModuleInfo(module:IModuleInfo, readyHandler:Function, errorHandler:Function){
super();
this.module = module;
this.readyHandler = readyHandler;
this.errorHandler = errorHandler;
}
}
Section 198
//ColorUtil (mx.utils.ColorUtil)
package mx.utils {
public class ColorUtil {
mx_internal static const VERSION:String = "3.5.0.12683";
public function ColorUtil(){
super();
}
public static function adjustBrightness2(rgb:uint, brite:Number):uint{
var r:Number;
var g:Number;
var b:Number;
if (brite == 0){
return (rgb);
};
if (brite < 0){
brite = ((100 + brite) / 100);
r = (((rgb >> 16) & 0xFF) * brite);
g = (((rgb >> 8) & 0xFF) * brite);
b = ((rgb & 0xFF) * brite);
} else {
brite = (brite / 100);
r = ((rgb >> 16) & 0xFF);
g = ((rgb >> 8) & 0xFF);
b = (rgb & 0xFF);
r = (r + ((0xFF - r) * brite));
g = (g + ((0xFF - g) * brite));
b = (b + ((0xFF - b) * brite));
r = Math.min(r, 0xFF);
g = Math.min(g, 0xFF);
b = Math.min(b, 0xFF);
};
return ((((r << 16) | (g << 8)) | b));
}
public static function rgbMultiply(rgb1:uint, rgb2:uint):uint{
var r1:Number = ((rgb1 >> 16) & 0xFF);
var g1:Number = ((rgb1 >> 8) & 0xFF);
var b1:Number = (rgb1 & 0xFF);
var r2:Number = ((rgb2 >> 16) & 0xFF);
var g2:Number = ((rgb2 >> 8) & 0xFF);
var b2:Number = (rgb2 & 0xFF);
return ((((((r1 * r2) / 0xFF) << 16) | (((g1 * g2) / 0xFF) << 8)) | ((b1 * b2) / 0xFF)));
}
public static function adjustBrightness(rgb:uint, brite:Number):uint{
var r:Number = Math.max(Math.min((((rgb >> 16) & 0xFF) + brite), 0xFF), 0);
var g:Number = Math.max(Math.min((((rgb >> 8) & 0xFF) + brite), 0xFF), 0);
var b:Number = Math.max(Math.min(((rgb & 0xFF) + brite), 0xFF), 0);
return ((((r << 16) | (g << 8)) | b));
}
}
}//package mx.utils
Section 199
//GraphicsUtil (mx.utils.GraphicsUtil)
package mx.utils {
import flash.display.*;
public class GraphicsUtil {
mx_internal static const VERSION:String = "3.5.0.12683";
public function GraphicsUtil(){
super();
}
public static function drawRoundRectComplex(graphics:Graphics, x:Number, y:Number, width:Number, height:Number, topLeftRadius:Number, topRightRadius:Number, bottomLeftRadius:Number, bottomRightRadius:Number):void{
var xw:Number = (x + width);
var yh:Number = (y + height);
var minSize:Number = ((width < height)) ? (width * 2) : (height * 2);
topLeftRadius = ((topLeftRadius < minSize)) ? topLeftRadius : minSize;
topRightRadius = ((topRightRadius < minSize)) ? topRightRadius : minSize;
bottomLeftRadius = ((bottomLeftRadius < minSize)) ? bottomLeftRadius : minSize;
bottomRightRadius = ((bottomRightRadius < minSize)) ? bottomRightRadius : minSize;
var a:Number = (bottomRightRadius * 0.292893218813453);
var s:Number = (bottomRightRadius * 0.585786437626905);
graphics.moveTo(xw, (yh - bottomRightRadius));
graphics.curveTo(xw, (yh - s), (xw - a), (yh - a));
graphics.curveTo((xw - s), yh, (xw - bottomRightRadius), yh);
a = (bottomLeftRadius * 0.292893218813453);
s = (bottomLeftRadius * 0.585786437626905);
graphics.lineTo((x + bottomLeftRadius), yh);
graphics.curveTo((x + s), yh, (x + a), (yh - a));
graphics.curveTo(x, (yh - s), x, (yh - bottomLeftRadius));
a = (topLeftRadius * 0.292893218813453);
s = (topLeftRadius * 0.585786437626905);
graphics.lineTo(x, (y + topLeftRadius));
graphics.curveTo(x, (y + s), (x + a), (y + a));
graphics.curveTo((x + s), y, (x + topLeftRadius), y);
a = (topRightRadius * 0.292893218813453);
s = (topRightRadius * 0.585786437626905);
graphics.lineTo((xw - topRightRadius), y);
graphics.curveTo((xw - s), y, (xw - a), (y + a));
graphics.curveTo(xw, (y + s), xw, (y + topRightRadius));
graphics.lineTo(xw, (yh - bottomRightRadius));
}
}
}//package mx.utils
Section 200
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import flash.display.*;
import mx.core.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "3.5.0.12683";
private static var counter:int = 0;
public function NameUtil(){
super();
}
public static function displayObjectToString(displayObject:DisplayObject):String{
var result:String;
var o:DisplayObject;
var s:String;
var indices:Array;
var displayObject = displayObject;
o = displayObject;
while (o != null) {
if (((((o.parent) && (o.stage))) && ((o.parent == o.stage)))){
break;
};
s = o.name;
if ((o is IRepeaterClient)){
indices = IRepeaterClient(o).instanceIndices;
if (indices){
s = (s + (("[" + indices.join("][")) + "]"));
};
};
result = ((result == null)) ? s : ((s + ".") + result);
o = o.parent;
};
//unresolved jump
var _slot1 = e;
return (result);
}
public static function createUniqueName(object:Object):String{
if (!object){
return (null);
};
var name:String = getQualifiedClassName(object);
var index:int = name.indexOf("::");
if (index != -1){
name = name.substr((index + 2));
};
var charCode:int = name.charCodeAt((name.length - 1));
if ((((charCode >= 48)) && ((charCode <= 57)))){
name = (name + "_");
};
return ((name + counter++));
}
}
}//package mx.utils
Section 201
//StringUtil (mx.utils.StringUtil)
package mx.utils {
public class StringUtil {
mx_internal static const VERSION:String = "3.5.0.12683";
public function StringUtil(){
super();
}
public static function trim(str:String):String{
if (str == null){
return ("");
};
var startIndex:int;
while (isWhitespace(str.charAt(startIndex))) {
startIndex++;
};
var endIndex:int = (str.length - 1);
while (isWhitespace(str.charAt(endIndex))) {
endIndex--;
};
if (endIndex >= startIndex){
return (str.slice(startIndex, (endIndex + 1)));
};
return ("");
}
public static function isWhitespace(character:String):Boolean{
switch (character){
case " ":
case "\t":
case "\r":
case "\n":
case "\f":
return (true);
default:
return (false);
};
}
public static function substitute(str:String, ... _args):String{
var args:Array;
if (str == null){
return ("");
};
var len:uint = _args.length;
if ((((len == 1)) && ((_args[0] is Array)))){
args = (_args[0] as Array);
len = args.length;
} else {
args = _args;
};
var i:int;
while (i < len) {
str = str.replace(new RegExp((("\\{" + i) + "\\}"), "g"), args[i]);
i++;
};
return (str);
}
public static function trimArrayElements(value:String, delimiter:String):String{
var items:Array;
var len:int;
var i:int;
if (((!((value == ""))) && (!((value == null))))){
items = value.split(delimiter);
len = items.length;
i = 0;
while (i < len) {
items[i] = StringUtil.trim(items[i]);
i++;
};
if (len > 0){
value = items.join(delimiter);
};
};
return (value);
}
}
}//package mx.utils
Section 202
//TmxLayer (net.pixelpracht.tmx.TmxLayer)
package net.pixelpracht.tmx {
import flash.utils.*;
public class TmxLayer {
public var visible:Boolean;
public var width:int;
public var height:int;
public var name:String;
public var properties:TmxPropertySet;// = null
public var tileGIDs:Array;
public var y:int;
public var opacity:Number;
public var map:TmxMap;
public var x:int;
private static const BASE64_CHARS:String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
public function TmxLayer(source:XML, parent:TmxMap){
var node:XML;
var data:XML;
var chunk:String;
var lineWidth:int;
var rowIdx:int;
var gid:int;
var compressed:Boolean;
var time:Number;
super();
map = parent;
name = source.@name;
x = source.@x;
y = source.@y;
width = source.@width;
height = source.@height;
visible = ((!(source.@visible)) || (!((source.@visible == 0))));
opacity = source.@opacity;
for each (node in source.properties) {
properties = (properties) ? properties.extend(node) : new TmxPropertySet(node);
};
tileGIDs = [];
data = source.data[0];
if (data){
chunk = "";
if (data.@encoding.length() == 0){
lineWidth = width;
rowIdx = -1;
for each (node in data.tile) {
++lineWidth;
if (lineWidth >= width){
++rowIdx;
var _local13 = rowIdx;
tileGIDs[_local13] = [];
lineWidth = 0;
};
gid = node.@gid;
tileGIDs[rowIdx].push(gid);
};
} else {
if (data.@encoding == "csv"){
chunk = data;
tileGIDs = csvToArray(chunk, width);
} else {
if (data.@encoding == "base64"){
chunk = data;
compressed = false;
time = getTimer();
if (data.@compression == "zlib"){
compressed = true;
} else {
if (data.@compression.length() != 0){
throw (Error("TmxLayer - data compression type not supported!"));
};
};
tileGIDs = base64ToArray(chunk, width, compressed);
};
};
};
};
}
public function toCsv(tileSet:TmxTileSet=null):String{
var row:Array;
var chunk:String;
var id:int;
var max = 0xFFFFFF;
var offset:int;
if (tileSet){
offset = tileSet.firstGID;
max = (tileSet.numTiles - 1);
};
var result:String = "";
for each (row in tileGIDs) {
chunk = "";
id = 0;
for each (id in row) {
id = (id - offset);
if ((((id < 0)) || ((id > max)))){
id = 0;
};
result = (result + chunk);
chunk = (id + ",");
};
result = (result + (id + "\n"));
};
return (result);
}
public static function csvToArray(input:String, lineWidth:int):Array{
var row:String;
var resultRow:Array;
var entries:Array;
var entry:String;
var result:Array = [];
var rows:Array = input.split("\n");
for each (row in rows) {
resultRow = [];
entries = row.split(",", lineWidth);
for each (entry in entries) {
resultRow.push(uint(entry));
};
result.push(resultRow);
};
return (result);
}
public static function base64ToByteArray(data:String):ByteArray{
var a0:int;
var a1:int;
var a2:int;
var a3:int;
var output:ByteArray = new ByteArray();
var lookup:Array = [];
var c:int;
while (c < BASE64_CHARS.length) {
lookup[BASE64_CHARS.charCodeAt(c)] = c;
c++;
};
var outputBuffer:Array = new Array(3);
var i:uint;
while (i < (data.length - 3)) {
a0 = lookup[data.charCodeAt(i)];
a1 = lookup[data.charCodeAt((i + 1))];
a2 = lookup[data.charCodeAt((i + 2))];
a3 = lookup[data.charCodeAt((i + 3))];
if (a1 < 64){
output.writeByte(((a0 << 2) + ((a1 & 48) >> 4)));
};
if (a2 < 64){
output.writeByte((((a1 & 15) << 4) + ((a2 & 60) >> 2)));
};
if (a3 < 64){
output.writeByte((((a2 & 3) << 6) + a3));
};
i = (i + 4);
};
output.position = 0;
return (output);
}
public static function base64ToArray(chunk:String, lineWidth:int, compressed:Boolean):Array{
var resultRow:Array;
var i:int;
var result:Array = [];
var data:ByteArray = base64ToByteArray(chunk);
if (compressed){
data.uncompress();
};
data.endian = Endian.LITTLE_ENDIAN;
while (data.position < data.length) {
resultRow = [];
i = 0;
while (i < lineWidth) {
resultRow.push(data.readInt());
i++;
};
result.push(resultRow);
};
return (result);
}
}
}//package net.pixelpracht.tmx
Section 203
//TmxMap (net.pixelpracht.tmx.TmxMap)
package net.pixelpracht.tmx {
public class TmxMap {
public var layers:Object;
public var width:uint;
public var objectGroups:Object;
public var orientation:String;
public var version:String;
public var tileSets:Object;
public var height:uint;
public var tileHeight:uint;
public var tileWidth:uint;
public var properties:TmxPropertySet;// = null
public function TmxMap(source:XML){
var node:XML;
layers = {};
tileSets = {};
objectGroups = {};
super();
version = (source.@version) ? source.@version : "unknown";
orientation = (source.@orientation) ? source.@orientation : "orthogonal";
width = source.@width;
height = source.@height;
tileWidth = source.@tilewidth;
tileHeight = source.@tileheight;
for each (node in source.properties) {
properties = (properties) ? properties.extend(node) : new TmxPropertySet(node);
};
node = null;
for each (node in source.tileset) {
tileSets[node.@name] = new TmxTileSet(node, this);
};
for each (node in source.layer) {
layers[node.@name] = new TmxLayer(node, this);
};
for each (node in source.objectgroup) {
objectGroups[node.@name] = new TmxObjectGroup(node, this);
};
}
public function getGidOwner(gid:int):TmxTileSet{
var tileSet:TmxTileSet;
var last:TmxTileSet;
for each (tileSet in tileSets) {
if (tileSet.hasGid(gid)){
return (tileSet);
};
};
return (null);
}
public function getObjectGroup(name:String):TmxObjectGroup{
return ((objectGroups[name] as TmxObjectGroup));
}
public function getLayer(name:String):TmxLayer{
return ((layers[name] as TmxLayer));
}
public function getTileSet(name:String):TmxTileSet{
return ((tileSets[name] as TmxTileSet));
}
public function getNumLayers():uint{
var layer:TmxLayer;
var count:uint;
for each (layer in layers) {
count++;
};
return (count);
}
}
}//package net.pixelpracht.tmx
Section 204
//TmxObject (net.pixelpracht.tmx.TmxObject)
package net.pixelpracht.tmx {
public class TmxObject {
public var gid:int;
public var shared:TmxPropertySet;
public var width:int;
public var height:int;
public var name:String;
public var custom:TmxPropertySet;
public var x:int;
public var y:int;
public var type:String;
public var group:TmxObjectGroup;
public function TmxObject(source:XML, parent:TmxObjectGroup){
var node:XML;
var tileSet:TmxTileSet;
super();
group = parent;
name = source.@name;
type = source.@type;
x = source.@x;
y = source.@y;
width = source.@width;
height = source.@height;
shared = null;
gid = -1;
if (source.@gid.length != 0){
gid = source.@gid;
for each (tileSet in group.map.tileSets) {
shared = tileSet.getPropertiesByGid(gid);
if (shared){
break;
};
};
};
for each (node in source.properties) {
custom = (custom) ? custom.extend(node) : new TmxPropertySet(node);
};
}
}
}//package net.pixelpracht.tmx
Section 205
//TmxObjectGroup (net.pixelpracht.tmx.TmxObjectGroup)
package net.pixelpracht.tmx {
public class TmxObjectGroup {
public var visible:Boolean;
public var width:int;
public var height:int;
public var name:String;
public var properties:TmxPropertySet;// = null
public var objects:Array;
public var y:int;
public var opacity:Number;
public var map:TmxMap;
public var x:int;
public function TmxObjectGroup(source:XML, parent:TmxMap){
var node:XML;
objects = [];
super();
map = parent;
name = source.@name;
x = source.@x;
y = source.@y;
width = source.@width;
height = source.@height;
visible = ((!(source.@visible)) || (!((source.@visible == 0))));
opacity = source.@opacity;
for each (node in source.properties) {
properties = (properties) ? properties.extend(node) : new TmxPropertySet(node);
};
for each (node in source.object) {
objects.push(new TmxObject(node, this));
};
}
}
}//package net.pixelpracht.tmx
Section 206
//TmxPropertySet (net.pixelpracht.tmx.TmxPropertySet)
package net.pixelpracht.tmx {
public dynamic class TmxPropertySet {
public function TmxPropertySet(source:XML){
super();
extend(source);
}
public function extend(source:XML):TmxPropertySet{
var prop:XML;
var key:String;
var value:String;
for each (prop in source.property) {
key = prop.@name;
value = prop.@value;
this[key] = value;
};
return (this);
}
}
}//package net.pixelpracht.tmx
Section 207
//TmxTileSet (net.pixelpracht.tmx.TmxTileSet)
package net.pixelpracht.tmx {
import flash.display.*;
import flash.geom.*;
public class TmxTileSet {
public var spacing:int;
public var tileWidth:int;
public var name:String;
public var numCols:int;// = 1
private var _image:BitmapData;// = null
public var imageSource:String;
public var numTiles:int;// = 0xFFFFFF
private var _tileProps:Array;
public var map:TmxMap;
public var margin:int;
public var firstGID:int;// = 0
public var tileHeight:int;
public var numRows:int;// = 1
public function TmxTileSet(source:XML, parent:TmxMap){
var node:XML;
_tileProps = [];
super();
firstGID = source.@firstgid;
imageSource = source.image.@source;
map = parent;
name = source.@name;
tileWidth = source.@tilewidth;
tileHeight = source.@tileheight;
spacing = source.@spacing;
margin = source.@margin;
for each (node in source.tile) {
if (node.properties[0]){
_tileProps[int(node.@id)] = new TmxPropertySet(node.properties[0]);
};
};
}
public function getPropertiesByGid(gid:int):TmxPropertySet{
return (_tileProps[(gid - firstGID)]);
}
public function hasGid(gid:int):Boolean{
return ((((gid >= firstGID)) && ((gid < (firstGID + numTiles)))));
}
public function toGid(id:int):int{
return ((firstGID + id));
}
public function fromGid(gid:int):int{
return ((gid - firstGID));
}
public function get image():BitmapData{
return (_image);
}
public function getRect(id:int):Rectangle{
return (new Rectangle(((id % numCols) * tileWidth), ((id / numCols) * tileHeight)));
}
public function getProperties(id:int):TmxPropertySet{
return (_tileProps[id]);
}
public function set image(v:BitmapData):void{
_image = v;
numCols = Math.floor((v.width / tileWidth));
numRows = Math.floor((v.height / tileHeight));
numTiles = (numRows * numCols);
}
}
}//package net.pixelpracht.tmx
Section 208
//FlxAnim (org.flixel.data.FlxAnim)
package org.flixel.data {
public class FlxAnim {
public var delay:Number;
public var frames:Array;
public var looped:Boolean;
public var name:String;
public function FlxAnim(Name:String, Frames:Array, FrameRate:Number=0, Looped:Boolean=true){
super();
name = Name;
delay = 0;
if (FrameRate > 0){
delay = (1 / FrameRate);
};
frames = Frames;
looped = Looped;
}
}
}//package org.flixel.data
Section 209
//FlxConsole (org.flixel.data.FlxConsole)
package org.flixel.data {
import flash.display.*;
import org.flixel.*;
import flash.text.*;
public class FlxConsole extends Sprite {
protected const MAX_CONSOLE_LINES:uint = 0x0100;
protected var _lines:Array;
protected var _text:TextField;
public var mtrUpdate:FlxMonitor;
public var mtrTotal:FlxMonitor;
protected var _Y:Number;
protected var _console:Sprite;
public var mtrRender:FlxMonitor;
protected var _curFPS:uint;
protected var _extraDisplay:TextField;
protected var _bx:int;
protected var _by:int;
protected var _YT:Number;
protected var _byt:int;
protected var _fpsDisplay:TextField;
public function FlxConsole(X:uint, Y:uint, Zoom:uint){
super();
visible = false;
x = (X * Zoom);
_by = (Y * Zoom);
_byt = (_by - (FlxG.height * Zoom));
_YT = (_Y = (y = _byt));
var tmp:Bitmap = new Bitmap(new BitmapData((FlxG.width * Zoom), (FlxG.height * Zoom), true, 2130706432));
addChild(tmp);
mtrUpdate = new FlxMonitor(8);
mtrRender = new FlxMonitor(8);
mtrTotal = new FlxMonitor(8);
_text = new TextField();
_text.width = tmp.width;
_text.height = tmp.height;
_text.multiline = true;
_text.wordWrap = true;
_text.embedFonts = true;
_text.selectable = false;
_text.antiAliasType = AntiAliasType.NORMAL;
_text.gridFitType = GridFitType.PIXEL;
_text.defaultTextFormat = new TextFormat("system", 8, 0xFFFFFF);
addChild(_text);
_fpsDisplay = new TextField();
_fpsDisplay.width = 100;
_fpsDisplay.x = (tmp.width - 100);
_fpsDisplay.height = 20;
_fpsDisplay.multiline = true;
_fpsDisplay.wordWrap = true;
_fpsDisplay.embedFonts = true;
_fpsDisplay.selectable = false;
_fpsDisplay.antiAliasType = AntiAliasType.NORMAL;
_fpsDisplay.gridFitType = GridFitType.PIXEL;
_fpsDisplay.defaultTextFormat = new TextFormat("system", 16, 0xFFFFFF, true, null, null, null, null, "right");
addChild(_fpsDisplay);
_extraDisplay = new TextField();
_extraDisplay.width = 100;
_extraDisplay.x = (tmp.width - 100);
_extraDisplay.height = 64;
_extraDisplay.y = 20;
_extraDisplay.alpha = 0.5;
_extraDisplay.multiline = true;
_extraDisplay.wordWrap = true;
_extraDisplay.embedFonts = true;
_extraDisplay.selectable = false;
_extraDisplay.antiAliasType = AntiAliasType.NORMAL;
_extraDisplay.gridFitType = GridFitType.PIXEL;
_extraDisplay.defaultTextFormat = new TextFormat("system", 8, 0xFFFFFF, true, null, null, null, null, "right");
addChild(_extraDisplay);
_lines = new Array();
}
public function log(Text:String):void{
var newText:String;
var i:uint;
if (Text == null){
Text = "NULL";
};
trace(Text);
_lines.push(Text);
if (_lines.length > MAX_CONSOLE_LINES){
_lines.shift();
newText = "";
i = 0;
while (i < _lines.length) {
newText = (newText + (_lines[i] + "\n"));
i++;
};
_text.text = newText;
} else {
_text.appendText((Text + "\n"));
};
_text.scrollV = _text.height;
}
public function update():void{
var total:Number = mtrTotal.average();
_fpsDisplay.text = (uint((1000 / total)) + " fps");
var up:uint = mtrUpdate.average();
var rn:uint = mtrRender.average();
var fx:uint = (up + rn);
var tt:uint = uint(total);
_extraDisplay.text = (((((((((up + "ms update\n") + rn) + "ms render\n") + fx) + "ms flixel\n") + (tt - fx)) + "ms flash\n") + tt) + "ms total");
if (_Y < _YT){
_Y = (_Y + ((FlxG.height * 10) * FlxG.elapsed));
} else {
if (_Y > _YT){
_Y = (_Y - ((FlxG.height * 10) * FlxG.elapsed));
};
};
if (_Y > _by){
_Y = _by;
} else {
if (_Y < _byt){
_Y = _byt;
visible = false;
};
};
y = Math.floor(_Y);
}
public function toggle():void{
if (_YT == _by){
_YT = _byt;
} else {
_YT = _by;
visible = true;
};
}
}
}//package org.flixel.data
Section 210
//FlxFade (org.flixel.data.FlxFade)
package org.flixel.data {
import org.flixel.*;
public class FlxFade extends FlxSprite {
protected var _reverse:Boolean;
protected var _delay:Number;
protected var _complete:Function;
public function FlxFade(){
super();
createGraphic(FlxG.width, FlxG.height, 0, true);
scrollFactor.x = 0;
scrollFactor.y = 0;
exists = false;
}
override public function update():void{
if (_reverse){
alpha = (alpha - (FlxG.elapsed / _delay));
} else {
alpha = (alpha + (FlxG.elapsed / _delay));
};
if ((((alpha >= 1)) || (((_reverse) && ((alpha <= 0)))))){
alpha = (_reverse) ? 0 : 1;
if (_complete != null){
_complete();
};
};
}
public function start(Color:uint=4278190080, Duration:Number=1, FadeComplete:Function=null, Force:Boolean=false, Reverse:Boolean=false):void{
if (((!(Force)) && (exists))){
return;
};
fill(Color);
_delay = Duration;
_complete = FadeComplete;
_reverse = Reverse;
alpha = (Reverse) ? 1 : 0;
exists = true;
}
public function stop():void{
exists = false;
}
}
}//package org.flixel.data
Section 211
//FlxFlash (org.flixel.data.FlxFlash)
package org.flixel.data {
import org.flixel.*;
public class FlxFlash extends FlxSprite {
protected var _delay:Number;
protected var _complete:Function;
public function FlxFlash(){
super();
createGraphic(FlxG.width, FlxG.height, 0, true);
scrollFactor.x = 0;
scrollFactor.y = 0;
exists = false;
}
override public function update():void{
alpha = (alpha - (FlxG.elapsed / _delay));
if (alpha <= 0){
exists = false;
if (_complete != null){
_complete();
};
};
}
public function start(Color:uint=4294967295, Duration:Number=1, FlashComplete:Function=null, Force:Boolean=false):void{
if (((!(Force)) && (exists))){
return;
};
fill(Color);
_delay = Duration;
_complete = FlashComplete;
alpha = 1;
exists = true;
}
public function stop():void{
exists = false;
}
}
}//package org.flixel.data
Section 212
//FlxKeyboard (org.flixel.data.FlxKeyboard)
package org.flixel.data {
import flash.events.*;
public class FlxKeyboard {
protected const _t:uint = 0x0100;
public var RIGHT:Boolean;
public var LEFT:Boolean;
public var FOUR:Boolean;
public var TWO:Boolean;
public var CONTROL:Boolean;
public var A:Boolean;
public var B:Boolean;
public var C:Boolean;
public var D:Boolean;
public var E:Boolean;
public var ONE:Boolean;
public var G:Boolean;
public var H:Boolean;
public var I:Boolean;
public var J:Boolean;
public var K:Boolean;
public var F:Boolean;
public var N:Boolean;
public var O:Boolean;
public var Q:Boolean;
public var R:Boolean;
public var S:Boolean;
public var T:Boolean;
public var U:Boolean;
public var MINUS:Boolean;
public var Y:Boolean;
public var L:Boolean;
public var Z:Boolean;
public var QUOTE:Boolean;
public var V:Boolean;
public var X:Boolean;
public var P:Boolean;
public var SHIFT:Boolean;
public var SLASH:Boolean;
public var BACKSPACE:Boolean;
public var EIGHT:Boolean;
public var W:Boolean;
public var M:Boolean;
public var THREE:Boolean;
public var ESCAPE:Boolean;
public var SEMICOLON:Boolean;
public var CAPSLOCK:Boolean;
protected var _lookup:Object;
public var PLUS:Boolean;
protected var _map:Array;
public var ZERO:Boolean;
public var DOWN:Boolean;
public var F1:Boolean;
public var F2:Boolean;
public var F3:Boolean;
public var F4:Boolean;
public var F5:Boolean;
public var F6:Boolean;
public var F7:Boolean;
public var NINE:Boolean;
public var F9:Boolean;
public var ALT:Boolean;
public var F8:Boolean;
public var DELETE:Boolean;
public var LBRACKET:Boolean;
public var UP:Boolean;
public var ENTER:Boolean;
public var FIVE:Boolean;
public var SIX:Boolean;
public var COMMA:Boolean;
public var PERIOD:Boolean;
public var BACKSLASH:Boolean;
public var F10:Boolean;
public var F11:Boolean;
public var F12:Boolean;
public var SEVEN:Boolean;
public var SPACE:Boolean;
public var RBRACKET:Boolean;
public function FlxKeyboard(){
super();
var i:uint;
_lookup = new Object();
_map = new Array(_t);
i = 65;
while (i <= 90) {
addKey(String.fromCharCode(i), i);
i++;
};
i = 48;
var _temp1 = i;
i = (i + 1);
addKey("ZERO", _temp1);
var _temp2 = i;
i = (i + 1);
addKey("ONE", _temp2);
var _temp3 = i;
i = (i + 1);
addKey("TWO", _temp3);
var _temp4 = i;
i = (i + 1);
addKey("THREE", _temp4);
var _temp5 = i;
i = (i + 1);
addKey("FOUR", _temp5);
var _temp6 = i;
i = (i + 1);
addKey("FIVE", _temp6);
var _temp7 = i;
i = (i + 1);
addKey("SIX", _temp7);
var _temp8 = i;
i = (i + 1);
addKey("SEVEN", _temp8);
var _temp9 = i;
i = (i + 1);
addKey("EIGHT", _temp9);
var _temp10 = i;
i = (i + 1);
addKey("NINE", _temp10);
i = 1;
while (i <= 12) {
addKey(("F" + i), (111 + i));
i++;
};
addKey("ESCAPE", 27);
addKey("MINUS", 189);
addKey("PLUS", 187);
addKey("DELETE", 46);
addKey("BACKSPACE", 8);
addKey("LBRACKET", 219);
addKey("RBRACKET", 221);
addKey("BACKSLASH", 220);
addKey("CAPSLOCK", 20);
addKey("SEMICOLON", 186);
addKey("QUOTE", 222);
addKey("ENTER", 13);
addKey("SHIFT", 16);
addKey("COMMA", 188);
addKey("PERIOD", 190);
addKey("SLASH", 191);
addKey("CONTROL", 17);
addKey("ALT", 18);
addKey("SPACE", 32);
addKey("UP", 38);
addKey("DOWN", 40);
addKey("LEFT", 37);
addKey("RIGHT", 39);
}
public function handleKeyUp(event:KeyboardEvent):void{
var o:Object = _map[event.keyCode];
if (o == null){
return;
};
if (o.current > 0){
o.current = -1;
} else {
o.current = 0;
};
this[o.name] = false;
}
public function pressed(Key:String):Boolean{
return (this[Key]);
}
public function justReleased(Key:String):Boolean{
return ((_map[_lookup[Key]].current == -1));
}
public function handleKeyDown(event:KeyboardEvent):void{
var o:Object = _map[event.keyCode];
if (o == null){
return;
};
if (o.current > 0){
o.current = 1;
} else {
o.current = 2;
};
this[o.name] = true;
}
public function reset():void{
var o:Object;
var i:uint;
while (i < _t) {
if (_map[i] == null){
} else {
o = _map[i];
this[o.name] = false;
o.current = 0;
o.last = 0;
};
i++;
};
}
public function justPressed(Key:String):Boolean{
return ((_map[_lookup[Key]].current == 2));
}
public function update():void{
var o:Object;
var i:uint;
while (i < _t) {
if (_map[i] == null){
} else {
o = _map[i];
if ((((o.last == -1)) && ((o.current == -1)))){
o.current = 0;
} else {
if ((((o.last == 2)) && ((o.current == 2)))){
o.current = 1;
};
};
o.last = o.current;
};
i++;
};
}
protected function addKey(KeyName:String, KeyCode:uint):void{
_lookup[KeyName] = KeyCode;
_map[KeyCode] = {name:KeyName, current:0, last:0};
}
}
}//package org.flixel.data
Section 213
//FlxKong (org.flixel.data.FlxKong)
package org.flixel.data {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class FlxKong extends Sprite {
public var API;
public function FlxKong(){
super();
API = null;
}
public function init():void{
var paramObj:Object = LoaderInfo(root.loaderInfo).parameters;
var api_url:String = ((paramObj.api_path) || ("http://www.kongregate.com/flash/API_AS3_Local.swf"));
var request:URLRequest = new URLRequest(api_url);
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, APILoaded);
loader.load(request);
this.addChild(loader);
}
protected function APILoaded(event:Event):void{
API = event.target.content;
API.services.connect();
}
}
}//package org.flixel.data
Section 214
//FlxList (org.flixel.data.FlxList)
package org.flixel.data {
import org.flixel.*;
public class FlxList {
public var next:FlxList;
public var object:FlxObject;
public function FlxList(){
super();
object = null;
next = null;
}
}
}//package org.flixel.data
Section 215
//FlxMouse (org.flixel.data.FlxMouse)
package org.flixel.data {
import flash.events.*;
import org.flixel.*;
public class FlxMouse {
protected var ImgDefaultCursor:Class;
protected var _out:Boolean;
public var cursor:FlxSprite;
public var screenY:int;
protected var _last:int;
public var x:int;
public var y:int;
protected var _current:int;
public var screenX:int;
public function FlxMouse(){
ImgDefaultCursor = FlxMouse_ImgDefaultCursor;
super();
x = 0;
y = 0;
screenX = 0;
screenY = 0;
_current = 0;
_last = 0;
cursor = null;
_out = false;
}
public function hide():void{
if (cursor != null){
cursor.visible = false;
_out = false;
};
}
public function update(X:int, Y:int, XScroll:Number, YScroll:Number):void{
screenX = X;
screenY = Y;
x = (screenX - FlxU.floor(XScroll));
y = (screenY - FlxU.floor(YScroll));
if (cursor != null){
cursor.x = x;
cursor.y = y;
};
if ((((_last == -1)) && ((_current == -1)))){
_current = 0;
} else {
if ((((_last == 2)) && ((_current == 2)))){
_current = 1;
};
};
_last = _current;
}
public function reset():void{
_current = 0;
_last = 0;
}
public function justReleased():Boolean{
return ((_current == -1));
}
public function handleMouseOver(event:MouseEvent):void{
if (cursor != null){
cursor.visible = _out;
};
}
public function handleMouseDown(event:MouseEvent):void{
if (_current > 0){
_current = 1;
} else {
_current = 2;
};
}
public function pressed():Boolean{
return ((_current > 0));
}
public function justPressed():Boolean{
return ((_current == 2));
}
public function load(Graphic:Class, XOffset:int=0, YOffset:int=0):void{
if (Graphic == null){
Graphic = ImgDefaultCursor;
};
cursor = new FlxSprite(screenX, screenY, Graphic);
cursor.offset.x = XOffset;
cursor.offset.y = YOffset;
}
public function handleMouseUp(event:MouseEvent):void{
if (_current > 0){
_current = -1;
} else {
_current = 0;
};
}
public function handleMouseOut(event:MouseEvent):void{
if (cursor != null){
_out = cursor.visible;
cursor.visible = false;
};
}
public function show(Graphic:Class=null, XOffset:int=0, YOffset:int=0):void{
_out = true;
if (Graphic != null){
load(Graphic, XOffset, YOffset);
} else {
if (cursor != null){
cursor.visible = true;
} else {
load(null);
};
};
}
public function unload():void{
if (cursor != null){
if (cursor.visible){
load(null);
} else {
cursor = null;
};
};
}
}
}//package org.flixel.data
Section 216
//FlxMouse_ImgDefaultCursor (org.flixel.data.FlxMouse_ImgDefaultCursor)
package org.flixel.data {
import mx.core.*;
public class FlxMouse_ImgDefaultCursor extends BitmapAsset {
}
}//package org.flixel.data
Section 217
//FlxPanel (org.flixel.data.FlxPanel)
package org.flixel.data {
import org.flixel.*;
import flash.ui.*;
public class FlxPanel extends FlxObject {
protected var _close:FlxButton;
protected var _digg:FlxButton;
protected var _gameTitle:String;
protected var _closed:Boolean;
protected var _payPalID:String;
protected var _donate:FlxButton;
private var ImgClose:Class;
protected var _topBar:FlxSprite;
protected var _ty:Number;
protected var _caption:FlxText;
protected var _initialized:Boolean;
protected var _twitter:FlxButton;
protected var _delicious:FlxButton;
protected var _stumble:FlxButton;
private var ImgDelicious:Class;
private var ImgTwitter:Class;
protected var _mainBar:FlxSprite;
protected var _gameURL:String;
private var ImgStumble:Class;
private var ImgReddit:Class;
private var ImgDigg:Class;
protected var _bottomBar:FlxSprite;
protected var _payPalAmount:Number;
protected var _s:Number;
private var ImgDonate:Class;
protected var _reddit:FlxButton;
public function FlxPanel(){
ImgDonate = FlxPanel_ImgDonate;
ImgStumble = FlxPanel_ImgStumble;
ImgDigg = FlxPanel_ImgDigg;
ImgReddit = FlxPanel_ImgReddit;
ImgDelicious = FlxPanel_ImgDelicious;
ImgTwitter = FlxPanel_ImgTwitter;
ImgClose = FlxPanel_ImgClose;
super();
y = -21;
_ty = y;
_closed = false;
_initialized = false;
_topBar = new FlxSprite();
_topBar.createGraphic(FlxG.width, 1, 2147483647);
_topBar.scrollFactor.x = 0;
_topBar.scrollFactor.y = 0;
_mainBar = new FlxSprite();
_mainBar.createGraphic(FlxG.width, 19, 2130706432);
_mainBar.scrollFactor.x = 0;
_mainBar.scrollFactor.y = 0;
_bottomBar = new FlxSprite();
_bottomBar.createGraphic(FlxG.width, 1, 2147483647);
_bottomBar.scrollFactor.x = 0;
_bottomBar.scrollFactor.y = 0;
_donate = new FlxButton(3, 0, onDonate);
_donate.loadGraphic(new FlxSprite(0, 0, ImgDonate));
_donate.scrollFactor.x = 0;
_donate.scrollFactor.y = 0;
_stumble = new FlxButton(((((((FlxG.width / 2) - 6) - 13) - 6) - 13) - 6), 0, onStumble);
_stumble.loadGraphic(new FlxSprite(0, 0, ImgStumble));
_stumble.scrollFactor.x = 0;
_stumble.scrollFactor.y = 0;
_digg = new FlxButton(((((FlxG.width / 2) - 6) - 13) - 6), 0, onDigg);
_digg.loadGraphic(new FlxSprite(0, 0, ImgDigg));
_digg.scrollFactor.x = 0;
_digg.scrollFactor.y = 0;
_reddit = new FlxButton(((FlxG.width / 2) - 6), 0, onReddit);
_reddit.loadGraphic(new FlxSprite(0, 0, ImgReddit));
_reddit.scrollFactor.x = 0;
_reddit.scrollFactor.y = 0;
_delicious = new FlxButton((((FlxG.width / 2) + 7) + 6), 0, onDelicious);
_delicious.loadGraphic(new FlxSprite(0, 0, ImgDelicious));
_delicious.scrollFactor.x = 0;
_delicious.scrollFactor.y = 0;
_twitter = new FlxButton((((((FlxG.width / 2) + 7) + 6) + 12) + 6), 0, onTwitter);
_twitter.loadGraphic(new FlxSprite(0, 0, ImgTwitter));
_twitter.scrollFactor.x = 0;
_twitter.scrollFactor.y = 0;
_caption = new FlxText((FlxG.width / 2), 0, ((FlxG.width / 2) - 19), "");
_caption.alignment = "right";
_caption.scrollFactor.x = 0;
_caption.scrollFactor.y = 0;
_close = new FlxButton((FlxG.width - 16), 0, onClose);
_close.loadGraphic(new FlxSprite(0, 0, ImgClose));
_close.scrollFactor.x = 0;
_close.scrollFactor.y = 0;
hide();
visible = false;
_s = 50;
}
public function onDelicious():void{
FlxU.openURL(((("http://delicious.com/save?v=5&noui&jump=close&url=" + encodeURIComponent(_gameURL)) + "&title=") + encodeURIComponent(_gameTitle)));
}
public function onTwitter():void{
FlxU.openURL(("http://twitter.com/home?status=Playing" + encodeURIComponent((((" " + _gameTitle) + " - ") + _gameURL))));
}
public function setup(PayPalID:String, PayPalAmount:Number, GameTitle:String, GameURL:String, Caption:String):void{
_payPalID = PayPalID;
if (_payPalID.length <= 0){
_donate.visible = false;
};
_payPalAmount = PayPalAmount;
_gameTitle = GameTitle;
_gameURL = GameURL;
_caption.text = Caption;
_initialized = true;
}
public function onStumble():void{
FlxU.openURL(("http://www.stumbleupon.com/submit?url=" + encodeURIComponent(_gameURL)));
}
override public function render():void{
if (!_initialized){
return;
};
if (_topBar.visible){
_topBar.render();
};
if (_mainBar.visible){
_mainBar.render();
};
if (_bottomBar.visible){
_bottomBar.render();
};
if (_donate.visible){
_donate.render();
};
if (_stumble.visible){
_stumble.render();
};
if (_digg.visible){
_digg.render();
};
if (_reddit.visible){
_reddit.render();
};
if (_delicious.visible){
_delicious.render();
};
if (_twitter.visible){
_twitter.render();
};
if (_caption.visible){
_caption.render();
};
if (_close.visible){
_close.render();
};
}
public function onDigg():void{
FlxU.openURL(((("http://digg.com/submit?url=" + encodeURIComponent(_gameURL)) + "&title=") + encodeURIComponent(_gameTitle)));
}
public function onReddit():void{
FlxU.openURL(("http://www.reddit.com/submit?url=" + encodeURIComponent(_gameURL)));
}
public function onDonate():void{
FlxU.openURL(((((("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=" + encodeURIComponent(_payPalID)) + "&item_name=") + encodeURIComponent(((_gameTitle + " Contribution (") + _gameURL))) + ")¤cy_code=USD&amount=") + _payPalAmount));
}
override public function update():void{
if (!_initialized){
return;
};
if (_ty != y){
if (y < _ty){
y = (y + (FlxG.elapsed * _s));
if (y > _ty){
y = _ty;
};
} else {
y = (y - (FlxG.elapsed * _s));
if (y < _ty){
y = _ty;
};
};
_topBar.y = y;
_mainBar.y = (y + 1);
_bottomBar.y = (y + 20);
_donate.reset(_donate.x, (y + 4));
_stumble.reset(_stumble.x, (y + 4));
_digg.reset(_digg.x, (y + 4));
_reddit.reset(_reddit.x, (y + 4));
_delicious.reset(_delicious.x, (y + 5));
_twitter.reset(_twitter.x, (y + 4));
_caption.reset(_caption.x, (y + 4));
_close.reset(_close.x, (y + 4));
};
if ((((y <= -21)) || ((y >= FlxG.height)))){
visible = false;
} else {
visible = true;
};
if (visible){
if (_donate.active){
_donate.update();
};
if (_stumble.active){
_stumble.update();
};
if (_digg.active){
_digg.update();
};
if (_reddit.active){
_reddit.update();
};
if (_delicious.active){
_delicious.update();
};
if (_twitter.active){
_twitter.update();
};
if (_caption.active){
_caption.update();
};
if (_close.active){
_close.update();
};
};
}
public function show(Top:Boolean=true):void{
if (_closed){
return;
};
if (!_initialized){
FlxG.log("SUPPORT PANEL ERROR: Uninitialized.\nYou forgot to call FlxGame.setupSupportPanel()\nfrom your game constructor.");
return;
};
if (Top){
y = -21;
_ty = -1;
} else {
y = FlxG.height;
_ty = (FlxG.height - 20);
};
_donate.reset(_donate.x, (y + 4));
_stumble.reset(_stumble.x, (y + 4));
_digg.reset(_digg.x, (y + 4));
_reddit.reset(_reddit.x, (y + 4));
_delicious.reset(_delicious.x, (y + 5));
_twitter.reset(_twitter.x, (y + 4));
_caption.reset(_caption.x, (y + 4));
_close.reset(_close.x, (y + 4));
if (!FlxG.mouse.cursor.visible){
Mouse.show();
};
visible = true;
}
public function onClose():void{
_closed = true;
hide();
}
public function hide():void{
if (y < 0){
_ty = -21;
} else {
_ty = FlxG.height;
};
Mouse.hide();
}
}
}//package org.flixel.data
Section 218
//FlxPanel_ImgClose (org.flixel.data.FlxPanel_ImgClose)
package org.flixel.data {
import mx.core.*;
public class FlxPanel_ImgClose extends BitmapAsset {
}
}//package org.flixel.data
Section 219
//FlxPanel_ImgDelicious (org.flixel.data.FlxPanel_ImgDelicious)
package org.flixel.data {
import mx.core.*;
public class FlxPanel_ImgDelicious extends BitmapAsset {
}
}//package org.flixel.data
Section 220
//FlxPanel_ImgDigg (org.flixel.data.FlxPanel_ImgDigg)
package org.flixel.data {
import mx.core.*;
public class FlxPanel_ImgDigg extends BitmapAsset {
}
}//package org.flixel.data
Section 221
//FlxPanel_ImgDonate (org.flixel.data.FlxPanel_ImgDonate)
package org.flixel.data {
import mx.core.*;
public class FlxPanel_ImgDonate extends BitmapAsset {
}
}//package org.flixel.data
Section 222
//FlxPanel_ImgReddit (org.flixel.data.FlxPanel_ImgReddit)
package org.flixel.data {
import mx.core.*;
public class FlxPanel_ImgReddit extends BitmapAsset {
}
}//package org.flixel.data
Section 223
//FlxPanel_ImgStumble (org.flixel.data.FlxPanel_ImgStumble)
package org.flixel.data {
import mx.core.*;
public class FlxPanel_ImgStumble extends BitmapAsset {
}
}//package org.flixel.data
Section 224
//FlxPanel_ImgTwitter (org.flixel.data.FlxPanel_ImgTwitter)
package org.flixel.data {
import mx.core.*;
public class FlxPanel_ImgTwitter extends BitmapAsset {
}
}//package org.flixel.data
Section 225
//FlxPause (org.flixel.data.FlxPause)
package org.flixel.data {
import org.flixel.*;
public class FlxPause extends FlxGroup {
private var ImgKeyP:Class;
private var ImgKey0:Class;
private var ImgKeyPlus:Class;
private var ImgKeyMinus:Class;
public function FlxPause(){
var h:uint;
ImgKeyMinus = FlxPause_ImgKeyMinus;
ImgKeyPlus = FlxPause_ImgKeyPlus;
ImgKey0 = FlxPause_ImgKey0;
ImgKeyP = FlxPause_ImgKeyP;
super();
scrollFactor.x = 0;
scrollFactor.y = 0;
var w:uint = 80;
h = 92;
x = ((FlxG.width - w) / 2);
y = ((FlxG.height - h) / 2);
add(new FlxSprite().createGraphic(w, h, 2852126720, true), true);
(add(new FlxText(0, 0, w, "this game is"), true) as FlxText).alignment = "center";
add(new FlxText(0, 10, w, "PAUSED").setFormat(null, 16, 0xFFFFFF, "center"), true);
add(new FlxSprite(4, 36, ImgKeyP), true);
add(new FlxText(16, 36, (w - 16), "Pause Game"), true);
add(new FlxSprite(4, 50, ImgKey0), true);
add(new FlxText(16, 50, (w - 16), "Mute Sound"), true);
add(new FlxSprite(4, 64, ImgKeyMinus), true);
add(new FlxText(16, 64, (w - 16), "Sound Down"), true);
add(new FlxSprite(4, 78, ImgKeyPlus), true);
add(new FlxText(16, 78, (w - 16), "Sound Up"), true);
}
}
}//package org.flixel.data
Section 226
//FlxPause_ImgKey0 (org.flixel.data.FlxPause_ImgKey0)
package org.flixel.data {
import mx.core.*;
public class FlxPause_ImgKey0 extends BitmapAsset {
}
}//package org.flixel.data
Section 227
//FlxPause_ImgKeyMinus (org.flixel.data.FlxPause_ImgKeyMinus)
package org.flixel.data {
import mx.core.*;
public class FlxPause_ImgKeyMinus extends BitmapAsset {
}
}//package org.flixel.data
Section 228
//FlxPause_ImgKeyP (org.flixel.data.FlxPause_ImgKeyP)
package org.flixel.data {
import mx.core.*;
public class FlxPause_ImgKeyP extends BitmapAsset {
}
}//package org.flixel.data
Section 229
//FlxPause_ImgKeyPlus (org.flixel.data.FlxPause_ImgKeyPlus)
package org.flixel.data {
import mx.core.*;
public class FlxPause_ImgKeyPlus extends BitmapAsset {
}
}//package org.flixel.data
Section 230
//FlxQuake (org.flixel.data.FlxQuake)
package org.flixel.data {
import org.flixel.*;
public class FlxQuake {
public var y:int;
protected var _timer:Number;
protected var _intensity:Number;
public var x:int;
protected var _zoom:uint;
public function FlxQuake(Zoom:uint){
super();
_zoom = Zoom;
start(0);
}
public function update():void{
if (_timer > 0){
_timer = (_timer - FlxG.elapsed);
if (_timer <= 0){
_timer = 0;
x = 0;
y = 0;
} else {
x = (((((Math.random() * _intensity) * FlxG.width) * 2) - (_intensity * FlxG.width)) * _zoom);
y = (((((Math.random() * _intensity) * FlxG.height) * 2) - (_intensity * FlxG.height)) * _zoom);
};
};
}
public function start(Intensity:Number=0.05, Duration:Number=0.5):void{
stop();
_intensity = Intensity;
_timer = Duration;
}
public function stop():void{
x = 0;
y = 0;
_intensity = 0;
_timer = 0;
}
}
}//package org.flixel.data
Section 231
//FlxButton (org.flixel.FlxButton)
package org.flixel {
import flash.events.*;
public class FlxButton extends FlxGroup {
protected var _on:FlxSprite;
protected var _offT:FlxText;
protected var _initialized:Boolean;
protected var _onT:FlxText;
protected var _pressed:Boolean;
protected var _callback:Function;
protected var _off:FlxSprite;
protected var _onToggle:Boolean;
protected var _sf:FlxPoint;
public function FlxButton(X:int, Y:int, Callback:Function){
super();
x = X;
y = Y;
width = 100;
height = 20;
_off = new FlxSprite().createGraphic(width, height, 4286545791);
_off.solid = false;
add(_off, true);
_on = new FlxSprite().createGraphic(width, height, 4294967295);
_on.solid = false;
add(_on, true);
_offT = null;
_onT = null;
_callback = Callback;
_onToggle = false;
_pressed = false;
_initialized = false;
_sf = null;
}
override public function destroy():void{
if (FlxG.stage != null){
FlxG.stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
};
}
override public function update():void{
if (!_initialized){
if (FlxG.stage != null){
FlxG.stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
_initialized = true;
};
};
super.update();
visibility(false);
if (overlapsPoint(FlxG.mouse.x, FlxG.mouse.y)){
if (!FlxG.mouse.pressed()){
_pressed = false;
} else {
if (!_pressed){
_pressed = true;
};
};
visibility(!(_pressed));
};
if (_onToggle){
visibility(_off.visible);
};
}
protected function onMouseUp(event:MouseEvent):void{
if (((((((((!(exists)) || (!(visible)))) || (!(active)))) || (!(FlxG.mouse.justReleased())))) || ((_callback == null)))){
return;
};
if (overlapsPoint(FlxG.mouse.x, FlxG.mouse.y)){
_callback();
};
}
protected function visibility(On:Boolean):void{
if (On){
_off.visible = false;
if (_offT != null){
_offT.visible = false;
};
_on.visible = true;
if (_onT != null){
_onT.visible = true;
};
} else {
_on.visible = false;
if (_onT != null){
_onT.visible = false;
};
_off.visible = true;
if (_offT != null){
_offT.visible = true;
};
};
}
public function isPressed():Boolean{
return (_pressed);
}
public function get on():Boolean{
return (_onToggle);
}
public function loadGraphic(Image:FlxSprite, ImageHighlight:FlxSprite=null):FlxButton{
_off = (replace(_off, Image) as FlxSprite);
if (ImageHighlight == null){
if (_on != _off){
remove(_on);
};
_on = _off;
} else {
_on = (replace(_on, ImageHighlight) as FlxSprite);
};
_on.solid = (_off.solid = false);
_off.scrollFactor = scrollFactor;
_on.scrollFactor = scrollFactor;
width = _off.width;
height = _off.height;
refreshHulls();
return (this);
}
public function loadText(Text:FlxText, TextHighlight:FlxText=null):FlxButton{
if (Text != null){
if (_offT == null){
_offT = Text;
add(_offT);
} else {
_offT = (replace(_offT, Text) as FlxText);
};
};
if (TextHighlight == null){
_onT = _offT;
} else {
if (_onT == null){
_onT = TextHighlight;
add(_onT);
} else {
_onT = (replace(_onT, TextHighlight) as FlxText);
};
};
_offT.scrollFactor = scrollFactor;
_onT.scrollFactor = scrollFactor;
return (this);
}
public function set on(On:Boolean):void{
_onToggle = On;
}
}
}//package org.flixel
Section 232
//FlxEmitter (org.flixel.FlxEmitter)
package org.flixel {
public class FlxEmitter extends FlxGroup {
public var maxRotation:Number;
public var delay:Number;
public var quantity:uint;
protected var _timer:Number;
public var gravity:Number;
public var particleDrag:FlxPoint;
public var maxParticleSpeed:FlxPoint;
public var on:Boolean;
protected var _explode:Boolean;
protected var _particle:uint;
public var minParticleSpeed:FlxPoint;
public var minRotation:Number;
protected var _counter:uint;
public function FlxEmitter(X:Number=0, Y:Number=0){
super();
x = X;
y = Y;
width = 0;
height = 0;
minParticleSpeed = new FlxPoint(-100, -100);
maxParticleSpeed = new FlxPoint(100, 100);
minRotation = -360;
maxRotation = 360;
gravity = 400;
particleDrag = new FlxPoint();
delay = 0.1;
quantity = 0;
_counter = 0;
_explode = true;
exists = false;
on = false;
}
public function setRotation(Min:Number=0, Max:Number=0):void{
minRotation = Min;
maxRotation = Max;
}
override public function update():void{
super.update();
updateEmitter();
}
public function setYSpeed(Min:Number=0, Max:Number=0):void{
minParticleSpeed.y = Min;
maxParticleSpeed.y = Max;
}
public function stop(Delay:Number=3):void{
_explode = true;
delay = Delay;
if (delay < 0){
delay = -(Delay);
};
on = false;
}
public function setSize(Width:uint, Height:uint):void{
width = Width;
height = Height;
}
public function at(Object:FlxObject):void{
x = (Object.x + Object.origin.x);
y = (Object.y + Object.origin.y);
}
override protected function updateMembers():void{
var o:FlxObject;
var l:uint = members.length;
var i:uint;
while (i < l) {
o = (members[i] as FlxObject);
if (((((!((o == null))) && (o.exists))) && (o.active))){
o.update();
};
i++;
};
}
public function start(Explode:Boolean=true, Delay:Number=0, Quantity:uint=0):void{
if (members.length <= 0){
FlxG.log("WARNING: there are no sprites loaded in your emitter.\nAdd some to FlxEmitter.members or use FlxEmitter.createSprites().");
return;
};
_explode = Explode;
if (!_explode){
_counter = 0;
};
if (!exists){
_particle = 0;
};
exists = true;
visible = true;
active = true;
dead = false;
on = true;
_timer = 0;
if (quantity == 0){
quantity = Quantity;
};
if (Delay != 0){
delay = Delay;
};
if (delay < 0){
delay = -(delay);
};
}
protected function updateEmitter():void{
var i:uint;
var l:uint;
if (_explode){
_timer = (_timer + FlxG.elapsed);
if ((((delay > 0)) && ((_timer > delay)))){
kill();
return;
};
if (on){
on = false;
l = members.length;
if (quantity > 0){
l = quantity;
};
l = (l + _particle);
i = _particle;
while (i < l) {
emitParticle();
i++;
};
};
return;
};
if (!on){
return;
};
_timer = (_timer + FlxG.elapsed);
while ((((_timer > delay)) && ((((quantity <= 0)) || ((_counter < quantity)))))) {
_timer = (_timer - delay);
emitParticle();
};
}
override public function kill():void{
super.kill();
on = false;
}
public function setXSpeed(Min:Number=0, Max:Number=0):void{
minParticleSpeed.x = Min;
maxParticleSpeed.x = Max;
}
public function createSprites(Graphics:Class, Quantity:uint=50, BakedRotations:uint=16, Multiple:Boolean=true, Collide:Number=0):FlxEmitter{
var r:uint;
var s:FlxSprite;
var sw:Number;
var sh:Number;
members = new Array();
var tf:uint = 1;
if (Multiple){
s = new FlxSprite(0, 0, Graphics);
tf = (s.width / s.height);
};
var i:uint;
while (i < Quantity) {
s = new FlxSprite();
if (Multiple){
r = (FlxU.random() * tf);
if (BakedRotations > 0){
s.loadRotatedGraphic(Graphics, BakedRotations, r);
} else {
s.loadGraphic(Graphics, true);
s.frame = r;
};
} else {
if (BakedRotations > 0){
s.loadRotatedGraphic(Graphics, BakedRotations);
} else {
s.loadGraphic(Graphics);
};
};
if (Collide > 0){
sw = s.width;
sh = s.height;
s.width = (s.width * Collide);
s.height = (s.height * Collide);
s.offset.x = ((sw - s.width) / 2);
s.offset.y = ((sh - s.height) / 2);
s.solid = true;
} else {
s.solid = false;
};
s.exists = false;
s.scrollFactor = scrollFactor;
add(s);
i++;
};
return (this);
}
public function emitParticle():void{
var s:FlxSprite;
_counter++;
s = (members[_particle] as FlxSprite);
s.visible = true;
s.exists = true;
s.active = true;
s.x = ((x - (s.width >> 1)) + (FlxU.random() * width));
s.y = ((y - (s.height >> 1)) + (FlxU.random() * height));
s.velocity.x = minParticleSpeed.x;
if (minParticleSpeed.x != maxParticleSpeed.x){
s.velocity.x = (s.velocity.x + (FlxU.random() * (maxParticleSpeed.x - minParticleSpeed.x)));
};
s.velocity.y = minParticleSpeed.y;
if (minParticleSpeed.y != maxParticleSpeed.y){
s.velocity.y = (s.velocity.y + (FlxU.random() * (maxParticleSpeed.y - minParticleSpeed.y)));
};
s.acceleration.y = gravity;
s.angularVelocity = minRotation;
if (minRotation != maxRotation){
s.angularVelocity = (s.angularVelocity + (FlxU.random() * (maxRotation - minRotation)));
};
if (s.angularVelocity != 0){
s.angle = ((FlxU.random() * 360) - 180);
};
s.drag.x = particleDrag.x;
s.drag.y = particleDrag.y;
s.visible = true;
_particle++;
if (_particle >= members.length){
_particle = 0;
};
s.onEmit();
}
}
}//package org.flixel
Section 233
//FlxG (org.flixel.FlxG)
package org.flixel {
import flash.display.*;
import flash.geom.*;
import org.flixel.data.*;
import flash.net.*;
public class FlxG {
public static var panel:FlxPanel;
protected static var _mute:Boolean;
public static var kong:FlxKong;
public static var scores:Array;
public static var music:FlxSound;
public static var height:uint;
protected static var _volume:Number;
public static var buffer:BitmapData;
public static var sounds:Array;
public static var debug:Boolean;
public static var LIBRARY_MINOR_VERSION:uint = 34;
public static var LIBRARY_MAJOR_VERSION:uint = 2;
public static var levels:Array;
public static var maxElapsed:Number;
public static var fade:FlxFade;
public static var timeScale:Number;
protected static var _cache:Object;
public static var level:int;
public static var elapsed:Number;
public static var score:int;
public static var save:int;
public static var saves:Array;
protected static var _scrollTarget:Point;
public static var mouse:FlxMouse;
public static var followTarget:FlxObject;
public static var followLead:Point;
public static var LIBRARY_NAME:String = "flixel";
public static var width:uint;
public static var followLerp:Number;
protected static var _game:FlxGame;
public static var scroll:Point;
public static var quake:FlxQuake;
public static var followMin:Point;
public static var FlxSave:SharedObject = SharedObject.getLocal("userData");
public static var flash:FlxFlash;
public static var followMax:Point;
public static var keys:FlxKeyboard;
protected static var _pause:Boolean;
public function FlxG(){
super();
}
public static function get stage():Stage{
if (((!((_game._state == null))) && (!((_game._state.parent == null))))){
return (_game._state.parent.stage);
};
return (null);
}
protected static function changeSounds():void{
var s:FlxSound;
if (((!((music == null))) && (music.active))){
music.updateTransform();
};
var sl:uint = sounds.length;
var i:uint;
while (i < sl) {
s = (sounds[i] as FlxSound);
if (((!((s == null))) && (s.active))){
s.updateTransform();
};
i++;
};
}
public static function get mute():Boolean{
return (_mute);
}
public static function get volume():Number{
return (_volume);
}
static function doFollow():void{
if (followTarget != null){
_scrollTarget.x = (((width >> 1) - followTarget.x) - (followTarget.width >> 1));
_scrollTarget.y = (((height >> 1) - followTarget.y) - (followTarget.height >> 1));
if (((!((followLead == null))) && ((followTarget is FlxSprite)))){
_scrollTarget.x = (_scrollTarget.x - ((followTarget as FlxSprite).velocity.x * followLead.x));
_scrollTarget.y = (_scrollTarget.y - ((followTarget as FlxSprite).velocity.y * followLead.y));
};
scroll.x = (scroll.x + (((_scrollTarget.x - scroll.x) * followLerp) * FlxG.elapsed));
scroll.y = (scroll.y + (((_scrollTarget.y - scroll.y) * followLerp) * FlxG.elapsed));
if (followMin != null){
if (scroll.x > followMin.x){
scroll.x = followMin.x;
};
if (scroll.y > followMin.y){
scroll.y = followMin.y;
};
};
if (followMax != null){
if (scroll.x < followMax.x){
scroll.x = followMax.x;
};
if (scroll.y < followMax.y){
scroll.y = followMax.y;
};
};
};
}
public static function getMuteValue():uint{
if (_mute){
return (0);
};
return (1);
}
public static function addBitmap(Graphic:Class, Reverse:Boolean=false, Unique:Boolean=false, Key:String=null):BitmapData{
var inc:uint;
var ukey:String;
var newPixels:BitmapData;
var mtx:Matrix;
var needReverse:Boolean;
var key:String = Key;
if (key == null){
key = String(Graphic);
if (((((Unique) && (!((_cache[key] == undefined))))) && (!((_cache[key] == null))))){
inc = 0;
do {
var _temp1 = inc;
inc = (inc + 1);
ukey = (key + _temp1);
} while (((!((_cache[ukey] == undefined))) && (!((_cache[ukey] == null)))));
key = ukey;
};
};
if (!checkBitmapCache(key)){
_cache[key] = new (Graphic).bitmapData;
if (Reverse){
needReverse = true;
};
};
var pixels:BitmapData = _cache[key];
if (((((!(needReverse)) && (Reverse))) && ((pixels.width == new (Graphic).bitmapData.width)))){
needReverse = true;
};
if (needReverse){
newPixels = new BitmapData((pixels.width << 1), pixels.height, true, 0);
newPixels.draw(pixels);
mtx = new Matrix();
mtx.scale(-1, 1);
mtx.translate(newPixels.width, 0);
newPixels.draw(pixels, mtx);
pixels = newPixels;
};
return (pixels);
}
public static function set state(State:FlxState):void{
_game.switchState(State);
}
public static function set mute(Mute:Boolean):void{
_mute = Mute;
changeSounds();
}
public static function play(EmbeddedSound:Class, Volume:Number=1, Looped:Boolean=false):FlxSound{
var sl:uint = sounds.length;
var i:uint;
while (i < sl) {
if (!(sounds[i] as FlxSound).active){
break;
};
i++;
};
if (sounds[i] == null){
sounds[i] = new FlxSound();
};
var s:FlxSound = sounds[i];
s.loadEmbedded(EmbeddedSound, Looped);
s.volume = Volume;
s.play();
return (s);
}
public static function set volume(Volume:Number):void{
_volume = Volume;
if (_volume < 0){
_volume = 0;
} else {
if (_volume > 1){
_volume = 1;
};
};
changeSounds();
}
static function setGameData(Game:FlxGame, Width:uint, Height:uint, Zoom:uint):void{
_game = Game;
_cache = new Object();
width = Width;
height = Height;
_mute = false;
_volume = 0.5;
sounds = new Array();
mouse = new FlxMouse();
keys = new FlxKeyboard();
scroll = null;
_scrollTarget = null;
unfollow();
FlxG.levels = new Array();
FlxG.scores = new Array();
level = 0;
score = 0;
FlxU.seed = NaN;
kong = null;
pause = false;
timeScale = 1;
framerate = 60;
frameratePaused = 10;
maxElapsed = 0.0333333;
panel = new FlxPanel();
quake = new FlxQuake(Zoom);
flash = new FlxFlash();
fade = new FlxFade();
FlxU.setWorldBounds();
}
public static function playMusic(Music:Class, Volume:Number=1):void{
if (music == null){
music = new FlxSound();
} else {
if (music.active){
music.stop();
};
};
music.loadEmbedded(Music, true);
music.volume = Volume;
music.survive = true;
music.play();
}
public static function createBitmap(Width:uint, Height:uint, Color:uint, Unique:Boolean=false, Key:String=null):BitmapData{
var inc:uint;
var ukey:String;
var key:String = Key;
if (key == null){
key = ((((Width + "x") + Height) + ":") + Color);
if (((((Unique) && (!((_cache[key] == undefined))))) && (!((_cache[key] == null))))){
inc = 0;
do {
var _temp1 = inc;
inc = (inc + 1);
ukey = (key + _temp1);
} while (((!((_cache[ukey] == undefined))) && (!((_cache[ukey] == null)))));
key = ukey;
};
};
if (!checkBitmapCache(key)){
_cache[key] = new BitmapData(Width, Height, true, Color);
};
return (_cache[key]);
}
public static function get frameratePaused():uint{
return (_game._frameratePaused);
}
public static function log(Data:Object):void{
if (((!((_game == null))) && (!((_game._console == null))))){
_game._console.log(((Data)==null) ? "ERROR: null object" : Data.toString());
};
}
public static function checkBitmapCache(Key:String):Boolean{
return (((!((_cache[Key] == undefined))) && (!((_cache[Key] == null)))));
}
static function updateSounds():void{
var s:FlxSound;
if (((!((music == null))) && (music.active))){
music.update();
};
var sl:uint = sounds.length;
var i:uint;
while (i < sl) {
s = (sounds[i] as FlxSound);
if (((!((s == null))) && (s.active))){
s.update();
};
i++;
};
}
static function updateInput():void{
keys.update();
mouse.update(state.mouseX, state.mouseY, scroll.x, scroll.y);
}
public static function stream(URL:String, Volume:Number=1, Looped:Boolean=false):FlxSound{
var sl:uint = sounds.length;
var i:uint;
while (i < sl) {
if (!(sounds[i] as FlxSound).active){
break;
};
i++;
};
if (sounds[i] == null){
sounds[i] = new FlxSound();
};
var s:FlxSound = sounds[i];
s.loadStream(URL, Looped);
s.volume = Volume;
s.play();
return (s);
}
static function unfollow():void{
followTarget = null;
followLead = null;
followLerp = 1;
followMin = null;
followMax = null;
if (scroll == null){
scroll = new Point();
} else {
scroll.x = (scroll.y = 0);
};
if (_scrollTarget == null){
_scrollTarget = new Point();
} else {
_scrollTarget.x = (_scrollTarget.y = 0);
};
}
public static function get state():FlxState{
return (_game._state);
}
protected static function playSounds():void{
var s:FlxSound;
if (((!((music == null))) && (music.active))){
music.play();
};
var sl:uint = sounds.length;
var i:uint;
while (i < sl) {
s = (sounds[i] as FlxSound);
if (((!((s == null))) && (s.active))){
s.play();
};
i++;
};
}
public static function followAdjust(LeadX:Number=0, LeadY:Number=0):void{
followLead = new Point(LeadX, LeadY);
}
public static function set framerate(Framerate:uint):void{
_game._framerate = Framerate;
if (((!(_game._paused)) && (!((_game.stage == null))))){
_game.stage.frameRate = Framerate;
};
}
public static function follow(Target:FlxObject, Lerp:Number=1):void{
followTarget = Target;
followLerp = Lerp;
_scrollTarget.x = (((width >> 1) - followTarget.x) - (followTarget.width >> 1));
_scrollTarget.y = (((height >> 1) - followTarget.y) - (followTarget.height >> 1));
scroll.x = _scrollTarget.x;
scroll.y = _scrollTarget.y;
doFollow();
}
public static function set frameratePaused(Framerate:uint):void{
_game._frameratePaused = Framerate;
if (((_game._paused) && (!((_game.stage == null))))){
_game.stage.frameRate = Framerate;
};
}
public static function resetInput():void{
keys.reset();
mouse.reset();
}
public static function get framerate():uint{
return (_game._framerate);
}
public static function followBounds(MinX:int=0, MinY:int=0, MaxX:int=0, MaxY:int=0, UpdateWorldBounds:Boolean=true):void{
followMin = new Point(-(MinX), -(MinY));
followMax = new Point((-(MaxX) + width), (-(MaxY) + height));
if (followMax.x > followMin.x){
followMax.x = followMin.x;
};
if (followMax.y > followMin.y){
followMax.y = followMin.y;
};
if (UpdateWorldBounds){
FlxU.setWorldBounds(MinX, MinY, (MaxX - MinX), (MaxY - MinY));
};
doFollow();
}
protected static function pauseSounds():void{
var s:FlxSound;
if (((!((music == null))) && (music.active))){
music.pause();
};
var sl:uint = sounds.length;
var i:uint;
while (i < sl) {
s = (sounds[i] as FlxSound);
if (((!((s == null))) && (s.active))){
s.pause();
};
i++;
};
}
static function destroySounds(ForceDestroy:Boolean=false):void{
var s:FlxSound;
if (sounds == null){
return;
};
if (((!((music == null))) && (((ForceDestroy) || (!(music.survive)))))){
music.destroy();
};
var sl:uint = sounds.length;
var i:uint;
while (i < sl) {
s = (sounds[i] as FlxSound);
if (((!((s == null))) && (((ForceDestroy) || (!(s.survive)))))){
s.destroy();
};
i++;
};
}
public static function set pause(Pause:Boolean):void{
var op:Boolean = _pause;
_pause = Pause;
if (_pause != op){
if (_pause){
_game.pauseGame();
pauseSounds();
} else {
_game.unpauseGame();
playSounds();
};
};
}
public static function get pause():Boolean{
return (_pause);
}
}
}//package org.flixel
Section 234
//FlxGame (org.flixel.FlxGame)
package org.flixel {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import org.flixel.data.*;
import flash.text.*;
import flash.utils.*;
import flash.ui.*;
public class FlxGame extends Sprite {
protected var SndFlixel:Class;
var _screen:Sprite;
var _state:FlxState;
protected var SndBeep:Class;
var _console:FlxConsole;
var _gameXOffset:int;
var _frameratePaused:uint;
var _created:Boolean;
var _zoom:uint;
var _elapsed:Number;
var _total:uint;
var _soundTrayBars:Array;
var _iState:Class;
protected var junk:String;// = "FlxGame_junk"
var _zeroPoint:Point;
var _paused:Boolean;
public var useDefaultHotKeys:Boolean;
var _framerate:uint;
var _gameYOffset:int;
var _buffer:Bitmap;
var _soundTray:Sprite;
var _frame:Class;
public var pause:FlxGroup;
var _soundTrayTimer:Number;
public function FlxGame(GameSizeX:uint, GameSizeY:uint, InitialState:Class, Zoom:uint=2){
SndBeep = FlxGame_SndBeep;
SndFlixel = FlxGame_SndFlixel;
super();
Mouse.hide();
_zoom = Zoom;
FlxState.bgColor = 4278190080;
FlxG.setGameData(this, GameSizeX, GameSizeY, Zoom);
_elapsed = 0;
_total = 0;
pause = new FlxPause();
_state = null;
_iState = InitialState;
_zeroPoint = new Point();
useDefaultHotKeys = true;
_frame = null;
_gameXOffset = 0;
_gameYOffset = 0;
_paused = false;
_created = false;
addEventListener(Event.ENTER_FRAME, create);
}
function pauseGame():void{
if (((!((x == 0))) || (!((y == 0))))){
x = 0;
y = 0;
};
Mouse.show();
_paused = true;
stage.frameRate = _frameratePaused;
}
function unpauseGame():void{
if (!FlxG.panel.visible){
Mouse.hide();
};
FlxG.resetInput();
_paused = false;
stage.frameRate = _framerate;
}
protected function onFocus(event:Event=null):void{
if (FlxG.pause){
FlxG.pause = false;
};
}
protected function onKeyUp(event:KeyboardEvent):void{
var c:int;
var code:String;
if ((((event.keyCode == 192)) || ((event.keyCode == 220)))){
_console.toggle();
return;
};
if (useDefaultHotKeys){
c = event.keyCode;
code = String.fromCharCode(event.charCode);
switch (c){
case 48:
case 96:
FlxG.mute = !(FlxG.mute);
showSoundTray();
return;
case 109:
case 189:
FlxG.mute = false;
FlxG.volume = (FlxG.volume - 0.1);
showSoundTray();
return;
case 107:
case 187:
FlxG.mute = false;
FlxG.volume = (FlxG.volume + 0.1);
showSoundTray();
return;
case 80:
FlxG.pause = !(FlxG.pause);
default:
break;
};
};
FlxG.keys.handleKeyUp(event);
}
public function switchState(State:FlxState):void{
FlxG.panel.hide();
FlxG.unfollow();
FlxG.resetInput();
FlxG.destroySounds();
FlxG.flash.stop();
FlxG.fade.stop();
FlxG.quake.stop();
_screen.x = 0;
_screen.y = 0;
_screen.addChild(State);
if (_state != null){
_state.destroy();
_screen.swapChildren(State, _state);
_screen.removeChild(_state);
};
_state = State;
_state.scaleX = (_state.scaleY = _zoom);
_state.create();
}
protected function update(event:Event):void{
var i:uint;
var soundPrefs:FlxSave;
var mark:uint = getTimer();
var ems:uint = (mark - _total);
_elapsed = (ems / 1000);
_console.mtrTotal.add(ems);
_total = mark;
FlxG.elapsed = _elapsed;
if (FlxG.elapsed > FlxG.maxElapsed){
FlxG.elapsed = FlxG.maxElapsed;
};
FlxG.elapsed = (FlxG.elapsed * FlxG.timeScale);
if (_soundTray != null){
if (_soundTrayTimer > 0){
_soundTrayTimer = (_soundTrayTimer - _elapsed);
} else {
if (_soundTray.y > -(_soundTray.height)){
_soundTray.y = (_soundTray.y - ((_elapsed * FlxG.height) * 2));
if (_soundTray.y <= -(_soundTray.height)){
_soundTray.visible = false;
soundPrefs = new FlxSave();
if (soundPrefs.bind("flixel")){
if (soundPrefs.data.sound == null){
soundPrefs.data.sound = new Object();
};
soundPrefs.data.mute = FlxG.mute;
soundPrefs.data.volume = FlxG.volume;
soundPrefs.forceSave();
};
};
};
};
};
FlxG.panel.update();
if (_console.visible){
_console.update();
};
FlxG.updateInput();
FlxG.updateSounds();
if (_paused){
pause.update();
} else {
FlxG.doFollow();
_state.update();
if (FlxG.flash.exists){
FlxG.flash.update();
};
if (FlxG.fade.exists){
FlxG.fade.update();
};
FlxG.quake.update();
_screen.x = FlxG.quake.x;
_screen.y = FlxG.quake.y;
};
var updateMark:uint = getTimer();
_console.mtrUpdate.add((updateMark - mark));
FlxG.buffer.lock();
_state.preProcess();
_state.render();
if (FlxG.flash.exists){
FlxG.flash.render();
};
if (FlxG.fade.exists){
FlxG.fade.render();
};
if (FlxG.panel.visible){
FlxG.panel.render();
};
if (FlxG.mouse.cursor != null){
if (FlxG.mouse.cursor.active){
FlxG.mouse.cursor.update();
};
if (FlxG.mouse.cursor.visible){
FlxG.mouse.cursor.render();
};
};
_state.postProcess();
if (_paused){
pause.render();
};
FlxG.buffer.unlock();
_console.mtrRender.add((getTimer() - updateMark));
}
protected function addFrame(Frame:Class, ScreenOffsetX:uint, ScreenOffsetY:uint):FlxGame{
_frame = Frame;
_gameXOffset = ScreenOffsetX;
_gameYOffset = ScreenOffsetY;
return (this);
}
public function showSoundTray(Silent:Boolean=false):void{
if (!Silent){
FlxG.play(SndBeep);
};
_soundTrayTimer = 1;
_soundTray.y = (_gameYOffset * _zoom);
_soundTray.visible = true;
var gv:uint = Math.round((FlxG.volume * 10));
if (FlxG.mute){
gv = 0;
};
var i:uint;
while (i < _soundTrayBars.length) {
if (i < gv){
_soundTrayBars[i].alpha = 1;
} else {
_soundTrayBars[i].alpha = 0.5;
};
i++;
};
}
function create(event:Event):void{
var i:uint;
var soundPrefs:FlxSave;
var bmp:Bitmap;
if (root == null){
return;
};
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.frameRate = _framerate;
_screen = new Sprite();
addChild(_screen);
var tmp:Bitmap = new Bitmap(new BitmapData(FlxG.width, FlxG.height, true, FlxState.bgColor));
tmp.x = _gameXOffset;
tmp.y = _gameYOffset;
tmp.scaleX = (tmp.scaleY = _zoom);
_screen.addChild(tmp);
FlxG.buffer = tmp.bitmapData;
_console = new FlxConsole(_gameXOffset, _gameYOffset, _zoom);
addChild(_console);
var vstring:String = ((((FlxG.LIBRARY_NAME + " v") + FlxG.LIBRARY_MAJOR_VERSION) + ".") + FlxG.LIBRARY_MINOR_VERSION);
if (FlxG.debug){
vstring = (vstring + " [debug]");
} else {
vstring = (vstring + " [release]");
};
var underline:String = "";
i = 0;
while (i < (vstring.length + 32)) {
underline = (underline + "-");
i++;
};
FlxG.log(vstring);
FlxG.log(underline);
stage.addEventListener(KeyboardEvent.KEY_DOWN, FlxG.keys.handleKeyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
stage.addEventListener(MouseEvent.MOUSE_DOWN, FlxG.mouse.handleMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, FlxG.mouse.handleMouseUp);
stage.addEventListener(MouseEvent.MOUSE_OUT, FlxG.mouse.handleMouseOut);
stage.addEventListener(MouseEvent.MOUSE_OVER, FlxG.mouse.handleMouseOver);
stage.addEventListener(Event.DEACTIVATE, onFocusLost);
stage.addEventListener(Event.ACTIVATE, onFocus);
_soundTray = new Sprite();
_soundTray.visible = false;
_soundTray.scaleX = 2;
_soundTray.scaleY = 2;
tmp = new Bitmap(new BitmapData(80, 30, true, 2130706432));
_soundTray.x = (((_gameXOffset + (FlxG.width / 2)) * _zoom) - ((tmp.width / 2) * _soundTray.scaleX));
_soundTray.addChild(tmp);
var text:TextField = new TextField();
text.width = tmp.width;
text.height = tmp.height;
text.multiline = true;
text.wordWrap = true;
text.selectable = false;
text.embedFonts = true;
text.antiAliasType = AntiAliasType.NORMAL;
text.gridFitType = GridFitType.PIXEL;
text.defaultTextFormat = new TextFormat("system", 8, 0xFFFFFF, null, null, null, null, null, "center");
_soundTray.addChild(text);
text.text = "VOLUME";
text.y = 16;
var bx:uint = 10;
var by:uint = 14;
_soundTrayBars = new Array();
i = 0;
while (i < 10) {
tmp = new Bitmap(new BitmapData(4, (i + 1), false, 0xFFFFFF));
tmp.x = bx;
tmp.y = by;
_soundTrayBars.push(_soundTray.addChild(tmp));
bx = (bx + 6);
by--;
i++;
};
addChild(_soundTray);
if (_frame != null){
bmp = new _frame();
bmp.scaleX = _zoom;
bmp.scaleY = _zoom;
addChild(bmp);
};
soundPrefs = new FlxSave();
if (((soundPrefs.bind("flixel")) && (!((soundPrefs.data.sound == null))))){
if (soundPrefs.data.volume != null){
FlxG.volume = soundPrefs.data.volume;
};
if (soundPrefs.data.mute != null){
FlxG.mute = soundPrefs.data.mute;
};
showSoundTray(true);
};
switchState(new _iState());
FlxState.screen.unsafeBind(FlxG.buffer);
removeEventListener(Event.ENTER_FRAME, create);
addEventListener(Event.ENTER_FRAME, update);
}
protected function onFocusLost(event:Event=null):void{
FlxG.pause = true;
}
}
}//package org.flixel
Section 235
//FlxGame_junk (org.flixel.FlxGame_junk)
package org.flixel {
import mx.core.*;
public class FlxGame_junk extends FontAsset {
}
}//package org.flixel
Section 236
//FlxGame_SndBeep (org.flixel.FlxGame_SndBeep)
package org.flixel {
import mx.core.*;
public class FlxGame_SndBeep extends SoundAsset {
}
}//package org.flixel
Section 237
//FlxGame_SndFlixel (org.flixel.FlxGame_SndFlixel)
package org.flixel {
import mx.core.*;
public class FlxGame_SndFlixel extends SoundAsset {
}
}//package org.flixel
Section 238
//FlxGroup (org.flixel.FlxGroup)
package org.flixel {
public class FlxGroup extends FlxObject {
public var members:Array;
protected var _first:Boolean;
protected var _last:FlxPoint;
public function FlxGroup(){
super();
_group = true;
solid = false;
members = new Array();
_last = new FlxPoint();
_first = true;
}
public function getFirstExtant():FlxObject{
var o:FlxObject;
var ml:uint = members.length;
var i:uint;
while (i < ml) {
o = (members[i] as FlxObject);
if (((!((o == null))) && (o.exists))){
return (o);
};
i++;
};
return (null);
}
override public function destroy():void{
destroyMembers();
super.destroy();
}
public function getFirstAlive():FlxObject{
var o:FlxObject;
var ml:uint = members.length;
var i:uint;
while (i < ml) {
o = (members[i] as FlxObject);
if (((((!((o == null))) && (o.exists))) && (!(o.dead)))){
return (o);
};
i++;
};
return (null);
}
public function remove(Object:FlxObject, Splice:Boolean=false):FlxObject{
var index:int = members.indexOf(Object);
if ((((index < 0)) || ((index >= members.length)))){
return (null);
};
if (Splice){
members.splice(index, 1);
} else {
members[index] = null;
};
return (Object);
}
override public function update():void{
saveOldPosition();
updateMotion();
updateMembers();
updateFlickering();
}
public function resetFirstAvail(X:Number=0, Y:Number=0):Boolean{
var o:FlxObject = getFirstAvail();
if (o == null){
return (false);
};
o.reset(X, Y);
return (true);
}
override public function reset(X:Number, Y:Number):void{
var mx:Number;
var my:Number;
var o:FlxObject;
saveOldPosition();
super.reset(X, Y);
var moved:Boolean;
if (((!((x == _last.x))) || (!((y == _last.y))))){
moved = true;
mx = (x - _last.x);
my = (y - _last.y);
};
var l:uint = members.length;
var i:uint;
while (i < l) {
o = (members[i] as FlxObject);
if (((!((o == null))) && (o.exists))){
if (moved){
if (o._group){
o.reset((o.x + mx), (o.y + my));
} else {
o.x = (o.x + mx);
o.y = (o.y + my);
if (solid){
o.colHullX.width = (o.colHullX.width + ((mx)>0) ? mx : -(mx));
if (mx < 0){
o.colHullX.x = (o.colHullX.x + mx);
};
o.colHullY.x = x;
o.colHullY.height = (o.colHullY.height + ((my)>0) ? my : -(my));
if (my < 0){
o.colHullY.y = (o.colHullY.y + my);
};
o.colVector.x = (o.colVector.x + mx);
o.colVector.y = (o.colVector.y + my);
};
};
};
};
i++;
};
}
protected function updateMembers():void{
var mx:Number;
var my:Number;
var o:FlxObject;
var moved:Boolean;
if (((!((x == _last.x))) || (!((y == _last.y))))){
moved = true;
mx = (x - _last.x);
my = (y - _last.y);
};
var l:uint = members.length;
var i:uint;
while (i < l) {
o = (members[i] as FlxObject);
if (((!((o == null))) && (o.exists))){
if (moved){
if (o._group){
o.reset((o.x + mx), (o.y + my));
} else {
o.x = (o.x + mx);
o.y = (o.y + my);
};
};
if (o.active){
o.update();
};
if (((moved) && (o.solid))){
o.colHullX.width = (o.colHullX.width + ((mx)>0) ? mx : -(mx));
if (mx < 0){
o.colHullX.x = (o.colHullX.x + mx);
};
o.colHullY.x = x;
o.colHullY.height = (o.colHullY.height + ((my)>0) ? my : -(my));
if (my < 0){
o.colHullY.y = (o.colHullY.y + my);
};
o.colVector.x = (o.colVector.x + mx);
o.colVector.y = (o.colVector.y + my);
};
};
i++;
};
}
public function countDead():int{
var o:FlxObject;
var count = -1;
var ml:uint = members.length;
var i:uint;
while (i < ml) {
o = (members[i] as FlxObject);
if (o != null){
if (count < 0){
count = 0;
};
if (o.dead){
count++;
};
};
i++;
};
return (count);
}
public function getFirstAvail():FlxObject{
var o:FlxObject;
var ml:uint = members.length;
var i:uint;
while (i < ml) {
o = (members[i] as FlxObject);
if (((!((o == null))) && (!(o.exists)))){
return (o);
};
i++;
};
return (null);
}
override public function render():void{
renderMembers();
}
public function countLiving():int{
var o:FlxObject;
var count = -1;
var ml:uint = members.length;
var i:uint;
while (i < ml) {
o = (members[i] as FlxObject);
if (o != null){
if (count < 0){
count = 0;
};
if (((o.exists) && (!(o.dead)))){
count++;
};
};
i++;
};
return (count);
}
public function countOnScreen():int{
var o:FlxObject;
var count = -1;
var ml:uint = members.length;
var i:uint;
while (i < ml) {
o = (members[i] as FlxObject);
if (o != null){
if (count < 0){
count = 0;
};
if (o.onScreen()){
count++;
};
};
i++;
};
return (count);
}
protected function killMembers():void{
var o:FlxObject;
var l:uint = members.length;
var i:uint;
while (i < l) {
o = (members[i] as FlxObject);
if (o != null){
o.kill();
};
i++;
};
}
override public function kill():void{
killMembers();
super.kill();
}
public function getFirstNull():int{
var ml:uint = members.length;
var i:uint;
while (i < ml) {
if (members[i] == null){
return (i);
};
i++;
};
return (-1);
}
protected function renderMembers():void{
var o:FlxObject;
var l:uint = members.length;
var i:uint;
while (i < l) {
o = (members[i] as FlxObject);
if (((((!((o == null))) && (o.exists))) && (o.visible))){
o.render();
};
i++;
};
}
public function add(Object:FlxObject, ShareScroll:Boolean=false):FlxObject{
members.push(Object);
if (ShareScroll){
Object.scrollFactor = scrollFactor;
};
return (Object);
}
protected function saveOldPosition():void{
if (_first){
_first = false;
_last.x = 0;
_last.y = 0;
return;
};
_last.x = x;
_last.y = y;
}
public function replace(OldObject:FlxObject, NewObject:FlxObject):FlxObject{
var index:int = members.indexOf(OldObject);
if ((((index < 0)) || ((index >= members.length)))){
return (null);
};
members[index] = NewObject;
return (NewObject);
}
public function getRandom():FlxObject{
var c:uint;
var o:FlxObject;
var l:uint = members.length;
var i:uint = uint((FlxU.random() * l));
while ((((o == null)) && ((c < members.length)))) {
++i;
o = (members[(i % l)] as FlxObject);
c++;
};
return (o);
}
public function getFirstDead():FlxObject{
var o:FlxObject;
var ml:uint = members.length;
var i:uint;
while (i < ml) {
o = (members[i] as FlxObject);
if (((!((o == null))) && (o.dead))){
return (o);
};
i++;
};
return (null);
}
protected function destroyMembers():void{
var o:FlxObject;
var l:uint = members.length;
var i:uint;
while (i < l) {
o = (members[i] as FlxObject);
if (o != null){
o.destroy();
};
i++;
};
members.length = 0;
}
}
}//package org.flixel
Section 239
//FlxMonitor (org.flixel.FlxMonitor)
package org.flixel {
public class FlxMonitor {
protected var _size:uint;
protected var _itr:uint;
protected var _data:Array;
public function FlxMonitor(Size:uint, Default:Number=0){
super();
_size = Size;
if (_size <= 0){
_size = 1;
};
_itr = 0;
_data = new Array(_size);
var i:uint;
while (i < _size) {
_data[i] = Default;
i++;
};
}
public function add(Data:Number):void{
var _local2 = _itr++;
_data[_local2] = Data;
if (_itr >= _size){
_itr = 0;
};
}
public function average():Number{
var sum:Number = 0;
var i:uint;
while (i < _size) {
sum = (sum + _data[i]);
i++;
};
return ((sum / _size));
}
}
}//package org.flixel
Section 240
//FlxObject (org.flixel.FlxObject)
package org.flixel {
import flash.geom.*;
public class FlxObject extends FlxRect {
public var acceleration:FlxPoint;
public var angularAcceleration:Number;
public var active:Boolean;
public var collideBottom:Boolean;
var _group:Boolean;
protected var _point:FlxPoint;
public var colHullX:FlxRect;
protected var _flickerTimer:Number;
public var colHullY:FlxRect;
protected var _flashPoint:Point;
public var colOffsets:Array;
public var solid:Boolean;
public var origin:FlxPoint;
public var drag:FlxPoint;
public var angularDrag:Number;
public var collideTop:Boolean;
protected var _flicker:Boolean;
protected var _rect:FlxRect;
public var moves:Boolean;
public var angle:Number;
public var thrust:Number;
public var health:Number;
public var velocity:FlxPoint;
public var maxAngular:Number;
public var angularVelocity:Number;
public var maxVelocity:FlxPoint;
public var exists:Boolean;
public var collideLeft:Boolean;
public var colVector:FlxPoint;
public var maxThrust:Number;
public var onFloor:Boolean;
public var dead:Boolean;
public var fixed:Boolean;
public var visible:Boolean;
public var scrollFactor:FlxPoint;
public var collideRight:Boolean;
protected static const _pZero:FlxPoint = new FlxPoint();
public function FlxObject(X:Number=0, Y:Number=0, Width:Number=0, Height:Number=0){
super(X, Y, Width, Height);
exists = true;
active = true;
visible = true;
solid = true;
fixed = false;
moves = true;
collideLeft = true;
collideRight = true;
collideTop = true;
collideBottom = true;
origin = new FlxPoint();
velocity = new FlxPoint();
acceleration = new FlxPoint();
drag = new FlxPoint();
maxVelocity = new FlxPoint(10000, 10000);
angle = 0;
angularVelocity = 0;
angularAcceleration = 0;
angularDrag = 0;
maxAngular = 10000;
thrust = 0;
scrollFactor = new FlxPoint(1, 1);
_flicker = false;
_flickerTimer = -1;
health = 1;
dead = false;
_point = new FlxPoint();
_rect = new FlxRect();
_flashPoint = new Point();
colHullX = new FlxRect();
colHullY = new FlxRect();
colVector = new FlxPoint();
colOffsets = new Array(new FlxPoint());
_group = false;
}
public function onScreen():Boolean{
getScreenXY(_point);
if (((((((((_point.x + width) < 0)) || ((_point.x > FlxG.width)))) || (((_point.y + height) < 0)))) || ((_point.y > FlxG.height)))){
return (false);
};
return (true);
}
public function kill():void{
exists = false;
dead = true;
}
protected function updateFlickering():void{
if (flickering()){
if (_flickerTimer > 0){
_flickerTimer = (_flickerTimer - FlxG.elapsed);
if (_flickerTimer == 0){
_flickerTimer = -1;
};
};
if (_flickerTimer < 0){
flicker(-1);
} else {
_flicker = !(_flicker);
visible = !(_flicker);
};
};
}
public function render():void{
}
public function hitBottom(Contact:FlxObject, Velocity:Number):void{
onFloor = true;
if (!fixed){
velocity.y = Velocity;
};
}
public function overlaps(Object:FlxObject):Boolean{
var ts:FlxSprite;
var os:FlxSprite;
getScreenXY(_point);
var tx:Number = _point.x;
var ty:Number = _point.y;
var tw:Number = width;
var th:Number = height;
if ((this is FlxSprite)){
ts = (this as FlxSprite);
tw = ts.frameWidth;
th = ts.frameHeight;
};
Object.getScreenXY(_point);
var ox:Number = _point.x;
var oy:Number = _point.y;
var ow:Number = Object.width;
var oh:Number = Object.height;
if ((Object is FlxSprite)){
os = (Object as FlxSprite);
ow = os.frameWidth;
oh = os.frameHeight;
};
if ((((((((ox <= (tx - ow))) || ((ox >= (tx + tw))))) || ((oy <= (ty - oh))))) || ((oy >= (ty + th))))){
return (false);
};
return (true);
}
public function overlapsPoint(X:Number, Y:Number, PerPixel:Boolean=false):Boolean{
X = (X + FlxU.floor(FlxG.scroll.x));
Y = (Y + FlxU.floor(FlxG.scroll.y));
getScreenXY(_point);
if ((((((((X <= _point.x)) || ((X >= (_point.x + width))))) || ((Y <= _point.y)))) || ((Y >= (_point.y + height))))){
return (false);
};
return (true);
}
public function hurt(Damage:Number):void{
if ((health = (health - Damage)) <= 0){
kill();
};
}
public function refreshHulls():void{
colHullX.x = x;
colHullX.y = y;
colHullX.width = width;
colHullX.height = height;
colHullY.x = x;
colHullY.y = y;
colHullY.width = width;
colHullY.height = height;
}
public function preCollide(Object:FlxObject):void{
}
public function hitLeft(Contact:FlxObject, Velocity:Number):void{
if (!fixed){
velocity.x = Velocity;
};
}
public function collide(Object:FlxObject=null):Boolean{
return (FlxU.collide(this, ((Object)==null) ? this : Object));
}
public function reset(X:Number, Y:Number):void{
x = X;
y = Y;
exists = true;
dead = false;
}
public function update():void{
updateMotion();
updateFlickering();
}
public function hitTop(Contact:FlxObject, Velocity:Number):void{
if (!fixed){
velocity.y = Velocity;
};
}
protected function updateMotion():void{
var vc:Number;
var thrustComponents:FlxPoint;
var maxComponents:FlxPoint;
var max:Number;
if (!moves){
return;
};
if (solid){
refreshHulls();
};
onFloor = false;
vc = ((FlxU.computeVelocity(angularVelocity, angularAcceleration, angularDrag, maxAngular) - angularVelocity) / 2);
angularVelocity = (angularVelocity + vc);
angle = (angle + (angularVelocity * FlxG.elapsed));
angularVelocity = (angularVelocity + vc);
if (thrust != 0){
thrustComponents = FlxU.rotatePoint(-(thrust), 0, 0, 0, angle);
maxComponents = FlxU.rotatePoint(-(maxThrust), 0, 0, 0, angle);
max = ((maxComponents.x)>0) ? maxComponents.x : -(maxComponents.x);
if (max > ((maxComponents.y)>0) ? maxComponents.y : -(maxComponents.y)){
maxComponents.y = max;
} else {
max = ((maxComponents.y)>0) ? maxComponents.y : -(maxComponents.y);
};
maxVelocity.x = (maxVelocity.y = ((max)>0) ? max : -(max));
} else {
thrustComponents = _pZero;
};
vc = ((FlxU.computeVelocity(velocity.x, (acceleration.x + thrustComponents.x), drag.x, maxVelocity.x) - velocity.x) / 2);
velocity.x = (velocity.x + vc);
var xd:Number = (velocity.x * FlxG.elapsed);
velocity.x = (velocity.x + vc);
vc = ((FlxU.computeVelocity(velocity.y, (acceleration.y + thrustComponents.y), drag.y, maxVelocity.y) - velocity.y) / 2);
velocity.y = (velocity.y + vc);
var yd:Number = (velocity.y * FlxG.elapsed);
velocity.y = (velocity.y + vc);
x = (x + xd);
y = (y + yd);
if (!solid){
return;
};
colVector.x = xd;
colVector.y = yd;
colHullX.width = (colHullX.width + ((colVector.x)>0) ? colVector.x : -(colVector.x));
if (colVector.x < 0){
colHullX.x = (colHullX.x + colVector.x);
};
colHullY.x = x;
colHullY.height = (colHullY.height + ((colVector.y)>0) ? colVector.y : -(colVector.y));
if (colVector.y < 0){
colHullY.y = (colHullY.y + colVector.y);
};
}
public function flickering():Boolean{
return ((_flickerTimer >= 0));
}
public function hitRight(Contact:FlxObject, Velocity:Number):void{
if (!fixed){
velocity.x = Velocity;
};
}
public function destroy():void{
}
public function getScreenXY(Point:FlxPoint=null):FlxPoint{
if (Point == null){
Point = new FlxPoint();
};
Point.x = (FlxU.floor((x + FlxU.roundingError)) + FlxU.floor((FlxG.scroll.x * scrollFactor.x)));
Point.y = (FlxU.floor((y + FlxU.roundingError)) + FlxU.floor((FlxG.scroll.y * scrollFactor.y)));
return (Point);
}
public function flicker(Duration:Number=1):void{
_flickerTimer = Duration;
if (_flickerTimer < 0){
_flicker = false;
visible = true;
};
}
}
}//package org.flixel
Section 241
//FlxPoint (org.flixel.FlxPoint)
package org.flixel {
public class FlxPoint {
public var x:Number;
public var y:Number;
public function FlxPoint(X:Number=0, Y:Number=0){
super();
x = X;
y = Y;
}
public function toString():String{
return (FlxU.getClassName(this, true));
}
}
}//package org.flixel
Section 242
//FlxPreloader (org.flixel.FlxPreloader)
package org.flixel {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
public class FlxPreloader extends MovieClip {
protected var _height:uint;
protected var _width:uint;
protected var ImgLogoLight:Class;
protected var _logo:Bitmap;
protected var _text:TextField;
protected var _min:uint;
protected var _buffer:Sprite;
public var className:String;
public var myURL:String;
protected var _bmpBar:Bitmap;
protected var ImgLogo:Class;
protected var _init:Boolean;
protected var ImgLogoCorners:Class;
protected var _logoGlow:Bitmap;
public var minDisplayTime:Number;
public function FlxPreloader(){
var tmp:Bitmap;
var re:RegExp;
var fmt:TextFormat;
var txt:TextField;
ImgLogo = FlxPreloader_ImgLogo;
ImgLogoCorners = FlxPreloader_ImgLogoCorners;
ImgLogoLight = FlxPreloader_ImgLogoLight;
super();
minDisplayTime = 0;
stop();
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
throw (new Error("Setting global debug flag..."));
//unresolved jump
var _slot1 = e;
re = /\[.*:[0-9]+\]/;
FlxG.debug = re.test(_slot1.getStackTrace());
if (((((!(FlxG.debug)) && (!((myURL == null))))) && ((root.loaderInfo.url.indexOf(myURL) < 0)))){
tmp = new Bitmap(new BitmapData(stage.stageWidth, stage.stageHeight, true, 4294967295));
addChild(tmp);
fmt = new TextFormat();
fmt.color = 0;
fmt.size = 16;
fmt.align = "center";
fmt.bold = true;
fmt.font = "system";
txt = new TextField();
txt.width = (tmp.width - 16);
txt.height = (tmp.height - 16);
txt.y = 8;
txt.multiline = true;
txt.wordWrap = true;
txt.embedFonts = true;
txt.defaultTextFormat = fmt;
txt.text = (("Hi there! It looks like somebody copied this game without my permission. Just click anywhere, or copy-paste this URL into your browser.\n\n" + myURL) + "\n\nto play the game at my site. Thanks, and have fun!");
addChild(txt);
txt.addEventListener(MouseEvent.CLICK, goToMyURL);
tmp.addEventListener(MouseEvent.CLICK, goToMyURL);
return;
};
_init = false;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
protected function update(Percent:Number):void{
_bmpBar.scaleX = (Percent * (_width - 8));
_text.text = (((((("FLX v" + FlxG.LIBRARY_MAJOR_VERSION) + ".") + FlxG.LIBRARY_MINOR_VERSION) + " ") + FlxU.floor((Percent * 100))) + "%");
_text.setTextFormat(_text.defaultTextFormat);
if (Percent < 0.1){
_logoGlow.alpha = 0;
_logo.alpha = 0;
} else {
if (Percent < 0.15){
_logoGlow.alpha = FlxU.random(false);
_logo.alpha = 0;
} else {
if (Percent < 0.2){
_logoGlow.alpha = 0;
_logo.alpha = 0;
} else {
if (Percent < 0.25){
_logoGlow.alpha = 0;
_logo.alpha = FlxU.random(false);
} else {
if (Percent < 0.7){
_logoGlow.alpha = ((Percent - 0.45) / 0.45);
_logo.alpha = 1;
} else {
if ((((Percent > 0.8)) && ((Percent < 0.9)))){
_logoGlow.alpha = (1 - ((Percent - 0.8) / 0.1));
_logo.alpha = 0;
} else {
if (Percent > 0.9){
_buffer.alpha = (1 - ((Percent - 0.9) / 0.1));
};
};
};
};
};
};
};
}
private function goToMyURL(event:MouseEvent=null):void{
navigateToURL(new URLRequest(("http://" + myURL)));
}
private function onEnterFrame(event:Event):void{
var i:int;
var mainClass:Class;
var app:Object;
var percent:Number;
if (!_init){
if ((((stage.stageWidth <= 0)) || ((stage.stageHeight <= 0)))){
return;
};
create();
_init = true;
};
graphics.clear();
var time:uint = getTimer();
if ((((framesLoaded >= totalFrames)) && ((time > _min)))){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
nextFrame();
mainClass = Class(getDefinitionByName(className));
if (mainClass){
app = new (mainClass);
addChild((app as DisplayObject));
};
removeChild(_buffer);
} else {
percent = (root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal);
if ((((_min > 0)) && ((percent > (time / _min))))){
percent = (time / _min);
};
update(percent);
};
}
protected function create():void{
var j:uint;
_min = 0;
if (!FlxG.debug){
_min = (minDisplayTime * 1000);
};
_buffer = new Sprite();
_buffer.scaleX = 2;
_buffer.scaleY = 2;
addChild(_buffer);
_width = (stage.stageWidth / _buffer.scaleX);
_height = (stage.stageHeight / _buffer.scaleY);
_buffer.addChild(new Bitmap(new BitmapData(_width, _height, false, 13406)));
var b:Bitmap = new ImgLogoLight();
b.smoothing = true;
b.width = (b.height = _height);
b.x = ((_width - b.width) / 2);
_buffer.addChild(b);
_bmpBar = new Bitmap(new BitmapData(1, 7, false, 6253311));
_bmpBar.x = 4;
_bmpBar.y = (_height - 11);
_buffer.addChild(_bmpBar);
_text = new TextField();
_text.defaultTextFormat = new TextFormat("system", 8, 6253311);
_text.embedFonts = true;
_text.selectable = false;
_text.multiline = false;
_text.x = 2;
_text.y = (_bmpBar.y - 11);
_text.width = 80;
_buffer.addChild(_text);
_logo = new ImgLogo();
_logo.scaleX = (_logo.scaleY = (_height / 8));
_logo.x = ((_width - _logo.width) / 2);
_logo.y = ((_height - _logo.height) / 2);
_buffer.addChild(_logo);
_logoGlow = new ImgLogo();
_logoGlow.smoothing = true;
_logoGlow.blendMode = "screen";
_logoGlow.scaleX = (_logoGlow.scaleY = (_height / 8));
_logoGlow.x = ((_width - _logoGlow.width) / 2);
_logoGlow.y = ((_height - _logoGlow.height) / 2);
_buffer.addChild(_logoGlow);
b = new ImgLogoCorners();
b.smoothing = true;
b.width = _width;
b.height = _height;
_buffer.addChild(b);
b = new Bitmap(new BitmapData(_width, _height, false, 0xFFFFFF));
var i:uint;
while (i < _height) {
j = 0;
while (j < _width) {
b.bitmapData.setPixel(j, i, 0);
j++;
};
i = (i + 2);
};
b.blendMode = "overlay";
b.alpha = 0.25;
_buffer.addChild(b);
}
}
}//package org.flixel
Section 243
//FlxPreloader_ImgLogo (org.flixel.FlxPreloader_ImgLogo)
package org.flixel {
import mx.core.*;
public class FlxPreloader_ImgLogo extends BitmapAsset {
}
}//package org.flixel
Section 244
//FlxPreloader_ImgLogoCorners (org.flixel.FlxPreloader_ImgLogoCorners)
package org.flixel {
import mx.core.*;
public class FlxPreloader_ImgLogoCorners extends BitmapAsset {
}
}//package org.flixel
Section 245
//FlxPreloader_ImgLogoLight (org.flixel.FlxPreloader_ImgLogoLight)
package org.flixel {
import mx.core.*;
public class FlxPreloader_ImgLogoLight extends BitmapAsset {
}
}//package org.flixel
Section 246
//FlxQuadTree (org.flixel.FlxQuadTree)
package org.flixel {
import org.flixel.data.*;
public class FlxQuadTree extends FlxRect {
protected var _sw:FlxQuadTree;
protected var _mx:Number;
protected var _my:Number;
protected var _ne:FlxQuadTree;
protected var _hh:Number;
protected var _headA:FlxList;
protected var _headB:FlxList;
protected var _canSubdivide:Boolean;
protected var _l:Number;
protected var _hw:Number;
protected var _nw:FlxQuadTree;
protected var _se:FlxQuadTree;
protected var _tailA:FlxList;
protected var _r:Number;
protected var _t:Number;
protected var _tailB:FlxList;
protected var _b:Number;
public static const A_LIST:uint = 0;
public static const B_LIST:uint = 1;
protected static var _ot:Number;
protected static var _or:Number;
protected static var _o:FlxObject;
protected static var _ob:Number;
protected static var _min:uint;
protected static var _oc:Function;
protected static var _ol:Number;
protected static var _oa:uint;
public function FlxQuadTree(X:Number, Y:Number, Width:Number, Height:Number, Parent:FlxQuadTree=null){
var itr:FlxList;
var ot:FlxList;
super(X, Y, Width, Height);
_headA = (_tailA = new FlxList());
_headB = (_tailB = new FlxList());
if (Parent != null){
if (Parent._headA.object != null){
itr = Parent._headA;
while (itr != null) {
if (_tailA.object != null){
ot = _tailA;
_tailA = new FlxList();
ot.next = _tailA;
};
_tailA.object = itr.object;
itr = itr.next;
};
};
if (Parent._headB.object != null){
itr = Parent._headB;
while (itr != null) {
if (_tailB.object != null){
ot = _tailB;
_tailB = new FlxList();
ot.next = _tailB;
};
_tailB.object = itr.object;
itr = itr.next;
};
};
} else {
_min = ((width + height) / (2 * FlxU.quadTreeDivisions));
};
_canSubdivide = (((width > _min)) || ((height > _min)));
_nw = null;
_ne = null;
_se = null;
_sw = null;
_l = x;
_r = (x + width);
_hw = (width / 2);
_mx = (_l + _hw);
_t = y;
_b = (y + height);
_hh = (height / 2);
_my = (_t + _hh);
}
protected function addObject():void{
if (((!(_canSubdivide)) || ((((((((_l >= _ol)) && ((_r <= _or)))) && ((_t >= _ot)))) && ((_b <= _ob)))))){
addToList();
return;
};
if ((((_ol > _l)) && ((_or < _mx)))){
if ((((_ot > _t)) && ((_ob < _my)))){
if (_nw == null){
_nw = new FlxQuadTree(_l, _t, _hw, _hh, this);
};
_nw.addObject();
return;
};
if ((((_ot > _my)) && ((_ob < _b)))){
if (_sw == null){
_sw = new FlxQuadTree(_l, _my, _hw, _hh, this);
};
_sw.addObject();
return;
};
};
if ((((_ol > _mx)) && ((_or < _r)))){
if ((((_ot > _t)) && ((_ob < _my)))){
if (_ne == null){
_ne = new FlxQuadTree(_mx, _t, _hw, _hh, this);
};
_ne.addObject();
return;
};
if ((((_ot > _my)) && ((_ob < _b)))){
if (_se == null){
_se = new FlxQuadTree(_mx, _my, _hw, _hh, this);
};
_se.addObject();
return;
};
};
if ((((((((_or > _l)) && ((_ol < _mx)))) && ((_ob > _t)))) && ((_ot < _my)))){
if (_nw == null){
_nw = new FlxQuadTree(_l, _t, _hw, _hh, this);
};
_nw.addObject();
};
if ((((((((_or > _mx)) && ((_ol < _r)))) && ((_ob > _t)))) && ((_ot < _my)))){
if (_ne == null){
_ne = new FlxQuadTree(_mx, _t, _hw, _hh, this);
};
_ne.addObject();
};
if ((((((((_or > _mx)) && ((_ol < _r)))) && ((_ob > _my)))) && ((_ot < _b)))){
if (_se == null){
_se = new FlxQuadTree(_mx, _my, _hw, _hh, this);
};
_se.addObject();
};
if ((((((((_or > _l)) && ((_ol < _mx)))) && ((_ob > _my)))) && ((_ot < _b)))){
if (_sw == null){
_sw = new FlxQuadTree(_l, _my, _hw, _hh, this);
};
_sw.addObject();
};
}
protected function addToList():void{
var ot:FlxList;
if (_oa == A_LIST){
if (_tailA.object != null){
ot = _tailA;
_tailA = new FlxList();
ot.next = _tailA;
};
_tailA.object = _o;
} else {
if (_tailB.object != null){
ot = _tailB;
_tailB = new FlxList();
ot.next = _tailB;
};
_tailB.object = _o;
};
if (!_canSubdivide){
return;
};
if (_nw != null){
_nw.addToList();
};
if (_ne != null){
_ne.addToList();
};
if (_se != null){
_se.addToList();
};
if (_sw != null){
_sw.addToList();
};
}
public function overlap(BothLists:Boolean=true, Callback:Function=null):Boolean{
var itr:FlxList;
_oc = Callback;
var c:Boolean;
if (BothLists){
_oa = B_LIST;
if (_headA.object != null){
itr = _headA;
while (itr != null) {
_o = itr.object;
if (((((_o.exists) && (_o.solid))) && (overlapNode()))){
c = true;
};
itr = itr.next;
};
};
_oa = A_LIST;
if (_headB.object != null){
itr = _headB;
while (itr != null) {
_o = itr.object;
if (((_o.exists) && (_o.solid))){
if (((!((_nw == null))) && (_nw.overlapNode()))){
c = true;
};
if (((!((_ne == null))) && (_ne.overlapNode()))){
c = true;
};
if (((!((_se == null))) && (_se.overlapNode()))){
c = true;
};
if (((!((_sw == null))) && (_sw.overlapNode()))){
c = true;
};
};
itr = itr.next;
};
};
} else {
if (_headA.object != null){
itr = _headA;
while (itr != null) {
_o = itr.object;
if (((((_o.exists) && (_o.solid))) && (overlapNode(itr.next)))){
c = true;
};
itr = itr.next;
};
};
};
if (((!((_nw == null))) && (_nw.overlap(BothLists, _oc)))){
c = true;
};
if (((!((_ne == null))) && (_ne.overlap(BothLists, _oc)))){
c = true;
};
if (((!((_se == null))) && (_se.overlap(BothLists, _oc)))){
c = true;
};
if (((!((_sw == null))) && (_sw.overlap(BothLists, _oc)))){
c = true;
};
return (c);
}
public function add(Object:FlxObject, List:uint):void{
var m:FlxObject;
var members:Array;
var l:uint;
var i:uint;
_oa = List;
if (Object._group){
members = (Object as FlxGroup).members;
l = members.length;
i = 0;
while (i < l) {
m = (members[i] as FlxObject);
if (((!((m == null))) && (m.exists))){
if (m._group){
add(m, List);
} else {
if (m.solid){
_o = m;
_ol = _o.x;
_ot = _o.y;
_or = (_o.x + _o.width);
_ob = (_o.y + _o.height);
addObject();
};
};
};
i++;
};
};
if (Object.solid){
_o = Object;
_ol = _o.x;
_ot = _o.y;
_or = (_o.x + _o.width);
_ob = (_o.y + _o.height);
addObject();
};
}
protected function overlapNode(Iterator:FlxList=null):Boolean{
var co:FlxObject;
var c:Boolean;
var itr:FlxList = Iterator;
if (itr == null){
if (_oa == A_LIST){
itr = _headA;
} else {
itr = _headB;
};
};
if (itr.object != null){
while (itr != null) {
co = itr.object;
if ((((((((((((((((((_o === co)) || (!(co.exists)))) || (!(_o.exists)))) || (!(co.solid)))) || (!(_o.solid)))) || (((_o.x + _o.width) < (co.x + FlxU.roundingError))))) || (((_o.x + FlxU.roundingError) > (co.x + co.width))))) || (((_o.y + _o.height) < (co.y + FlxU.roundingError))))) || (((_o.y + FlxU.roundingError) > (co.y + co.height))))){
itr = itr.next;
} else {
if (_oc == null){
_o.kill();
co.kill();
c = true;
} else {
if (_oc(_o, co)){
c = true;
};
};
itr = itr.next;
};
};
};
return (c);
}
}
}//package org.flixel
Section 247
//FlxRect (org.flixel.FlxRect)
package org.flixel {
public class FlxRect extends FlxPoint {
public var width:Number;
public var height:Number;
public function FlxRect(X:Number=0, Y:Number=0, Width:Number=0, Height:Number=0){
super(X, Y);
width = Width;
height = Height;
}
public function get bottom():Number{
return ((y + height));
}
public function get top():Number{
return (y);
}
public function get left():Number{
return (x);
}
public function get right():Number{
return ((x + width));
}
}
}//package org.flixel
Section 248
//FlxSave (org.flixel.FlxSave)
package org.flixel {
import flash.net.*;
public class FlxSave {
protected var _so:SharedObject;
public var data:Object;
public var name:String;
public function FlxSave(){
super();
name = null;
_so = null;
data = null;
}
public function read(FieldName:String):Object{
if (_so == null){
FlxG.log("WARNING: You must call FlxSave.bind()\nbefore calling FlxSave.read().");
return (null);
};
return (data[FieldName]);
}
public function forceSave(MinFileSize:uint=0):Boolean{
var MinFileSize = MinFileSize;
if (_so == null){
FlxG.log("WARNING: You must call FlxSave.bind()\nbefore calling FlxSave.forceSave().");
return (false);
};
var status:Object;
status = _so.flush(MinFileSize);
//unresolved jump
var _slot1 = e;
FlxG.log("WARNING: There was a problem flushing\nthe shared object data from FlxSave.");
return (false);
return ((status == SharedObjectFlushStatus.FLUSHED));
}
public function bind(Name:String):Boolean{
var Name = Name;
name = null;
_so = null;
data = null;
name = Name;
_so = SharedObject.getLocal(name);
//unresolved jump
var _slot1 = e;
FlxG.log("WARNING: There was a problem binding to\nthe shared object data from FlxSave.");
name = null;
_so = null;
data = null;
return (false);
data = _so.data;
return (true);
}
public function erase(MinFileSize:uint=0):Boolean{
if (_so == null){
FlxG.log("WARNING: You must call FlxSave.bind()\nbefore calling FlxSave.erase().");
return (false);
};
_so.clear();
return (forceSave(MinFileSize));
}
public function write(FieldName:String, FieldValue:Object, MinFileSize:uint=0):Boolean{
if (_so == null){
FlxG.log("WARNING: You must call FlxSave.bind()\nbefore calling FlxSave.write().");
return (false);
};
data[FieldName] = FieldValue;
return (forceSave(MinFileSize));
}
}
}//package org.flixel
Section 249
//FlxSound (org.flixel.FlxSound)
package org.flixel {
import flash.events.*;
import flash.media.*;
import flash.net.*;
public class FlxSound extends FlxObject {
public var name:String;
protected var _position:Number;
protected var _fadeOutTotal:Number;
protected var _fadeOutTimer:Number;
protected var _sound:Sound;
protected var _pauseOnFadeOut:Boolean;
protected var _volumeAdjust:Number;
public var playing:Boolean;
protected var _radius:Number;
protected var _volume:Number;
protected var _point2:FlxPoint;
protected var _fadeInTimer:Number;
public var artist:String;
protected var _channel:SoundChannel;
protected var _fadeInTotal:Number;
protected var _looped:Boolean;
protected var _pan:Boolean;
protected var _transform:SoundTransform;
protected var _init:Boolean;
public var survive:Boolean;
protected var _core:FlxObject;
public function FlxSound(){
super();
_point2 = new FlxPoint();
_transform = new SoundTransform();
init();
fixed = true;
}
public function loadStream(SoundURL:String, Looped:Boolean=false):FlxSound{
stop();
init();
_sound = new Sound();
_sound.load(new URLRequest(SoundURL));
_looped = Looped;
updateTransform();
active = true;
return (this);
}
public function stop():void{
_position = 0;
if (_channel != null){
_channel.stop();
stopped();
};
}
public function loadEmbedded(EmbeddedSound:Class, Looped:Boolean=false):FlxSound{
stop();
init();
_sound = new (EmbeddedSound);
_looped = Looped;
updateTransform();
active = true;
return (this);
}
public function get volume():Number{
return (_volume);
}
function updateTransform():void{
_transform.volume = (((FlxG.getMuteValue() * FlxG.volume) * _volume) * _volumeAdjust);
if (_channel != null){
_channel.soundTransform = _transform;
};
}
public function fadeOut(Seconds:Number, PauseInstead:Boolean=false):void{
_pauseOnFadeOut = PauseInstead;
_fadeInTimer = 0;
_fadeOutTimer = Seconds;
_fadeOutTotal = _fadeOutTimer;
}
public function play():void{
if (_position < 0){
return;
};
if (_looped){
if (_position == 0){
if (_channel == null){
_channel = _sound.play(0, 9999, _transform);
};
if (_channel == null){
active = false;
};
} else {
_channel = _sound.play(_position, 0, _transform);
if (_channel == null){
active = false;
} else {
_channel.addEventListener(Event.SOUND_COMPLETE, looped);
};
};
} else {
if (_position == 0){
if (_channel == null){
_channel = _sound.play(0, 0, _transform);
if (_channel == null){
active = false;
} else {
_channel.addEventListener(Event.SOUND_COMPLETE, stopped);
};
};
} else {
_channel = _sound.play(_position, 0, _transform);
if (_channel == null){
active = false;
};
};
};
playing = !((_channel == null));
_position = 0;
}
public function set volume(Volume:Number):void{
_volume = Volume;
if (_volume < 0){
_volume = 0;
} else {
if (_volume > 1){
_volume = 1;
};
};
updateTransform();
}
protected function init():void{
_transform.pan = 0;
_sound = null;
_position = 0;
_volume = 1;
_volumeAdjust = 1;
_looped = false;
_core = null;
_radius = 0;
_pan = false;
_fadeOutTimer = 0;
_fadeOutTotal = 0;
_pauseOnFadeOut = false;
_fadeInTimer = 0;
_fadeInTotal = 0;
active = false;
visible = false;
solid = false;
playing = false;
name = null;
artist = null;
}
protected function looped(event:Event=null):void{
if (_channel == null){
return;
};
_channel.removeEventListener(Event.SOUND_COMPLETE, looped);
_channel = null;
play();
}
protected function updateSound():void{
var _point:FlxPoint;
var _point2:FlxPoint;
var dx:Number;
var dy:Number;
var d:Number;
if (_position != 0){
return;
};
var radial:Number = 1;
var fade:Number = 1;
if (_core != null){
_point = new FlxPoint();
_point2 = new FlxPoint();
_core.getScreenXY(_point);
getScreenXY(_point2);
dx = (_point.x - _point2.x);
dy = (_point.y - _point2.y);
radial = ((_radius - Math.sqrt(((dx * dx) + (dy * dy)))) / _radius);
if (radial < 0){
radial = 0;
};
if (radial > 1){
radial = 1;
};
if (_pan){
d = (-(dx) / _radius);
if (d < -1){
d = -1;
} else {
if (d > 1){
d = 1;
};
};
_transform.pan = d;
};
};
if (_fadeOutTimer > 0){
_fadeOutTimer = (_fadeOutTimer - FlxG.elapsed);
if (_fadeOutTimer <= 0){
if (_pauseOnFadeOut){
pause();
} else {
stop();
};
};
fade = (_fadeOutTimer / _fadeOutTotal);
if (fade < 0){
fade = 0;
};
} else {
if (_fadeInTimer > 0){
_fadeInTimer = (_fadeInTimer - FlxG.elapsed);
fade = (_fadeInTimer / _fadeInTotal);
if (fade < 0){
fade = 0;
};
fade = (1 - fade);
};
};
_volumeAdjust = (radial * fade);
updateTransform();
}
public function fadeIn(Seconds:Number):void{
_fadeOutTimer = 0;
_fadeInTimer = Seconds;
_fadeInTotal = _fadeInTimer;
play();
}
override public function update():void{
super.update();
updateSound();
}
protected function stopped(event:Event=null):void{
if (!_looped){
_channel.removeEventListener(Event.SOUND_COMPLETE, stopped);
} else {
_channel.removeEventListener(Event.SOUND_COMPLETE, looped);
};
_channel = null;
active = false;
playing = false;
}
protected function gotID3(event:Event=null):void{
FlxG.log("got ID3 info!");
if (_sound.id3.songName.length > 0){
name = _sound.id3.songName;
};
if (_sound.id3.artist.length > 0){
artist = _sound.id3.artist;
};
_sound.removeEventListener(Event.ID3, gotID3);
}
public function pause():void{
if (_channel == null){
_position = -1;
return;
};
_position = _channel.position;
_channel.stop();
if (_looped){
while (_position >= _sound.length) {
_position = (_position - _sound.length);
};
};
_channel = null;
playing = false;
}
override public function destroy():void{
if (active){
stop();
};
}
public function proximity(X:Number, Y:Number, Core:FlxObject, Radius:Number, Pan:Boolean=true):FlxSound{
x = X;
y = Y;
_core = Core;
_radius = Radius;
_pan = Pan;
return (this);
}
}
}//package org.flixel
Section 250
//FlxSprite (org.flixel.FlxSprite)
package org.flixel {
import flash.display.*;
import flash.geom.*;
import org.flixel.data.*;
public class FlxSprite extends FlxObject {
protected var _mtx:Matrix;
protected var _caf:uint;
public var finished:Boolean;
protected var _animations:Array;
protected var _ct:ColorTransform;
public var offset:FlxPoint;
protected var _callback:Function;
protected var _curAnim:FlxAnim;
protected var _framePixels:BitmapData;
protected var _flipped:uint;
public var scale:FlxPoint;
protected var _pixels:BitmapData;
protected var _bakedRotation:Number;
public var blend:String;
public var frameWidth:uint;
protected var _flashRect2:Rectangle;
protected var _alpha:Number;
protected var _flashPointZero:Point;
protected var _curFrame:uint;
public var frameHeight:uint;
protected var _flashRect:Rectangle;
protected var _frameTimer:Number;
protected var _facing:uint;
public var antialiasing:Boolean;
protected var _color:uint;
public static const LEFT:uint = 0;
public static const DOWN:uint = 3;
public static const UP:uint = 2;
public static const RIGHT:uint = 1;
public function FlxSprite(X:Number=0, Y:Number=0, SimpleGraphic:Class=null){
super();
x = X;
y = Y;
_flashRect = new Rectangle();
_flashRect2 = new Rectangle();
_flashPointZero = new Point();
if (SimpleGraphic == null){
createGraphic(8, 8);
} else {
loadGraphic(SimpleGraphic);
};
offset = new FlxPoint();
scale = new FlxPoint(1, 1);
_alpha = 1;
_color = 0xFFFFFF;
blend = null;
antialiasing = false;
finished = false;
_facing = RIGHT;
_animations = new Array();
_flipped = 0;
_curAnim = null;
_curFrame = 0;
_caf = 0;
_frameTimer = 0;
_mtx = new Matrix();
_callback = null;
}
protected function renderSprite():void{
getScreenXY(_point);
_flashPoint.x = _point.x;
_flashPoint.y = _point.y;
if ((((((((((angle == 0)) || ((_bakedRotation > 0)))) && ((scale.x == 1)))) && ((scale.y == 1)))) && ((blend == null)))){
FlxG.buffer.copyPixels(_framePixels, _flashRect, _flashPoint, null, null, true);
return;
};
_mtx.identity();
_mtx.translate(-(origin.x), -(origin.y));
_mtx.scale(scale.x, scale.y);
if (angle != 0){
_mtx.rotate(((Math.PI * 2) * (angle / 360)));
};
_mtx.translate((_point.x + origin.x), (_point.y + origin.y));
FlxG.buffer.draw(_framePixels, _mtx, null, blend, null, antialiasing);
}
public function fill(Color:uint):void{
_pixels.fillRect(_flashRect2, Color);
calcFrame();
}
public function addAnimation(Name:String, Frames:Array, FrameRate:Number=0, Looped:Boolean=true):void{
_animations.push(new FlxAnim(Name, Frames, FrameRate, Looped));
}
override public function overlapsPoint(X:Number, Y:Number, PerPixel:Boolean=false):Boolean{
X = (X - FlxU.floor(FlxG.scroll.x));
Y = (Y - FlxU.floor(FlxG.scroll.y));
getScreenXY(_point);
if (PerPixel){
return (_framePixels.hitTest(new Point(0, 0), 0xFF, new Point((X - _point.x), (Y - _point.y))));
};
if ((((((((X <= _point.x)) || ((X >= (_point.x + frameWidth))))) || ((Y <= _point.y)))) || ((Y >= (_point.y + frameHeight))))){
return (false);
};
return (true);
}
override public function render():void{
renderSprite();
}
protected function calcFrame():void{
var rx:uint = (_caf * frameWidth);
var ry:uint;
var w:uint = (_flipped) ? _flipped : _pixels.width;
if (rx >= w){
ry = (uint((rx / w)) * frameHeight);
rx = (rx % w);
};
if (((_flipped) && ((_facing == LEFT)))){
rx = (((_flipped << 1) - rx) - frameWidth);
};
_flashRect.x = rx;
_flashRect.y = ry;
_framePixels.copyPixels(_pixels, _flashRect, _flashPointZero);
_flashRect.x = (_flashRect.y = 0);
if (_ct != null){
_framePixels.colorTransform(_flashRect, _ct);
};
if (_callback != null){
_callback(_curAnim.name, _curFrame, _caf);
};
}
function unsafeBind(Pixels:BitmapData):void{
_pixels = (_framePixels = Pixels);
}
public function loadGraphic(Graphic:Class, Animated:Boolean=false, Reverse:Boolean=false, Width:uint=0, Height:uint=0, Unique:Boolean=false):FlxSprite{
_bakedRotation = 0;
_pixels = FlxG.addBitmap(Graphic, Reverse, Unique);
if (Reverse){
_flipped = (_pixels.width >> 1);
} else {
_flipped = 0;
};
if (Width == 0){
if (Animated){
Width = _pixels.height;
} else {
if (_flipped > 0){
Width = (_pixels.width / 2);
} else {
Width = _pixels.width;
};
};
};
width = (frameWidth = Width);
if (Height == 0){
if (Animated){
Height = width;
} else {
Height = _pixels.height;
};
};
height = (frameHeight = Height);
resetHelpers();
return (this);
}
public function get pixels():BitmapData{
return (_pixels);
}
public function set facing(Direction:uint):void{
var c = !((_facing == Direction));
_facing = Direction;
if (c){
calcFrame();
};
}
protected function resetHelpers():void{
_flashRect.x = 0;
_flashRect.y = 0;
_flashRect.width = frameWidth;
_flashRect.height = frameHeight;
_flashRect2.x = 0;
_flashRect2.y = 0;
_flashRect2.width = _pixels.width;
_flashRect2.height = _pixels.height;
if ((((((_framePixels == null)) || (!((_framePixels.width == width))))) || (!((_framePixels.height == height))))){
_framePixels = new BitmapData(width, height);
};
origin.x = (frameWidth / 2);
origin.y = (frameHeight / 2);
_framePixels.copyPixels(_pixels, _flashRect, _flashPointZero);
_caf = 0;
refreshHulls();
}
override public function getScreenXY(Point:FlxPoint=null):FlxPoint{
if (Point == null){
Point = new FlxPoint();
};
Point.x = ((FlxU.floor((x + FlxU.roundingError)) + FlxU.floor((FlxG.scroll.x * scrollFactor.x))) - offset.x);
Point.y = ((FlxU.floor((y + FlxU.roundingError)) + FlxU.floor((FlxG.scroll.y * scrollFactor.y))) - offset.y);
return (Point);
}
public function set alpha(Alpha:Number):void{
if (Alpha > 1){
Alpha = 1;
};
if (Alpha < 0){
Alpha = 0;
};
if (Alpha == _alpha){
return;
};
_alpha = Alpha;
if (((!((_alpha == 1))) || (!((_color == 0xFFFFFF))))){
_ct = new ColorTransform((Number((_color >> 16)) / 0xFF), (Number(((_color >> 8) & 0xFF)) / 0xFF), (Number((_color & 0xFF)) / 0xFF), _alpha);
} else {
_ct = null;
};
calcFrame();
}
protected function updateAnimation():void{
var oc:uint;
var ta:int;
if (_bakedRotation){
oc = _caf;
ta = (angle % 360);
if (ta < 0){
ta = (ta + 360);
};
_caf = (ta / _bakedRotation);
if (oc != _caf){
calcFrame();
};
return;
};
if (((((!((_curAnim == null))) && ((_curAnim.delay > 0)))) && (((_curAnim.looped) || (!(finished)))))){
_frameTimer = (_frameTimer + FlxG.elapsed);
if (_frameTimer > _curAnim.delay){
_frameTimer = (_frameTimer - _curAnim.delay);
if (_curFrame == (_curAnim.frames.length - 1)){
if (_curAnim.looped){
_curFrame = 0;
};
finished = true;
} else {
_curFrame++;
};
_caf = _curAnim.frames[_curFrame];
calcFrame();
};
};
}
public function draw(Brush:FlxSprite, X:int=0, Y:int=0):void{
var b:BitmapData = Brush._framePixels;
if ((((((((((Brush.angle == 0)) || ((Brush._bakedRotation > 0)))) && ((Brush.scale.x == 1)))) && ((Brush.scale.y == 1)))) && ((Brush.blend == null)))){
_flashPoint.x = X;
_flashPoint.y = Y;
_flashRect2.width = b.width;
_flashRect2.height = b.height;
_pixels.copyPixels(b, _flashRect2, _flashPoint, null, null, true);
_flashRect2.width = _pixels.width;
_flashRect2.height = _pixels.height;
calcFrame();
return;
};
_mtx.identity();
_mtx.translate(-(Brush.origin.x), -(Brush.origin.y));
_mtx.scale(Brush.scale.x, Brush.scale.y);
if (Brush.angle != 0){
_mtx.rotate(((Math.PI * 2) * (Brush.angle / 360)));
};
_mtx.translate((X + Brush.origin.x), (Y + Brush.origin.y));
_pixels.draw(b, _mtx, null, Brush.blend, null, Brush.antialiasing);
calcFrame();
}
public function loadRotatedGraphic(Graphic:Class, Rotations:uint=16, Frame:int=-1, AntiAliasing:Boolean=false, AutoBuffer:Boolean=false):FlxSprite{
var r:uint;
var c:uint;
var bw2:uint;
var bh2:uint;
var gxc:uint;
var gyc:uint;
var rows:uint = 4;
var brush:FlxSprite = new FlxSprite().loadGraphic(Graphic, (Frame >= 0));
if (Frame >= 0){
brush.frame = Frame;
};
brush.antialiasing = AntiAliasing;
var max:uint = brush.width;
if (brush.height > max){
max = brush.height;
};
if (AutoBuffer){
max = (max * 1.5);
};
var cols:uint = Math.ceil((Rotations / rows));
width = (max * cols);
height = (max * rows);
var key:String = ((((((String(Graphic) + ":") + Frame) + ":") + width) + "x") + height);
var skipGen:Boolean = FlxG.checkBitmapCache(key);
createGraphic(width, height, 0, true, key);
_bakedRotation = (360 / Rotations);
if (!skipGen){
bw2 = (brush.width / 2);
bh2 = (brush.height / 2);
gxc = (max / 2);
gyc = (max / 2);
r = 0;
while (r < rows) {
c = 0;
while (c < cols) {
draw(brush, ((gxc + (max * c)) - bw2), (gyc - bh2));
brush.angle = (brush.angle + _bakedRotation);
c++;
};
gyc = (gyc + max);
r++;
};
};
frameWidth = (frameHeight = (width = (height = max)));
resetHelpers();
return (this);
}
public function set color(Color:uint):void{
Color = (Color & 0xFFFFFF);
if (_color == Color){
return;
};
_color = Color;
if (((!((_alpha == 1))) || (!((_color == 0xFFFFFF))))){
_ct = new ColorTransform((Number((_color >> 16)) / 0xFF), (Number(((_color >> 8) & 0xFF)) / 0xFF), (Number((_color & 0xFF)) / 0xFF), _alpha);
} else {
_ct = null;
};
calcFrame();
}
override public function update():void{
updateMotion();
updateAnimation();
updateFlickering();
}
public function onEmit():void{
}
public function createGraphic(Width:uint, Height:uint, Color:uint=4294967295, Unique:Boolean=false, Key:String=null):FlxSprite{
_bakedRotation = 0;
_pixels = FlxG.createBitmap(Width, Height, Color, Unique, Key);
width = (frameWidth = _pixels.width);
height = (frameHeight = _pixels.height);
resetHelpers();
return (this);
}
public function play(AnimName:String, Force:Boolean=false):void{
if (((((!(Force)) && (!((_curAnim == null))))) && ((AnimName == _curAnim.name)))){
return;
};
_curFrame = 0;
_caf = 0;
_frameTimer = 0;
var al:uint = _animations.length;
var i:uint;
while (i < al) {
if (_animations[i].name == AnimName){
_curAnim = _animations[i];
if (_curAnim.delay <= 0){
finished = true;
} else {
finished = false;
};
_caf = _curAnim.frames[_curFrame];
calcFrame();
return;
};
i++;
};
}
public function addAnimationCallback(AnimationCallback:Function):void{
_callback = AnimationCallback;
}
public function set pixels(Pixels:BitmapData):void{
_pixels = Pixels;
width = (frameWidth = _pixels.width);
height = (frameHeight = _pixels.height);
resetHelpers();
}
public function get alpha():Number{
return (_alpha);
}
public function get facing():uint{
return (_facing);
}
public function get color():uint{
return (_color);
}
public function set frame(Frame:uint):void{
_curAnim = null;
_caf = Frame;
calcFrame();
}
public function get frame():uint{
return (_caf);
}
public function randomFrame():void{
_curAnim = null;
_caf = int((FlxU.random() * (_pixels.width / frameWidth)));
calcFrame();
}
}
}//package org.flixel
Section 251
//FlxState (org.flixel.FlxState)
package org.flixel {
import flash.display.*;
public class FlxState extends Sprite {
public var defaultGroup:FlxGroup;
public static var screen:FlxSprite;
public static var bgColor:uint;
public function FlxState(){
super();
defaultGroup = new FlxGroup();
if (screen == null){
screen = new FlxSprite();
screen.createGraphic(FlxG.width, FlxG.height, 0, true);
screen.origin.x = (screen.origin.y = 0);
screen.antialiasing = true;
};
}
public function update():void{
defaultGroup.update();
}
public function add(Core:FlxObject):FlxObject{
return (defaultGroup.add(Core));
}
public function remove(Core:FlxObject):FlxObject{
return (defaultGroup.remove(Core));
}
public function collide():void{
FlxU.collide(defaultGroup, defaultGroup);
}
public function render():void{
defaultGroup.render();
}
public function preProcess():void{
screen.fill(bgColor);
}
public function destroy():void{
defaultGroup.destroy();
}
public function create():void{
}
public function postProcess():void{
}
}
}//package org.flixel
Section 252
//FlxText (org.flixel.FlxText)
package org.flixel {
import flash.display.*;
import flash.text.*;
public class FlxText extends FlxSprite {
protected var _tf:TextField;
protected var _regen:Boolean;
protected var _shadow:uint;
public function FlxText(X:Number, Y:Number, Width:uint, Text:String=null){
super(X, Y);
createGraphic(Width, 1, 0);
if (Text == null){
Text = "";
};
_tf = new TextField();
_tf.width = Width;
_tf.embedFonts = true;
_tf.selectable = false;
_tf.sharpness = 100;
_tf.multiline = true;
_tf.wordWrap = true;
_tf.text = Text;
var tf:TextFormat = new TextFormat("system", 8, 0xFFFFFF);
_tf.defaultTextFormat = tf;
_tf.setTextFormat(tf);
if (Text.length <= 0){
_tf.height = 1;
} else {
_tf.height = 10;
};
_regen = true;
_shadow = 0;
solid = false;
calcFrame();
}
public function get shadow():uint{
return (_shadow);
}
public function get size():Number{
return ((_tf.defaultTextFormat.size as Number));
}
override public function get color():uint{
return ((_tf.defaultTextFormat.color as uint));
}
override public function set color(Color:uint):void{
var tf:TextFormat = dtfCopy();
tf.color = Color;
_tf.defaultTextFormat = tf;
_tf.setTextFormat(tf);
_regen = true;
calcFrame();
}
public function set shadow(Color:uint):void{
_shadow = Color;
calcFrame();
}
public function set size(Size:Number):void{
var tf:TextFormat = dtfCopy();
tf.size = Size;
_tf.defaultTextFormat = tf;
_tf.setTextFormat(tf);
_regen = true;
calcFrame();
}
public function get alignment():String{
return (_tf.defaultTextFormat.align);
}
protected function dtfCopy():TextFormat{
var dtf:TextFormat = _tf.defaultTextFormat;
return (new TextFormat(dtf.font, dtf.size, dtf.color, dtf.bold, dtf.italic, dtf.underline, dtf.url, dtf.target, dtf.align));
}
public function get text():String{
return (_tf.text);
}
public function get font():String{
return (_tf.defaultTextFormat.font);
}
public function set alignment(Alignment:String):void{
var tf:TextFormat = dtfCopy();
tf.align = Alignment;
_tf.defaultTextFormat = tf;
_tf.setTextFormat(tf);
calcFrame();
}
public function set font(Font:String):void{
var tf:TextFormat = dtfCopy();
tf.font = Font;
_tf.defaultTextFormat = tf;
_tf.setTextFormat(tf);
_regen = true;
calcFrame();
}
override protected function calcFrame():void{
var nl:uint;
var i:uint;
var tf:TextFormat;
var tfa:TextFormat;
if (_regen){
nl = _tf.numLines;
height = 0;
i = 0;
while (i < nl) {
height = (height + _tf.getLineMetrics(i).height);
i++;
};
height = (height + 4);
_pixels = new BitmapData(width, height, true, 0);
frameHeight = height;
_tf.height = (height * 1.2);
_flashRect.x = 0;
_flashRect.y = 0;
_flashRect.width = width;
_flashRect.height = height;
_regen = false;
} else {
_pixels.fillRect(_flashRect, 0);
};
if (((((!((_tf == null))) && (!((_tf.text == null))))) && ((_tf.text.length > 0)))){
tf = _tf.defaultTextFormat;
tfa = tf;
_mtx.identity();
if ((((tf.align == "center")) && ((_tf.numLines == 1)))){
tfa = new TextFormat(tf.font, tf.size, tf.color, null, null, null, null, null, "left");
_tf.setTextFormat(tfa);
_mtx.translate(Math.floor(((width - _tf.getLineMetrics(0).width) / 2)), 0);
};
if (_shadow > 0){
_tf.setTextFormat(new TextFormat(tfa.font, tfa.size, _shadow, null, null, null, null, null, tfa.align));
_mtx.translate(1, 1);
_pixels.draw(_tf, _mtx, _ct);
_mtx.translate(-1, -1);
_tf.setTextFormat(new TextFormat(tfa.font, tfa.size, tfa.color, null, null, null, null, null, tfa.align));
};
_pixels.draw(_tf, _mtx, _ct);
_tf.setTextFormat(new TextFormat(tf.font, tf.size, tf.color, null, null, null, null, null, tf.align));
};
_framePixels = new BitmapData(_pixels.width, _pixels.height, true, 0);
_framePixels.copyPixels(_pixels, _flashRect, _flashPointZero);
if (solid){
refreshHulls();
};
}
public function setFormat(Font:String=null, Size:Number=8, Color:uint=0xFFFFFF, Alignment:String=null, ShadowColor:uint=0):FlxText{
if (Font == null){
Font = "";
};
var tf:TextFormat = dtfCopy();
tf.font = Font;
tf.size = Size;
tf.color = Color;
tf.align = Alignment;
_tf.defaultTextFormat = tf;
_tf.setTextFormat(tf);
_shadow = ShadowColor;
_regen = true;
calcFrame();
return (this);
}
public function set text(Text:String):void{
_tf.text = Text;
_regen = true;
calcFrame();
}
}
}//package org.flixel
Section 253
//FlxTilemap (org.flixel.FlxTilemap)
package org.flixel {
import flash.display.*;
import flash.geom.*;
public class FlxTilemap extends FlxObject {
protected var _tileWidth:uint;
protected var _screenRows:uint;
protected var _data:Array;
public var startingIndex:uint;
protected var _pixels:BitmapData;
protected var _block:FlxObject;
protected var _callbacks:Array;
protected var _rects:Array;
protected var _tileHeight:uint;
public var totalTiles:uint;
protected var _screenCols:uint;
public var drawIndex:uint;
public var auto:uint;
protected var _flashRect:Rectangle;
public var heightInTiles:uint;
public var widthInTiles:uint;
public var collideIndex:uint;
public static const ALT:uint = 2;
public static const AUTO:uint = 1;
public static const OFF:uint = 0;
public static var ImgAutoAlt:Class = FlxTilemap_ImgAutoAlt;
public static var ImgAuto:Class = FlxTilemap_ImgAuto;
public function FlxTilemap(){
super();
auto = OFF;
collideIndex = 1;
startingIndex = 0;
drawIndex = 1;
widthInTiles = 0;
heightInTiles = 0;
totalTiles = 0;
_data = null;
_tileWidth = 0;
_tileHeight = 0;
_rects = null;
_pixels = null;
_block = new FlxObject();
_block.width = (_block.height = 0);
_block.fixed = true;
_callbacks = new Array();
fixed = true;
}
public function setTileByIndex(Index:uint, Tile:uint, UpdateGraphics:Boolean=true):Boolean{
var i:uint;
if (Index >= _data.length){
return (false);
};
var ok:Boolean;
_data[Index] = Tile;
if (!UpdateGraphics){
return (ok);
};
if (auto == OFF){
updateTile(Index);
return (ok);
};
var r:int = (int((Index / widthInTiles)) - 1);
var rl:int = (r + 3);
var c:int = ((Index % widthInTiles) - 1);
var cl:int = (c + 3);
while (r < rl) {
c = (cl - 3);
while (c < cl) {
if ((((((((r >= 0)) && ((r < heightInTiles)))) && ((c >= 0)))) && ((c < widthInTiles)))){
i = ((r * widthInTiles) + c);
autoTile(i);
updateTile(i);
};
c++;
};
r++;
};
return (ok);
}
public function getTile(X:uint, Y:uint):uint{
return (getTileByIndex(((Y * widthInTiles) + X)));
}
public function setCallback(Tile:uint, Callback:Function, Range:uint=1):void{
FlxG.log("FlxTilemap.setCallback() has been temporarily deprecated, sorry!");
if (Range <= 0){
return;
};
var i:uint = Tile;
while (i < (Tile + Range)) {
_callbacks[i] = Callback;
i++;
};
}
override public function overlaps(Core:FlxObject):Boolean{
var c:uint;
var d:uint;
var i:uint;
var dd:uint;
var blocks:Array = new Array();
var ix:uint = Math.floor(((Core.x - x) / _tileWidth));
var iy:uint = Math.floor(((Core.y - y) / _tileHeight));
var iw:uint = (Math.ceil((Core.width / _tileWidth)) + 1);
var ih:uint = (Math.ceil((Core.height / _tileHeight)) + 1);
var r:uint;
while (r < ih) {
if (r >= heightInTiles){
break;
};
d = (((iy + r) * widthInTiles) + ix);
c = 0;
while (c < iw) {
if (c >= widthInTiles){
break;
};
dd = (_data[(d + c)] as uint);
if (dd >= collideIndex){
blocks.push({x:(x + ((ix + c) * _tileWidth)), y:(y + ((iy + r) * _tileHeight)), data:dd});
};
c++;
};
r++;
};
var bl:uint = blocks.length;
var hx:Boolean;
i = 0;
while (i < bl) {
_block.x = blocks[i].x;
_block.y = blocks[i].y;
if (_block.overlaps(Core)){
return (true);
};
i++;
};
return (false);
}
public function loadMap(MapData:String, TileGraphic:Class, TileWidth:uint=0, TileHeight:uint=0):FlxTilemap{
var c:uint;
var cols:Array;
var i:uint;
var rows:Array = MapData.split("\n");
heightInTiles = rows.length;
_data = new Array();
var r:uint;
while (r < heightInTiles) {
cols = rows[r].split(",");
if (cols.length <= 1){
heightInTiles--;
} else {
if (widthInTiles == 0){
widthInTiles = cols.length;
};
c = 0;
while (c < widthInTiles) {
_data.push(uint(cols[c]));
c++;
};
};
r++;
};
totalTiles = (widthInTiles * heightInTiles);
if (auto > OFF){
collideIndex = (startingIndex = (drawIndex = 1));
i = 0;
while (i < totalTiles) {
autoTile(i);
i++;
};
};
_pixels = FlxG.addBitmap(TileGraphic);
_tileWidth = TileWidth;
if (_tileWidth == 0){
_tileWidth = _pixels.height;
};
_tileHeight = TileHeight;
if (_tileHeight == 0){
_tileHeight = _tileWidth;
};
_block.width = _tileWidth;
_block.height = _tileHeight;
width = (widthInTiles * _tileWidth);
height = (heightInTiles * _tileHeight);
_rects = new Array(totalTiles);
i = 0;
while (i < totalTiles) {
updateTile(i);
i++;
};
_screenRows = (Math.ceil((FlxG.height / _tileHeight)) + 1);
if (_screenRows > heightInTiles){
_screenRows = heightInTiles;
};
_screenCols = (Math.ceil((FlxG.width / _tileWidth)) + 1);
if (_screenCols > widthInTiles){
_screenCols = widthInTiles;
};
refreshHulls();
return (this);
}
public function ray(StartX:Number, StartY:Number, EndX:Number, EndY:Number, Result:FlxPoint, Resolution:Number=1):Boolean{
var tx:uint;
var ty:uint;
var rx:Number;
var ry:Number;
var q:Number;
var lx:Number;
var ly:Number;
var step:Number = _tileWidth;
if (_tileHeight < _tileWidth){
step = _tileHeight;
};
step = (step / Resolution);
var dx:Number = (EndX - StartX);
var dy:Number = (EndY - StartY);
var distance:Number = Math.sqrt(((dx * dx) + (dy * dy)));
var steps:uint = Math.ceil((distance / step));
var stepX:Number = (dx / steps);
var stepY:Number = (dy / steps);
var curX:Number = (StartX - stepX);
var curY:Number = (StartY - stepY);
var i:uint;
while (i < steps) {
curX = (curX + stepX);
curY = (curY + stepY);
if ((((((((curX < 0)) || ((curX > width)))) || ((curY < 0)))) || ((curY > height)))){
} else {
tx = (curX / _tileWidth);
ty = (curY / _tileHeight);
if ((_data[((ty * widthInTiles) + tx)] as uint) >= collideIndex){
tx = (tx * _tileWidth);
ty = (ty * _tileHeight);
rx = 0;
ry = 0;
lx = (curX - stepX);
ly = (curY - stepY);
q = tx;
if (dx < 0){
q = (q + _tileWidth);
};
rx = q;
ry = (ly + (stepY * ((q - lx) / stepX)));
if ((((ry > ty)) && ((ry < (ty + _tileHeight))))){
if (Result == null){
Result = new FlxPoint();
};
Result.x = rx;
Result.y = ry;
return (true);
};
q = ty;
if (dy < 0){
q = (q + _tileHeight);
};
rx = (lx + (stepX * ((q - ly) / stepY)));
ry = q;
if ((((rx > tx)) && ((rx < (tx + _tileWidth))))){
if (Result == null){
Result = new FlxPoint();
};
Result.x = rx;
Result.y = ry;
return (true);
};
return (false);
};
};
i++;
};
return (false);
}
override public function preCollide(Object:FlxObject):void{
var r:uint;
var c:uint;
var rs:uint;
var col:uint;
var ix:int = FlxU.floor(((Object.x - x) / _tileWidth));
var iy:int = FlxU.floor(((Object.y - y) / _tileHeight));
var iw:uint = ((ix + FlxU.ceil((Object.width / _tileWidth))) + 1);
var ih:uint = ((iy + FlxU.ceil((Object.height / _tileHeight))) + 1);
if (ix < 0){
ix = 0;
};
if (iy < 0){
iy = 0;
};
if (iw > widthInTiles){
iw = widthInTiles;
};
if (ih > heightInTiles){
ih = heightInTiles;
};
rs = (iy * widthInTiles);
r = iy;
while (r < ih) {
c = ix;
while (c < iw) {
if ((_data[(rs + c)] as uint) >= collideIndex){
var _temp1 = col;
col = (col + 1);
var _local10 = _temp1;
colOffsets[_local10] = new FlxPoint((x + (c * _tileWidth)), (y + (r * _tileHeight)));
};
c++;
};
rs = (rs + widthInTiles);
r++;
};
if (colOffsets.length != col){
colOffsets.length = col;
};
}
override public function render():void{
renderTilemap();
}
protected function updateTile(Index:uint):void{
if (_data[Index] < drawIndex){
_rects[Index] = null;
return;
};
var rx:uint = ((_data[Index] - startingIndex) * _tileWidth);
var ry:uint;
if (rx >= _pixels.width){
ry = (uint((rx / _pixels.width)) * _tileHeight);
rx = (rx % _pixels.width);
};
_rects[Index] = new Rectangle(rx, ry, _tileWidth, _tileHeight);
}
override public function refreshHulls():void{
colHullX.x = 0;
colHullX.y = 0;
colHullX.width = _tileWidth;
colHullX.height = _tileHeight;
colHullY.x = 0;
colHullY.y = 0;
colHullY.width = _tileWidth;
colHullY.height = _tileHeight;
}
public function setTile(X:uint, Y:uint, Tile:uint, UpdateGraphics:Boolean=true):Boolean{
if ((((X >= widthInTiles)) || ((Y >= heightInTiles)))){
return (false);
};
return (setTileByIndex(((Y * widthInTiles) + X), Tile, UpdateGraphics));
}
public function follow(Border:int=0):void{
FlxG.followBounds((x + (Border * _tileWidth)), (y + (Border * _tileHeight)), (width - (Border * _tileWidth)), (height - (Border * _tileHeight)));
}
protected function renderTilemap():void{
var c:uint;
var cri:uint;
getScreenXY(_point);
_flashPoint.x = _point.x;
_flashPoint.y = _point.y;
var tx:int = Math.floor((-(_flashPoint.x) / _tileWidth));
var ty:int = Math.floor((-(_flashPoint.y) / _tileHeight));
if (tx < 0){
tx = 0;
};
if (tx > (widthInTiles - _screenCols)){
tx = (widthInTiles - _screenCols);
};
if (ty < 0){
ty = 0;
};
if (ty > (heightInTiles - _screenRows)){
ty = (heightInTiles - _screenRows);
};
var ri:int = ((ty * widthInTiles) + tx);
_flashPoint.x = (_flashPoint.x + (tx * _tileWidth));
_flashPoint.y = (_flashPoint.y + (ty * _tileHeight));
var opx:int = _flashPoint.x;
var r:uint;
while (r < _screenRows) {
cri = ri;
c = 0;
while (c < _screenCols) {
var _temp1 = cri;
cri = (cri + 1);
_flashRect = (_rects[_temp1] as Rectangle);
if (_flashRect != null){
FlxG.buffer.copyPixels(_pixels, _flashRect, _flashPoint, null, null, true);
};
_flashPoint.x = (_flashPoint.x + _tileWidth);
c++;
};
ri = (ri + widthInTiles);
_flashPoint.x = opx;
_flashPoint.y = (_flashPoint.y + _tileHeight);
r++;
};
}
protected function autoTile(Index:uint):void{
if (_data[Index] == 0){
return;
};
_data[Index] = 0;
if (((((Index - widthInTiles) < 0)) || ((_data[(Index - widthInTiles)] > 0)))){
_data[Index] = (_data[Index] + 1);
};
if (((((Index % widthInTiles) >= (widthInTiles - 1))) || ((_data[(Index + 1)] > 0)))){
_data[Index] = (_data[Index] + 2);
};
if (((((Index + widthInTiles) >= totalTiles)) || ((_data[(Index + widthInTiles)] > 0)))){
_data[Index] = (_data[Index] + 4);
};
if (((((Index % widthInTiles) <= 0)) || ((_data[(Index - 1)] > 0)))){
_data[Index] = (_data[Index] + 8);
};
if ((((auto == ALT)) && ((_data[Index] == 15)))){
if (((((((Index % widthInTiles) > 0)) && (((Index + widthInTiles) < totalTiles)))) && ((_data[((Index + widthInTiles) - 1)] <= 0)))){
_data[Index] = 1;
};
if (((((((Index % widthInTiles) > 0)) && (((Index - widthInTiles) >= 0)))) && ((_data[((Index - widthInTiles) - 1)] <= 0)))){
_data[Index] = 2;
};
if (((((((Index % widthInTiles) < widthInTiles)) && (((Index - widthInTiles) >= 0)))) && ((_data[((Index - widthInTiles) + 1)] <= 0)))){
_data[Index] = 4;
};
if (((((((Index % widthInTiles) < widthInTiles)) && (((Index + widthInTiles) < totalTiles)))) && ((_data[((Index + widthInTiles) + 1)] <= 0)))){
_data[Index] = 8;
};
};
_data[Index] = (_data[Index] + 1);
}
public function getTileByIndex(Index:uint):uint{
return ((_data[Index] as uint));
}
public static function arrayToCSV(Data:Array, Width:int):String{
var r:uint;
var c:uint;
var csv:String;
var Height:int = (Data.length / Width);
r = 0;
while (r < Height) {
c = 0;
while (c < Width) {
if (c == 0){
if (r == 0){
csv = (csv + Data[0]);
} else {
csv = (csv + ("\n" + Data[(r * Width)]));
};
} else {
csv = (csv + (", " + Data[((r * Width) + c)]));
};
c++;
};
r++;
};
return (csv);
}
public static function pngToCSV(PNGFile:Class, Invert:Boolean=false, Scale:uint=1):String{
var layout:Bitmap;
var r:uint;
var c:uint;
var p:uint;
var csv:String;
var tmp:Bitmap;
var mtx:Matrix;
if (Scale <= 1){
layout = new (PNGFile);
} else {
tmp = new (PNGFile);
layout = new Bitmap(new BitmapData((tmp.width * Scale), (tmp.height * Scale)));
mtx = new Matrix();
mtx.scale(Scale, Scale);
layout.bitmapData.draw(tmp, mtx);
};
var bd:BitmapData = layout.bitmapData;
var w:uint = layout.width;
var h:uint = layout.height;
r = 0;
while (r < h) {
c = 0;
while (c < w) {
p = bd.getPixel(c, r);
if (((((Invert) && ((p > 0)))) || (((!(Invert)) && ((p == 0)))))){
p = 1;
} else {
p = 0;
};
if (c == 0){
if (r == 0){
csv = (csv + p);
} else {
csv = (csv + ("\n" + p));
};
} else {
csv = (csv + (", " + p));
};
c++;
};
r++;
};
return (csv);
}
}
}//package org.flixel
Section 254
//FlxTilemap_ImgAuto (org.flixel.FlxTilemap_ImgAuto)
package org.flixel {
import mx.core.*;
public class FlxTilemap_ImgAuto extends BitmapAsset {
}
}//package org.flixel
Section 255
//FlxTilemap_ImgAutoAlt (org.flixel.FlxTilemap_ImgAutoAlt)
package org.flixel {
import mx.core.*;
public class FlxTilemap_ImgAutoAlt extends BitmapAsset {
}
}//package org.flixel
Section 256
//FlxU (org.flixel.FlxU)
package org.flixel {
import flash.net.*;
import flash.utils.*;
public class FlxU {
protected static var _originalSeed:Number;
public static var quadTree:FlxQuadTree;
protected static var _seed:Number;
static var roundingError:Number = 1E-7;
public static var quadTreeBounds:FlxRect;
public static var quadTreeDivisions:uint = 3;
public function FlxU(){
super();
}
public static function random(UseGlobalSeed:Boolean=true):Number{
var random:Number;
if (((UseGlobalSeed) && (!(isNaN(_seed))))){
random = randomize(_seed);
_seed = mutate(_seed, random);
return (random);
};
return (Math.random());
}
public static function mutate(Seed:Number, Mutator:Number):Number{
Seed = (Seed + Mutator);
if (Seed > 1){
Seed = (Seed - int(Seed));
};
return (Seed);
}
public static function overlap(Object1:FlxObject, Object2:FlxObject, Callback:Function=null):Boolean{
if ((((((((Object1 == null)) || (!(Object1.exists)))) || ((Object2 == null)))) || (!(Object2.exists)))){
return (false);
};
quadTree = new FlxQuadTree(quadTreeBounds.x, quadTreeBounds.y, quadTreeBounds.width, quadTreeBounds.height);
quadTree.add(Object1, FlxQuadTree.A_LIST);
if (Object1 === Object2){
return (quadTree.overlap(false, Callback));
};
quadTree.add(Object2, FlxQuadTree.B_LIST);
return (quadTree.overlap(true, Callback));
}
public static function openURL(URL:String):void{
navigateToURL(new URLRequest(URL), "_blank");
}
public static function endProfile(Start:uint, Name:String="Profiler", Log:Boolean=true):uint{
var t:uint = getTimer();
if (Log){
FlxG.log((((Name + ": ") + ((t - Start) / 1000)) + "s"));
};
return (t);
}
public static function getClass(Name:String):Class{
return ((getDefinitionByName(Name) as Class));
}
public static function floor(N:Number):Number{
var n:Number = int(N);
return (((N)>0) ? n : ((n)!=N) ? (n - 1) : n);
}
public static function solveYCollision(Object1:FlxObject, Object2:FlxObject):Boolean{
var overlap:Number;
var p1hn2:Boolean;
var i1:uint;
var i2:uint;
var ox1:Number;
var oy1:Number;
var ox2:Number;
var oy2:Number;
var r1:Number;
var r2:Number;
var sv1:Number;
var sv2:Number;
var o1:Number = Object1.colVector.y;
var o2:Number = Object2.colVector.y;
if (o1 == o2){
return (false);
};
Object1.preCollide(Object2);
Object2.preCollide(Object1);
var hit:Boolean;
var obj1Stopped = (o1 == 0);
var obj1MoveNeg = (o1 < 0);
var obj1MovePos = (o1 > 0);
var obj2Stopped = (o2 == 0);
var obj2MoveNeg = (o2 < 0);
var obj2MovePos = (o2 > 0);
var obj1Hull:FlxRect = Object1.colHullY;
var obj2Hull:FlxRect = Object2.colHullY;
var co1:Array = Object1.colOffsets;
var co2:Array = Object2.colOffsets;
var l1:uint = co1.length;
var l2:uint = co2.length;
p1hn2 = ((((((((((obj1Stopped) && (obj2MoveNeg))) || (((obj1MovePos) && (obj2Stopped))))) || (((obj1MovePos) && (obj2MoveNeg))))) || (((((obj1MoveNeg) && (obj2MoveNeg))) && ((((o1)>0) ? o1 : -(o1) < ((o2)>0) ? o2 : -(o2))))))) || (((((obj1MovePos) && (obj2MovePos))) && ((((o1)>0) ? o1 : -(o1) > ((o2)>0) ? o2 : -(o2))))));
if ((p1hn2) ? ((!(Object1.collideBottom)) || (!(Object2.collideTop))) : ((!(Object1.collideTop)) || (!(Object2.collideBottom)))){
return (false);
};
i1 = 0;
while (i1 < l1) {
ox1 = co1[i1].x;
oy1 = co1[i1].y;
obj1Hull.x = (obj1Hull.x + ox1);
obj1Hull.y = (obj1Hull.y + oy1);
i2 = 0;
while (i2 < l2) {
ox2 = co2[i2].x;
oy2 = co2[i2].y;
obj2Hull.x = (obj2Hull.x + ox2);
obj2Hull.y = (obj2Hull.y + oy2);
if (((((((((obj1Hull.x + obj1Hull.width) < (obj2Hull.x + roundingError))) || (((obj1Hull.x + roundingError) > (obj2Hull.x + obj2Hull.width))))) || (((obj1Hull.y + obj1Hull.height) < (obj2Hull.y + roundingError))))) || (((obj1Hull.y + roundingError) > (obj2Hull.y + obj2Hull.height))))){
obj2Hull.x = (obj2Hull.x - ox2);
obj2Hull.y = (obj2Hull.y - oy2);
} else {
if (p1hn2){
if (obj1MoveNeg){
r1 = (obj1Hull.y + Object1.colHullX.height);
} else {
r1 = (obj1Hull.y + obj1Hull.height);
};
if (obj2MoveNeg){
r2 = obj2Hull.y;
} else {
r2 = ((obj2Hull.y + obj2Hull.height) - Object2.colHullX.height);
};
} else {
if (obj2MoveNeg){
r1 = (-(obj2Hull.y) - Object2.colHullX.height);
} else {
r1 = (-(obj2Hull.y) - obj2Hull.height);
};
if (obj1MoveNeg){
r2 = -(obj1Hull.y);
} else {
r2 = ((-(obj1Hull.y) - obj1Hull.height) + Object1.colHullX.height);
};
};
overlap = (r1 - r2);
if ((((((overlap == 0)) || (((!(Object1.fixed)) && ((((overlap)>0) ? overlap : -(overlap) > (obj1Hull.height * 0.8))))))) || (((!(Object2.fixed)) && ((((overlap)>0) ? overlap : -(overlap) > (obj2Hull.height * 0.8))))))){
obj2Hull.x = (obj2Hull.x - ox2);
obj2Hull.y = (obj2Hull.y - oy2);
} else {
hit = true;
sv1 = Object2.velocity.y;
sv2 = Object1.velocity.y;
if (((!(Object1.fixed)) && (Object2.fixed))){
if (Object1._group){
Object1.reset(Object1.x, (Object1.y - overlap));
} else {
Object1.y = (Object1.y - overlap);
};
} else {
if (((Object1.fixed) && (!(Object2.fixed)))){
if (Object2._group){
Object2.reset(Object2.x, (Object2.y + overlap));
} else {
Object2.y = (Object2.y + overlap);
};
} else {
if (((!(Object1.fixed)) && (!(Object2.fixed)))){
overlap = (overlap / 2);
if (Object1._group){
Object1.reset(Object1.x, (Object1.y - overlap));
} else {
Object1.y = (Object1.y - overlap);
};
if (Object2._group){
Object2.reset(Object2.x, (Object2.y + overlap));
} else {
Object2.y = (Object2.y + overlap);
};
sv1 = (sv1 / 2);
sv2 = (sv2 / 2);
};
};
};
if (p1hn2){
Object1.hitBottom(Object2, sv1);
Object2.hitTop(Object1, sv2);
} else {
Object1.hitTop(Object2, sv1);
Object2.hitBottom(Object1, sv2);
};
if (((!(Object1.fixed)) && (!((overlap == 0))))){
if (p1hn2){
obj1Hull.y = (obj1Hull.y - overlap);
if (((Object2.fixed) && (Object2.moves))){
sv1 = Object2.colVector.x;
Object1.x = (Object1.x + sv1);
obj1Hull.x = (obj1Hull.x + sv1);
Object1.colHullX.x = (Object1.colHullX.x + sv1);
};
} else {
obj1Hull.y = (obj1Hull.y - overlap);
obj1Hull.height = (obj1Hull.height + overlap);
};
};
if (((!(Object2.fixed)) && (!((overlap == 0))))){
if (p1hn2){
obj2Hull.y = (obj2Hull.y + overlap);
obj2Hull.height = (obj2Hull.height - overlap);
} else {
obj2Hull.height = (obj2Hull.height + overlap);
if (((Object1.fixed) && (Object1.moves))){
sv2 = Object1.colVector.x;
Object2.x = (Object2.x + sv2);
obj2Hull.x = (obj2Hull.x + sv2);
Object2.colHullX.x = (Object2.colHullX.x + sv2);
};
};
};
obj2Hull.x = (obj2Hull.x - ox2);
obj2Hull.y = (obj2Hull.y - oy2);
};
};
i2++;
};
obj1Hull.x = (obj1Hull.x - ox1);
obj1Hull.y = (obj1Hull.y - oy1);
i1++;
};
return (hit);
}
public static function ceil(N:Number):Number{
var n:Number = int(N);
return (((N)>0) ? ((n)!=N) ? (n + 1) : n : n);
}
public static function getAngle(X:Number, Y:Number):Number{
return (((Math.atan2(Y, X) * 180) / Math.PI));
}
public static function setWorldBounds(X:Number=0, Y:Number=0, Width:Number=0, Height:Number=0, Divisions:uint=3):void{
if ((((((((X == 0)) && ((Y == 0)))) && ((Width == 0)))) && ((Height == 0)))){
X = (-128 * FlxG.width);
Y = (-128 * FlxG.height);
Width = (0x0100 * FlxG.width);
Height = (0x0100 * FlxG.height);
};
if (quadTreeBounds == null){
quadTreeBounds = new FlxRect();
};
quadTreeBounds.x = X;
quadTreeBounds.y = Y;
if (Width != 0){
quadTreeBounds.width = Width;
};
if (Height != 0){
quadTreeBounds.height = Height;
};
if (Divisions > 0){
quadTreeDivisions = Divisions;
};
}
public static function startProfile():uint{
return (getTimer());
}
public static function set seed(Seed:Number):void{
_seed = Seed;
_originalSeed = _seed;
}
public static function getClassName(Obj:Object, Simple:Boolean=false):String{
var s:String = getQualifiedClassName(Obj);
s = s.replace("::", ".");
if (Simple){
s = s.substr((s.lastIndexOf(".") + 1));
};
return (s);
}
public static function randomize(Seed:Number):Number{
return ((((69621 * int((Seed * 2147483647))) % 2147483647) / 2147483647));
}
public static function abs(N:Number):Number{
return (((N)>0) ? N : -(N));
}
public static function rotatePoint(X:Number, Y:Number, PivotX:Number, PivotY:Number, Angle:Number, P:FlxPoint=null):FlxPoint{
if (P == null){
P = new FlxPoint();
};
var radians:Number = ((-(Angle) / 180) * Math.PI);
var dx:Number = (X - PivotX);
var dy:Number = (PivotY - Y);
P.x = ((PivotX + (Math.cos(radians) * dx)) - (Math.sin(radians) * dy));
P.y = (PivotY - ((Math.sin(radians) * dx) + (Math.cos(radians) * dy)));
return (P);
}
public static function get seed():Number{
return (_originalSeed);
}
public static function solveXCollision(Object1:FlxObject, Object2:FlxObject):Boolean{
var f1:Boolean;
var f2:Boolean;
var overlap:Number;
var p1hn2:Boolean;
var i1:uint;
var i2:uint;
var obj1Hull:FlxRect;
var obj2Hull:FlxRect;
var ox1:Number;
var oy1:Number;
var ox2:Number;
var oy2:Number;
var r1:Number;
var r2:Number;
var sv1:Number;
var sv2:Number;
var o1:Number = Object1.colVector.x;
var o2:Number = Object2.colVector.x;
if (o1 == o2){
return (false);
};
Object1.preCollide(Object2);
Object2.preCollide(Object1);
var hit:Boolean;
var obj1Stopped = (o1 == 0);
var obj1MoveNeg = (o1 < 0);
var obj1MovePos = (o1 > 0);
var obj2Stopped = (o2 == 0);
var obj2MoveNeg = (o2 < 0);
var obj2MovePos = (o2 > 0);
obj1Hull = Object1.colHullX;
obj2Hull = Object2.colHullX;
var co1:Array = Object1.colOffsets;
var co2:Array = Object2.colOffsets;
var l1:uint = co1.length;
var l2:uint = co2.length;
p1hn2 = ((((((((((obj1Stopped) && (obj2MoveNeg))) || (((obj1MovePos) && (obj2Stopped))))) || (((obj1MovePos) && (obj2MoveNeg))))) || (((((obj1MoveNeg) && (obj2MoveNeg))) && ((((o1)>0) ? o1 : -(o1) < ((o2)>0) ? o2 : -(o2))))))) || (((((obj1MovePos) && (obj2MovePos))) && ((((o1)>0) ? o1 : -(o1) > ((o2)>0) ? o2 : -(o2))))));
if ((p1hn2) ? ((!(Object1.collideRight)) || (!(Object2.collideLeft))) : ((!(Object1.collideLeft)) || (!(Object2.collideRight)))){
return (false);
};
i1 = 0;
while (i1 < l1) {
ox1 = co1[i1].x;
oy1 = co1[i1].y;
obj1Hull.x = (obj1Hull.x + ox1);
obj1Hull.y = (obj1Hull.y + oy1);
i2 = 0;
while (i2 < l2) {
ox2 = co2[i2].x;
oy2 = co2[i2].y;
obj2Hull.x = (obj2Hull.x + ox2);
obj2Hull.y = (obj2Hull.y + oy2);
if (((((((((obj1Hull.x + obj1Hull.width) < (obj2Hull.x + roundingError))) || (((obj1Hull.x + roundingError) > (obj2Hull.x + obj2Hull.width))))) || (((obj1Hull.y + obj1Hull.height) < (obj2Hull.y + roundingError))))) || (((obj1Hull.y + roundingError) > (obj2Hull.y + obj2Hull.height))))){
obj2Hull.x = (obj2Hull.x - ox2);
obj2Hull.y = (obj2Hull.y - oy2);
} else {
if (p1hn2){
if (obj1MoveNeg){
r1 = (obj1Hull.x + Object1.colHullY.width);
} else {
r1 = (obj1Hull.x + obj1Hull.width);
};
if (obj2MoveNeg){
r2 = obj2Hull.x;
} else {
r2 = ((obj2Hull.x + obj2Hull.width) - Object2.colHullY.width);
};
} else {
if (obj2MoveNeg){
r1 = (-(obj2Hull.x) - Object2.colHullY.width);
} else {
r1 = (-(obj2Hull.x) - obj2Hull.width);
};
if (obj1MoveNeg){
r2 = -(obj1Hull.x);
} else {
r2 = ((-(obj1Hull.x) - obj1Hull.width) + Object1.colHullY.width);
};
};
overlap = (r1 - r2);
if ((((((overlap == 0)) || (((!(Object1.fixed)) && ((((overlap)>0) ? overlap : -(overlap) > (obj1Hull.width * 0.8))))))) || (((!(Object2.fixed)) && ((((overlap)>0) ? overlap : -(overlap) > (obj2Hull.width * 0.8))))))){
obj2Hull.x = (obj2Hull.x - ox2);
obj2Hull.y = (obj2Hull.y - oy2);
} else {
hit = true;
sv1 = Object2.velocity.x;
sv2 = Object1.velocity.x;
if (((!(Object1.fixed)) && (Object2.fixed))){
if (Object1._group){
Object1.reset((Object1.x - overlap), Object1.y);
} else {
Object1.x = (Object1.x - overlap);
};
} else {
if (((Object1.fixed) && (!(Object2.fixed)))){
if (Object2._group){
Object2.reset((Object2.x + overlap), Object2.y);
} else {
Object2.x = (Object2.x + overlap);
};
} else {
if (((!(Object1.fixed)) && (!(Object2.fixed)))){
overlap = (overlap / 2);
if (Object1._group){
Object1.reset((Object1.x - overlap), Object1.y);
} else {
Object1.x = (Object1.x - overlap);
};
if (Object2._group){
Object2.reset((Object2.x + overlap), Object2.y);
} else {
Object2.x = (Object2.x + overlap);
};
sv1 = (sv1 / 2);
sv2 = (sv2 / 2);
};
};
};
if (p1hn2){
Object1.hitRight(Object2, sv1);
Object2.hitLeft(Object1, sv2);
} else {
Object1.hitLeft(Object2, sv1);
Object2.hitRight(Object1, sv2);
};
if (((!(Object1.fixed)) && (!((overlap == 0))))){
if (p1hn2){
obj1Hull.width = (obj1Hull.width - overlap);
} else {
obj1Hull.x = (obj1Hull.x - overlap);
obj1Hull.width = (obj1Hull.width + overlap);
};
Object1.colHullY.x = (Object1.colHullY.x - overlap);
};
if (((!(Object2.fixed)) && (!((overlap == 0))))){
if (p1hn2){
obj2Hull.x = (obj2Hull.x + overlap);
obj2Hull.width = (obj2Hull.width - overlap);
} else {
obj2Hull.width = (obj2Hull.width + overlap);
};
Object2.colHullY.x = (Object2.colHullY.x + overlap);
};
obj2Hull.x = (obj2Hull.x - ox2);
obj2Hull.y = (obj2Hull.y - oy2);
};
};
i2++;
};
obj1Hull.x = (obj1Hull.x - ox1);
obj1Hull.y = (obj1Hull.y - oy1);
i1++;
};
return (hit);
}
public static function computeVelocity(Velocity:Number, Acceleration:Number=0, Drag:Number=0, Max:Number=10000):Number{
var d:Number;
if (Acceleration != 0){
Velocity = (Velocity + (Acceleration * FlxG.elapsed));
} else {
if (Drag != 0){
d = (Drag * FlxG.elapsed);
if ((Velocity - d) > 0){
Velocity = (Velocity - d);
} else {
if ((Velocity + d) < 0){
Velocity = (Velocity + d);
} else {
Velocity = 0;
};
};
};
};
if (((!((Velocity == 0))) && (!((Max == 10000))))){
if (Velocity > Max){
Velocity = Max;
} else {
if (Velocity < -(Max)){
Velocity = -(Max);
};
};
};
return (Velocity);
}
public static function collide(Object1:FlxObject, Object2:FlxObject):Boolean{
if ((((((((Object1 == null)) || (!(Object1.exists)))) || ((Object2 == null)))) || (!(Object2.exists)))){
return (false);
};
quadTree = new FlxQuadTree(quadTreeBounds.x, quadTreeBounds.y, quadTreeBounds.width, quadTreeBounds.height);
quadTree.add(Object1, FlxQuadTree.A_LIST);
var match = (Object1 === Object2);
if (!match){
quadTree.add(Object2, FlxQuadTree.B_LIST);
};
var cx:Boolean = quadTree.overlap(!(match), solveXCollision);
var cy:Boolean = quadTree.overlap(!(match), solveYCollision);
return (((cx) || (cy)));
}
}
}//package org.flixel
Section 257
//_activeButtonStyleStyle (_activeButtonStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _activeButtonStyleStyle {
public static function init(_activeButtonStyleStyle:IFlexModuleFactory):void{
var fbs = _activeButtonStyleStyle;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".activeButtonStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".activeButtonStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 258
//_activeTabStyleStyle (_activeTabStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _activeTabStyleStyle {
public static function init(:IFlexModuleFactory):void{
var fbs = ;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".activeTabStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".activeTabStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 259
//_alertButtonStyleStyle (_alertButtonStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _alertButtonStyleStyle {
public static function init(:IFlexModuleFactory):void{
var fbs = ;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".alertButtonStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".alertButtonStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.color = 734012;
};
};
}
}
}//package
Section 260
//_comboDropdownStyle (_comboDropdownStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _comboDropdownStyle {
public static function init(leading:IFlexModuleFactory):void{
var fbs = leading;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".comboDropdown");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".comboDropdown", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.shadowDirection = "center";
this.fontWeight = "normal";
this.dropShadowEnabled = true;
this.leading = 0;
this.backgroundColor = 0xFFFFFF;
this.shadowDistance = 1;
this.cornerRadius = 0;
this.borderThickness = 0;
this.paddingLeft = 5;
this.paddingRight = 5;
};
};
}
}
}//package
Section 261
//_dataGridStylesStyle (_dataGridStylesStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _dataGridStylesStyle {
public static function init(:IFlexModuleFactory):void{
var fbs = ;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".dataGridStyles");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".dataGridStyles", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 262
//_dateFieldPopupStyle (_dateFieldPopupStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _dateFieldPopupStyle {
public static function init(_dateFieldPopupStyle.as$3:IFlexModuleFactory):void{
var fbs = _dateFieldPopupStyle.as$3;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".dateFieldPopup");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".dateFieldPopup", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.dropShadowEnabled = true;
this.backgroundColor = 0xFFFFFF;
this.borderThickness = 0;
};
};
}
}
}//package
Section 263
//_errorTipStyle (_errorTipStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _errorTipStyle {
public static function init(borderColor:IFlexModuleFactory):void{
var fbs = borderColor;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".errorTip");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".errorTip", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
this.borderStyle = "errorTipRight";
this.paddingTop = 4;
this.borderColor = 13510953;
this.color = 0xFFFFFF;
this.fontSize = 9;
this.shadowColor = 0;
this.paddingLeft = 4;
this.paddingBottom = 4;
this.paddingRight = 4;
};
};
}
}
}//package
Section 264
//_globalStyle (_globalStyle)
package {
import mx.core.*;
import mx.styles.*;
import mx.skins.halo.*;
public class _globalStyle {
public static function init(horizontalGridLines:IFlexModuleFactory):void{
var fbs = horizontalGridLines;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("global");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("global", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fillColor = 0xFFFFFF;
this.kerning = false;
this.iconColor = 0x111111;
this.textRollOverColor = 2831164;
this.horizontalAlign = "left";
this.shadowCapColor = 14015965;
this.backgroundAlpha = 1;
this.filled = true;
this.textDecoration = "none";
this.roundedBottomCorners = true;
this.fontThickness = 0;
this.focusBlendMode = "normal";
this.fillColors = [0xFFFFFF, 0xCCCCCC, 0xFFFFFF, 0xEEEEEE];
this.horizontalGap = 8;
this.borderCapColor = 9542041;
this.buttonColor = 7305079;
this.indentation = 17;
this.selectionDisabledColor = 0xDDDDDD;
this.closeDuration = 250;
this.embedFonts = false;
this.paddingTop = 0;
this.letterSpacing = 0;
this.focusAlpha = 0.4;
this.bevel = true;
this.fontSize = 10;
this.shadowColor = 0xEEEEEE;
this.borderAlpha = 1;
this.paddingLeft = 0;
this.fontWeight = "normal";
this.indicatorGap = 14;
this.focusSkin = HaloFocusRect;
this.dropShadowEnabled = false;
this.leading = 2;
this.borderSkin = HaloBorder;
this.fontSharpness = 0;
this.modalTransparencyDuration = 100;
this.borderThickness = 1;
this.backgroundSize = "auto";
this.borderStyle = "inset";
this.borderColor = 12040892;
this.fontAntiAliasType = "advanced";
this.errorColor = 0xFF0000;
this.shadowDistance = 2;
this.horizontalGridLineColor = 0xF7F7F7;
this.stroked = false;
this.modalTransparencyColor = 0xDDDDDD;
this.cornerRadius = 0;
this.verticalAlign = "top";
this.textIndent = 0;
this.fillAlphas = [0.6, 0.4, 0.75, 0.65];
this.verticalGridLineColor = 14015965;
this.themeColor = 40447;
this.version = "3.0.0";
this.shadowDirection = "center";
this.modalTransparency = 0.5;
this.repeatInterval = 35;
this.openDuration = 250;
this.textAlign = "left";
this.fontFamily = "Verdana";
this.textSelectedColor = 2831164;
this.paddingBottom = 0;
this.strokeWidth = 1;
this.fontGridFitType = "pixel";
this.horizontalGridLines = false;
this.useRollOver = true;
this.verticalGridLines = true;
this.repeatDelay = 500;
this.fontStyle = "normal";
this.dropShadowColor = 0;
this.focusThickness = 2;
this.verticalGap = 6;
this.disabledColor = 11187123;
this.paddingRight = 0;
this.focusRoundedCorners = "tl tr bl br";
this.borderSides = "left top right bottom";
this.disabledIconColor = 0x999999;
this.modalTransparencyBlur = 3;
this.color = 734012;
this.selectionDuration = 250;
this.highlightAlphas = [0.3, 0];
};
};
}
}
}//package
Section 265
//_headerDateTextStyle (_headerDateTextStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _headerDateTextStyle {
public static function init(bold:IFlexModuleFactory):void{
var fbs = bold;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".headerDateText");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".headerDateText", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
this.textAlign = "center";
};
};
}
}
}//package
Section 266
//_headerDragProxyStyleStyle (_headerDragProxyStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _headerDragProxyStyleStyle {
public static function init(:IFlexModuleFactory):void{
var fbs = ;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".headerDragProxyStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".headerDragProxyStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 267
//_linkButtonStyleStyle (_linkButtonStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _linkButtonStyleStyle {
public static function init(http://adobe.com/AS3/2006/builtin:IFlexModuleFactory):void{
var fbs = http://adobe.com/AS3/2006/builtin;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".linkButtonStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".linkButtonStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 2;
this.paddingLeft = 2;
this.paddingBottom = 2;
this.paddingRight = 2;
};
};
}
}
}//package
Section 268
//_opaquePanelStyle (_opaquePanelStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _opaquePanelStyle {
public static function init(Object:IFlexModuleFactory):void{
var fbs = Object;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".opaquePanel");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".opaquePanel", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.borderColor = 0xFFFFFF;
this.backgroundColor = 0xFFFFFF;
this.headerColors = [0xE7E7E7, 0xD9D9D9];
this.footerColors = [0xE7E7E7, 0xC7C7C7];
this.borderAlpha = 1;
};
};
}
}
}//package
Section 269
//_plainStyle (_plainStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _plainStyle {
public static function init(backgroundImage:IFlexModuleFactory):void{
var fbs = backgroundImage;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".plain");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".plain", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 0;
this.backgroundColor = 0xFFFFFF;
this.backgroundImage = "";
this.horizontalAlign = "left";
this.paddingLeft = 0;
this.paddingBottom = 0;
this.paddingRight = 0;
};
};
}
}
}//package
Section 270
//_popUpMenuStyle (_popUpMenuStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _popUpMenuStyle {
public static function init(normal:IFlexModuleFactory):void{
var fbs = normal;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".popUpMenu");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".popUpMenu", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "normal";
this.textAlign = "left";
};
};
}
}
}//package
Section 271
//_richTextEditorTextAreaStyleStyle (_richTextEditorTextAreaStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _richTextEditorTextAreaStyleStyle {
public static function init(_richTextEditorTextAreaStyleStyle:IFlexModuleFactory):void{
var fbs = _richTextEditorTextAreaStyleStyle;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".richTextEditorTextAreaStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".richTextEditorTextAreaStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 272
//_swatchPanelTextFieldStyle (_swatchPanelTextFieldStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _swatchPanelTextFieldStyle {
public static function init(shadowCapColor:IFlexModuleFactory):void{
var fbs = shadowCapColor;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".swatchPanelTextField");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".swatchPanelTextField", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.borderStyle = "inset";
this.borderColor = 14015965;
this.highlightColor = 12897484;
this.backgroundColor = 0xFFFFFF;
this.shadowCapColor = 14015965;
this.shadowColor = 14015965;
this.paddingLeft = 5;
this.buttonColor = 7305079;
this.borderCapColor = 9542041;
this.paddingRight = 5;
};
};
}
}
}//package
Section 273
//_textAreaHScrollBarStyleStyle (_textAreaHScrollBarStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _textAreaHScrollBarStyleStyle {
public static function init(_textAreaHScrollBarStyleStyle:IFlexModuleFactory):void{
var fbs = _textAreaHScrollBarStyleStyle;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".textAreaHScrollBarStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".textAreaHScrollBarStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 274
//_textAreaVScrollBarStyleStyle (_textAreaVScrollBarStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _textAreaVScrollBarStyleStyle {
public static function init(_textAreaVScrollBarStyleStyle:IFlexModuleFactory):void{
var fbs = _textAreaVScrollBarStyleStyle;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".textAreaVScrollBarStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".textAreaVScrollBarStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 275
//_todayStyleStyle (_todayStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _todayStyleStyle {
public static function init(color:IFlexModuleFactory):void{
var fbs = color;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".todayStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".todayStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.color = 0xFFFFFF;
this.textAlign = "center";
};
};
}
}
}//package
Section 276
//_weekDayStyleStyle (_weekDayStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _weekDayStyleStyle {
public static function init(bold:IFlexModuleFactory):void{
var fbs = bold;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".weekDayStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".weekDayStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
this.textAlign = "center";
};
};
}
}
}//package
Section 277
//_windowStatusStyle (_windowStatusStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _windowStatusStyle {
public static function init(:IFlexModuleFactory):void{
var fbs = ;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".windowStatus");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".windowStatus", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.color = 0x666666;
};
};
}
}
}//package
Section 278
//_windowStylesStyle (_windowStylesStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _windowStylesStyle {
public static function init(:IFlexModuleFactory):void{
var fbs = ;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".windowStyles");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".windowStyles", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 279
//en_US$core_properties (en_US$core_properties)
package {
import mx.resources.*;
public class en_US$core_properties extends ResourceBundle {
public function en_US$core_properties(){
super("en_US", "core");
}
override protected function getContent():Object{
var _local1:Object = {multipleChildSets_ClassAndInstance:"Multiple sets of visual children have been specified for this component (component definition and component instance).", truncationIndicator:"...", notExecuting:"Repeater is not executing.", versionAlreadyRead:"Compatibility version has already been read.", multipleChildSets_ClassAndSubclass:"Multiple sets of visual children have been specified for this component (base component definition and derived component definition).", viewSource:"View Source", badFile:"File does not exist.", stateUndefined:"Undefined state '{0}'.", versionAlreadySet:"Compatibility version has already been set."};
return (_local1);
}
}
}//package
Section 280
//en_US$skins_properties (en_US$skins_properties)
package {
import mx.resources.*;
public class en_US$skins_properties extends ResourceBundle {
public function en_US$skins_properties(){
super("en_US", "skins");
}
override protected function getContent():Object{
var _local1:Object = {notLoaded:"Unable to load '{0}'."};
return (_local1);
}
}
}//package
Section 281
//en_US$styles_properties (en_US$styles_properties)
package {
import mx.resources.*;
public class en_US$styles_properties extends ResourceBundle {
public function en_US$styles_properties(){
super("en_US", "styles");
}
override protected function getContent():Object{
var _local1:Object = {unableToLoad:"Unable to load style({0}): {1}."};
return (_local1);
}
}
}//package
Section 282
//HelloWorlds (HelloWorlds)
package {
import com.mw.*;
import org.flixel.*;
public class HelloWorlds extends FlxGame {
public function HelloWorlds():void{
super(700, 550, Game, 1);
FlxG.mouse.show();
FlxState.bgColor = 4278190080;
pause = new Pause();
}
}
}//package
Section 283
//Preloader (Preloader)
package {
import org.flixel.*;
public class Preloader extends FlxPreloader {
public function Preloader(){
this.className = "HelloWorlds";
super();
}
}
}//package