Section 1
//AuxFunctions (caurina.transitions.AuxFunctions)
package caurina.transitions {
public class AuxFunctions {
public function AuxFunctions(){
super();
}
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);
}
public static function numberToG(p_num:Number):Number{
return (((p_num & 0xFF00) >> 8));
}
public static function numberToR(p_num:Number):Number{
return (((p_num & 0xFF0000) >> 16));
}
public static function isInArray(p_string:String, p_array:Array):Boolean{
var l:uint = p_array.length;
var i:uint;
while (i < l) {
if (p_array[i] == p_string){
return (true);
};
i++;
};
return (false);
}
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 numberToB(p_num:Number):Number{
return ((p_num & 0xFF));
}
}
}//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):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, a:Number=NaN, p:Number=NaN):Number{
var s:Number;
if (t == 0){
return (b);
};
t = (t / (d / 2));
if (t == 2){
return ((b + c));
};
if (!p){
p = (d * (0.3 * 1.5));
};
if (((!(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):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):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, s:Number=NaN):Number{
if (!s){
s = 1.70158;
};
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):Number{
if (t < (d / 2)){
return (easeOutCubic((t * 2), b, (c / 2), d));
};
return (easeInCubic(((t * 2) - d), (b + (c / 2)), (c / 2), d));
}
public static function easeNone(t:Number, b:Number, c:Number, d:Number):Number{
return ((((c * t) / d) + b));
}
public static function easeOutBack(t:Number, b:Number, c:Number, d:Number, s:Number=NaN):Number{
if (!s){
s = 1.70158;
};
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):Number{
return ((((-(c) / 2) * (Math.cos(((Math.PI * t) / d)) - 1)) + b));
}
public static function easeInBack(t:Number, b:Number, c:Number, d:Number, s:Number=NaN):Number{
if (!s){
s = 1.70158;
};
t = (t / d);
return (((((c * t) * t) * (((s + 1) * t) - s)) + b));
}
public static function easeInQuart(t:Number, b:Number, c:Number, d:Number):Number{
t = (t / d);
return ((((((c * t) * t) * t) * t) + b));
}
public static function easeOutInQuint(t:Number, b:Number, c:Number, d:Number):Number{
if (t < (d / 2)){
return (easeOutQuint((t * 2), b, (c / 2), d));
};
return (easeInQuint(((t * 2) - d), (b + (c / 2)), (c / 2), d));
}
public static function easeOutInBounce(t:Number, b:Number, c:Number, d:Number):Number{
if (t < (d / 2)){
return (easeOutBounce((t * 2), b, (c / 2), d));
};
return (easeInBounce(((t * 2) - d), (b + (c / 2)), (c / 2), d));
}
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):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, s:Number=NaN):Number{
if (t < (d / 2)){
return (easeOutBack((t * 2), b, (c / 2), d, s));
};
return (easeInBack(((t * 2) - d), (b + (c / 2)), (c / 2), d, s));
}
public static function easeInExpo(t:Number, b:Number, c:Number, d:Number):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):Number{
t = (t / d);
return (((((c * t) * t) * t) + b));
}
public static function easeInQuint(t:Number, b:Number, c:Number, d:Number):Number{
t = (t / d);
return (((((((c * t) * t) * t) * t) * t) + b));
}
public static function easeInOutCirc(t:Number, b:Number, c:Number, d:Number):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):Number{
t = (t / d);
return ((((c * t) * t) + b));
}
public static function easeInBounce(t:Number, b:Number, c:Number, d:Number):Number{
return (((c - easeOutBounce((d - t), 0, c, d)) + b));
}
public static function easeOutInExpo(t:Number, b:Number, c:Number, d:Number):Number{
if (t < (d / 2)){
return (easeOutExpo((t * 2), b, (c / 2), d));
};
return (easeInExpo(((t * 2) - d), (b + (c / 2)), (c / 2), d));
}
public static function easeOutQuart(t:Number, b:Number, c:Number, d:Number):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):Number{
return ((((-(c) * Math.cos(((t / d) * (Math.PI / 2)))) + c) + b));
}
public static function easeInOutQuart(t:Number, b:Number, c:Number, d:Number):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):Number{
t = (t / d);
return ((((-(c) * t) * (t - 2)) + b));
}
public static function easeOutInElastic(t:Number, b:Number, c:Number, d:Number, a:Number=NaN, p:Number=NaN):Number{
if (t < (d / 2)){
return (easeOutElastic((t * 2), b, (c / 2), d, a, p));
};
return (easeInElastic(((t * 2) - d), (b + (c / 2)), (c / 2), d, a, p));
}
public static function easeInElastic(t:Number, b:Number, c:Number, d:Number, a:Number=NaN, p:Number=NaN):Number{
var s:Number;
if (t == 0){
return (b);
};
t = (t / d);
if (t == 1){
return ((b + c));
};
if (!p){
p = (d * 0.3);
};
if (((!(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):Number{
t = ((t / d) - 1);
return (((c * (((t * t) * t) + 1)) + b));
}
public static function easeOutQuint(t:Number, b:Number, c:Number, d:Number):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):Number{
if (t < (d / 2)){
return (easeOutQuad((t * 2), b, (c / 2), d));
};
return (easeInQuad(((t * 2) - d), (b + (c / 2)), (c / 2), d));
}
public static function easeOutSine(t:Number, b:Number, c:Number, d:Number):Number{
return (((c * Math.sin(((t / d) * (Math.PI / 2)))) + b));
}
public static function easeInOutCubic(t:Number, b:Number, c:Number, d:Number):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):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):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):Number{
if (t < (d / 2)){
return (easeOutSine((t * 2), b, (c / 2), d));
};
return (easeInSine(((t * 2) - d), (b + (c / 2)), (c / 2), d));
}
public static function easeInOutExpo(t:Number, b:Number, c:Number, d:Number):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, a:Number=NaN, p:Number=NaN):Number{
var s:Number;
if (t == 0){
return (b);
};
t = (t / d);
if (t == 1){
return ((b + c));
};
if (!p){
p = (d * 0.3);
};
if (((!(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):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):Number{
if (t < (d / 2)){
return (easeOutQuart((t * 2), b, (c / 2), d));
};
return (easeInQuart(((t * 2) - d), (b + (c / 2)), (c / 2), d));
}
public static function easeOutInCirc(t:Number, b:Number, c:Number, d:Number):Number{
if (t < (d / 2)){
return (easeOutCirc((t * 2), b, (c / 2), d));
};
return (easeInCirc(((t * 2) - d), (b + (c / 2)), (c / 2), d));
}
}
}//package caurina.transitions
Section 3
//PropertyInfoObj (caurina.transitions.PropertyInfoObj)
package caurina.transitions {
public class PropertyInfoObj {
public var modifierParameters:Array;
public var valueComplete:Number;
public var modifierFunction:Function;
public var hasModifier:Boolean;
public var valueStart:Number;
public function PropertyInfoObj(p_valueStart:Number, p_valueComplete:Number, p_modifierFunction:Function, p_modifierParameters:Array){
super();
valueStart = p_valueStart;
valueComplete = p_valueComplete;
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 + ("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, modifierFunction, modifierParameters);
return (nProperty);
}
}
}//package caurina.transitions
Section 4
//SpecialPropertiesDefault (caurina.transitions.SpecialPropertiesDefault)
package caurina.transitions {
import flash.geom.*;
import flash.media.*;
import flash.filters.*;
public class SpecialPropertiesDefault {
public function SpecialPropertiesDefault(){
super();
trace("SpecialProperties is a static class and should not be instantiated.");
}
public static function _sound_volume_get(p_obj:Object):Number{
return (p_obj.soundTransform.volume);
}
public static function _color_splitter(p_value, p_parameters:Array):Array{
var nArray:Array = new Array();
if (p_value == null){
nArray.push({name:"_color_ra", value:1});
nArray.push({name:"_color_rb", value:0});
nArray.push({name:"_color_ga", value:1});
nArray.push({name:"_color_gb", value:0});
nArray.push({name:"_color_ba", value:1});
nArray.push({name:"_color_bb", value:0});
} else {
nArray.push({name:"_color_ra", value:0});
nArray.push({name:"_color_rb", value:AuxFunctions.numberToR(p_value)});
nArray.push({name:"_color_ga", value:0});
nArray.push({name:"_color_gb", value:AuxFunctions.numberToG(p_value)});
nArray.push({name:"_color_ba", value:0});
nArray.push({name:"_color_bb", value:AuxFunctions.numberToB(p_value)});
};
return (nArray);
}
public static function frame_get(p_obj:Object):Number{
return (p_obj.currentFrame);
}
public static function _sound_pan_get(p_obj:Object):Number{
return (p_obj.soundTransform.pan);
}
public static function _color_property_get(p_obj:Object, p_parameters:Array):Number{
return (p_obj.transform.colorTransform[p_parameters[0]]);
}
public static function _sound_volume_set(p_obj:Object, p_value:Number):void{
var sndTransform:SoundTransform = p_obj.soundTransform;
sndTransform.volume = p_value;
p_obj.soundTransform = sndTransform;
}
public static function _autoAlpha_get(p_obj:Object):Number{
return (p_obj.alpha);
}
public static function _filter_splitter(p_value:BitmapFilter, p_parameters:Array):Array{
var nArray:Array = new Array();
if ((p_value is BlurFilter)){
nArray.push({name:"_blur_blurX", value:BlurFilter(p_value).blurX});
nArray.push({name:"_blur_blurY", value:BlurFilter(p_value).blurY});
nArray.push({name:"_blur_quality", value:BlurFilter(p_value).quality});
} else {
trace("??");
};
return (nArray);
}
public static function init():void{
Tweener.registerSpecialProperty("_frame", frame_get, frame_set);
Tweener.registerSpecialProperty("_sound_volume", _sound_volume_get, _sound_volume_set);
Tweener.registerSpecialProperty("_sound_pan", _sound_pan_get, _sound_pan_set);
Tweener.registerSpecialProperty("_color_ra", _color_property_get, _color_property_set, ["redMultiplier"]);
Tweener.registerSpecialProperty("_color_rb", _color_property_get, _color_property_set, ["redOffset"]);
Tweener.registerSpecialProperty("_color_ga", _color_property_get, _color_property_set, ["greenMultiplier"]);
Tweener.registerSpecialProperty("_color_gb", _color_property_get, _color_property_set, ["greenOffset"]);
Tweener.registerSpecialProperty("_color_ba", _color_property_get, _color_property_set, ["blueMultiplier"]);
Tweener.registerSpecialProperty("_color_bb", _color_property_get, _color_property_set, ["blueOffset"]);
Tweener.registerSpecialProperty("_color_aa", _color_property_get, _color_property_set, ["alphaMultiplier"]);
Tweener.registerSpecialProperty("_color_ab", _color_property_get, _color_property_set, ["alphaOffset"]);
Tweener.registerSpecialProperty("_autoAlpha", _autoAlpha_get, _autoAlpha_set);
Tweener.registerSpecialPropertySplitter("_color", _color_splitter);
Tweener.registerSpecialPropertySplitter("_colorTransform", _colorTransform_splitter);
Tweener.registerSpecialPropertySplitter("_scale", _scale_splitter);
Tweener.registerSpecialProperty("_blur_blurX", _filter_property_get, _filter_property_set, [BlurFilter, "blurX"]);
Tweener.registerSpecialProperty("_blur_blurY", _filter_property_get, _filter_property_set, [BlurFilter, "blurY"]);
Tweener.registerSpecialProperty("_blur_quality", _filter_property_get, _filter_property_set, [BlurFilter, "quality"]);
Tweener.registerSpecialPropertySplitter("_filter", _filter_splitter);
Tweener.registerSpecialPropertyModifier("_bezier", _bezier_modifier, _bezier_get);
}
public static function _sound_pan_set(p_obj:Object, p_value:Number):void{
var sndTransform:SoundTransform = p_obj.soundTransform;
sndTransform.pan = p_value;
p_obj.soundTransform = sndTransform;
}
public static function _color_property_set(p_obj:Object, p_value:Number, p_parameters:Array):void{
var tf:ColorTransform = p_obj.transform.colorTransform;
tf[p_parameters[0]] = p_value;
p_obj.transform.colorTransform = tf;
}
public static function _filter_property_get(p_obj:Object, p_parameters:Array):Number{
var i:uint;
var defaultValues:Object;
var f:Array = p_obj.filters;
var filterClass:Object = p_parameters[0];
var propertyName:String = p_parameters[1];
i = 0;
while (i < f.length) {
if ((((f[i] is BlurFilter)) && ((filterClass == BlurFilter)))){
return (f[i][propertyName]);
};
i++;
};
switch (filterClass){
case BlurFilter:
defaultValues = {blurX:0, blurY:0, quality:NaN};
break;
};
return (defaultValues[propertyName]);
}
public static function _bezier_get(b:Number, e:Number, t:Number, p:Array):Number{
var ip:uint;
var it:Number;
var p1:Number;
var p2:Number;
if (p.length == 1){
return ((b + (t * (((2 * (1 - t)) * (p[0] - b)) + (t * (e - b))))));
};
ip = Math.floor((t * p.length));
it = ((t - (ip * (1 / p.length))) * p.length);
if (ip == 0){
p1 = b;
p2 = ((p[0] + p[1]) / 2);
} else {
if (ip == (p.length - 1)){
p1 = ((p[(ip - 1)] + p[ip]) / 2);
p2 = e;
} else {
p1 = ((p[(ip - 1)] + p[ip]) / 2);
p2 = ((p[ip] + p[(ip + 1)]) / 2);
};
};
return ((p1 + (it * (((2 * (1 - it)) * (p[ip] - p1)) + (it * (p2 - p1))))));
}
public static function frame_set(p_obj:Object, p_value:Number):void{
p_obj.gotoAndStop(Math.round(p_value));
}
public static function _filter_property_set(p_obj:Object, p_value:Number, p_parameters:Array):void{
var i:uint;
var fi:BitmapFilter;
var f:Array = p_obj.filters;
var filterClass:Object = p_parameters[0];
var propertyName:String = p_parameters[1];
i = 0;
while (i < f.length) {
if ((((f[i] is BlurFilter)) && ((filterClass == BlurFilter)))){
f[i][propertyName] = p_value;
p_obj.filters = f;
return;
};
i++;
};
if (f == null){
f = new Array();
};
switch (filterClass){
case BlurFilter:
fi = new BlurFilter(0, 0);
break;
};
fi[propertyName] = p_value;
f.push(fi);
p_obj.filters = f;
}
public static function _autoAlpha_set(p_obj:Object, p_value:Number):void{
p_obj.alpha = p_value;
p_obj.visible = (p_value > 0);
}
public static function _scale_splitter(p_value:Number, p_parameters:Array):Array{
var nArray:Array = new Array();
nArray.push({name:"scaleX", value:p_value});
nArray.push({name:"scaleY", value:p_value});
return (nArray);
}
public static function _colorTransform_splitter(p_value, p_parameters:Array):Array{
var nArray:Array = new Array();
if (p_value == null){
nArray.push({name:"_color_ra", value:1});
nArray.push({name:"_color_rb", value:0});
nArray.push({name:"_color_ga", value:1});
nArray.push({name:"_color_gb", value:0});
nArray.push({name:"_color_ba", value:1});
nArray.push({name:"_color_bb", value:0});
} else {
if (p_value.ra != undefined){
nArray.push({name:"_color_ra", value:p_value.ra});
};
if (p_value.rb != undefined){
nArray.push({name:"_color_rb", value:p_value.rb});
};
if (p_value.ga != undefined){
nArray.push({name:"_color_ba", value:p_value.ba});
};
if (p_value.gb != undefined){
nArray.push({name:"_color_bb", value:p_value.bb});
};
if (p_value.ba != undefined){
nArray.push({name:"_color_ga", value:p_value.ga});
};
if (p_value.bb != undefined){
nArray.push({name:"_color_gb", value:p_value.gb});
};
if (p_value.aa != undefined){
nArray.push({name:"_color_aa", value:p_value.aa});
};
if (p_value.ab != undefined){
nArray.push({name:"_color_ab", value:p_value.ab});
};
};
return (nArray);
}
public static function _bezier_modifier(p_obj):Array{
var pList:Array;
var i:uint;
var istr:String;
var mList:Array = [];
if ((p_obj is Array)){
pList = p_obj;
} else {
pList = [p_obj];
};
var mListObj:Object = {};
i = 0;
while (i < pList.length) {
for (istr in pList[i]) {
if (mListObj[istr] == undefined){
mListObj[istr] = [];
};
mListObj[istr].push(pList[i][istr]);
};
i++;
};
for (istr in mListObj) {
mList.push({name:istr, parameters:mListObj[istr]});
};
return (mList);
}
}
}//package caurina.transitions
Section 5
//SpecialProperty (caurina.transitions.SpecialProperty)
package caurina.transitions {
public class SpecialProperty {
public var parameters:Array;
public var getValue:Function;
public var setValue:Function;
public function SpecialProperty(p_getFunction:Function, p_setFunction:Function, p_parameters:Array=null){
super();
getValue = p_getFunction;
setValue = p_setFunction;
parameters = p_parameters;
}
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 + "]");
return (value);
}
}
}//package caurina.transitions
Section 6
//SpecialPropertyModifier (caurina.transitions.SpecialPropertyModifier)
package caurina.transitions {
public class SpecialPropertyModifier {
public var getValue:Function;
public var modifyValues:Function;
public function SpecialPropertyModifier(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 7
//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;
}
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 8
//Tweener (caurina.transitions.Tweener)
package caurina.transitions {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Tweener {
private static var _timeScale:Number = 1;
private static var _specialPropertySplitterList:Object;
private static var _engineExists:Boolean = false;
private static var _specialPropertyModifierList:Object;
private static var _currentTime:Number;
private static var _tweenList:Array;
private static var _specialPropertyList:Object;
private static var _transitionList:Object;
private static var _inited:Boolean = false;
private static var __tweener_controller__:MovieClip;
public function Tweener(){
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):void{
if (!_inited){
init();
};
var sp:SpecialProperty = new SpecialProperty(p_getFunction, p_setFunction, p_parameters);
_specialPropertyList[p_name] = sp;
}
public static function addCaller(p_arg1:Object=null, p_arg2:Object=null):Boolean{
var i:Number;
var j:Number;
var rTransition:Function;
var nTween:TweenListObj;
var myT:Number;
var trans:String;
if ((((arguments.length < 2)) || ((arguments[0] == undefined)))){
return (false);
};
var rScopes:Array = new Array();
if ((arguments[0] is Array)){
i = 0;
while (i < arguments[0].length) {
rScopes.push(arguments[0][i]);
i++;
};
} else {
i = 0;
while (i < (arguments.length - 1)) {
rScopes.push(arguments[i]);
i++;
};
};
var p_obj:Object = arguments[(arguments.length - 1)];
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) {
nTween = new TweenListObj(rScopes[i], (_currentTime + ((rDelay * 1000) / _timeScale)), (_currentTime + (((rDelay * 1000) + (rTime * 1000)) / _timeScale)), (p_obj.useFrames == true), rTransition);
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.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 init(p_object=null):void{
_inited = true;
_transitionList = new Object();
Equations.init();
_specialPropertyList = new Object();
_specialPropertyModifierList = new Object();
_specialPropertySplitterList = new Object();
SpecialPropertiesDefault.init();
}
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 removeTweens(p_scope:Object, ... _args):Boolean{
var i:uint;
var properties:Array = new Array();
i = 0;
while (i < _args.length) {
if ((((typeof(_args[i]) == "string")) && (!(AuxFunctions.isInArray(_args[i], properties))))){
properties.push(_args[i]);
};
i++;
};
return (affectTweens(removeTweenByIndex, p_scope, properties));
}
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 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);
};
tTweening.timeStart = (tTweening.timeStart + (_currentTime - tTweening.timePaused));
tTweening.timeComplete = (tTweening.timeComplete + (_currentTime - tTweening.timePaused));
tTweening.timePaused = undefined;
tTweening.isPaused = false;
return (true);
}
public static function debug_getList():String{
var i:uint;
var k:uint;
var ttl:String = "";
i = 0;
while (i < _tweenList.length) {
ttl = (ttl + (("[" + i) + "] ::\n"));
k = 0;
while (k < _tweenList[i].properties.length) {
ttl = (ttl + ((((" " + _tweenList[i].properties[k].name) + " -> ") + _tweenList[i].properties[k].valueComplete) + "\n"));
k++;
};
i++;
};
return (ttl);
}
public static function getVersion():String{
return ("AS3 1.26.62");
}
public static function onEnterFrame(e:Event):void{
updateTime();
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 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;
if (_currentTime >= 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)){
tTweening.onUpdate.apply(tScope, tTweening.onUpdateParams);
continue;
var _slot1 = e;
handleError(tTweening, _slot1, "onUpdate");
};
} while (tTweening.timesCalled++, !(tTweening.timesCalled >= tTweening.count));
} else {
mustUpdate = (((((tTweening.skipUpdates < 1)) || (!(tTweening.skipUpdates)))) || ((tTweening.updatesSkipped >= tTweening.skipUpdates)));
if (_currentTime >= tTweening.timeComplete){
isOver = true;
mustUpdate = true;
};
if (!tTweening.hasStarted){
if (Boolean(tTweening.onStart)){
tTweening.onStart.apply(tScope, tTweening.onStartParams);
//unresolved jump
var _slot1 = e;
handleError(tTweening, _slot1, "onStart");
};
for (pName in tTweening.properties) {
pv = getPropertyValue(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 = (_currentTime - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, 0, 1, d);
nv = tProperty.modifierFunction(tProperty.valueStart, tProperty.valueComplete, nv, tProperty.modifierParameters);
} else {
t = (_currentTime - tTweening.timeStart);
b = tProperty.valueStart;
c = (tProperty.valueComplete - tProperty.valueStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d);
};
};
if (tTweening.rounded){
nv = Math.round(nv);
};
setPropertyValue(tScope, pName, nv);
};
tTweening.updatesSkipped = 0;
if (Boolean(tTweening.onUpdate)){
tTweening.onUpdate.apply(tScope, tTweening.onUpdateParams);
//unresolved jump
var _slot1 = e;
handleError(tTweening, _slot1, "onUpdate");
};
} else {
tTweening.updatesSkipped++;
};
};
if (((isOver) && (Boolean(tTweening.onComplete)))){
tTweening.onComplete.apply(tScope, tTweening.onCompleteParams);
//unresolved jump
var _slot1 = e;
handleError(tTweening, _slot1, "onComplete");
};
return (!(isOver));
};
return (true);
}
public static function setTimeScale(p_time:Number):void{
var i: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) {
_tweenList[i].timeStart = (_currentTime - (((_currentTime - _tweenList[i].timeStart) * _timeScale) / p_time));
_tweenList[i].timeComplete = (_currentTime - (((_currentTime - _tweenList[i].timeComplete) * _timeScale) / p_time));
if (_tweenList[i].timePaused != undefined){
_tweenList[i].timePaused = (_currentTime - (((_currentTime - _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 pTweening = pTweening;
var pError = pError;
var pCallBackName = pCallBackName;
if (((Boolean(pTweening.onError)) && ((pTweening.onError is Function)))){
pTweening.onError.apply(pTweening.scope, [pTweening.scope, pError]);
//unresolved jump
var _slot1 = metaError;
trace("## [Tweener] Error:", pTweening.scope, "raised an error while executing the 'onError' handler. Original error:\n", pError.getStackTrace(), "\nonError error:", _slot1.getStackTrace());
} else {
if (!Boolean(pTweening.onError)){
trace("## [Tweener] Error: :", 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);
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_arg1:Object=null, p_arg2:Object=null):Boolean{
var i:Number;
var j:Number;
var istr:String;
var jstr:String;
var rTransition:Function;
var nProperties:Object;
var nTween:TweenListObj;
var myT:Number;
var splitProperties:Array;
var tempModifiedProperties:Array;
var trans:String;
if ((((arguments.length < 2)) || ((arguments[0] == undefined)))){
return (false);
};
var rScopes:Array = new Array();
if ((arguments[0] is Array)){
i = 0;
while (i < arguments[0].length) {
rScopes.push(arguments[0][i]);
i++;
};
} else {
i = 0;
while (i < (arguments.length - 1)) {
rScopes.push(arguments[i]);
i++;
};
};
var p_obj:Object = TweenListObj.makePropertiesChain(arguments[(arguments.length - 1)]);
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 = {time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams: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) {
rProperties[splitProperties[i].name] = {valueStart:undefined, valueComplete:splitProperties[i].value};
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 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].modifierFunction, rProperties[istr].modifierParameters);
};
nTween = new TweenListObj(rScopes[i], (_currentTime + ((rDelay * 1000) / _timeScale)), (_currentTime + (((rDelay * 1000) + (rTime * 1000)) / _timeScale)), (p_obj.useFrames == true), rTransition);
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.rounded = p_obj.rounded;
nTween.skipUpdates = p_obj.skipUpdates;
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;
}
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 (_tweenList[i].scope == p_scope){
for (pName in _tweenList[i].properties) {
tList.push(pName);
};
};
i++;
};
return (tList);
}
private static function setPropertyValue(p_obj:Object, p_prop:String, p_value:Number):void{
if (_specialPropertyList[p_prop] != undefined){
if (Boolean(_specialPropertyList[p_prop].parameters)){
_specialPropertyList[p_prop].setValue(p_obj, p_value, _specialPropertyList[p_prop].parameters);
} else {
_specialPropertyList[p_prop].setValue(p_obj, p_value);
};
} else {
p_obj[p_prop] = p_value;
};
}
private static function getPropertyValue(p_obj:Object, p_prop:String):Number{
if (_specialPropertyList[p_prop] != undefined){
if (Boolean(_specialPropertyList[p_prop].parameters)){
return (_specialPropertyList[p_prop].getValue(p_obj, _specialPropertyList[p_prop].parameters));
};
return (_specialPropertyList[p_prop].getValue(p_obj));
} else {
};
return (!NULL!);
}
public static function isTweening(p_scope:Object):Boolean{
var i:uint;
if (!Boolean(_tweenList)){
return (false);
};
i = 0;
while (i < _tweenList.length) {
if (_tweenList[i].scope == p_scope){
return (true);
};
i++;
};
return (false);
}
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 (_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;
__tweener_controller__.removeEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
__tweener_controller__ = null;
}
public static function pauseTweenByIndex(p_tween:Number):Boolean{
var tTweening:TweenListObj = _tweenList[p_tween];
if ((((tTweening == null)) || (tTweening.isPaused))){
return (false);
};
tTweening.timePaused = _currentTime;
tTweening.isPaused = true;
return (true);
}
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 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)){
_tweenList[i].onOverwrite.apply(_tweenList[i].scope, _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")) && (!(AuxFunctions.isInArray(_args[i], properties))))){
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")) && (!(AuxFunctions.isInArray(_args[i], properties))))){
properties.push(_args[i]);
};
i++;
};
return (affectTweens(pauseTweenByIndex, p_scope, properties));
}
}
}//package caurina.transitions
Section 9
//TweenListObj (caurina.transitions.TweenListObj)
package caurina.transitions {
public class TweenListObj {
public var hasStarted:Boolean;
public var onUpdate:Function;
public var useFrames:Boolean;
public var count:Number;
public var onOverwriteParams:Array;
public var timeStart:Number;
public var auxProperties:Object;
public var timeComplete:Number;
public var onStartParams:Array;
public var rounded:Boolean;
public var updatesSkipped:Number;
public var onUpdateParams:Array;
public var onComplete:Function;
public var properties:Object;
public var onStart:Function;
public var skipUpdates:Number;
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 onOverwrite:Function;
public var isPaused:Boolean;
public var waitFrames:Boolean;
public function TweenListObj(p_scope:Object, p_timeStart:Number, p_timeComplete:Number, p_useFrames:Boolean, p_transition:Function){
super();
scope = p_scope;
timeStart = p_timeStart;
timeComplete = p_timeComplete;
useFrames = p_useFrames;
transition = p_transition;
auxProperties = new Object();
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);
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.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 returnStr:String = "\n[TweenListObj ";
returnStr = (returnStr + ("scope:" + String(scope)));
returnStr = (returnStr + ", properties:");
var i:uint;
while (i < properties.length) {
if (i > 0){
returnStr = (returnStr + ",");
};
returnStr = (returnStr + ("[name:" + properties[i].name));
returnStr = (returnStr + (",valueStart:" + properties[i].valueStart));
returnStr = (returnStr + (",valueComplete:" + properties[i].valueComplete));
returnStr = (returnStr + "]");
i++;
};
returnStr = (returnStr + (", timeStart:" + String(timeStart)));
returnStr = (returnStr + (", timeComplete:" + String(timeComplete)));
returnStr = (returnStr + (", useFrames:" + String(useFrames)));
returnStr = (returnStr + (", transition:" + String(transition)));
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 (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 10
//BranchCalculator (com.evilfree.BranchCalculator)
package com.evilfree {
public class BranchCalculator {
public function BranchCalculator(){
super();
}
public static function findBranches(xml:XML):Array{
var branch:Array;
var br:String;
var b:Number;
var scenes:XMLList = xml.imageSet;
var branches:Array = [];
branches = followBranch(scenes, 0, []);
for each (branch in branches) {
br = "BRANCH: ";
for each (b in branch) {
br = (br + (" -> " + scenes[b].@name[0].toString()));
};
trace(br);
};
return (branches);
}
public static function followBranch(scenes:XMLList, start:Number, curBranch:Array):Array{
var scene:XML;
var tmpBranch:Array;
var tmp:Number;
var branches:Array;
var c:Number;
var branch:XML;
var tmpBranches:Array;
var aBranch:Array;
var scenes = scenes;
var start = start;
var curBranch = curBranch;
var scenesByName:Object = [];
var x:Number = 0;
for each (scene in scenes) {
scenesByName[scene.@name[0].toString()] = x;
x = (x + 1);
};
tmpBranch = [];
for each (tmp in curBranch) {
tmpBranch.push(tmp);
};
branches = [];
c = start;
for (;c < scenes.length();if (scenes[c].branch[0] != null){
for each (branch in scenes[c].branch) {
tmpBranches = followBranch(scenes, scenesByName[branch.@target[0].toString()], tmpBranch);
for each (aBranch in tmpBranches) {
branches.push(aBranch);
};
};
return (branches);
}, (c = (c + 1))) {
tmpBranch.push(c);
if (scenes[c].@end[0].toString() == "true"){
branches.push(tmpBranch);
return (branches);
};
continue;
var _slot1 = e;
};
branches.push(tmpBranch);
return (branches);
}
}
}//package com.evilfree
Section 11
//CheatDispatcher (com.evilfree.CheatDispatcher)
package com.evilfree {
import mx.core.*;
import flash.events.*;
public class CheatDispatcher extends UIComponent {
private var _keyList:String;// = ""
private var _cheats:Object;
public function CheatDispatcher(cheats:Object){
super();
_cheats = cheats;
}
public function addKeyFromEvent(e:KeyboardEvent):void{
var t:String;
_keyList = (_keyList + String.fromCharCode(e.charCode));
for (t in _cheats) {
if (_keyList.substr((_keyList.length - t.length)) == t){
dispatchEvent(new Event(_cheats[t]));
};
};
if (_keyList.length >= 25){
_keyList = _keyList.substr(1);
};
}
}
}//package com.evilfree
Section 12
//CPMStarAd (com.evilfree.CPMStarAd)
package com.evilfree {
import flash.display.*;
import flash.system.*;
import flash.net.*;
public class CPMStarAd extends Sprite {
public var subPoolId:Number;
public var poolId:Number;
public var loaded:Boolean;// = false
private var adUnit:Loader;
public function CPMStarAd(pool:Number=4613, subPool:Number=20){
adUnit = new Loader();
super();
this.poolId = pool;
this.subPoolId = subPool;
this.graphics.beginFill(0);
this.graphics.drawRect(0, 0, 300, 250);
this.graphics.endFill();
Security.allowDomain("server.cpmstar.com");
adUnit.load(new URLRequest(((("http://server.cpmstar.com/adviewas3.swf?poolid=" + poolId) + "&subpoolid=") + subPoolId)));
loaded = true;
addChild(adUnit);
}
public function unload():void{
if (loaded){
removeChild(adUnit);
adUnit.unload();
loaded = false;
};
}
}
}//package com.evilfree
Section 13
//CustomProgressBar (com.evilfree.CustomProgressBar)
package com.evilfree {
import flash.display.*;
public class CustomProgressBar extends Sprite {
public var cWidth:int;// = 0
public var foreColor:int;// = 15663086
public var cHeight:int;// = 0
public var progress:int;// = 0
public var backColor:int;// = 0xBB00
public var myDataNode:XML;
public function CustomProgressBar(){
super();
}
public function setProgress(percent:Number):void{
if (percent < 0){
percent = progress;
};
progress = percent;
var pwidth:Number = ((percent / 100) * (cWidth - 2));
foreColor = parseInt(myDataNode.@foreColor);
backColor = parseInt(myDataNode.@backColor);
trace(backColor, cWidth, cHeight);
graphics.clear();
graphics.beginFill(backColor);
graphics.drawRect(0, 0, cWidth, cHeight);
graphics.endFill();
graphics.beginFill(foreColor);
graphics.drawRect(1, 1, pwidth, (height - 2));
graphics.endFill();
}
public function init(dataNode:XML):void{
x = dataNode.@x;
y = dataNode.@y;
width = dataNode.@width;
height = dataNode.@height;
cWidth = dataNode.@width;
cHeight = dataNode.@height;
foreColor = parseInt(dataNode.@foreColor);
backColor = parseInt(dataNode.@backColor);
myDataNode = dataNode;
setProgress(0);
}
}
}//package com.evilfree
Section 14
//DifferenceArea (com.evilfree.DifferenceArea)
package com.evilfree {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import caurina.transitions.*;
public class DifferenceArea extends MovieClip {
public var found:Boolean;
public var active:Boolean;
private var parentImage:DifferenceImage;
private var difGame:DifferenceGame;
private var shown:Boolean;
private var completeState:Boolean;
public var points:Number;// = 0
private var clicked:Boolean;
private var indexPos:Number;
public var bitmapData:BitmapData;
private var myBitmap:Bitmap;
public function DifferenceArea(dImage:DifferenceImage, iPos:Number){
super();
parentImage = dImage;
indexPos = iPos;
difGame = parentImage.difGame;
clicked = false;
found = false;
active = false;
completeState = false;
setupEvents();
}
public function show():void{
myBitmap.alpha = 1;
}
public function mouseClick(e:Event):void{
if (active == false){
dispatchEvent(new Event("miss"));
return;
};
if (found){
dispatchEvent(new Event("miss"));
return;
};
clicked = true;
difGame.foundDifference(indexPos);
}
public function setActive(a:Boolean):void{
active = a;
}
public function hide():void{
myBitmap.alpha = 0;
}
public function setState(iState:Boolean):void{
if (iState){
myBitmap.alpha = 1;
} else {
myBitmap.alpha = 0;
};
}
public function showFilter():void{
this.filters = [new GlowFilter(0xFF0000)];
}
public function setCompleteState(cState:Boolean):void{
completeState = cState;
}
public function hiliteArea():void{
graphics.clear();
switch (difGame.hiliteState){
case "none":
break;
case "possible":
graphics.lineStyle(2, 0xFF);
graphics.drawRect(-1, -1, (this.myBitmap.width + 2), (this.myBitmap.height + 2));
break;
case "active & found":
if (active){
if (found){
graphics.lineStyle(2, 0xFF00);
} else {
graphics.lineStyle(2, 0xFF0000);
};
graphics.drawRect(-1, -1, (this.myBitmap.width + 2), (this.myBitmap.height + 2));
};
break;
};
}
public function showHint():void{
var effect:String;
if (!found){
effect = "shake";
switch (Math.ceil((Math.random() * 3))){
case 1:
effect = "flicker";
break;
case 2:
effect = "shake";
break;
case 3:
effect = "swing";
break;
};
if (bitmapData){
if ((((bitmapData.width > 80)) || ((bitmapData.height > 80)))){
effect = "flicker";
};
};
HintEffectManager.Hint(this, effect);
};
}
private function removeEvents():void{
this.removeEventListener(MouseEvent.CLICK, mouseClick);
}
public function foundDifference():void{
found = true;
if (difGame.matchClick){
if (clicked){
if (myBitmap.alpha == 0){
Tweener.addTween(myBitmap, {alpha:1, time:2, transition:"easeOutBounce"});
} else {
Tweener.addTween(myBitmap, {alpha:0, time:2, transition:"easeOutBounce"});
};
};
} else {
if (completeState == true){
Tweener.addTween(myBitmap, {alpha:1, time:2, transition:"easeOutBounce"});
} else {
Tweener.addTween(myBitmap, {alpha:0, time:2, transition:"easeOutBounce"});
};
};
hiliteArea();
}
public function receiveBitmapData(bData:BitmapData):void{
bitmapData = bData;
myBitmap = new Bitmap(bitmapData, "auto", true);
addChild(myBitmap);
}
private function setupEvents():void{
this.addEventListener(MouseEvent.CLICK, mouseClick);
}
}
}//package com.evilfree
Section 15
//DifferenceEvent (com.evilfree.DifferenceEvent)
package com.evilfree {
import flash.events.*;
public class DifferenceEvent {
public static var LAYOUT_CHANGED:Event = new Event("layoutchanged");
public static var FOUND_DIFFERENCE:Event = new Event("founddifference");
public static var MISSED_CLICK:Event = new Event("missedclick");
public static var TIME_LIMIT_REACHED:Event = new Event("timelimitreached");
public static var SCENE_START:Event = new Event("scenestart");
public function DifferenceEvent(){
super();
}
}
}//package com.evilfree
Section 16
//DifferenceImage (com.evilfree.DifferenceImage)
package com.evilfree {
import flash.display.*;
import mx.core.*;
import flash.geom.*;
import flash.events.*;
import flash.text.*;
import flash.filters.*;
import caurina.transitions.*;
public class DifferenceImage extends UIComponent {
private var scorebox:SceneTextEffect;
private var eraseFilter:ColorMatrixFilter;
private var dAreaPoint:Point;
private var difAreaData:XMLList;
public var currentBitmap:Bitmap;
public var difGame:DifferenceGame;
private var missedbox:SceneTextEffect;
private var missclickarea:MovieClip;
private var dAreaBitmapData:BitmapData;
private var difAreaList:Array;
public var timeLimit:Number;// = 0
private var imageXML:XML;
private var blurFilter:BlurFilter;
public function DifferenceImage(dg:DifferenceGame){
missclickarea = new MovieClip();
super();
missclickarea.graphics.beginFill(0, 0);
missclickarea.graphics.drawRect(0, 0, width, height);
missclickarea.graphics.endFill();
addChild(missclickarea);
missclickarea.addEventListener(MouseEvent.CLICK, missClick);
scorebox = new SceneTextEffect("", (SceneTextEffect.FADE + SceneTextEffect.FLOAT), 0, 0, 50, 50, [new GlowFilter(0)], new TextFormat("MaiandraBold", 20, 0xFFFFFF));
missedbox = new SceneTextEffect("", (SceneTextEffect.FADE + SceneTextEffect.FLOAT), 0, 0, 50, 50, [new GlowFilter(0)], new TextFormat("MaiandraBold", 20, 0xFF3600));
missedbox.addEventListener(SceneTextEffect.COMPLETED_EVENT.type, missedboxTransitionComplete);
scorebox.addEventListener(SceneTextEffect.COMPLETED_EVENT.type, scoreboxTransitionComplete);
difGame = dg;
difAreaList = [];
}
public function receiveStates(activeList:Array, initialStateList:Array, completeStateList:Array):void{
var i:int;
var cArea:DifferenceArea;
while (i < difAreaList.length) {
cArea = difAreaList[i];
cArea.setActive(activeList[i]);
cArea.setState(initialStateList[i]);
cArea.setCompleteState(completeStateList[i]);
cArea.hiliteArea();
i++;
};
}
public function scoreboxTransitionComplete(e:Event):void{
removeChild(scorebox);
}
public function showBitmap(bit:Bitmap):void{
if (currentBitmap != null){
this.removeChild(currentBitmap);
};
currentBitmap = new Bitmap(bit.bitmapData, "auto", true);
this.addChildAt(currentBitmap, 0);
missclickarea.graphics.clear();
missclickarea.graphics.beginFill(0, 0);
missclickarea.graphics.drawRect(0, 0, bit.width, bit.height);
missclickarea.graphics.endFill();
}
public function getAreaPoints(iPos:Number):Number{
return (difAreaList[iPos].points);
}
public function getEngine():DifferenceGame{
return (difGame);
}
public function updateHilites():void{
var i:int;
var cArea:DifferenceArea;
while (i < difAreaList.length) {
cArea = difAreaList[i];
cArea.hiliteArea();
i++;
};
}
public function missedboxTransitionComplete(e:Event):void{
removeChild(missedbox);
}
public function areaMissClick(e:Event):void{
dispatchEvent(DifferenceEvent.MISSED_CLICK);
missedbox.text = "-5";
missedbox.textx = e.target.x;
missedbox.texty = e.target.y;
missedbox.alpha = 1;
missedbox.run();
addChild(missedbox);
difGame.curScene.runEffect("bad");
}
public function receiveImageXML(iXML:XML):void{
imageXML = iXML;
drawDifAreas();
}
public function showHint():void{
var dArea:DifferenceArea;
var curArea:Number = 0;
dArea = difAreaList[Math.floor((Math.random() * difAreaList.length))];
if (dArea){
while (((dArea) && (((dArea.found) || (!(dArea.active)))))) {
curArea++;
dArea = difAreaList[curArea];
};
if (dArea){
dArea.showHint();
return;
};
curArea = 0;
dArea = difAreaList[curArea];
while (((dArea) && (((dArea.found) || (!(dArea.active)))))) {
curArea++;
dArea = difAreaList[curArea];
};
if (dArea){
dArea.showHint();
return;
};
};
}
public function drawDifAreas():void{
difAreaData = imageXML.difArea;
}
public function receiveDifferenceAreas(difList:XMLList, aArray:Array):void{
var i:int;
var bitmapToCopy:Bitmap;
var difArea:DifferenceArea;
difAreaData = difList;
while (difAreaList.length > 0) {
removeChild(difAreaList.pop());
};
while (i < aArray.length) {
bitmapToCopy = aArray[i];
difArea = new DifferenceArea(this, i);
difArea.receiveBitmapData(bitmapToCopy.bitmapData);
difArea.x = difAreaData[i].@left;
difArea.y = difAreaData[i].@top;
difArea.points = difAreaData[i].@points;
addChild(difArea);
difArea.addEventListener("miss", areaMissClick);
difAreaList.push(difArea);
i++;
};
}
public function hideDifferences():void{
var i:int;
var cArea:DifferenceArea;
while (i < difAreaList.length) {
cArea = difAreaList[i];
cArea.hide();
i++;
};
}
public function foundDifference(iPos:Number):Number{
var dArea:DifferenceArea = difAreaList[iPos];
if (!difGame.noPoints){
scorebox.text = dArea.points.toString();
scorebox.textx = ((dArea.x + (dArea.width / 2)) - 5);
scorebox.texty = ((dArea.y + (dArea.height / 2)) - 20);
scorebox.alpha = 1;
scorebox.run();
};
difGame.curScene.runEffect("good");
addChild(scorebox);
dArea.foundDifference();
return (dArea.points);
}
public function missClick(e:MouseEvent):void{
dispatchEvent(DifferenceEvent.MISSED_CLICK);
missedbox.text = "-5";
missedbox.textx = (e.localX - 10);
missedbox.texty = (e.localY - 40);
missedbox.alpha = 1;
missedbox.run();
addChild(missedbox);
difGame.curScene.runEffect("bad");
}
}
}//package com.evilfree
Section 17
//DifferenceScene (com.evilfree.DifferenceScene)
package com.evilfree {
import flash.display.*;
import mx.core.*;
import flash.events.*;
import flash.utils.*;
public class DifferenceScene extends UIComponent {
public var loaded:Boolean;// = false
public var failScene:String;// = ""
public var score:Number;// = 0
public var currentDifferences:Number;// = 0
public var goodEffect:SceneSWFEffect;
private var helperPointCls:Class;
public var showHints:Boolean;// = true
public var orientation:String;// = "topBottom"
public var transition:String;// = "pageTurn"
public var orgImage:DifferenceImage;
public var difImage:DifferenceImage;
public var sceneType:String;// = "scene"
public var failFrom:Number;// = 0
public var bgSprite:Sprite;
public var threshold:Number;// = 0
public var isFinal:Boolean;// = false
public var timeLimit:Number;// = 0
public var numDifferences:Number;// = 10
public var badEffect:SceneSWFEffect;
private var helperBitmap:Bitmap;
public var hintTimer:Timer;
public function DifferenceScene(g:DifferenceGame){
hintTimer = new Timer(10000);
bgSprite = new Sprite();
helperPointCls = DifferenceScene_helperPointCls;
helperBitmap = new helperPointCls();
super();
orgImage = new DifferenceImage(g);
difImage = new DifferenceImage(g);
orgImage.addEventListener(DifferenceEvent.MISSED_CLICK.type, onMiss);
difImage.addEventListener(DifferenceEvent.MISSED_CLICK.type, onMiss);
addChild(bgSprite);
addChild(orgImage);
addChild(difImage);
addChild(helperBitmap);
helperBitmap.visible = false;
orgImage.addEventListener(MouseEvent.MOUSE_MOVE, orgMouseMove);
difImage.addEventListener(MouseEvent.MOUSE_MOVE, difMouseMove);
orgImage.addEventListener(MouseEvent.MOUSE_OUT, imgMouseOuto);
difImage.addEventListener(MouseEvent.MOUSE_OUT, imgMouseOut);
orgImage.addEventListener(MouseEvent.MOUSE_OVER, imgMouseOvero);
difImage.addEventListener(MouseEvent.MOUSE_OVER, imgMouseOver);
hintTimer.addEventListener(TimerEvent.TIMER, showHint);
hintTimer.start();
}
public function runEffect(e:String):void{
if (e == "good"){
goodEffect.x = mouseX;
goodEffect.y = mouseY;
goodEffect.visible = true;
setChildIndex(goodEffect, (numChildren - 1));
goodEffect.run();
} else {
badEffect.x = mouseX;
badEffect.y = mouseY;
badEffect.visible = true;
setChildIndex(badEffect, (numChildren - 1));
badEffect.run();
};
}
public function difMouseMove(e:MouseEvent):void{
helperBitmap.x = ((orgImage.x + (mouseX - difImage.x)) - (helperBitmap.width / 2));
helperBitmap.y = ((orgImage.y + (mouseY - difImage.y)) - (helperBitmap.height / 2));
}
public function imgMouseOver(e:MouseEvent):void{
helperBitmap.x = ((orgImage.x + (mouseX - difImage.x)) - (helperBitmap.width / 2));
helperBitmap.y = ((orgImage.y + (mouseY - difImage.y)) - (helperBitmap.height / 2));
helperBitmap.visible = true;
}
public function imgMouseOvero(e:MouseEvent):void{
helperBitmap.x = ((difImage.x + (mouseX - orgImage.x)) - (helperBitmap.width / 2));
helperBitmap.y = ((difImage.y + (mouseY - orgImage.y)) - (helperBitmap.height / 2));
helperBitmap.visible = true;
}
public function generateRandomSelections(selectionsWanted:Number, totalAvailable:Number):Array{
var i:int;
var rSelection:Number;
var selectedItem:Array;
var choiceArray:Array = [];
var selectionArray:Array = [];
i = 0;
while (i < totalAvailable) {
choiceArray.push(i);
i++;
};
if (selectionsWanted >= totalAvailable){
return (choiceArray);
};
i = 0;
while (i < selectionsWanted) {
rSelection = Math.floor((Math.random() * choiceArray.length));
selectedItem = choiceArray.splice(rSelection, 1);
selectionArray.push(selectedItem[0]);
i++;
};
return (selectionArray);
}
public function orgMouseMove(e:MouseEvent):void{
helperBitmap.x = ((difImage.x + (mouseX - orgImage.x)) - (helperBitmap.width / 2));
helperBitmap.y = ((difImage.y + (mouseY - orgImage.y)) - (helperBitmap.height / 2));
}
public function imgMouseOuto(e:MouseEvent):void{
helperBitmap.visible = false;
}
public function showHint(e:TimerEvent):void{
if (showHints){
orgImage.showHint();
difImage.showHint();
};
}
public function resetHints():void{
hintTimer.stop();
hintTimer.reset();
hintTimer.start();
}
private function removeBadComplete(e:Event):void{
badEffect.visible = false;
}
public function receiveStates(activeList:Array, oInitialStateList:Array, oCompleteStateList:Array, dInitialStateList:Array, dCompleteStateList:Array):void{
orgImage.receiveStates(activeList, oInitialStateList, oCompleteStateList);
difImage.receiveStates(activeList, dInitialStateList, dCompleteStateList);
updateLayout();
}
private function removeGoodComplete(e:Event):void{
goodEffect.visible = false;
}
public function receiveMcs(good:MovieClip, bad:MovieClip):void{
goodEffect = new SceneSWFEffect(good);
addChild(goodEffect);
badEffect = new SceneSWFEffect(bad);
addChild(badEffect);
goodEffect.addEventListener("complete", removeGoodComplete);
badEffect.addEventListener("complete", removeBadComplete);
}
public function imgMouseOut(e:MouseEvent):void{
helperBitmap.visible = false;
}
public function prepareDifferences(difList:XMLList, aArray:Array, correctSide:String=""):void{
var i:int;
var iState:Boolean;
var sIndex:Number;
var totalDifferences:Number = difList.length();
trace(("There are a total of: " + totalDifferences));
var selectedItems:Array = generateRandomSelections(numDifferences, totalDifferences);
currentDifferences = selectedItems.length;
var activeList:Array = [];
var orgInitialStateList:Array = [];
var orgCompleteStateList:Array = [];
var difInitialStateList:Array = [];
var difCompleteStateList:Array = [];
var rand:Number = 0.5;
if (correctSide == "1"){
rand = 0;
} else {
if (correctSide == "2"){
rand = 1;
};
};
i = 0;
while (i < totalDifferences) {
activeList.push(false);
iState = false;
if (Math.random() > 0.5){
iState = true;
};
orgInitialStateList.push(iState);
orgCompleteStateList.push(iState);
difInitialStateList.push(iState);
difCompleteStateList.push(iState);
i++;
};
i = 0;
while (i < selectedItems.length) {
sIndex = selectedItems[i];
activeList[sIndex] = true;
iState = false;
if (Math.random() > rand){
iState = true;
};
activeList[sIndex] = true;
if (Math.random() > rand){
orgInitialStateList[sIndex] = iState;
orgCompleteStateList[sIndex] = !(iState);
difInitialStateList[sIndex] = !(iState);
difCompleteStateList[sIndex] = !(iState);
} else {
orgInitialStateList[sIndex] = !(iState);
orgCompleteStateList[sIndex] = !(iState);
difInitialStateList[sIndex] = iState;
difCompleteStateList[sIndex] = !(iState);
};
i++;
};
receiveDifferenceAreas(difList, aArray);
receiveStates(activeList, orgInitialStateList, orgCompleteStateList, difInitialStateList, difCompleteStateList);
updateLayout();
score = 0;
dispatchEvent(DifferenceEvent.SCENE_START);
resetHints();
}
public function updateLayout():void{
if (orgImage.currentBitmap){
bgSprite.graphics.clear();
if (orgImage.currentBitmap.width > orgImage.currentBitmap.height){
orientation = "topBottom";
trace("Using topBottom Orientation..");
difImage.x = orgImage.x;
difImage.y = ((orgImage.y + orgImage.currentBitmap.height) + 2);
bgSprite.graphics.beginFill(0, 1);
bgSprite.graphics.drawRect(0, 0, orgImage.currentBitmap.width, ((orgImage.currentBitmap.height * 2) + 2));
bgSprite.graphics.endFill();
} else {
orientation = "leftRight";
trace("Using leftRight Orientation..");
difImage.x = ((orgImage.x + orgImage.currentBitmap.width) + 2);
difImage.y = orgImage.y;
bgSprite.graphics.beginFill(0, 1);
bgSprite.graphics.drawRect(0, 0, ((orgImage.currentBitmap.width * 2) + 2), orgImage.currentBitmap.height);
bgSprite.graphics.endFill();
};
dispatchEvent(DifferenceEvent.LAYOUT_CHANGED);
};
}
public function setBitmaps(b:Bitmap):void{
orgImage.showBitmap(b);
difImage.showBitmap(b);
updateLayout();
}
public function receiveDifferenceAreas(difList:XMLList, aArray:Array):void{
orgImage.receiveDifferenceAreas(difList, aArray);
difImage.receiveDifferenceAreas(difList, aArray);
updateLayout();
}
public function onMiss(e:Event):void{
dispatchEvent(e);
}
}
}//package com.evilfree
Section 18
//DifferenceScene_helperPointCls (com.evilfree.DifferenceScene_helperPointCls)
package com.evilfree {
import mx.core.*;
public class DifferenceScene_helperPointCls extends BitmapAsset {
}
}//package com.evilfree
Section 19
//EvilFreeTimer (com.evilfree.EvilFreeTimer)
package com.evilfree {
import flash.events.*;
import flash.utils.*;
public class EvilFreeTimer {
private var timer:Timer;
public var time:Number;// = 0
public var countdown:Boolean;// = false
public var events:EventDispatcher;
public var precision:Number;// = 100
public function EvilFreeTimer(precision:Number=100, countdown:Boolean=false, startat:Number=0){
events = new EventDispatcher();
super();
if (countdown){
this.precision = -(precision);
} else {
this.precision = precision;
};
timer = new Timer(precision);
time = startat;
this.countdown = countdown;
timer.addEventListener(TimerEvent.TIMER, onTick);
}
private function onTick(e:TimerEvent):void{
time = (time + (this.precision / 1000));
events.dispatchEvent(new Event(TimerEvent.TIMER));
if (((countdown) && ((time <= 0)))){
events.dispatchEvent(new Event(TimerEvent.TIMER_COMPLETE));
};
}
public function stop():void{
timer.stop();
}
public function start():void{
timer.start();
}
public function reset():void{
time = 0;
}
public function addEventListener(type:String, listener:Function, useCapture:Boolean=false):void{
events.addEventListener(type, listener, useCapture);
}
}
}//package com.evilfree
Section 20
//FacebookIntegration (com.evilfree.FacebookIntegration)
package com.evilfree {
import flash.net.*;
public class FacebookIntegration {
public static var gConn:LocalConnection = new LocalConnection();
public function FacebookIntegration(){
super();
}
public static function sendScore(score:Number, gszConnID:String):void{
if (gszConnID){
gConn.send(gszConnID, "listUpdate", score);
};
}
public static function saveHiscore(score:Number, gszConnID:String):void{
if (gszConnID){
gConn.send(gszConnID, "saveHiscore", score);
};
}
}
}//package com.evilfree
Section 21
//HintEffectManager (com.evilfree.HintEffectManager)
package com.evilfree {
import flash.display.*;
import caurina.transitions.*;
public class HintEffectManager {
public function HintEffectManager(){
super();
}
public static function Hint(dispObj:DisplayObject, type:String="glow"):void{
var _local3:int;
switch (type){
case "flicker":
Tweener.addTween(dispObj, {alpha:0.5, time:1, transition:"bounce"});
Tweener.addTween(dispObj, {alpha:1, delay:1, time:1, transition:"bounce"});
break;
case "swing":
Tweener.addTween(dispObj, {rotation:15, time:1, transition:"EaseInExpo"});
Tweener.addTween(dispObj, {rotation:0, delay:1, time:1, transition:"EaseOutExpo"});
break;
case "shake":
_local3 = dispObj.x;
Tweener.addTween(dispObj, {x:(_local3 - 2), time:0.5, transition:"bounce"});
Tweener.addTween(dispObj, {x:(_local3 + 2), delay:0.5, time:0.5, transition:"bounce"});
Tweener.addTween(dispObj, {x:(_local3 - 2), delay:1, time:0.5, transition:"bounce"});
Tweener.addTween(dispObj, {x:_local3, delay:1.5, time:0.5, transition:"bounce"});
break;
};
}
}
}//package com.evilfree
Section 22
//ImageTransitionManager (com.evilfree.ImageTransitionManager)
package com.evilfree {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import org.papervision3d.view.*;
import org.papervision3d.objects.*;
import org.papervision3d.render.*;
import org.papervision3d.objects.special.*;
import org.papervision3d.scenes.*;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.cameras.*;
import org.papervision3d.materials.*;
import flash.filters.*;
import caurina.transitions.*;
public class ImageTransitionManager extends Sprite {
public var transType:String;// = "pageTurn"
private var page2:BookPage3D;
private var sprite1:Sprite;
private var sprite2:Sprite;
private var page1:BookPage3D;
private var delay:Number;// = 0
private var scene:Scene3D;
public var transTime:Number;// = 2
private var newSceneData:BitmapData;
private var planes:DisplayObject3D;
private var vpBuffer:int;// = 200
private var render:BasicRenderEngine;
private var otherMask:Boolean;
public var blurAmount:Number;// = 0
private var newSceneSprite:Sprite;
private var planescene:Scene3D;
private var myMask:Bitmap;
private var vp:Viewport3D;
private var p1:Plane;
private var p2:Plane;
private var pages:DisplayObject3D;
public var easeType:String;// = "easeOutExpo"
private var oldSceneSprite:Sprite;
private var vertpages:DisplayObject3D;
private var cam:Camera3D;
private var initialized:Boolean;
private var disposableBMD1:BitmapData;
private var disposableBMD2:BitmapData;
public var TRANSITION_COMPLETE:String;// = "transitionComplete"
private var disposableBM2:Bitmap;
private var disposableBM1:Bitmap;
private var oldSceneData:BitmapData;
private var vertpage1:BookPage3D;
private var vertpage2:BookPage3D;
private var myHeight:Number;// = 500
private var mat:Matrix;
private var r:Rectangle;
private var myWidth:Number;// = 600
private var vertscene:Scene3D;
private var rads:Number;
public function ImageTransitionManager(xPos:int=0, yPos:int=0){
cam = new Camera3D();
scene = new Scene3D();
vertscene = new Scene3D();
planescene = new Scene3D();
render = new BasicRenderEngine();
planes = new DisplayObject3D();
pages = new DisplayObject3D();
vertpages = new DisplayObject3D();
initialized = new Boolean(false);
otherMask = new Boolean(false);
super();
x = xPos;
y = yPos;
}
public function removeKids():void{
while (numChildren >= 1) {
this.removeChildAt(0);
};
}
public function renderLoopPlane(e:Event):void{
render.renderScene(planescene, cam, vp);
}
public function cleanup():void{
removeKids();
onComplete();
}
private function check3dMask():void{
if (otherMask){
mask = myMask;
myMask.x = x;
myMask.y = y;
} else {
mask = null;
};
}
public function blurLoop(e:Event):void{
var t:BlurFilter = new BlurFilter(blurAmount, blurAmount);
oldSceneSprite.filters = [t];
newSceneSprite.filters = [t];
}
public function pvVertBookComplete():void{
removeEventListener(Event.ENTER_FRAME, renderVertLoopBook);
cleanup();
}
public function receiveBitmapDatas(curscene:BitmapData, nextscene:BitmapData):void{
if (!initialized){
initWith(curscene);
};
oldSceneData = curscene;
newSceneData = nextscene;
}
private function init():void{
var myMaskBMD:BitmapData = new BitmapData(myWidth, myHeight, false, 4278190080);
myMask = new Bitmap(myMaskBMD);
myMask.y = 0;
myMask.x = 0;
mask = myMask;
vp = new Viewport3D((myWidth + vpBuffer), (myHeight + vpBuffer));
vp.x = (vpBuffer / -2);
vp.y = (vpBuffer / -2);
vp.visible = false;
p1 = new Plane(null, myWidth, myHeight, 4);
p2 = new Plane(null, myWidth, myHeight, 4);
p2.rotationX = 180;
planes.addChild(p1);
planes.addChild(p2);
planescene.addChild(planes);
page1 = new BookPage3D(new BitmapData((myWidth / 2), myHeight, false), (myWidth / 2), myHeight);
page2 = new BookPage3D(new BitmapData((myWidth / 2), myHeight, false), (myWidth / 2), myHeight, true);
pages.addChild(page1);
pages.addChild(page2);
scene.addChild(pages);
vertpage1 = new BookPage3D(new BitmapData(Math.ceil((myHeight / 2)), myWidth, false), Math.ceil((myHeight / 2)), myWidth);
vertpage2 = new BookPage3D(new BitmapData(Math.ceil((myHeight / 2)), myWidth, false), Math.ceil((myHeight / 2)), myWidth, true);
vertpages.addChild(vertpage1);
vertpages.addChild(vertpage2);
vertscene.addChild(vertpages);
vertpage1.y++;
cam.zoom = 11;
}
public function renderVertLoopBook(e:Event):void{
vertpage1.rotate(vertpage1.rotation);
vertpage2.rotate(vertpage1.rotation);
render.renderScene(vertscene, cam, vp);
}
public function blurComplete():void{
removeEventListener(Event.ENTER_FRAME, blurLoop);
cleanup();
}
public function newSceneReady():void{
var testnewBMD:BitmapData;
var pageturnBMD:BitmapData;
var tex1:BitmapData;
var tex2:BitmapData;
var margin:Number = 0;
if (otherMask){
mask = null;
} else {
mask = myMask;
};
oldSceneSprite = new Sprite();
var oldbm:Bitmap = new Bitmap(oldSceneData);
oldSceneSprite.addChild(oldbm);
newSceneSprite = new Sprite();
var newbm:Bitmap = new Bitmap(newSceneData);
newSceneSprite.addChild(newbm);
trace("Running Transition:", transType);
if ((((((((((((((((((((((((transType == "revealUp")) || ((transType == "revealDown")))) || ((transType == "revealLeft")))) || ((transType == "revealRight")))) || ((transType == "slideDown")))) || ((transType == "slideUp")))) || ((transType == "slideLeft")))) || ((transType == "slideRight")))) || ((transType == "blur")))) || ((transType == "crossFade")))) || ((transType == "fadeWhite")))) || ((transType == "fadeBlack")))){
addChild(newSceneSprite);
addChild(oldSceneSprite);
oldSceneSprite.alpha = 1;
newSceneSprite.alpha = 1;
oldSceneSprite.x = 0;
oldSceneSprite.y = 0;
newSceneSprite.x = 0;
newSceneSprite.y = 0;
myMask.x = this.x;
myMask.y = this.y;
if (transType == "revealUp"){
Tweener.addTween(oldSceneSprite, {y:(0 - oldSceneData.height), time:transTime, transition:easeType, onComplete:cleanup});
};
if (transType == "revealRight"){
Tweener.addTween(oldSceneSprite, {x:(0 + oldSceneData.width), time:transTime, transition:easeType, onComplete:cleanup});
};
if (transType == "revealDown"){
Tweener.addTween(oldSceneSprite, {y:(0 + oldSceneData.height), time:transTime, transition:easeType, onComplete:cleanup});
};
if (transType == "revealLeft"){
Tweener.addTween(oldSceneSprite, {x:(0 - oldSceneData.width), time:transTime, transition:easeType, onComplete:cleanup});
};
if (transType == "slideUp"){
Tweener.addTween(oldSceneSprite, {y:(0 - oldSceneData.height), time:transTime, transition:easeType, onComplete:cleanup});
newSceneSprite.y = oldSceneData.height;
Tweener.addTween(newSceneSprite, {y:0, time:transTime, transition:easeType});
};
if (transType == "slideRight"){
Tweener.addTween(oldSceneSprite, {x:(0 + oldSceneData.width), time:transTime, transition:easeType, onComplete:cleanup});
newSceneSprite.x = -(oldSceneData.width);
Tweener.addTween(newSceneSprite, {x:0, time:transTime, transition:easeType});
};
if (transType == "slideDown"){
Tweener.addTween(oldSceneSprite, {y:(0 + oldSceneData.height), time:transTime, transition:easeType, onComplete:cleanup});
newSceneSprite.y = -(oldSceneData.height);
Tweener.addTween(newSceneSprite, {y:0, time:transTime, transition:easeType});
};
if (transType == "slideLeft"){
Tweener.addTween(oldSceneSprite, {x:(0 - oldSceneData.width), time:transTime, transition:easeType, onComplete:cleanup});
newSceneSprite.x = oldSceneData.width;
Tweener.addTween(newSceneSprite, {x:0, time:transTime, transition:easeType});
};
if (transType == "blur"){
addEventListener(Event.ENTER_FRAME, blurLoop);
Tweener.addTween(oldSceneSprite, {alpha:0, time:transTime, transition:easeType, onComplete:cleanup});
Tweener.addTween(this, {blurAmount:5, time:(transTime / 2), transition:easeType});
Tweener.addTween(this, {blurAmount:0, time:(transTime / 2), delay:(transTime / 2), transition:easeType, onComplete:blurComplete});
};
if (transType == "crossFade"){
Tweener.addTween(oldSceneSprite, {alpha:0, time:transTime, transition:easeType, onComplete:cleanup});
};
} else {
if (transType == "flipPlane"){
check3dMask();
planes.rotationX = 0;
p1.material = new BitmapMaterial(oldSceneData);
p2.material = new BitmapMaterial(newSceneData);
renderLoopPlane(null);
vp.visible = true;
addChild(vp);
p1.visible = true;
p2.visible = true;
Tweener.addTween(planes, {rotationX:180, time:transTime, transition:easeType, onComplete:pvComplete});
addEventListener(Event.ENTER_FRAME, renderLoopPlane);
} else {
if (transType == "testNew"){
testnewBMD = new BitmapData((oldSceneData.width / 2), oldSceneData.height);
testnewBMD.copyPixels(oldSceneData, oldSceneData.rect, new Point());
disposableBM1 = new Bitmap(testnewBMD);
addChild(disposableBM1);
disposableBM2 = new Bitmap(newSceneData);
disposableBM2.alpha = 0;
addChild(disposableBM2);
Tweener.addTween(disposableBM2, {alpha:1, time:transTime, transition:"easeoutexpo", onComplete:cleanup});
} else {
if (transType == "pageTurn"){
check3dMask();
disposableBM1 = new Bitmap(newSceneData);
addChild(disposableBM1);
pageturnBMD = new BitmapData((oldSceneData.width / 2), oldSceneData.height);
pageturnBMD.copyPixels(oldSceneData, oldSceneData.rect, new Point());
disposableBM2 = new Bitmap(pageturnBMD);
addChild(disposableBM2);
addEventListener(Event.ENTER_FRAME, renderLoopBook);
tex1 = new BitmapData((oldSceneData.width / 2), oldSceneData.height);
tex1.copyPixels(oldSceneData, new Rectangle(tex1.width, 0, tex1.width, tex1.height), new Point());
tex2 = new BitmapData((newSceneData.width / 2), newSceneData.height);
tex2.copyPixels(newSceneData, new Rectangle(0, 0, tex2.width, tex2.height), new Point());
page1.visible = true;
page2.visible = true;
page1.material = new BitmapMaterial(tex1);
page2.material = new BitmapMaterial(tex2);
page1.rotation = 0;
page2.rotation = 0;
addChild(vp);
Tweener.addTween(page1, {rotation:180, delay:delay, time:transTime, transition:"easeinoutquad", onComplete:pvBookComplete});
vp.visible = true;
renderLoopBook(null);
} else {
if (transType == "pageTurnV"){
check3dMask();
addEventListener(Event.ENTER_FRAME, renderVertLoopBook);
disposableBM1 = new Bitmap(newSceneData.clone());
r = new Rectangle(0, 0, oldSceneData.width, (oldSceneData.height / 2));
disposableBM1.bitmapData.copyPixels(oldSceneData, r, new Point(0, 0));
addChild(disposableBM1);
mat = new Matrix();
mat.translate((-(oldSceneData.width) / 2), (-(oldSceneData.height) / 2));
rads = ((Math.PI * 2) * (270 / 360));
mat.rotate(rads);
mat.translate((oldSceneData.height / 2), (oldSceneData.width / 2));
mat.translate((-(oldSceneData.height) / 2), 0);
disposableBMD1 = new BitmapData((oldSceneData.height / 2), oldSceneData.width, false);
disposableBMD1.draw(oldSceneData, mat);
mat = new Matrix();
mat.translate((-(newSceneData.width) / 2), (-(newSceneData.height) / 2));
rads = ((Math.PI * 2) * (270 / 360));
mat.rotate(rads);
mat.translate((newSceneData.height / 2), (newSceneData.width / 2));
disposableBMD2 = new BitmapData((newSceneData.height / 2), newSceneData.width, false);
disposableBMD2.draw(newSceneData, mat);
vertpage1.rotationZ = 270;
vertpage2.rotationZ = 270;
vertpage1.visible = true;
vertpage2.visible = true;
vertpage1.material = new BitmapMaterial(disposableBMD1);
vertpage2.material = new BitmapMaterial(disposableBMD2);
vertpage1.rotation = 0;
vertpage2.rotation = 0;
addChild(vp);
Tweener.addTween(vertpage1, {rotation:180, delay:delay, time:transTime, transition:"easeinoutquad", onComplete:pvVertBookComplete});
vp.visible = true;
renderVertLoopBook(null);
} else {
if (transType == "pageTurnVBack"){
check3dMask();
addEventListener(Event.ENTER_FRAME, renderVertLoopBook);
disposableBM1 = new Bitmap(newSceneData.clone());
r = new Rectangle(0, (oldSceneData.height / 2), oldSceneData.width, (oldSceneData.height / 2));
disposableBM1.bitmapData.copyPixels(oldSceneData, r, new Point(0, (newSceneData.height / 2)));
addChild(disposableBM1);
mat = new Matrix();
mat.translate((-(oldSceneData.width) / 2), (-(oldSceneData.height) / 2));
rads = ((Math.PI * 2) * (270 / 360));
mat.rotate(rads);
mat.translate((oldSceneData.height / 2), (oldSceneData.width / 2));
disposableBMD1 = new BitmapData((oldSceneData.height / 2), oldSceneData.width, false);
disposableBMD1.draw(oldSceneData, mat);
mat = new Matrix();
mat.translate((-(newSceneData.width) / 2), (-(newSceneData.height) / 2));
rads = ((Math.PI * 2) * (270 / 360));
mat.rotate(rads);
mat.translate((newSceneData.height / 2), (newSceneData.width / 2));
mat.translate((-(oldSceneData.height) / 2), 0);
disposableBMD2 = new BitmapData((newSceneData.height / 2), newSceneData.width, false);
disposableBMD2.draw(newSceneData, mat);
vertpage1.rotationZ = 270;
vertpage2.rotationZ = 270;
vertpage1.visible = true;
vertpage2.visible = true;
vertpage1.material = new BitmapMaterial(disposableBMD2);
vertpage2.material = new BitmapMaterial(disposableBMD1);
vertpage1.rotation = 180;
vertpage2.rotation = 180;
addChild(vp);
Tweener.addTween(vertpage1, {rotation:0, delay:delay, time:transTime, transition:"easeinoutquad", onComplete:pvVertBookComplete});
vp.visible = true;
renderVertLoopBook(null);
} else {
if (transType == "pageTurnBack"){
check3dMask();
disposableBM1 = new Bitmap(newSceneData.clone());
r = new Rectangle((oldSceneData.width / 2), 0, (oldSceneData.width / 2), oldSceneData.height);
disposableBM1.bitmapData.copyPixels(oldSceneData, r, new Point((oldSceneData.width / 2), 0));
addChild(disposableBM1);
addEventListener(Event.ENTER_FRAME, renderLoopBook);
tex1 = new BitmapData((oldSceneData.width / 2), oldSceneData.height);
tex1.copyPixels(oldSceneData, new Rectangle(0, 0, tex1.width, tex1.height), new Point());
tex2 = new BitmapData((newSceneData.width / 2), newSceneData.height);
tex2.copyPixels(newSceneData, new Rectangle(tex2.width, 0, tex2.width, tex2.height), new Point());
page1.visible = true;
page2.visible = true;
page1.material = new BitmapMaterial(tex2);
page2.material = new BitmapMaterial(tex1);
page1.rotation = 180;
page2.rotation = 180;
addChild(vp);
Tweener.addTween(page1, {rotation:0, delay:delay, time:transTime, transition:"easeinoutquad", onComplete:pvBookComplete});
vp.visible = true;
renderLoopBook(null);
};
};
};
};
};
};
};
}
private function onComplete():void{
var transCompleteEvent:Event = new Event(TRANSITION_COMPLETE);
this.dispatchEvent(transCompleteEvent);
}
public function renderLoop(e:Event):void{
render.renderScene(planescene, cam, vp);
}
public function pvComplete():void{
removeEventListener(Event.ENTER_FRAME, renderLoopPlane);
removeEventListener(Event.ENTER_FRAME, renderLoop);
cleanup();
}
public function trans(curscene:BitmapData, nextscene:BitmapData, otherMaskType:Boolean=false):void{
otherMask = otherMaskType;
receiveBitmapDatas(curscene.clone(), nextscene.clone());
newSceneReady();
visible = true;
}
public function pvBookComplete():void{
removeEventListener(Event.ENTER_FRAME, renderLoopBook);
cleanup();
}
public function renderLoopBook(e:Event):void{
page1.rotate(page1.rotation);
page2.rotate(page1.rotation);
render.renderScene(scene, cam, vp);
}
public function initWith(curScene:BitmapData):void{
myWidth = curScene.width;
myHeight = curScene.height;
init();
initialized = true;
}
}
}//package com.evilfree
Section 23
//MenuManager (com.evilfree.MenuManager)
package com.evilfree {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.filters.*;
public class MenuManager extends MovieClip {
public var hiScores:Array;
public var optionsDialog:OptionsDialog;
public var whiteHiScores:Array;
private var differenceGamePlayer:DifferenceGamePlayer;
private var _menus:Object;
public static var MENU_ROOT:String = "root";
public static var MENU_WON:String = "won";
public static var MENU_LOST:String = "lost";
public static var MENU_PAUSE:String = "pause";
public static var MENU_OPTIONS:String = "options";
public function MenuManager(menus:XMLList, dPlayer:DifferenceGamePlayer){
var m:XML;
hiScores = [];
whiteHiScores = [];
_menus = new Object();
differenceGamePlayer = dPlayer;
super();
for each (m in menus) {
_menus[m.@id] = new MovieClip();
trace((("Creating menu: \"" + m.@id) + "\""));
prepMenu(_menus[m.@id], m);
};
}
public function dispatchButtonOver(e:MouseEvent):void{
trace((("[MenuManager] Dispatching: " + e.target.name) + "_over"));
dispatchEvent(new Event((e.target.name + "_over")));
}
public function setHintsOff(e:Event):void{
dispatchEvent(new Event("hintsOff"));
}
public function setHintsOn(e:Event):void{
dispatchEvent(new Event("hintsOn"));
}
public function reset(e:Event):void{
dispatchEvent(new Event("reset"));
}
public function hide():void{
this.visible = false;
}
public function setSoundOn(e:Event):void{
dispatchEvent(new Event("soundOn"));
}
public function update(id:String, text:String):void{
var c:MovieClip;
var tt:TextField;
for each (c in _menus) {
if (c.getChildByName(("label_" + id))){
tt = (c.getChildByName(("label_" + id)) as TextField);
tt.text = text;
};
};
}
public function setMusicOff(e:Event):void{
dispatchEvent(new Event("musicOff"));
}
public function dispatchButtonClick(e:MouseEvent):void{
trace((("[MenuManager] Dispatching: " + e.target.name) + "_click"));
dispatchEvent(new Event((e.target.name + "_click")));
}
public function setSoundOff(e:Event):void{
dispatchEvent(new Event("soundOff"));
}
public function setMusicOn(e:Event):void{
dispatchEvent(new Event("musicOn"));
}
private function prepMenu(mc:MovieClip, menu:XML):void{
var b:XML;
var p:XML;
var tmpLabel:TextField;
var tmpLFormat:TextFormat;
var tmpButton:TextField;
var tmpFormat:TextFormat;
var button_mc:MovieClip;
var moreGamesBrandedV2:MoreGamesBrandedV2;
var host:String;
var tmpMoreButton:MoreGamesLogo;
var tmpMoreButton3:MoreGamesLogo;
var tmpResetButton:PlayAgainButton;
var tmpOptionsDialog:OptionsDialog;
var tmpWHiscores:WhiteHiScores;
var tmpHiscores:HiScores;
for each (b in menu.label) {
tmpLabel = new TextField();
tmpLabel.embedFonts = true;
tmpLFormat = new TextFormat(b.@font, b.@fontsize, b.@color, null, null, null, null, null, b.@align);
tmpLabel.defaultTextFormat = tmpLFormat;
tmpLabel.filters = [new DropShadowFilter(1)];
tmpLabel.selectable = false;
tmpLabel.antiAliasType = AntiAliasType.ADVANCED;
tmpLabel.width = b.@width;
tmpLabel.height = b.@height;
tmpLabel.x = b.@x;
tmpLabel.y = b.@y;
tmpLabel.text = b.@text;
trace("labeltext =", b.@text);
tmpLabel.name = ("label_" + b.@id);
mc.addChild(tmpLabel);
};
for each (b in menu.button) {
tmpButton = new TextField();
tmpButton.embedFonts = true;
tmpFormat = new TextFormat(b.@font, b.@fontsize, b.@color, null, null, null, null, null, b.@align);
tmpButton.defaultTextFormat = tmpFormat;
tmpButton.filters = [new DropShadowFilter(1)];
tmpButton.selectable = false;
tmpButton.antiAliasType = AntiAliasType.ADVANCED;
tmpButton.width = b.@width;
tmpButton.height = b.@height;
tmpButton.text = b.@text;
tmpButton.x = b.@x;
tmpButton.y = b.@y;
button_mc = new MovieClip();
button_mc.addChild(tmpButton);
button_mc.name = ("button_" + b.@id);
button_mc.addEventListener(MouseEvent.MOUSE_OVER, dispatchButtonOver);
button_mc.addEventListener(MouseEvent.MOUSE_OUT, dispatchButtonOut);
button_mc.addEventListener(MouseEvent.CLICK, dispatchButtonClick);
button_mc.buttonMode = true;
button_mc.mouseChildren = false;
mc.addChild(button_mc);
};
for each (p in menu.moregamesbrandedv2) {
moreGamesBrandedV2 = new MoreGamesBrandedV2();
moreGamesBrandedV2.x = p.@x;
moreGamesBrandedV2.y = p.@y;
if (p.@frame){
moreGamesBrandedV2.gotoNStop(p.@frame);
};
mc.addChild(moreGamesBrandedV2);
trace("moreGames button on screen");
};
if (menu.@id == "won"){
host = differenceGamePlayer.host;
if ((((((((((((((((((((((((((((host == "agame.com")) || ((host == "differencebuilder.com")))) || ((host == "spel.nl")))) || ((host == "jeu.fr")))) || ((host == "spielen.com")))) || ((host == "minigry.pl")))) || ((host == "spel.eu")))) || ((host == "giocaregratis.it")))) || ((host == "zapjuegos.com")))) || ((host == "clickjogos.com")))) || ((host == "games.co.id")))) || ((host == "mygames.co.uk")))) || ((host == "game.co.in")))) || ((host == "egames.jp")))){
} else {
for each (p in menu.morebutton) {
tmpMoreButton = new MoreGamesLogo();
tmpMoreButton.x = p.@x;
tmpMoreButton.y = p.@y;
if (p.@skin){
tmpMoreButton.setSkin(p.@skin);
};
mc.addChild(tmpMoreButton);
};
};
} else {
trace("I thinkn this is it i am on the \"won\" menu");
for each (p in menu.morebutton) {
tmpMoreButton3 = new MoreGamesLogo();
tmpMoreButton3.x = p.@x;
tmpMoreButton3.y = p.@y;
if (p.@skin){
tmpMoreButton3.setSkin(p.@skin);
};
mc.addChild(tmpMoreButton3);
};
};
for each (p in menu.resetbutton) {
tmpResetButton = new PlayAgainButton();
tmpResetButton.x = p.@x;
tmpResetButton.y = p.@y;
if (p.@skin){
tmpResetButton.setSkin(p.@skin);
};
mc.addChild(tmpResetButton);
tmpResetButton.addEventListener("reset", reset);
};
for each (p in menu.options) {
tmpOptionsDialog = new OptionsDialog(differenceGamePlayer);
tmpOptionsDialog.x = p.@x;
tmpOptionsDialog.y = p.@y;
tmpOptionsDialog.addEventListener("resume", resumeGame);
tmpOptionsDialog.addEventListener("mainMenu", mainMenu);
tmpOptionsDialog.addEventListener("soundOn", setSoundOn);
tmpOptionsDialog.addEventListener("soundOff", setSoundOff);
tmpOptionsDialog.addEventListener("musicOn", setMusicOn);
tmpOptionsDialog.addEventListener("musicOff", setMusicOff);
tmpOptionsDialog.addEventListener("hintsOn", setHintsOn);
tmpOptionsDialog.addEventListener("hintsOff", setHintsOff);
mc.addChild(tmpOptionsDialog);
optionsDialog = tmpOptionsDialog;
};
for each (p in menu.hiscores) {
if (p.@white == "true"){
tmpWHiscores = new WhiteHiScores();
tmpWHiscores.x = p.@x;
tmpWHiscores.y = p.@y;
whiteHiScores.push(tmpWHiscores);
mc.addChild(tmpWHiscores);
} else {
tmpHiscores = new HiScores();
tmpHiscores.setSkin(1);
tmpHiscores.x = p.@x;
tmpHiscores.y = p.@y;
hiScores.push(tmpHiscores);
mc.addChild(tmpHiscores);
};
};
}
public function setBackground(menu:String, image:Bitmap):void{
var menuBg:MovieClip;
if (_menus[menu]){
menuBg = new MovieClip();
menuBg.graphics.beginBitmapFill(image.bitmapData);
menuBg.graphics.drawRect(0, 0, image.width, image.height);
menuBg.graphics.endFill();
menuBg.name = "_background";
_menus[menu].addChildAt(menuBg, 0);
};
}
public function dispatchButtonOut(e:MouseEvent):void{
trace((("[MenuManager] Dispatching: " + e.target.name) + "_out"));
dispatchEvent(new Event((e.target.name + "_out")));
}
public function mainMenu(e:Event):void{
show("root");
}
public function setFilters(id:String, filters:Array):void{
var c:MovieClip;
var tt:DisplayObject;
var t2:DisplayObject;
for each (c in _menus) {
if (c.getChildByName(("button_" + id))){
tt = c.getChildByName(("button_" + id));
tt.filters = filters;
};
if (c.getChildByName(("label_" + id))){
t2 = c.getChildByName(("label_" + id));
t2.filters = filters;
};
};
}
public function show(menu:String):void{
var x:Number = 0;
while (x < numChildren) {
removeChildAt(x);
x++;
};
if (_menus[menu]){
this.visible = true;
addChild(_menus[menu]);
} else {
trace(((" MenuManager: [ERROR]: Menu \"" + menu) + "\" does not exist!"));
};
}
public function resumeGame(e:Event):void{
dispatchEvent(new Event("button_resume_click"));
}
}
}//package com.evilfree
Section 24
//MoreGamesBrandedV2 (com.evilfree.MoreGamesBrandedV2)
package com.evilfree {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class MoreGamesBrandedV2 extends MovieClip {
public var moreButton:MovieClip;
private var difData:XML;
private var mochiCode:String;// = ""
private var internalLoader:Loader;
public var goesTo:Array;
public var xmlFile:Class;
private var _skin:Number;// = 1
public static const logoBytes:Class = MoreGamesBrandedV2_logoBytes;
public function MoreGamesBrandedV2(){
internalLoader = new Loader();
xmlFile = MoreGamesBrandedV2_xmlFile;
goesTo = new Array();
super();
var ba:ByteArray = new xmlFile();
difData = new XML(ba.readUTFBytes(ba.length));
internalLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, setupLoader);
internalLoader.loadBytes(new logoBytes());
}
private function buttonMouseOver(e:MouseEvent):void{
}
private function gotoSite(e:MouseEvent):void{
}
public function gotoNStop(fr:int):void{
goesTo[0] = fr;
}
private function setupLoader(e:Event):void{
trace("loader has completed");
moreButton = (internalLoader.content as MovieClip);
moreButton.addEventListener(MouseEvent.CLICK, gotoSite);
addChild(moreButton);
if (goesTo[0] != undefined){
moreButton.gotoAndStop(goesTo[0]);
};
}
private function buttonMouseOut(e:MouseEvent):void{
}
public function setSkin(skinNumber:Number):void{
}
}
}//package com.evilfree
Section 25
//MoreGamesBrandedV2_logoBytes (com.evilfree.MoreGamesBrandedV2_logoBytes)
package com.evilfree {
import mx.core.*;
public class MoreGamesBrandedV2_logoBytes extends ByteArrayAsset {
}
}//package com.evilfree
Section 26
//MoreGamesBrandedV2_xmlFile (com.evilfree.MoreGamesBrandedV2_xmlFile)
package com.evilfree {
import mx.core.*;
public class MoreGamesBrandedV2_xmlFile extends ByteArrayAsset {
}
}//package com.evilfree
Section 27
//MoreGamesLogo (com.evilfree.MoreGamesLogo)
package com.evilfree {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class MoreGamesLogo extends Sprite {
public var moreButton:MovieClip;
private var difData:XML;
private var mochiCode:String;// = ""
private var internalLoader:Loader;
public var xmlFile:Class;
private var _skin:Number;// = 1
public static const logoBytes:Class = MoreGamesLogo_logoBytes;
public function MoreGamesLogo(){
internalLoader = new Loader();
xmlFile = MoreGamesLogo_xmlFile;
super();
var ba:ByteArray = new xmlFile();
difData = new XML(ba.readUTFBytes(ba.length));
mochiCode = difData.config[0].mochiC[0].@code;
this.graphics.beginFill(0xFFFFFF, 0.01);
this.graphics.drawRect(0, 0, 253, 50);
this.graphics.endFill();
internalLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, setupLoader);
internalLoader.loadBytes(new logoBytes());
this.width = 253;
this.height = 50;
}
private function gotoDgames(e:MouseEvent):void{
MochiBot.track(this, mochiCode);
navigateToURL(new URLRequest("http://differencegames.com/"), "_blank");
}
private function buttonMouseOver(e:MouseEvent):void{
moreButton.gotoAndStop((_skin * 2));
}
private function setupLoader(e:Event):void{
var tmpTemplate:MovieClip = (internalLoader.content as MovieClip);
moreButton = (tmpTemplate.moreGames as MovieClip);
moreButton.gotoAndStop(((_skin * 2) - 1));
moreButton.buttonMode = true;
moreButton.addEventListener(MouseEvent.MOUSE_OVER, buttonMouseOver);
moreButton.addEventListener(MouseEvent.MOUSE_OUT, buttonMouseOut);
moreButton.addEventListener(MouseEvent.CLICK, gotoDgames);
addChild(moreButton);
}
private function buttonMouseOut(e:MouseEvent):void{
moreButton.gotoAndStop(((_skin * 2) - 1));
}
public function setSkin(skinNumber:Number):void{
_skin = skinNumber;
if (moreButton){
moreButton.gotoAndStop(((_skin * 2) - 1));
};
}
}
}//package com.evilfree
Section 28
//MoreGamesLogo_logoBytes (com.evilfree.MoreGamesLogo_logoBytes)
package com.evilfree {
import mx.core.*;
public class MoreGamesLogo_logoBytes extends ByteArrayAsset {
}
}//package com.evilfree
Section 29
//MoreGamesLogo_xmlFile (com.evilfree.MoreGamesLogo_xmlFile)
package com.evilfree {
import mx.core.*;
public class MoreGamesLogo_xmlFile extends ByteArrayAsset {
}
}//package com.evilfree
Section 30
//OptionsDialog (com.evilfree.OptionsDialog)
package com.evilfree {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class OptionsDialog extends Sprite {
private var dGamePlayer:DifferenceGamePlayer;
private var _fromMenu:Boolean;// = true
private var states:Object;
private var difData:XML;
private var mochiCode:String;// = ""
public var soundButton:MovieClip;
public var hintsButton:MovieClip;
public var moreButton:MovieClip;
private var internalLoader:Loader;
public var xmlFile:Class;
public var musicButton:MovieClip;
public var resumeButton:MovieClip;
public static const templateSwf:Class = OptionsDialog_templateSwf;
public function OptionsDialog(dPlayer:DifferenceGamePlayer){
internalLoader = new Loader();
xmlFile = OptionsDialog_xmlFile;
states = {};
super();
dGamePlayer = dPlayer;
var ba:ByteArray = new xmlFile();
difData = new XML(ba.readUTFBytes(ba.length));
mochiCode = difData.config[0].mochiB[0].@code;
this.graphics.beginFill(0xFFFFFF, 0.01);
this.graphics.drawRect(0, 0, 280, 340);
this.graphics.endFill();
internalLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, setupLoader);
internalLoader.loadBytes(new templateSwf());
addChild(internalLoader);
this.width = 280;
this.height = 340;
}
private function buttonMouseOver(e:MouseEvent):void{
e.target.gotoAndStop((states[e.target.name] + 1));
}
private function buttonMouseClick(e:MouseEvent):void{
if ((((e.target.name == "btnResumeGame")) && ((_fromMenu == false)))){
dispatchEvent(new Event("resume"));
return;
};
if ((((e.target.name == "btnResumeGame")) && ((_fromMenu == true)))){
dispatchEvent(new Event("mainMenu"));
return;
};
if (e.target.name == "btnMoreGames"){
MochiBot.track(this, mochiCode);
navigateToURL(new URLRequest("http://differencegames.com/"), "_blank");
return;
};
if (e.target.name == "btnSound"){
if (states[e.target.name] == 1){
dispatchEvent(new Event("soundOff"));
} else {
dispatchEvent(new Event("soundOn"));
};
} else {
if (e.target.name == "btnMusic"){
if (states[e.target.name] == 1){
dispatchEvent(new Event("musicOff"));
} else {
dispatchEvent(new Event("musicOn"));
};
} else {
if (e.target.name == "btnHints"){
if (states[e.target.name] == 1){
dispatchEvent(new Event("hintsOff"));
} else {
dispatchEvent(new Event("hintsOn"));
};
};
};
};
if (states[e.target.name] == 1){
states[e.target.name] = 3;
e.target.gotoAndStop(4);
} else {
states[e.target.name] = 1;
e.target.gotoAndStop(2);
};
}
public function setupListeners(clip:MovieClip):void{
clip.addEventListener(MouseEvent.MOUSE_OVER, buttonMouseOver);
clip.addEventListener(MouseEvent.MOUSE_OUT, buttonMouseOut);
clip.addEventListener(MouseEvent.CLICK, buttonMouseClick);
}
public function set fromMenu(v:Boolean):void{
if (v){
_fromMenu = true;
if (resumeButton){
resumeButton.gotoAndStop(3);
states[resumeButton.name] = 3;
};
} else {
_fromMenu = false;
if (resumeButton){
resumeButton.gotoAndStop(1);
states[resumeButton.name] = 1;
};
};
}
public function setState(button:MovieClip, state:Number):void{
states[button.name] = state;
button.gotoAndStop(state);
}
public function setupLoader(e:Event):void{
var tmpTemplate:MovieClip = (internalLoader.content as MovieClip);
hintsButton = (tmpTemplate.btnHints as MovieClip);
musicButton = (tmpTemplate.btnMusic as MovieClip);
soundButton = (tmpTemplate.btnSound as MovieClip);
resumeButton = (tmpTemplate.btnResumeGame as MovieClip);
moreButton = (tmpTemplate.btnMoreGames as MovieClip);
var hintsOn:Number = dGamePlayer.__options.hints;
if (hintsOn == 0){
hintsButton.gotoAndStop(3);
hintsButton.buttonMode = true;
setupListeners(hintsButton);
states[hintsButton.name] = 3;
} else {
hintsButton.gotoAndStop(1);
hintsButton.buttonMode = true;
setupListeners(hintsButton);
states[hintsButton.name] = 1;
};
var musicOn:Number = dGamePlayer.__options.music;
if (musicOn == 0){
musicButton.gotoAndStop(3);
musicButton.buttonMode = true;
setupListeners(musicButton);
states[musicButton.name] = 3;
} else {
musicButton.gotoAndStop(1);
musicButton.buttonMode = true;
setupListeners(musicButton);
states[musicButton.name] = 1;
};
var soundsOn:Number = dGamePlayer.__options.sound;
if (soundsOn == 0){
soundButton.gotoAndStop(3);
soundButton.buttonMode = true;
setupListeners(soundButton);
states[soundButton.name] = 3;
} else {
soundButton.gotoAndStop(1);
soundButton.buttonMode = true;
setupListeners(soundButton);
states[soundButton.name] = 1;
};
resumeButton.gotoAndStop(3);
resumeButton.buttonMode = true;
setupListeners(resumeButton);
states[resumeButton.name] = 3;
moreButton.gotoAndStop(1);
moreButton.buttonMode = true;
setupListeners(moreButton);
states[moreButton.name] = 1;
}
private function buttonMouseOut(e:MouseEvent):void{
e.target.gotoAndStop(states[e.target.name]);
}
}
}//package com.evilfree
Section 31
//OptionsDialog_templateSwf (com.evilfree.OptionsDialog_templateSwf)
package com.evilfree {
import mx.core.*;
public class OptionsDialog_templateSwf extends ByteArrayAsset {
}
}//package com.evilfree
Section 32
//OptionsDialog_xmlFile (com.evilfree.OptionsDialog_xmlFile)
package com.evilfree {
import mx.core.*;
public class OptionsDialog_xmlFile extends ByteArrayAsset {
}
}//package com.evilfree
Section 33
//PlayAgainButton (com.evilfree.PlayAgainButton)
package com.evilfree {
import flash.display.*;
import flash.events.*;
public class PlayAgainButton extends Sprite {
private var internalLoader:Loader;
public var moreButton:MovieClip;
private var _skin:Number;// = 1
public static const logoBytes:Class = PlayAgainButton_logoBytes;
public function PlayAgainButton(){
internalLoader = new Loader();
super();
this.graphics.beginFill(0xFFFFFF, 0.01);
this.graphics.drawRect(0, 0, 0x0100, 92);
this.graphics.endFill();
internalLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, setupLoader);
internalLoader.loadBytes(new logoBytes());
this.width = 0x0100;
this.height = 92;
}
private function setupLoader(e:Event):void{
var tmpTemplate:MovieClip = (internalLoader.content as MovieClip);
moreButton = (tmpTemplate.playAgain as MovieClip);
moreButton.gotoAndStop(((_skin * 2) - 1));
moreButton.buttonMode = true;
moreButton.addEventListener(MouseEvent.MOUSE_OVER, buttonMouseOver);
moreButton.addEventListener(MouseEvent.MOUSE_OUT, buttonMouseOut);
moreButton.addEventListener(MouseEvent.CLICK, gotoDgames);
addChild(moreButton);
}
public function setSkin(skinNumber:Number):void{
_skin = skinNumber;
if (moreButton){
moreButton.gotoAndStop(((_skin * 2) - 1));
};
}
private function buttonMouseOver(e:MouseEvent):void{
moreButton.gotoAndStop((_skin * 2));
}
private function buttonMouseOut(e:MouseEvent):void{
moreButton.gotoAndStop(((_skin * 2) - 1));
}
private function gotoDgames(e:MouseEvent):void{
dispatchEvent(new Event("reset"));
}
}
}//package com.evilfree
Section 34
//PlayAgainButton_logoBytes (com.evilfree.PlayAgainButton_logoBytes)
package com.evilfree {
import mx.core.*;
public class PlayAgainButton_logoBytes extends ByteArrayAsset {
}
}//package com.evilfree
Section 35
//Preloader (com.evilfree.Preloader)
package com.evilfree {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import mx.events.*;
import mx.preloaders.*;
import flash.net.*;
import caurina.transitions.*;
import flash.utils.*;
import flash.filters.*;
public class Preloader extends DownloadProgressBar {
private var started:Boolean;
public var buttonclass:Class;
public var progressFore:int;// = 0
private var curFrame:Number;// = 1
public var xmlLoader:Loader;
public var bgImage:Class;
public var gameLoaded:Boolean;// = false
public var progressWidth:Number;// = 0
public var progressBar:CustomProgressBar;
public var fadeTimer:Timer;
public var data:XML;
public var xmlFile:Class;
public var progressHeight:Number;// = 0
public var background:Sprite;
public var playImage_n:Bitmap;
public var playImage_o:Bitmap;
private var theHost:String;
public var logoBitmap:Bitmap;
public var progressBack:int;// = 0
public var timerProg:Number;// = 0
public var timeReached:Boolean;// = false
private var difData:XML;
public var playImageNormal:Class;
private var mochiCode:String;// = ""
public var logoSprite:Sprite;
public var progressSprite:Sprite;
public var bgBitmap:Bitmap;
public var frameTimer:Timer;
public var splashLoader:Loader;
public var loadedProgress:Number;// = 0
public var advert:CPMStarAd;
public var buttonLoader:Loader;
private var splash:MovieClip;
public var prog:Number;// = 0
public var playButtonSprite:Sprite;
public var logoImage:Class;
public var splashclass:Class;
public var playImageOver:Class;
public function Preloader(){
xmlFile = Preloader_xmlFile;
bgImage = Preloader_bgImage;
logoImage = Preloader_logoImage;
playImageOver = Preloader_playImageOver;
playImageNormal = Preloader_playImageNormal;
splashclass = Preloader_splashclass;
buttonclass = Preloader_buttonclass;
splashLoader = new Loader();
buttonLoader = new Loader();
bgBitmap = new bgImage();
logoBitmap = new logoImage();
playImage_n = new playImageNormal();
playImage_o = new playImageOver();
logoSprite = new Sprite();
playButtonSprite = new Sprite();
background = new Sprite();
progressSprite = new Sprite();
fadeTimer = new Timer(10);
progressBar = new CustomProgressBar();
frameTimer = new Timer(10);
super();
started = false;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function setupIntro(e:Event):void{
var mc:MovieClip = (splashLoader.content as MovieClip);
mc.addEventListener(Event.ENTER_FRAME, onEnterSplashFrame);
}
private function playClick(e:MouseEvent):void{
Tweener.addTween(background, {alpha:0, time:0.5, onComplete:playGame});
}
private function onLogoMouseOver(e:MouseEvent):void{
logoSprite.filters = [new ColorMatrixFilter([1.2, 0, 0, 0, 0, 0, 1.2, 0, 0, 0, 0, 0, 1.2, 0, 0, 0, 0, 0, 1, 1])];
}
private function FlexInitComplete(event:Event):void{
gameLoaded = true;
if (timeReached){
playButtonSprite.visible = true;
};
}
private function onLogoMouseUp(e:MouseEvent):void{
logoSprite.x = (logoSprite.x - 2);
logoSprite.y = (logoSprite.y - 2);
}
public function onInitMDM():void{
}
private function playOnMouseOver(e:MouseEvent):void{
playButtonSprite.graphics.clear();
playButtonSprite.graphics.beginBitmapFill(playImage_o.bitmapData);
playButtonSprite.graphics.drawRect(0, 0, playImage_o.width, playImage_o.height);
playButtonSprite.graphics.endFill();
}
private function gotoDgames(e:MouseEvent):void{
MochiBot.track(this, mochiCode);
navigateToURL(new URLRequest("http://differencegames.com/"), "_blank");
}
private function playOnMouseOut(e:MouseEvent):void{
playButtonSprite.graphics.clear();
playButtonSprite.graphics.beginBitmapFill(playImage_n.bitmapData);
playButtonSprite.graphics.drawRect(0, 0, playImage_n.width, playImage_n.height);
playButtonSprite.graphics.endFill();
}
private function finTimer():void{
timeReached = true;
if (gameLoaded){
playButtonSprite.visible = true;
};
}
private function playGame():void{
Tweener.removeAllTweens();
setTimeout(dispatchEvent, 100, new Event(Event.COMPLETE));
}
private function onEnterSplashFrame(e:Event):void{
var buttonMC:MovieClip;
var mc:MovieClip = (splashLoader.content as MovieClip);
if (mc.currentFrame == mc.framesLoaded){
splashLoader.unload();
removeChild(splashLoader);
mc.removeEventListener(Event.ENTER_FRAME, onEnterSplashFrame);
mc.stop();
addChild(background);
buttonMC = (buttonLoader.content as MovieClip);
background.addChild(buttonMC);
buttonMC.x = 340;
buttonMC.y = 480;
buttonMC.gotoAndStop(1);
if (difData.preloader[0].@ads != "false"){
Tweener.addTween(this, {timerProg:25, time:5, transition:"linear", onComplete:finTimer});
} else {
Tweener.addTween(this, {timerProg:25, time:0.5, transition:"linear", onComplete:finTimer});
};
};
}
public function loadXML(xml:XML):void{
data = xml;
playButtonSprite.visible = false;
playButtonSprite.x = data.playButton[0].@x;
playButtonSprite.y = data.playButton[0].@y;
if (advert){
advert.x = data.advert[0].@x;
advert.y = data.advert[0].@y;
};
logoSprite.x = data.logo[0].@x;
logoSprite.y = data.logo[0].@y;
progressSprite.x = data.progressbar[0].@x;
progressSprite.y = data.progressbar[0].@y;
progressWidth = data.progressbar[0].@width;
progressHeight = data.progressbar[0].@height;
progressFore = parseInt(data.progressbar[0].@foreColor);
progressBack = parseInt(data.progressbar[0].@backColor);
}
private function SWFDownloadProgress(event:ProgressEvent):void{
loadedProgress = (loaderInfo.bytesLoaded / loaderInfo.bytesTotal);
var loadedTotal:Number = Math.min(loadedProgress, (timerProg / 25));
var pWidth:Number = (loadedTotal * (progressWidth - 2));
progressSprite.graphics.clear();
progressSprite.graphics.beginFill(progressBack);
progressSprite.graphics.drawRect(0, 0, progressWidth, progressHeight);
progressSprite.graphics.endFill();
progressSprite.graphics.beginFill(progressFore);
progressSprite.graphics.drawRect(1, 1, pWidth, (progressHeight - 2));
progressSprite.graphics.endFill();
}
private function onLogoMouseDown(e:MouseEvent):void{
logoSprite.x = (logoSprite.x + 2);
logoSprite.y = (logoSprite.y + 2);
}
public function ini():void{
var host:String;
started = true;
var hostDomain:String = stage.loaderInfo.url.split("/")[2];
var locked:Boolean;
var hostBits:Array = hostDomain.split(".");
if (hostBits.length > 1){
host = ((hostBits[(hostBits.length - 2)] + ".") + hostBits[(hostBits.length - 1)]);
} else {
host = hostBits[0];
};
theHost = host;
trace(("HOST:" + host));
buttonLoader.loadBytes((new buttonclass() as ByteArray));
background.graphics.beginBitmapFill(bgBitmap.bitmapData);
background.graphics.drawRect(0, 0, bgBitmap.width, bgBitmap.height);
background.graphics.endFill();
splashLoader.loadBytes((new splashclass() as ByteArray));
splashLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, setupIntro);
addChild(splashLoader);
splashLoader.x = ((bgBitmap.width / 2) - 275);
splashLoader.y = ((bgBitmap.height / 2) - 274);
playButtonSprite.graphics.beginBitmapFill(playImage_n.bitmapData);
playButtonSprite.graphics.drawRect(0, 0, playImage_n.width, playImage_n.height);
playButtonSprite.graphics.endFill();
var ba:ByteArray = new xmlFile();
difData = new XML(ba.readUTFBytes(ba.length));
mochiCode = difData.config[0].mochiD[0].@code;
background.addChild(progressSprite);
if (difData.preloader[0].@ads != "false"){
if ((((((((((((((((((((((host == "kongregate.com")) || ((host == "differencebuilder.com")))) || ((host == "agame.com")))) || ((host == "myprincessacademy.com")))) || ((host == "cartoondollemporium.com")))) || ((host == "addictinggames.com")))) || ((host == "evilfree.com")))) || ((host == "andkon.com")))) || ((host == "2games.com")))) || ((host == "armorgames.com")))) || ((host == "evilfree.com")))){
} else {
advert = new CPMStarAd();
background.addChild(advert);
};
background.addChild(logoSprite);
};
background.addChild(playButtonSprite);
loadXML(difData.preloader[0]);
logoSprite.buttonMode = true;
var mat:Matrix = new Matrix();
if (data.logo[0].@scale){
mat.scale(parseFloat(data.logo[0].@scale), parseFloat(data.logo[0].@scale));
};
logoSprite.graphics.beginBitmapFill(logoBitmap.bitmapData, mat, false, true);
if (data.logo[0].@scale){
logoSprite.graphics.drawRect(0, 0, (logoBitmap.width * parseFloat(data.logo[0].@scale)), (logoBitmap.height * parseFloat(data.logo[0].@scale)));
} else {
logoSprite.graphics.drawRect(0, 0, logoBitmap.width, logoBitmap.height);
};
logoSprite.graphics.endFill();
logoSprite.addEventListener(MouseEvent.MOUSE_OVER, onLogoMouseOver);
logoSprite.addEventListener(MouseEvent.MOUSE_OUT, onLogoMouseOut);
logoSprite.addEventListener(MouseEvent.MOUSE_DOWN, onLogoMouseDown);
logoSprite.addEventListener(MouseEvent.MOUSE_UP, onLogoMouseUp);
logoSprite.addEventListener(MouseEvent.CLICK, gotoDgames);
playButtonSprite.addEventListener(MouseEvent.MOUSE_OVER, playOnMouseOver);
playButtonSprite.addEventListener(MouseEvent.MOUSE_OUT, playOnMouseOut);
playButtonSprite.addEventListener(MouseEvent.CLICK, playClick);
playButtonSprite.buttonMode = true;
}
override public function set preloader(preloader:Sprite):void{
preloader.addEventListener(ProgressEvent.PROGRESS, SWFDownloadProgress);
preloader.addEventListener(FlexEvent.INIT_COMPLETE, FlexInitComplete);
}
private function onLogoMouseOut(e:MouseEvent):void{
logoSprite.filters = [];
}
private function onEnterFrame(e:Event):void{
if (started == false){
ini();
};
if (timerProg >= 25){
timerProg = 25;
};
var loadedTotal:Number = Math.min(loadedProgress, (timerProg / 25));
var pWidth:Number = (loadedTotal * (progressWidth - 2));
progressSprite.graphics.clear();
progressSprite.graphics.beginFill(progressBack);
progressSprite.graphics.drawRect(0, 0, progressWidth, progressHeight);
progressSprite.graphics.endFill();
progressSprite.graphics.beginFill(progressFore);
progressSprite.graphics.drawRect(1, 1, pWidth, (progressHeight - 2));
progressSprite.graphics.endFill();
}
}
}//package com.evilfree
Section 36
//Preloader_bgImage (com.evilfree.Preloader_bgImage)
package com.evilfree {
import mx.core.*;
public class Preloader_bgImage extends BitmapAsset {
}
}//package com.evilfree
Section 37
//Preloader_buttonclass (com.evilfree.Preloader_buttonclass)
package com.evilfree {
import mx.core.*;
public class Preloader_buttonclass extends ByteArrayAsset {
}
}//package com.evilfree
Section 38
//Preloader_logoImage (com.evilfree.Preloader_logoImage)
package com.evilfree {
import mx.core.*;
public class Preloader_logoImage extends BitmapAsset {
}
}//package com.evilfree
Section 39
//Preloader_playImageNormal (com.evilfree.Preloader_playImageNormal)
package com.evilfree {
import mx.core.*;
public class Preloader_playImageNormal extends BitmapAsset {
}
}//package com.evilfree
Section 40
//Preloader_playImageOver (com.evilfree.Preloader_playImageOver)
package com.evilfree {
import mx.core.*;
public class Preloader_playImageOver extends BitmapAsset {
}
}//package com.evilfree
Section 41
//Preloader_splashclass (com.evilfree.Preloader_splashclass)
package com.evilfree {
import mx.core.*;
public class Preloader_splashclass extends ByteArrayAsset {
}
}//package com.evilfree
Section 42
//Preloader_xmlFile (com.evilfree.Preloader_xmlFile)
package com.evilfree {
import mx.core.*;
public class Preloader_xmlFile extends ByteArrayAsset {
}
}//package com.evilfree
Section 43
//SceneSWFEffect (com.evilfree.SceneSWFEffect)
package com.evilfree {
import flash.display.*;
import mx.core.*;
import flash.events.*;
public class SceneSWFEffect extends UIComponent {
private var _toframe:Number;// = 15
private var _mc:MovieClip;
public function SceneSWFEffect(mc:MovieClip, toFrame:Number=15){
super();
_mc = mc;
_toframe = toFrame;
_mc.x = 0;
_mc.y = 0;
_mc.visible = false;
addChild(_mc);
}
private function onEnterFrame(e:Event):void{
if (_mc.currentFrame == _toframe){
_mc.visible = false;
_mc.stop();
dispatchEvent(new Event("complete"));
_mc.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
}
public function run():void{
_mc.gotoAndPlay(1);
_mc.addEventListener(Event.ENTER_FRAME, onEnterFrame);
_mc.visible = true;
}
}
}//package com.evilfree
Section 44
//SceneTextEffect (com.evilfree.SceneTextEffect)
package com.evilfree {
import mx.core.*;
import flash.events.*;
import flash.text.*;
import caurina.transitions.*;
public class SceneTextEffect extends UIComponent {
public var textwidth:Number;// = 200
public var effects:int;// = 0
public var textx:Number;// = 0
public var texty:Number;// = 0
public var text:String;// = ""
private var numTweens:Number;// = 0
public var duration:Number;// = 1000
public var startFormat:TextFormat;
public var textheight:Number;// = 200
private var textbox:TextField;
public static var FADE:int = 1;
public static var ZOOMOUT:int = 0x1000;
public static var FLOAT:int = 0x0100;
public static var COMPLETED_EVENT:Event = new Event("onComplete");
public static var ZOOMIN:int = 16;
public function SceneTextEffect(text:String, effects:int=0, x:Number=0, y:Number=0, width:Number=400, height:Number=100, filters:Array=null, startFormat:TextFormat=null){
startFormat = new TextFormat("Verdana", 20, 0, null, null, null, null, null, "center");
textbox = new TextField();
super();
this.mouseEnabled = false;
this.mouseChildren = false;
this.mouseFocusEnabled = false;
this.text = text;
this.textbox.text = text;
this.textx = x;
this.textbox.x = x;
this.texty = y;
this.textbox.y = y;
this.textwidth = width;
this.textbox.width = width;
this.textheight = height;
this.textbox.height = height;
this.effects = effects;
this.textbox.antiAliasType = AntiAliasType.ADVANCED;
this.textbox.selectable = false;
if (filters != null){
this.filters = filters;
this.textbox.filters = filters;
};
if (startFormat != null){
this.startFormat = startFormat;
this.textbox.defaultTextFormat = startFormat;
};
}
private function onTweenComplete():void{
numTweens--;
if (numTweens <= 0){
removeChild(textbox);
numTweens = 0;
visible = false;
dispatchEvent(COMPLETED_EVENT);
};
}
private function processZoom():void{
}
public function run():void{
visible = true;
textbox.text = text;
textbox.x = textx;
textbox.y = texty;
textbox.width = textwidth;
textbox.height = textheight;
textbox.defaultTextFormat = startFormat;
textbox.text = text;
textbox.filters = filters;
textbox.embedFonts = true;
textbox.alpha = 1;
textbox.scaleX = 1;
textbox.scaleY = 1;
textbox.antiAliasType = AntiAliasType.NORMAL;
addChild(textbox);
this.alpha = 1;
this.scaleX = 1;
this.scaleY = 1;
if ((effects & FADE) == FADE){
Tweener.addTween(this, {alpha:0, time:(((duration / 1000) / 4) * 2), delay:((duration / 1000) / 3), onComplete:onTweenComplete});
numTweens++;
};
if ((effects & ZOOMIN) == ZOOMIN){
Tweener.addTween(this, {scaleX:2, scaleY:2, time:(duration / 1000), onComplete:onTweenComplete});
numTweens++;
};
if ((effects & ZOOMOUT) == ZOOMOUT){
Tweener.addTween(this, {scaleX:0.5, scaleY:0.5, time:(duration / 1000), onComplete:onTweenComplete});
numTweens++;
};
if ((effects & FLOAT) == FLOAT){
Tweener.addTween(textbox, {y:(textbox.y - 20), time:(duration / 1000), onComplete:onTweenComplete});
numTweens++;
};
}
}
}//package com.evilfree
Section 45
//SoundManager (com.evilfree.SoundManager)
package com.evilfree {
import mx.core.*;
import flash.media.*;
public class SoundManager {
private var sound1:SoundAsset;
private var sound2:SoundAsset;
private var sound3:SoundAsset;
private var sound4:SoundAsset;
private var sound6:SoundAsset;
private var sound5:SoundAsset;
private var svolume:Number;// = 0
private var soundTransform:SoundTransform;
private var soundC2:SoundChannel;
private var soundC3:SoundChannel;
private var soundC4:SoundChannel;
private var soundC5:SoundChannel;
private var soundC6:SoundChannel;
private var soundC1:SoundChannel;
private var _musicMuted:Boolean;// = false
private var _soundMuted:Boolean;// = false
public static var NEXT_SCENE:Number = 3;
public static var MUSIC:Number = 6;
public static var GOOD_CLICK:Number = 1;
public static var BAD_CLICK:Number = 2;
public static var WIN:Number = 5;
public static var FAIL:Number = 4;
public function SoundManager(GoodClickSound:SoundAsset, BadClickSound:SoundAsset, NextSceneSound:SoundAsset, FailSound:SoundAsset, WinSound:SoundAsset, Music:SoundAsset){
soundC1 = new SoundChannel();
soundC2 = new SoundChannel();
soundC3 = new SoundChannel();
soundC4 = new SoundChannel();
soundC5 = new SoundChannel();
soundC6 = new SoundChannel();
soundTransform = new SoundTransform();
super();
sound1 = GoodClickSound;
sound2 = BadClickSound;
sound3 = NextSceneSound;
sound4 = FailSound;
sound5 = WinSound;
sound6 = Music;
}
public function play(sound:Number, loop:Boolean=false):void{
var loops:Number = 0;
if (loop){
loops = 1000;
};
if (!_soundMuted){
switch (sound){
case 1:
soundC1 = sound1.play(0, loops);
break;
case 2:
soundC2 = sound2.play(0, loops);
break;
case 3:
soundC3 = sound3.play(0, loops);
break;
case 4:
soundC4 = sound4.play(0, loops);
break;
case 5:
soundC5 = sound5.play(0, loops);
break;
};
};
if (((!(_musicMuted)) && ((sound == 6)))){
soundC6 = sound6.play(0, loops);
};
}
public function set musicMuted(value:Boolean):void{
_musicMuted = value;
var volume:Number = 1;
if (value == true){
volume = 0;
};
soundTransform.volume = volume;
soundC6.soundTransform = soundTransform;
}
public function get volume():Number{
return (this.svolume);
}
public function set volume(value:Number):void{
this.svolume = value;
soundTransform.volume = value;
soundC1.soundTransform = soundTransform;
soundC2.soundTransform = soundTransform;
soundC3.soundTransform = soundTransform;
soundC4.soundTransform = soundTransform;
soundC5.soundTransform = soundTransform;
soundC6.soundTransform = soundTransform;
}
public function set soundMuted(value:Boolean):void{
var volume:Number = 1;
_soundMuted = value;
if (value == true){
volume = 0;
};
soundTransform.volume = volume;
soundC1.soundTransform = soundTransform;
soundC2.soundTransform = soundTransform;
soundC3.soundTransform = soundTransform;
soundC4.soundTransform = soundTransform;
soundC5.soundTransform = soundTransform;
}
public function stopAll():void{
soundC1.stop();
soundC2.stop();
soundC3.stop();
soundC4.stop();
soundC5.stop();
soundC6.stop();
}
}
}//package com.evilfree
Section 46
//WhiteHiScores (com.evilfree.WhiteHiScores)
package com.evilfree {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class WhiteHiScores extends Loader {
private var _score:int;// = 0
public var graphicsclass:Class;
public function WhiteHiScores(){
graphicsclass = WhiteHiScores_graphicsclass;
super();
contentLoaderInfo.addEventListener(Event.COMPLETE, loadedComplete);
loadBytes((new graphicsclass() as ByteArray));
}
public function setScore(value:Number):void{
_score = value;
var mc:MovieClip = (content as MovieClip);
if (mc){
mc.scoreText.text = value.toString();
};
}
private function loadedComplete(e:Event):void{
var mc:MovieClip = (content as MovieClip);
if (mc){
mc.scoreText.text = _score.toString();
};
}
}
}//package com.evilfree
Section 47
//WhiteHiScores_graphicsclass (com.evilfree.WhiteHiScores_graphicsclass)
package com.evilfree {
import mx.core.*;
public class WhiteHiScores_graphicsclass extends ByteArrayAsset {
}
}//package com.evilfree
Section 48
//KongregateEvent (com.kongregate.as3.client.events.KongregateEvent)
package com.kongregate.as3.client.events {
import flash.events.*;
public class KongregateEvent extends Event {
public static const COMPLETE:String = "component_api_available";
public function KongregateEvent(_arg1:String){
super(_arg1);
}
}
}//package com.kongregate.as3.client.events
Section 49
//AbstractShadowService (com.kongregate.as3.client.services.AbstractShadowService)
package com.kongregate.as3.client.services {
import flash.events.*;
public class AbstractShadowService extends EventDispatcher {
protected function alert(_arg1:String, _arg2:String, _arg3="", _arg4:String=""):void{
trace(((((((("Kongregate API: " + _arg1) + ".") + _arg2) + "(") + _arg3) + ") ") + _arg4));
}
}
}//package com.kongregate.as3.client.services
Section 50
//HighScoreServiceShadow (com.kongregate.as3.client.services.HighScoreServiceShadow)
package com.kongregate.as3.client.services {
public class HighScoreServiceShadow extends AbstractShadowService implements IHighScoreServices {
private var mode:String;
public function HighScoreServiceShadow(){
mode = "";
}
public function submit(_arg1:Number, _arg2:String=null):void{
alert("IHighScoreServices", "submit", arguments);
}
public function connect():Boolean{
alert("IKongregateServices", "connect");
return (true);
}
public function requestList(_arg1:Function):void{
alert("IHighScoreServices", "requestList", "", (("[Mode: " + mode) + "]"));
_arg1({success:false});
}
public function setMode(_arg1:String):void{
alert("IHighScoreServices", "setMode", arguments);
this.mode = _arg1;
}
}
}//package com.kongregate.as3.client.services
Section 51
//IHighScoreServices (com.kongregate.as3.client.services.IHighScoreServices)
package com.kongregate.as3.client.services {
public interface IHighScoreServices {
function setMode(_arg1:String):void;
function submit(_arg1:Number, _arg2:String=null):void;
function requestList(_arg1:Function):void;
}
}//package com.kongregate.as3.client.services
Section 52
//IKongregateServices (com.kongregate.as3.client.services.IKongregateServices)
package com.kongregate.as3.client.services {
import flash.events.*;
public interface IKongregateServices extends IEventDispatcher {
function getPlayerInfo(_arg1:Function):void;
function connect(_arg1:Number=-1):Boolean;
}
}//package com.kongregate.as3.client.services
Section 53
//IStatServices (com.kongregate.as3.client.services.IStatServices)
package com.kongregate.as3.client.services {
public interface IStatServices {
function submitArray(_arg1:Array):void;
function submit(_arg1:String, _arg2:Number):void;
}
}//package com.kongregate.as3.client.services
Section 54
//IUserServices (com.kongregate.as3.client.services.IUserServices)
package com.kongregate.as3.client.services {
public interface IUserServices {
function getName():String;
function getPlayerInfo(_arg1:Function):void;
}
}//package com.kongregate.as3.client.services
Section 55
//KongregateServiceShadow (com.kongregate.as3.client.services.KongregateServiceShadow)
package com.kongregate.as3.client.services {
public class KongregateServiceShadow extends AbstractShadowService implements IKongregateServices {
public function getName():String{
alert("IKongregateServices", "getName");
return ("Guest");
}
public function connect(_arg1:Number=-1):Boolean{
alert("IKongregateServices", "connect", arguments);
return (true);
}
public function getPlayerInfo(_arg1:Function):void{
alert("IKongregateServices", "getPlayerInfo");
_arg1(new Object());
}
}
}//package com.kongregate.as3.client.services
Section 56
//StatServiceShadow (com.kongregate.as3.client.services.StatServiceShadow)
package com.kongregate.as3.client.services {
public class StatServiceShadow extends AbstractShadowService implements IStatServices {
public function submitArray(_arg1:Array):void{
alert("IStatServices", "submitArray", arguments);
}
public function submit(_arg1:String, _arg2:Number):void{
alert("IStatServices", "submitStat", arguments);
}
}
}//package com.kongregate.as3.client.services
Section 57
//UserServiceShadow (com.kongregate.as3.client.services.UserServiceShadow)
package com.kongregate.as3.client.services {
public class UserServiceShadow extends AbstractShadowService implements IUserServices {
public function getName():String{
alert("UserService", "getName");
return ("Guest");
}
public function getPlayerInfo(_arg1:Function):void{
alert("UserService", "getPlayerInfo");
_arg1({isGuest:true, name:"Guest", points:0, level:0, isMode:false, isAdmin:false, isDeveloper:false, avatarPath:"", chatAvatarPath:""});
}
}
}//package com.kongregate.as3.client.services
Section 58
//IAPIBootstrap (com.kongregate.as3.client.IAPIBootstrap)
package com.kongregate.as3.client {
import flash.display.*;
import flash.events.*;
public interface IAPIBootstrap {
function init(_arg1:Event=null, _arg2:Stage=null):void;
function hideLog():void;
function showLog(_arg1:int=0):void;
}
}//package com.kongregate.as3.client
Section 59
//KongregateAPI (com.kongregate.as3.client.KongregateAPI)
package com.kongregate.as3.client {
import flash.display.*;
import flash.events.*;
import com.kongregate.as3.client.services.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import com.kongregate.as3.client.events.*;
import flash.errors.*;
public class KongregateAPI extends Sprite {
private const VERSION:Number = 1;
private var loader:Loader;
private var loadedDomain:ApplicationDomain;
private static const CLASS_USER:String = "com.kongregate.as3.client.services.UserServices";
private static const CLASS_STATS:String = "com.kongregate.as3.client.services.StatServices";
private static const CLASS_SERVICES:String = "com.kongregate.as3.client.services.KongregateServices";
private static const CLASS_SCORES:String = "com.kongregate.as3.client.services.HighScoreServices";
private static const DEBUG_API_URL:String = "//Linuxpc/kongregate/public/flash/API_AS3.swf";
private static var _connected:Boolean;
private static var kUser:IUserServices;
private static var _loaded:Boolean;
private static var kServices:IKongregateServices;
private static var kScores:IHighScoreServices;
private static var mInstance:KongregateAPI;
private static var kStats:IStatServices;
private static var kAPI:IAPIBootstrap;
public function KongregateAPI(){
if (mInstance != null){
throw (new Error("Warning: KongregateAPI has been added to stage more than once or accessed improperly. Use getInstance() or a stage reference to access."));
};
mInstance = this;
this.addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true);
}
public function get loaded():Boolean{
return (_loaded);
}
public function get connected():Boolean{
return (_connected);
}
private function alertConnected(_arg1:TimerEvent=null):void{
var _local2:KongregateEvent;
var _local3:Boolean;
_local2 = new KongregateEvent(KongregateEvent.COMPLETE);
_local3 = this.dispatchEvent(_local2);
}
private function init(_arg1:Event):void{
var _local2:Object;
var _local3:String;
var _local4:URLRequest;
var _local5:LoaderContext;
this.removeEventListener(Event.ADDED_TO_STAGE, init);
_loaded = false;
_connected = false;
_local2 = LoaderInfo(root.loaderInfo).parameters;
_local3 = _local2.api_path;
if (_local3 == null){
trace("Alert: Kongregate API could not be loaded, due to local testing. API will load when the game is uploaded.");
createShadowServices();
return;
};
Security.allowDomain("*.kongregate.com");
Security.allowDomain("kongregatetrunk.com");
_local4 = new URLRequest(_local3);
_local5 = new LoaderContext(false);
_local5.applicationDomain = ApplicationDomain.currentDomain;
_local5.securityDomain = SecurityDomain.currentDomain;
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
loader.load(_local4, _local5);
}
public function get api():IAPIBootstrap{
return (kAPI);
}
private function loadComplete(_arg1:Event):void{
getServices();
}
public function get scores():IHighScoreServices{
return (kScores);
}
private function ioErrorHandler(_arg1:IOErrorEvent):void{
throw (new IOError(("API file not found. " + _arg1)));
}
public function get services():IKongregateServices{
return (kServices);
}
public function get stats():IStatServices{
return (kStats);
}
private function createShadowServices():void{
var _local1:Timer;
trace(">>> Kongregate Shadow Services instantiated for local development..");
kServices = new KongregateServiceShadow();
kScores = new HighScoreServiceShadow();
kStats = new StatServiceShadow();
kUser = new UserServiceShadow();
_local1 = new Timer(200, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, alertConnected);
_local1.start();
_connected = true;
}
public function get user():IUserServices{
return (kUser);
}
private function getServices():void{
var _local1:ApplicationDomain;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local1 = ApplicationDomain.currentDomain;
kAPI = IAPIBootstrap(loader.getChildAt(0));
this.addChild(loader);
_local2 = _local1.getDefinition(CLASS_SERVICES);
trace(_local2);
kServices = _local2.getInstance();
_local3 = _local1.getDefinition(CLASS_SCORES);
kScores = _local3.getInstance();
_local4 = _local1.getDefinition(CLASS_STATS);
kStats = _local4.getInstance();
_local5 = _local1.getDefinition(CLASS_USER);
kUser = _local5.getInstance();
kServices.connect(VERSION);
_loaded = true;
_connected = true;
alertConnected();
}
public static function getInstance():KongregateAPI{
if (!mInstance){
throw (new IllegalOperationError("You must add the Kongregate API component to the stage before attempting to access it."));
};
return (mInstance);
}
}
}//package com.kongregate.as3.client
Section 60
//movAutoEntryScreen0_18 (HiScores_fla.movAutoEntryScreen0_18)
package HiScores_fla {
import flash.display.*;
import flash.text.*;
public dynamic class movAutoEntryScreen0_18 extends MovieClip {
public var txtName:TextField;
public var txtMsg2:TextField;
public var btnEnterAnother:SimpleButton;
public var txtMsg1:TextField;
public var btnSubmit:SimpleButton;
}
}//package HiScores_fla
Section 61
//movAutoEntryScreen1_8 (HiScores_fla.movAutoEntryScreen1_8)
package HiScores_fla {
import flash.display.*;
import flash.text.*;
public dynamic class movAutoEntryScreen1_8 extends MovieClip {
public var txtName:TextField;
public var txtMsg2:TextField;
public var btnEnterAnother:SimpleButton;
public var txtMsg1:TextField;
public var btnSubmit:SimpleButton;
}
}//package HiScores_fla
Section 62
//movEntryScreen0_14 (HiScores_fla.movEntryScreen0_14)
package HiScores_fla {
import flash.display.*;
import flash.text.*;
public dynamic class movEntryScreen0_14 extends MovieClip {
public var txtName:TextField;
public var movCode:MovieClip;
public var txtMsg2:TextField;
public var btnRefreshCode:SimpleButton;
public var txtCode:TextField;
public var txtMsg1:TextField;
public var btnSubmit:SimpleButton;
}
}//package HiScores_fla
Section 63
//movEntryScreen1_4 (HiScores_fla.movEntryScreen1_4)
package HiScores_fla {
import flash.display.*;
import flash.text.*;
public dynamic class movEntryScreen1_4 extends MovieClip {
public var txtName:TextField;
public var movCode:MovieClip;
public var txtMsg2:TextField;
public var btnRefreshCode:SimpleButton;
public var txtCode:TextField;
public var txtMsg1:TextField;
public var btnSubmit:SimpleButton;
}
}//package HiScores_fla
Section 64
//movInfoScreen0_20 (HiScores_fla.movInfoScreen0_20)
package HiScores_fla {
import flash.display.*;
import flash.text.*;
public dynamic class movInfoScreen0_20 extends MovieClip {
public var btnView:SimpleButton;
public var txtInfo:TextField;
public var btnBack:SimpleButton;
}
}//package HiScores_fla
Section 65
//movInfoScreen1_10 (HiScores_fla.movInfoScreen1_10)
package HiScores_fla {
import flash.display.*;
import flash.text.*;
public dynamic class movInfoScreen1_10 extends MovieClip {
public var btnView:SimpleButton;
public var txtInfo:TextField;
public var btnBack:SimpleButton;
}
}//package HiScores_fla
Section 66
//movSkin0_13 (HiScores_fla.movSkin0_13)
package HiScores_fla {
import flash.display.*;
public dynamic class movSkin0_13 extends MovieClip {
public var movAutoEntryScreen:MovieClip;
public var movEntryScreen:MovieClip;
public var movInfoScreen:MovieClip;
}
}//package HiScores_fla
Section 67
//movSkin1_2 (HiScores_fla.movSkin1_2)
package HiScores_fla {
import flash.display.*;
public dynamic class movSkin1_2 extends MovieClip {
public var movAutoEntryScreen:MovieClip;
public var movEntryScreen:MovieClip;
public var movInfoScreen:MovieClip;
}
}//package HiScores_fla
Section 68
//IAutomationObject (mx.automation.IAutomationObject)
package mx.automation {
import flash.events.*;
public interface IAutomationObject {
function createAutomationIDPart(:IAutomationObject):Object;
function get automationName():String;
function get showInAutomationHierarchy():Boolean;
function set automationName(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\automation;IAutomationObject.as:String):void;
function getAutomationChildAt(delegate:int):IAutomationObject;
function get automationDelegate():Object;
function get automationTabularData():Object;
function resolveAutomationIDPart(Object:Object):Array;
function replayAutomatableEvent(void:Event):Boolean;
function set automationDelegate(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\automation;IAutomationObject.as:Object):void;
function get automationValue():Array;
function get numAutomationChildren():int;
function set showInAutomationHierarchy(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\automation;IAutomationObject.as:Boolean):void;
}
}//package mx.automation
Section 69
//Binding (mx.binding.Binding)
package mx.binding {
import mx.core.*;
import flash.utils.*;
public class Binding {
mx_internal var destFunc:Function;
mx_internal var srcFunc:Function;
mx_internal var destString:String;
mx_internal var document:Object;
private var hasHadValue:Boolean;
mx_internal var disabledRequests:Dictionary;
mx_internal var isExecuting:Boolean;
mx_internal var isHandlingEvent:Boolean;
public var twoWayCounterpart:Binding;
private var wrappedFunctionSuccessful:Boolean;
mx_internal var _isEnabled:Boolean;
public var uiComponentWatcher:int;
private var lastValue:Object;
mx_internal static const VERSION:String = "3.2.0.3958";
public function Binding(document:Object, srcFunc:Function, destFunc:Function, destString:String){
super();
this.document = document;
this.srcFunc = srcFunc;
this.destFunc = destFunc;
this.destString = destString;
_isEnabled = true;
isExecuting = false;
isHandlingEvent = false;
hasHadValue = false;
uiComponentWatcher = -1;
BindingManager.addBinding(document, destString, this);
}
private function registerDisabledExecute(o:Object):void{
if (o != null){
disabledRequests = ((disabledRequests)!=null) ? disabledRequests : new Dictionary(true);
disabledRequests[o] = true;
};
}
protected function wrapFunctionCall(thisArg:Object, wrappedFunction:Function, object:Object=null, ... _args):Object{
var result:Object;
var thisArg = thisArg;
var wrappedFunction = wrappedFunction;
var object = object;
var args = _args;
wrappedFunctionSuccessful = false;
result = wrappedFunction.apply(thisArg, args);
wrappedFunctionSuccessful = true;
return (result);
//unresolved jump
var _slot1 = itemPendingError;
_slot1.addResponder(new EvalBindingResponder(this, object));
if (BindingManager.debugDestinationStrings[destString]){
trace(((("Binding: destString = " + destString) + ", error = ") + _slot1));
};
//unresolved jump
var _slot1 = rangeError;
if (BindingManager.debugDestinationStrings[destString]){
trace(((("Binding: destString = " + destString) + ", error = ") + _slot1));
};
//unresolved jump
var _slot1 = error;
if (((((((((!((_slot1.errorID == 1006))) && (!((_slot1.errorID == 1009))))) && (!((_slot1.errorID == 1010))))) && (!((_slot1.errorID == 1055))))) && (!((_slot1.errorID == 1069))))){
throw (_slot1);
} else {
if (BindingManager.debugDestinationStrings[destString]){
trace(((("Binding: destString = " + destString) + ", error = ") + _slot1));
};
};
return (null);
}
public function watcherFired(commitEvent:Boolean, cloneIndex:int):void{
var commitEvent = commitEvent;
var cloneIndex = cloneIndex;
if (isHandlingEvent){
return;
};
try {
try {
isHandlingEvent = true;
execute(cloneIndex);
} finally {
};
} finally {
isHandlingEvent = false;
};
}
private function nodeSeqEqual(x:XMLList, y:XMLList):Boolean{
var i:uint;
var n:uint = x.length();
if (n == y.length()){
i = 0;
while ((((i < n)) && ((x[i] === y[i])))) {
i++;
};
return ((i == n));
//unresolved jump
};
return (false);
}
mx_internal function set isEnabled(value:Boolean):void{
_isEnabled = value;
if (value){
processDisabledRequests();
};
}
private function processDisabledRequests():void{
var key:Object;
if (disabledRequests != null){
for (key in disabledRequests) {
execute(key);
};
disabledRequests = null;
};
}
public function execute(o:Object=null):void{
var o = o;
if (!isEnabled){
if (o != null){
registerDisabledExecute(o);
};
return;
};
if (((isExecuting) || (((twoWayCounterpart) && (twoWayCounterpart.isExecuting))))){
hasHadValue = true;
return;
};
try {
try {
isExecuting = true;
wrapFunctionCall(this, innerExecute, o);
} finally {
};
} finally {
isExecuting = false;
};
}
mx_internal function get isEnabled():Boolean{
return (_isEnabled);
}
private function innerExecute():void{
var value:Object = wrapFunctionCall(document, srcFunc);
if (BindingManager.debugDestinationStrings[destString]){
trace(((("Binding: destString = " + destString) + ", srcFunc result = ") + value));
};
if (((hasHadValue) || (wrappedFunctionSuccessful))){
if (((!((((((lastValue is XML)) && (lastValue.hasComplexContent()))) && ((lastValue === value))))) && (!((((((((lastValue is XMLList)) && (lastValue.hasComplexContent()))) && ((value is XMLList)))) && (nodeSeqEqual((lastValue as XMLList), (value as XMLList)))))))){
destFunc.call(document, value);
lastValue = value;
hasHadValue = true;
};
};
}
}
}//package mx.binding
Section 70
//BindingManager (mx.binding.BindingManager)
package mx.binding {
import mx.core.*;
public class BindingManager {
mx_internal static const VERSION:String = "3.2.0.3958";
static var debugDestinationStrings:Object = {};
public function BindingManager(){
super();
}
public static function executeBindings(document:Object, destStr:String, destObj:Object):void{
var binding:String;
if (((!(destStr)) || ((destStr == "")))){
return;
};
if (((((((document) && ((((document is IBindingClient)) || (document.hasOwnProperty("_bindingsByDestination")))))) && (document._bindingsByDestination))) && (document._bindingsBeginWithWord[getFirstWord(destStr)]))){
for (binding in document._bindingsByDestination) {
if (binding.charAt(0) == destStr.charAt(0)){
if ((((((binding.indexOf((destStr + ".")) == 0)) || ((binding.indexOf((destStr + "[")) == 0)))) || ((binding == destStr)))){
document._bindingsByDestination[binding].execute(destObj);
};
};
};
};
}
public static function addBinding(document:Object, destStr:String, b:Binding):void{
if (!document._bindingsByDestination){
document._bindingsByDestination = {};
document._bindingsBeginWithWord = {};
};
document._bindingsByDestination[destStr] = b;
document._bindingsBeginWithWord[getFirstWord(destStr)] = true;
}
public static function debugBinding(destinationString:String):void{
debugDestinationStrings[destinationString] = true;
}
private static function getFirstWord(destStr:String):String{
var indexPeriod:int = destStr.indexOf(".");
var indexBracket:int = destStr.indexOf("[");
if (indexPeriod == indexBracket){
return (destStr);
};
var minIndex:int = Math.min(indexPeriod, indexBracket);
if (minIndex == -1){
minIndex = Math.max(indexPeriod, indexBracket);
};
return (destStr.substr(0, minIndex));
}
public static function setEnabled(document:Object, isEnabled:Boolean):void{
var bindings:Array;
var i:uint;
var binding:Binding;
if ((((document is IBindingClient)) && (document._bindings))){
bindings = (document._bindings as Array);
i = 0;
while (i < bindings.length) {
binding = bindings[i];
binding.isEnabled = isEnabled;
i++;
};
};
}
}
}//package mx.binding
Section 71
//EvalBindingResponder (mx.binding.EvalBindingResponder)
package mx.binding {
import mx.core.*;
import mx.rpc.*;
public class EvalBindingResponder implements IResponder {
private var binding:Binding;
private var object:Object;
mx_internal static const VERSION:String = "3.2.0.3958";
public function EvalBindingResponder(binding:Binding, object:Object){
super();
this.binding = binding;
this.object = object;
}
public function fault(data:Object):void{
}
public function result(data:Object):void{
binding.execute(object);
}
}
}//package mx.binding
Section 72
//IBindingClient (mx.binding.IBindingClient)
package mx.binding {
public interface IBindingClient {
}
}//package mx.binding
Section 73
//ItemPendingError (mx.collections.errors.ItemPendingError)
package mx.collections.errors {
import mx.core.*;
import mx.rpc.*;
public class ItemPendingError extends Error {
private var _responders:Array;
mx_internal static const VERSION:String = "3.2.0.3958";
public function ItemPendingError(message:String){
super(message);
}
public function get responders():Array{
return (_responders);
}
public function addResponder(responder:IResponder):void{
if (!_responders){
_responders = [];
};
_responders.push(responder);
}
}
}//package mx.collections.errors
Section 74
//ConstraintError (mx.containers.errors.ConstraintError)
package mx.containers.errors {
public class ConstraintError extends Error {
mx_internal static const VERSION:String = "3.2.0.3958";
public function ConstraintError(message:String){
super(message);
}
}
}//package mx.containers.errors
Section 75
//ApplicationLayout (mx.containers.utilityClasses.ApplicationLayout)
package mx.containers.utilityClasses {
import mx.core.*;
public class ApplicationLayout extends BoxLayout {
mx_internal static const VERSION:String = "3.2.0.3958";
public function ApplicationLayout(){
super();
}
override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
var paddingLeft:Number;
var paddingTop:Number;
var oX:Number;
var oY:Number;
var n:int;
var i:int;
var child:IFlexDisplayObject;
super.updateDisplayList(unscaledWidth, unscaledHeight);
var target:Container = super.target;
if (((((target.horizontalScrollBar) && ((getHorizontalAlignValue() > 0)))) || (((target.verticalScrollBar) && ((getVerticalAlignValue() > 0)))))){
paddingLeft = target.getStyle("paddingLeft");
paddingTop = target.getStyle("paddingTop");
oX = 0;
oY = 0;
n = target.numChildren;
i = 0;
while (i < n) {
child = IFlexDisplayObject(target.getChildAt(i));
if (child.x < paddingLeft){
oX = Math.max(oX, (paddingLeft - child.x));
};
if (child.y < paddingTop){
oY = Math.max(oY, (paddingTop - child.y));
};
i++;
};
if (((!((oX == 0))) || (!((oY == 0))))){
i = 0;
while (i < n) {
child = IFlexDisplayObject(target.getChildAt(i));
child.move((child.x + oX), (child.y + oY));
i++;
};
};
};
}
}
}//package mx.containers.utilityClasses
Section 76
//BoxLayout (mx.containers.utilityClasses.BoxLayout)
package mx.containers.utilityClasses {
import mx.core.*;
import mx.controls.scrollClasses.*;
import mx.containers.*;
public class BoxLayout extends Layout {
public var direction:String;// = "vertical"
mx_internal static const VERSION:String = "3.2.0.3958";
public function BoxLayout(){
super();
}
private function isVertical():Boolean{
return (!((direction == BoxDirection.HORIZONTAL)));
}
mx_internal function getHorizontalAlignValue():Number{
var horizontalAlign:String = target.getStyle("horizontalAlign");
if (horizontalAlign == "center"){
return (0.5);
};
if (horizontalAlign == "right"){
return (1);
};
return (0);
}
override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
var gap:Number;
var numChildrenWithOwnSpace:int;
var excessSpace:Number;
var top:Number;
var left:Number;
var i:int;
var obj:IUIComponent;
var child:IUIComponent;
var percentWidth:Number;
var percentHeight:Number;
var width:Number;
var height:Number;
var target:Container = super.target;
var n:int = target.numChildren;
if (n == 0){
return;
};
var vm:EdgeMetrics = target.viewMetricsAndPadding;
var paddingLeft:Number = target.getStyle("paddingLeft");
var paddingTop:Number = target.getStyle("paddingTop");
var horizontalAlign:Number = getHorizontalAlignValue();
var verticalAlign:Number = getVerticalAlignValue();
var mw:Number = ((((target.scaleX > 0)) && (!((target.scaleX == 1))))) ? (target.minWidth / Math.abs(target.scaleX)) : target.minWidth;
var mh:Number = ((((target.scaleY > 0)) && (!((target.scaleY == 1))))) ? (target.minHeight / Math.abs(target.scaleY)) : target.minHeight;
var w:Number = ((Math.max(unscaledWidth, mw) - vm.right) - vm.left);
var h:Number = ((Math.max(unscaledHeight, mh) - vm.bottom) - vm.top);
var horizontalScrollBar:ScrollBar = target.horizontalScrollBar;
var verticalScrollBar:ScrollBar = target.verticalScrollBar;
if (n == 1){
child = IUIComponent(target.getChildAt(0));
percentWidth = child.percentWidth;
percentHeight = child.percentHeight;
if (percentWidth){
width = Math.max(child.minWidth, Math.min(child.maxWidth, ((percentWidth)>=100) ? w : ((w * percentWidth) / 100)));
} else {
width = child.getExplicitOrMeasuredWidth();
};
if (percentHeight){
height = Math.max(child.minHeight, Math.min(child.maxHeight, ((percentHeight)>=100) ? h : ((h * percentHeight) / 100)));
} else {
height = child.getExplicitOrMeasuredHeight();
};
if ((((child.scaleX == 1)) && ((child.scaleY == 1)))){
child.setActualSize(Math.floor(width), Math.floor(height));
} else {
child.setActualSize(width, height);
};
if (((!((verticalScrollBar == null))) && ((target.verticalScrollPolicy == ScrollPolicy.AUTO)))){
w = (w + verticalScrollBar.minWidth);
};
if (((!((horizontalScrollBar == null))) && ((target.horizontalScrollPolicy == ScrollPolicy.AUTO)))){
h = (h + horizontalScrollBar.minHeight);
};
left = (((w - child.width) * horizontalAlign) + paddingLeft);
top = (((h - child.height) * verticalAlign) + paddingTop);
child.move(Math.floor(left), Math.floor(top));
} else {
if (isVertical()){
gap = target.getStyle("verticalGap");
numChildrenWithOwnSpace = n;
i = 0;
while (i < n) {
if (!IUIComponent(target.getChildAt(i)).includeInLayout){
numChildrenWithOwnSpace--;
};
i++;
};
excessSpace = Flex.flexChildHeightsProportionally(target, (h - ((numChildrenWithOwnSpace - 1) * gap)), w);
if (((!((horizontalScrollBar == null))) && ((target.horizontalScrollPolicy == ScrollPolicy.AUTO)))){
excessSpace = (excessSpace + horizontalScrollBar.minHeight);
};
if (((!((verticalScrollBar == null))) && ((target.verticalScrollPolicy == ScrollPolicy.AUTO)))){
w = (w + verticalScrollBar.minWidth);
};
top = (paddingTop + (excessSpace * verticalAlign));
i = 0;
while (i < n) {
obj = IUIComponent(target.getChildAt(i));
left = (((w - obj.width) * horizontalAlign) + paddingLeft);
obj.move(Math.floor(left), Math.floor(top));
if (obj.includeInLayout){
top = (top + (obj.height + gap));
};
i++;
};
} else {
gap = target.getStyle("horizontalGap");
numChildrenWithOwnSpace = n;
i = 0;
while (i < n) {
if (!IUIComponent(target.getChildAt(i)).includeInLayout){
numChildrenWithOwnSpace--;
};
i++;
};
excessSpace = Flex.flexChildWidthsProportionally(target, (w - ((numChildrenWithOwnSpace - 1) * gap)), h);
if (((!((horizontalScrollBar == null))) && ((target.horizontalScrollPolicy == ScrollPolicy.AUTO)))){
h = (h + horizontalScrollBar.minHeight);
};
if (((!((verticalScrollBar == null))) && ((target.verticalScrollPolicy == ScrollPolicy.AUTO)))){
excessSpace = (excessSpace + verticalScrollBar.minWidth);
};
left = (paddingLeft + (excessSpace * horizontalAlign));
i = 0;
while (i < n) {
obj = IUIComponent(target.getChildAt(i));
top = (((h - obj.height) * verticalAlign) + paddingTop);
obj.move(Math.floor(left), Math.floor(top));
if (obj.includeInLayout){
left = (left + (obj.width + gap));
};
i++;
};
};
};
}
mx_internal function getVerticalAlignValue():Number{
var verticalAlign:String = target.getStyle("verticalAlign");
if (verticalAlign == "middle"){
return (0.5);
};
if (verticalAlign == "bottom"){
return (1);
};
return (0);
}
mx_internal function heightPadding(numChildren:Number):Number{
var vm:EdgeMetrics = target.viewMetricsAndPadding;
var padding:Number = (vm.top + vm.bottom);
if ((((numChildren > 1)) && (isVertical()))){
padding = (padding + (target.getStyle("verticalGap") * (numChildren - 1)));
};
return (padding);
}
mx_internal function widthPadding(numChildren:Number):Number{
var vm:EdgeMetrics = target.viewMetricsAndPadding;
var padding:Number = (vm.left + vm.right);
if ((((numChildren > 1)) && ((isVertical() == false)))){
padding = (padding + (target.getStyle("horizontalGap") * (numChildren - 1)));
};
return (padding);
}
override public function measure():void{
var target:Container;
var wPadding:Number;
var hPadding:Number;
var child:IUIComponent;
var wPref:Number;
var hPref:Number;
target = super.target;
var isVertical:Boolean = isVertical();
var minWidth:Number = 0;
var minHeight:Number = 0;
var preferredWidth:Number = 0;
var preferredHeight:Number = 0;
var n:int = target.numChildren;
var numChildrenWithOwnSpace:int = n;
var i:int;
while (i < n) {
child = IUIComponent(target.getChildAt(i));
if (!child.includeInLayout){
numChildrenWithOwnSpace--;
} else {
wPref = child.getExplicitOrMeasuredWidth();
hPref = child.getExplicitOrMeasuredHeight();
if (isVertical){
minWidth = Math.max((isNaN(child.percentWidth)) ? wPref : child.minWidth, minWidth);
preferredWidth = Math.max(wPref, preferredWidth);
minHeight = (minHeight + (isNaN(child.percentHeight)) ? hPref : child.minHeight);
preferredHeight = (preferredHeight + hPref);
} else {
minWidth = (minWidth + (isNaN(child.percentWidth)) ? wPref : child.minWidth);
preferredWidth = (preferredWidth + wPref);
minHeight = Math.max((isNaN(child.percentHeight)) ? hPref : child.minHeight, minHeight);
preferredHeight = Math.max(hPref, preferredHeight);
};
};
i++;
};
wPadding = widthPadding(numChildrenWithOwnSpace);
hPadding = heightPadding(numChildrenWithOwnSpace);
target.measuredMinWidth = (minWidth + wPadding);
target.measuredMinHeight = (minHeight + hPadding);
target.measuredWidth = (preferredWidth + wPadding);
target.measuredHeight = (preferredHeight + hPadding);
}
}
}//package mx.containers.utilityClasses
Section 77
//CanvasLayout (mx.containers.utilityClasses.CanvasLayout)
package mx.containers.utilityClasses {
import flash.display.*;
import mx.core.*;
import flash.geom.*;
import mx.events.*;
import flash.utils.*;
import mx.containers.errors.*;
public class CanvasLayout extends Layout {
private var colSpanChildren:Array;
private var constraintRegionsInUse:Boolean;// = false
private var rowSpanChildren:Array;
private var constraintCache:Dictionary;
private var _contentArea:Rectangle;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var r:Rectangle = new Rectangle();
public function CanvasLayout(){
colSpanChildren = [];
rowSpanChildren = [];
constraintCache = new Dictionary(true);
super();
}
private function parseConstraints(child:IUIComponent=null):ChildConstraintInfo{
var left:Number;
var right:Number;
var horizontalCenter:Number;
var top:Number;
var bottom:Number;
var verticalCenter:Number;
var baseline:Number;
var leftBoundary:String;
var rightBoundary:String;
var hcBoundary:String;
var topBoundary:String;
var bottomBoundary:String;
var vcBoundary:String;
var baselineBoundary:String;
var temp:Array;
var i:int;
var col:ConstraintColumn;
var found:Boolean;
var row:ConstraintRow;
var constraints:LayoutConstraints = getLayoutConstraints(child);
if (!constraints){
return (null);
};
while (true) {
temp = parseConstraintExp(constraints.left);
if (!temp){
left = NaN;
} else {
if (temp.length == 1){
left = Number(temp[0]);
} else {
leftBoundary = temp[0];
left = temp[1];
};
};
temp = parseConstraintExp(constraints.right);
if (!temp){
right = NaN;
} else {
if (temp.length == 1){
right = Number(temp[0]);
} else {
rightBoundary = temp[0];
right = temp[1];
};
};
temp = parseConstraintExp(constraints.horizontalCenter);
if (!temp){
horizontalCenter = NaN;
} else {
if (temp.length == 1){
horizontalCenter = Number(temp[0]);
} else {
hcBoundary = temp[0];
horizontalCenter = temp[1];
};
};
temp = parseConstraintExp(constraints.top);
if (!temp){
top = NaN;
} else {
if (temp.length == 1){
top = Number(temp[0]);
} else {
topBoundary = temp[0];
top = temp[1];
};
};
temp = parseConstraintExp(constraints.bottom);
if (!temp){
bottom = NaN;
} else {
if (temp.length == 1){
bottom = Number(temp[0]);
} else {
bottomBoundary = temp[0];
bottom = temp[1];
};
};
temp = parseConstraintExp(constraints.verticalCenter);
if (!temp){
verticalCenter = NaN;
} else {
if (temp.length == 1){
verticalCenter = Number(temp[0]);
} else {
vcBoundary = temp[0];
verticalCenter = temp[1];
};
};
temp = parseConstraintExp(constraints.baseline);
if (!temp){
baseline = NaN;
} else {
if (temp.length == 1){
baseline = Number(temp[0]);
} else {
baselineBoundary = temp[0];
baseline = temp[1];
};
};
break;
};
var colEntry:ContentColumnChild = new ContentColumnChild();
var pushEntry:Boolean;
var leftIndex:Number = 0;
var rightIndex:Number = 0;
var hcIndex:Number = 0;
i = 0;
while (i < IConstraintLayout(target).constraintColumns.length) {
col = IConstraintLayout(target).constraintColumns[i];
if (col.mx_internal::contentSize){
if (col.id == leftBoundary){
colEntry.leftCol = col;
colEntry.leftOffset = left;
leftIndex = i;
colEntry.left = leftIndex;
pushEntry = true;
};
if (col.id == rightBoundary){
colEntry.rightCol = col;
colEntry.rightOffset = right;
rightIndex = (i + 1);
colEntry.right = rightIndex;
pushEntry = true;
};
if (col.id == hcBoundary){
colEntry.hcCol = col;
colEntry.hcOffset = horizontalCenter;
hcIndex = (i + 1);
colEntry.hc = hcIndex;
pushEntry = true;
};
};
i++;
};
if (pushEntry){
colEntry.child = child;
if (((((((colEntry.leftCol) && (!(colEntry.rightCol)))) || (((colEntry.rightCol) && (!(colEntry.leftCol)))))) || (colEntry.hcCol))){
colEntry.span = 1;
} else {
colEntry.span = (rightIndex - leftIndex);
};
found = false;
i = 0;
while (i < colSpanChildren.length) {
if (colEntry.child == colSpanChildren[i].child){
found = true;
break;
};
i++;
};
if (!found){
colSpanChildren.push(colEntry);
};
};
pushEntry = false;
var rowEntry:ContentRowChild = new ContentRowChild();
var topIndex:Number = 0;
var bottomIndex:Number = 0;
var vcIndex:Number = 0;
var baselineIndex:Number = 0;
i = 0;
while (i < IConstraintLayout(target).constraintRows.length) {
row = IConstraintLayout(target).constraintRows[i];
if (row.mx_internal::contentSize){
if (row.id == topBoundary){
rowEntry.topRow = row;
rowEntry.topOffset = top;
topIndex = i;
rowEntry.top = topIndex;
pushEntry = true;
};
if (row.id == bottomBoundary){
rowEntry.bottomRow = row;
rowEntry.bottomOffset = bottom;
bottomIndex = (i + 1);
rowEntry.bottom = bottomIndex;
pushEntry = true;
};
if (row.id == vcBoundary){
rowEntry.vcRow = row;
rowEntry.vcOffset = verticalCenter;
vcIndex = (i + 1);
rowEntry.vc = vcIndex;
pushEntry = true;
};
if (row.id == baselineBoundary){
rowEntry.baselineRow = row;
rowEntry.baselineOffset = baseline;
baselineIndex = (i + 1);
rowEntry.baseline = baselineIndex;
pushEntry = true;
};
};
i++;
};
if (pushEntry){
rowEntry.child = child;
if (((((((((rowEntry.topRow) && (!(rowEntry.bottomRow)))) || (((rowEntry.bottomRow) && (!(rowEntry.topRow)))))) || (rowEntry.vcRow))) || (rowEntry.baselineRow))){
rowEntry.span = 1;
} else {
rowEntry.span = (bottomIndex - topIndex);
};
found = false;
i = 0;
while (i < rowSpanChildren.length) {
if (rowEntry.child == rowSpanChildren[i].child){
found = true;
break;
};
i++;
};
if (!found){
rowSpanChildren.push(rowEntry);
};
};
var info:ChildConstraintInfo = new ChildConstraintInfo(left, right, horizontalCenter, top, bottom, verticalCenter, baseline, leftBoundary, rightBoundary, hcBoundary, topBoundary, bottomBoundary, vcBoundary, baselineBoundary);
constraintCache[child] = info;
return (info);
}
private function bound(a:Number, min:Number, max:Number):Number{
if (a < min){
a = min;
} else {
if (a > max){
a = max;
} else {
a = Math.floor(a);
};
};
return (a);
}
private function shareRowSpace(entry:ContentRowChild, availableHeight:Number):Number{
var tempTopHeight:Number;
var tempBtmHeight:Number;
var share:Number;
var topRow:ConstraintRow = entry.topRow;
var bottomRow:ConstraintRow = entry.bottomRow;
var child:IUIComponent = entry.child;
var topHeight:Number = 0;
var bottomHeight:Number = 0;
var top:Number = (entry.topOffset) ? entry.topOffset : 0;
var bottom:Number = (entry.bottomOffset) ? entry.bottomOffset : 0;
if (((topRow) && (topRow.height))){
topHeight = (topHeight + topRow.height);
} else {
if (((bottomRow) && (!(topRow)))){
topRow = IConstraintLayout(target).constraintRows[(entry.bottom - 2)];
if (((topRow) && (topRow.height))){
topHeight = (topHeight + topRow.height);
};
};
};
if (((bottomRow) && (bottomRow.height))){
bottomHeight = (bottomHeight + bottomRow.height);
} else {
if (((topRow) && (!(bottomRow)))){
bottomRow = IConstraintLayout(target).constraintRows[(entry.top + 1)];
if (((bottomRow) && (bottomRow.height))){
bottomHeight = (bottomHeight + bottomRow.height);
};
};
};
if (((topRow) && (isNaN(topRow.height)))){
topRow.setActualHeight(Math.max(0, topRow.maxHeight));
};
if (((bottomRow) && (isNaN(bottomRow.height)))){
bottomRow.setActualHeight(Math.max(0, bottomRow.height));
};
var childHeight:Number = child.getExplicitOrMeasuredHeight();
if (childHeight){
if (!entry.topRow){
if (childHeight > topHeight){
tempBtmHeight = ((childHeight - topHeight) + bottom);
} else {
tempBtmHeight = (childHeight + bottom);
};
};
if (!entry.bottomRow){
if (childHeight > bottomHeight){
tempTopHeight = ((childHeight - bottomHeight) + top);
} else {
tempTopHeight = (childHeight + top);
};
};
if (((entry.topRow) && (entry.bottomRow))){
share = (childHeight / Number(entry.span));
if ((share + top) < topHeight){
tempTopHeight = topHeight;
tempBtmHeight = ((childHeight - (topHeight - top)) + bottom);
} else {
tempTopHeight = (share + top);
};
if ((share + bottom) < bottomHeight){
tempBtmHeight = bottomHeight;
tempTopHeight = ((childHeight - (bottomHeight - bottom)) + top);
} else {
tempBtmHeight = (share + bottom);
};
};
tempBtmHeight = bound(tempBtmHeight, bottomRow.minHeight, bottomRow.maxHeight);
bottomRow.setActualHeight(tempBtmHeight);
availableHeight = (availableHeight - tempBtmHeight);
tempTopHeight = bound(tempTopHeight, topRow.minHeight, topRow.maxHeight);
topRow.setActualHeight(tempTopHeight);
availableHeight = (availableHeight - tempTopHeight);
};
return (availableHeight);
}
private function parseConstraintExp(val:String):Array{
if (!val){
return (null);
};
var temp:String = val.replace(/:/g, " ");
var args:Array = temp.split(/\s+/);
return (args);
}
private function measureColumnsAndRows():void{
var i:int;
var k:int;
var cc:ConstraintColumn;
var cr:ConstraintRow;
var spaceToDistribute:Number;
var w:Number;
var h:Number;
var remainingSpace:Number;
var colEntry:ContentColumnChild;
var rowEntry:ContentRowChild;
var cols:Array = IConstraintLayout(target).constraintColumns;
var rows:Array = IConstraintLayout(target).constraintRows;
if ((((!(rows.length) > 0)) && ((!(cols.length) > 0)))){
constraintRegionsInUse = false;
return;
};
constraintRegionsInUse = true;
var canvasX:Number = 0;
var canvasY:Number = 0;
var vm:EdgeMetrics = Container(target).viewMetrics;
var availableWidth:Number = ((Container(target).width - vm.left) - vm.right);
var availableHeight:Number = ((Container(target).height - vm.top) - vm.bottom);
var fixedSize:Array = [];
var percentageSize:Array = [];
var contentSize:Array = [];
if (cols.length > 0){
i = 0;
while (i < cols.length) {
cc = cols[i];
if (!isNaN(cc.percentWidth)){
percentageSize.push(cc);
} else {
if (((!(isNaN(cc.width))) && (!(cc.mx_internal::contentSize)))){
fixedSize.push(cc);
} else {
contentSize.push(cc);
cc.mx_internal::contentSize = true;
};
};
i++;
};
i = 0;
while (i < fixedSize.length) {
cc = ConstraintColumn(fixedSize[i]);
availableWidth = (availableWidth - cc.width);
i++;
};
if (contentSize.length > 0){
if (colSpanChildren.length > 0){
colSpanChildren.sortOn("span");
k = 0;
while (k < colSpanChildren.length) {
colEntry = colSpanChildren[k];
if (colEntry.span == 1){
if (colEntry.hcCol){
cc = ConstraintColumn(cols[cols.indexOf(colEntry.hcCol)]);
} else {
if (colEntry.leftCol){
cc = ConstraintColumn(cols[cols.indexOf(colEntry.leftCol)]);
} else {
if (colEntry.rightCol){
cc = ConstraintColumn(cols[cols.indexOf(colEntry.rightCol)]);
};
};
};
w = colEntry.child.getExplicitOrMeasuredWidth();
if (colEntry.hcOffset){
w = (w + colEntry.hcOffset);
} else {
if (colEntry.leftOffset){
w = (w + colEntry.leftOffset);
};
if (colEntry.rightOffset){
w = (w + colEntry.rightOffset);
};
};
if (!isNaN(cc.width)){
w = Math.max(cc.width, w);
};
w = bound(w, cc.minWidth, cc.maxWidth);
cc.setActualWidth(w);
availableWidth = (availableWidth - cc.width);
} else {
availableWidth = shareColumnSpace(colEntry, availableWidth);
};
k++;
};
colSpanChildren = [];
};
i = 0;
while (i < contentSize.length) {
cc = contentSize[i];
if (!cc.width){
w = bound(0, cc.minWidth, 0);
cc.setActualWidth(w);
};
i++;
};
};
remainingSpace = availableWidth;
i = 0;
while (i < percentageSize.length) {
cc = ConstraintColumn(percentageSize[i]);
if (remainingSpace <= 0){
w = 0;
} else {
w = Math.round(((remainingSpace * cc.percentWidth) / 100));
};
w = bound(w, cc.minWidth, cc.maxWidth);
cc.setActualWidth(w);
availableWidth = (availableWidth - w);
i++;
};
i = 0;
while (i < cols.length) {
cc = ConstraintColumn(cols[i]);
cc.x = canvasX;
canvasX = (canvasX + cc.width);
i++;
};
};
fixedSize = [];
percentageSize = [];
contentSize = [];
if (rows.length > 0){
i = 0;
while (i < rows.length) {
cr = rows[i];
if (!isNaN(cr.percentHeight)){
percentageSize.push(cr);
} else {
if (((!(isNaN(cr.height))) && (!(cr.mx_internal::contentSize)))){
fixedSize.push(cr);
} else {
contentSize.push(cr);
cr.mx_internal::contentSize = true;
};
};
i++;
};
i = 0;
while (i < fixedSize.length) {
cr = ConstraintRow(fixedSize[i]);
availableHeight = (availableHeight - cr.height);
i++;
};
if (contentSize.length > 0){
if (rowSpanChildren.length > 0){
rowSpanChildren.sortOn("span");
k = 0;
while (k < rowSpanChildren.length) {
rowEntry = rowSpanChildren[k];
if (rowEntry.span == 1){
if (rowEntry.vcRow){
cr = ConstraintRow(rows[rows.indexOf(rowEntry.vcRow)]);
} else {
if (rowEntry.baselineRow){
cr = ConstraintRow(rows[rows.indexOf(rowEntry.baselineRow)]);
} else {
if (rowEntry.topRow){
cr = ConstraintRow(rows[rows.indexOf(rowEntry.topRow)]);
} else {
if (rowEntry.bottomRow){
cr = ConstraintRow(rows[rows.indexOf(rowEntry.bottomRow)]);
};
};
};
};
h = rowEntry.child.getExplicitOrMeasuredHeight();
if (rowEntry.baselineOffset){
h = (h + rowEntry.baselineOffset);
} else {
if (rowEntry.vcOffset){
h = (h + rowEntry.vcOffset);
} else {
if (rowEntry.topOffset){
h = (h + rowEntry.topOffset);
};
if (rowEntry.bottomOffset){
h = (h + rowEntry.bottomOffset);
};
};
};
if (!isNaN(cr.height)){
h = Math.max(cr.height, h);
};
h = bound(h, cr.minHeight, cr.maxHeight);
cr.setActualHeight(h);
availableHeight = (availableHeight - cr.height);
} else {
availableHeight = shareRowSpace(rowEntry, availableHeight);
};
k++;
};
rowSpanChildren = [];
};
i = 0;
while (i < contentSize.length) {
cr = ConstraintRow(contentSize[i]);
if (!cr.height){
h = bound(0, cr.minHeight, 0);
cr.setActualHeight(h);
};
i++;
};
};
remainingSpace = availableHeight;
i = 0;
while (i < percentageSize.length) {
cr = ConstraintRow(percentageSize[i]);
if (remainingSpace <= 0){
h = 0;
} else {
h = Math.round(((remainingSpace * cr.percentHeight) / 100));
};
h = bound(h, cr.minHeight, cr.maxHeight);
cr.setActualHeight(h);
availableHeight = (availableHeight - h);
i++;
};
i = 0;
while (i < rows.length) {
cr = rows[i];
cr.y = canvasY;
canvasY = (canvasY + cr.height);
i++;
};
};
}
private function child_moveHandler(event:MoveEvent):void{
if ((event.target is IUIComponent)){
if (!IUIComponent(event.target).includeInLayout){
return;
};
};
var target:Container = super.target;
if (target){
target.invalidateSize();
target.invalidateDisplayList();
_contentArea = null;
};
}
private function applyAnchorStylesDuringMeasure(child:IUIComponent, r:Rectangle):void{
var i:int;
var constraintChild:IConstraintClient = (child as IConstraintClient);
if (!constraintChild){
return;
};
var childInfo:ChildConstraintInfo = constraintCache[constraintChild];
if (!childInfo){
childInfo = parseConstraints(child);
};
var left:Number = childInfo.left;
var right:Number = childInfo.right;
var horizontalCenter:Number = childInfo.hc;
var top:Number = childInfo.top;
var bottom:Number = childInfo.bottom;
var verticalCenter:Number = childInfo.vc;
var cols:Array = IConstraintLayout(target).constraintColumns;
var rows:Array = IConstraintLayout(target).constraintRows;
var holder:Number = 0;
if (!(cols.length) > 0){
if (!isNaN(horizontalCenter)){
r.x = Math.round((((target.width - child.width) / 2) + horizontalCenter));
} else {
if (((!(isNaN(left))) && (!(isNaN(right))))){
r.x = left;
r.width = (r.width + right);
} else {
if (!isNaN(left)){
r.x = left;
} else {
if (!isNaN(right)){
r.x = 0;
r.width = (r.width + right);
};
};
};
};
} else {
r.x = 0;
i = 0;
while (i < cols.length) {
holder = (holder + ConstraintColumn(cols[i]).width);
i++;
};
r.width = holder;
};
if (!(rows.length) > 0){
if (!isNaN(verticalCenter)){
r.y = Math.round((((target.height - child.height) / 2) + verticalCenter));
} else {
if (((!(isNaN(top))) && (!(isNaN(bottom))))){
r.y = top;
r.height = (r.height + bottom);
} else {
if (!isNaN(top)){
r.y = top;
} else {
if (!isNaN(bottom)){
r.y = 0;
r.height = (r.height + bottom);
};
};
};
};
} else {
holder = 0;
r.y = 0;
i = 0;
while (i < rows.length) {
holder = (holder + ConstraintRow(rows[i]).height);
i++;
};
r.height = holder;
};
}
override public function measure():void{
var target:Container;
var vm:EdgeMetrics;
var contentArea:Rectangle;
var child:IUIComponent;
var col:ConstraintColumn;
var row:ConstraintRow;
target = super.target;
var w:Number = 0;
var h:Number = 0;
var i:Number = 0;
vm = target.viewMetrics;
i = 0;
while (i < target.numChildren) {
child = (target.getChildAt(i) as IUIComponent);
parseConstraints(child);
i++;
};
i = 0;
while (i < IConstraintLayout(target).constraintColumns.length) {
col = IConstraintLayout(target).constraintColumns[i];
if (col.mx_internal::contentSize){
col.mx_internal::_width = NaN;
};
i++;
};
i = 0;
while (i < IConstraintLayout(target).constraintRows.length) {
row = IConstraintLayout(target).constraintRows[i];
if (row.mx_internal::contentSize){
row.mx_internal::_height = NaN;
};
i++;
};
measureColumnsAndRows();
_contentArea = null;
contentArea = measureContentArea();
target.measuredWidth = ((contentArea.width + vm.left) + vm.right);
target.measuredHeight = ((contentArea.height + vm.top) + vm.bottom);
}
private function target_childRemoveHandler(event:ChildExistenceChangedEvent):void{
DisplayObject(event.relatedObject).removeEventListener(MoveEvent.MOVE, child_moveHandler);
delete constraintCache[event.relatedObject];
}
override public function set target(value:Container):void{
var i:int;
var n:int;
var target:Container = super.target;
if (value != target){
if (target){
target.removeEventListener(ChildExistenceChangedEvent.CHILD_ADD, target_childAddHandler);
target.removeEventListener(ChildExistenceChangedEvent.CHILD_REMOVE, target_childRemoveHandler);
n = target.numChildren;
i = 0;
while (i < n) {
DisplayObject(target.getChildAt(i)).removeEventListener(MoveEvent.MOVE, child_moveHandler);
i++;
};
};
if (value){
value.addEventListener(ChildExistenceChangedEvent.CHILD_ADD, target_childAddHandler);
value.addEventListener(ChildExistenceChangedEvent.CHILD_REMOVE, target_childRemoveHandler);
n = value.numChildren;
i = 0;
while (i < n) {
DisplayObject(value.getChildAt(i)).addEventListener(MoveEvent.MOVE, child_moveHandler);
i++;
};
};
super.target = value;
};
}
private function measureContentArea():Rectangle{
var i:int;
var cols:Array;
var rows:Array;
var child:IUIComponent;
var childConstraints:LayoutConstraints;
var cx:Number;
var cy:Number;
var pw:Number;
var ph:Number;
var rightEdge:Number;
var bottomEdge:Number;
if (_contentArea){
return (_contentArea);
};
_contentArea = new Rectangle();
var n:int = target.numChildren;
if ((((n == 0)) && (constraintRegionsInUse))){
cols = IConstraintLayout(target).constraintColumns;
rows = IConstraintLayout(target).constraintRows;
if (cols.length > 0){
_contentArea.right = (cols[(cols.length - 1)].x + cols[(cols.length - 1)].width);
} else {
_contentArea.right = 0;
};
if (rows.length > 0){
_contentArea.bottom = (rows[(rows.length - 1)].y + rows[(rows.length - 1)].height);
} else {
_contentArea.bottom = 0;
};
};
i = 0;
while (i < n) {
child = (target.getChildAt(i) as IUIComponent);
childConstraints = getLayoutConstraints(child);
if (!child.includeInLayout){
} else {
cx = child.x;
cy = child.y;
pw = child.getExplicitOrMeasuredWidth();
ph = child.getExplicitOrMeasuredHeight();
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
if (((!(isNaN(child.percentWidth))) || (((((childConstraints) && (!(isNaN(childConstraints.left))))) && (!(isNaN(childConstraints.right))))))){
pw = child.minWidth;
};
} else {
if (((!(isNaN(child.percentWidth))) || (((((((childConstraints) && (!(isNaN(childConstraints.left))))) && (!(isNaN(childConstraints.right))))) && (isNaN(child.explicitWidth)))))){
pw = child.minWidth;
};
};
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
if (((!(isNaN(child.percentHeight))) || (((((childConstraints) && (!(isNaN(childConstraints.top))))) && (!(isNaN(childConstraints.bottom))))))){
ph = child.minHeight;
};
} else {
if (((!(isNaN(child.percentHeight))) || (((((((childConstraints) && (!(isNaN(childConstraints.top))))) && (!(isNaN(childConstraints.bottom))))) && (isNaN(child.explicitHeight)))))){
ph = child.minHeight;
};
};
r.x = cx;
r.y = cy;
r.width = pw;
r.height = ph;
applyAnchorStylesDuringMeasure(child, r);
cx = r.x;
cy = r.y;
pw = r.width;
ph = r.height;
if (isNaN(cx)){
cx = child.x;
};
if (isNaN(cy)){
cy = child.y;
};
rightEdge = cx;
bottomEdge = cy;
if (isNaN(pw)){
pw = child.width;
};
if (isNaN(ph)){
ph = child.height;
};
rightEdge = (rightEdge + pw);
bottomEdge = (bottomEdge + ph);
_contentArea.right = Math.max(_contentArea.right, rightEdge);
_contentArea.bottom = Math.max(_contentArea.bottom, bottomEdge);
};
i++;
};
return (_contentArea);
}
private function shareColumnSpace(entry:ContentColumnChild, availableWidth:Number):Number{
var tempLeftWidth:Number;
var tempRightWidth:Number;
var share:Number;
var leftCol:ConstraintColumn = entry.leftCol;
var rightCol:ConstraintColumn = entry.rightCol;
var child:IUIComponent = entry.child;
var leftWidth:Number = 0;
var rightWidth:Number = 0;
var right:Number = (entry.rightOffset) ? entry.rightOffset : 0;
var left:Number = (entry.leftOffset) ? entry.leftOffset : 0;
if (((leftCol) && (leftCol.width))){
leftWidth = (leftWidth + leftCol.width);
} else {
if (((rightCol) && (!(leftCol)))){
leftCol = IConstraintLayout(target).constraintColumns[(entry.right - 2)];
if (((leftCol) && (leftCol.width))){
leftWidth = (leftWidth + leftCol.width);
};
};
};
if (((rightCol) && (rightCol.width))){
rightWidth = (rightWidth + rightCol.width);
} else {
if (((leftCol) && (!(rightCol)))){
rightCol = IConstraintLayout(target).constraintColumns[(entry.left + 1)];
if (((rightCol) && (rightCol.width))){
rightWidth = (rightWidth + rightCol.width);
};
};
};
if (((leftCol) && (isNaN(leftCol.width)))){
leftCol.setActualWidth(Math.max(0, leftCol.maxWidth));
};
if (((rightCol) && (isNaN(rightCol.width)))){
rightCol.setActualWidth(Math.max(0, rightCol.maxWidth));
};
var childWidth:Number = child.getExplicitOrMeasuredWidth();
if (childWidth){
if (!entry.leftCol){
if (childWidth > leftWidth){
tempRightWidth = ((childWidth - leftWidth) + right);
} else {
tempRightWidth = (childWidth + right);
};
};
if (!entry.rightCol){
if (childWidth > rightWidth){
tempLeftWidth = ((childWidth - rightWidth) + left);
} else {
tempLeftWidth = (childWidth + left);
};
};
if (((entry.leftCol) && (entry.rightCol))){
share = (childWidth / Number(entry.span));
if ((share + left) < leftWidth){
tempLeftWidth = leftWidth;
tempRightWidth = ((childWidth - (leftWidth - left)) + right);
} else {
tempLeftWidth = (share + left);
};
if ((share + right) < rightWidth){
tempRightWidth = rightWidth;
tempLeftWidth = ((childWidth - (rightWidth - right)) + left);
} else {
tempRightWidth = (share + right);
};
};
tempLeftWidth = bound(tempLeftWidth, leftCol.minWidth, leftCol.maxWidth);
leftCol.setActualWidth(tempLeftWidth);
availableWidth = (availableWidth - tempLeftWidth);
tempRightWidth = bound(tempRightWidth, rightCol.minWidth, rightCol.maxWidth);
rightCol.setActualWidth(tempRightWidth);
availableWidth = (availableWidth - tempRightWidth);
};
return (availableWidth);
}
private function getLayoutConstraints(child:IUIComponent):LayoutConstraints{
var constraintChild:IConstraintClient = (child as IConstraintClient);
if (!constraintChild){
return (null);
};
var constraints:LayoutConstraints = new LayoutConstraints();
constraints.baseline = constraintChild.getConstraintValue("baseline");
constraints.bottom = constraintChild.getConstraintValue("bottom");
constraints.horizontalCenter = constraintChild.getConstraintValue("horizontalCenter");
constraints.left = constraintChild.getConstraintValue("left");
constraints.right = constraintChild.getConstraintValue("right");
constraints.top = constraintChild.getConstraintValue("top");
constraints.verticalCenter = constraintChild.getConstraintValue("verticalCenter");
return (constraints);
}
override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
var i:int;
var child:IUIComponent;
var col:ConstraintColumn;
var row:ConstraintRow;
var target:Container = super.target;
var n:int = target.numChildren;
target.mx_internal::doingLayout = false;
var vm:EdgeMetrics = target.viewMetrics;
target.mx_internal::doingLayout = true;
var viewableWidth:Number = ((unscaledWidth - vm.left) - vm.right);
var viewableHeight:Number = ((unscaledHeight - vm.top) - vm.bottom);
if ((((IConstraintLayout(target).constraintColumns.length > 0)) || ((IConstraintLayout(target).constraintRows.length > 0)))){
constraintRegionsInUse = true;
};
if (constraintRegionsInUse){
i = 0;
while (i < n) {
child = (target.getChildAt(i) as IUIComponent);
parseConstraints(child);
i++;
};
i = 0;
while (i < IConstraintLayout(target).constraintColumns.length) {
col = IConstraintLayout(target).constraintColumns[i];
if (col.mx_internal::contentSize){
col.mx_internal::_width = NaN;
};
i++;
};
i = 0;
while (i < IConstraintLayout(target).constraintRows.length) {
row = IConstraintLayout(target).constraintRows[i];
if (row.mx_internal::contentSize){
row.mx_internal::_height = NaN;
};
i++;
};
measureColumnsAndRows();
};
i = 0;
while (i < n) {
child = (target.getChildAt(i) as IUIComponent);
applyAnchorStylesDuringUpdateDisplayList(viewableWidth, viewableHeight, child);
i++;
};
}
private function applyAnchorStylesDuringUpdateDisplayList(availableWidth:Number, availableHeight:Number, child:IUIComponent=null):void{
var i:int;
var w:Number;
var h:Number;
var x:Number;
var y:Number;
var message:String;
var vcHolder:Number;
var hcHolder:Number;
var vcY:Number;
var hcX:Number;
var baselineY:Number;
var matchLeft:Boolean;
var matchRight:Boolean;
var matchHC:Boolean;
var col:ConstraintColumn;
var matchTop:Boolean;
var matchBottom:Boolean;
var matchVC:Boolean;
var matchBaseline:Boolean;
var row:ConstraintRow;
var constraintChild:IConstraintClient = (child as IConstraintClient);
if (!constraintChild){
return;
};
var childInfo:ChildConstraintInfo = parseConstraints(child);
var left:Number = childInfo.left;
var right:Number = childInfo.right;
var horizontalCenter:Number = childInfo.hc;
var top:Number = childInfo.top;
var bottom:Number = childInfo.bottom;
var verticalCenter:Number = childInfo.vc;
var baseline:Number = childInfo.baseline;
var leftBoundary:String = childInfo.leftBoundary;
var rightBoundary:String = childInfo.rightBoundary;
var hcBoundary:String = childInfo.hcBoundary;
var topBoundary:String = childInfo.topBoundary;
var bottomBoundary:String = childInfo.bottomBoundary;
var vcBoundary:String = childInfo.vcBoundary;
var baselineBoundary:String = childInfo.baselineBoundary;
var checkWidth:Boolean;
var checkHeight:Boolean;
var parentBoundariesLR:Boolean = ((((!(hcBoundary)) && (!(leftBoundary)))) && (!(rightBoundary)));
var parentBoundariesTB:Boolean = ((((((!(vcBoundary)) && (!(topBoundary)))) && (!(bottomBoundary)))) && (!(baselineBoundary)));
var leftHolder:Number = 0;
var rightHolder:Number = availableWidth;
var topHolder:Number = 0;
var bottomHolder:Number = availableHeight;
if (!parentBoundariesLR){
matchLeft = (leftBoundary) ? true : false;
matchRight = (rightBoundary) ? true : false;
matchHC = (hcBoundary) ? true : false;
i = 0;
while (i < IConstraintLayout(target).constraintColumns.length) {
col = ConstraintColumn(IConstraintLayout(target).constraintColumns[i]);
if (matchLeft){
if (leftBoundary == col.id){
leftHolder = col.x;
matchLeft = false;
};
};
if (matchRight){
if (rightBoundary == col.id){
rightHolder = (col.x + col.width);
matchRight = false;
};
};
if (matchHC){
if (hcBoundary == col.id){
hcHolder = col.width;
hcX = col.x;
matchHC = false;
};
};
i++;
};
if (matchLeft){
message = resourceManager.getString("containers", "columnNotFound", [leftBoundary]);
throw (new ConstraintError(message));
};
if (matchRight){
message = resourceManager.getString("containers", "columnNotFound", [rightBoundary]);
throw (new ConstraintError(message));
};
if (matchHC){
message = resourceManager.getString("containers", "columnNotFound", [hcBoundary]);
throw (new ConstraintError(message));
};
} else {
if (!parentBoundariesLR){
message = resourceManager.getString("containers", "noColumnsFound");
throw (new ConstraintError(message));
};
};
availableWidth = Math.round((rightHolder - leftHolder));
if (((!(isNaN(left))) && (!(isNaN(right))))){
w = ((availableWidth - left) - right);
if (w < child.minWidth){
w = child.minWidth;
};
} else {
if (!isNaN(child.percentWidth)){
w = ((child.percentWidth / 100) * availableWidth);
w = bound(w, child.minWidth, child.maxWidth);
checkWidth = true;
} else {
w = child.getExplicitOrMeasuredWidth();
};
};
if (((!(parentBoundariesTB)) && ((IConstraintLayout(target).constraintRows.length > 0)))){
matchTop = (topBoundary) ? true : false;
matchBottom = (bottomBoundary) ? true : false;
matchVC = (vcBoundary) ? true : false;
matchBaseline = (baselineBoundary) ? true : false;
i = 0;
while (i < IConstraintLayout(target).constraintRows.length) {
row = ConstraintRow(IConstraintLayout(target).constraintRows[i]);
if (matchTop){
if (topBoundary == row.id){
topHolder = row.y;
matchTop = false;
};
};
if (matchBottom){
if (bottomBoundary == row.id){
bottomHolder = (row.y + row.height);
matchBottom = false;
};
};
if (matchVC){
if (vcBoundary == row.id){
vcHolder = row.height;
vcY = row.y;
matchVC = false;
};
};
if (matchBaseline){
if (baselineBoundary == row.id){
baselineY = row.y;
matchBaseline = false;
};
};
i++;
};
if (matchTop){
message = resourceManager.getString("containers", "rowNotFound", [topBoundary]);
throw (new ConstraintError(message));
};
if (matchBottom){
message = resourceManager.getString("containers", "rowNotFound", [bottomBoundary]);
throw (new ConstraintError(message));
};
if (matchVC){
message = resourceManager.getString("containers", "rowNotFound", [vcBoundary]);
throw (new ConstraintError(message));
};
if (matchBaseline){
message = resourceManager.getString("containers", "rowNotFound", [baselineBoundary]);
throw (new ConstraintError(message));
};
} else {
if (((!(parentBoundariesTB)) && (!((IConstraintLayout(target).constraintRows.length > 0))))){
message = resourceManager.getString("containers", "noRowsFound");
throw (new ConstraintError(message));
};
};
availableHeight = Math.round((bottomHolder - topHolder));
if (((!(isNaN(top))) && (!(isNaN(bottom))))){
h = ((availableHeight - top) - bottom);
if (h < child.minHeight){
h = child.minHeight;
};
} else {
if (!isNaN(child.percentHeight)){
h = ((child.percentHeight / 100) * availableHeight);
h = bound(h, child.minHeight, child.maxHeight);
checkHeight = true;
} else {
h = child.getExplicitOrMeasuredHeight();
};
};
if (!isNaN(horizontalCenter)){
if (hcBoundary){
x = Math.round(((((hcHolder - w) / 2) + horizontalCenter) + hcX));
} else {
x = Math.round((((availableWidth - w) / 2) + horizontalCenter));
};
} else {
if (!isNaN(left)){
if (leftBoundary){
x = (leftHolder + left);
} else {
x = left;
};
} else {
if (!isNaN(right)){
if (rightBoundary){
x = ((rightHolder - right) - w);
} else {
x = ((availableWidth - right) - w);
};
};
};
};
if (!isNaN(baseline)){
if (baselineBoundary){
y = ((baselineY - child.baselinePosition) + baseline);
} else {
y = baseline;
};
};
if (!isNaN(verticalCenter)){
if (vcBoundary){
y = Math.round(((((vcHolder - h) / 2) + verticalCenter) + vcY));
} else {
y = Math.round((((availableHeight - h) / 2) + verticalCenter));
};
} else {
if (!isNaN(top)){
if (topBoundary){
y = (topHolder + top);
} else {
y = top;
};
} else {
if (!isNaN(bottom)){
if (bottomBoundary){
y = ((bottomHolder - bottom) - h);
} else {
y = ((availableHeight - bottom) - h);
};
};
};
};
x = (isNaN(x)) ? child.x : x;
y = (isNaN(y)) ? child.y : y;
child.move(x, y);
if (checkWidth){
if ((x + w) > availableWidth){
w = Math.max((availableWidth - x), child.minWidth);
};
};
if (checkHeight){
if ((y + h) > availableHeight){
h = Math.max((availableHeight - y), child.minHeight);
};
};
if (((!(isNaN(w))) && (!(isNaN(h))))){
child.setActualSize(w, h);
};
}
private function target_childAddHandler(event:ChildExistenceChangedEvent):void{
DisplayObject(event.relatedObject).addEventListener(MoveEvent.MOVE, child_moveHandler);
}
}
}//package mx.containers.utilityClasses
import mx.core.*;
class LayoutConstraints {
public var baseline;
public var left;
public var bottom;
public var top;
public var horizontalCenter;
public var verticalCenter;
public var right;
private function LayoutConstraints():void{
super();
}
}
class ChildConstraintInfo {
public var baseline:Number;
public var left:Number;
public var baselineBoundary:String;
public var leftBoundary:String;
public var hcBoundary:String;
public var top:Number;
public var right:Number;
public var topBoundary:String;
public var rightBoundary:String;
public var bottom:Number;
public var vc:Number;
public var bottomBoundary:String;
public var vcBoundary:String;
public var hc:Number;
private function ChildConstraintInfo(left:Number, right:Number, hc:Number, top:Number, bottom:Number, vc:Number, baseline:Number, leftBoundary:String=null, rightBoundary:String=null, hcBoundary:String=null, topBoundary:String=null, bottomBoundary:String=null, vcBoundary:String=null, baselineBoundary:String=null):void{
super();
this.left = left;
this.right = right;
this.hc = hc;
this.top = top;
this.bottom = bottom;
this.vc = vc;
this.baseline = baseline;
this.leftBoundary = leftBoundary;
this.rightBoundary = rightBoundary;
this.hcBoundary = hcBoundary;
this.topBoundary = topBoundary;
this.bottomBoundary = bottomBoundary;
this.vcBoundary = vcBoundary;
this.baselineBoundary = baselineBoundary;
}
}
class ContentColumnChild {
public var rightCol:ConstraintColumn;
public var hcCol:ConstraintColumn;
public var left:Number;
public var child:IUIComponent;
public var rightOffset:Number;
public var span:Number;
public var hcOffset:Number;
public var leftCol:ConstraintColumn;
public var leftOffset:Number;
public var hc:Number;
public var right:Number;
private function ContentColumnChild():void{
super();
}
}
class ContentRowChild {
public var topRow:ConstraintRow;
public var topOffset:Number;
public var baseline:Number;
public var baselineRow:ConstraintRow;
public var span:Number;
public var top:Number;
public var vcOffset:Number;
public var child:IUIComponent;
public var bottomOffset:Number;
public var bottom:Number;
public var vc:Number;
public var bottomRow:ConstraintRow;
public var vcRow:ConstraintRow;
public var baselineOffset:Number;
private function ContentRowChild():void{
super();
}
}
Section 78
//ConstraintColumn (mx.containers.utilityClasses.ConstraintColumn)
package mx.containers.utilityClasses {
import mx.core.*;
import flash.events.*;
public class ConstraintColumn extends EventDispatcher implements IMXMLObject {
private var _container:IInvalidating;
private var _explicitMinWidth:Number;
mx_internal var _width:Number;
mx_internal var contentSize:Boolean;// = false
private var _percentWidth:Number;
private var _explicitWidth:Number;
private var _explicitMaxWidth:Number;
private var _x:Number;
private var _id:String;
mx_internal static const VERSION:String = "3.2.0.3958";
public function ConstraintColumn(){
super();
}
public function get container():IInvalidating{
return (_container);
}
public function get width():Number{
return (_width);
}
public function get percentWidth():Number{
return (_percentWidth);
}
public function set container(value:IInvalidating):void{
_container = value;
}
public function set maxWidth(value:Number):void{
if (_explicitMaxWidth != value){
_explicitMaxWidth = value;
if (container){
container.invalidateSize();
container.invalidateDisplayList();
};
dispatchEvent(new Event("maxWidthChanged"));
};
}
public function set width(value:Number):void{
if (explicitWidth != value){
explicitWidth = value;
if (_width != value){
_width = value;
if (container){
container.invalidateSize();
container.invalidateDisplayList();
};
dispatchEvent(new Event("widthChanged"));
};
};
}
public function get maxWidth():Number{
return (_explicitMaxWidth);
}
public function get minWidth():Number{
return (_explicitMinWidth);
}
public function get id():String{
return (_id);
}
public function initialized(document:Object, id:String):void{
this.id = id;
if (((!(this.width)) && (!(this.percentWidth)))){
contentSize = true;
};
}
public function set explicitWidth(value:Number):void{
if (_explicitWidth == value){
return;
};
if (!isNaN(value)){
_percentWidth = NaN;
};
_explicitWidth = value;
if (container){
container.invalidateSize();
container.invalidateDisplayList();
};
dispatchEvent(new Event("explicitWidthChanged"));
}
public function setActualWidth(w:Number):void{
if (_width != w){
_width = w;
dispatchEvent(new Event("widthChanged"));
};
}
public function set minWidth(value:Number):void{
if (_explicitMinWidth != value){
_explicitMinWidth = value;
if (container){
container.invalidateSize();
container.invalidateDisplayList();
};
dispatchEvent(new Event("minWidthChanged"));
};
}
public function set percentWidth(value:Number):void{
if (_percentWidth == value){
return;
};
if (!isNaN(value)){
_explicitWidth = NaN;
};
_percentWidth = value;
if (container){
container.invalidateSize();
container.invalidateDisplayList();
};
dispatchEvent(new Event("percentWidthChanged"));
}
public function set x(value:Number):void{
if (value != _x){
_x = value;
dispatchEvent(new Event("xChanged"));
};
}
public function get explicitWidth():Number{
return (_explicitWidth);
}
public function set id(value:String):void{
_id = value;
}
public function get x():Number{
return (_x);
}
}
}//package mx.containers.utilityClasses
Section 79
//ConstraintRow (mx.containers.utilityClasses.ConstraintRow)
package mx.containers.utilityClasses {
import mx.core.*;
import flash.events.*;
public class ConstraintRow extends EventDispatcher implements IMXMLObject {
private var _container:IInvalidating;
mx_internal var _height:Number;
private var _explicitMinHeight:Number;
private var _y:Number;
private var _percentHeight:Number;
private var _explicitMaxHeight:Number;
mx_internal var contentSize:Boolean;// = false
private var _explicitHeight:Number;
private var _id:String;
mx_internal static const VERSION:String = "3.2.0.3958";
public function ConstraintRow(){
super();
}
public function get container():IInvalidating{
return (_container);
}
public function set container(value:IInvalidating):void{
_container = value;
}
public function set y(value:Number):void{
if (value != _y){
_y = value;
dispatchEvent(new Event("yChanged"));
};
}
public function set height(value:Number):void{
if (explicitHeight != value){
explicitHeight = value;
if (_height != value){
_height = value;
if (container){
container.invalidateSize();
container.invalidateDisplayList();
};
dispatchEvent(new Event("heightChanged"));
};
};
}
public function set maxHeight(value:Number):void{
if (_explicitMaxHeight != value){
_explicitMaxHeight = value;
if (container){
container.invalidateSize();
container.invalidateDisplayList();
};
dispatchEvent(new Event("maxHeightChanged"));
};
}
public function setActualHeight(h:Number):void{
if (_height != h){
_height = h;
dispatchEvent(new Event("heightChanged"));
};
}
public function get minHeight():Number{
return (_explicitMinHeight);
}
public function get id():String{
return (_id);
}
public function set percentHeight(value:Number):void{
if (_percentHeight == value){
return;
};
if (!isNaN(value)){
_explicitHeight = NaN;
};
_percentHeight = value;
if (container){
container.invalidateSize();
container.invalidateDisplayList();
};
}
public function initialized(document:Object, id:String):void{
this.id = id;
if (((!(this.height)) && (!(this.percentHeight)))){
contentSize = true;
};
}
public function get percentHeight():Number{
return (_percentHeight);
}
public function get height():Number{
return (_height);
}
public function get maxHeight():Number{
return (_explicitMaxHeight);
}
public function set minHeight(value:Number):void{
if (_explicitMinHeight != value){
_explicitMinHeight = value;
if (container){
container.invalidateSize();
container.invalidateDisplayList();
};
dispatchEvent(new Event("minHeightChanged"));
};
}
public function set id(value:String):void{
_id = value;
}
public function get y():Number{
return (_y);
}
public function get explicitHeight():Number{
return (_explicitHeight);
}
public function set explicitHeight(value:Number):void{
if (_explicitHeight == value){
return;
};
if (!isNaN(value)){
_percentHeight = NaN;
};
_explicitHeight = value;
if (container){
container.invalidateSize();
container.invalidateDisplayList();
};
dispatchEvent(new Event("explicitHeightChanged"));
}
}
}//package mx.containers.utilityClasses
Section 80
//Flex (mx.containers.utilityClasses.Flex)
package mx.containers.utilityClasses {
import mx.core.*;
public class Flex {
mx_internal static const VERSION:String = "3.2.0.3958";
public function Flex(){
super();
}
public static function flexChildWidthsProportionally(parent:Container, spaceForChildren:Number, h:Number):Number{
var childInfoArray:Array;
var childInfo:FlexChildInfo;
var child:IUIComponent;
var i:int;
var percentWidth:Number;
var percentHeight:Number;
var height:Number;
var width:Number;
var spaceToDistribute:Number = spaceForChildren;
var totalPercentWidth:Number = 0;
childInfoArray = [];
var n:int = parent.numChildren;
i = 0;
while (i < n) {
child = IUIComponent(parent.getChildAt(i));
percentWidth = child.percentWidth;
percentHeight = child.percentHeight;
if (((!(isNaN(percentHeight))) && (child.includeInLayout))){
height = Math.max(child.minHeight, Math.min(child.maxHeight, ((percentHeight)>=100) ? h : ((h * percentHeight) / 100)));
} else {
height = child.getExplicitOrMeasuredHeight();
};
if (((!(isNaN(percentWidth))) && (child.includeInLayout))){
totalPercentWidth = (totalPercentWidth + percentWidth);
childInfo = new FlexChildInfo();
childInfo.percent = percentWidth;
childInfo.min = child.minWidth;
childInfo.max = child.maxWidth;
childInfo.height = height;
childInfo.child = child;
childInfoArray.push(childInfo);
} else {
width = child.getExplicitOrMeasuredWidth();
if ((((child.scaleX == 1)) && ((child.scaleY == 1)))){
child.setActualSize(Math.floor(width), Math.floor(height));
} else {
child.setActualSize(width, height);
};
if (child.includeInLayout){
spaceToDistribute = (spaceToDistribute - child.width);
};
};
i++;
};
if (totalPercentWidth){
spaceToDistribute = flexChildrenProportionally(spaceForChildren, spaceToDistribute, totalPercentWidth, childInfoArray);
n = childInfoArray.length;
i = 0;
while (i < n) {
childInfo = childInfoArray[i];
child = childInfo.child;
if ((((child.scaleX == 1)) && ((child.scaleY == 1)))){
child.setActualSize(Math.floor(childInfo.size), Math.floor(childInfo.height));
} else {
child.setActualSize(childInfo.size, childInfo.height);
};
i++;
};
if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0){
distributeExtraWidth(parent, spaceForChildren);
};
};
return (spaceToDistribute);
}
public static function distributeExtraHeight(parent:Container, spaceForChildren:Number):void{
var i:int;
var percentHeight:Number;
var child:IUIComponent;
var childHeight:Number;
var wantSpace:Number;
var n:int = parent.numChildren;
var wantToGrow:Boolean;
var spaceToDistribute:Number = spaceForChildren;
var spaceUsed:Number = 0;
i = 0;
while (i < n) {
child = IUIComponent(parent.getChildAt(i));
if (!child.includeInLayout){
} else {
childHeight = child.height;
percentHeight = child.percentHeight;
spaceUsed = (spaceUsed + childHeight);
if (!isNaN(percentHeight)){
wantSpace = Math.ceil(((percentHeight / 100) * spaceForChildren));
if (wantSpace > childHeight){
wantToGrow = true;
};
};
};
i++;
};
if (!wantToGrow){
return;
};
spaceToDistribute = (spaceToDistribute - spaceUsed);
var stillFlexibleComponents:Boolean;
while (((stillFlexibleComponents) && ((spaceToDistribute > 0)))) {
stillFlexibleComponents = false;
i = 0;
while (i < n) {
child = IUIComponent(parent.getChildAt(i));
childHeight = child.height;
percentHeight = child.percentHeight;
if (((((!(isNaN(percentHeight))) && (child.includeInLayout))) && ((childHeight < child.maxHeight)))){
wantSpace = Math.ceil(((percentHeight / 100) * spaceForChildren));
if (wantSpace > childHeight){
child.setActualSize(child.width, (childHeight + 1));
spaceToDistribute--;
stillFlexibleComponents = true;
if (spaceToDistribute == 0){
return;
};
};
};
i++;
};
};
}
public static function distributeExtraWidth(parent:Container, spaceForChildren:Number):void{
var i:int;
var percentWidth:Number;
var child:IUIComponent;
var childWidth:Number;
var wantSpace:Number;
var n:int = parent.numChildren;
var wantToGrow:Boolean;
var spaceToDistribute:Number = spaceForChildren;
var spaceUsed:Number = 0;
i = 0;
while (i < n) {
child = IUIComponent(parent.getChildAt(i));
if (!child.includeInLayout){
} else {
childWidth = child.width;
percentWidth = child.percentWidth;
spaceUsed = (spaceUsed + childWidth);
if (!isNaN(percentWidth)){
wantSpace = Math.ceil(((percentWidth / 100) * spaceForChildren));
if (wantSpace > childWidth){
wantToGrow = true;
};
};
};
i++;
};
if (!wantToGrow){
return;
};
spaceToDistribute = (spaceToDistribute - spaceUsed);
var stillFlexibleComponents:Boolean;
while (((stillFlexibleComponents) && ((spaceToDistribute > 0)))) {
stillFlexibleComponents = false;
i = 0;
while (i < n) {
child = IUIComponent(parent.getChildAt(i));
childWidth = child.width;
percentWidth = child.percentWidth;
if (((((!(isNaN(percentWidth))) && (child.includeInLayout))) && ((childWidth < child.maxWidth)))){
wantSpace = Math.ceil(((percentWidth / 100) * spaceForChildren));
if (wantSpace > childWidth){
child.setActualSize((childWidth + 1), child.height);
spaceToDistribute--;
stillFlexibleComponents = true;
if (spaceToDistribute == 0){
return;
};
};
};
i++;
};
};
}
public static function flexChildrenProportionally(spaceForChildren:Number, spaceToDistribute:Number, totalPercent:Number, childInfoArray:Array):Number{
var flexConsumed:Number;
var done:Boolean;
var spacePerPercent:*;
var i:*;
var childInfo:*;
var size:*;
var min:*;
var max:*;
var numChildren:int = childInfoArray.length;
var unused:Number = (spaceToDistribute - ((spaceForChildren * totalPercent) / 100));
if (unused > 0){
spaceToDistribute = (spaceToDistribute - unused);
};
do {
flexConsumed = 0;
done = true;
spacePerPercent = (spaceToDistribute / totalPercent);
i = 0;
while (i < numChildren) {
childInfo = childInfoArray[i];
size = (childInfo.percent * spacePerPercent);
if (size < childInfo.min){
min = childInfo.min;
childInfo.size = min;
--numChildren;
childInfoArray[i] = childInfoArray[numChildren];
childInfoArray[numChildren] = childInfo;
totalPercent = (totalPercent - childInfo.percent);
spaceToDistribute = (spaceToDistribute - min);
done = false;
break;
} else {
if (size > childInfo.max){
max = childInfo.max;
childInfo.size = max;
--numChildren;
childInfoArray[i] = childInfoArray[numChildren];
childInfoArray[numChildren] = childInfo;
totalPercent = (totalPercent - childInfo.percent);
spaceToDistribute = (spaceToDistribute - max);
done = false;
break;
} else {
childInfo.size = size;
flexConsumed = (flexConsumed + size);
};
};
i++;
};
} while (!(done));
return (Math.max(0, Math.floor((spaceToDistribute - flexConsumed))));
}
public static function flexChildHeightsProportionally(parent:Container, spaceForChildren:Number, w:Number):Number{
var childInfo:FlexChildInfo;
var child:IUIComponent;
var i:int;
var percentWidth:Number;
var percentHeight:Number;
var width:Number;
var height:Number;
var spaceToDistribute:Number = spaceForChildren;
var totalPercentHeight:Number = 0;
var childInfoArray:Array = [];
var n:int = parent.numChildren;
i = 0;
while (i < n) {
child = IUIComponent(parent.getChildAt(i));
percentWidth = child.percentWidth;
percentHeight = child.percentHeight;
if (((!(isNaN(percentWidth))) && (child.includeInLayout))){
width = Math.max(child.minWidth, Math.min(child.maxWidth, ((percentWidth)>=100) ? w : ((w * percentWidth) / 100)));
} else {
width = child.getExplicitOrMeasuredWidth();
};
if (((!(isNaN(percentHeight))) && (child.includeInLayout))){
totalPercentHeight = (totalPercentHeight + percentHeight);
childInfo = new FlexChildInfo();
childInfo.percent = percentHeight;
childInfo.min = child.minHeight;
childInfo.max = child.maxHeight;
childInfo.width = width;
childInfo.child = child;
childInfoArray.push(childInfo);
} else {
height = child.getExplicitOrMeasuredHeight();
if ((((child.scaleX == 1)) && ((child.scaleY == 1)))){
child.setActualSize(Math.floor(width), Math.floor(height));
} else {
child.setActualSize(width, height);
};
if (child.includeInLayout){
spaceToDistribute = (spaceToDistribute - child.height);
};
};
i++;
};
if (totalPercentHeight){
spaceToDistribute = flexChildrenProportionally(spaceForChildren, spaceToDistribute, totalPercentHeight, childInfoArray);
n = childInfoArray.length;
i = 0;
while (i < n) {
childInfo = childInfoArray[i];
child = childInfo.child;
if ((((child.scaleX == 1)) && ((child.scaleY == 1)))){
child.setActualSize(Math.floor(childInfo.width), Math.floor(childInfo.size));
} else {
child.setActualSize(childInfo.width, childInfo.size);
};
i++;
};
if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0){
distributeExtraHeight(parent, spaceForChildren);
};
};
return (spaceToDistribute);
}
}
}//package mx.containers.utilityClasses
Section 81
//FlexChildInfo (mx.containers.utilityClasses.FlexChildInfo)
package mx.containers.utilityClasses {
import mx.core.*;
public class FlexChildInfo {
public var flex:Number;// = 0
public var preferred:Number;// = 0
public var percent:Number;
public var width:Number;
public var height:Number;
public var size:Number;// = 0
public var max:Number;
public var min:Number;
public var child:IUIComponent;
mx_internal static const VERSION:String = "3.2.0.3958";
public function FlexChildInfo(){
super();
}
}
}//package mx.containers.utilityClasses
Section 82
//IConstraintLayout (mx.containers.utilityClasses.IConstraintLayout)
package mx.containers.utilityClasses {
public interface IConstraintLayout {
function get constraintColumns():Array;
function set constraintRows(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\containers\utilityClasses;IConstraintLayout.as:Array):void;
function get constraintRows():Array;
function set constraintColumns(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\containers\utilityClasses;IConstraintLayout.as:Array):void;
}
}//package mx.containers.utilityClasses
Section 83
//Layout (mx.containers.utilityClasses.Layout)
package mx.containers.utilityClasses {
import mx.core.*;
import mx.resources.*;
public class Layout {
private var _target:Container;
protected var resourceManager:IResourceManager;
mx_internal static const VERSION:String = "3.2.0.3958";
public function Layout(){
resourceManager = ResourceManager.getInstance();
super();
}
public function get target():Container{
return (_target);
}
public function set target(value:Container):void{
_target = value;
}
public function measure():void{
}
public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
}
}
}//package mx.containers.utilityClasses
Section 84
//Box (mx.containers.Box)
package mx.containers {
import mx.core.*;
import flash.events.*;
import mx.containers.utilityClasses.*;
public class Box extends Container {
mx_internal var layoutObject:BoxLayout;
mx_internal static const VERSION:String = "3.2.0.3958";
public function Box(){
layoutObject = new BoxLayout();
super();
layoutObject.target = this;
}
mx_internal function isVertical():Boolean{
return (!((direction == BoxDirection.HORIZONTAL)));
}
public function set direction(value:String):void{
layoutObject.direction = value;
invalidateSize();
invalidateDisplayList();
dispatchEvent(new Event("directionChanged"));
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
super.updateDisplayList(unscaledWidth, unscaledHeight);
layoutObject.updateDisplayList(unscaledWidth, unscaledHeight);
}
public function pixelsToPercent(pxl:Number):Number{
var child:IUIComponent;
var size:Number;
var perc:Number;
var vertical:Boolean = isVertical();
var totalPerc:Number = 0;
var totalSize:Number = 0;
var n:int = numChildren;
var i:int;
while (i < n) {
child = IUIComponent(getChildAt(i));
size = (vertical) ? child.height : child.width;
perc = (vertical) ? child.percentHeight : child.percentWidth;
if (!isNaN(perc)){
totalPerc = (totalPerc + perc);
totalSize = (totalSize + size);
};
i++;
};
var p:Number = 100;
if (totalSize != pxl){
p = (((totalSize * totalPerc) / (totalSize - pxl)) - totalPerc);
};
return (p);
}
override protected function measure():void{
super.measure();
layoutObject.measure();
}
public function get direction():String{
return (layoutObject.direction);
}
}
}//package mx.containers
Section 85
//BoxDirection (mx.containers.BoxDirection)
package mx.containers {
public final class BoxDirection {
public static const HORIZONTAL:String = "horizontal";
public static const VERTICAL:String = "vertical";
mx_internal static const VERSION:String = "3.2.0.3958";
public function BoxDirection(){
super();
}
}
}//package mx.containers
Section 86
//ControlBar (mx.containers.ControlBar)
package mx.containers {
import mx.core.*;
public class ControlBar extends Box {
mx_internal static const VERSION:String = "3.2.0.3958";
public function ControlBar(){
super();
direction = BoxDirection.HORIZONTAL;
}
override public function set verticalScrollPolicy(value:String):void{
}
override public function set horizontalScrollPolicy(value:String):void{
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
super.updateDisplayList(unscaledWidth, unscaledHeight);
if (contentPane){
contentPane.opaqueBackground = null;
};
}
override public function set enabled(value:Boolean):void{
if (value != super.enabled){
super.enabled = value;
alpha = (value) ? 1 : 0.4;
};
}
override public function get horizontalScrollPolicy():String{
return (ScrollPolicy.OFF);
}
override public function invalidateSize():void{
super.invalidateSize();
if (parent){
Container(parent).invalidateViewMetricsAndPadding();
};
}
override public function get verticalScrollPolicy():String{
return (ScrollPolicy.OFF);
}
override public function set includeInLayout(value:Boolean):void{
var p:Container;
if (includeInLayout != value){
super.includeInLayout = value;
p = (parent as Container);
if (p){
p.invalidateViewMetricsAndPadding();
};
};
}
}
}//package mx.containers
Section 87
//Panel (mx.containers.Panel)
package mx.containers {
import flash.display.*;
import mx.core.*;
import flash.geom.*;
import flash.events.*;
import mx.events.*;
import mx.controls.*;
import mx.styles.*;
import flash.text.*;
import mx.effects.*;
import mx.containers.utilityClasses.*;
import flash.utils.*;
import mx.automation.*;
public class Panel extends Container implements IConstraintLayout, IFontContextComponent {
private var layoutObject:Layout;
private var _status:String;// = ""
private var _titleChanged:Boolean;// = false
mx_internal var titleBarBackground:IFlexDisplayObject;
private var regX:Number;
private var regY:Number;
private var _layout:String;// = "vertical"
mx_internal var closeButton:Button;
private var initializing:Boolean;// = true
private var _title:String;// = ""
protected var titleTextField:IUITextField;
private var _statusChanged:Boolean;// = false
private var autoSetRoundedCorners:Boolean;
private var _titleIcon:Class;
private var _constraintRows:Array;
protected var controlBar:IUIComponent;
mx_internal var titleIconObject:Object;// = null
protected var titleBar:UIComponent;
private var panelViewMetrics:EdgeMetrics;
private var _constraintColumns:Array;
mx_internal var _showCloseButton:Boolean;// = false
private var checkedForAutoSetRoundedCorners:Boolean;
private var _titleIconChanged:Boolean;// = false
protected var statusTextField:IUITextField;
mx_internal static const VERSION:String = "3.2.0.3958";
private static const HEADER_PADDING:Number = 14;
mx_internal static var createAccessibilityImplementation:Function;
private static var _closeButtonStyleFilters:Object = {closeButtonUpSkin:"closeButtonUpSkin", closeButtonOverSkin:"closeButtonOverSkin", closeButtonDownSkin:"closeButtonDownSkin", closeButtonDisabledSkin:"closeButtonDisabledSkin", closeButtonSkin:"closeButtonSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
public function Panel(){
_constraintColumns = [];
_constraintRows = [];
super();
addEventListener("resizeStart", EffectManager.eventHandler, false, EventPriority.EFFECT);
addEventListener("resizeEnd", EffectManager.eventHandler, false, EventPriority.EFFECT);
layoutObject = new BoxLayout();
layoutObject.target = this;
showInAutomationHierarchy = true;
}
private function systemManager_mouseUpHandler(event:MouseEvent):void{
if (!isNaN(regX)){
stopDragging();
};
}
mx_internal function getHeaderHeightProxy():Number{
return (getHeaderHeight());
}
override public function getChildIndex(child:DisplayObject):int{
if (((controlBar) && ((child == controlBar)))){
return (numChildren);
};
return (super.getChildIndex(child));
}
mx_internal function get _controlBar():IUIComponent{
return (controlBar);
}
mx_internal function getTitleBar():UIComponent{
return (titleBar);
}
public function get layout():String{
return (_layout);
}
override protected function createChildren():void{
var titleBarBackgroundClass:Class;
var backgroundUIComponent:IStyleClient;
var backgroundStyleable:ISimpleStyleClient;
super.createChildren();
if (!titleBar){
titleBar = new UIComponent();
titleBar.visible = false;
titleBar.addEventListener(MouseEvent.MOUSE_DOWN, titleBar_mouseDownHandler);
rawChildren.addChild(titleBar);
};
if (!titleBarBackground){
titleBarBackgroundClass = getStyle("titleBackgroundSkin");
if (titleBarBackgroundClass){
titleBarBackground = new (titleBarBackgroundClass);
backgroundUIComponent = (titleBarBackground as IStyleClient);
if (backgroundUIComponent){
backgroundUIComponent.setStyle("backgroundImage", undefined);
};
backgroundStyleable = (titleBarBackground as ISimpleStyleClient);
if (backgroundStyleable){
backgroundStyleable.styleName = this;
};
titleBar.addChild(DisplayObject(titleBarBackground));
};
};
createTitleTextField(-1);
createStatusTextField(-1);
if (!closeButton){
closeButton = new Button();
closeButton.styleName = new StyleProxy(this, closeButtonStyleFilters);
closeButton.upSkinName = "closeButtonUpSkin";
closeButton.overSkinName = "closeButtonOverSkin";
closeButton.downSkinName = "closeButtonDownSkin";
closeButton.disabledSkinName = "closeButtonDisabledSkin";
closeButton.skinName = "closeButtonSkin";
closeButton.explicitWidth = (closeButton.explicitHeight = 16);
closeButton.focusEnabled = false;
closeButton.visible = false;
closeButton.enabled = enabled;
closeButton.addEventListener(MouseEvent.CLICK, closeButton_clickHandler);
titleBar.addChild(closeButton);
closeButton.owner = this;
};
}
public function get constraintColumns():Array{
return (_constraintColumns);
}
override public function set cacheAsBitmap(value:Boolean):void{
super.cacheAsBitmap = value;
if (((((((cacheAsBitmap) && (!(contentPane)))) && (!((cachePolicy == UIComponentCachePolicy.OFF))))) && (getStyle("backgroundColor")))){
createContentPane();
invalidateDisplayList();
};
}
override public function createComponentsFromDescriptors(recurse:Boolean=true):void{
var oldChildDocument:Object;
super.createComponentsFromDescriptors();
if (numChildren == 0){
setControlBar(null);
return;
};
var lastChild:IUIComponent = IUIComponent(getChildAt((numChildren - 1)));
if ((lastChild is ControlBar)){
oldChildDocument = lastChild.document;
if (contentPane){
contentPane.removeChild(DisplayObject(lastChild));
} else {
removeChild(DisplayObject(lastChild));
};
lastChild.document = oldChildDocument;
rawChildren.addChild(DisplayObject(lastChild));
setControlBar(lastChild);
} else {
setControlBar(null);
};
}
override protected function layoutChrome(unscaledWidth:Number, unscaledHeight:Number):void{
var titleBarWidth:Number;
var g:Graphics;
var leftOffset:Number;
var rightOffset:Number;
var h:Number;
var offset:Number;
var borderWidth:Number;
var statusX:Number;
var minX:Number;
var cx:Number;
var cy:Number;
var cw:Number;
var ch:Number;
super.layoutChrome(unscaledWidth, unscaledHeight);
var em:EdgeMetrics = EdgeMetrics.EMPTY;
var bt:Number = getStyle("borderThickness");
if ((((((getQualifiedClassName(border) == "mx.skins.halo::PanelSkin")) && (!((getStyle("borderStyle") == "default"))))) && (bt))){
em = new EdgeMetrics(bt, bt, bt, bt);
};
var bm:EdgeMetrics = ((FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)) ? borderMetrics : em;
var x:Number = bm.left;
var y:Number = bm.top;
var headerHeight:Number = getHeaderHeight();
if ((((headerHeight > 0)) && ((height >= headerHeight)))){
titleBarWidth = ((unscaledWidth - bm.left) - bm.right);
showTitleBar(true);
titleBar.mouseChildren = true;
titleBar.mouseEnabled = true;
g = titleBar.graphics;
g.clear();
g.beginFill(0xFFFFFF, 0);
g.drawRect(0, 0, titleBarWidth, headerHeight);
g.endFill();
titleBar.move(x, y);
titleBar.setActualSize(titleBarWidth, headerHeight);
titleBarBackground.move(0, 0);
IFlexDisplayObject(titleBarBackground).setActualSize(titleBarWidth, headerHeight);
closeButton.visible = _showCloseButton;
if (_showCloseButton){
closeButton.setActualSize(closeButton.getExplicitOrMeasuredWidth(), closeButton.getExplicitOrMeasuredHeight());
closeButton.move(((((unscaledWidth - x) - bm.right) - 10) - closeButton.getExplicitOrMeasuredWidth()), ((headerHeight - closeButton.getExplicitOrMeasuredHeight()) / 2));
};
leftOffset = 10;
rightOffset = 10;
if (titleIconObject){
h = titleIconObject.height;
offset = ((headerHeight - h) / 2);
titleIconObject.move(leftOffset, offset);
leftOffset = (leftOffset + (titleIconObject.width + 4));
};
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
h = titleTextField.nonZeroTextHeight;
} else {
h = titleTextField.getUITextFormat().measureText(titleTextField.text).height;
};
offset = ((headerHeight - h) / 2);
borderWidth = (bm.left + bm.right);
titleTextField.move(leftOffset, (offset - 1));
titleTextField.setActualSize(Math.max(0, (((unscaledWidth - leftOffset) - rightOffset) - borderWidth)), (h + UITextField.TEXT_HEIGHT_PADDING));
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
h = statusTextField.textHeight;
} else {
h = ((statusTextField.text)!="") ? statusTextField.getUITextFormat().measureText(statusTextField.text).height : 0;
};
offset = ((headerHeight - h) / 2);
statusX = ((((unscaledWidth - rightOffset) - 4) - borderWidth) - statusTextField.textWidth);
if (_showCloseButton){
statusX = (statusX - (closeButton.getExplicitOrMeasuredWidth() + 4));
};
statusTextField.move(statusX, (offset - 1));
statusTextField.setActualSize((statusTextField.textWidth + 8), (statusTextField.textHeight + UITextField.TEXT_HEIGHT_PADDING));
minX = ((titleTextField.x + titleTextField.textWidth) + 8);
if (statusTextField.x < minX){
statusTextField.width = Math.max((statusTextField.width - (minX - statusTextField.x)), 0);
statusTextField.x = minX;
};
} else {
if (titleBar){
showTitleBar(false);
titleBar.mouseChildren = false;
titleBar.mouseEnabled = false;
};
};
if (controlBar){
cx = controlBar.x;
cy = controlBar.y;
cw = controlBar.width;
ch = controlBar.height;
controlBar.setActualSize((unscaledWidth - (bm.left + bm.right)), controlBar.getExplicitOrMeasuredHeight());
controlBar.move(bm.left, ((unscaledHeight - bm.bottom) - controlBar.getExplicitOrMeasuredHeight()));
if (controlBar.includeInLayout){
controlBar.visible = (controlBar.y >= bm.top);
};
if (((((((!((cx == controlBar.x))) || (!((cy == controlBar.y))))) || (!((cw == controlBar.width))))) || (!((ch == controlBar.height))))){
invalidateDisplayList();
};
};
}
public function set layout(value:String):void{
if (_layout != value){
_layout = value;
if (layoutObject){
layoutObject.target = null;
};
if (_layout == ContainerLayout.ABSOLUTE){
layoutObject = new CanvasLayout();
} else {
layoutObject = new BoxLayout();
if (_layout == ContainerLayout.VERTICAL){
BoxLayout(layoutObject).direction = BoxDirection.VERTICAL;
} else {
BoxLayout(layoutObject).direction = BoxDirection.HORIZONTAL;
};
};
if (layoutObject){
layoutObject.target = this;
};
invalidateSize();
invalidateDisplayList();
dispatchEvent(new Event("layoutChanged"));
};
}
public function get constraintRows():Array{
return (_constraintRows);
}
public function get title():String{
return (_title);
}
mx_internal function getTitleTextField():IUITextField{
return (titleTextField);
}
mx_internal function createStatusTextField(childIndex:int):void{
var statusStyleName:String;
if (((titleBar) && (!(statusTextField)))){
statusTextField = IUITextField(createInFontContext(UITextField));
statusTextField.selectable = false;
if (childIndex == -1){
titleBar.addChild(DisplayObject(statusTextField));
} else {
titleBar.addChildAt(DisplayObject(statusTextField), childIndex);
};
statusStyleName = getStyle("statusStyleName");
statusTextField.styleName = statusStyleName;
statusTextField.text = status;
statusTextField.enabled = enabled;
};
}
public function get fontContext():IFlexModuleFactory{
return (moduleFactory);
}
override protected function measure():void{
var controlWidth:Number;
super.measure();
layoutObject.measure();
var textSize:Rectangle = measureHeaderText();
var textWidth:Number = textSize.width;
var textHeight:Number = textSize.height;
var bm:EdgeMetrics = ((FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)) ? borderMetrics : EdgeMetrics.EMPTY;
textWidth = (textWidth + (bm.left + bm.right));
var offset:Number = 5;
textWidth = (textWidth + (offset * 2));
if (titleIconObject){
textWidth = (textWidth + titleIconObject.width);
};
if (closeButton){
textWidth = (textWidth + (closeButton.getExplicitOrMeasuredWidth() + 6));
};
measuredMinWidth = Math.max(textWidth, measuredMinWidth);
measuredWidth = Math.max(textWidth, measuredWidth);
if (((controlBar) && (controlBar.includeInLayout))){
controlWidth = ((controlBar.getExplicitOrMeasuredWidth() + bm.left) + bm.right);
measuredWidth = Math.max(measuredWidth, controlWidth);
};
}
mx_internal function getControlBar():IUIComponent{
return (controlBar);
}
override public function get viewMetrics():EdgeMetrics{
var o:EdgeMetrics;
var bt:Number;
var btl:Number;
var btt:Number;
var btr:Number;
var btb:Number;
var hHeight:Number;
var vm:EdgeMetrics = super.viewMetrics;
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
if (!panelViewMetrics){
panelViewMetrics = new EdgeMetrics(0, 0, 0, 0);
};
vm = panelViewMetrics;
o = super.viewMetrics;
bt = getStyle("borderThickness");
btl = getStyle("borderThicknessLeft");
btt = getStyle("borderThicknessTop");
btr = getStyle("borderThicknessRight");
btb = getStyle("borderThicknessBottom");
vm.left = (o.left + (isNaN(btl)) ? bt : btl);
vm.top = (o.top + (isNaN(btt)) ? bt : btt);
vm.right = (o.right + (isNaN(btr)) ? bt : btr);
vm.bottom = (o.bottom + (isNaN(btb)) ? (((controlBar) && (!(isNaN(btt))))) ? btt : (isNaN(btl)) ? bt : btl : btb);
hHeight = getHeaderHeight();
if (!isNaN(hHeight)){
vm.top = (vm.top + hHeight);
};
if (((controlBar) && (controlBar.includeInLayout))){
vm.bottom = (vm.bottom + controlBar.getExplicitOrMeasuredHeight());
};
};
return (vm);
}
private function measureHeaderText():Rectangle{
var textFormat:UITextFormat;
var metrics:TextLineMetrics;
var textWidth:Number = 20;
var textHeight:Number = 14;
if (((titleTextField) && (titleTextField.text))){
titleTextField.validateNow();
textFormat = titleTextField.getUITextFormat();
metrics = textFormat.measureText(titleTextField.text, false);
textWidth = metrics.width;
textHeight = metrics.height;
};
if (((statusTextField) && (statusTextField.text))){
statusTextField.validateNow();
textFormat = statusTextField.getUITextFormat();
metrics = textFormat.measureText(statusTextField.text, false);
textWidth = Math.max(textWidth, metrics.width);
textHeight = Math.max(textHeight, metrics.height);
};
return (new Rectangle(0, 0, Math.round(textWidth), Math.round(textHeight)));
}
mx_internal function createTitleTextField(childIndex:int):void{
var titleStyleName:String;
if (!titleTextField){
titleTextField = IUITextField(createInFontContext(UITextField));
titleTextField.selectable = false;
if (childIndex == -1){
titleBar.addChild(DisplayObject(titleTextField));
} else {
titleBar.addChildAt(DisplayObject(titleTextField), childIndex);
};
titleStyleName = getStyle("titleStyleName");
titleTextField.styleName = titleStyleName;
titleTextField.text = title;
titleTextField.enabled = enabled;
};
}
private function closeButton_clickHandler(event:MouseEvent):void{
dispatchEvent(new CloseEvent(CloseEvent.CLOSE));
}
private function setControlBar(newControlBar:IUIComponent):void{
if (newControlBar == controlBar){
return;
};
controlBar = newControlBar;
if (!checkedForAutoSetRoundedCorners){
checkedForAutoSetRoundedCorners = true;
autoSetRoundedCorners = (styleDeclaration) ? (styleDeclaration.getStyle("roundedBottomCorners") === undefined) : true;
};
if (autoSetRoundedCorners){
setStyle("roundedBottomCorners", !((controlBar == null)));
};
var controlBarStyleName:String = getStyle("controlBarStyleName");
if (((controlBarStyleName) && ((controlBar is ISimpleStyleClient)))){
ISimpleStyleClient(controlBar).styleName = controlBarStyleName;
};
if (controlBar){
controlBar.enabled = enabled;
};
if ((controlBar is IAutomationObject)){
IAutomationObject(controlBar).showInAutomationHierarchy = false;
};
invalidateViewMetricsAndPadding();
invalidateSize();
invalidateDisplayList();
}
protected function get closeButtonStyleFilters():Object{
return (_closeButtonStyleFilters);
}
public function set constraintColumns(value:Array):void{
var n:int;
var i:int;
if (value != _constraintColumns){
n = value.length;
i = 0;
while (i < n) {
ConstraintColumn(value[i]).container = this;
i++;
};
_constraintColumns = value;
invalidateSize();
invalidateDisplayList();
};
}
override public function set enabled(value:Boolean):void{
super.enabled = value;
if (titleTextField){
titleTextField.enabled = value;
};
if (statusTextField){
statusTextField.enabled = value;
};
if (controlBar){
controlBar.enabled = value;
};
if (closeButton){
closeButton.enabled = value;
};
}
override public function get baselinePosition():Number{
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
return (super.baselinePosition);
};
if (!validateBaselinePosition()){
return (NaN);
};
return (((titleBar.y + titleTextField.y) + titleTextField.baselinePosition));
}
protected function stopDragging():void{
var sbRoot:DisplayObject = systemManager.getSandboxRoot();
sbRoot.removeEventListener(MouseEvent.MOUSE_MOVE, systemManager_mouseMoveHandler, true);
sbRoot.removeEventListener(MouseEvent.MOUSE_UP, systemManager_mouseUpHandler, true);
sbRoot.removeEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE, stage_mouseLeaveHandler);
regX = NaN;
regY = NaN;
systemManager.deployMouseShields(false);
}
private function titleBar_mouseDownHandler(event:MouseEvent):void{
if (event.target == closeButton){
return;
};
if (((((enabled) && (isPopUp))) && (isNaN(regX)))){
startDragging(event);
};
}
override mx_internal function get usePadding():Boolean{
return (!((layout == ContainerLayout.ABSOLUTE)));
}
override protected function initializeAccessibility():void{
if (Panel.createAccessibilityImplementation != null){
Panel.createAccessibilityImplementation(this);
};
}
protected function getHeaderHeight():Number{
var headerHeight:Number = getStyle("headerHeight");
if (isNaN(headerHeight)){
headerHeight = (measureHeaderText().height + HEADER_PADDING);
};
return (headerHeight);
}
public function set constraintRows(value:Array):void{
var n:int;
var i:int;
if (value != _constraintRows){
n = value.length;
i = 0;
while (i < n) {
ConstraintRow(value[i]).container = this;
i++;
};
_constraintRows = value;
invalidateSize();
invalidateDisplayList();
};
}
public function set title(value:String):void{
_title = value;
_titleChanged = true;
invalidateProperties();
invalidateSize();
invalidateViewMetricsAndPadding();
dispatchEvent(new Event("titleChanged"));
}
private function showTitleBar(show:Boolean):void{
var child:DisplayObject;
titleBar.visible = show;
var n:int = titleBar.numChildren;
var i:int;
while (i < n) {
child = titleBar.getChildAt(i);
child.visible = show;
i++;
};
}
override public function styleChanged(styleProp:String):void{
var titleStyleName:String;
var statusStyleName:String;
var controlBarStyleName:String;
var titleBackgroundSkinClass:Class;
var backgroundUIComponent:IStyleClient;
var backgroundStyleable:ISimpleStyleClient;
var allStyles:Boolean = ((!(styleProp)) || ((styleProp == "styleName")));
super.styleChanged(styleProp);
if (((allStyles) || ((styleProp == "titleStyleName")))){
if (titleTextField){
titleStyleName = getStyle("titleStyleName");
titleTextField.styleName = titleStyleName;
};
};
if (((allStyles) || ((styleProp == "statusStyleName")))){
if (statusTextField){
statusStyleName = getStyle("statusStyleName");
statusTextField.styleName = statusStyleName;
};
};
if (((allStyles) || ((styleProp == "controlBarStyleName")))){
if (((controlBar) && ((controlBar is ISimpleStyleClient)))){
controlBarStyleName = getStyle("controlBarStyleName");
ISimpleStyleClient(controlBar).styleName = controlBarStyleName;
};
};
if (((allStyles) || ((styleProp == "titleBackgroundSkin")))){
if (titleBar){
titleBackgroundSkinClass = getStyle("titleBackgroundSkin");
if (titleBackgroundSkinClass){
if (titleBarBackground){
titleBar.removeChild(DisplayObject(titleBarBackground));
titleBarBackground = null;
};
titleBarBackground = new (titleBackgroundSkinClass);
backgroundUIComponent = (titleBarBackground as IStyleClient);
if (backgroundUIComponent){
backgroundUIComponent.setStyle("backgroundImage", undefined);
};
backgroundStyleable = (titleBarBackground as ISimpleStyleClient);
if (backgroundStyleable){
backgroundStyleable.styleName = this;
};
titleBar.addChildAt(DisplayObject(titleBarBackground), 0);
};
};
};
}
mx_internal function getStatusTextField():IUITextField{
return (statusTextField);
}
public function set fontContext(moduleFactory:IFlexModuleFactory):void{
this.moduleFactory = moduleFactory;
}
override protected function commitProperties():void{
var childIndex:int;
super.commitProperties();
if (hasFontContextChanged()){
if (titleTextField){
childIndex = titleBar.getChildIndex(DisplayObject(titleTextField));
removeTitleTextField();
createTitleTextField(childIndex);
_titleChanged = true;
};
if (statusTextField){
childIndex = titleBar.getChildIndex(DisplayObject(statusTextField));
removeStatusTextField();
createStatusTextField(childIndex);
_statusChanged = true;
};
};
if (_titleChanged){
_titleChanged = false;
titleTextField.text = _title;
if (initialized){
layoutChrome(unscaledWidth, unscaledHeight);
};
};
if (_titleIconChanged){
_titleIconChanged = false;
if (titleIconObject){
titleBar.removeChild(DisplayObject(titleIconObject));
titleIconObject = null;
};
if (_titleIcon){
titleIconObject = new _titleIcon();
titleBar.addChild(DisplayObject(titleIconObject));
};
if (initialized){
layoutChrome(unscaledWidth, unscaledHeight);
};
};
if (_statusChanged){
_statusChanged = false;
statusTextField.text = _status;
if (initialized){
layoutChrome(unscaledWidth, unscaledHeight);
};
};
}
protected function startDragging(event:MouseEvent):void{
regX = (event.stageX - x);
regY = (event.stageY - y);
var sbRoot:DisplayObject = systemManager.getSandboxRoot();
sbRoot.addEventListener(MouseEvent.MOUSE_MOVE, systemManager_mouseMoveHandler, true);
sbRoot.addEventListener(MouseEvent.MOUSE_UP, systemManager_mouseUpHandler, true);
sbRoot.addEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE, stage_mouseLeaveHandler);
systemManager.deployMouseShields(true);
}
mx_internal function removeStatusTextField():void{
if (((titleBar) && (statusTextField))){
titleBar.removeChild(DisplayObject(statusTextField));
statusTextField = null;
};
}
private function stage_mouseLeaveHandler(event:Event):void{
if (!isNaN(regX)){
stopDragging();
};
}
public function set status(value:String):void{
_status = value;
_statusChanged = true;
invalidateProperties();
dispatchEvent(new Event("statusChanged"));
}
public function get titleIcon():Class{
return (_titleIcon);
}
public function get status():String{
return (_status);
}
private function systemManager_mouseMoveHandler(event:MouseEvent):void{
event.stopImmediatePropagation();
if (((isNaN(regX)) || (isNaN(regY)))){
return;
};
move((event.stageX - regX), (event.stageY - regY));
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
super.updateDisplayList(unscaledWidth, unscaledHeight);
layoutObject.updateDisplayList(unscaledWidth, unscaledHeight);
if (border){
border.visible = true;
};
titleBar.visible = true;
}
mx_internal function removeTitleTextField():void{
if (((titleBar) && (titleTextField))){
titleBar.removeChild(DisplayObject(titleTextField));
titleTextField = null;
};
}
public function set titleIcon(value:Class):void{
_titleIcon = value;
_titleIconChanged = true;
invalidateProperties();
invalidateSize();
dispatchEvent(new Event("titleIconChanged"));
}
}
}//package mx.containers
Section 88
//AlertForm (mx.controls.alertClasses.AlertForm)
package mx.controls.alertClasses {
import flash.display.*;
import mx.core.*;
import flash.events.*;
import mx.events.*;
import mx.managers.*;
import mx.controls.*;
import flash.text.*;
import flash.ui.*;
public class AlertForm extends UIComponent implements IFontContextComponent {
mx_internal var buttons:Array;
private var icon:DisplayObject;
mx_internal var textField:IUITextField;
mx_internal var defaultButton:Button;
private var textWidth:Number;
private var defaultButtonChanged:Boolean;// = false
private var textHeight:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
public function AlertForm(){
buttons = [];
super();
tabChildren = true;
}
override public function styleChanged(styleProp:String):void{
var buttonStyleName:String;
var n:int;
var i:int;
super.styleChanged(styleProp);
if (((((!(styleProp)) || ((styleProp == "styleName")))) || ((styleProp == "buttonStyleName")))){
if (buttons){
buttonStyleName = getStyle("buttonStyleName");
n = buttons.length;
i = 0;
while (i < n) {
buttons[i].styleName = buttonStyleName;
i++;
};
};
};
}
public function set fontContext(moduleFactory:IFlexModuleFactory):void{
this.moduleFactory = moduleFactory;
}
override protected function commitProperties():void{
var index:int;
var sm:ISystemManager;
super.commitProperties();
if (((hasFontContextChanged()) && (!((textField == null))))){
index = getChildIndex(DisplayObject(textField));
removeTextField();
createTextField(index);
};
if (((defaultButtonChanged) && (defaultButton))){
defaultButtonChanged = false;
Alert(parent).defaultButton = defaultButton;
if ((parent is IFocusManagerContainer)){
sm = Alert(parent).systemManager;
sm.activate(IFocusManagerContainer(parent));
};
defaultButton.setFocus();
};
}
private function createButton(label:String, name:String):Button{
var button:Button = new Button();
button.label = label;
button.name = name;
var buttonStyleName:String = getStyle("buttonStyleName");
if (buttonStyleName){
button.styleName = buttonStyleName;
};
button.addEventListener(MouseEvent.CLICK, clickHandler);
button.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
button.owner = parent;
addChild(button);
button.setActualSize(Alert.buttonWidth, Alert.buttonHeight);
buttons.push(button);
return (button);
}
override protected function resourcesChanged():void{
var b:Button;
super.resourcesChanged();
b = Button(getChildByName("OK"));
if (b){
b.label = String(Alert.okLabel);
};
b = Button(getChildByName("CANCEL"));
if (b){
b.label = String(Alert.cancelLabel);
};
b = Button(getChildByName("YES"));
if (b){
b.label = String(Alert.yesLabel);
};
b = Button(getChildByName("NO"));
if (b){
b.label = String(Alert.noLabel);
};
}
override protected function createChildren():void{
var label:String;
var button:Button;
super.createChildren();
createTextField(-1);
var iconClass:Class = Alert(parent).iconClass;
if (((iconClass) && (!(icon)))){
icon = new (iconClass);
addChild(icon);
};
var alert:Alert = Alert(parent);
var buttonFlags:uint = alert.buttonFlags;
var defaultButtonFlag:uint = alert.defaultButtonFlag;
if ((buttonFlags & Alert.OK)){
label = String(Alert.okLabel);
button = createButton(label, "OK");
if (defaultButtonFlag == Alert.OK){
defaultButton = button;
};
};
if ((buttonFlags & Alert.YES)){
label = String(Alert.yesLabel);
button = createButton(label, "YES");
if (defaultButtonFlag == Alert.YES){
defaultButton = button;
};
};
if ((buttonFlags & Alert.NO)){
label = String(Alert.noLabel);
button = createButton(label, "NO");
if (defaultButtonFlag == Alert.NO){
defaultButton = button;
};
};
if ((buttonFlags & Alert.CANCEL)){
label = String(Alert.cancelLabel);
button = createButton(label, "CANCEL");
if (defaultButtonFlag == Alert.CANCEL){
defaultButton = button;
};
};
if (((!(defaultButton)) && (buttons.length))){
defaultButton = buttons[0];
};
if (defaultButton){
defaultButtonChanged = true;
invalidateProperties();
};
}
override protected function measure():void{
super.measure();
var title:String = Alert(parent).title;
var lineMetrics:TextLineMetrics = Alert(parent).getTitleTextField().getUITextFormat().measureText(title);
var numButtons:int = Math.max(buttons.length, 2);
var buttonWidth:Number = ((numButtons * buttons[0].width) + ((numButtons - 1) * 8));
var buttonAndTitleWidth:Number = Math.max(buttonWidth, lineMetrics.width);
textField.width = (2 * buttonAndTitleWidth);
textWidth = (textField.textWidth + UITextField.TEXT_WIDTH_PADDING);
var prefWidth:Number = Math.max(buttonAndTitleWidth, textWidth);
prefWidth = Math.min(prefWidth, (2 * buttonAndTitleWidth));
if ((((textWidth < prefWidth)) && ((textField.multiline == true)))){
textField.multiline = false;
textField.wordWrap = false;
} else {
if (textField.multiline == false){
textField.wordWrap = true;
textField.multiline = true;
};
};
prefWidth = (prefWidth + 16);
if (icon){
prefWidth = (prefWidth + (icon.width + 8));
};
textHeight = (textField.textHeight + UITextField.TEXT_HEIGHT_PADDING);
var prefHeight:Number = textHeight;
if (icon){
prefHeight = Math.max(prefHeight, icon.height);
};
prefHeight = Math.min(prefHeight, (screen.height * 0.75));
prefHeight = (prefHeight + (buttons[0].height + (3 * 8)));
measuredWidth = prefWidth;
measuredHeight = prefHeight;
}
public function get fontContext():IFlexModuleFactory{
return (moduleFactory);
}
private function clickHandler(event:MouseEvent):void{
var name:String = Button(event.currentTarget).name;
removeAlert(name);
}
mx_internal function removeTextField():void{
if (textField){
removeChild(DisplayObject(textField));
textField = null;
};
}
override protected function keyDownHandler(event:KeyboardEvent):void{
var buttonFlags:uint = Alert(parent).buttonFlags;
if (event.keyCode == Keyboard.ESCAPE){
if ((((buttonFlags & Alert.CANCEL)) || (!((buttonFlags & Alert.NO))))){
removeAlert("CANCEL");
} else {
if ((buttonFlags & Alert.NO)){
removeAlert("NO");
};
};
};
}
mx_internal function createTextField(childIndex:int):void{
if (!textField){
textField = IUITextField(createInFontContext(UITextField));
textField.styleName = this;
textField.text = Alert(parent).text;
textField.multiline = true;
textField.wordWrap = true;
textField.selectable = true;
if (childIndex == -1){
addChild(DisplayObject(textField));
} else {
addChildAt(DisplayObject(textField), childIndex);
};
};
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
var newX:Number;
var newY:Number;
var newWidth:Number;
super.updateDisplayList(unscaledWidth, unscaledHeight);
newY = (unscaledHeight - buttons[0].height);
newWidth = ((buttons.length * (buttons[0].width + 8)) - 8);
newX = ((unscaledWidth - newWidth) / 2);
var i:int;
while (i < buttons.length) {
buttons[i].move(newX, newY);
buttons[i].tabIndex = (i + 1);
newX = (newX + (buttons[i].width + 8));
i++;
};
newWidth = textWidth;
if (icon){
newWidth = (newWidth + (icon.width + 8));
};
newX = ((unscaledWidth - newWidth) / 2);
if (icon){
icon.x = newX;
icon.y = ((newY - icon.height) / 2);
newX = (newX + (icon.width + 8));
};
var newHeight:Number = textField.getExplicitOrMeasuredHeight();
textField.move(newX, ((newY - newHeight) / 2));
textField.setActualSize((textWidth + 5), newHeight);
}
private function removeAlert(buttonPressed:String):void{
var alert:Alert = Alert(parent);
alert.visible = false;
var closeEvent:CloseEvent = new CloseEvent(CloseEvent.CLOSE);
if (buttonPressed == "YES"){
closeEvent.detail = Alert.YES;
} else {
if (buttonPressed == "NO"){
closeEvent.detail = Alert.NO;
} else {
if (buttonPressed == "OK"){
closeEvent.detail = Alert.OK;
} else {
if (buttonPressed == "CANCEL"){
closeEvent.detail = Alert.CANCEL;
};
};
};
};
alert.dispatchEvent(closeEvent);
PopUpManager.removePopUp(alert);
}
}
}//package mx.controls.alertClasses
Section 89
//DataGridListData (mx.controls.dataGridClasses.DataGridListData)
package mx.controls.dataGridClasses {
import mx.core.*;
import mx.controls.listClasses.*;
public class DataGridListData extends BaseListData {
public var dataField:String;
mx_internal static const VERSION:String = "3.2.0.3958";
public function DataGridListData(text:String, dataField:String, columnIndex:int, uid:String, owner:IUIComponent, rowIndex:int=0){
super(text, uid, owner, rowIndex, columnIndex);
this.dataField = dataField;
}
}
}//package mx.controls.dataGridClasses
Section 90
//BaseListData (mx.controls.listClasses.BaseListData)
package mx.controls.listClasses {
import mx.core.*;
public class BaseListData {
private var _uid:String;
public var owner:IUIComponent;
public var label:String;
public var rowIndex:int;
public var columnIndex:int;
mx_internal static const VERSION:String = "3.2.0.3958";
public function BaseListData(label:String, uid:String, owner:IUIComponent, rowIndex:int=0, columnIndex:int=0){
super();
this.label = label;
this.uid = uid;
this.owner = owner;
this.rowIndex = rowIndex;
this.columnIndex = columnIndex;
}
public function set uid(value:String):void{
_uid = value;
}
public function get uid():String{
return (_uid);
}
}
}//package mx.controls.listClasses
Section 91
//IDropInListItemRenderer (mx.controls.listClasses.IDropInListItemRenderer)
package mx.controls.listClasses {
public interface IDropInListItemRenderer {
function get listData():BaseListData;
function set listData(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\controls\listClasses;IDropInListItemRenderer.as:BaseListData):void;
}
}//package mx.controls.listClasses
Section 92
//IListItemRenderer (mx.controls.listClasses.IListItemRenderer)
package mx.controls.listClasses {
import mx.core.*;
import flash.events.*;
import mx.managers.*;
import mx.styles.*;
public interface IListItemRenderer extends IDataRenderer, IEventDispatcher, IFlexDisplayObject, ILayoutManagerClient, ISimpleStyleClient, IUIComponent {
}
}//package mx.controls.listClasses
Section 93
//ScrollBar (mx.controls.scrollClasses.ScrollBar)
package mx.controls.scrollClasses {
import flash.display.*;
import mx.core.*;
import flash.geom.*;
import flash.events.*;
import mx.events.*;
import mx.controls.*;
import mx.styles.*;
import flash.ui.*;
import flash.utils.*;
public class ScrollBar extends UIComponent {
private var _direction:String;// = "vertical"
private var _pageScrollSize:Number;// = 0
mx_internal var scrollTrack:Button;
mx_internal var downArrow:Button;
mx_internal var scrollThumb:ScrollThumb;
private var trackScrollRepeatDirection:int;
private var _minScrollPosition:Number;// = 0
private var trackPosition:Number;
private var _pageSize:Number;// = 0
mx_internal var _minHeight:Number;// = 32
private var _maxScrollPosition:Number;// = 0
private var trackScrollTimer:Timer;
mx_internal var upArrow:Button;
private var _lineScrollSize:Number;// = 1
private var _scrollPosition:Number;// = 0
private var trackScrolling:Boolean;// = false
mx_internal var isScrolling:Boolean;
mx_internal var oldPosition:Number;
mx_internal var _minWidth:Number;// = 16
mx_internal static const VERSION:String = "3.2.0.3958";
public static const THICKNESS:Number = 16;
public function ScrollBar(){
super();
}
override public function set enabled(value:Boolean):void{
super.enabled = value;
invalidateDisplayList();
}
public function set lineScrollSize(value:Number):void{
_lineScrollSize = value;
}
public function get minScrollPosition():Number{
return (_minScrollPosition);
}
mx_internal function dispatchScrollEvent(oldPosition:Number, detail:String):void{
var event:ScrollEvent = new ScrollEvent(ScrollEvent.SCROLL);
event.detail = detail;
event.position = scrollPosition;
event.delta = (scrollPosition - oldPosition);
event.direction = direction;
dispatchEvent(event);
}
private function downArrow_buttonDownHandler(event:FlexEvent):void{
if (isNaN(oldPosition)){
oldPosition = scrollPosition;
};
lineScroll(1);
}
private function scrollTrack_mouseDownHandler(event:MouseEvent):void{
if (!(((event.target == this)) || ((event.target == scrollTrack)))){
return;
};
trackScrolling = true;
var sbRoot:DisplayObject = systemManager.getSandboxRoot();
sbRoot.addEventListener(MouseEvent.MOUSE_UP, scrollTrack_mouseUpHandler, true);
sbRoot.addEventListener(MouseEvent.MOUSE_MOVE, scrollTrack_mouseMoveHandler, true);
sbRoot.addEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE, scrollTrack_mouseLeaveHandler);
systemManager.deployMouseShields(true);
var pt:Point = new Point(event.localX, event.localY);
pt = event.target.localToGlobal(pt);
pt = globalToLocal(pt);
trackPosition = pt.y;
if (isNaN(oldPosition)){
oldPosition = scrollPosition;
};
trackScrollRepeatDirection = (((scrollThumb.y + scrollThumb.height) < pt.y)) ? 1 : ((scrollThumb.y > pt.y)) ? -1 : 0;
pageScroll(trackScrollRepeatDirection);
if (!trackScrollTimer){
trackScrollTimer = new Timer(getStyle("repeatDelay"), 1);
trackScrollTimer.addEventListener(TimerEvent.TIMER, trackScrollTimerHandler);
};
trackScrollTimer.start();
}
public function set minScrollPosition(value:Number):void{
_minScrollPosition = value;
invalidateDisplayList();
}
public function get scrollPosition():Number{
return (_scrollPosition);
}
mx_internal function get linePlusDetail():String{
return (((direction == ScrollBarDirection.VERTICAL)) ? ScrollEventDetail.LINE_DOWN : ScrollEventDetail.LINE_RIGHT);
}
public function get maxScrollPosition():Number{
return (_maxScrollPosition);
}
protected function get thumbStyleFilters():Object{
return (null);
}
override public function set doubleClickEnabled(value:Boolean):void{
}
public function get lineScrollSize():Number{
return (_lineScrollSize);
}
mx_internal function get virtualHeight():Number{
return (unscaledHeight);
}
public function set scrollPosition(value:Number):void{
var denom:Number;
var y:Number;
var x:Number;
_scrollPosition = value;
if (scrollThumb){
if (!cacheAsBitmap){
cacheHeuristic = (scrollThumb.cacheHeuristic = true);
};
if (!isScrolling){
value = Math.min(value, maxScrollPosition);
value = Math.max(value, minScrollPosition);
denom = (maxScrollPosition - minScrollPosition);
y = ((((denom == 0)) || (isNaN(denom)))) ? 0 : ((((value - minScrollPosition) * (trackHeight - scrollThumb.height)) / denom) + trackY);
x = (((virtualWidth - scrollThumb.width) / 2) + getStyle("thumbOffset"));
scrollThumb.move(Math.round(x), Math.round(y));
};
};
}
protected function get downArrowStyleFilters():Object{
return (null);
}
public function get pageSize():Number{
return (_pageSize);
}
public function set pageScrollSize(value:Number):void{
_pageScrollSize = value;
}
public function set maxScrollPosition(value:Number):void{
_maxScrollPosition = value;
invalidateDisplayList();
}
mx_internal function pageScroll(direction:int):void{
var oldPosition:Number;
var detail:String;
var delta:Number = ((_pageScrollSize)!=0) ? _pageScrollSize : pageSize;
var newPos:Number = (_scrollPosition + (direction * delta));
if (newPos > maxScrollPosition){
newPos = maxScrollPosition;
} else {
if (newPos < minScrollPosition){
newPos = minScrollPosition;
};
};
if (newPos != scrollPosition){
oldPosition = scrollPosition;
scrollPosition = newPos;
detail = ((direction < 0)) ? pageMinusDetail : pagePlusDetail;
dispatchScrollEvent(oldPosition, detail);
};
}
override protected function createChildren():void{
super.createChildren();
if (!scrollTrack){
scrollTrack = new Button();
scrollTrack.focusEnabled = false;
scrollTrack.skinName = "trackSkin";
scrollTrack.upSkinName = "trackUpSkin";
scrollTrack.overSkinName = "trackOverSkin";
scrollTrack.downSkinName = "trackDownSkin";
scrollTrack.disabledSkinName = "trackDisabledSkin";
if ((scrollTrack is ISimpleStyleClient)){
ISimpleStyleClient(scrollTrack).styleName = this;
};
addChild(scrollTrack);
scrollTrack.validateProperties();
};
if (!upArrow){
upArrow = new Button();
upArrow.enabled = false;
upArrow.autoRepeat = true;
upArrow.focusEnabled = false;
upArrow.upSkinName = "upArrowUpSkin";
upArrow.overSkinName = "upArrowOverSkin";
upArrow.downSkinName = "upArrowDownSkin";
upArrow.disabledSkinName = "upArrowDisabledSkin";
upArrow.skinName = "upArrowSkin";
upArrow.upIconName = "";
upArrow.overIconName = "";
upArrow.downIconName = "";
upArrow.disabledIconName = "";
addChild(upArrow);
upArrow.styleName = new StyleProxy(this, upArrowStyleFilters);
upArrow.validateProperties();
upArrow.addEventListener(FlexEvent.BUTTON_DOWN, upArrow_buttonDownHandler);
};
if (!downArrow){
downArrow = new Button();
downArrow.enabled = false;
downArrow.autoRepeat = true;
downArrow.focusEnabled = false;
downArrow.upSkinName = "downArrowUpSkin";
downArrow.overSkinName = "downArrowOverSkin";
downArrow.downSkinName = "downArrowDownSkin";
downArrow.disabledSkinName = "downArrowDisabledSkin";
downArrow.skinName = "downArrowSkin";
downArrow.upIconName = "";
downArrow.overIconName = "";
downArrow.downIconName = "";
downArrow.disabledIconName = "";
addChild(downArrow);
downArrow.styleName = new StyleProxy(this, downArrowStyleFilters);
downArrow.validateProperties();
downArrow.addEventListener(FlexEvent.BUTTON_DOWN, downArrow_buttonDownHandler);
};
}
private function scrollTrack_mouseOverHandler(event:MouseEvent):void{
if (!(((event.target == this)) || ((event.target == scrollTrack)))){
return;
};
if (trackScrolling){
trackScrollTimer.start();
};
}
private function get minDetail():String{
return (((direction == ScrollBarDirection.VERTICAL)) ? ScrollEventDetail.AT_TOP : ScrollEventDetail.AT_LEFT);
}
mx_internal function isScrollBarKey(key:uint):Boolean{
var oldPosition:Number;
if (key == Keyboard.HOME){
if (scrollPosition != 0){
oldPosition = scrollPosition;
scrollPosition = 0;
dispatchScrollEvent(oldPosition, minDetail);
};
return (true);
} else {
if (key == Keyboard.END){
if (scrollPosition < maxScrollPosition){
oldPosition = scrollPosition;
scrollPosition = maxScrollPosition;
dispatchScrollEvent(oldPosition, maxDetail);
};
return (true);
};
};
return (false);
}
mx_internal function get lineMinusDetail():String{
return (((direction == ScrollBarDirection.VERTICAL)) ? ScrollEventDetail.LINE_UP : ScrollEventDetail.LINE_LEFT);
}
mx_internal function get pageMinusDetail():String{
return (((direction == ScrollBarDirection.VERTICAL)) ? ScrollEventDetail.PAGE_UP : ScrollEventDetail.PAGE_LEFT);
}
private function get maxDetail():String{
return (((direction == ScrollBarDirection.VERTICAL)) ? ScrollEventDetail.AT_BOTTOM : ScrollEventDetail.AT_RIGHT);
}
private function scrollTrack_mouseLeaveHandler(event:Event):void{
trackScrolling = false;
var sbRoot:DisplayObject = systemManager.getSandboxRoot();
sbRoot.removeEventListener(MouseEvent.MOUSE_UP, scrollTrack_mouseUpHandler, true);
sbRoot.removeEventListener(MouseEvent.MOUSE_MOVE, scrollTrack_mouseMoveHandler, true);
sbRoot.removeEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE, scrollTrack_mouseLeaveHandler);
systemManager.deployMouseShields(false);
if (trackScrollTimer){
trackScrollTimer.reset();
};
if (event.target != scrollTrack){
return;
};
var detail:String = ((oldPosition > scrollPosition)) ? pageMinusDetail : pagePlusDetail;
dispatchScrollEvent(oldPosition, detail);
oldPosition = NaN;
}
protected function get upArrowStyleFilters():Object{
return (null);
}
private function get trackHeight():Number{
return ((virtualHeight - (upArrow.getExplicitOrMeasuredHeight() + downArrow.getExplicitOrMeasuredHeight())));
}
public function get pageScrollSize():Number{
return (_pageScrollSize);
}
override protected function measure():void{
super.measure();
upArrow.validateSize();
downArrow.validateSize();
scrollTrack.validateSize();
if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0){
_minWidth = (scrollThumb) ? scrollThumb.getExplicitOrMeasuredWidth() : 0;
_minWidth = Math.max(scrollTrack.getExplicitOrMeasuredWidth(), upArrow.getExplicitOrMeasuredWidth(), downArrow.getExplicitOrMeasuredWidth(), _minWidth);
} else {
_minWidth = upArrow.getExplicitOrMeasuredWidth();
};
_minHeight = (upArrow.getExplicitOrMeasuredHeight() + downArrow.getExplicitOrMeasuredHeight());
}
mx_internal function lineScroll(direction:int):void{
var oldPosition:Number;
var detail:String;
var delta:Number = _lineScrollSize;
var newPos:Number = (_scrollPosition + (direction * delta));
if (newPos > maxScrollPosition){
newPos = maxScrollPosition;
} else {
if (newPos < minScrollPosition){
newPos = minScrollPosition;
};
};
if (newPos != scrollPosition){
oldPosition = scrollPosition;
scrollPosition = newPos;
detail = ((direction < 0)) ? lineMinusDetail : linePlusDetail;
dispatchScrollEvent(oldPosition, detail);
};
}
public function setScrollProperties(pageSize:Number, minScrollPosition:Number, maxScrollPosition:Number, pageScrollSize:Number=0):void{
var thumbHeight:Number;
this.pageSize = pageSize;
_pageScrollSize = ((pageScrollSize)>0) ? pageScrollSize : pageSize;
this.minScrollPosition = Math.max(minScrollPosition, 0);
this.maxScrollPosition = Math.max(maxScrollPosition, 0);
_scrollPosition = Math.max(this.minScrollPosition, _scrollPosition);
_scrollPosition = Math.min(this.maxScrollPosition, _scrollPosition);
if (((((this.maxScrollPosition - this.minScrollPosition) > 0)) && (enabled))){
upArrow.enabled = true;
downArrow.enabled = true;
scrollTrack.enabled = true;
addEventListener(MouseEvent.MOUSE_DOWN, scrollTrack_mouseDownHandler);
addEventListener(MouseEvent.MOUSE_OVER, scrollTrack_mouseOverHandler);
addEventListener(MouseEvent.MOUSE_OUT, scrollTrack_mouseOutHandler);
if (!scrollThumb){
scrollThumb = new ScrollThumb();
scrollThumb.focusEnabled = false;
addChildAt(scrollThumb, getChildIndex(downArrow));
scrollThumb.styleName = new StyleProxy(this, thumbStyleFilters);
scrollThumb.upSkinName = "thumbUpSkin";
scrollThumb.overSkinName = "thumbOverSkin";
scrollThumb.downSkinName = "thumbDownSkin";
scrollThumb.iconName = "thumbIcon";
scrollThumb.skinName = "thumbSkin";
};
thumbHeight = ((trackHeight < 0)) ? 0 : Math.round(((pageSize / ((this.maxScrollPosition - this.minScrollPosition) + pageSize)) * trackHeight));
if (thumbHeight < scrollThumb.minHeight){
if (trackHeight < scrollThumb.minHeight){
scrollThumb.visible = false;
} else {
thumbHeight = scrollThumb.minHeight;
scrollThumb.visible = true;
scrollThumb.setActualSize(scrollThumb.measuredWidth, scrollThumb.minHeight);
};
} else {
scrollThumb.visible = true;
scrollThumb.setActualSize(scrollThumb.measuredWidth, thumbHeight);
};
scrollThumb.setRange((upArrow.getExplicitOrMeasuredHeight() + 0), ((virtualHeight - downArrow.getExplicitOrMeasuredHeight()) - scrollThumb.height), this.minScrollPosition, this.maxScrollPosition);
scrollPosition = Math.max(Math.min(scrollPosition, this.maxScrollPosition), this.minScrollPosition);
} else {
upArrow.enabled = false;
downArrow.enabled = false;
scrollTrack.enabled = false;
if (scrollThumb){
scrollThumb.visible = false;
};
};
}
private function trackScrollTimerHandler(event:Event):void{
if (trackScrollRepeatDirection == 1){
if ((scrollThumb.y + scrollThumb.height) > trackPosition){
return;
};
};
if (trackScrollRepeatDirection == -1){
if (scrollThumb.y < trackPosition){
return;
};
};
pageScroll(trackScrollRepeatDirection);
if (((trackScrollTimer) && ((trackScrollTimer.repeatCount == 1)))){
trackScrollTimer.delay = getStyle("repeatInterval");
trackScrollTimer.repeatCount = 0;
};
}
private function upArrow_buttonDownHandler(event:FlexEvent):void{
if (isNaN(oldPosition)){
oldPosition = scrollPosition;
};
lineScroll(-1);
}
public function set pageSize(value:Number):void{
_pageSize = value;
}
private function get trackY():Number{
return (upArrow.getExplicitOrMeasuredHeight());
}
private function scrollTrack_mouseOutHandler(event:MouseEvent):void{
if (trackScrolling){
trackScrollTimer.stop();
};
}
private function scrollTrack_mouseUpHandler(event:MouseEvent):void{
scrollTrack_mouseLeaveHandler(event);
}
private function scrollTrack_mouseMoveHandler(event:MouseEvent):void{
var pt:Point;
if (trackScrolling){
pt = new Point(event.stageX, event.stageY);
pt = globalToLocal(pt);
trackPosition = pt.y;
};
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
if ($height == 1){
return;
};
if (!upArrow){
return;
};
super.updateDisplayList(unscaledWidth, unscaledHeight);
if (cacheAsBitmap){
cacheHeuristic = (scrollThumb.cacheHeuristic = false);
};
upArrow.setActualSize(upArrow.getExplicitOrMeasuredWidth(), upArrow.getExplicitOrMeasuredHeight());
if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0){
upArrow.move(((virtualWidth - upArrow.width) / 2), 0);
} else {
upArrow.move(0, 0);
};
scrollTrack.setActualSize(scrollTrack.getExplicitOrMeasuredWidth(), virtualHeight);
if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0){
scrollTrack.x = ((virtualWidth - scrollTrack.width) / 2);
};
scrollTrack.y = 0;
downArrow.setActualSize(downArrow.getExplicitOrMeasuredWidth(), downArrow.getExplicitOrMeasuredHeight());
if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0){
downArrow.move(((virtualWidth - downArrow.width) / 2), (virtualHeight - downArrow.getExplicitOrMeasuredHeight()));
} else {
downArrow.move(0, (virtualHeight - downArrow.getExplicitOrMeasuredHeight()));
};
setScrollProperties(pageSize, minScrollPosition, maxScrollPosition, _pageScrollSize);
scrollPosition = _scrollPosition;
}
mx_internal function get pagePlusDetail():String{
return (((direction == ScrollBarDirection.VERTICAL)) ? ScrollEventDetail.PAGE_DOWN : ScrollEventDetail.PAGE_RIGHT);
}
mx_internal function get virtualWidth():Number{
return (unscaledWidth);
}
public function set direction(value:String):void{
_direction = value;
invalidateSize();
invalidateDisplayList();
dispatchEvent(new Event("directionChanged"));
}
public function get direction():String{
return (_direction);
}
}
}//package mx.controls.scrollClasses
Section 94
//ScrollBarDirection (mx.controls.scrollClasses.ScrollBarDirection)
package mx.controls.scrollClasses {
public final class ScrollBarDirection {
public static const HORIZONTAL:String = "horizontal";
public static const VERTICAL:String = "vertical";
mx_internal static const VERSION:String = "3.2.0.3958";
public function ScrollBarDirection(){
super();
}
}
}//package mx.controls.scrollClasses
Section 95
//ScrollThumb (mx.controls.scrollClasses.ScrollThumb)
package mx.controls.scrollClasses {
import flash.geom.*;
import flash.events.*;
import mx.events.*;
import mx.controls.*;
public class ScrollThumb extends Button {
private var lastY:Number;
private var datamin:Number;
private var ymax:Number;
private var ymin:Number;
private var datamax:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
public function ScrollThumb(){
super();
explicitMinHeight = 10;
stickyHighlighting = true;
}
private function stopDragThumb():void{
var scrollBar:ScrollBar = ScrollBar(parent);
scrollBar.isScrolling = false;
scrollBar.dispatchScrollEvent(scrollBar.oldPosition, ScrollEventDetail.THUMB_POSITION);
scrollBar.oldPosition = NaN;
systemManager.getSandboxRoot().removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true);
}
override protected function mouseDownHandler(event:MouseEvent):void{
super.mouseDownHandler(event);
var scrollBar:ScrollBar = ScrollBar(parent);
scrollBar.oldPosition = scrollBar.scrollPosition;
lastY = event.localY;
systemManager.getSandboxRoot().addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true);
}
private function mouseMoveHandler(event:MouseEvent):void{
if (ymin == ymax){
return;
};
var pt:Point = new Point(event.stageX, event.stageY);
pt = globalToLocal(pt);
var scrollMove:Number = (pt.y - lastY);
scrollMove = (scrollMove + y);
if (scrollMove < ymin){
scrollMove = ymin;
} else {
if (scrollMove > ymax){
scrollMove = ymax;
};
};
var scrollBar:ScrollBar = ScrollBar(parent);
scrollBar.isScrolling = true;
$y = scrollMove;
var oldPosition:Number = scrollBar.scrollPosition;
var pos:Number = (Math.round((((datamax - datamin) * (y - ymin)) / (ymax - ymin))) + datamin);
scrollBar.scrollPosition = pos;
scrollBar.dispatchScrollEvent(oldPosition, ScrollEventDetail.THUMB_TRACK);
event.updateAfterEvent();
}
override mx_internal function buttonReleased():void{
super.buttonReleased();
stopDragThumb();
}
mx_internal function setRange(ymin:Number, ymax:Number, datamin:Number, datamax:Number):void{
this.ymin = ymin;
this.ymax = ymax;
this.datamin = datamin;
this.datamax = datamax;
}
}
}//package mx.controls.scrollClasses
Section 96
//Alert (mx.controls.Alert)
package mx.controls {
import flash.display.*;
import mx.core.*;
import flash.events.*;
import mx.events.*;
import mx.managers.*;
import mx.resources.*;
import mx.containers.*;
import mx.controls.alertClasses.*;
public class Alert extends Panel {
mx_internal var alertForm:AlertForm;
public var defaultButtonFlag:uint;// = 4
public var text:String;// = ""
public var buttonFlags:uint;// = 4
public var iconClass:Class;
public static const NONMODAL:uint = 0x8000;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const NO:uint = 2;
public static const YES:uint = 1;
public static const OK:uint = 4;
public static const CANCEL:uint = 8;
mx_internal static var createAccessibilityImplementation:Function;
private static var cancelLabelOverride:String;
private static var _resourceManager:IResourceManager;
public static var buttonHeight:Number = 22;
private static var noLabelOverride:String;
private static var _yesLabel:String;
private static var yesLabelOverride:String;
public static var buttonWidth:Number = ((FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)) ? 60 : 65;
;
private static var _okLabel:String;
private static var initialized:Boolean = false;
private static var _cancelLabel:String;
private static var okLabelOverride:String;
private static var _noLabel:String;
public function Alert(){
super();
title = "";
}
override public function styleChanged(styleProp:String):void{
var messageStyleName:String;
super.styleChanged(styleProp);
if (styleProp == "messageStyleName"){
messageStyleName = getStyle("messageStyleName");
styleName = messageStyleName;
};
if (alertForm){
alertForm.styleChanged(styleProp);
};
}
override protected function measure():void{
super.measure();
var m:EdgeMetrics = viewMetrics;
measuredWidth = Math.max(measuredWidth, ((alertForm.getExplicitOrMeasuredWidth() + m.left) + m.right));
measuredHeight = ((alertForm.getExplicitOrMeasuredHeight() + m.top) + m.bottom);
}
override protected function resourcesChanged():void{
super.resourcesChanged();
static_resourcesChanged();
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
super.updateDisplayList(unscaledWidth, unscaledHeight);
var vm:EdgeMetrics = viewMetrics;
alertForm.setActualSize(((((unscaledWidth - vm.left) - vm.right) - getStyle("paddingLeft")) - getStyle("paddingRight")), ((((unscaledHeight - vm.top) - vm.bottom) - getStyle("paddingTop")) - getStyle("paddingBottom")));
}
override protected function createChildren():void{
super.createChildren();
var messageStyleName:String = getStyle("messageStyleName");
if (messageStyleName){
styleName = messageStyleName;
};
if (!alertForm){
alertForm = new AlertForm();
alertForm.styleName = this;
addChild(alertForm);
};
}
override protected function initializeAccessibility():void{
if (Alert.createAccessibilityImplementation != null){
Alert.createAccessibilityImplementation(this);
};
}
private static function initialize():void{
if (!initialized){
resourceManager.addEventListener(Event.CHANGE, static_resourceManager_changeHandler, false, 0, true);
static_resourcesChanged();
initialized = true;
};
}
private static function static_resourcesChanged():void{
cancelLabel = cancelLabelOverride;
noLabel = noLabelOverride;
okLabel = okLabelOverride;
yesLabel = yesLabelOverride;
}
public static function get cancelLabel():String{
initialize();
return (_cancelLabel);
}
public static function set yesLabel(value:String):void{
yesLabelOverride = value;
_yesLabel = ((value)!=null) ? value : resourceManager.getString("controls", "yesLabel");
}
private static function static_creationCompleteHandler(event:FlexEvent):void{
if ((((event.target is IFlexDisplayObject)) && ((event.eventPhase == EventPhase.AT_TARGET)))){
event.target.removeEventListener(FlexEvent.CREATION_COMPLETE, static_creationCompleteHandler);
PopUpManager.centerPopUp(IFlexDisplayObject(event.target));
};
}
public static function get noLabel():String{
initialize();
return (_noLabel);
}
public static function set cancelLabel(value:String):void{
cancelLabelOverride = value;
_cancelLabel = ((value)!=null) ? value : resourceManager.getString("controls", "cancelLabel");
}
private static function get resourceManager():IResourceManager{
if (!_resourceManager){
_resourceManager = ResourceManager.getInstance();
};
return (_resourceManager);
}
public static function get yesLabel():String{
initialize();
return (_yesLabel);
}
public static function set noLabel(value:String):void{
noLabelOverride = value;
_noLabel = ((value)!=null) ? value : resourceManager.getString("controls", "noLabel");
}
private static function static_resourceManager_changeHandler(event:Event):void{
static_resourcesChanged();
}
public static function set okLabel(value:String):void{
okLabelOverride = value;
_okLabel = ((value)!=null) ? value : resourceManager.getString("controls", "okLabel");
}
public static function get okLabel():String{
initialize();
return (_okLabel);
}
public static function show(text:String="", title:String="", flags:uint=4, parent:Sprite=null, closeHandler:Function=null, iconClass:Class=null, defaultButtonFlag:uint=4):Alert{
var sm:ISystemManager;
var modal:Boolean = ((flags & Alert.NONMODAL)) ? false : true;
if (!parent){
sm = ISystemManager(Application.application.systemManager);
if (sm.useSWFBridge()){
parent = Sprite(sm.getSandboxRoot());
} else {
parent = Sprite(Application.application);
};
};
var alert:Alert = new (Alert);
if ((((((((flags & Alert.OK)) || ((flags & Alert.CANCEL)))) || ((flags & Alert.YES)))) || ((flags & Alert.NO)))){
alert.buttonFlags = flags;
};
if ((((((((defaultButtonFlag == Alert.OK)) || ((defaultButtonFlag == Alert.CANCEL)))) || ((defaultButtonFlag == Alert.YES)))) || ((defaultButtonFlag == Alert.NO)))){
alert.defaultButtonFlag = defaultButtonFlag;
};
alert.text = text;
alert.title = title;
alert.iconClass = iconClass;
if (closeHandler != null){
alert.addEventListener(CloseEvent.CLOSE, closeHandler);
};
if ((parent is UIComponent)){
alert.moduleFactory = UIComponent(parent).moduleFactory;
};
PopUpManager.addPopUp(alert, parent, modal);
alert.setActualSize(alert.getExplicitOrMeasuredWidth(), alert.getExplicitOrMeasuredHeight());
alert.addEventListener(FlexEvent.CREATION_COMPLETE, static_creationCompleteHandler);
return (alert);
}
}
}//package mx.controls
Section 97
//Button (mx.controls.Button)
package mx.controls {
import flash.display.*;
import mx.core.*;
import flash.events.*;
import mx.events.*;
import mx.managers.*;
import mx.styles.*;
import mx.controls.listClasses.*;
import flash.text.*;
import flash.ui.*;
import flash.utils.*;
import mx.controls.dataGridClasses.*;
public class Button extends UIComponent implements IDataRenderer, IDropInListItemRenderer, IFocusManagerComponent, IListItemRenderer, IFontContextComponent, IButton {
mx_internal var _emphasized:Boolean;// = false
mx_internal var extraSpacing:Number;// = 20
private var icons:Array;
public var selectedField:String;// = null
private var labelChanged:Boolean;// = false
private var skinMeasuredWidth:Number;
mx_internal var checkedDefaultSkin:Boolean;// = false
private var autoRepeatTimer:Timer;
mx_internal var disabledIconName:String;// = "disabledIcon"
mx_internal var disabledSkinName:String;// = "disabledSkin"
mx_internal var checkedDefaultIcon:Boolean;// = false
public var stickyHighlighting:Boolean;// = false
private var enabledChanged:Boolean;// = false
mx_internal var selectedUpIconName:String;// = "selectedUpIcon"
mx_internal var selectedUpSkinName:String;// = "selectedUpSkin"
mx_internal var upIconName:String;// = "upIcon"
mx_internal var upSkinName:String;// = "upSkin"
mx_internal var centerContent:Boolean;// = true
mx_internal var buttonOffset:Number;// = 0
private var skinMeasuredHeight:Number;
private var oldUnscaledWidth:Number;
mx_internal var downIconName:String;// = "downIcon"
mx_internal var _labelPlacement:String;// = "right"
mx_internal var downSkinName:String;// = "downSkin"
mx_internal var _toggle:Boolean;// = false
private var _phase:String;// = "up"
private var toolTipSet:Boolean;// = false
private var _data:Object;
mx_internal var currentIcon:IFlexDisplayObject;
mx_internal var currentSkin:IFlexDisplayObject;
mx_internal var overIconName:String;// = "overIcon"
mx_internal var selectedDownIconName:String;// = "selectedDownIcon"
mx_internal var overSkinName:String;// = "overSkin"
mx_internal var iconName:String;// = "icon"
mx_internal var skinName:String;// = "skin"
mx_internal var selectedDownSkinName:String;// = "selectedDownSkin"
private var skins:Array;
private var selectedSet:Boolean;
private var _autoRepeat:Boolean;// = false
private var styleChangedFlag:Boolean;// = true
mx_internal var selectedOverIconName:String;// = "selectedOverIcon"
private var _listData:BaseListData;
mx_internal var selectedOverSkinName:String;// = "selectedOverSkin"
protected var textField:IUITextField;
private var labelSet:Boolean;
mx_internal var defaultIconUsesStates:Boolean;// = false
mx_internal var defaultSkinUsesStates:Boolean;// = false
mx_internal var toggleChanged:Boolean;// = false
private var emphasizedChanged:Boolean;// = false
private var _label:String;// = ""
mx_internal var _selected:Boolean;// = false
mx_internal var selectedDisabledIconName:String;// = "selectedDisabledIcon"
mx_internal var selectedDisabledSkinName:String;// = "selectedDisabledSkin"
mx_internal static const VERSION:String = "3.2.0.3958";
mx_internal static var createAccessibilityImplementation:Function;
mx_internal static var TEXT_WIDTH_PADDING:Number = 6;
public function Button(){
skins = [];
icons = [];
super();
mouseChildren = false;
addEventListener(MouseEvent.ROLL_OVER, rollOverHandler);
addEventListener(MouseEvent.ROLL_OUT, rollOutHandler);
addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
addEventListener(MouseEvent.CLICK, clickHandler);
}
private function previousVersion_measure():void{
var bm:EdgeMetrics;
var lineMetrics:TextLineMetrics;
var paddingLeft:Number;
var paddingRight:Number;
var paddingTop:Number;
var paddingBottom:Number;
var horizontalGap:Number;
super.measure();
var textWidth:Number = 0;
var textHeight:Number = 0;
if (label){
lineMetrics = measureText(label);
textWidth = lineMetrics.width;
textHeight = lineMetrics.height;
paddingLeft = getStyle("paddingLeft");
paddingRight = getStyle("paddingRight");
paddingTop = getStyle("paddingTop");
paddingBottom = getStyle("paddingBottom");
textWidth = (textWidth + ((paddingLeft + paddingRight) + getStyle("textIndent")));
textHeight = (textHeight + (paddingTop + paddingBottom));
};
bm = currentSkin["borderMetrics"];
//unresolved jump
var _slot1 = e;
bm = new EdgeMetrics(3, 3, 3, 3);
var tempCurrentIcon:IFlexDisplayObject = getCurrentIcon();
var iconWidth:Number = (tempCurrentIcon) ? tempCurrentIcon.width : 0;
var iconHeight:Number = (tempCurrentIcon) ? tempCurrentIcon.height : 0;
var w:Number = 0;
var h:Number = 0;
if ((((labelPlacement == ButtonLabelPlacement.LEFT)) || ((labelPlacement == ButtonLabelPlacement.RIGHT)))){
w = (textWidth + iconWidth);
if (iconWidth != 0){
horizontalGap = getStyle("horizontalGap");
w = (w + (horizontalGap - 2));
};
h = Math.max(textHeight, (iconHeight + 6));
} else {
w = Math.max(textWidth, iconWidth);
h = (textHeight + iconHeight);
if (iconHeight != 0){
h = (h + getStyle("verticalGap"));
};
};
if (bm){
w = (w + (bm.left + bm.right));
h = (h + (bm.top + bm.bottom));
};
if (((label) && (!((label.length == 0))))){
w = (w + extraSpacing);
} else {
w = (w + 6);
};
if (((currentSkin) && (((isNaN(skinMeasuredWidth)) || (isNaN(skinMeasuredHeight)))))){
skinMeasuredWidth = currentSkin.measuredWidth;
skinMeasuredHeight = currentSkin.measuredHeight;
};
if (!isNaN(skinMeasuredWidth)){
w = Math.max(skinMeasuredWidth, w);
};
if (!isNaN(skinMeasuredHeight)){
h = Math.max(skinMeasuredHeight, h);
};
measuredMinWidth = (measuredWidth = w);
measuredMinHeight = (measuredHeight = h);
}
public function get label():String{
return (_label);
}
mx_internal function getCurrentIconName():String{
var tempIconName:String;
if (!enabled){
tempIconName = (selected) ? selectedDisabledIconName : disabledIconName;
} else {
if (phase == ButtonPhase.UP){
tempIconName = (selected) ? selectedUpIconName : upIconName;
} else {
if (phase == ButtonPhase.OVER){
tempIconName = (selected) ? selectedOverIconName : overIconName;
} else {
if (phase == ButtonPhase.DOWN){
tempIconName = (selected) ? selectedDownIconName : downIconName;
};
};
};
};
return (tempIconName);
}
protected function mouseUpHandler(event:MouseEvent):void{
if (!enabled){
return;
};
phase = ButtonPhase.OVER;
buttonReleased();
if (!toggle){
event.updateAfterEvent();
};
}
override protected function adjustFocusRect(object:DisplayObject=null):void{
super.adjustFocusRect((currentSkin) ? this : DisplayObject(currentIcon));
}
mx_internal function set phase(value:String):void{
_phase = value;
invalidateSize();
invalidateDisplayList();
}
mx_internal function viewIconForPhase(tempIconName:String):IFlexDisplayObject{
var newIcon:IFlexDisplayObject;
var sizeIcon:Boolean;
var stateName:String;
var newIconClass:Class = Class(getStyle(tempIconName));
if (!newIconClass){
newIconClass = Class(getStyle(iconName));
if (defaultIconUsesStates){
tempIconName = iconName;
};
if (((!(checkedDefaultIcon)) && (newIconClass))){
newIcon = IFlexDisplayObject(new (newIconClass));
if (((!((newIcon is IProgrammaticSkin))) && ((newIcon is IStateClient)))){
defaultIconUsesStates = true;
tempIconName = iconName;
};
if (newIcon){
checkedDefaultIcon = true;
};
};
};
newIcon = IFlexDisplayObject(getChildByName(tempIconName));
if (newIcon == null){
if (newIconClass != null){
newIcon = IFlexDisplayObject(new (newIconClass));
newIcon.name = tempIconName;
if ((newIcon is ISimpleStyleClient)){
ISimpleStyleClient(newIcon).styleName = this;
};
addChild(DisplayObject(newIcon));
sizeIcon = false;
if ((newIcon is IInvalidating)){
IInvalidating(newIcon).validateNow();
sizeIcon = true;
} else {
if ((newIcon is IProgrammaticSkin)){
IProgrammaticSkin(newIcon).validateDisplayList();
sizeIcon = true;
};
};
if (((newIcon) && ((newIcon is IUIComponent)))){
IUIComponent(newIcon).enabled = enabled;
};
if (sizeIcon){
newIcon.setActualSize(newIcon.measuredWidth, newIcon.measuredHeight);
};
icons.push(newIcon);
};
};
if (currentIcon != null){
currentIcon.visible = false;
};
currentIcon = newIcon;
if (((defaultIconUsesStates) && ((currentIcon is IStateClient)))){
stateName = "";
if (!enabled){
stateName = (selected) ? "selectedDisabled" : "disabled";
} else {
if (phase == ButtonPhase.UP){
stateName = (selected) ? "selectedUp" : "up";
} else {
if (phase == ButtonPhase.OVER){
stateName = (selected) ? "selectedOver" : "over";
} else {
if (phase == ButtonPhase.DOWN){
stateName = (selected) ? "selectedDown" : "down";
};
};
};
};
IStateClient(currentIcon).currentState = stateName;
};
if (currentIcon != null){
currentIcon.visible = true;
};
return (newIcon);
}
mx_internal function viewSkinForPhase(tempSkinName:String, stateName:String):void{
var newSkin:IFlexDisplayObject;
var labelColor:Number;
var styleableSkin:ISimpleStyleClient;
var newSkinClass:Class = Class(getStyle(tempSkinName));
if (!newSkinClass){
newSkinClass = Class(getStyle(skinName));
if (defaultSkinUsesStates){
tempSkinName = skinName;
};
if (((!(checkedDefaultSkin)) && (newSkinClass))){
newSkin = IFlexDisplayObject(new (newSkinClass));
if (((!((newSkin is IProgrammaticSkin))) && ((newSkin is IStateClient)))){
defaultSkinUsesStates = true;
tempSkinName = skinName;
};
if (newSkin){
checkedDefaultSkin = true;
};
};
};
newSkin = IFlexDisplayObject(getChildByName(tempSkinName));
if (!newSkin){
if (newSkinClass){
newSkin = IFlexDisplayObject(new (newSkinClass));
newSkin.name = tempSkinName;
styleableSkin = (newSkin as ISimpleStyleClient);
if (styleableSkin){
styleableSkin.styleName = this;
};
addChild(DisplayObject(newSkin));
newSkin.setActualSize(unscaledWidth, unscaledHeight);
if ((((newSkin is IInvalidating)) && (initialized))){
IInvalidating(newSkin).validateNow();
} else {
if ((((newSkin is IProgrammaticSkin)) && (initialized))){
IProgrammaticSkin(newSkin).validateDisplayList();
};
};
skins.push(newSkin);
};
};
if (currentSkin){
currentSkin.visible = false;
};
currentSkin = newSkin;
if (((defaultSkinUsesStates) && ((currentSkin is IStateClient)))){
IStateClient(currentSkin).currentState = stateName;
};
if (currentSkin){
currentSkin.visible = true;
};
if (enabled){
if (phase == ButtonPhase.OVER){
labelColor = textField.getStyle("textRollOverColor");
} else {
if (phase == ButtonPhase.DOWN){
labelColor = textField.getStyle("textSelectedColor");
} else {
labelColor = textField.getStyle("color");
};
};
textField.setColor(labelColor);
};
}
mx_internal function getTextField():IUITextField{
return (textField);
}
protected function rollOverHandler(event:MouseEvent):void{
if (phase == ButtonPhase.UP){
if (event.buttonDown){
return;
};
phase = ButtonPhase.OVER;
event.updateAfterEvent();
} else {
if (phase == ButtonPhase.OVER){
phase = ButtonPhase.DOWN;
event.updateAfterEvent();
if (autoRepeatTimer){
autoRepeatTimer.start();
};
};
};
}
override protected function createChildren():void{
super.createChildren();
if (!textField){
textField = IUITextField(createInFontContext(UITextField));
textField.styleName = this;
addChild(DisplayObject(textField));
};
}
mx_internal function setSelected(value:Boolean, isProgrammatic:Boolean=false):void{
if (_selected != value){
_selected = value;
invalidateDisplayList();
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
if (toggle){
dispatchEvent(new Event(Event.CHANGE));
};
} else {
if (((toggle) && (!(isProgrammatic)))){
dispatchEvent(new Event(Event.CHANGE));
};
};
dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT));
};
}
private function autoRepeatTimer_timerDelayHandler(event:Event):void{
if (!enabled){
return;
};
dispatchEvent(new FlexEvent(FlexEvent.BUTTON_DOWN));
if (autoRepeat){
autoRepeatTimer.reset();
autoRepeatTimer.removeEventListener(TimerEvent.TIMER, autoRepeatTimer_timerDelayHandler);
autoRepeatTimer.delay = getStyle("repeatInterval");
autoRepeatTimer.addEventListener(TimerEvent.TIMER, autoRepeatTimer_timerHandler);
autoRepeatTimer.start();
};
}
public function get autoRepeat():Boolean{
return (_autoRepeat);
}
public function set selected(value:Boolean):void{
selectedSet = true;
setSelected(value, true);
}
override protected function focusOutHandler(event:FocusEvent):void{
super.focusOutHandler(event);
if (phase != ButtonPhase.UP){
phase = ButtonPhase.UP;
};
}
public function get labelPlacement():String{
return (_labelPlacement);
}
public function set autoRepeat(value:Boolean):void{
_autoRepeat = value;
if (value){
autoRepeatTimer = new Timer(1);
} else {
autoRepeatTimer = null;
};
}
mx_internal function changeIcons():void{
var n:int = icons.length;
var i:int;
while (i < n) {
removeChild(icons[i]);
i++;
};
icons = [];
checkedDefaultIcon = false;
defaultIconUsesStates = false;
}
public function set data(value:Object):void{
var newSelected:*;
var newLabel:*;
_data = value;
if (((((_listData) && ((_listData is DataGridListData)))) && (!((DataGridListData(_listData).dataField == null))))){
newSelected = _data[DataGridListData(_listData).dataField];
newLabel = "";
} else {
if (_listData){
if (selectedField){
newSelected = _data[selectedField];
};
newLabel = _listData.label;
} else {
newSelected = _data;
};
};
if (((!((newSelected === undefined))) && (!(selectedSet)))){
selected = (newSelected as Boolean);
selectedSet = false;
};
if (((!((newLabel === undefined))) && (!(labelSet)))){
label = newLabel;
labelSet = false;
};
dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
}
mx_internal function getCurrentIcon():IFlexDisplayObject{
var tempIconName:String = getCurrentIconName();
if (!tempIconName){
return (null);
};
return (viewIconForPhase(tempIconName));
}
public function get fontContext():IFlexModuleFactory{
return (moduleFactory);
}
public function get emphasized():Boolean{
return (_emphasized);
}
public function get listData():BaseListData{
return (_listData);
}
mx_internal function layoutContents(unscaledWidth:Number, unscaledHeight:Number, offset:Boolean):void{
var lineMetrics:TextLineMetrics;
var moveEvent:MoveEvent;
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
previousVersion_layoutContents(unscaledWidth, unscaledHeight, offset);
return;
};
var labelWidth:Number = 0;
var labelHeight:Number = 0;
var labelX:Number = 0;
var labelY:Number = 0;
var iconWidth:Number = 0;
var iconHeight:Number = 0;
var iconX:Number = 0;
var iconY:Number = 0;
var horizontalGap:Number = 0;
var verticalGap:Number = 0;
var paddingLeft:Number = getStyle("paddingLeft");
var paddingRight:Number = getStyle("paddingRight");
var paddingTop:Number = getStyle("paddingTop");
var paddingBottom:Number = getStyle("paddingBottom");
var textWidth:Number = 0;
var textHeight:Number = 0;
if (label){
lineMetrics = measureText(label);
textWidth = (lineMetrics.width + TEXT_WIDTH_PADDING);
textHeight = (lineMetrics.height + UITextField.TEXT_HEIGHT_PADDING);
} else {
lineMetrics = measureText("Wj");
textHeight = (lineMetrics.height + UITextField.TEXT_HEIGHT_PADDING);
};
var n:Number = (offset) ? buttonOffset : 0;
var textAlign:String = getStyle("textAlign");
var viewWidth:Number = unscaledWidth;
var viewHeight:Number = unscaledHeight;
var bm:EdgeMetrics = (((((currentSkin) && ((currentSkin is IBorder)))) && (!((currentSkin is IFlexAsset))))) ? IBorder(currentSkin).borderMetrics : null;
if (bm){
viewWidth = (viewWidth - (bm.left + bm.right));
viewHeight = (viewHeight - (bm.top + bm.bottom));
};
if (currentIcon){
iconWidth = currentIcon.width;
iconHeight = currentIcon.height;
};
if ((((labelPlacement == ButtonLabelPlacement.LEFT)) || ((labelPlacement == ButtonLabelPlacement.RIGHT)))){
horizontalGap = getStyle("horizontalGap");
if ((((iconWidth == 0)) || ((textWidth == 0)))){
horizontalGap = 0;
};
if (textWidth > 0){
labelWidth = Math.max(Math.min(((((viewWidth - iconWidth) - horizontalGap) - paddingLeft) - paddingRight), textWidth), 0);
textField.width = labelWidth;
} else {
labelWidth = 0;
textField.width = labelWidth;
};
labelHeight = Math.min(viewHeight, textHeight);
textField.height = labelHeight;
if (textAlign == "left"){
labelX = (labelX + paddingLeft);
} else {
if (textAlign == "right"){
labelX = (labelX + ((((viewWidth - labelWidth) - iconWidth) - horizontalGap) - paddingRight));
} else {
labelX = (labelX + (((((((viewWidth - labelWidth) - iconWidth) - horizontalGap) - paddingLeft) - paddingRight) / 2) + paddingLeft));
};
};
if (labelPlacement == ButtonLabelPlacement.RIGHT){
labelX = (labelX + (iconWidth + horizontalGap));
iconX = (labelX - (iconWidth + horizontalGap));
} else {
iconX = ((labelX + labelWidth) + horizontalGap);
};
iconY = (((((viewHeight - iconHeight) - paddingTop) - paddingBottom) / 2) + paddingTop);
labelY = (((((viewHeight - labelHeight) - paddingTop) - paddingBottom) / 2) + paddingTop);
} else {
verticalGap = getStyle("verticalGap");
if ((((iconHeight == 0)) || ((label == "")))){
verticalGap = 0;
};
if (textWidth > 0){
labelWidth = Math.max(((viewWidth - paddingLeft) - paddingRight), 0);
textField.width = labelWidth;
labelHeight = Math.min(((((viewHeight - iconHeight) - paddingTop) - paddingBottom) - verticalGap), textHeight);
textField.height = labelHeight;
} else {
labelWidth = 0;
textField.width = labelWidth;
labelHeight = 0;
textField.height = labelHeight;
};
labelX = paddingLeft;
if (textAlign == "left"){
iconX = (iconX + paddingLeft);
} else {
if (textAlign == "right"){
iconX = (iconX + Math.max(((viewWidth - iconWidth) - paddingRight), paddingLeft));
} else {
iconX = (iconX + (((((viewWidth - iconWidth) - paddingLeft) - paddingRight) / 2) + paddingLeft));
};
};
if (labelPlacement == ButtonLabelPlacement.TOP){
labelY = (labelY + (((((((viewHeight - labelHeight) - iconHeight) - paddingTop) - paddingBottom) - verticalGap) / 2) + paddingTop));
iconY = (iconY + ((labelY + labelHeight) + verticalGap));
} else {
iconY = (iconY + (((((((viewHeight - labelHeight) - iconHeight) - paddingTop) - paddingBottom) - verticalGap) / 2) + paddingTop));
labelY = (labelY + ((iconY + iconHeight) + verticalGap));
};
};
var buffX:Number = n;
var buffY:Number = n;
if (bm){
buffX = (buffX + bm.left);
buffY = (buffY + bm.top);
};
textField.x = Math.round((labelX + buffX));
textField.y = Math.round((labelY + buffY));
if (currentIcon){
iconX = (iconX + buffX);
iconY = (iconY + buffY);
moveEvent = new MoveEvent(MoveEvent.MOVE);
moveEvent.oldX = currentIcon.x;
moveEvent.oldY = currentIcon.y;
currentIcon.x = Math.round(iconX);
currentIcon.y = Math.round(iconY);
currentIcon.dispatchEvent(moveEvent);
};
if (currentSkin){
setChildIndex(DisplayObject(currentSkin), (numChildren - 1));
};
if (currentIcon){
setChildIndex(DisplayObject(currentIcon), (numChildren - 1));
};
if (textField){
setChildIndex(DisplayObject(textField), (numChildren - 1));
};
}
protected function mouseDownHandler(event:MouseEvent):void{
if (!enabled){
return;
};
systemManager.getSandboxRoot().addEventListener(MouseEvent.MOUSE_UP, systemManager_mouseUpHandler, true);
systemManager.getSandboxRoot().addEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE, stage_mouseLeaveHandler);
buttonPressed();
event.updateAfterEvent();
}
override protected function keyDownHandler(event:KeyboardEvent):void{
if (!enabled){
return;
};
if (event.keyCode == Keyboard.SPACE){
buttonPressed();
};
}
protected function rollOutHandler(event:MouseEvent):void{
if (phase == ButtonPhase.OVER){
phase = ButtonPhase.UP;
event.updateAfterEvent();
} else {
if ((((phase == ButtonPhase.DOWN)) && (!(stickyHighlighting)))){
phase = ButtonPhase.OVER;
event.updateAfterEvent();
if (autoRepeatTimer){
autoRepeatTimer.stop();
};
};
};
}
mx_internal function get phase():String{
return (_phase);
}
override public function set enabled(value:Boolean):void{
if (super.enabled == value){
return;
};
super.enabled = value;
enabledChanged = true;
invalidateProperties();
invalidateDisplayList();
}
override protected function measure():void{
var lineMetrics:TextLineMetrics;
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
previousVersion_measure();
return;
};
super.measure();
var textWidth:Number = 0;
var textHeight:Number = 0;
if (label){
lineMetrics = measureText(label);
textWidth = (lineMetrics.width + TEXT_WIDTH_PADDING);
textHeight = (lineMetrics.height + UITextField.TEXT_HEIGHT_PADDING);
};
var tempCurrentIcon:IFlexDisplayObject = getCurrentIcon();
var iconWidth:Number = (tempCurrentIcon) ? tempCurrentIcon.width : 0;
var iconHeight:Number = (tempCurrentIcon) ? tempCurrentIcon.height : 0;
var w:Number = 0;
var h:Number = 0;
if ((((labelPlacement == ButtonLabelPlacement.LEFT)) || ((labelPlacement == ButtonLabelPlacement.RIGHT)))){
w = (textWidth + iconWidth);
if (((textWidth) && (iconWidth))){
w = (w + getStyle("horizontalGap"));
};
h = Math.max(textHeight, iconHeight);
} else {
w = Math.max(textWidth, iconWidth);
h = (textHeight + iconHeight);
if (((textHeight) && (iconHeight))){
h = (h + getStyle("verticalGap"));
};
};
if (((textWidth) || (iconWidth))){
w = (w + (getStyle("paddingLeft") + getStyle("paddingRight")));
h = (h + (getStyle("paddingTop") + getStyle("paddingBottom")));
};
var bm:EdgeMetrics = (((((currentSkin) && ((currentSkin is IBorder)))) && (!((currentSkin is IFlexAsset))))) ? IBorder(currentSkin).borderMetrics : null;
if (bm){
w = (w + (bm.left + bm.right));
h = (h + (bm.top + bm.bottom));
};
if (((currentSkin) && (((isNaN(skinMeasuredWidth)) || (isNaN(skinMeasuredHeight)))))){
skinMeasuredWidth = currentSkin.measuredWidth;
skinMeasuredHeight = currentSkin.measuredHeight;
};
if (!isNaN(skinMeasuredWidth)){
w = Math.max(skinMeasuredWidth, w);
};
if (!isNaN(skinMeasuredHeight)){
h = Math.max(skinMeasuredHeight, h);
};
measuredMinWidth = (measuredWidth = w);
measuredMinHeight = (measuredHeight = h);
}
public function get toggle():Boolean{
return (_toggle);
}
mx_internal function buttonReleased():void{
systemManager.getSandboxRoot().removeEventListener(MouseEvent.MOUSE_UP, systemManager_mouseUpHandler, true);
systemManager.getSandboxRoot().removeEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE, stage_mouseLeaveHandler);
if (autoRepeatTimer){
autoRepeatTimer.removeEventListener(TimerEvent.TIMER, autoRepeatTimer_timerDelayHandler);
autoRepeatTimer.removeEventListener(TimerEvent.TIMER, autoRepeatTimer_timerHandler);
autoRepeatTimer.reset();
};
}
mx_internal function buttonPressed():void{
phase = ButtonPhase.DOWN;
dispatchEvent(new FlexEvent(FlexEvent.BUTTON_DOWN));
if (autoRepeat){
autoRepeatTimer.delay = getStyle("repeatDelay");
autoRepeatTimer.addEventListener(TimerEvent.TIMER, autoRepeatTimer_timerDelayHandler);
autoRepeatTimer.start();
};
}
override protected function keyUpHandler(event:KeyboardEvent):void{
if (!enabled){
return;
};
if (event.keyCode == Keyboard.SPACE){
buttonReleased();
if (phase == ButtonPhase.DOWN){
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
phase = ButtonPhase.UP;
};
}
public function get selected():Boolean{
return (_selected);
}
public function set labelPlacement(value:String):void{
_labelPlacement = value;
invalidateSize();
invalidateDisplayList();
dispatchEvent(new Event("labelPlacementChanged"));
}
protected function clickHandler(event:MouseEvent):void{
if (!enabled){
event.stopImmediatePropagation();
return;
};
if (toggle){
setSelected(!(selected));
event.updateAfterEvent();
};
}
override protected function initializeAccessibility():void{
if (Button.createAccessibilityImplementation != null){
Button.createAccessibilityImplementation(this);
};
}
public function set toggle(value:Boolean):void{
_toggle = value;
toggleChanged = true;
invalidateProperties();
invalidateDisplayList();
dispatchEvent(new Event("toggleChanged"));
}
override public function get baselinePosition():Number{
var t:String;
var lineMetrics:TextLineMetrics;
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
t = label;
if (!t){
t = "Wj";
};
validateNow();
if (((!(label)) && ((((labelPlacement == ButtonLabelPlacement.TOP)) || ((labelPlacement == ButtonLabelPlacement.BOTTOM)))))){
lineMetrics = measureText(t);
return ((((measuredHeight - lineMetrics.height) / 2) + lineMetrics.ascent));
};
return ((textField.y + measureText(t).ascent));
};
if (!validateBaselinePosition()){
return (NaN);
};
return ((textField.y + textField.baselinePosition));
}
public function get data():Object{
return (_data);
}
public function set fontContext(moduleFactory:IFlexModuleFactory):void{
this.moduleFactory = moduleFactory;
}
mx_internal function viewSkin():void{
var tempSkinName:String;
var stateName:String;
if (!enabled){
tempSkinName = (selected) ? selectedDisabledSkinName : disabledSkinName;
stateName = (selected) ? "selectedDisabled" : "disabled";
} else {
if (phase == ButtonPhase.UP){
tempSkinName = (selected) ? selectedUpSkinName : upSkinName;
stateName = (selected) ? "selectedUp" : "up";
} else {
if (phase == ButtonPhase.OVER){
tempSkinName = (selected) ? selectedOverSkinName : overSkinName;
stateName = (selected) ? "selectedOver" : "over";
} else {
if (phase == ButtonPhase.DOWN){
tempSkinName = (selected) ? selectedDownSkinName : downSkinName;
stateName = (selected) ? "selectedDown" : "down";
};
};
};
};
viewSkinForPhase(tempSkinName, stateName);
}
override public function styleChanged(styleProp:String):void{
styleChangedFlag = true;
super.styleChanged(styleProp);
if (((!(styleProp)) || ((styleProp == "styleName")))){
changeSkins();
changeIcons();
if (initialized){
viewSkin();
viewIcon();
};
} else {
if (styleProp.toLowerCase().indexOf("skin") != -1){
changeSkins();
} else {
if (styleProp.toLowerCase().indexOf("icon") != -1){
changeIcons();
invalidateSize();
};
};
};
}
public function set emphasized(value:Boolean):void{
_emphasized = value;
emphasizedChanged = true;
invalidateDisplayList();
}
mx_internal function viewIcon():void{
var tempIconName:String = getCurrentIconName();
viewIconForPhase(tempIconName);
}
override public function set toolTip(value:String):void{
super.toolTip = value;
if (value){
toolTipSet = true;
} else {
toolTipSet = false;
invalidateDisplayList();
};
}
override protected function commitProperties():void{
super.commitProperties();
if (((hasFontContextChanged()) && (!((textField == null))))){
removeChild(DisplayObject(textField));
textField = null;
};
if (!textField){
textField = IUITextField(createInFontContext(UITextField));
textField.styleName = this;
addChild(DisplayObject(textField));
enabledChanged = true;
toggleChanged = true;
};
if (!initialized){
viewSkin();
viewIcon();
};
if (enabledChanged){
textField.enabled = enabled;
if (((currentIcon) && ((currentIcon is IUIComponent)))){
IUIComponent(currentIcon).enabled = enabled;
};
enabledChanged = false;
};
if (toggleChanged){
if (!toggle){
selected = false;
};
toggleChanged = false;
};
}
mx_internal function changeSkins():void{
var n:int = skins.length;
var i:int;
while (i < n) {
removeChild(skins[i]);
i++;
};
skins = [];
skinMeasuredWidth = NaN;
skinMeasuredHeight = NaN;
checkedDefaultSkin = false;
defaultSkinUsesStates = false;
if (((initialized) && ((FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0)))){
viewSkin();
invalidateSize();
};
}
private function autoRepeatTimer_timerHandler(event:Event):void{
if (!enabled){
return;
};
dispatchEvent(new FlexEvent(FlexEvent.BUTTON_DOWN));
}
private function previousVersion_layoutContents(unscaledWidth:Number, unscaledHeight:Number, offset:Boolean):void{
var lineMetrics:TextLineMetrics;
var disp:Number;
var moveEvent:MoveEvent;
var labelWidth:Number = 0;
var labelHeight:Number = 0;
var labelX:Number = 0;
var labelY:Number = 0;
var iconWidth:Number = 0;
var iconHeight:Number = 0;
var iconX:Number = 0;
var iconY:Number = 0;
var horizontalGap:Number = 2;
var verticalGap:Number = 2;
var paddingLeft:Number = getStyle("paddingLeft");
var paddingRight:Number = getStyle("paddingRight");
var paddingTop:Number = getStyle("paddingTop");
var paddingBottom:Number = getStyle("paddingBottom");
var textWidth:Number = 0;
var textHeight:Number = 0;
if (label){
lineMetrics = measureText(label);
if (lineMetrics.width > 0){
textWidth = (((paddingLeft + paddingRight) + getStyle("textIndent")) + lineMetrics.width);
};
textHeight = lineMetrics.height;
} else {
lineMetrics = measureText("Wj");
textHeight = lineMetrics.height;
};
var n:Number = (offset) ? buttonOffset : 0;
var textAlign:String = getStyle("textAlign");
var bm:EdgeMetrics = (((currentSkin) && ((currentSkin is IRectangularBorder)))) ? IRectangularBorder(currentSkin).borderMetrics : null;
var viewWidth:Number = unscaledWidth;
var viewHeight:Number = ((unscaledHeight - paddingTop) - paddingBottom);
if (bm){
viewWidth = (viewWidth - (bm.left + bm.right));
viewHeight = (viewHeight - (bm.top + bm.bottom));
};
if (currentIcon){
iconWidth = currentIcon.width;
iconHeight = currentIcon.height;
};
if ((((labelPlacement == ButtonLabelPlacement.LEFT)) || ((labelPlacement == ButtonLabelPlacement.RIGHT)))){
horizontalGap = getStyle("horizontalGap");
if ((((iconWidth == 0)) || ((textWidth == 0)))){
horizontalGap = 0;
};
if (textWidth > 0){
labelWidth = Math.max(((((viewWidth - iconWidth) - horizontalGap) - paddingLeft) - paddingRight), 0);
textField.width = labelWidth;
} else {
labelWidth = 0;
textField.width = labelWidth;
};
labelHeight = Math.min((viewHeight + 2), (textHeight + UITextField.TEXT_HEIGHT_PADDING));
textField.height = labelHeight;
if (labelPlacement == ButtonLabelPlacement.RIGHT){
labelX = (iconWidth + horizontalGap);
if (centerContent){
if (textAlign == "left"){
labelX = (labelX + paddingLeft);
} else {
if (textAlign == "right"){
labelX = (labelX + ((((viewWidth - labelWidth) - iconWidth) - horizontalGap) - paddingLeft));
} else {
disp = ((((viewWidth - labelWidth) - iconWidth) - horizontalGap) / 2);
labelX = (labelX + Math.max(disp, paddingLeft));
};
};
};
iconX = (labelX - (iconWidth + horizontalGap));
if (!centerContent){
labelX = (labelX + paddingLeft);
};
} else {
labelX = ((((viewWidth - labelWidth) - iconWidth) - horizontalGap) - paddingRight);
if (centerContent){
if (textAlign == "left"){
labelX = 2;
} else {
if (textAlign == "right"){
labelX--;
} else {
if (labelX > 0){
labelX = (labelX / 2);
};
};
};
};
iconX = ((labelX + labelWidth) + horizontalGap);
};
labelY = 0;
iconY = labelY;
if (centerContent){
iconY = (Math.round(((viewHeight - iconHeight) / 2)) + paddingTop);
labelY = (Math.round(((viewHeight - labelHeight) / 2)) + paddingTop);
} else {
labelY = (labelY + (Math.max(0, ((viewHeight - labelHeight) / 2)) + paddingTop));
iconY = (iconY + (Math.max(0, (((viewHeight - iconHeight) / 2) - 1)) + paddingTop));
};
} else {
verticalGap = getStyle("verticalGap");
if ((((iconHeight == 0)) || ((textHeight == 0)))){
verticalGap = 0;
};
if (textWidth > 0){
labelWidth = Math.min(viewWidth, (textWidth + UITextField.TEXT_WIDTH_PADDING));
textField.width = labelWidth;
labelHeight = Math.min(((viewHeight - iconHeight) + 1), (textHeight + 5));
textField.height = labelHeight;
} else {
labelWidth = 0;
textField.width = labelWidth;
labelHeight = 0;
textField.height = labelHeight;
};
labelX = ((viewWidth - labelWidth) / 2);
iconX = ((viewWidth - iconWidth) / 2);
if (labelPlacement == ButtonLabelPlacement.TOP){
labelY = (((viewHeight - labelHeight) - iconHeight) - verticalGap);
if (((centerContent) && ((labelY > 0)))){
labelY = (labelY / 2);
};
labelY = (labelY + paddingTop);
iconY = (((labelY + labelHeight) + verticalGap) - 3);
} else {
labelY = ((iconHeight + verticalGap) + paddingTop);
if (centerContent){
labelY = (labelY + (((((viewHeight - labelHeight) - iconHeight) - verticalGap) / 2) + 1));
};
iconY = (((labelY - iconHeight) - verticalGap) + 3);
};
};
var buffX:Number = n;
var buffY:Number = n;
if (bm){
buffX = (buffX + bm.left);
buffY = (buffY + bm.top);
};
textField.x = (labelX + buffX);
textField.y = (labelY + buffY);
if (currentIcon){
iconX = (iconX + buffX);
iconY = (iconY + buffY);
moveEvent = new MoveEvent(MoveEvent.MOVE);
moveEvent.oldX = currentIcon.x;
moveEvent.oldY = currentIcon.y;
currentIcon.x = Math.round(iconX);
currentIcon.y = Math.round(iconY);
currentIcon.dispatchEvent(moveEvent);
};
if (currentSkin){
setChildIndex(DisplayObject(currentSkin), (numChildren - 1));
};
if (currentIcon){
setChildIndex(DisplayObject(currentIcon), (numChildren - 1));
};
if (textField){
setChildIndex(DisplayObject(textField), (numChildren - 1));
};
}
private function systemManager_mouseUpHandler(event:MouseEvent):void{
if (contains(DisplayObject(event.target))){
return;
};
phase = ButtonPhase.UP;
buttonReleased();
event.updateAfterEvent();
}
public function set label(value:String):void{
labelSet = true;
if (_label != value){
_label = value;
labelChanged = true;
invalidateSize();
invalidateDisplayList();
dispatchEvent(new Event("labelChanged"));
};
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
var skin:IFlexDisplayObject;
var truncated:Boolean;
super.updateDisplayList(unscaledWidth, unscaledHeight);
if (emphasizedChanged){
changeSkins();
emphasizedChanged = false;
};
var n:int = skins.length;
var i:int;
while (i < n) {
skin = IFlexDisplayObject(skins[i]);
skin.setActualSize(unscaledWidth, unscaledHeight);
i++;
};
viewSkin();
viewIcon();
layoutContents(unscaledWidth, unscaledHeight, (phase == ButtonPhase.DOWN));
if ((((((((oldUnscaledWidth > unscaledWidth)) || (!((textField.text == label))))) || (labelChanged))) || (styleChangedFlag))){
textField.text = label;
truncated = textField.truncateToFit();
if (!toolTipSet){
if (truncated){
super.toolTip = label;
} else {
super.toolTip = null;
};
};
styleChangedFlag = false;
labelChanged = false;
};
oldUnscaledWidth = unscaledWidth;
}
private function stage_mouseLeaveHandler(event:Event):void{
phase = ButtonPhase.UP;
buttonReleased();
}
public function set listData(value:BaseListData):void{
_listData = value;
}
}
}//package mx.controls
Section 98
//ButtonLabelPlacement (mx.controls.ButtonLabelPlacement)
package mx.controls {
public final class ButtonLabelPlacement {
public static const TOP:String = "top";
public static const LEFT:String = "left";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const BOTTOM:String = "bottom";
public static const RIGHT:String = "right";
public function ButtonLabelPlacement(){
super();
}
}
}//package mx.controls
Section 99
//ButtonPhase (mx.controls.ButtonPhase)
package mx.controls {
public final class ButtonPhase {
public static const DOWN:String = "down";
public static const OVER:String = "over";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const UP:String = "up";
public function ButtonPhase(){
super();
}
}
}//package mx.controls
Section 100
//HScrollBar (mx.controls.HScrollBar)
package mx.controls {
import mx.controls.scrollClasses.*;
import flash.ui.*;
public class HScrollBar extends ScrollBar {
mx_internal static const VERSION:String = "3.2.0.3958";
public function HScrollBar(){
super();
super.direction = ScrollBarDirection.HORIZONTAL;
scaleX = -1;
rotation = -90;
}
override mx_internal function get virtualHeight():Number{
return (unscaledWidth);
}
override protected function measure():void{
super.measure();
measuredWidth = _minHeight;
measuredHeight = _minWidth;
}
override public function get minHeight():Number{
return (_minWidth);
}
override mx_internal function get virtualWidth():Number{
return (unscaledHeight);
}
override public function get minWidth():Number{
return (_minHeight);
}
override mx_internal function isScrollBarKey(key:uint):Boolean{
if (key == Keyboard.LEFT){
lineScroll(-1);
return (true);
};
if (key == Keyboard.RIGHT){
lineScroll(1);
return (true);
};
return (super.isScrollBarKey(key));
}
override public function set direction(value:String):void{
}
}
}//package mx.controls
Section 101
//IFlexContextMenu (mx.controls.IFlexContextMenu)
package mx.controls {
import flash.display.*;
public interface IFlexContextMenu {
function setContextMenu(:InteractiveObject):void;
function unsetContextMenu(:InteractiveObject):void;
}
}//package mx.controls
Section 102
//ToolTip (mx.controls.ToolTip)
package mx.controls {
import flash.display.*;
import mx.core.*;
import flash.text.*;
import mx.styles.*;
public class ToolTip extends UIComponent implements IToolTip, IFontContextComponent {
private var textChanged:Boolean;
private var _text:String;
protected var textField:IUITextField;
mx_internal var border:IFlexDisplayObject;
mx_internal static const VERSION:String = "3.2.0.3958";
public static var maxWidth:Number = 300;
public function ToolTip(){
super();
mouseEnabled = false;
}
public function set fontContext(moduleFactory:IFlexModuleFactory):void{
this.moduleFactory = moduleFactory;
}
override public function styleChanged(styleProp:String):void{
super.styleChanged(styleProp);
if ((((((styleProp == "borderStyle")) || ((styleProp == "styleName")))) || ((styleProp == null)))){
invalidateDisplayList();
};
}
override protected function commitProperties():void{
var index:int;
var textFormat:TextFormat;
super.commitProperties();
if (((hasFontContextChanged()) && (!((textField == null))))){
index = getChildIndex(DisplayObject(textField));
removeTextField();
createTextField(index);
invalidateSize();
textChanged = true;
};
if (textChanged){
textFormat = textField.getTextFormat();
textFormat.leftMargin = 0;
textFormat.rightMargin = 0;
textField.defaultTextFormat = textFormat;
textField.text = _text;
textChanged = false;
};
}
mx_internal function getTextField():IUITextField{
return (textField);
}
override protected function createChildren():void{
var borderClass:Class;
super.createChildren();
if (!border){
borderClass = getStyle("borderSkin");
border = new (borderClass);
if ((border is ISimpleStyleClient)){
ISimpleStyleClient(border).styleName = this;
};
addChild(DisplayObject(border));
};
createTextField(-1);
}
override protected function measure():void{
var heightSlop:Number;
super.measure();
var bm:EdgeMetrics = borderMetrics;
var leftInset:Number = (bm.left + getStyle("paddingLeft"));
var topInset:Number = (bm.top + getStyle("paddingTop"));
var rightInset:Number = (bm.right + getStyle("paddingRight"));
var bottomInset:Number = (bm.bottom + getStyle("paddingBottom"));
var widthSlop:Number = (leftInset + rightInset);
heightSlop = (topInset + bottomInset);
textField.wordWrap = false;
if ((textField.textWidth + widthSlop) > ToolTip.maxWidth){
textField.width = (ToolTip.maxWidth - widthSlop);
textField.wordWrap = true;
};
measuredWidth = (textField.width + widthSlop);
measuredHeight = (textField.height + heightSlop);
}
public function get fontContext():IFlexModuleFactory{
return (moduleFactory);
}
public function set text(value:String):void{
_text = value;
textChanged = true;
invalidateProperties();
invalidateSize();
invalidateDisplayList();
}
public function get text():String{
return (_text);
}
mx_internal function removeTextField():void{
if (textField){
removeChild(DisplayObject(textField));
textField = null;
};
}
mx_internal function createTextField(childIndex:int):void{
if (!textField){
textField = IUITextField(createInFontContext(UITextField));
textField.autoSize = TextFieldAutoSize.LEFT;
textField.mouseEnabled = false;
textField.multiline = true;
textField.selectable = false;
textField.wordWrap = false;
textField.styleName = this;
if (childIndex == -1){
addChild(DisplayObject(textField));
} else {
addChildAt(DisplayObject(textField), childIndex);
};
};
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
super.updateDisplayList(unscaledWidth, unscaledHeight);
var bm:EdgeMetrics = borderMetrics;
var leftInset:Number = (bm.left + getStyle("paddingLeft"));
var topInset:Number = (bm.top + getStyle("paddingTop"));
var rightInset:Number = (bm.right + getStyle("paddingRight"));
var bottomInset:Number = (bm.bottom + getStyle("paddingBottom"));
var widthSlop:Number = (leftInset + rightInset);
var heightSlop:Number = (topInset + bottomInset);
border.setActualSize(unscaledWidth, unscaledHeight);
textField.move(leftInset, topInset);
textField.setActualSize((unscaledWidth - widthSlop), (unscaledHeight - heightSlop));
}
private function get borderMetrics():EdgeMetrics{
if ((border is IRectangularBorder)){
return (IRectangularBorder(border).borderMetrics);
};
return (EdgeMetrics.EMPTY);
}
}
}//package mx.controls
Section 103
//VScrollBar (mx.controls.VScrollBar)
package mx.controls {
import mx.controls.scrollClasses.*;
import flash.ui.*;
public class VScrollBar extends ScrollBar {
mx_internal static const VERSION:String = "3.2.0.3958";
public function VScrollBar(){
super();
super.direction = ScrollBarDirection.VERTICAL;
}
override protected function measure():void{
super.measure();
measuredWidth = _minWidth;
measuredHeight = _minHeight;
}
override public function get minHeight():Number{
return (_minHeight);
}
override mx_internal function isScrollBarKey(key:uint):Boolean{
if (key == Keyboard.UP){
lineScroll(-1);
return (true);
};
if (key == Keyboard.DOWN){
lineScroll(1);
return (true);
};
if (key == Keyboard.PAGE_UP){
pageScroll(-1);
return (true);
};
if (key == Keyboard.PAGE_DOWN){
pageScroll(1);
return (true);
};
return (super.isScrollBarKey(key));
}
override public function get minWidth():Number{
return (_minWidth);
}
override public function set direction(value:String):void{
}
}
}//package mx.controls
Section 104
//Application (mx.core.Application)
package mx.core {
import flash.display.*;
import flash.events.*;
import mx.events.*;
import mx.managers.*;
import mx.styles.*;
import mx.effects.*;
import mx.containers.utilityClasses.*;
import flash.ui.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.external.*;
public class Application extends LayoutContainer {
public var preloader:Object;
public var pageTitle:String;
private var resizeWidth:Boolean;// = true
private var _applicationViewMetrics:EdgeMetrics;
mx_internal var _parameters:Object;
private var processingCreationQueue:Boolean;// = false
public var scriptRecursionLimit:int;
private var resizeHandlerAdded:Boolean;// = false
private var preloadObj:Object;
public var usePreloader:Boolean;
mx_internal var _url:String;
private var _viewSourceURL:String;
public var resetHistory:Boolean;// = true
public var historyManagementEnabled:Boolean;// = true
public var scriptTimeLimit:Number;
public var frameRate:Number;
private var creationQueue:Array;
private var resizeHeight:Boolean;// = true
public var controlBar:IUIComponent;
private var viewSourceCMI:ContextMenuItem;
mx_internal static const VERSION:String = "3.2.0.3958";
mx_internal static var useProgressiveLayout:Boolean = false;
public function Application(){
creationQueue = [];
name = "application";
UIComponentGlobals.layoutManager = ILayoutManager(Singleton.getInstance("mx.managers::ILayoutManager"));
UIComponentGlobals.layoutManager.usePhasedInstantiation = true;
if (!ApplicationGlobals.application){
ApplicationGlobals.application = this;
};
super();
layoutObject = new ApplicationLayout();
layoutObject.target = this;
boxLayoutClass = ApplicationLayout;
showInAutomationHierarchy = true;
}
public function set viewSourceURL(value:String):void{
_viewSourceURL = value;
}
override public function set percentWidth(value:Number):void{
super.percentWidth = value;
invalidateDisplayList();
}
override public function prepareToPrint(target:IFlexDisplayObject):Object{
var objData:Object = {};
if (target == this){
objData.width = width;
objData.height = height;
objData.verticalScrollPosition = verticalScrollPosition;
objData.horizontalScrollPosition = horizontalScrollPosition;
objData.horizontalScrollBarVisible = !((horizontalScrollBar == null));
objData.verticalScrollBarVisible = !((verticalScrollBar == null));
objData.whiteBoxVisible = !((whiteBox == null));
setActualSize(measuredWidth, measuredHeight);
horizontalScrollPosition = 0;
verticalScrollPosition = 0;
if (horizontalScrollBar){
horizontalScrollBar.visible = false;
};
if (verticalScrollBar){
verticalScrollBar.visible = false;
};
if (whiteBox){
whiteBox.visible = false;
};
updateDisplayList(unscaledWidth, unscaledHeight);
};
objData.scrollRect = super.prepareToPrint(target);
return (objData);
}
override protected function measure():void{
var controlWidth:Number;
super.measure();
var bm:EdgeMetrics = borderMetrics;
if (((controlBar) && (controlBar.includeInLayout))){
controlWidth = ((controlBar.getExplicitOrMeasuredWidth() + bm.left) + bm.right);
measuredWidth = Math.max(measuredWidth, controlWidth);
measuredMinWidth = Math.max(measuredMinWidth, controlWidth);
};
}
override public function getChildIndex(child:DisplayObject):int{
if (((controlBar) && ((child == controlBar)))){
return (-1);
};
return (super.getChildIndex(child));
}
private function resizeHandler(event:Event):void{
var w:Number;
var h:Number;
if (resizeWidth){
if (isNaN(percentWidth)){
w = DisplayObject(systemManager).width;
} else {
super.percentWidth = Math.max(percentWidth, 0);
super.percentWidth = Math.min(percentWidth, 100);
w = ((percentWidth * screen.width) / 100);
};
if (!isNaN(explicitMaxWidth)){
w = Math.min(w, explicitMaxWidth);
};
if (!isNaN(explicitMinWidth)){
w = Math.max(w, explicitMinWidth);
};
} else {
w = width;
};
if (resizeHeight){
if (isNaN(percentHeight)){
h = DisplayObject(systemManager).height;
} else {
super.percentHeight = Math.max(percentHeight, 0);
super.percentHeight = Math.min(percentHeight, 100);
h = ((percentHeight * screen.height) / 100);
};
if (!isNaN(explicitMaxHeight)){
h = Math.min(h, explicitMaxHeight);
};
if (!isNaN(explicitMinHeight)){
h = Math.max(h, explicitMinHeight);
};
} else {
h = height;
};
if (((!((w == width))) || (!((h == height))))){
invalidateProperties();
invalidateSize();
};
setActualSize(w, h);
invalidateDisplayList();
}
private function initManagers(sm:ISystemManager):void{
if (sm.isTopLevel()){
focusManager = new FocusManager(this);
sm.activate(this);
};
}
override public function initialize():void{
var properties:Object;
var sm:ISystemManager = systemManager;
_url = sm.loaderInfo.url;
_parameters = sm.loaderInfo.parameters;
initManagers(sm);
_descriptor = null;
if (documentDescriptor){
creationPolicy = documentDescriptor.properties.creationPolicy;
if ((((creationPolicy == null)) || ((creationPolicy.length == 0)))){
creationPolicy = ContainerCreationPolicy.AUTO;
};
properties = documentDescriptor.properties;
if (properties.width != null){
width = properties.width;
delete properties.width;
};
if (properties.height != null){
height = properties.height;
delete properties.height;
};
documentDescriptor.events = null;
};
initContextMenu();
super.initialize();
addEventListener(Event.ADDED, addedHandler);
if (((sm.isTopLevelRoot()) && ((Capabilities.isDebugger == true)))){
setInterval(debugTickler, 1500);
};
}
override public function set percentHeight(value:Number):void{
super.percentHeight = value;
invalidateDisplayList();
}
override public function get id():String{
if (((((!(super.id)) && ((this == Application.application)))) && (ExternalInterface.available))){
return (ExternalInterface.objectID);
};
return (super.id);
}
override mx_internal function setUnscaledWidth(value:Number):void{
invalidateProperties();
super.setUnscaledWidth(value);
}
private function debugTickler():void{
var i:int;
}
private function doNextQueueItem(event:FlexEvent=null):void{
processingCreationQueue = true;
Application.useProgressiveLayout = true;
callLater(processNextQueueItem);
}
private function initContextMenu():void{
var caption:String;
if (flexContextMenu != null){
if ((systemManager is InteractiveObject)){
InteractiveObject(systemManager).contextMenu = contextMenu;
};
return;
};
var defaultMenu:ContextMenu = new ContextMenu();
defaultMenu.hideBuiltInItems();
defaultMenu.builtInItems.print = true;
if (_viewSourceURL){
caption = resourceManager.getString("core", "viewSource");
viewSourceCMI = new ContextMenuItem(caption, true);
viewSourceCMI.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuItemSelectHandler);
defaultMenu.customItems.push(viewSourceCMI);
};
contextMenu = defaultMenu;
if ((systemManager is InteractiveObject)){
InteractiveObject(systemManager).contextMenu = defaultMenu;
};
}
private function addedHandler(event:Event):void{
if ((((event.target == this)) && ((creationQueue.length > 0)))){
doNextQueueItem();
};
}
public function get viewSourceURL():String{
return (_viewSourceURL);
}
override mx_internal function get usePadding():Boolean{
return (!((layout == ContainerLayout.ABSOLUTE)));
}
override mx_internal function setUnscaledHeight(value:Number):void{
invalidateProperties();
super.setUnscaledHeight(value);
}
mx_internal function dockControlBar(controlBar:IUIComponent, dock:Boolean):void{
var controlBar = controlBar;
var dock = dock;
if (dock){
removeChild(DisplayObject(controlBar));
//unresolved jump
var _slot1 = e;
return;
rawChildren.addChildAt(DisplayObject(controlBar), firstChildIndex);
setControlBar(controlBar);
} else {
rawChildren.removeChild(DisplayObject(controlBar));
//unresolved jump
var _slot1 = e;
return;
setControlBar(null);
addChildAt(DisplayObject(controlBar), 0);
};
}
override public function styleChanged(styleProp:String):void{
super.styleChanged(styleProp);
if ((((styleProp == "backgroundColor")) && ((getStyle("backgroundImage") == getStyle("defaultBackgroundImage"))))){
clearStyle("backgroundImage");
};
}
override protected function layoutChrome(unscaledWidth:Number, unscaledHeight:Number):void{
super.layoutChrome(unscaledWidth, unscaledHeight);
if (!doingLayout){
createBorder();
};
var bm:EdgeMetrics = borderMetrics;
var thickness:Number = getStyle("borderThickness");
var em:EdgeMetrics = new EdgeMetrics();
em.left = (bm.left - thickness);
em.top = (bm.top - thickness);
em.right = (bm.right - thickness);
em.bottom = (bm.bottom - thickness);
if (((controlBar) && (controlBar.includeInLayout))){
if ((controlBar is IInvalidating)){
IInvalidating(controlBar).invalidateDisplayList();
};
controlBar.setActualSize((width - (em.left + em.right)), controlBar.getExplicitOrMeasuredHeight());
controlBar.move(em.left, em.top);
};
}
protected function menuItemSelectHandler(event:Event):void{
navigateToURL(new URLRequest(_viewSourceURL), "_blank");
}
private function printCreationQueue():void{
var child:Object;
var msg:String = "";
var n:Number = creationQueue.length;
var i:int;
while (i < n) {
child = creationQueue[i];
msg = (msg + (((((" [" + i) + "] ") + child.id) + " ") + child.index));
i++;
};
}
override protected function resourcesChanged():void{
super.resourcesChanged();
if (viewSourceCMI){
viewSourceCMI.caption = resourceManager.getString("core", "viewSource");
};
}
override protected function commitProperties():void{
super.commitProperties();
resizeWidth = isNaN(explicitWidth);
resizeHeight = isNaN(explicitHeight);
if (((resizeWidth) || (resizeHeight))){
resizeHandler(new Event(Event.RESIZE));
if (!resizeHandlerAdded){
systemManager.addEventListener(Event.RESIZE, resizeHandler, false, 0, true);
resizeHandlerAdded = true;
};
} else {
if (resizeHandlerAdded){
systemManager.removeEventListener(Event.RESIZE, resizeHandler);
resizeHandlerAdded = false;
};
};
}
override public function set toolTip(value:String):void{
}
public function addToCreationQueue(id:Object, preferredIndex:int=-1, callbackFunc:Function=null, parent:IFlexDisplayObject=null):void{
var insertIndex:int;
var pointerIndex:int;
var pointerLevel:int;
var parentLevel:int;
var queueLength:int = creationQueue.length;
var queueObj:Object = {};
var insertedItem:Boolean;
queueObj.id = id;
queueObj.parent = parent;
queueObj.callbackFunc = callbackFunc;
queueObj.index = preferredIndex;
var i:int;
while (i < queueLength) {
pointerIndex = creationQueue[i].index;
pointerLevel = (creationQueue[i].parent) ? creationQueue[i].parent.nestLevel : 0;
if (queueObj.index != -1){
if ((((pointerIndex == -1)) || ((queueObj.index < pointerIndex)))){
insertIndex = i;
insertedItem = true;
break;
};
} else {
parentLevel = (queueObj.parent) ? queueObj.parent.nestLevel : 0;
if ((((pointerIndex == -1)) && ((pointerLevel < parentLevel)))){
insertIndex = i;
insertedItem = true;
break;
};
};
i++;
};
if (!insertedItem){
creationQueue.push(queueObj);
insertedItem = true;
} else {
creationQueue.splice(insertIndex, 0, queueObj);
};
if (((initialized) && (!(processingCreationQueue)))){
doNextQueueItem();
};
}
override mx_internal function initThemeColor():Boolean{
var tc:Object;
var rc:Number;
var sc:Number;
var globalSelector:CSSStyleDeclaration;
var result:Boolean = super.initThemeColor();
if (!result){
globalSelector = StyleManager.getStyleDeclaration("global");
if (globalSelector){
tc = globalSelector.getStyle("themeColor");
rc = globalSelector.getStyle("rollOverColor");
sc = globalSelector.getStyle("selectionColor");
};
if (((((tc) && (isNaN(rc)))) && (isNaN(sc)))){
setThemeColor(tc);
};
result = true;
};
return (result);
}
override public function finishPrint(obj:Object, target:IFlexDisplayObject):void{
if (target == this){
setActualSize(obj.width, obj.height);
if (horizontalScrollBar){
horizontalScrollBar.visible = obj.horizontalScrollBarVisible;
};
if (verticalScrollBar){
verticalScrollBar.visible = obj.verticalScrollBarVisible;
};
if (whiteBox){
whiteBox.visible = obj.whiteBoxVisible;
};
horizontalScrollPosition = obj.horizontalScrollPosition;
verticalScrollPosition = obj.verticalScrollPosition;
updateDisplayList(unscaledWidth, unscaledHeight);
};
super.finishPrint(obj.scrollRect, target);
}
private function processNextQueueItem():void{
var queueItem:Object;
var nextChild:IUIComponent;
if (EffectManager.effectsPlaying.length > 0){
callLater(processNextQueueItem);
} else {
if (creationQueue.length > 0){
queueItem = creationQueue.shift();
nextChild = ((queueItem.id is String)) ? document[queueItem.id] : queueItem.id;
if ((nextChild is Container)){
Container(nextChild).createComponentsFromDescriptors(true);
};
if ((((nextChild is Container)) && ((Container(nextChild).creationPolicy == ContainerCreationPolicy.QUEUED)))){
doNextQueueItem();
} else {
nextChild.addEventListener("childrenCreationComplete", doNextQueueItem);
};
//unresolved jump
var _slot1 = e;
processNextQueueItem();
} else {
processingCreationQueue = false;
Application.useProgressiveLayout = false;
};
};
}
override public function set label(value:String):void{
}
public function get parameters():Object{
return (_parameters);
}
override public function get viewMetrics():EdgeMetrics{
if (!_applicationViewMetrics){
_applicationViewMetrics = new EdgeMetrics();
};
var vm:EdgeMetrics = _applicationViewMetrics;
var o:EdgeMetrics = super.viewMetrics;
var thickness:Number = getStyle("borderThickness");
vm.left = o.left;
vm.top = o.top;
vm.right = o.right;
vm.bottom = o.bottom;
if (((controlBar) && (controlBar.includeInLayout))){
vm.top = (vm.top - thickness);
vm.top = (vm.top + Math.max(controlBar.getExplicitOrMeasuredHeight(), thickness));
};
return (vm);
}
public function get url():String{
return (_url);
}
override public function set icon(value:Class):void{
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
super.updateDisplayList(unscaledWidth, unscaledHeight);
createBorder();
}
private function setControlBar(newControlBar:IUIComponent):void{
if (newControlBar == controlBar){
return;
};
if (((controlBar) && ((controlBar is IStyleClient)))){
IStyleClient(controlBar).clearStyle("cornerRadius");
IStyleClient(controlBar).clearStyle("docked");
};
controlBar = newControlBar;
if (((controlBar) && ((controlBar is IStyleClient)))){
IStyleClient(controlBar).setStyle("cornerRadius", 0);
IStyleClient(controlBar).setStyle("docked", true);
};
invalidateSize();
invalidateDisplayList();
invalidateViewMetricsAndPadding();
}
override public function set tabIndex(value:int):void{
}
public static function get application():Object{
return (ApplicationGlobals.application);
}
}
}//package mx.core
Section 105
//ApplicationGlobals (mx.core.ApplicationGlobals)
package mx.core {
public class ApplicationGlobals {
public static var application:Object;
public function ApplicationGlobals(){
super();
}
}
}//package mx.core
Section 106
//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.2.0.3958";
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 107
//ByteArrayAsset (mx.core.ByteArrayAsset)
package mx.core {
import flash.utils.*;
public class ByteArrayAsset extends ByteArray implements IFlexAsset {
mx_internal static const VERSION:String = "3.2.0.3958";
public function ByteArrayAsset(){
super();
}
}
}//package mx.core
Section 108
//ComponentDescriptor (mx.core.ComponentDescriptor)
package mx.core {
public class ComponentDescriptor {
public var events:Object;
public var type:Class;
public var document:Object;
private var _properties:Object;
public var propertiesFactory:Function;
public var id:String;
mx_internal static const VERSION:String = "3.2.0.3958";
public function ComponentDescriptor(descriptorProperties:Object){
var p:String;
super();
for (p in descriptorProperties) {
this[p] = descriptorProperties[p];
};
}
public function toString():String{
return (("ComponentDescriptor_" + id));
}
public function invalidateProperties():void{
_properties = null;
}
public function get properties():Object{
var cd:Array;
var n:int;
var i:int;
if (_properties){
return (_properties);
};
if (propertiesFactory != null){
_properties = propertiesFactory.call(document);
};
if (_properties){
cd = _properties.childDescriptors;
if (cd){
n = cd.length;
i = 0;
while (i < n) {
cd[i].document = document;
i++;
};
};
} else {
_properties = {};
};
return (_properties);
}
}
}//package mx.core
Section 109
//Container (mx.core.Container)
package mx.core {
import flash.display.*;
import mx.controls.scrollClasses.*;
import flash.geom.*;
import mx.graphics.*;
import flash.events.*;
import mx.events.*;
import mx.managers.*;
import mx.controls.*;
import mx.styles.*;
import mx.controls.listClasses.*;
import flash.text.*;
import flash.ui.*;
import flash.utils.*;
import mx.binding.*;
public class Container extends UIComponent implements IContainer, IDataRenderer, IFocusManagerContainer, IListItemRenderer, IRawChildrenContainer {
private var forceLayout:Boolean;// = false
private var _numChildrenCreated:int;// = -1
private var _horizontalLineScrollSize:Number;// = 5
mx_internal var border:IFlexDisplayObject;
protected var actualCreationPolicy:String;
private var _viewMetricsAndPadding:EdgeMetrics;
private var _creatingContentPane:Boolean;// = false
private var _childRepeaters:Array;
private var scrollableWidth:Number;// = 0
private var _childDescriptors:Array;
private var _rawChildren:ContainerRawChildrenList;
private var _data:Object;
private var _verticalPageScrollSize:Number;// = 0
private var _viewMetrics:EdgeMetrics;
private var _verticalScrollBar:ScrollBar;
private var scrollPropertiesChanged:Boolean;// = false
private var changedStyles:String;// = null
private var scrollPositionChanged:Boolean;// = true
private var _defaultButton:IFlexDisplayObject;
private var mouseEventReferenceCount:int;// = 0
private var _focusPane:Sprite;
protected var whiteBox:Shape;
private var _forceClippingCount:int;
private var _horizontalPageScrollSize:Number;// = 0
private var _creationPolicy:String;
private var _creationIndex:int;// = -1
private var _clipContent:Boolean;// = true
private var _verticalScrollPosition:Number;// = 0
private var _autoLayout:Boolean;// = true
private var _icon:Class;// = null
mx_internal var doingLayout:Boolean;// = false
private var _horizontalScrollBar:ScrollBar;
private var numChildrenBefore:int;
private var viewableHeight:Number;// = 0
private var viewableWidth:Number;// = 0
mx_internal var contentPane:Sprite;// = null
private var _createdComponents:Array;
private var _firstChildIndex:int;// = 0
private var scrollableHeight:Number;// = 0
private var _verticalLineScrollSize:Number;// = 5
private var _horizontalScrollPosition:Number;// = 0
mx_internal var _horizontalScrollPolicy:String;// = "auto"
private var verticalScrollPositionPending:Number;
mx_internal var _verticalScrollPolicy:String;// = "auto"
private var horizontalScrollPositionPending:Number;
mx_internal var _numChildren:int;// = 0
private var recursionFlag:Boolean;// = true
private var _label:String;// = ""
mx_internal var blocker:Sprite;
mx_internal static const VERSION:String = "3.2.0.3958";
private static const MULTIPLE_PROPERTIES:String = "<MULTIPLE>";
public function Container(){
super();
tabChildren = true;
tabEnabled = false;
showInAutomationHierarchy = false;
}
public function set verticalScrollPolicy(value:String):void{
if (_verticalScrollPolicy != value){
_verticalScrollPolicy = value;
invalidateDisplayList();
dispatchEvent(new Event("verticalScrollPolicyChanged"));
};
}
private function createContentPaneAndScrollbarsIfNeeded():Boolean{
var bounds:Rectangle;
var changed:Boolean;
if (_clipContent){
bounds = getScrollableRect();
changed = createScrollbarsIfNeeded(bounds);
if (border){
updateBackgroundImageRect();
};
return (changed);
} else {
changed = createOrDestroyScrollbars(false, false, false);
bounds = getScrollableRect();
scrollableWidth = bounds.right;
scrollableHeight = bounds.bottom;
if (((changed) && (border))){
updateBackgroundImageRect();
};
};
return (changed);
}
override protected function initializationComplete():void{
}
mx_internal function rawChildren_getObjectsUnderPoint(pt:Point):Array{
return (super.getObjectsUnderPoint(pt));
}
public function set creatingContentPane(value:Boolean):void{
_creatingContentPane = value;
}
public function set clipContent(value:Boolean):void{
if (_clipContent != value){
_clipContent = value;
invalidateDisplayList();
};
}
protected function scrollChildren():void{
if (!contentPane){
return;
};
var vm:EdgeMetrics = viewMetrics;
var x:Number = 0;
var y:Number = 0;
var w:Number = ((unscaledWidth - vm.left) - vm.right);
var h:Number = ((unscaledHeight - vm.top) - vm.bottom);
if (_clipContent){
x = (x + _horizontalScrollPosition);
if (horizontalScrollBar){
w = viewableWidth;
};
y = (y + _verticalScrollPosition);
if (verticalScrollBar){
h = viewableHeight;
};
} else {
w = scrollableWidth;
h = scrollableHeight;
};
var sr:Rectangle = getScrollableRect();
if ((((((((((((((x == 0)) && ((y == 0)))) && ((w >= sr.right)))) && ((h >= sr.bottom)))) && ((sr.left >= 0)))) && ((sr.top >= 0)))) && ((_forceClippingCount <= 0)))){
contentPane.scrollRect = null;
contentPane.opaqueBackground = null;
contentPane.cacheAsBitmap = false;
} else {
contentPane.scrollRect = new Rectangle(x, y, w, h);
};
if (focusPane){
focusPane.scrollRect = contentPane.scrollRect;
};
if (((((border) && ((border is IRectangularBorder)))) && (IRectangularBorder(border).hasBackgroundImage))){
IRectangularBorder(border).layoutBackgroundImage();
};
}
override public function set doubleClickEnabled(value:Boolean):void{
var n:int;
var i:int;
var child:InteractiveObject;
super.doubleClickEnabled = value;
if (contentPane){
n = contentPane.numChildren;
i = 0;
while (i < n) {
child = (contentPane.getChildAt(i) as InteractiveObject);
if (child){
child.doubleClickEnabled = value;
};
i++;
};
};
}
override public function notifyStyleChangeInChildren(styleProp:String, recursive:Boolean):void{
var child:ISimpleStyleClient;
var n:int = super.numChildren;
var i:int;
while (i < n) {
if (((((contentPane) || ((i < _firstChildIndex)))) || ((i >= (_firstChildIndex + _numChildren))))){
child = (super.getChildAt(i) as ISimpleStyleClient);
if (child){
child.styleChanged(styleProp);
if ((child is IStyleClient)){
IStyleClient(child).notifyStyleChangeInChildren(styleProp, recursive);
};
};
};
i++;
};
if (recursive){
changedStyles = (((!((changedStyles == null))) || ((styleProp == null)))) ? MULTIPLE_PROPERTIES : styleProp;
invalidateProperties();
};
}
mx_internal function get createdComponents():Array{
return (_createdComponents);
}
public function get childDescriptors():Array{
return (_childDescriptors);
}
override public function get contentMouseY():Number{
if (contentPane){
return (contentPane.mouseY);
};
return (super.contentMouseY);
}
mx_internal function get childRepeaters():Array{
return (_childRepeaters);
}
override public function contains(child:DisplayObject):Boolean{
if (contentPane){
return (contentPane.contains(child));
};
return (super.contains(child));
}
override public function get contentMouseX():Number{
if (contentPane){
return (contentPane.mouseX);
};
return (super.contentMouseX);
}
mx_internal function set createdComponents(value:Array):void{
_createdComponents = value;
}
public function get horizontalScrollBar():ScrollBar{
return (_horizontalScrollBar);
}
override public function validateSize(recursive:Boolean=false):void{
var n:int;
var i:int;
var child:DisplayObject;
if ((((autoLayout == false)) && ((forceLayout == false)))){
if (recursive){
n = super.numChildren;
i = 0;
while (i < n) {
child = super.getChildAt(i);
if ((child is ILayoutManagerClient)){
ILayoutManagerClient(child).validateSize(true);
};
i++;
};
};
adjustSizesForScaleChanges();
} else {
super.validateSize(recursive);
};
}
public function get rawChildren():IChildList{
if (!_rawChildren){
_rawChildren = new ContainerRawChildrenList(this);
};
return (_rawChildren);
}
override public function getChildAt(index:int):DisplayObject{
if (contentPane){
return (contentPane.getChildAt(index));
};
return (super.getChildAt((_firstChildIndex + index)));
}
override protected function attachOverlay():void{
rawChildren_addChild(overlay);
}
override public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{
super.addEventListener(type, listener, useCapture, priority, useWeakReference);
if ((((((((((((((((type == MouseEvent.CLICK)) || ((type == MouseEvent.DOUBLE_CLICK)))) || ((type == MouseEvent.MOUSE_DOWN)))) || ((type == MouseEvent.MOUSE_MOVE)))) || ((type == MouseEvent.MOUSE_OVER)))) || ((type == MouseEvent.MOUSE_OUT)))) || ((type == MouseEvent.MOUSE_UP)))) || ((type == MouseEvent.MOUSE_WHEEL)))){
if ((((mouseEventReferenceCount < 2147483647)) && ((mouseEventReferenceCount++ == 0)))){
setStyle("mouseShield", true);
setStyle("mouseShieldChildren", true);
};
};
}
override public function localToContent(point:Point):Point{
if (!contentPane){
return (point);
};
point = localToGlobal(point);
return (globalToContent(point));
}
public function executeChildBindings(recurse:Boolean):void{
var child:IUIComponent;
var n:int = numChildren;
var i:int;
while (i < n) {
child = IUIComponent(getChildAt(i));
if ((child is IDeferredInstantiationUIComponent)){
IDeferredInstantiationUIComponent(child).executeBindings(recurse);
};
i++;
};
}
protected function createBorder():void{
var borderClass:Class;
if (((!(border)) && (isBorderNeeded()))){
borderClass = getStyle("borderSkin");
if (borderClass != null){
border = new (borderClass);
border.name = "border";
if ((border is IUIComponent)){
IUIComponent(border).enabled = enabled;
};
if ((border is ISimpleStyleClient)){
ISimpleStyleClient(border).styleName = this;
};
rawChildren.addChildAt(DisplayObject(border), 0);
invalidateDisplayList();
};
};
}
public function get verticalScrollPosition():Number{
if (!isNaN(verticalScrollPositionPending)){
return (verticalScrollPositionPending);
};
return (_verticalScrollPosition);
}
public function get horizontalScrollPosition():Number{
if (!isNaN(horizontalScrollPositionPending)){
return (horizontalScrollPositionPending);
};
return (_horizontalScrollPosition);
}
protected function layoutChrome(unscaledWidth:Number, unscaledHeight:Number):void{
if (border){
updateBackgroundImageRect();
border.move(0, 0);
border.setActualSize(unscaledWidth, unscaledHeight);
};
}
mx_internal function set childRepeaters(value:Array):void{
_childRepeaters = value;
}
override public function get focusPane():Sprite{
return (_focusPane);
}
public function set creationIndex(value:int):void{
_creationIndex = value;
}
public function get viewMetrics():EdgeMetrics{
var bm:EdgeMetrics = borderMetrics;
var verticalScrollBarIncluded:Boolean = ((!((verticalScrollBar == null))) && (((doingLayout) || ((verticalScrollPolicy == ScrollPolicy.ON)))));
var horizontalScrollBarIncluded:Boolean = ((!((horizontalScrollBar == null))) && (((doingLayout) || ((horizontalScrollPolicy == ScrollPolicy.ON)))));
if (((!(verticalScrollBarIncluded)) && (!(horizontalScrollBarIncluded)))){
return (bm);
};
if (!_viewMetrics){
_viewMetrics = bm.clone();
} else {
_viewMetrics.left = bm.left;
_viewMetrics.right = bm.right;
_viewMetrics.top = bm.top;
_viewMetrics.bottom = bm.bottom;
};
if (verticalScrollBarIncluded){
_viewMetrics.right = (_viewMetrics.right + verticalScrollBar.minWidth);
};
if (horizontalScrollBarIncluded){
_viewMetrics.bottom = (_viewMetrics.bottom + horizontalScrollBar.minHeight);
};
return (_viewMetrics);
}
public function set verticalScrollBar(value:ScrollBar):void{
_verticalScrollBar = value;
}
public function set verticalScrollPosition(value:Number):void{
if (_verticalScrollPosition == value){
return;
};
_verticalScrollPosition = value;
scrollPositionChanged = true;
if (!initialized){
verticalScrollPositionPending = value;
};
invalidateDisplayList();
dispatchEvent(new Event("viewChanged"));
}
private function createOrDestroyScrollbars(needHorizontal:Boolean, needVertical:Boolean, needContentPane:Boolean):Boolean{
var fm:IFocusManager;
var horizontalScrollBarStyleName:String;
var verticalScrollBarStyleName:String;
var g:Graphics;
var changed:Boolean;
if (((((needHorizontal) || (needVertical))) || (needContentPane))){
createContentPane();
};
if (needHorizontal){
if (!horizontalScrollBar){
horizontalScrollBar = new HScrollBar();
horizontalScrollBar.name = "horizontalScrollBar";
horizontalScrollBarStyleName = getStyle("horizontalScrollBarStyleName");
if (((horizontalScrollBarStyleName) && ((horizontalScrollBar is ISimpleStyleClient)))){
ISimpleStyleClient(horizontalScrollBar).styleName = horizontalScrollBarStyleName;
};
rawChildren.addChild(DisplayObject(horizontalScrollBar));
horizontalScrollBar.lineScrollSize = horizontalLineScrollSize;
horizontalScrollBar.pageScrollSize = horizontalPageScrollSize;
horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, horizontalScrollBar_scrollHandler);
horizontalScrollBar.enabled = enabled;
if ((horizontalScrollBar is IInvalidating)){
IInvalidating(horizontalScrollBar).validateNow();
};
invalidateDisplayList();
invalidateViewMetricsAndPadding();
changed = true;
if (!verticalScrollBar){
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
};
};
} else {
if (horizontalScrollBar){
horizontalScrollBar.removeEventListener(ScrollEvent.SCROLL, horizontalScrollBar_scrollHandler);
rawChildren.removeChild(DisplayObject(horizontalScrollBar));
horizontalScrollBar = null;
viewableWidth = (scrollableWidth = 0);
if (_horizontalScrollPosition != 0){
_horizontalScrollPosition = 0;
scrollPositionChanged = true;
};
invalidateDisplayList();
invalidateViewMetricsAndPadding();
changed = true;
fm = focusManager;
if (((!(verticalScrollBar)) && (((!(fm)) || (!((fm.getFocus() == this))))))){
removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
};
};
};
if (needVertical){
if (!verticalScrollBar){
verticalScrollBar = new VScrollBar();
verticalScrollBar.name = "verticalScrollBar";
verticalScrollBarStyleName = getStyle("verticalScrollBarStyleName");
if (((verticalScrollBarStyleName) && ((verticalScrollBar is ISimpleStyleClient)))){
ISimpleStyleClient(verticalScrollBar).styleName = verticalScrollBarStyleName;
};
rawChildren.addChild(DisplayObject(verticalScrollBar));
verticalScrollBar.lineScrollSize = verticalLineScrollSize;
verticalScrollBar.pageScrollSize = verticalPageScrollSize;
verticalScrollBar.addEventListener(ScrollEvent.SCROLL, verticalScrollBar_scrollHandler);
verticalScrollBar.enabled = enabled;
if ((verticalScrollBar is IInvalidating)){
IInvalidating(verticalScrollBar).validateNow();
};
invalidateDisplayList();
invalidateViewMetricsAndPadding();
changed = true;
if (!horizontalScrollBar){
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
};
addEventListener(MouseEvent.MOUSE_WHEEL, mouseWheelHandler);
};
} else {
if (verticalScrollBar){
verticalScrollBar.removeEventListener(ScrollEvent.SCROLL, verticalScrollBar_scrollHandler);
rawChildren.removeChild(DisplayObject(verticalScrollBar));
verticalScrollBar = null;
viewableHeight = (scrollableHeight = 0);
if (_verticalScrollPosition != 0){
_verticalScrollPosition = 0;
scrollPositionChanged = true;
};
invalidateDisplayList();
invalidateViewMetricsAndPadding();
changed = true;
fm = focusManager;
if (((!(horizontalScrollBar)) && (((!(fm)) || (!((fm.getFocus() == this))))))){
removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
};
removeEventListener(MouseEvent.MOUSE_WHEEL, mouseWheelHandler);
};
};
if (((horizontalScrollBar) && (verticalScrollBar))){
if (!whiteBox){
whiteBox = new FlexShape();
whiteBox.name = "whiteBox";
g = whiteBox.graphics;
g.beginFill(0xFFFFFF);
g.drawRect(0, 0, verticalScrollBar.minWidth, horizontalScrollBar.minHeight);
g.endFill();
rawChildren.addChild(whiteBox);
};
} else {
if (whiteBox){
rawChildren.removeChild(whiteBox);
whiteBox = null;
};
};
return (changed);
}
override protected function keyDownHandler(event:KeyboardEvent):void{
var direction:String;
var oldPos:Number;
var focusObj:Object = getFocus();
if ((focusObj is TextField)){
return;
};
if (verticalScrollBar){
direction = ScrollEventDirection.VERTICAL;
oldPos = verticalScrollPosition;
switch (event.keyCode){
case Keyboard.DOWN:
verticalScrollPosition = (verticalScrollPosition + verticalLineScrollSize);
dispatchScrollEvent(direction, oldPos, verticalScrollPosition, ScrollEventDetail.LINE_DOWN);
event.stopPropagation();
break;
case Keyboard.UP:
verticalScrollPosition = (verticalScrollPosition - verticalLineScrollSize);
dispatchScrollEvent(direction, oldPos, verticalScrollPosition, ScrollEventDetail.LINE_UP);
event.stopPropagation();
break;
case Keyboard.PAGE_UP:
verticalScrollPosition = (verticalScrollPosition - verticalPageScrollSize);
dispatchScrollEvent(direction, oldPos, verticalScrollPosition, ScrollEventDetail.PAGE_UP);
event.stopPropagation();
break;
case Keyboard.PAGE_DOWN:
verticalScrollPosition = (verticalScrollPosition + verticalPageScrollSize);
dispatchScrollEvent(direction, oldPos, verticalScrollPosition, ScrollEventDetail.PAGE_DOWN);
event.stopPropagation();
break;
case Keyboard.HOME:
verticalScrollPosition = verticalScrollBar.minScrollPosition;
dispatchScrollEvent(direction, oldPos, verticalScrollPosition, ScrollEventDetail.AT_TOP);
event.stopPropagation();
break;
case Keyboard.END:
verticalScrollPosition = verticalScrollBar.maxScrollPosition;
dispatchScrollEvent(direction, oldPos, verticalScrollPosition, ScrollEventDetail.AT_BOTTOM);
event.stopPropagation();
break;
};
};
if (horizontalScrollBar){
direction = ScrollEventDirection.HORIZONTAL;
oldPos = horizontalScrollPosition;
switch (event.keyCode){
case Keyboard.LEFT:
horizontalScrollPosition = (horizontalScrollPosition - horizontalLineScrollSize);
dispatchScrollEvent(direction, oldPos, horizontalScrollPosition, ScrollEventDetail.LINE_LEFT);
event.stopPropagation();
break;
case Keyboard.RIGHT:
horizontalScrollPosition = (horizontalScrollPosition + horizontalLineScrollSize);
dispatchScrollEvent(direction, oldPos, horizontalScrollPosition, ScrollEventDetail.LINE_RIGHT);
event.stopPropagation();
break;
};
};
}
public function get icon():Class{
return (_icon);
}
private function createOrDestroyBlocker():void{
var o:DisplayObject;
var sm:ISystemManager;
if (enabled){
if (blocker){
rawChildren.removeChild(blocker);
blocker = null;
};
} else {
if (!blocker){
blocker = new FlexSprite();
blocker.name = "blocker";
blocker.mouseEnabled = true;
rawChildren.addChild(blocker);
blocker.addEventListener(MouseEvent.CLICK, blocker_clickHandler);
o = (focusManager) ? DisplayObject(focusManager.getFocus()) : null;
while (o) {
if (o == this){
sm = systemManager;
if (((sm) && (sm.stage))){
sm.stage.focus = null;
};
break;
};
o = o.parent;
};
};
};
}
private function horizontalScrollBar_scrollHandler(event:Event):void{
var oldPos:Number;
if ((event is ScrollEvent)){
oldPos = horizontalScrollPosition;
horizontalScrollPosition = horizontalScrollBar.scrollPosition;
dispatchScrollEvent(ScrollEventDirection.HORIZONTAL, oldPos, horizontalScrollPosition, ScrollEvent(event).detail);
};
}
public function createComponentFromDescriptor(descriptor:ComponentDescriptor, recurse:Boolean):IFlexDisplayObject{
var p:String;
var rChild:IRepeaterClient;
var scChild:IStyleClient;
var eventName:String;
var eventHandler:String;
var childDescriptor:UIComponentDescriptor = UIComponentDescriptor(descriptor);
var childProperties:Object = childDescriptor.properties;
if (((((((!((numChildrenBefore == 0))) || (!((numChildrenCreated == -1))))) && ((childDescriptor.instanceIndices == null)))) && (hasChildMatchingDescriptor(childDescriptor)))){
return (null);
};
UIComponentGlobals.layoutManager.usePhasedInstantiation = true;
var childType:Class = childDescriptor.type;
var child:IDeferredInstantiationUIComponent = new (childType);
child.id = childDescriptor.id;
if (((child.id) && (!((child.id == ""))))){
child.name = child.id;
};
child.descriptor = childDescriptor;
if (((childProperties.childDescriptors) && ((child is Container)))){
Container(child)._childDescriptors = childProperties.childDescriptors;
delete childProperties.childDescriptors;
};
for (p in childProperties) {
child[p] = childProperties[p];
};
if ((child is Container)){
Container(child).recursionFlag = recurse;
};
if (childDescriptor.instanceIndices){
if ((child is IRepeaterClient)){
rChild = IRepeaterClient(child);
rChild.instanceIndices = childDescriptor.instanceIndices;
rChild.repeaters = childDescriptor.repeaters;
rChild.repeaterIndices = childDescriptor.repeaterIndices;
};
};
if ((child is IStyleClient)){
scChild = IStyleClient(child);
if (childDescriptor.stylesFactory != null){
if (!scChild.styleDeclaration){
scChild.styleDeclaration = new CSSStyleDeclaration();
};
scChild.styleDeclaration.factory = childDescriptor.stylesFactory;
};
};
var childEvents:Object = childDescriptor.events;
if (childEvents){
for (eventName in childEvents) {
eventHandler = childEvents[eventName];
child.addEventListener(eventName, childDescriptor.document[eventHandler]);
};
};
var childEffects:Array = childDescriptor.effects;
if (childEffects){
child.registerEffects(childEffects);
};
if ((child is IRepeaterClient)){
IRepeaterClient(child).initializeRepeaterArrays(this);
};
child.createReferenceOnParentDocument(IFlexDisplayObject(childDescriptor.document));
if (!child.document){
child.document = childDescriptor.document;
};
if ((child is IRepeater)){
if (!childRepeaters){
childRepeaters = [];
};
childRepeaters.push(child);
child.executeBindings();
IRepeater(child).initializeRepeater(this, recurse);
} else {
addChild(DisplayObject(child));
child.executeBindings();
if ((((creationPolicy == ContainerCreationPolicy.QUEUED)) || ((creationPolicy == ContainerCreationPolicy.NONE)))){
child.addEventListener(FlexEvent.CREATION_COMPLETE, creationCompleteHandler);
};
};
return (child);
}
override public function set enabled(value:Boolean):void{
super.enabled = value;
if (horizontalScrollBar){
horizontalScrollBar.enabled = value;
};
if (verticalScrollBar){
verticalScrollBar.enabled = value;
};
invalidateProperties();
}
public function set horizontalScrollBar(value:ScrollBar):void{
_horizontalScrollBar = value;
}
mx_internal function get usePadding():Boolean{
return (true);
}
override public function get baselinePosition():Number{
var child:IUIComponent;
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
if ((((getStyle("verticalAlign") == "top")) && ((numChildren > 0)))){
child = (getChildAt(0) as IUIComponent);
if (child){
return ((child.y + child.baselinePosition));
};
};
return (super.baselinePosition);
};
if (!validateBaselinePosition()){
return (NaN);
};
var lineMetrics:TextLineMetrics = measureText("Wj");
if (height < (((2 * viewMetrics.top) + 4) + lineMetrics.ascent)){
return (int((height + ((lineMetrics.ascent - height) / 2))));
};
return (((viewMetrics.top + 2) + lineMetrics.ascent));
}
override public function getChildByName(name:String):DisplayObject{
var child:DisplayObject;
var index:int;
if (contentPane){
return (contentPane.getChildByName(name));
};
child = super.getChildByName(name);
if (!child){
return (null);
};
index = (super.getChildIndex(child) - _firstChildIndex);
if ((((index < 0)) || ((index >= _numChildren)))){
return (null);
};
return (child);
}
public function get verticalLineScrollSize():Number{
return (_verticalLineScrollSize);
}
public function get horizontalScrollPolicy():String{
return (_horizontalScrollPolicy);
}
override public function addChildAt(child:DisplayObject, index:int):DisplayObject{
var formerParent:DisplayObjectContainer = child.parent;
if (((formerParent) && (!((formerParent is Loader))))){
if (formerParent == this){
index = ((index)==numChildren) ? (index - 1) : index;
};
formerParent.removeChild(child);
};
addingChild(child);
if (contentPane){
contentPane.addChildAt(child, index);
} else {
$addChildAt(child, (_firstChildIndex + index));
};
childAdded(child);
if ((((child is UIComponent)) && (UIComponent(child).isDocument))){
BindingManager.setEnabled(child, true);
};
return (child);
}
public function get maxVerticalScrollPosition():Number{
return ((verticalScrollBar) ? verticalScrollBar.maxScrollPosition : Math.max((scrollableHeight - viewableHeight), 0));
}
public function set horizontalScrollPosition(value:Number):void{
if (_horizontalScrollPosition == value){
return;
};
_horizontalScrollPosition = value;
scrollPositionChanged = true;
if (!initialized){
horizontalScrollPositionPending = value;
};
invalidateDisplayList();
dispatchEvent(new Event("viewChanged"));
}
mx_internal function invalidateViewMetricsAndPadding():void{
_viewMetricsAndPadding = null;
}
public function get horizontalLineScrollSize():Number{
return (_horizontalLineScrollSize);
}
override public function set focusPane(o:Sprite):void{
var oldInvalidateSizeFlag:Boolean = invalidateSizeFlag;
var oldInvalidateDisplayListFlag:Boolean = invalidateDisplayListFlag;
invalidateSizeFlag = true;
invalidateDisplayListFlag = true;
if (o){
rawChildren.addChild(o);
o.x = 0;
o.y = 0;
o.scrollRect = null;
_focusPane = o;
} else {
rawChildren.removeChild(_focusPane);
_focusPane = null;
};
if (((o) && (contentPane))){
o.x = contentPane.x;
o.y = contentPane.y;
o.scrollRect = contentPane.scrollRect;
};
invalidateSizeFlag = oldInvalidateSizeFlag;
invalidateDisplayListFlag = oldInvalidateDisplayListFlag;
}
private function updateBackgroundImageRect():void{
var rectBorder:IRectangularBorder = (border as IRectangularBorder);
if (!rectBorder){
return;
};
if ((((viewableWidth == 0)) && ((viewableHeight == 0)))){
rectBorder.backgroundImageBounds = null;
return;
};
var vm:EdgeMetrics = viewMetrics;
var bkWidth:Number = (viewableWidth) ? viewableWidth : ((unscaledWidth - vm.left) - vm.right);
var bkHeight:Number = (viewableHeight) ? viewableHeight : ((unscaledHeight - vm.top) - vm.bottom);
if (getStyle("backgroundAttachment") == "fixed"){
rectBorder.backgroundImageBounds = new Rectangle(vm.left, vm.top, bkWidth, bkHeight);
} else {
rectBorder.backgroundImageBounds = new Rectangle(vm.left, vm.top, Math.max(scrollableWidth, bkWidth), Math.max(scrollableHeight, bkHeight));
};
}
private function blocker_clickHandler(event:Event):void{
event.stopPropagation();
}
private function mouseWheelHandler(event:MouseEvent):void{
var scrollDirection:int;
var lineScrollSize:int;
var scrollAmount:Number;
var oldPosition:Number;
if (verticalScrollBar){
event.stopPropagation();
scrollDirection = ((event.delta <= 0)) ? 1 : -1;
lineScrollSize = (verticalScrollBar) ? verticalScrollBar.lineScrollSize : 1;
scrollAmount = Math.max(Math.abs(event.delta), lineScrollSize);
oldPosition = verticalScrollPosition;
verticalScrollPosition = (verticalScrollPosition + ((3 * scrollAmount) * scrollDirection));
dispatchScrollEvent(ScrollEventDirection.VERTICAL, oldPosition, verticalScrollPosition, ((event.delta <= 0)) ? ScrollEventDetail.LINE_UP : ScrollEventDetail.LINE_DOWN);
};
}
public function get defaultButton():IFlexDisplayObject{
return (_defaultButton);
}
mx_internal function createContentPane():void{
var childIndex:int;
var child:IUIComponent;
if (contentPane){
return;
};
creatingContentPane = true;
var n:int = numChildren;
var newPane:Sprite = new FlexSprite();
newPane.name = "contentPane";
newPane.tabChildren = true;
if (border){
childIndex = (rawChildren.getChildIndex(DisplayObject(border)) + 1);
if ((((border is IRectangularBorder)) && (IRectangularBorder(border).hasBackgroundImage))){
childIndex++;
};
} else {
childIndex = 0;
};
rawChildren.addChildAt(newPane, childIndex);
var i:int;
while (i < n) {
child = IUIComponent(super.getChildAt(_firstChildIndex));
newPane.addChild(DisplayObject(child));
child.parentChanged(newPane);
_numChildren--;
i++;
};
contentPane = newPane;
creatingContentPane = false;
contentPane.visible = true;
}
public function set verticalPageScrollSize(value:Number):void{
scrollPropertiesChanged = true;
_verticalPageScrollSize = value;
invalidateDisplayList();
dispatchEvent(new Event("verticalPageScrollSizeChanged"));
}
mx_internal function setDocumentDescriptor(desc:UIComponentDescriptor):void{
var message:String;
if (processedDescriptors){
return;
};
if (((_documentDescriptor) && (_documentDescriptor.properties.childDescriptors))){
if (desc.properties.childDescriptors){
message = resourceManager.getString("core", "multipleChildSets_ClassAndSubclass");
throw (new Error(message));
};
} else {
_documentDescriptor = desc;
_documentDescriptor.document = this;
};
}
private function verticalScrollBar_scrollHandler(event:Event):void{
var oldPos:Number;
if ((event is ScrollEvent)){
oldPos = verticalScrollPosition;
verticalScrollPosition = verticalScrollBar.scrollPosition;
dispatchScrollEvent(ScrollEventDirection.VERTICAL, oldPos, verticalScrollPosition, ScrollEvent(event).detail);
};
}
public function get creationPolicy():String{
return (_creationPolicy);
}
public function set icon(value:Class):void{
_icon = value;
dispatchEvent(new Event("iconChanged"));
}
private function dispatchScrollEvent(direction:String, oldPosition:Number, newPosition:Number, detail:String):void{
var event:ScrollEvent = new ScrollEvent(ScrollEvent.SCROLL);
event.direction = direction;
event.position = newPosition;
event.delta = (newPosition - oldPosition);
event.detail = detail;
dispatchEvent(event);
}
public function get label():String{
return (_label);
}
public function get verticalScrollPolicy():String{
return (_verticalScrollPolicy);
}
public function get borderMetrics():EdgeMetrics{
return ((((border) && ((border is IRectangularBorder)))) ? IRectangularBorder(border).borderMetrics : EdgeMetrics.EMPTY);
}
private function creationCompleteHandler(event:FlexEvent):void{
numChildrenCreated--;
if (numChildrenCreated <= 0){
dispatchEvent(new FlexEvent("childrenCreationComplete"));
};
}
override public function contentToLocal(point:Point):Point{
if (!contentPane){
return (point);
};
point = contentToGlobal(point);
return (globalToLocal(point));
}
override public function removeChild(child:DisplayObject):DisplayObject{
var n:int;
var i:int;
if ((((child is IDeferredInstantiationUIComponent)) && (IDeferredInstantiationUIComponent(child).descriptor))){
if (createdComponents){
n = createdComponents.length;
i = 0;
while (i < n) {
if (createdComponents[i] === child){
createdComponents.splice(i, 1);
};
i++;
};
};
};
removingChild(child);
if ((((child is UIComponent)) && (UIComponent(child).isDocument))){
BindingManager.setEnabled(child, false);
};
if (contentPane){
contentPane.removeChild(child);
} else {
$removeChild(child);
};
childRemoved(child);
return (child);
}
final mx_internal function get $numChildren():int{
return (super.numChildren);
}
mx_internal function get numRepeaters():int{
return ((childRepeaters) ? childRepeaters.length : 0);
}
mx_internal function set numChildrenCreated(value:int):void{
_numChildrenCreated = value;
}
public function get creatingContentPane():Boolean{
return (_creatingContentPane);
}
public function get clipContent():Boolean{
return (_clipContent);
}
mx_internal function rawChildren_getChildIndex(child:DisplayObject):int{
return (super.getChildIndex(child));
}
override public function regenerateStyleCache(recursive:Boolean):void{
var n:int;
var i:int;
var child:DisplayObject;
super.regenerateStyleCache(recursive);
if (contentPane){
n = contentPane.numChildren;
i = 0;
while (i < n) {
child = getChildAt(i);
if (((recursive) && ((child is UIComponent)))){
if (UIComponent(child).inheritingStyles != UIComponent.STYLE_UNINITIALIZED){
UIComponent(child).regenerateStyleCache(recursive);
};
} else {
if ((((child is IUITextField)) && (IUITextField(child).inheritingStyles))){
StyleProtoChain.initTextField(IUITextField(child));
};
};
i++;
};
};
}
override public function getChildIndex(child:DisplayObject):int{
var index:int;
if (contentPane){
return (contentPane.getChildIndex(child));
};
index = (super.getChildIndex(child) - _firstChildIndex);
return (index);
}
mx_internal function rawChildren_contains(child:DisplayObject):Boolean{
return (super.contains(child));
}
mx_internal function getScrollableRect():Rectangle{
var child:DisplayObject;
var left:Number = 0;
var top:Number = 0;
var right:Number = 0;
var bottom:Number = 0;
var n:int = numChildren;
var i:int;
while (i < n) {
child = getChildAt(i);
if ((((child is IUIComponent)) && (!(IUIComponent(child).includeInLayout)))){
} else {
left = Math.min(left, child.x);
top = Math.min(top, child.y);
if (!isNaN(child.width)){
right = Math.max(right, (child.x + child.width));
};
if (!isNaN(child.height)){
bottom = Math.max(bottom, (child.y + child.height));
};
};
i++;
};
var vm:EdgeMetrics = viewMetrics;
var bounds:Rectangle = new Rectangle();
bounds.left = left;
bounds.top = top;
bounds.right = right;
bounds.bottom = bottom;
if (usePadding){
bounds.right = (bounds.right + getStyle("paddingRight"));
bounds.bottom = (bounds.bottom + getStyle("paddingBottom"));
};
return (bounds);
}
override protected function createChildren():void{
var mainApp:Application;
super.createChildren();
createBorder();
createOrDestroyScrollbars((horizontalScrollPolicy == ScrollPolicy.ON), (verticalScrollPolicy == ScrollPolicy.ON), (((horizontalScrollPolicy == ScrollPolicy.ON)) || ((verticalScrollPolicy == ScrollPolicy.ON))));
if (creationPolicy != null){
actualCreationPolicy = creationPolicy;
} else {
if ((parent is Container)){
if (Container(parent).actualCreationPolicy == ContainerCreationPolicy.QUEUED){
actualCreationPolicy = ContainerCreationPolicy.AUTO;
} else {
actualCreationPolicy = Container(parent).actualCreationPolicy;
};
};
};
if (actualCreationPolicy == ContainerCreationPolicy.NONE){
actualCreationPolicy = ContainerCreationPolicy.AUTO;
} else {
if (actualCreationPolicy == ContainerCreationPolicy.QUEUED){
mainApp = (parentApplication) ? Application(parentApplication) : Application(Application.application);
mainApp.addToCreationQueue(this, creationIndex, null, this);
} else {
if (recursionFlag){
createComponentsFromDescriptors();
};
};
};
if (autoLayout == false){
forceLayout = true;
};
UIComponentGlobals.layoutManager.addEventListener(FlexEvent.UPDATE_COMPLETE, layoutCompleteHandler, false, 0, true);
}
override public function executeBindings(recurse:Boolean=false):void{
var bindingsHost:Object = (((descriptor) && (descriptor.document))) ? descriptor.document : parentDocument;
BindingManager.executeBindings(bindingsHost, id, this);
if (recurse){
executeChildBindings(recurse);
};
}
override public function setChildIndex(child:DisplayObject, newIndex:int):void{
var oldIndex:int;
var eventOldIndex:int = oldIndex;
var eventNewIndex:int = newIndex;
if (contentPane){
contentPane.setChildIndex(child, newIndex);
if (((_autoLayout) || (forceLayout))){
invalidateDisplayList();
};
} else {
oldIndex = super.getChildIndex(child);
newIndex = (newIndex + _firstChildIndex);
if (newIndex == oldIndex){
return;
};
super.setChildIndex(child, newIndex);
invalidateDisplayList();
eventOldIndex = (oldIndex - _firstChildIndex);
eventNewIndex = (newIndex - _firstChildIndex);
};
var event:IndexChangedEvent = new IndexChangedEvent(IndexChangedEvent.CHILD_INDEX_CHANGE);
event.relatedObject = child;
event.oldIndex = eventOldIndex;
event.newIndex = eventNewIndex;
dispatchEvent(event);
dispatchEvent(new Event("childrenChanged"));
}
override public function globalToContent(point:Point):Point{
if (contentPane){
return (contentPane.globalToLocal(point));
};
return (globalToLocal(point));
}
mx_internal function rawChildren_removeChild(child:DisplayObject):DisplayObject{
var index:int = rawChildren_getChildIndex(child);
return (rawChildren_removeChildAt(index));
}
mx_internal function rawChildren_setChildIndex(child:DisplayObject, newIndex:int):void{
var oldIndex:int = super.getChildIndex(child);
super.setChildIndex(child, newIndex);
if ((((oldIndex < _firstChildIndex)) && ((newIndex >= _firstChildIndex)))){
_firstChildIndex--;
} else {
if ((((oldIndex >= _firstChildIndex)) && ((newIndex <= _firstChildIndex)))){
_firstChildIndex++;
};
};
dispatchEvent(new Event("childrenChanged"));
}
public function set verticalLineScrollSize(value:Number):void{
scrollPropertiesChanged = true;
_verticalLineScrollSize = value;
invalidateDisplayList();
dispatchEvent(new Event("verticalLineScrollSizeChanged"));
}
mx_internal function rawChildren_getChildAt(index:int):DisplayObject{
return (super.getChildAt(index));
}
public function get creationIndex():int{
return (_creationIndex);
}
public function get verticalScrollBar():ScrollBar{
return (_verticalScrollBar);
}
public function get viewMetricsAndPadding():EdgeMetrics{
if (((((_viewMetricsAndPadding) && (((!(horizontalScrollBar)) || ((horizontalScrollPolicy == ScrollPolicy.ON)))))) && (((!(verticalScrollBar)) || ((verticalScrollPolicy == ScrollPolicy.ON)))))){
return (_viewMetricsAndPadding);
};
if (!_viewMetricsAndPadding){
_viewMetricsAndPadding = new EdgeMetrics();
};
var o:EdgeMetrics = _viewMetricsAndPadding;
var vm:EdgeMetrics = viewMetrics;
o.left = (vm.left + getStyle("paddingLeft"));
o.right = (vm.right + getStyle("paddingRight"));
o.top = (vm.top + getStyle("paddingTop"));
o.bottom = (vm.bottom + getStyle("paddingBottom"));
return (o);
}
override public function addChild(child:DisplayObject):DisplayObject{
return (addChildAt(child, numChildren));
}
public function set horizontalPageScrollSize(value:Number):void{
scrollPropertiesChanged = true;
_horizontalPageScrollSize = value;
invalidateDisplayList();
dispatchEvent(new Event("horizontalPageScrollSizeChanged"));
}
override mx_internal function childAdded(child:DisplayObject):void{
dispatchEvent(new Event("childrenChanged"));
var event:ChildExistenceChangedEvent = new ChildExistenceChangedEvent(ChildExistenceChangedEvent.CHILD_ADD);
event.relatedObject = child;
dispatchEvent(event);
child.dispatchEvent(new FlexEvent(FlexEvent.ADD));
super.childAdded(child);
}
public function set horizontalScrollPolicy(value:String):void{
if (_horizontalScrollPolicy != value){
_horizontalScrollPolicy = value;
invalidateDisplayList();
dispatchEvent(new Event("horizontalScrollPolicyChanged"));
};
}
private function layoutCompleteHandler(event:FlexEvent):void{
UIComponentGlobals.layoutManager.removeEventListener(FlexEvent.UPDATE_COMPLETE, layoutCompleteHandler);
forceLayout = false;
var needToScrollChildren:Boolean;
if (!isNaN(horizontalScrollPositionPending)){
if (horizontalScrollPositionPending < 0){
horizontalScrollPositionPending = 0;
} else {
if (horizontalScrollPositionPending > maxHorizontalScrollPosition){
horizontalScrollPositionPending = maxHorizontalScrollPosition;
};
};
if (((horizontalScrollBar) && (!((horizontalScrollBar.scrollPosition == horizontalScrollPositionPending))))){
_horizontalScrollPosition = horizontalScrollPositionPending;
horizontalScrollBar.scrollPosition = horizontalScrollPositionPending;
needToScrollChildren = true;
};
horizontalScrollPositionPending = NaN;
};
if (!isNaN(verticalScrollPositionPending)){
if (verticalScrollPositionPending < 0){
verticalScrollPositionPending = 0;
} else {
if (verticalScrollPositionPending > maxVerticalScrollPosition){
verticalScrollPositionPending = maxVerticalScrollPosition;
};
};
if (((verticalScrollBar) && (!((verticalScrollBar.scrollPosition == verticalScrollPositionPending))))){
_verticalScrollPosition = verticalScrollPositionPending;
verticalScrollBar.scrollPosition = verticalScrollPositionPending;
needToScrollChildren = true;
};
verticalScrollPositionPending = NaN;
};
if (needToScrollChildren){
scrollChildren();
};
}
public function createComponentsFromDescriptors(recurse:Boolean=true):void{
var component:IFlexDisplayObject;
numChildrenBefore = numChildren;
createdComponents = [];
var n:int = (childDescriptors) ? childDescriptors.length : 0;
var i:int;
while (i < n) {
component = createComponentFromDescriptor(childDescriptors[i], recurse);
createdComponents.push(component);
i++;
};
if ((((creationPolicy == ContainerCreationPolicy.QUEUED)) || ((creationPolicy == ContainerCreationPolicy.NONE)))){
UIComponentGlobals.layoutManager.usePhasedInstantiation = false;
};
numChildrenCreated = (numChildren - numChildrenBefore);
processedDescriptors = true;
}
override mx_internal function fillOverlay(overlay:UIComponent, color:uint, targetArea:RoundedRectangle=null):void{
var vm:EdgeMetrics = viewMetrics;
var cornerRadius:Number = 0;
if (!targetArea){
targetArea = new RoundedRectangle(vm.left, vm.top, ((unscaledWidth - vm.right) - vm.left), ((unscaledHeight - vm.bottom) - vm.top), cornerRadius);
};
if (((((((((isNaN(targetArea.x)) || (isNaN(targetArea.y)))) || (isNaN(targetArea.width)))) || (isNaN(targetArea.height)))) || (isNaN(targetArea.cornerRadius)))){
return;
};
var g:Graphics = overlay.graphics;
g.clear();
g.beginFill(color);
g.drawRoundRect(targetArea.x, targetArea.y, targetArea.width, targetArea.height, (targetArea.cornerRadius * 2), (targetArea.cornerRadius * 2));
g.endFill();
}
override public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{
super.removeEventListener(type, listener, useCapture);
if ((((((((((((((((type == MouseEvent.CLICK)) || ((type == MouseEvent.DOUBLE_CLICK)))) || ((type == MouseEvent.MOUSE_DOWN)))) || ((type == MouseEvent.MOUSE_MOVE)))) || ((type == MouseEvent.MOUSE_OVER)))) || ((type == MouseEvent.MOUSE_OUT)))) || ((type == MouseEvent.MOUSE_UP)))) || ((type == MouseEvent.MOUSE_WHEEL)))){
if ((((mouseEventReferenceCount > 0)) && ((--mouseEventReferenceCount == 0)))){
setStyle("mouseShield", false);
setStyle("mouseShieldChildren", false);
};
};
}
mx_internal function rawChildren_removeChildAt(index:int):DisplayObject{
var child:DisplayObject = super.getChildAt(index);
super.removingChild(child);
$removeChildAt(index);
super.childRemoved(child);
if ((((_firstChildIndex < index)) && ((index < (_firstChildIndex + _numChildren))))){
_numChildren--;
} else {
if ((((_numChildren == 0)) || ((index < _firstChildIndex)))){
_firstChildIndex--;
};
};
invalidateSize();
invalidateDisplayList();
dispatchEvent(new Event("childrenChanged"));
return (child);
}
public function set data(value:Object):void{
_data = value;
dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
invalidateDisplayList();
}
override public function removeChildAt(index:int):DisplayObject{
return (removeChild(getChildAt(index)));
}
private function isBorderNeeded():Boolean{
var c:Class = getStyle("borderSkin");
if (c != getDefinitionByName("mx.skins.halo::HaloBorder")){
return (true);
};
//unresolved jump
var _slot1 = e;
return (true);
var v:Object = getStyle("borderStyle");
if (v){
if (((!((v == "none"))) || ((((v == "none")) && (getStyle("mouseShield")))))){
return (true);
};
};
v = getStyle("backgroundColor");
if (((!((v === null))) && (!((v === ""))))){
return (true);
};
v = getStyle("backgroundImage");
return (((!((v == null))) && (!((v == "")))));
}
public function set autoLayout(value:Boolean):void{
var p:IInvalidating;
_autoLayout = value;
if (value){
invalidateSize();
invalidateDisplayList();
p = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
};
}
public function get verticalPageScrollSize():Number{
return (_verticalPageScrollSize);
}
public function getChildren():Array{
var results:Array = [];
var n:int = numChildren;
var i:int;
while (i < n) {
results.push(getChildAt(i));
i++;
};
return (results);
}
private function createScrollbarsIfNeeded(bounds:Rectangle):Boolean{
var newScrollableWidth:Number = bounds.right;
var newScrollableHeight:Number = bounds.bottom;
var newViewableWidth:Number = unscaledWidth;
var newViewableHeight:Number = unscaledHeight;
var hasNegativeCoords:Boolean = (((bounds.left < 0)) || ((bounds.top < 0)));
var vm:EdgeMetrics = viewMetrics;
if (scaleX != 1){
newViewableWidth = (newViewableWidth + (1 / Math.abs(scaleX)));
};
if (scaleY != 1){
newViewableHeight = (newViewableHeight + (1 / Math.abs(scaleY)));
};
newViewableWidth = Math.floor(newViewableWidth);
newViewableHeight = Math.floor(newViewableHeight);
newScrollableWidth = Math.floor(newScrollableWidth);
newScrollableHeight = Math.floor(newScrollableHeight);
if (((horizontalScrollBar) && (!((horizontalScrollPolicy == ScrollPolicy.ON))))){
newViewableHeight = (newViewableHeight - horizontalScrollBar.minHeight);
};
if (((verticalScrollBar) && (!((verticalScrollPolicy == ScrollPolicy.ON))))){
newViewableWidth = (newViewableWidth - verticalScrollBar.minWidth);
};
newViewableWidth = (newViewableWidth - (vm.left + vm.right));
newViewableHeight = (newViewableHeight - (vm.top + vm.bottom));
var needHorizontal = (horizontalScrollPolicy == ScrollPolicy.ON);
var needVertical = (verticalScrollPolicy == ScrollPolicy.ON);
var needContentPane:Boolean = ((((((((((needHorizontal) || (needVertical))) || (hasNegativeCoords))) || (!((overlay == null))))) || ((vm.left > 0)))) || ((vm.top > 0)));
if (newViewableWidth < newScrollableWidth){
needContentPane = true;
if ((((((horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((((unscaledHeight - vm.top) - vm.bottom) >= 18)))) && ((((unscaledWidth - vm.left) - vm.right) >= 32)))){
needHorizontal = true;
};
};
if (newViewableHeight < newScrollableHeight){
needContentPane = true;
if ((((((verticalScrollPolicy == ScrollPolicy.AUTO)) && ((((unscaledWidth - vm.left) - vm.right) >= 18)))) && ((((unscaledHeight - vm.top) - vm.bottom) >= 32)))){
needVertical = true;
};
};
if (((((((((((((((needHorizontal) && (needVertical))) && ((horizontalScrollPolicy == ScrollPolicy.AUTO)))) && ((verticalScrollPolicy == ScrollPolicy.AUTO)))) && (horizontalScrollBar))) && (verticalScrollBar))) && (((newViewableWidth + verticalScrollBar.minWidth) >= newScrollableWidth)))) && (((newViewableHeight + horizontalScrollBar.minHeight) >= newScrollableHeight)))){
needVertical = false;
needHorizontal = needVertical;
} else {
if (((((((((needHorizontal) && (!(needVertical)))) && (verticalScrollBar))) && ((horizontalScrollPolicy == ScrollPolicy.AUTO)))) && (((newViewableWidth + verticalScrollBar.minWidth) >= newScrollableWidth)))){
needHorizontal = false;
};
};
var changed:Boolean = createOrDestroyScrollbars(needHorizontal, needVertical, needContentPane);
if (((((!((scrollableWidth == newScrollableWidth))) || (!((viewableWidth == newViewableWidth))))) || (changed))){
if (horizontalScrollBar){
horizontalScrollBar.setScrollProperties(newViewableWidth, 0, (newScrollableWidth - newViewableWidth), horizontalPageScrollSize);
scrollPositionChanged = true;
};
viewableWidth = newViewableWidth;
scrollableWidth = newScrollableWidth;
};
if (((((!((scrollableHeight == newScrollableHeight))) || (!((viewableHeight == newViewableHeight))))) || (changed))){
if (verticalScrollBar){
verticalScrollBar.setScrollProperties(newViewableHeight, 0, (newScrollableHeight - newViewableHeight), verticalPageScrollSize);
scrollPositionChanged = true;
};
viewableHeight = newViewableHeight;
scrollableHeight = newScrollableHeight;
};
return (changed);
}
override mx_internal function removingChild(child:DisplayObject):void{
super.removingChild(child);
child.dispatchEvent(new FlexEvent(FlexEvent.REMOVE));
var event:ChildExistenceChangedEvent = new ChildExistenceChangedEvent(ChildExistenceChangedEvent.CHILD_REMOVE);
event.relatedObject = child;
dispatchEvent(event);
}
mx_internal function get numChildrenCreated():int{
return (_numChildrenCreated);
}
mx_internal function rawChildren_addChildAt(child:DisplayObject, index:int):DisplayObject{
if ((((_firstChildIndex < index)) && ((index < ((_firstChildIndex + _numChildren) + 1))))){
_numChildren++;
} else {
if (index <= _firstChildIndex){
_firstChildIndex++;
};
};
super.addingChild(child);
$addChildAt(child, index);
super.childAdded(child);
dispatchEvent(new Event("childrenChanged"));
return (child);
}
private function hasChildMatchingDescriptor(descriptor:UIComponentDescriptor):Boolean{
var i:int;
var child:IUIComponent;
var id:String = descriptor.id;
if (((!((id == null))) && ((document[id] == null)))){
return (false);
};
var n:int = numChildren;
i = 0;
while (i < n) {
child = IUIComponent(getChildAt(i));
if ((((child is IDeferredInstantiationUIComponent)) && ((IDeferredInstantiationUIComponent(child).descriptor == descriptor)))){
return (true);
};
i++;
};
if (childRepeaters){
n = childRepeaters.length;
i = 0;
while (i < n) {
if (IDeferredInstantiationUIComponent(childRepeaters[i]).descriptor == descriptor){
return (true);
};
i++;
};
};
return (false);
}
mx_internal function rawChildren_getChildByName(name:String):DisplayObject{
return (super.getChildByName(name));
}
override public function validateDisplayList():void{
var vm:EdgeMetrics;
var w:Number;
var h:Number;
var bgColor:Object;
var blockerAlpha:Number;
var widthToBlock:Number;
var heightToBlock:Number;
if (((_autoLayout) || (forceLayout))){
doingLayout = true;
super.validateDisplayList();
doingLayout = false;
} else {
layoutChrome(unscaledWidth, unscaledHeight);
};
invalidateDisplayListFlag = true;
if (createContentPaneAndScrollbarsIfNeeded()){
if (((_autoLayout) || (forceLayout))){
doingLayout = true;
super.validateDisplayList();
doingLayout = false;
};
createContentPaneAndScrollbarsIfNeeded();
};
if (clampScrollPositions()){
scrollChildren();
};
if (contentPane){
vm = viewMetrics;
if (overlay){
overlay.x = 0;
overlay.y = 0;
overlay.width = unscaledWidth;
overlay.height = unscaledHeight;
};
if (((horizontalScrollBar) || (verticalScrollBar))){
if (((verticalScrollBar) && ((verticalScrollPolicy == ScrollPolicy.ON)))){
vm.right = (vm.right - verticalScrollBar.minWidth);
};
if (((horizontalScrollBar) && ((horizontalScrollPolicy == ScrollPolicy.ON)))){
vm.bottom = (vm.bottom - horizontalScrollBar.minHeight);
};
if (horizontalScrollBar){
w = ((unscaledWidth - vm.left) - vm.right);
if (verticalScrollBar){
w = (w - verticalScrollBar.minWidth);
};
horizontalScrollBar.setActualSize(w, horizontalScrollBar.minHeight);
horizontalScrollBar.move(vm.left, ((unscaledHeight - vm.bottom) - horizontalScrollBar.minHeight));
};
if (verticalScrollBar){
h = ((unscaledHeight - vm.top) - vm.bottom);
if (horizontalScrollBar){
h = (h - horizontalScrollBar.minHeight);
};
verticalScrollBar.setActualSize(verticalScrollBar.minWidth, h);
verticalScrollBar.move(((unscaledWidth - vm.right) - verticalScrollBar.minWidth), vm.top);
};
if (whiteBox){
whiteBox.x = verticalScrollBar.x;
whiteBox.y = horizontalScrollBar.y;
};
};
contentPane.x = vm.left;
contentPane.y = vm.top;
if (focusPane){
focusPane.x = vm.left;
focusPane.y = vm.top;
};
scrollChildren();
};
invalidateDisplayListFlag = false;
if (blocker){
vm = viewMetrics;
bgColor = (enabled) ? null : getStyle("backgroundDisabledColor");
if ((((bgColor === null)) || (isNaN(Number(bgColor))))){
bgColor = getStyle("backgroundColor");
};
if ((((bgColor === null)) || (isNaN(Number(bgColor))))){
bgColor = 0xFFFFFF;
};
blockerAlpha = getStyle("disabledOverlayAlpha");
if (isNaN(blockerAlpha)){
blockerAlpha = 0.6;
};
blocker.x = vm.left;
blocker.y = vm.top;
widthToBlock = (unscaledWidth - (vm.left + vm.right));
heightToBlock = (unscaledHeight - (vm.top + vm.bottom));
blocker.graphics.clear();
blocker.graphics.beginFill(uint(bgColor), blockerAlpha);
blocker.graphics.drawRect(0, 0, widthToBlock, heightToBlock);
blocker.graphics.endFill();
rawChildren.setChildIndex(blocker, (rawChildren.numChildren - 1));
};
}
public function set horizontalLineScrollSize(value:Number):void{
scrollPropertiesChanged = true;
_horizontalLineScrollSize = value;
invalidateDisplayList();
dispatchEvent(new Event("horizontalLineScrollSizeChanged"));
}
override public function initialize():void{
var props:*;
var message:String;
if (((((isDocument) && (documentDescriptor))) && (!(processedDescriptors)))){
props = documentDescriptor.properties;
if (((props) && (props.childDescriptors))){
if (_childDescriptors){
message = resourceManager.getString("core", "multipleChildSets_ClassAndInstance");
throw (new Error(message));
};
_childDescriptors = props.childDescriptors;
};
};
super.initialize();
}
mx_internal function set forceClipping(value:Boolean):void{
if (_clipContent){
if (value){
_forceClippingCount++;
} else {
_forceClippingCount--;
};
createContentPane();
scrollChildren();
};
}
public function removeAllChildren():void{
while (numChildren > 0) {
removeChildAt(0);
};
}
override public function contentToGlobal(point:Point):Point{
if (contentPane){
return (contentPane.localToGlobal(point));
};
return (localToGlobal(point));
}
public function get horizontalPageScrollSize():Number{
return (_horizontalPageScrollSize);
}
override mx_internal function childRemoved(child:DisplayObject):void{
super.childRemoved(child);
invalidateSize();
invalidateDisplayList();
if (!contentPane){
_numChildren--;
if (_numChildren == 0){
_firstChildIndex = super.numChildren;
};
};
if (((contentPane) && (!(autoLayout)))){
forceLayout = true;
UIComponentGlobals.layoutManager.addEventListener(FlexEvent.UPDATE_COMPLETE, layoutCompleteHandler, false, 0, true);
};
dispatchEvent(new Event("childrenChanged"));
}
public function set defaultButton(value:IFlexDisplayObject):void{
_defaultButton = value;
ContainerGlobals.focusedContainer = null;
}
public function get data():Object{
return (_data);
}
override public function get numChildren():int{
return ((contentPane) ? contentPane.numChildren : _numChildren);
}
public function get autoLayout():Boolean{
return (_autoLayout);
}
override public function styleChanged(styleProp:String):void{
var horizontalScrollBarStyleName:String;
var verticalScrollBarStyleName:String;
var allStyles:Boolean = (((styleProp == null)) || ((styleProp == "styleName")));
if (((allStyles) || (StyleManager.isSizeInvalidatingStyle(styleProp)))){
invalidateDisplayList();
};
if (((allStyles) || ((styleProp == "borderSkin")))){
if (border){
rawChildren.removeChild(DisplayObject(border));
border = null;
createBorder();
};
};
if (((((((((((allStyles) || ((styleProp == "borderStyle")))) || ((styleProp == "backgroundColor")))) || ((styleProp == "backgroundImage")))) || ((styleProp == "mouseShield")))) || ((styleProp == "mouseShieldChildren")))){
createBorder();
};
super.styleChanged(styleProp);
if (((allStyles) || (StyleManager.isSizeInvalidatingStyle(styleProp)))){
invalidateViewMetricsAndPadding();
};
if (((allStyles) || ((styleProp == "horizontalScrollBarStyleName")))){
if (((horizontalScrollBar) && ((horizontalScrollBar is ISimpleStyleClient)))){
horizontalScrollBarStyleName = getStyle("horizontalScrollBarStyleName");
ISimpleStyleClient(horizontalScrollBar).styleName = horizontalScrollBarStyleName;
};
};
if (((allStyles) || ((styleProp == "verticalScrollBarStyleName")))){
if (((verticalScrollBar) && ((verticalScrollBar is ISimpleStyleClient)))){
verticalScrollBarStyleName = getStyle("verticalScrollBarStyleName");
ISimpleStyleClient(verticalScrollBar).styleName = verticalScrollBarStyleName;
};
};
}
override protected function commitProperties():void{
var styleProp:String;
super.commitProperties();
if (changedStyles){
styleProp = ((changedStyles == MULTIPLE_PROPERTIES)) ? null : changedStyles;
super.notifyStyleChangeInChildren(styleProp, true);
changedStyles = null;
};
createOrDestroyBlocker();
}
override public function finishPrint(obj:Object, target:IFlexDisplayObject):void{
if (obj){
contentPane.scrollRect = Rectangle(obj);
};
super.finishPrint(obj, target);
}
public function get maxHorizontalScrollPosition():Number{
return ((horizontalScrollBar) ? horizontalScrollBar.maxScrollPosition : Math.max((scrollableWidth - viewableWidth), 0));
}
public function set creationPolicy(value:String):void{
_creationPolicy = value;
setActualCreationPolicies(value);
}
public function set label(value:String):void{
_label = value;
dispatchEvent(new Event("labelChanged"));
}
private function clampScrollPositions():Boolean{
var changed:Boolean;
if (_horizontalScrollPosition < 0){
_horizontalScrollPosition = 0;
changed = true;
} else {
if (_horizontalScrollPosition > maxHorizontalScrollPosition){
_horizontalScrollPosition = maxHorizontalScrollPosition;
changed = true;
};
};
if (((horizontalScrollBar) && (!((horizontalScrollBar.scrollPosition == _horizontalScrollPosition))))){
horizontalScrollBar.scrollPosition = _horizontalScrollPosition;
};
if (_verticalScrollPosition < 0){
_verticalScrollPosition = 0;
changed = true;
} else {
if (_verticalScrollPosition > maxVerticalScrollPosition){
_verticalScrollPosition = maxVerticalScrollPosition;
changed = true;
};
};
if (((verticalScrollBar) && (!((verticalScrollBar.scrollPosition == _verticalScrollPosition))))){
verticalScrollBar.scrollPosition = _verticalScrollPosition;
};
return (changed);
}
override public function prepareToPrint(target:IFlexDisplayObject):Object{
var rect:Rectangle = (((contentPane) && (contentPane.scrollRect))) ? contentPane.scrollRect : null;
if (rect){
contentPane.scrollRect = null;
};
super.prepareToPrint(target);
return (rect);
}
mx_internal function get firstChildIndex():int{
return (_firstChildIndex);
}
mx_internal function rawChildren_addChild(child:DisplayObject):DisplayObject{
if (_numChildren == 0){
_firstChildIndex++;
};
super.addingChild(child);
$addChild(child);
super.childAdded(child);
dispatchEvent(new Event("childrenChanged"));
return (child);
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
var backgroundColor:Object;
var backgroundAlpha:Number;
super.updateDisplayList(unscaledWidth, unscaledHeight);
layoutChrome(unscaledWidth, unscaledHeight);
if (scrollPositionChanged){
clampScrollPositions();
scrollChildren();
scrollPositionChanged = false;
};
if (scrollPropertiesChanged){
if (horizontalScrollBar){
horizontalScrollBar.lineScrollSize = horizontalLineScrollSize;
horizontalScrollBar.pageScrollSize = horizontalPageScrollSize;
};
if (verticalScrollBar){
verticalScrollBar.lineScrollSize = verticalLineScrollSize;
verticalScrollBar.pageScrollSize = verticalPageScrollSize;
};
scrollPropertiesChanged = false;
};
if (((contentPane) && (contentPane.scrollRect))){
backgroundColor = (enabled) ? null : getStyle("backgroundDisabledColor");
if ((((backgroundColor === null)) || (isNaN(Number(backgroundColor))))){
backgroundColor = getStyle("backgroundColor");
};
backgroundAlpha = getStyle("backgroundAlpha");
if (((((((!(_clipContent)) || (isNaN(Number(backgroundColor))))) || ((backgroundColor === "")))) || (((!(((horizontalScrollBar) || (verticalScrollBar)))) && (!(cacheAsBitmap)))))){
backgroundColor = null;
} else {
if (((getStyle("backgroundImage")) || (getStyle("background")))){
backgroundColor = null;
} else {
if (backgroundAlpha != 1){
backgroundColor = null;
};
};
};
contentPane.opaqueBackground = backgroundColor;
contentPane.cacheAsBitmap = !((backgroundColor == null));
};
}
override mx_internal function addingChild(child:DisplayObject):void{
var uiChild:IUIComponent = IUIComponent(child);
super.addingChild(child);
invalidateSize();
invalidateDisplayList();
if (!contentPane){
if (_numChildren == 0){
_firstChildIndex = super.numChildren;
};
_numChildren++;
};
if (((contentPane) && (!(autoLayout)))){
forceLayout = true;
UIComponentGlobals.layoutManager.addEventListener(FlexEvent.UPDATE_COMPLETE, layoutCompleteHandler, false, 0, true);
};
}
mx_internal function setActualCreationPolicies(policy:String):void{
var child:IFlexDisplayObject;
var childContainer:Container;
actualCreationPolicy = policy;
var childPolicy:String = policy;
if (policy == ContainerCreationPolicy.QUEUED){
childPolicy = ContainerCreationPolicy.AUTO;
};
var n:int = numChildren;
var i:int;
while (i < n) {
child = IFlexDisplayObject(getChildAt(i));
if ((child is Container)){
childContainer = Container(child);
if (childContainer.creationPolicy == null){
childContainer.setActualCreationPolicies(childPolicy);
};
};
i++;
};
}
}
}//package mx.core
Section 110
//ContainerCreationPolicy (mx.core.ContainerCreationPolicy)
package mx.core {
public final class ContainerCreationPolicy {
public static const ALL:String = "all";
public static const QUEUED:String = "queued";
public static const NONE:String = "none";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const AUTO:String = "auto";
public function ContainerCreationPolicy(){
super();
}
}
}//package mx.core
Section 111
//ContainerGlobals (mx.core.ContainerGlobals)
package mx.core {
import flash.display.*;
import mx.managers.*;
public class ContainerGlobals {
public static var focusedContainer:InteractiveObject;
public function ContainerGlobals(){
super();
}
public static function checkFocus(oldObj:InteractiveObject, newObj:InteractiveObject):void{
var fm:IFocusManager;
var defButton:IButton;
var objParent:InteractiveObject = newObj;
var currObj:InteractiveObject = newObj;
var lastUIComp:IUIComponent;
if (((!((newObj == null))) && ((oldObj == newObj)))){
return;
};
while (currObj) {
if (currObj.parent){
objParent = currObj.parent;
} else {
objParent = null;
};
if ((currObj is IUIComponent)){
lastUIComp = IUIComponent(currObj);
};
currObj = objParent;
if (((((currObj) && ((currObj is IContainer)))) && (IContainer(currObj).defaultButton))){
break;
};
};
if (((!((ContainerGlobals.focusedContainer == currObj))) || ((((ContainerGlobals.focusedContainer == null)) && ((currObj == null)))))){
if (!currObj){
currObj = InteractiveObject(lastUIComp);
};
if (((currObj) && ((currObj is IContainer)))){
fm = IContainer(currObj).focusManager;
if (!fm){
return;
};
defButton = (IContainer(currObj).defaultButton as IButton);
if (defButton){
ContainerGlobals.focusedContainer = InteractiveObject(currObj);
fm.defaultButton = (defButton as IButton);
} else {
ContainerGlobals.focusedContainer = InteractiveObject(currObj);
fm.defaultButton = null;
};
};
};
}
}
}//package mx.core
Section 112
//ContainerLayout (mx.core.ContainerLayout)
package mx.core {
public final class ContainerLayout {
public static const HORIZONTAL:String = "horizontal";
public static const VERTICAL:String = "vertical";
public static const ABSOLUTE:String = "absolute";
mx_internal static const VERSION:String = "3.2.0.3958";
public function ContainerLayout(){
super();
}
}
}//package mx.core
Section 113
//ContainerRawChildrenList (mx.core.ContainerRawChildrenList)
package mx.core {
import flash.display.*;
import flash.geom.*;
public class ContainerRawChildrenList implements IChildList {
private var owner:Container;
mx_internal static const VERSION:String = "3.2.0.3958";
public function ContainerRawChildrenList(owner:Container){
super();
this.owner = owner;
}
public function addChild(child:DisplayObject):DisplayObject{
return (owner.mx_internal::rawChildren_addChild(child));
}
public function getChildIndex(child:DisplayObject):int{
return (owner.mx_internal::rawChildren_getChildIndex(child));
}
public function setChildIndex(child:DisplayObject, newIndex:int):void{
var _local3 = owner;
_local3.mx_internal::rawChildren_setChildIndex(child, newIndex);
}
public function getChildByName(name:String):DisplayObject{
return (owner.mx_internal::rawChildren_getChildByName(name));
}
public function removeChildAt(index:int):DisplayObject{
return (owner.mx_internal::rawChildren_removeChildAt(index));
}
public function get numChildren():int{
return (owner.mx_internal::$numChildren);
}
public function addChildAt(child:DisplayObject, index:int):DisplayObject{
return (owner.mx_internal::rawChildren_addChildAt(child, index));
}
public function getObjectsUnderPoint(point:Point):Array{
return (owner.mx_internal::rawChildren_getObjectsUnderPoint(point));
}
public function contains(child:DisplayObject):Boolean{
return (owner.mx_internal::rawChildren_contains(child));
}
public function removeChild(child:DisplayObject):DisplayObject{
return (owner.mx_internal::rawChildren_removeChild(child));
}
public function getChildAt(index:int):DisplayObject{
return (owner.mx_internal::rawChildren_getChildAt(index));
}
}
}//package mx.core
Section 114
//DragSource (mx.core.DragSource)
package mx.core {
public class DragSource {
private var formatHandlers:Object;
private var dataHolder:Object;
private var _formats:Array;
mx_internal static const VERSION:String = "3.2.0.3958";
public function DragSource(){
dataHolder = {};
formatHandlers = {};
_formats = [];
super();
}
public function hasFormat(format:String):Boolean{
var n:int = _formats.length;
var i:int;
while (i < n) {
if (_formats[i] == format){
return (true);
};
i++;
};
return (false);
}
public function addData(data:Object, format:String):void{
_formats.push(format);
dataHolder[format] = data;
}
public function dataForFormat(format:String):Object{
var data:Object = dataHolder[format];
if (data){
return (data);
};
if (formatHandlers[format]){
return (formatHandlers[format]());
};
return (null);
}
public function addHandler(handler:Function, format:String):void{
_formats.push(format);
formatHandlers[format] = handler;
}
public function get formats():Array{
return (_formats);
}
}
}//package mx.core
Section 115
//EdgeMetrics (mx.core.EdgeMetrics)
package mx.core {
public class EdgeMetrics {
public var top:Number;
public var left:Number;
public var bottom:Number;
public var right:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
;
public function EdgeMetrics(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 116
//EmbeddedFont (mx.core.EmbeddedFont)
package mx.core {
public class EmbeddedFont {
private var _fontName:String;
private var _fontStyle:String;
mx_internal static const VERSION:String = "3.2.0.3958";
public function EmbeddedFont(fontName:String, bold:Boolean, italic:Boolean){
super();
_fontName = fontName;
_fontStyle = EmbeddedFontRegistry.getFontStyle(bold, italic);
}
public function get fontStyle():String{
return (_fontStyle);
}
public function get fontName():String{
return (_fontName);
}
}
}//package mx.core
Section 117
//EmbeddedFontRegistry (mx.core.EmbeddedFontRegistry)
package mx.core {
import flash.text.*;
import flash.utils.*;
public class EmbeddedFontRegistry implements IEmbeddedFontRegistry {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var fonts:Object = {};
private static var instance:IEmbeddedFontRegistry;
public function EmbeddedFontRegistry(){
super();
}
public function getAssociatedModuleFactory(font:EmbeddedFont, defaultModuleFactory:IFlexModuleFactory):IFlexModuleFactory{
var found:int;
var iter:Object;
var fontDictionary:Dictionary = fonts[createFontKey(font)];
if (fontDictionary){
found = fontDictionary[defaultModuleFactory];
if (found){
return (defaultModuleFactory);
};
for (iter in fontDictionary) {
return ((iter as IFlexModuleFactory));
};
};
return (null);
}
public function deregisterFont(font:EmbeddedFont, moduleFactory:IFlexModuleFactory):void{
var count:int;
var obj:Object;
var fontKey:String = createFontKey(font);
var fontDictionary:Dictionary = fonts[fontKey];
if (fontDictionary != null){
delete fontDictionary[moduleFactory];
count = 0;
for (obj in fontDictionary) {
count++;
};
if (count == 0){
delete fonts[fontKey];
};
};
}
public function getFonts():Array{
var key:String;
var fontArray:Array = [];
for (key in fonts) {
fontArray.push(createEmbeddedFont(key));
};
return (fontArray);
}
public function registerFont(font:EmbeddedFont, moduleFactory:IFlexModuleFactory):void{
var fontKey:String = createFontKey(font);
var fontDictionary:Dictionary = fonts[fontKey];
if (!fontDictionary){
fontDictionary = new Dictionary(true);
fonts[fontKey] = fontDictionary;
};
fontDictionary[moduleFactory] = 1;
}
public static function registerFonts(fonts:Object, moduleFactory:IFlexModuleFactory):void{
var f:Object;
var fontObj:Object;
var fieldIter:String;
var bold:Boolean;
var italic:Boolean;
var fontRegistry:IEmbeddedFontRegistry = IEmbeddedFontRegistry(Singleton.getInstance("mx.core::IEmbeddedFontRegistry"));
for (f in fonts) {
fontObj = fonts[f];
for (fieldIter in fontObj) {
if (fontObj[fieldIter] == false){
} else {
if (fieldIter == "regular"){
bold = false;
italic = false;
} else {
if (fieldIter == "boldItalic"){
bold = true;
italic = true;
} else {
if (fieldIter == "bold"){
bold = true;
italic = false;
} else {
if (fieldIter == "italic"){
bold = false;
italic = true;
};
};
};
};
fontRegistry.registerFont(new EmbeddedFont(String(f), bold, italic), moduleFactory);
};
};
};
}
public static function getInstance():IEmbeddedFontRegistry{
if (!instance){
instance = new (EmbeddedFontRegistry);
};
return (instance);
}
public static function getFontStyle(bold:Boolean, italic:Boolean):String{
var style:String = FontStyle.REGULAR;
if (((bold) && (italic))){
style = FontStyle.BOLD_ITALIC;
} else {
if (bold){
style = FontStyle.BOLD;
} else {
if (italic){
style = FontStyle.ITALIC;
};
};
};
return (style);
}
private static function createFontKey(font:EmbeddedFont):String{
return ((font.fontName + font.fontStyle));
}
private static function createEmbeddedFont(key:String):EmbeddedFont{
var fontName:String;
var fontBold:Boolean;
var fontItalic:Boolean;
var index:int = endsWith(key, FontStyle.REGULAR);
if (index > 0){
fontName = key.substring(0, index);
return (new EmbeddedFont(fontName, false, false));
};
index = endsWith(key, FontStyle.BOLD);
if (index > 0){
fontName = key.substring(0, index);
return (new EmbeddedFont(fontName, true, false));
};
index = endsWith(key, FontStyle.BOLD_ITALIC);
if (index > 0){
fontName = key.substring(0, index);
return (new EmbeddedFont(fontName, true, true));
};
index = endsWith(key, FontStyle.ITALIC);
if (index > 0){
fontName = key.substring(0, index);
return (new EmbeddedFont(fontName, false, true));
};
return (new EmbeddedFont("", false, false));
}
private static function endsWith(s:String, match:String):int{
var index:int = s.lastIndexOf(match);
if ((((index > 0)) && (((index + match.length) == s.length)))){
return (index);
};
return (-1);
}
}
}//package mx.core
Section 118
//EventPriority (mx.core.EventPriority)
package mx.core {
public final class EventPriority {
public static const DEFAULT:int = 0;
public static const BINDING:int = 100;
public static const DEFAULT_HANDLER:int = -50;
public static const EFFECT:int = -100;
public static const CURSOR_MANAGEMENT:int = 200;
mx_internal static const VERSION:String = "3.2.0.3958";
public function EventPriority(){
super();
}
}
}//package mx.core
Section 119
//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.2.0.3958";
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 120
//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.2.0.3958";
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 121
//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.2.0.3958";
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 122
//FlexSprite (mx.core.FlexSprite)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexSprite extends Sprite {
mx_internal static const VERSION:String = "3.2.0.3958";
public function FlexSprite(){
super();
name = NameUtil.createUniqueName(this);
//unresolved jump
var _slot1 = e;
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 123
//FlexTextField (mx.core.FlexTextField)
package mx.core {
import flash.text.*;
import mx.utils.*;
public class FlexTextField extends TextField {
mx_internal static const VERSION:String = "3.2.0.3958";
public function FlexTextField(){
super();
name = NameUtil.createUniqueName(this);
//unresolved jump
var _slot1 = e;
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 124
//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.2.0.3958";
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 125
//FontAsset (mx.core.FontAsset)
package mx.core {
import flash.text.*;
public class FontAsset extends Font implements IFlexAsset {
mx_internal static const VERSION:String = "3.2.0.3958";
public function FontAsset(){
super();
}
}
}//package mx.core
Section 126
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 127
//IButton (mx.core.IButton)
package mx.core {
public interface IButton extends IUIComponent {
function get emphasized():Boolean;
function set emphasized(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IButton.as:Boolean):void;
function callLater(_arg1:Function, _arg2:Array=null):void;
}
}//package mx.core
Section 128
//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.2.0\frameworks\projects\framework\src;mx\core;IChildList.as:DisplayObject):DisplayObject;
function getChildByName(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IChildList.as:String):DisplayObject;
function removeChildAt(C:\autobuild\3.2.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.2.0\frameworks\projects\framework\src;mx\core;IChildList.as:int):DisplayObject;
function addChild(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IChildList.as:DisplayObject):DisplayObject;
function contains(flash.display:DisplayObject):Boolean;
}
}//package mx.core
Section 129
//IConstraintClient (mx.core.IConstraintClient)
package mx.core {
public interface IConstraintClient {
function setConstraintValue(_arg1:String, _arg2):void;
function getConstraintValue(*:String);
}
}//package mx.core
Section 130
//IContainer (mx.core.IContainer)
package mx.core {
import flash.display.*;
import flash.geom.*;
import mx.managers.*;
import flash.text.*;
import flash.media.*;
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.2.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.2.0\frameworks\projects\framework\src;mx\core;ISpriteInterface.as:Point):Boolean;
}
}//package mx.core
Section 131
//IDataRenderer (mx.core.IDataRenderer)
package mx.core {
public interface IDataRenderer {
function get data():Object;
function set data(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IDataRenderer.as:Object):void;
}
}//package mx.core
Section 132
//IDeferredInstantiationUIComponent (mx.core.IDeferredInstantiationUIComponent)
package mx.core {
public interface IDeferredInstantiationUIComponent extends IUIComponent {
function set cacheHeuristic(:Boolean):void;
function createReferenceOnParentDocument(:IFlexDisplayObject):void;
function get cachePolicy():String;
function set id(:String):void;
function registerEffects(:Array):void;
function executeBindings(:Boolean=false):void;
function get id():String;
function deleteReferenceOnParentDocument(:IFlexDisplayObject):void;
function set descriptor(:UIComponentDescriptor):void;
function get descriptor():UIComponentDescriptor;
}
}//package mx.core
Section 133
//IEmbeddedFontRegistry (mx.core.IEmbeddedFontRegistry)
package mx.core {
public interface IEmbeddedFontRegistry {
function getAssociatedModuleFactory(_arg1:EmbeddedFont, _arg2:IFlexModuleFactory):IFlexModuleFactory;
function registerFont(_arg1:EmbeddedFont, _arg2:IFlexModuleFactory):void;
function deregisterFont(_arg1:EmbeddedFont, _arg2:IFlexModuleFactory):void;
function getFonts():Array;
}
}//package mx.core
Section 134
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 135
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
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 136
//IFlexModule (mx.core.IFlexModule)
package mx.core {
public interface IFlexModule {
function set moduleFactory(:IFlexModuleFactory):void;
function get moduleFactory():IFlexModuleFactory;
}
}//package mx.core
Section 137
//IFlexModuleFactory (mx.core.IFlexModuleFactory)
package mx.core {
public interface IFlexModuleFactory {
function create(... _args):Object;
function info():Object;
}
}//package mx.core
Section 138
//IFontContextComponent (mx.core.IFontContextComponent)
package mx.core {
public interface IFontContextComponent {
function get fontContext():IFlexModuleFactory;
function set fontContext(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IFontContextComponent.as:IFlexModuleFactory):void;
}
}//package mx.core
Section 139
//IIMESupport (mx.core.IIMESupport)
package mx.core {
public interface IIMESupport {
function set imeMode(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IIMESupport.as:String):void;
function get imeMode():String;
}
}//package mx.core
Section 140
//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 141
//IMXMLObject (mx.core.IMXMLObject)
package mx.core {
public interface IMXMLObject {
function initialized(_arg1:Object, _arg2:String):void;
}
}//package mx.core
Section 142
//IProgrammaticSkin (mx.core.IProgrammaticSkin)
package mx.core {
public interface IProgrammaticSkin {
function validateNow():void;
function validateDisplayList():void;
}
}//package mx.core
Section 143
//IPropertyChangeNotifier (mx.core.IPropertyChangeNotifier)
package mx.core {
import flash.events.*;
public interface IPropertyChangeNotifier extends IEventDispatcher, IUID {
}
}//package mx.core
Section 144
//IRawChildrenContainer (mx.core.IRawChildrenContainer)
package mx.core {
public interface IRawChildrenContainer {
function get rawChildren():IChildList;
}
}//package mx.core
Section 145
//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.2.0\frameworks\projects\framework\src;mx\core;IRectangularBorder.as:Rectangle):void;
function layoutBackgroundImage():void;
}
}//package mx.core
Section 146
//IRepeater (mx.core.IRepeater)
package mx.core {
public interface IRepeater {
function get container():IContainer;
function set startingIndex(mx.core:IRepeater/mx.core:IRepeater:container/get:int):void;
function get startingIndex():int;
function set recycleChildren(mx.core:IRepeater/mx.core:IRepeater:container/get:Boolean):void;
function get currentItem():Object;
function get count():int;
function get recycleChildren():Boolean;
function executeChildBindings():void;
function set dataProvider(mx.core:IRepeater/mx.core:IRepeater:container/get:Object):void;
function initializeRepeater(_arg1:IContainer, _arg2:Boolean):void;
function get currentIndex():int;
function get dataProvider():Object;
function set count(mx.core:IRepeater/mx.core:IRepeater:container/get:int):void;
}
}//package mx.core
Section 147
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function get instanceIndices():Array;
function set instanceIndices(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void;
function get isDocument():Boolean;
function set repeaters(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void;
function initializeRepeaterArrays(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:IRepeaterClient):void;
function get repeaters():Array;
function set repeaterIndices(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 148
//IStateClient (mx.core.IStateClient)
package mx.core {
public interface IStateClient {
function get currentState():String;
function set currentState(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IStateClient.as:String):void;
}
}//package mx.core
Section 149
//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.2.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.2.0\frameworks\projects\framework\src;mx\core;ISWFBridgeGroup.as:IEventDispatcher):void;
function containsBridge(IEventDispatcher:IEventDispatcher):Boolean;
function getChildBridges():Array;
}
}//package mx.core
Section 150
//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 151
//ISWFLoader (mx.core.ISWFLoader)
package mx.core {
import flash.geom.*;
public interface ISWFLoader extends ISWFBridgeProvider {
function getVisibleApplicationRect(mx.core:ISWFLoader/mx.core:ISWFLoader:loadForCompatibility/get:Boolean=false):Rectangle;
function set loadForCompatibility(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ISWFLoader.as:Boolean):void;
function get loadForCompatibility():Boolean;
}
}//package mx.core
Section 152
//ITextFieldFactory (mx.core.ITextFieldFactory)
package mx.core {
import flash.text.*;
public interface ITextFieldFactory {
function createTextField(:IFlexModuleFactory):TextField;
}
}//package mx.core
Section 153
//IToolTip (mx.core.IToolTip)
package mx.core {
import flash.geom.*;
public interface IToolTip extends IUIComponent {
function set text(mx.core:IToolTip/mx.core:IToolTip:screen/get:String):void;
function get screen():Rectangle;
function get text():String;
}
}//package mx.core
Section 154
//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 155
//IUID (mx.core.IUID)
package mx.core {
public interface IUID {
function get uid():String;
function set uid(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;IUID.as:String):void;
}
}//package mx.core
Section 156
//IUITextField (mx.core.IUITextField)
package mx.core {
import flash.display.*;
import flash.geom.*;
import mx.managers.*;
import flash.text.*;
import mx.styles.*;
public interface IUITextField extends IIMESupport, IFlexModule, IInvalidating, ISimpleStyleClient, IToolTipManagerClient, IUIComponent {
function replaceText(_arg1:int, _arg2:int, _arg3:String):void;
function get doubleClickEnabled():Boolean;
function get nestLevel():int;
function get caretIndex():int;
function set doubleClickEnabled(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function get maxScrollH():int;
function set nestLevel(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:int):void;
function get numLines():int;
function get scrollH():int;
function setColor(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:uint):void;
function get maxScrollV():int;
function getImageReference(mx.core:IUITextField/mx.core:IUITextField:antiAliasType/set:String):DisplayObject;
function get scrollV():int;
function get border():Boolean;
function get text():String;
function get styleSheet():StyleSheet;
function getCharBoundaries(String:int):Rectangle;
function get background():Boolean;
function set scrollH(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:int):void;
function getFirstCharInParagraph(value:int):int;
function get type():String;
function replaceSelectedText(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function set borderColor(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:uint):void;
function get alwaysShowSelection():Boolean;
function get sharpness():Number;
function get tabIndex():int;
function get textColor():uint;
function set defaultTextFormat(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:TextFormat):void;
function get condenseWhite():Boolean;
function get displayAsPassword():Boolean;
function get autoSize():String;
function setSelection(_arg1:int, _arg2:int):void;
function set scrollV(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:int):void;
function set useRichTextClipboard(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function get selectionBeginIndex():int;
function get selectable():Boolean;
function set border(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function set multiline(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function set background(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function set embedFonts(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function set text(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function get selectionEndIndex():int;
function set mouseWheelEnabled(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function appendText(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function get antiAliasType():String;
function set styleSheet(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:StyleSheet):void;
function set nonInheritingStyles(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Object):void;
function set textColor(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:uint):void;
function get wordWrap():Boolean;
function getLineIndexAtPoint(_arg1:Number, _arg2:Number):int;
function get htmlText():String;
function set tabIndex(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:int):void;
function get thickness():Number;
function getLineIndexOfChar(value:int):int;
function get bottomScrollV():int;
function set restrict(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function set alwaysShowSelection(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function getTextFormat(_arg1:int=-1, _arg2:int=-1):TextFormat;
function set sharpness(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Number):void;
function set type(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function setTextFormat(_arg1:TextFormat, _arg2:int=-1, _arg3:int=-1):void;
function set gridFitType(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function getUITextFormat():UITextFormat;
function set inheritingStyles(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Object):void;
function setFocus():void;
function get borderColor():uint;
function set condenseWhite(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function get textWidth():Number;
function getLineOffset(value:int):int;
function set displayAsPassword(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function set autoSize(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function get defaultTextFormat():TextFormat;
function get useRichTextClipboard():Boolean;
function get nonZeroTextHeight():Number;
function set backgroundColor(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:uint):void;
function get embedFonts():Boolean;
function set selectable(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function get multiline():Boolean;
function set maxChars(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:int):void;
function get textHeight():Number;
function get nonInheritingStyles():Object;
function getLineText(mx.core:IUITextField/mx.core:IUITextField:alwaysShowSelection/get:int):String;
function set focusRect(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Object):void;
function get mouseWheelEnabled():Boolean;
function get restrict():String;
function getParagraphLength(value:int):int;
function set mouseEnabled(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function get gridFitType():String;
function get inheritingStyles():Object;
function set ignorePadding(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function set antiAliasType(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function get backgroundColor():uint;
function getCharIndexAtPoint(_arg1:Number, _arg2:Number):int;
function set tabEnabled(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function get maxChars():int;
function get focusRect():Object;
function get ignorePadding():Boolean;
function get mouseEnabled():Boolean;
function get length():int;
function set wordWrap(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function get tabEnabled():Boolean;
function set thickness(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Number):void;
function getLineLength(value:int):int;
function truncateToFit(:String=null):Boolean;
function set htmlText(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function getLineMetrics(antiAliasType:int):TextLineMetrics;
function getStyle(*:String);
}
}//package mx.core
Section 157
//LayoutContainer (mx.core.LayoutContainer)
package mx.core {
import flash.events.*;
import mx.containers.utilityClasses.*;
import mx.containers.*;
public class LayoutContainer extends Container implements IConstraintLayout {
private var _constraintColumns:Array;
protected var layoutObject:Layout;
private var _layout:String;// = "vertical"
private var processingCreationQueue:Boolean;// = false
protected var boxLayoutClass:Class;
private var resizeHandlerAdded:Boolean;// = false
private var preloadObj:Object;
private var creationQueue:Array;
private var _constraintRows:Array;
protected var canvasLayoutClass:Class;
mx_internal static const VERSION:String = "3.2.0.3958";
mx_internal static var useProgressiveLayout:Boolean = false;
public function LayoutContainer(){
layoutObject = new BoxLayout();
canvasLayoutClass = CanvasLayout;
boxLayoutClass = BoxLayout;
creationQueue = [];
_constraintColumns = [];
_constraintRows = [];
super();
layoutObject.target = this;
}
public function get constraintColumns():Array{
return (_constraintColumns);
}
override mx_internal function get usePadding():Boolean{
return (!((layout == ContainerLayout.ABSOLUTE)));
}
override protected function layoutChrome(unscaledWidth:Number, unscaledHeight:Number):void{
super.layoutChrome(unscaledWidth, unscaledHeight);
if (!doingLayout){
createBorder();
};
}
public function set constraintColumns(value:Array):void{
var n:int;
var i:int;
if (value != _constraintColumns){
n = value.length;
i = 0;
while (i < n) {
ConstraintColumn(value[i]).container = this;
i++;
};
_constraintColumns = value;
invalidateSize();
invalidateDisplayList();
};
}
public function set layout(value:String):void{
if (_layout != value){
_layout = value;
if (layoutObject){
layoutObject.target = null;
};
if (_layout == ContainerLayout.ABSOLUTE){
layoutObject = new canvasLayoutClass();
} else {
layoutObject = new boxLayoutClass();
if (_layout == ContainerLayout.VERTICAL){
BoxLayout(layoutObject).direction = BoxDirection.VERTICAL;
} else {
BoxLayout(layoutObject).direction = BoxDirection.HORIZONTAL;
};
};
if (layoutObject){
layoutObject.target = this;
};
invalidateSize();
invalidateDisplayList();
dispatchEvent(new Event("layoutChanged"));
};
}
public function get constraintRows():Array{
return (_constraintRows);
}
override protected function measure():void{
super.measure();
layoutObject.measure();
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
super.updateDisplayList(unscaledWidth, unscaledHeight);
layoutObject.updateDisplayList(unscaledWidth, unscaledHeight);
createBorder();
}
public function get layout():String{
return (_layout);
}
public function set constraintRows(value:Array):void{
var n:int;
var i:int;
if (value != _constraintRows){
n = value.length;
i = 0;
while (i < n) {
ConstraintRow(value[i]).container = this;
i++;
};
_constraintRows = value;
invalidateSize();
invalidateDisplayList();
};
}
}
}//package mx.core
Section 158
//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 159
//ResourceModuleRSLItem (mx.core.ResourceModuleRSLItem)
package mx.core {
import flash.events.*;
import mx.events.*;
import mx.resources.*;
public class ResourceModuleRSLItem extends RSLItem {
mx_internal static const VERSION:String = "3.2.0.3958";
public function ResourceModuleRSLItem(url:String){
super(url);
}
private function resourceErrorHandler(event:ResourceEvent):void{
var errorEvent:IOErrorEvent = new IOErrorEvent(IOErrorEvent.IO_ERROR);
errorEvent.text = event.errorText;
super.itemErrorHandler(errorEvent);
}
override public function load(progressHandler:Function, completeHandler:Function, ioErrorHandler:Function, securityErrorHandler:Function, rslErrorHandler:Function):void{
chainedProgressHandler = progressHandler;
chainedCompleteHandler = completeHandler;
chainedIOErrorHandler = ioErrorHandler;
chainedSecurityErrorHandler = securityErrorHandler;
chainedRSLErrorHandler = rslErrorHandler;
var resourceManager:IResourceManager = ResourceManager.getInstance();
var eventDispatcher:IEventDispatcher = resourceManager.loadResourceModule(url);
eventDispatcher.addEventListener(ResourceEvent.PROGRESS, itemProgressHandler);
eventDispatcher.addEventListener(ResourceEvent.COMPLETE, itemCompleteHandler);
eventDispatcher.addEventListener(ResourceEvent.ERROR, resourceErrorHandler);
}
}
}//package mx.core
Section 160
//RSLItem (mx.core.RSLItem)
package mx.core {
import flash.display.*;
import flash.events.*;
import mx.events.*;
import flash.system.*;
import flash.net.*;
import mx.utils.*;
public class RSLItem {
protected var chainedSecurityErrorHandler:Function;
public var total:uint;// = 0
public var loaded:uint;// = 0
private var completed:Boolean;// = false
protected var chainedRSLErrorHandler:Function;
protected var chainedIOErrorHandler:Function;
protected var chainedCompleteHandler:Function;
private var errorText:String;
protected var chainedProgressHandler:Function;
public var urlRequest:URLRequest;
public var rootURL:String;
protected var url:String;
mx_internal static const VERSION:String = "3.2.0.3958";
public function RSLItem(url:String, rootURL:String=null){
super();
this.url = url;
this.rootURL = rootURL;
}
public function itemProgressHandler(event:ProgressEvent):void{
loaded = event.bytesLoaded;
total = event.bytesTotal;
if (chainedProgressHandler != null){
chainedProgressHandler(event);
};
}
public function itemErrorHandler(event:ErrorEvent):void{
errorText = decodeURI(event.text);
completed = true;
loaded = 0;
total = 0;
trace(errorText);
if ((((event.type == IOErrorEvent.IO_ERROR)) && (!((chainedIOErrorHandler == null))))){
chainedIOErrorHandler(event);
} else {
if ((((event.type == SecurityErrorEvent.SECURITY_ERROR)) && (!((chainedSecurityErrorHandler == null))))){
chainedSecurityErrorHandler(event);
} else {
if ((((event.type == RSLEvent.RSL_ERROR)) && (!((chainedRSLErrorHandler == null))))){
chainedRSLErrorHandler(event);
};
};
};
}
public function load(progressHandler:Function, completeHandler:Function, ioErrorHandler:Function, securityErrorHandler:Function, rslErrorHandler:Function):void{
chainedProgressHandler = progressHandler;
chainedCompleteHandler = completeHandler;
chainedIOErrorHandler = ioErrorHandler;
chainedSecurityErrorHandler = securityErrorHandler;
chainedRSLErrorHandler = rslErrorHandler;
var loader:Loader = new Loader();
var loaderContext:LoaderContext = new LoaderContext();
urlRequest = new URLRequest(LoaderUtil.createAbsoluteURL(rootURL, url));
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, itemProgressHandler);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, itemCompleteHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, itemErrorHandler);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, itemErrorHandler);
loaderContext.applicationDomain = ApplicationDomain.currentDomain;
loader.load(urlRequest, loaderContext);
}
public function itemCompleteHandler(event:Event):void{
completed = true;
if (chainedCompleteHandler != null){
chainedCompleteHandler(event);
};
}
}
}//package mx.core
Section 161
//RSLListLoader (mx.core.RSLListLoader)
package mx.core {
import flash.events.*;
public class RSLListLoader {
private var chainedSecurityErrorHandler:Function;
private var chainedIOErrorHandler:Function;
private var rslList:Array;
private var chainedRSLErrorHandler:Function;
private var chainedCompleteHandler:Function;
private var currentIndex:int;// = 0
private var chainedProgressHandler:Function;
mx_internal static const VERSION:String = "3.2.0.3958";
public function RSLListLoader(rslList:Array){
rslList = [];
super();
this.rslList = rslList;
}
private function loadNext():void{
if (!isDone()){
currentIndex++;
if (currentIndex < rslList.length){
rslList[currentIndex].load(chainedProgressHandler, listCompleteHandler, listIOErrorHandler, listSecurityErrorHandler, chainedRSLErrorHandler);
};
};
}
public function getIndex():int{
return (currentIndex);
}
public function load(progressHandler:Function, completeHandler:Function, ioErrorHandler:Function, securityErrorHandler:Function, rslErrorHandler:Function):void{
chainedProgressHandler = progressHandler;
chainedCompleteHandler = completeHandler;
chainedIOErrorHandler = ioErrorHandler;
chainedSecurityErrorHandler = securityErrorHandler;
chainedRSLErrorHandler = rslErrorHandler;
currentIndex = -1;
loadNext();
}
private function listCompleteHandler(event:Event):void{
if (chainedCompleteHandler != null){
chainedCompleteHandler(event);
};
loadNext();
}
public function isDone():Boolean{
return ((currentIndex >= rslList.length));
}
private function listSecurityErrorHandler(event:Event):void{
if (chainedSecurityErrorHandler != null){
chainedSecurityErrorHandler(event);
};
}
public function getItemCount():int{
return (rslList.length);
}
public function getItem(index:int):RSLItem{
if ((((index < 0)) || ((index >= rslList.length)))){
return (null);
};
return (rslList[index]);
}
private function listIOErrorHandler(event:Event):void{
if (chainedIOErrorHandler != null){
chainedIOErrorHandler(event);
};
}
}
}//package mx.core
Section 162
//ScrollPolicy (mx.core.ScrollPolicy)
package mx.core {
public final class ScrollPolicy {
public static const AUTO:String = "auto";
public static const ON:String = "on";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const OFF:String = "off";
public function ScrollPolicy(){
super();
}
}
}//package mx.core
Section 163
//Singleton (mx.core.Singleton)
package mx.core {
public class Singleton {
mx_internal static const VERSION:String = "3.2.0.3958";
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 164
//SoundAsset (mx.core.SoundAsset)
package mx.core {
import flash.media.*;
public class SoundAsset extends Sound implements IFlexAsset {
mx_internal static const VERSION:String = "3.2.0.3958";
public function SoundAsset(){
super();
}
}
}//package mx.core
Section 165
//SpriteAsset (mx.core.SpriteAsset)
package mx.core {
public class SpriteAsset extends FlexSprite implements IFlexAsset, IFlexDisplayObject, IBorder {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
public function SpriteAsset(){
super();
_measuredWidth = width;
_measuredHeight = height;
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
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;
}
public function get borderMetrics():EdgeMetrics{
if (scale9Grid == null){
return (EdgeMetrics.EMPTY);
};
return (new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil((measuredWidth - scale9Grid.right)), Math.ceil((measuredHeight - scale9Grid.bottom))));
}
}
}//package mx.core
Section 166
//SWFBridgeGroup (mx.core.SWFBridgeGroup)
package mx.core {
import mx.managers.*;
import flash.events.*;
import flash.utils.*;
public class SWFBridgeGroup implements ISWFBridgeGroup {
private var _parentBridge:IEventDispatcher;
private var _childBridges:Dictionary;
private var _groupOwner:ISystemManager;
mx_internal static const VERSION:String = "3.2.0.3958";
public function SWFBridgeGroup(owner:ISystemManager){
super();
_groupOwner = owner;
}
public function getChildBridgeProvider(bridge:IEventDispatcher):ISWFBridgeProvider{
if (!_childBridges){
return (null);
};
return (ISWFBridgeProvider(_childBridges[bridge]));
}
public function removeChildBridge(bridge:IEventDispatcher):void{
var iter:Object;
if (((!(_childBridges)) || (!(bridge)))){
return;
};
for (iter in _childBridges) {
if (iter == bridge){
delete _childBridges[iter];
};
};
}
public function get parentBridge():IEventDispatcher{
return (_parentBridge);
}
public function containsBridge(bridge:IEventDispatcher):Boolean{
var iter:Object;
if (((parentBridge) && ((parentBridge == bridge)))){
return (true);
};
for (iter in _childBridges) {
if (bridge == iter){
return (true);
};
};
return (false);
}
public function set parentBridge(bridge:IEventDispatcher):void{
_parentBridge = bridge;
}
public function addChildBridge(bridge:IEventDispatcher, bridgeProvider:ISWFBridgeProvider):void{
if (!_childBridges){
_childBridges = new Dictionary();
};
_childBridges[bridge] = bridgeProvider;
}
public function getChildBridges():Array{
var iter:Object;
var bridges:Array = [];
for (iter in _childBridges) {
bridges.push(iter);
};
return (bridges);
}
}
}//package mx.core
Section 167
//TextFieldFactory (mx.core.TextFieldFactory)
package mx.core {
import flash.text.*;
import flash.utils.*;
public class TextFieldFactory implements ITextFieldFactory {
private var textFields:Dictionary;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var instance:ITextFieldFactory;
public function TextFieldFactory(){
textFields = new Dictionary(true);
super();
}
public function createTextField(moduleFactory:IFlexModuleFactory):TextField{
var iter:Object;
var textField:TextField;
var textFieldDictionary:Dictionary = textFields[moduleFactory];
if (textFieldDictionary){
for (iter in textFieldDictionary) {
textField = TextField(iter);
break;
};
};
if (!textField){
if (moduleFactory){
textField = TextField(moduleFactory.create("flash.text.TextField"));
} else {
textField = new TextField();
};
if (!textFieldDictionary){
textFieldDictionary = new Dictionary(true);
};
textFieldDictionary[textField] = 1;
textFields[moduleFactory] = textFieldDictionary;
};
return (textField);
}
public static function getInstance():ITextFieldFactory{
if (!instance){
instance = new (TextFieldFactory);
};
return (instance);
}
}
}//package mx.core
Section 168
//UIComponent (mx.core.UIComponent)
package mx.core {
import flash.display.*;
import flash.geom.*;
import mx.managers.*;
import flash.text.*;
import flash.events.*;
import mx.events.*;
import mx.styles.*;
import mx.resources.*;
import flash.system.*;
import mx.graphics.*;
import mx.modules.*;
import mx.automation.*;
import mx.controls.*;
import mx.states.*;
import mx.effects.*;
import flash.utils.*;
import mx.binding.*;
import mx.utils.*;
import mx.validators.*;
public class UIComponent extends FlexSprite implements IAutomationObject, IChildList, IDeferredInstantiationUIComponent, IFlexDisplayObject, IFlexModule, IInvalidating, ILayoutManagerClient, IPropertyChangeNotifier, IRepeaterClient, ISimpleStyleClient, IStyleClient, IToolTipManagerClient, IUIComponent, IValidatorListener, IStateClient, IConstraintClient {
private var cachedEmbeddedFont:EmbeddedFont;// = null
private var errorStringChanged:Boolean;// = false
mx_internal var overlay:UIComponent;
mx_internal var automaticRadioButtonGroups:Object;
private var _currentState:String;
private var _isPopUp:Boolean;
private var _repeaters:Array;
private var _systemManager:ISystemManager;
private var _measuredWidth:Number;// = 0
private var methodQueue:Array;
mx_internal var _width:Number;
private var _tweeningProperties:Array;
private var _validationSubField:String;
private var _endingEffectInstances:Array;
mx_internal var saveBorderColor:Boolean;// = true
mx_internal var overlayColor:uint;
mx_internal var overlayReferenceCount:int;// = 0
private var hasFontContextBeenSaved:Boolean;// = false
private var _repeaterIndices:Array;
private var oldExplicitWidth:Number;
mx_internal var _descriptor:UIComponentDescriptor;
private var _initialized:Boolean;// = false
private var _focusEnabled:Boolean;// = true
private var cacheAsBitmapCount:int;// = 0
private var requestedCurrentState:String;
private var listeningForRender:Boolean;// = false
mx_internal var invalidateDisplayListFlag:Boolean;// = false
private var oldScaleX:Number;// = 1
private var oldScaleY:Number;// = 1
mx_internal var _explicitMaxHeight:Number;
mx_internal var invalidatePropertiesFlag:Boolean;// = false
private var hasFocusRect:Boolean;// = false
mx_internal var invalidateSizeFlag:Boolean;// = false
private var _scaleX:Number;// = 1
private var _scaleY:Number;// = 1
private var _styleDeclaration:CSSStyleDeclaration;
private var _resourceManager:IResourceManager;
mx_internal var _affectedProperties:Object;
mx_internal var _documentDescriptor:UIComponentDescriptor;
private var _processedDescriptors:Boolean;// = false
mx_internal var origBorderColor:Number;
private var _focusManager:IFocusManager;
private var _cachePolicy:String;// = "auto"
private var _measuredHeight:Number;// = 0
private var _id:String;
private var _owner:DisplayObjectContainer;
public var transitions:Array;
mx_internal var _parent:DisplayObjectContainer;
private var _measuredMinWidth:Number;// = 0
private var oldMinWidth:Number;
private var _explicitWidth:Number;
private var _enabled:Boolean;// = false
public var states:Array;
private var _mouseFocusEnabled:Boolean;// = true
private var oldHeight:Number;// = 0
private var _currentStateChanged:Boolean;
private var cachedTextFormat:UITextFormat;
mx_internal var _height:Number;
private var _automationDelegate:IAutomationObject;
private var _percentWidth:Number;
private var _automationName:String;// = null
private var _isEffectStarted:Boolean;// = false
private var _styleName:Object;
private var lastUnscaledWidth:Number;
mx_internal var _document:Object;
mx_internal var _errorString:String;// = ""
private var oldExplicitHeight:Number;
private var _nestLevel:int;// = 0
private var _systemManagerDirty:Boolean;// = false
private var _explicitHeight:Number;
mx_internal var _toolTip:String;
private var _filters:Array;
private var _focusPane:Sprite;
private var playStateTransition:Boolean;// = true
private var _nonInheritingStyles:Object;
private var _showInAutomationHierarchy:Boolean;// = true
private var _moduleFactory:IFlexModuleFactory;
private var preventDrawFocus:Boolean;// = false
private var oldX:Number;// = 0
private var oldY:Number;// = 0
private var _instanceIndices:Array;
private var _visible:Boolean;// = true
private var _inheritingStyles:Object;
private var _includeInLayout:Boolean;// = true
mx_internal var _effectsStarted:Array;
mx_internal var _explicitMinWidth:Number;
private var lastUnscaledHeight:Number;
mx_internal var _explicitMaxWidth:Number;
private var _measuredMinHeight:Number;// = 0
private var _uid:String;
private var _currentTransitionEffect:IEffect;
private var _updateCompletePendingFlag:Boolean;// = false
private var oldMinHeight:Number;
private var _flexContextMenu:IFlexContextMenu;
mx_internal var _explicitMinHeight:Number;
private var _percentHeight:Number;
private var oldEmbeddedFontContext:IFlexModuleFactory;// = null
private var oldWidth:Number;// = 0
public static const DEFAULT_MEASURED_WIDTH:Number = 160;
public static const DEFAULT_MAX_WIDTH:Number = 10000;
public static const DEFAULT_MEASURED_MIN_HEIGHT:Number = 22;
public static const DEFAULT_MAX_HEIGHT:Number = 10000;
public static const DEFAULT_MEASURED_HEIGHT:Number = 22;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const DEFAULT_MEASURED_MIN_WIDTH:Number = 40;
mx_internal static var dispatchEventHook:Function;
private static var fakeMouseY:QName = new QName(mx_internal, "_mouseY");
mx_internal static var createAccessibilityImplementation:Function;
mx_internal static var STYLE_UNINITIALIZED:Object = {};
private static var fakeMouseX:QName = new QName(mx_internal, "_mouseX");
private static var _embeddedFontRegistry:IEmbeddedFontRegistry;
public function UIComponent(){
methodQueue = [];
_resourceManager = ResourceManager.getInstance();
_inheritingStyles = UIComponent.STYLE_UNINITIALIZED;
_nonInheritingStyles = UIComponent.STYLE_UNINITIALIZED;
states = [];
transitions = [];
_effectsStarted = [];
_affectedProperties = {};
_endingEffectInstances = [];
super();
focusRect = false;
tabEnabled = (this is IFocusManagerComponent);
tabChildren = false;
enabled = true;
$visible = false;
addEventListener(Event.ADDED, addedHandler);
addEventListener(Event.REMOVED, removedHandler);
if ((this is IFocusManagerComponent)){
addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
};
resourcesChanged();
resourceManager.addEventListener(Event.CHANGE, resourceManager_changeHandler, false, 0, true);
_width = super.width;
_height = super.height;
}
override public function get filters():Array{
return ((_filters) ? _filters : super.filters);
}
public function get toolTip():String{
return (_toolTip);
}
private function transition_effectEndHandler(event:EffectEvent):void{
_currentTransitionEffect = null;
}
public function get nestLevel():int{
return (_nestLevel);
}
protected function adjustFocusRect(obj:DisplayObject=null):void{
var rectCol:Number;
var thickness:Number;
var pt:Point;
var rotRad:Number;
if (!obj){
obj = this;
};
if (((isNaN(obj.width)) || (isNaN(obj.height)))){
return;
};
var fm:IFocusManager = focusManager;
if (!fm){
return;
};
var focusObj:IFlexDisplayObject = IFlexDisplayObject(getFocusObject());
if (focusObj){
if (((errorString) && (!((errorString == ""))))){
rectCol = getStyle("errorColor");
} else {
rectCol = getStyle("themeColor");
};
thickness = getStyle("focusThickness");
if ((focusObj is IStyleClient)){
IStyleClient(focusObj).setStyle("focusColor", rectCol);
};
focusObj.setActualSize((obj.width + (2 * thickness)), (obj.height + (2 * thickness)));
if (rotation){
rotRad = ((rotation * Math.PI) / 180);
pt = new Point((obj.x - (thickness * (Math.cos(rotRad) - Math.sin(rotRad)))), (obj.y - (thickness * (Math.cos(rotRad) + Math.sin(rotRad)))));
DisplayObject(focusObj).rotation = rotation;
} else {
pt = new Point((obj.x - thickness), (obj.y - thickness));
};
if (obj.parent == this){
pt.x = (pt.x + x);
pt.y = (pt.y + y);
};
pt = parent.localToGlobal(pt);
pt = parent.globalToLocal(pt);
focusObj.move(pt.x, pt.y);
if ((focusObj is IInvalidating)){
IInvalidating(focusObj).validateNow();
} else {
if ((focusObj is IProgrammaticSkin)){
IProgrammaticSkin(focusObj).validateNow();
};
};
};
}
mx_internal function setUnscaledWidth(value:Number):void{
var scaledValue:Number = (value * Math.abs(oldScaleX));
if (_explicitWidth == scaledValue){
return;
};
if (!isNaN(scaledValue)){
_percentWidth = NaN;
};
_explicitWidth = scaledValue;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (((p) && (includeInLayout))){
p.invalidateSize();
p.invalidateDisplayList();
};
}
private function isOnDisplayList():Boolean{
var p:DisplayObjectContainer;
p = (_parent) ? _parent : super.parent;
//unresolved jump
var _slot1 = e;
return (true);
return ((p) ? true : false);
}
public function set nestLevel(value:int):void{
var childList:IChildList;
var n:int;
var i:int;
var ui:ILayoutManagerClient;
var textField:IUITextField;
if ((((value > 1)) && (!((_nestLevel == value))))){
_nestLevel = value;
updateCallbacks();
childList = ((this is IRawChildrenContainer)) ? IRawChildrenContainer(this).rawChildren : IChildList(this);
n = childList.numChildren;
i = 0;
while (i < n) {
ui = (childList.getChildAt(i) as ILayoutManagerClient);
if (ui){
ui.nestLevel = (value + 1);
} else {
textField = (childList.getChildAt(i) as IUITextField);
if (textField){
textField.nestLevel = (value + 1);
};
};
i++;
};
};
}
public function getExplicitOrMeasuredHeight():Number{
return ((isNaN(explicitHeight)) ? measuredHeight : explicitHeight);
}
private function callLaterDispatcher(event:Event):void{
var callLaterErrorEvent:DynamicEvent;
var event = event;
UIComponentGlobals.callLaterDispatcherCount++;
if (!UIComponentGlobals.catchCallLaterExceptions){
callLaterDispatcher2(event);
} else {
callLaterDispatcher2(event);
//unresolved jump
var _slot1 = e;
callLaterErrorEvent = new DynamicEvent("callLaterError");
callLaterErrorEvent.error = _slot1;
systemManager.dispatchEvent(callLaterErrorEvent);
};
UIComponentGlobals.callLaterDispatcherCount--;
}
public function getStyle(styleProp:String){
return ((StyleManager.inheritingStyles[styleProp]) ? _inheritingStyles[styleProp] : _nonInheritingStyles[styleProp]);
}
final mx_internal function get $width():Number{
return (super.width);
}
public function get className():String{
var name:String = getQualifiedClassName(this);
var index:int = name.indexOf("::");
if (index != -1){
name = name.substr((index + 2));
};
return (name);
}
public function verticalGradientMatrix(x:Number, y:Number, width:Number, height:Number):Matrix{
UIComponentGlobals.tempMatrix.createGradientBox(width, height, (Math.PI / 2), x, y);
return (UIComponentGlobals.tempMatrix);
}
public function setCurrentState(stateName:String, playTransition:Boolean=true):void{
if (((!((stateName == currentState))) && (!(((isBaseState(stateName)) && (isBaseState(currentState))))))){
requestedCurrentState = stateName;
playStateTransition = playTransition;
if (initialized){
commitCurrentState();
} else {
_currentStateChanged = true;
addEventListener(FlexEvent.CREATION_COMPLETE, creationCompleteHandler);
};
};
}
private function getBaseStates(state:State):Array{
var baseStates:Array = [];
while (((state) && (state.basedOn))) {
baseStates.push(state.basedOn);
state = getState(state.basedOn);
};
return (baseStates);
}
public function set minHeight(value:Number):void{
if (explicitMinHeight == value){
return;
};
explicitMinHeight = value;
}
protected function isOurFocus(target:DisplayObject):Boolean{
return ((target == this));
}
public function get errorString():String{
return (_errorString);
}
mx_internal function setUnscaledHeight(value:Number):void{
var scaledValue:Number = (value * Math.abs(oldScaleY));
if (_explicitHeight == scaledValue){
return;
};
if (!isNaN(scaledValue)){
_percentHeight = NaN;
};
_explicitHeight = scaledValue;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (((p) && (includeInLayout))){
p.invalidateSize();
p.invalidateDisplayList();
};
}
public function get automationName():String{
if (_automationName){
return (_automationName);
};
if (automationDelegate){
return (automationDelegate.automationName);
};
return ("");
}
final mx_internal function set $width(value:Number):void{
super.width = value;
}
public function getVisibleRect(targetParent:DisplayObject=null):Rectangle{
if (!targetParent){
targetParent = DisplayObject(systemManager);
};
var pt:Point = new Point(x, y);
var thisParent:DisplayObject = ($parent) ? $parent : parent;
pt = thisParent.localToGlobal(pt);
var bounds:Rectangle = new Rectangle(pt.x, pt.y, width, height);
var current:DisplayObject = this;
var currentRect:Rectangle = new Rectangle();
do {
if ((current is UIComponent)){
if (UIComponent(current).$parent){
current = UIComponent(current).$parent;
} else {
current = UIComponent(current).parent;
};
} else {
current = current.parent;
};
if (((current) && (current.scrollRect))){
currentRect = current.scrollRect.clone();
pt = current.localToGlobal(currentRect.topLeft);
currentRect.x = pt.x;
currentRect.y = pt.y;
bounds = bounds.intersection(currentRect);
};
} while (((current) && (!((current == targetParent)))));
return (bounds);
}
public function invalidateDisplayList():void{
if (!invalidateDisplayListFlag){
invalidateDisplayListFlag = true;
if (((isOnDisplayList()) && (UIComponentGlobals.layoutManager))){
UIComponentGlobals.layoutManager.invalidateDisplayList(this);
};
};
}
mx_internal function initThemeColor():Boolean{
var tc:Object;
var rc:Number;
var sc:Number;
var classSelector:Object;
var typeSelectors:Array;
var i:int;
var typeSelector:CSSStyleDeclaration;
var styleName:Object = _styleName;
if (_styleDeclaration){
tc = _styleDeclaration.getStyle("themeColor");
rc = _styleDeclaration.getStyle("rollOverColor");
sc = _styleDeclaration.getStyle("selectionColor");
};
if ((((((tc === null)) || (!(StyleManager.isValidStyleValue(tc))))) && (((styleName) && (!((styleName is ISimpleStyleClient))))))){
classSelector = ((styleName is String)) ? StyleManager.getStyleDeclaration(("." + styleName)) : styleName;
if (classSelector){
tc = classSelector.getStyle("themeColor");
rc = classSelector.getStyle("rollOverColor");
sc = classSelector.getStyle("selectionColor");
};
};
if ((((tc === null)) || (!(StyleManager.isValidStyleValue(tc))))){
typeSelectors = getClassStyleDeclarations();
i = 0;
while (i < typeSelectors.length) {
typeSelector = typeSelectors[i];
if (typeSelector){
tc = typeSelector.getStyle("themeColor");
rc = typeSelector.getStyle("rollOverColor");
sc = typeSelector.getStyle("selectionColor");
};
if (((!((tc === null))) && (StyleManager.isValidStyleValue(tc)))){
break;
};
i++;
};
};
if (((((((!((tc === null))) && (StyleManager.isValidStyleValue(tc)))) && (isNaN(rc)))) && (isNaN(sc)))){
setThemeColor(tc);
return (true);
};
return (((((((!((tc === null))) && (StyleManager.isValidStyleValue(tc)))) && (!(isNaN(rc))))) && (!(isNaN(sc)))));
}
override public function get scaleX():Number{
return (_scaleX);
}
public function get uid():String{
if (!_uid){
_uid = toString();
};
return (_uid);
}
override public function get mouseX():Number{
if (((((!(root)) || ((root is Stage)))) || ((root[fakeMouseX] === undefined)))){
return (super.mouseX);
};
return (globalToLocal(new Point(root[fakeMouseX], 0)).x);
}
override public function stopDrag():void{
super.stopDrag();
invalidateProperties();
dispatchEvent(new Event("xChanged"));
dispatchEvent(new Event("yChanged"));
}
public function get focusPane():Sprite{
return (_focusPane);
}
public function set tweeningProperties(value:Array):void{
_tweeningProperties = value;
}
public function horizontalGradientMatrix(x:Number, y:Number, width:Number, height:Number):Matrix{
UIComponentGlobals.tempMatrix.createGradientBox(width, height, 0, x, y);
return (UIComponentGlobals.tempMatrix);
}
public function get isDocument():Boolean{
return ((document == this));
}
public function set validationSubField(value:String):void{
_validationSubField = value;
}
override public function get scaleY():Number{
return (_scaleY);
}
protected function keyDownHandler(event:KeyboardEvent):void{
}
protected function createInFontContext(classObj:Class):Object{
hasFontContextBeenSaved = true;
var fontName:String = StringUtil.trimArrayElements(getStyle("fontFamily"), ",");
var fontWeight:String = getStyle("fontWeight");
var fontStyle:String = getStyle("fontStyle");
var bold = (fontWeight == "bold");
var italic = (fontStyle == "italic");
oldEmbeddedFontContext = getFontContext(fontName, bold, italic);
var obj:Object = createInModuleContext((oldEmbeddedFontContext) ? oldEmbeddedFontContext : moduleFactory, getQualifiedClassName(classObj));
if (obj == null){
obj = new (classObj);
};
return (obj);
}
public function get screen():Rectangle{
var sm:ISystemManager = systemManager;
return ((sm) ? sm.screen : null);
}
protected function focusInHandler(event:FocusEvent):void{
var fm:IFocusManager;
if (isOurFocus(DisplayObject(event.target))){
fm = focusManager;
if (((fm) && (fm.showFocusIndicator))){
drawFocus(true);
};
ContainerGlobals.checkFocus(event.relatedObject, this);
};
}
public function hasFontContextChanged():Boolean{
if (!hasFontContextBeenSaved){
return (false);
};
var fontName:String = StringUtil.trimArrayElements(getStyle("fontFamily"), ",");
var fontWeight:String = getStyle("fontWeight");
var fontStyle:String = getStyle("fontStyle");
var bold = (fontWeight == "bold");
var italic = (fontStyle == "italic");
var embeddedFont:EmbeddedFont = getEmbeddedFont(fontName, bold, italic);
var fontContext:IFlexModuleFactory = embeddedFontRegistry.getAssociatedModuleFactory(embeddedFont, moduleFactory);
return (!((fontContext == oldEmbeddedFontContext)));
}
public function get explicitHeight():Number{
return (_explicitHeight);
}
override public function get x():Number{
return (super.x);
}
override public function get y():Number{
return (super.y);
}
override public function get visible():Boolean{
return (_visible);
}
mx_internal function addOverlay(color:uint, targetArea:RoundedRectangle=null):void{
if (!overlay){
overlayColor = color;
overlay = new UIComponent();
overlay.name = "overlay";
overlay.$visible = true;
fillOverlay(overlay, color, targetArea);
attachOverlay();
if (!targetArea){
addEventListener(ResizeEvent.RESIZE, overlay_resizeHandler);
};
overlay.x = 0;
overlay.y = 0;
invalidateDisplayList();
overlayReferenceCount = 1;
} else {
overlayReferenceCount++;
};
dispatchEvent(new ChildExistenceChangedEvent(ChildExistenceChangedEvent.OVERLAY_CREATED, true, false, overlay));
}
public function get percentWidth():Number{
return (_percentWidth);
}
public function set explicitMinHeight(value:Number):void{
if (_explicitMinHeight == value){
return;
};
_explicitMinHeight = value;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
dispatchEvent(new Event("explicitMinHeightChanged"));
}
public function set automationName(value:String):void{
_automationName = value;
}
public function get mouseFocusEnabled():Boolean{
return (_mouseFocusEnabled);
}
mx_internal function getEmbeddedFont(fontName:String, bold:Boolean, italic:Boolean):EmbeddedFont{
if (cachedEmbeddedFont){
if ((((cachedEmbeddedFont.fontName == fontName)) && ((cachedEmbeddedFont.fontStyle == EmbeddedFontRegistry.getFontStyle(bold, italic))))){
return (cachedEmbeddedFont);
};
};
cachedEmbeddedFont = new EmbeddedFont(fontName, bold, italic);
return (cachedEmbeddedFont);
}
public function stylesInitialized():void{
}
public function set errorString(value:String):void{
var oldValue:String = _errorString;
_errorString = value;
ToolTipManager.registerErrorString(this, oldValue, value);
errorStringChanged = true;
invalidateProperties();
dispatchEvent(new Event("errorStringChanged"));
}
public function getExplicitOrMeasuredWidth():Number{
return ((isNaN(explicitWidth)) ? measuredWidth : explicitWidth);
}
final mx_internal function set $height(value:Number):void{
super.height = value;
}
protected function keyUpHandler(event:KeyboardEvent):void{
}
final mx_internal function $removeChild(child:DisplayObject):DisplayObject{
return (super.removeChild(child));
}
override public function set scaleX(value:Number):void{
if (_scaleX == value){
return;
};
_scaleX = value;
invalidateProperties();
invalidateSize();
dispatchEvent(new Event("scaleXChanged"));
}
override public function set scaleY(value:Number):void{
if (_scaleY == value){
return;
};
_scaleY = value;
invalidateProperties();
invalidateSize();
dispatchEvent(new Event("scaleYChanged"));
}
public function set uid(uid:String):void{
this._uid = uid;
}
public function createAutomationIDPart(child:IAutomationObject):Object{
if (automationDelegate){
return (automationDelegate.createAutomationIDPart(child));
};
return (null);
}
public function getAutomationChildAt(index:int):IAutomationObject{
if (automationDelegate){
return (automationDelegate.getAutomationChildAt(index));
};
return (null);
}
mx_internal function get isEffectStarted():Boolean{
return (_isEffectStarted);
}
override public function get parent():DisplayObjectContainer{
return ((_parent) ? _parent : super.parent);
//unresolved jump
var _slot1 = e;
return (null);
}
override public function get mouseY():Number{
if (((((!(root)) || ((root is Stage)))) || ((root[fakeMouseY] === undefined)))){
return (super.mouseY);
};
return (globalToLocal(new Point(0, root[fakeMouseY])).y);
}
public function setActualSize(w:Number, h:Number):void{
var changed:Boolean;
if (_width != w){
_width = w;
dispatchEvent(new Event("widthChanged"));
changed = true;
};
if (_height != h){
_height = h;
dispatchEvent(new Event("heightChanged"));
changed = true;
};
if (changed){
invalidateDisplayList();
dispatchResizeEvent();
};
}
private function focusObj_resizeHandler(event:ResizeEvent):void{
adjustFocusRect();
}
mx_internal function adjustSizesForScaleChanges():void{
var scalingFactor:Number;
var xScale:Number = scaleX;
var yScale:Number = scaleY;
if (xScale != oldScaleX){
scalingFactor = Math.abs((xScale / oldScaleX));
if (explicitMinWidth){
explicitMinWidth = (explicitMinWidth * scalingFactor);
};
if (!isNaN(explicitWidth)){
explicitWidth = (explicitWidth * scalingFactor);
};
if (explicitMaxWidth){
explicitMaxWidth = (explicitMaxWidth * scalingFactor);
};
oldScaleX = xScale;
};
if (yScale != oldScaleY){
scalingFactor = Math.abs((yScale / oldScaleY));
if (explicitMinHeight){
explicitMinHeight = (explicitMinHeight * scalingFactor);
};
if (explicitHeight){
explicitHeight = (explicitHeight * scalingFactor);
};
if (explicitMaxHeight){
explicitMaxHeight = (explicitMaxHeight * scalingFactor);
};
oldScaleY = yScale;
};
}
public function set focusPane(value:Sprite):void{
if (value){
addChild(value);
value.x = 0;
value.y = 0;
value.scrollRect = null;
_focusPane = value;
} else {
removeChild(_focusPane);
_focusPane.mask = null;
_focusPane = null;
};
}
public function determineTextFormatFromStyles():UITextFormat{
var font:String;
var textFormat:UITextFormat = cachedTextFormat;
if (!textFormat){
font = StringUtil.trimArrayElements(_inheritingStyles.fontFamily, ",");
textFormat = new UITextFormat(getNonNullSystemManager(), font);
textFormat.moduleFactory = moduleFactory;
textFormat.align = _inheritingStyles.textAlign;
textFormat.bold = (_inheritingStyles.fontWeight == "bold");
textFormat.color = (enabled) ? _inheritingStyles.color : _inheritingStyles.disabledColor;
textFormat.font = font;
textFormat.indent = _inheritingStyles.textIndent;
textFormat.italic = (_inheritingStyles.fontStyle == "italic");
textFormat.kerning = _inheritingStyles.kerning;
textFormat.leading = _nonInheritingStyles.leading;
textFormat.leftMargin = _nonInheritingStyles.paddingLeft;
textFormat.letterSpacing = _inheritingStyles.letterSpacing;
textFormat.rightMargin = _nonInheritingStyles.paddingRight;
textFormat.size = _inheritingStyles.fontSize;
textFormat.underline = (_nonInheritingStyles.textDecoration == "underline");
textFormat.antiAliasType = _inheritingStyles.fontAntiAliasType;
textFormat.gridFitType = _inheritingStyles.fontGridFitType;
textFormat.sharpness = _inheritingStyles.fontSharpness;
textFormat.thickness = _inheritingStyles.fontThickness;
cachedTextFormat = textFormat;
};
return (textFormat);
}
public function validationResultHandler(event:ValidationResultEvent):void{
var msg:String;
var result:ValidationResult;
var i:int;
if (event.type == ValidationResultEvent.VALID){
if (errorString != ""){
errorString = "";
dispatchEvent(new FlexEvent(FlexEvent.VALID));
};
} else {
if (((((!((validationSubField == null))) && (!((validationSubField == ""))))) && (event.results))){
i = 0;
while (i < event.results.length) {
result = event.results[i];
if (result.subField == validationSubField){
if (result.isError){
msg = result.errorMessage;
} else {
if (errorString != ""){
errorString = "";
dispatchEvent(new FlexEvent(FlexEvent.VALID));
};
};
break;
};
i++;
};
} else {
if (((event.results) && ((event.results.length > 0)))){
msg = event.results[0].errorMessage;
};
};
if (((msg) && (!((errorString == msg))))){
errorString = msg;
dispatchEvent(new FlexEvent(FlexEvent.INVALID));
};
};
}
public function invalidateProperties():void{
if (!invalidatePropertiesFlag){
invalidatePropertiesFlag = true;
if (((parent) && (UIComponentGlobals.layoutManager))){
UIComponentGlobals.layoutManager.invalidateProperties(this);
};
};
}
public function get inheritingStyles():Object{
return (_inheritingStyles);
}
private function focusObj_scrollHandler(event:Event):void{
adjustFocusRect();
}
final mx_internal function get $x():Number{
return (super.x);
}
final mx_internal function get $y():Number{
return (super.y);
}
public function setConstraintValue(constraintName:String, value):void{
setStyle(constraintName, value);
}
protected function resourcesChanged():void{
}
public function registerEffects(effects:Array):void{
var event:String;
var n:int = effects.length;
var i:int;
while (i < n) {
event = EffectManager.getEventForEffectTrigger(effects[i]);
if (((!((event == null))) && (!((event == ""))))){
addEventListener(event, EffectManager.eventHandler, false, EventPriority.EFFECT);
};
i++;
};
}
public function get explicitMinWidth():Number{
return (_explicitMinWidth);
}
private function filterChangeHandler(event:Event):void{
super.filters = _filters;
}
override public function set visible(value:Boolean):void{
setVisible(value);
}
public function set explicitHeight(value:Number):void{
if (_explicitHeight == value){
return;
};
if (!isNaN(value)){
_percentHeight = NaN;
};
_explicitHeight = value;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (((p) && (includeInLayout))){
p.invalidateSize();
p.invalidateDisplayList();
};
dispatchEvent(new Event("explicitHeightChanged"));
}
override public function set x(value:Number):void{
if (super.x == value){
return;
};
super.x = value;
invalidateProperties();
dispatchEvent(new Event("xChanged"));
}
public function set showInAutomationHierarchy(value:Boolean):void{
_showInAutomationHierarchy = value;
}
override public function set y(value:Number):void{
if (super.y == value){
return;
};
super.y = value;
invalidateProperties();
dispatchEvent(new Event("yChanged"));
}
private function resourceManager_changeHandler(event:Event):void{
resourcesChanged();
}
public function set systemManager(value:ISystemManager):void{
_systemManager = value;
_systemManagerDirty = false;
}
mx_internal function getFocusObject():DisplayObject{
var fm:IFocusManager = focusManager;
if (((!(fm)) || (!(fm.focusPane)))){
return (null);
};
return (((fm.focusPane.numChildren == 0)) ? null : fm.focusPane.getChildAt(0));
}
public function set percentWidth(value:Number):void{
if (_percentWidth == value){
return;
};
if (!isNaN(value)){
_explicitWidth = NaN;
};
_percentWidth = value;
var p:IInvalidating = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
}
public function get moduleFactory():IFlexModuleFactory{
return (_moduleFactory);
}
override public function addChild(child:DisplayObject):DisplayObject{
var formerParent:DisplayObjectContainer = child.parent;
if (((formerParent) && (!((formerParent is Loader))))){
formerParent.removeChild(child);
};
var index:int = (((overlayReferenceCount) && (!((child == overlay))))) ? Math.max(0, (super.numChildren - 1)) : super.numChildren;
addingChild(child);
$addChildAt(child, index);
childAdded(child);
return (child);
}
public function get document():Object{
return (_document);
}
public function set mouseFocusEnabled(value:Boolean):void{
_mouseFocusEnabled = value;
}
final mx_internal function $addChild(child:DisplayObject):DisplayObject{
return (super.addChild(child));
}
mx_internal function setThemeColor(value:Object):void{
var newValue:Number;
if ((newValue is String)){
newValue = parseInt(String(value));
} else {
newValue = Number(value);
};
if (isNaN(newValue)){
newValue = StyleManager.getColorName(value);
};
var newValueS:Number = ColorUtil.adjustBrightness2(newValue, 50);
var newValueR:Number = ColorUtil.adjustBrightness2(newValue, 70);
setStyle("selectionColor", newValueS);
setStyle("rollOverColor", newValueR);
}
public function get explicitMaxWidth():Number{
return (_explicitMaxWidth);
}
public function get id():String{
return (_id);
}
override public function get height():Number{
return (_height);
}
public function set minWidth(value:Number):void{
if (explicitMinWidth == value){
return;
};
explicitMinWidth = value;
}
public function set currentState(value:String):void{
setCurrentState(value, true);
}
public function getRepeaterItem(whichRepeater:int=-1):Object{
var repeaterArray:Array = repeaters;
if (whichRepeater == -1){
whichRepeater = (repeaterArray.length - 1);
};
return (repeaterArray[whichRepeater].getItemAt(repeaterIndices[whichRepeater]));
}
public function executeBindings(recurse:Boolean=false):void{
var bindingsHost:Object = (((descriptor) && (descriptor.document))) ? descriptor.document : parentDocument;
BindingManager.executeBindings(bindingsHost, id, this);
}
public function replayAutomatableEvent(event:Event):Boolean{
if (automationDelegate){
return (automationDelegate.replayAutomatableEvent(event));
};
return (false);
}
mx_internal function getFontContext(fontName:String, bold:Boolean, italic:Boolean):IFlexModuleFactory{
return (embeddedFontRegistry.getAssociatedModuleFactory(getEmbeddedFont(fontName, bold, italic), moduleFactory));
}
public function get instanceIndex():int{
return ((_instanceIndices) ? _instanceIndices[(_instanceIndices.length - 1)] : -1);
}
public function set measuredWidth(value:Number):void{
_measuredWidth = value;
}
public function effectFinished(effectInst:IEffectInstance):void{
_endingEffectInstances.push(effectInst);
invalidateProperties();
UIComponentGlobals.layoutManager.addEventListener(FlexEvent.UPDATE_COMPLETE, updateCompleteHandler, false, 0, true);
}
mx_internal function set isEffectStarted(value:Boolean):void{
_isEffectStarted = value;
}
mx_internal function fillOverlay(overlay:UIComponent, color:uint, targetArea:RoundedRectangle=null):void{
if (!targetArea){
targetArea = new RoundedRectangle(0, 0, unscaledWidth, unscaledHeight, 0);
};
var g:Graphics = overlay.graphics;
g.clear();
g.beginFill(color);
g.drawRoundRect(targetArea.x, targetArea.y, targetArea.width, targetArea.height, (targetArea.cornerRadius * 2), (targetArea.cornerRadius * 2));
g.endFill();
}
public function get instanceIndices():Array{
return ((_instanceIndices) ? _instanceIndices.slice(0) : null);
}
mx_internal function childAdded(child:DisplayObject):void{
if ((child is UIComponent)){
if (!UIComponent(child).initialized){
UIComponent(child).initialize();
};
} else {
if ((child is IUIComponent)){
IUIComponent(child).initialize();
};
};
}
public function globalToContent(point:Point):Point{
return (globalToLocal(point));
}
mx_internal function removingChild(child:DisplayObject):void{
}
mx_internal function getEffectsForProperty(propertyName:String):Array{
return (((_affectedProperties[propertyName])!=undefined) ? _affectedProperties[propertyName] : []);
}
override public function removeChildAt(index:int):DisplayObject{
var child:DisplayObject = getChildAt(index);
removingChild(child);
$removeChild(child);
childRemoved(child);
return (child);
}
protected function measure():void{
measuredMinWidth = 0;
measuredMinHeight = 0;
measuredWidth = 0;
measuredHeight = 0;
}
public function set owner(value:DisplayObjectContainer):void{
_owner = value;
}
mx_internal function getNonNullSystemManager():ISystemManager{
var sm:ISystemManager = systemManager;
if (!sm){
sm = ISystemManager(SystemManager.getSWFRoot(this));
};
if (!sm){
return (SystemManagerGlobals.topLevelSystemManagers[0]);
};
return (sm);
}
protected function get unscaledWidth():Number{
return ((width / Math.abs(scaleX)));
}
public function set processedDescriptors(value:Boolean):void{
_processedDescriptors = value;
if (value){
dispatchEvent(new FlexEvent(FlexEvent.INITIALIZE));
};
}
private function processEffectFinished(effectInsts:Array):void{
var j:int;
var effectInst:IEffectInstance;
var removedInst:IEffectInstance;
var aProps:Array;
var k:int;
var propName:String;
var l:int;
var i:int = (_effectsStarted.length - 1);
while (i >= 0) {
j = 0;
while (j < effectInsts.length) {
effectInst = effectInsts[j];
if (effectInst == _effectsStarted[i]){
removedInst = _effectsStarted[i];
_effectsStarted.splice(i, 1);
aProps = removedInst.effect.getAffectedProperties();
k = 0;
while (k < aProps.length) {
propName = aProps[k];
if (_affectedProperties[propName] != undefined){
l = 0;
while (l < _affectedProperties[propName].length) {
if (_affectedProperties[propName][l] == effectInst){
_affectedProperties[propName].splice(l, 1);
break;
};
l++;
};
if (_affectedProperties[propName].length == 0){
delete _affectedProperties[propName];
};
};
k++;
};
break;
};
j++;
};
i--;
};
isEffectStarted = ((_effectsStarted.length > 0)) ? true : false;
if (((effectInst) && (effectInst.hideFocusRing))){
preventDrawFocus = false;
};
}
private function commitCurrentState():void{
var event:StateChangeEvent;
var transition:IEffect = (playStateTransition) ? getTransition(_currentState, requestedCurrentState) : null;
var commonBaseState:String = findCommonBaseState(_currentState, requestedCurrentState);
var oldState:String = (_currentState) ? _currentState : "";
var destination:State = getState(requestedCurrentState);
if (_currentTransitionEffect){
_currentTransitionEffect.end();
};
initializeState(requestedCurrentState);
if (transition){
transition.captureStartValues();
};
event = new StateChangeEvent(StateChangeEvent.CURRENT_STATE_CHANGING);
event.oldState = oldState;
event.newState = (requestedCurrentState) ? requestedCurrentState : "";
dispatchEvent(event);
if (isBaseState(_currentState)){
dispatchEvent(new FlexEvent(FlexEvent.EXIT_STATE));
};
removeState(_currentState, commonBaseState);
_currentState = requestedCurrentState;
if (isBaseState(currentState)){
dispatchEvent(new FlexEvent(FlexEvent.ENTER_STATE));
} else {
applyState(_currentState, commonBaseState);
};
event = new StateChangeEvent(StateChangeEvent.CURRENT_STATE_CHANGE);
event.oldState = oldState;
event.newState = (_currentState) ? _currentState : "";
dispatchEvent(event);
if (transition){
UIComponentGlobals.layoutManager.validateNow();
_currentTransitionEffect = transition;
transition.addEventListener(EffectEvent.EFFECT_END, transition_effectEndHandler);
transition.play();
};
}
public function get includeInLayout():Boolean{
return (_includeInLayout);
}
private function dispatchResizeEvent():void{
var resizeEvent:ResizeEvent = new ResizeEvent(ResizeEvent.RESIZE);
resizeEvent.oldWidth = oldWidth;
resizeEvent.oldHeight = oldHeight;
dispatchEvent(resizeEvent);
oldWidth = width;
oldHeight = height;
}
public function set maxWidth(value:Number):void{
if (explicitMaxWidth == value){
return;
};
explicitMaxWidth = value;
}
public function validateDisplayList():void{
var sm:ISystemManager;
var unscaledWidth:Number;
var unscaledHeight:Number;
if (invalidateDisplayListFlag){
sm = (parent as ISystemManager);
if (sm){
if ((((sm is SystemManagerProxy)) || ((((sm == systemManager.topLevelSystemManager)) && (!((sm.document == this))))))){
setActualSize(getExplicitOrMeasuredWidth(), getExplicitOrMeasuredHeight());
};
};
unscaledWidth = ((scaleX == 0)) ? 0 : (width / scaleX);
unscaledHeight = ((scaleY == 0)) ? 0 : (height / scaleY);
if (Math.abs((unscaledWidth - lastUnscaledWidth)) < 1E-5){
unscaledWidth = lastUnscaledWidth;
};
if (Math.abs((unscaledHeight - lastUnscaledHeight)) < 1E-5){
unscaledHeight = lastUnscaledHeight;
};
updateDisplayList(unscaledWidth, unscaledHeight);
lastUnscaledWidth = unscaledWidth;
lastUnscaledHeight = unscaledHeight;
invalidateDisplayListFlag = false;
};
}
public function contentToGlobal(point:Point):Point{
return (localToGlobal(point));
}
public function resolveAutomationIDPart(criteria:Object):Array{
if (automationDelegate){
return (automationDelegate.resolveAutomationIDPart(criteria));
};
return ([]);
}
public function set inheritingStyles(value:Object):void{
_inheritingStyles = value;
}
public function setFocus():void{
var sm:ISystemManager = systemManager;
if (((sm) && (((sm.stage) || (sm.useSWFBridge()))))){
if (UIComponentGlobals.callLaterDispatcherCount == 0){
sm.stage.focus = this;
UIComponentGlobals.nextFocusObject = null;
} else {
UIComponentGlobals.nextFocusObject = this;
sm.addEventListener(FlexEvent.ENTER_FRAME, setFocusLater);
};
} else {
UIComponentGlobals.nextFocusObject = this;
callLater(setFocusLater);
};
}
private function getTransition(oldState:String, newState:String):IEffect{
var t:Transition;
var result:IEffect;
var priority:int;
if (!transitions){
return (null);
};
if (!oldState){
oldState = "";
};
if (!newState){
newState = "";
};
var i:int;
while (i < transitions.length) {
t = transitions[i];
if ((((((t.fromState == "*")) && ((t.toState == "*")))) && ((priority < 1)))){
result = t.effect;
priority = 1;
} else {
if ((((((t.fromState == oldState)) && ((t.toState == "*")))) && ((priority < 2)))){
result = t.effect;
priority = 2;
} else {
if ((((((t.fromState == "*")) && ((t.toState == newState)))) && ((priority < 3)))){
result = t.effect;
priority = 3;
} else {
if ((((((t.fromState == oldState)) && ((t.toState == newState)))) && ((priority < 4)))){
result = t.effect;
priority = 4;
break;
};
};
};
};
i++;
};
return (result);
}
public function set initialized(value:Boolean):void{
_initialized = value;
if (value){
setVisible(_visible, true);
dispatchEvent(new FlexEvent(FlexEvent.CREATION_COMPLETE));
};
}
final mx_internal function set $y(value:Number):void{
super.y = value;
}
public function owns(child:DisplayObject):Boolean{
var child = child;
var childList:IChildList = ((this is IRawChildrenContainer)) ? IRawChildrenContainer(this).rawChildren : IChildList(this);
if (childList.contains(child)){
return (true);
};
while (((child) && (!((child == this))))) {
if ((child is IUIComponent)){
child = IUIComponent(child).owner;
} else {
child = child.parent;
};
};
//unresolved jump
var _slot1 = e;
return (false);
return ((child == this));
}
public function setVisible(value:Boolean, noEvent:Boolean=false):void{
_visible = value;
if (!initialized){
return;
};
if ($visible == value){
return;
};
$visible = value;
if (!noEvent){
dispatchEvent(new FlexEvent((value) ? FlexEvent.SHOW : FlexEvent.HIDE));
};
}
final mx_internal function $addChildAt(child:DisplayObject, index:int):DisplayObject{
return (super.addChildAt(child, index));
}
public function deleteReferenceOnParentDocument(parentDocument:IFlexDisplayObject):void{
var indices:Array;
var r:Object;
var stack:Array;
var n:int;
var i:int;
var j:int;
var s:Object;
var event:PropertyChangeEvent;
if (((id) && (!((id == ""))))){
indices = _instanceIndices;
if (!indices){
parentDocument[id] = null;
} else {
r = parentDocument[id];
if (!r){
return;
};
stack = [];
stack.push(r);
n = indices.length;
i = 0;
while (i < (n - 1)) {
s = r[indices[i]];
if (!s){
return;
};
r = s;
stack.push(r);
i++;
};
r.splice(indices[(n - 1)], 1);
j = (stack.length - 1);
while (j > 0) {
if (stack[j].length == 0){
stack[(j - 1)].splice(indices[j], 1);
};
j--;
};
if ((((stack.length > 0)) && ((stack[0].length == 0)))){
parentDocument[id] = null;
} else {
event = PropertyChangeEvent.createUpdateEvent(parentDocument, id, parentDocument[id], parentDocument[id]);
parentDocument.dispatchEvent(event);
};
};
};
}
public function get nonInheritingStyles():Object{
return (_nonInheritingStyles);
}
public function effectStarted(effectInst:IEffectInstance):void{
var propName:String;
_effectsStarted.push(effectInst);
var aProps:Array = effectInst.effect.getAffectedProperties();
var j:int;
while (j < aProps.length) {
propName = aProps[j];
if (_affectedProperties[propName] == undefined){
_affectedProperties[propName] = [];
};
_affectedProperties[propName].push(effectInst);
j++;
};
isEffectStarted = true;
if (effectInst.hideFocusRing){
preventDrawFocus = true;
drawFocus(false);
};
}
final mx_internal function set $x(value:Number):void{
super.x = value;
}
private function applyState(stateName:String, lastState:String):void{
var overrides:Array;
var i:int;
var state:State = getState(stateName);
if (stateName == lastState){
return;
};
if (state){
if (state.basedOn != lastState){
applyState(state.basedOn, lastState);
};
overrides = state.overrides;
i = 0;
while (i < overrides.length) {
overrides[i].apply(this);
i++;
};
state.dispatchEnterState();
};
}
protected function commitProperties():void{
var scalingFactorX:Number;
var scalingFactorY:Number;
if (_scaleX != oldScaleX){
scalingFactorX = Math.abs((_scaleX / oldScaleX));
if (!isNaN(explicitMinWidth)){
explicitMinWidth = (explicitMinWidth * scalingFactorX);
};
if (!isNaN(explicitWidth)){
explicitWidth = (explicitWidth * scalingFactorX);
};
if (!isNaN(explicitMaxWidth)){
explicitMaxWidth = (explicitMaxWidth * scalingFactorX);
};
_width = (_width * scalingFactorX);
super.scaleX = (oldScaleX = _scaleX);
};
if (_scaleY != oldScaleY){
scalingFactorY = Math.abs((_scaleY / oldScaleY));
if (!isNaN(explicitMinHeight)){
explicitMinHeight = (explicitMinHeight * scalingFactorY);
};
if (!isNaN(explicitHeight)){
explicitHeight = (explicitHeight * scalingFactorY);
};
if (!isNaN(explicitMaxHeight)){
explicitMaxHeight = (explicitMaxHeight * scalingFactorY);
};
_height = (_height * scalingFactorY);
super.scaleY = (oldScaleY = _scaleY);
};
if (((!((x == oldX))) || (!((y == oldY))))){
dispatchMoveEvent();
};
if (((!((width == oldWidth))) || (!((height == oldHeight))))){
dispatchResizeEvent();
};
if (errorStringChanged){
errorStringChanged = false;
setBorderColorForErrorString();
};
}
public function get percentHeight():Number{
return (_percentHeight);
}
override public function get width():Number{
return (_width);
}
final mx_internal function get $parent():DisplayObjectContainer{
return (super.parent);
}
public function set explicitMinWidth(value:Number):void{
if (_explicitMinWidth == value){
return;
};
_explicitMinWidth = value;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
dispatchEvent(new Event("explicitMinWidthChanged"));
}
public function get isPopUp():Boolean{
return (_isPopUp);
}
private function measureSizes():Boolean{
var scalingFactor:Number;
var newValue:Number;
var xScale:Number;
var yScale:Number;
var changed:Boolean;
if (!invalidateSizeFlag){
return (changed);
};
if (((isNaN(explicitWidth)) || (isNaN(explicitHeight)))){
xScale = Math.abs(scaleX);
yScale = Math.abs(scaleY);
if (xScale != 1){
_measuredMinWidth = (_measuredMinWidth / xScale);
_measuredWidth = (_measuredWidth / xScale);
};
if (yScale != 1){
_measuredMinHeight = (_measuredMinHeight / yScale);
_measuredHeight = (_measuredHeight / yScale);
};
measure();
invalidateSizeFlag = false;
if (((!(isNaN(explicitMinWidth))) && ((measuredWidth < explicitMinWidth)))){
measuredWidth = explicitMinWidth;
};
if (((!(isNaN(explicitMaxWidth))) && ((measuredWidth > explicitMaxWidth)))){
measuredWidth = explicitMaxWidth;
};
if (((!(isNaN(explicitMinHeight))) && ((measuredHeight < explicitMinHeight)))){
measuredHeight = explicitMinHeight;
};
if (((!(isNaN(explicitMaxHeight))) && ((measuredHeight > explicitMaxHeight)))){
measuredHeight = explicitMaxHeight;
};
if (xScale != 1){
_measuredMinWidth = (_measuredMinWidth * xScale);
_measuredWidth = (_measuredWidth * xScale);
};
if (yScale != 1){
_measuredMinHeight = (_measuredMinHeight * yScale);
_measuredHeight = (_measuredHeight * yScale);
};
} else {
invalidateSizeFlag = false;
_measuredMinWidth = 0;
_measuredMinHeight = 0;
};
adjustSizesForScaleChanges();
if (isNaN(oldMinWidth)){
oldMinWidth = (isNaN(explicitMinWidth)) ? measuredMinWidth : explicitMinWidth;
oldMinHeight = (isNaN(explicitMinHeight)) ? measuredMinHeight : explicitMinHeight;
oldExplicitWidth = (isNaN(explicitWidth)) ? measuredWidth : explicitWidth;
oldExplicitHeight = (isNaN(explicitHeight)) ? measuredHeight : explicitHeight;
changed = true;
} else {
newValue = (isNaN(explicitMinWidth)) ? measuredMinWidth : explicitMinWidth;
if (newValue != oldMinWidth){
oldMinWidth = newValue;
changed = true;
};
newValue = (isNaN(explicitMinHeight)) ? measuredMinHeight : explicitMinHeight;
if (newValue != oldMinHeight){
oldMinHeight = newValue;
changed = true;
};
newValue = (isNaN(explicitWidth)) ? measuredWidth : explicitWidth;
if (newValue != oldExplicitWidth){
oldExplicitWidth = newValue;
changed = true;
};
newValue = (isNaN(explicitHeight)) ? measuredHeight : explicitHeight;
if (newValue != oldExplicitHeight){
oldExplicitHeight = newValue;
changed = true;
};
};
return (changed);
}
public function get automationTabularData():Object{
if (automationDelegate){
return (automationDelegate.automationTabularData);
};
return (null);
}
public function validateNow():void{
UIComponentGlobals.layoutManager.validateClient(this);
}
public function finishPrint(obj:Object, target:IFlexDisplayObject):void{
}
public function get repeaters():Array{
return ((_repeaters) ? _repeaters.slice(0) : []);
}
private function dispatchMoveEvent():void{
var moveEvent:MoveEvent = new MoveEvent(MoveEvent.MOVE);
moveEvent.oldX = oldX;
moveEvent.oldY = oldY;
dispatchEvent(moveEvent);
oldX = x;
oldY = y;
}
public function drawFocus(isFocused:Boolean):void{
var focusOwner:DisplayObjectContainer;
var focusClass:Class;
if (!parent){
return;
};
var focusObj:DisplayObject = getFocusObject();
var focusPane:Sprite = (focusManager) ? focusManager.focusPane : null;
if (((isFocused) && (!(preventDrawFocus)))){
focusOwner = focusPane.parent;
if (focusOwner != parent){
if (focusOwner){
if ((focusOwner is ISystemManager)){
ISystemManager(focusOwner).focusPane = null;
} else {
IUIComponent(focusOwner).focusPane = null;
};
};
if ((parent is ISystemManager)){
ISystemManager(parent).focusPane = focusPane;
} else {
IUIComponent(parent).focusPane = focusPane;
};
};
focusClass = getStyle("focusSkin");
if (((focusObj) && (!((focusObj is focusClass))))){
focusPane.removeChild(focusObj);
focusObj = null;
};
if (!focusObj){
focusObj = new (focusClass);
focusObj.name = "focus";
focusPane.addChild(focusObj);
};
if ((focusObj is ILayoutManagerClient)){
ILayoutManagerClient(focusObj).nestLevel = nestLevel;
};
if ((focusObj is ISimpleStyleClient)){
ISimpleStyleClient(focusObj).styleName = this;
};
addEventListener(MoveEvent.MOVE, focusObj_moveHandler, true);
addEventListener(MoveEvent.MOVE, focusObj_moveHandler);
addEventListener(ResizeEvent.RESIZE, focusObj_resizeHandler, true);
addEventListener(ResizeEvent.RESIZE, focusObj_resizeHandler);
addEventListener(Event.REMOVED, focusObj_removedHandler, true);
focusObj.visible = true;
hasFocusRect = true;
adjustFocusRect();
} else {
if (hasFocusRect){
hasFocusRect = false;
if (focusObj){
focusObj.visible = false;
};
removeEventListener(MoveEvent.MOVE, focusObj_moveHandler);
removeEventListener(MoveEvent.MOVE, focusObj_moveHandler, true);
removeEventListener(ResizeEvent.RESIZE, focusObj_resizeHandler, true);
removeEventListener(ResizeEvent.RESIZE, focusObj_resizeHandler);
removeEventListener(Event.REMOVED, focusObj_removedHandler, true);
};
};
}
public function get flexContextMenu():IFlexContextMenu{
return (_flexContextMenu);
}
private function get indexedID():String{
var s:String = id;
var indices:Array = instanceIndices;
if (indices){
s = (s + (("[" + indices.join("][")) + "]"));
};
return (s);
}
public function get measuredMinHeight():Number{
return (_measuredMinHeight);
}
mx_internal function addingChild(child:DisplayObject):void{
if ((((child is IUIComponent)) && (!(IUIComponent(child).document)))){
IUIComponent(child).document = (document) ? document : ApplicationGlobals.application;
};
if ((((child is UIComponent)) && ((UIComponent(child).moduleFactory == null)))){
if (moduleFactory != null){
UIComponent(child).moduleFactory = moduleFactory;
} else {
if ((((document is IFlexModule)) && (!((document.moduleFactory == null))))){
UIComponent(child).moduleFactory = document.moduleFactory;
} else {
if ((((parent is UIComponent)) && (!((UIComponent(parent).moduleFactory == null))))){
UIComponent(child).moduleFactory = UIComponent(parent).moduleFactory;
};
};
};
};
if ((((((child is IFontContextComponent)) && ((!(child) is UIComponent)))) && ((IFontContextComponent(child).fontContext == null)))){
IFontContextComponent(child).fontContext = moduleFactory;
};
if ((child is IUIComponent)){
IUIComponent(child).parentChanged(this);
};
if ((child is ILayoutManagerClient)){
ILayoutManagerClient(child).nestLevel = (nestLevel + 1);
} else {
if ((child is IUITextField)){
IUITextField(child).nestLevel = (nestLevel + 1);
};
};
if ((child is InteractiveObject)){
if (doubleClickEnabled){
InteractiveObject(child).doubleClickEnabled = true;
};
};
if ((child is IStyleClient)){
IStyleClient(child).regenerateStyleCache(true);
} else {
if ((((child is IUITextField)) && (IUITextField(child).inheritingStyles))){
StyleProtoChain.initTextField(IUITextField(child));
};
};
if ((child is ISimpleStyleClient)){
ISimpleStyleClient(child).styleChanged(null);
};
if ((child is IStyleClient)){
IStyleClient(child).notifyStyleChangeInChildren(null, true);
};
if ((child is UIComponent)){
UIComponent(child).initThemeColor();
};
if ((child is UIComponent)){
UIComponent(child).stylesInitialized();
};
}
public function set repeaterIndices(value:Array):void{
_repeaterIndices = value;
}
protected function initializationComplete():void{
processedDescriptors = true;
}
public function set moduleFactory(factory:IFlexModuleFactory):void{
var child:UIComponent;
var n:int = numChildren;
var i:int;
while (i < n) {
child = (getChildAt(i) as UIComponent);
if (!child){
} else {
if ((((child.moduleFactory == null)) || ((child.moduleFactory == _moduleFactory)))){
child.moduleFactory = factory;
};
};
i++;
};
_moduleFactory = factory;
}
private function focusObj_removedHandler(event:Event):void{
if (event.target != this){
return;
};
var focusObject:DisplayObject = getFocusObject();
if (focusObject){
focusObject.visible = false;
};
}
mx_internal function updateCallbacks():void{
if (invalidateDisplayListFlag){
UIComponentGlobals.layoutManager.invalidateDisplayList(this);
};
if (invalidateSizeFlag){
UIComponentGlobals.layoutManager.invalidateSize(this);
};
if (invalidatePropertiesFlag){
UIComponentGlobals.layoutManager.invalidateProperties(this);
};
if (((systemManager) && (((_systemManager.stage) || (_systemManager.useSWFBridge()))))){
if ((((methodQueue.length > 0)) && (!(listeningForRender)))){
_systemManager.addEventListener(FlexEvent.RENDER, callLaterDispatcher);
_systemManager.addEventListener(FlexEvent.ENTER_FRAME, callLaterDispatcher);
listeningForRender = true;
};
if (_systemManager.stage){
_systemManager.stage.invalidate();
};
};
}
public function set styleDeclaration(value:CSSStyleDeclaration):void{
_styleDeclaration = value;
}
override public function set doubleClickEnabled(value:Boolean):void{
var childList:IChildList;
var child:InteractiveObject;
super.doubleClickEnabled = value;
if ((this is IRawChildrenContainer)){
childList = IRawChildrenContainer(this).rawChildren;
} else {
childList = IChildList(this);
};
var i:int;
while (i < childList.numChildren) {
child = (childList.getChildAt(i) as InteractiveObject);
if (child){
child.doubleClickEnabled = value;
};
i++;
};
}
public function prepareToPrint(target:IFlexDisplayObject):Object{
return (null);
}
public function get minHeight():Number{
if (!isNaN(explicitMinHeight)){
return (explicitMinHeight);
};
return (measuredMinHeight);
}
public function notifyStyleChangeInChildren(styleProp:String, recursive:Boolean):void{
var child:ISimpleStyleClient;
cachedTextFormat = null;
var n:int = numChildren;
var i:int;
while (i < n) {
child = (getChildAt(i) as ISimpleStyleClient);
if (child){
child.styleChanged(styleProp);
if ((child is IStyleClient)){
IStyleClient(child).notifyStyleChangeInChildren(styleProp, recursive);
};
};
i++;
};
}
public function get contentMouseX():Number{
return (mouseX);
}
public function get contentMouseY():Number{
return (mouseY);
}
public function get tweeningProperties():Array{
return (_tweeningProperties);
}
public function set explicitMaxWidth(value:Number):void{
if (_explicitMaxWidth == value){
return;
};
_explicitMaxWidth = value;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
dispatchEvent(new Event("explicitMaxWidthChanged"));
}
public function set document(value:Object):void{
var child:IUIComponent;
var n:int = numChildren;
var i:int;
while (i < n) {
child = (getChildAt(i) as IUIComponent);
if (!child){
} else {
if ((((child.document == _document)) || ((child.document == ApplicationGlobals.application)))){
child.document = value;
};
};
i++;
};
_document = value;
}
public function validateSize(recursive:Boolean=false):void{
var i:int;
var child:DisplayObject;
var sizeChanging:Boolean;
var p:IInvalidating;
if (recursive){
i = 0;
while (i < numChildren) {
child = getChildAt(i);
if ((child is ILayoutManagerClient)){
(child as ILayoutManagerClient).validateSize(true);
};
i++;
};
};
if (invalidateSizeFlag){
sizeChanging = measureSizes();
if (((sizeChanging) && (includeInLayout))){
invalidateDisplayList();
p = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
};
};
}
public function get validationSubField():String{
return (_validationSubField);
}
override public function dispatchEvent(event:Event):Boolean{
if (dispatchEventHook != null){
dispatchEventHook(event, this);
};
return (super.dispatchEvent(event));
}
public function set id(value:String):void{
_id = value;
}
private function overlay_resizeHandler(event:Event):void{
fillOverlay(overlay, overlayColor, null);
}
public function set updateCompletePendingFlag(value:Boolean):void{
_updateCompletePendingFlag = value;
}
final mx_internal function get $height():Number{
return (super.height);
}
protected function attachOverlay():void{
addChild(overlay);
}
public function get explicitMinHeight():Number{
return (_explicitMinHeight);
}
override public function set height(value:Number):void{
var p:IInvalidating;
if (explicitHeight != value){
explicitHeight = value;
invalidateSize();
};
if (_height != value){
invalidateProperties();
invalidateDisplayList();
p = (parent as IInvalidating);
if (((p) && (includeInLayout))){
p.invalidateSize();
p.invalidateDisplayList();
};
_height = value;
dispatchEvent(new Event("heightChanged"));
};
}
public function get numAutomationChildren():int{
if (automationDelegate){
return (automationDelegate.numAutomationChildren);
};
return (0);
}
public function get parentApplication():Object{
var p:UIComponent;
var o:Object = systemManager.document;
if (o == this){
p = (o.systemManager.parent as UIComponent);
o = (p) ? p.systemManager.document : null;
};
return (o);
}
public function localToContent(point:Point):Point{
return (point);
}
public function get repeaterIndex():int{
return ((_repeaterIndices) ? _repeaterIndices[(_repeaterIndices.length - 1)] : -1);
}
private function removeState(stateName:String, lastState:String):void{
var overrides:Array;
var i:int;
var state:State = getState(stateName);
if (stateName == lastState){
return;
};
if (state){
state.dispatchExitState();
overrides = state.overrides;
i = overrides.length;
while (i) {
overrides[(i - 1)].remove(this);
i--;
};
if (state.basedOn != lastState){
removeState(state.basedOn, lastState);
};
};
}
public function setStyle(styleProp:String, newValue):void{
if (styleProp == "styleName"){
styleName = newValue;
return;
};
if (EffectManager.getEventForEffectTrigger(styleProp) != ""){
EffectManager.setStyle(styleProp, this);
};
var isInheritingStyle:Boolean = StyleManager.isInheritingStyle(styleProp);
var isProtoChainInitialized = !((inheritingStyles == UIComponent.STYLE_UNINITIALIZED));
var valueChanged = !((getStyle(styleProp) == newValue));
if (!_styleDeclaration){
_styleDeclaration = new CSSStyleDeclaration();
_styleDeclaration.setStyle(styleProp, newValue);
if (isProtoChainInitialized){
regenerateStyleCache(isInheritingStyle);
};
} else {
_styleDeclaration.setStyle(styleProp, newValue);
};
if (((isProtoChainInitialized) && (valueChanged))){
styleChanged(styleProp);
notifyStyleChangeInChildren(styleProp, isInheritingStyle);
};
}
public function get showInAutomationHierarchy():Boolean{
return (_showInAutomationHierarchy);
}
public function get systemManager():ISystemManager{
var r:DisplayObject;
var o:DisplayObjectContainer;
var ui:IUIComponent;
if (((!(_systemManager)) || (_systemManagerDirty))){
r = root;
if ((_systemManager is SystemManagerProxy)){
} else {
if (((r) && (!((r is Stage))))){
_systemManager = (r as ISystemManager);
} else {
if (r){
_systemManager = (Stage(r).getChildAt(0) as ISystemManager);
} else {
o = parent;
while (o) {
ui = (o as IUIComponent);
if (ui){
_systemManager = ui.systemManager;
break;
} else {
if ((o is ISystemManager)){
_systemManager = (o as ISystemManager);
break;
};
};
o = o.parent;
};
};
};
};
_systemManagerDirty = false;
};
return (_systemManager);
}
private function isBaseState(stateName:String):Boolean{
return (((!(stateName)) || ((stateName == ""))));
}
public function set enabled(value:Boolean):void{
_enabled = value;
cachedTextFormat = null;
invalidateDisplayList();
dispatchEvent(new Event("enabledChanged"));
}
public function set focusEnabled(value:Boolean):void{
_focusEnabled = value;
}
public function get minWidth():Number{
if (!isNaN(explicitMinWidth)){
return (explicitMinWidth);
};
return (measuredMinWidth);
}
private function setFocusLater(event:Event=null):void{
var sm:ISystemManager = systemManager;
if (((sm) && (sm.stage))){
sm.stage.removeEventListener(Event.ENTER_FRAME, setFocusLater);
if (UIComponentGlobals.nextFocusObject){
sm.stage.focus = UIComponentGlobals.nextFocusObject;
};
UIComponentGlobals.nextFocusObject = null;
};
}
public function get currentState():String{
return ((_currentStateChanged) ? requestedCurrentState : _currentState);
}
public function initializeRepeaterArrays(parent:IRepeaterClient):void{
if (((((((parent) && (parent.instanceIndices))) && (((!(parent.isDocument)) || (!((parent == descriptor.document))))))) && (!(_instanceIndices)))){
_instanceIndices = parent.instanceIndices;
_repeaters = parent.repeaters;
_repeaterIndices = parent.repeaterIndices;
};
}
public function get baselinePosition():Number{
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
return (NaN);
};
if (!validateBaselinePosition()){
return (NaN);
};
var lineMetrics:TextLineMetrics = measureText("Wj");
if (height < ((2 + lineMetrics.ascent) + 2)){
return (int((height + ((lineMetrics.ascent - height) / 2))));
};
return ((2 + lineMetrics.ascent));
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function set instanceIndices(value:Array):void{
_instanceIndices = value;
}
public function set cachePolicy(value:String):void{
if (_cachePolicy != value){
_cachePolicy = value;
if (value == UIComponentCachePolicy.OFF){
cacheAsBitmap = false;
} else {
if (value == UIComponentCachePolicy.ON){
cacheAsBitmap = true;
} else {
cacheAsBitmap = (cacheAsBitmapCount > 0);
};
};
};
}
public function get automationValue():Array{
if (automationDelegate){
return (automationDelegate.automationValue);
};
return ([]);
}
private function addedHandler(event:Event):void{
var event = event;
if (event.eventPhase != EventPhase.AT_TARGET){
return;
};
if ((((parent is IContainer)) && (IContainer(parent).creatingContentPane))){
event.stopImmediatePropagation();
return;
};
//unresolved jump
var _slot1 = error;
}
public function parentChanged(p:DisplayObjectContainer):void{
if (!p){
_parent = null;
_nestLevel = 0;
} else {
if ((p is IStyleClient)){
_parent = p;
} else {
if ((p is ISystemManager)){
_parent = p;
} else {
_parent = p.parent;
};
};
};
}
public function get owner():DisplayObjectContainer{
return ((_owner) ? _owner : parent);
}
public function get processedDescriptors():Boolean{
return (_processedDescriptors);
}
override public function addChildAt(child:DisplayObject, index:int):DisplayObject{
var formerParent:DisplayObjectContainer = child.parent;
if (((formerParent) && (!((formerParent is Loader))))){
formerParent.removeChild(child);
};
if (((overlayReferenceCount) && (!((child == overlay))))){
index = Math.min(index, Math.max(0, (super.numChildren - 1)));
};
addingChild(child);
$addChildAt(child, index);
childAdded(child);
return (child);
}
public function get maxWidth():Number{
return ((isNaN(explicitMaxWidth)) ? DEFAULT_MAX_WIDTH : explicitMaxWidth);
}
override public function set alpha(value:Number):void{
super.alpha = value;
dispatchEvent(new Event("alphaChanged"));
}
private function removedHandler(event:Event):void{
var event = event;
if (event.eventPhase != EventPhase.AT_TARGET){
return;
};
if ((((parent is IContainer)) && (IContainer(parent).creatingContentPane))){
event.stopImmediatePropagation();
return;
};
//unresolved jump
var _slot1 = error;
_systemManagerDirty = true;
}
public function callLater(method:Function, args:Array=null):void{
methodQueue.push(new MethodQueueElement(method, args));
var sm:ISystemManager = systemManager;
if (((sm) && (((sm.stage) || (sm.useSWFBridge()))))){
if (!listeningForRender){
sm.addEventListener(FlexEvent.RENDER, callLaterDispatcher);
sm.addEventListener(FlexEvent.ENTER_FRAME, callLaterDispatcher);
listeningForRender = true;
};
if (sm.stage){
sm.stage.invalidate();
};
};
}
public function get initialized():Boolean{
return (_initialized);
}
private function callLaterDispatcher2(event:Event):void{
var mqe:MethodQueueElement;
if (UIComponentGlobals.callLaterSuspendCount > 0){
return;
};
var sm:ISystemManager = systemManager;
if (((((sm) && (((sm.stage) || (sm.useSWFBridge()))))) && (listeningForRender))){
sm.removeEventListener(FlexEvent.RENDER, callLaterDispatcher);
sm.removeEventListener(FlexEvent.ENTER_FRAME, callLaterDispatcher);
listeningForRender = false;
};
var queue:Array = methodQueue;
methodQueue = [];
var n:int = queue.length;
var i:int;
while (i < n) {
mqe = MethodQueueElement(queue[i]);
mqe.method.apply(null, mqe.args);
i++;
};
}
public function measureHTMLText(htmlText:String):TextLineMetrics{
return (determineTextFormatFromStyles().measureHTMLText(htmlText));
}
public function set descriptor(value:UIComponentDescriptor):void{
_descriptor = value;
}
private function getState(stateName:String):State{
if (((!(states)) || (isBaseState(stateName)))){
return (null);
};
var i:int;
while (i < states.length) {
if (states[i].name == stateName){
return (states[i]);
};
i++;
};
var message:String = resourceManager.getString("core", "stateUndefined", [stateName]);
throw (new ArgumentError(message));
}
public function validateProperties():void{
if (invalidatePropertiesFlag){
commitProperties();
invalidatePropertiesFlag = false;
};
}
mx_internal function get documentDescriptor():UIComponentDescriptor{
return (_documentDescriptor);
}
public function set includeInLayout(value:Boolean):void{
var p:IInvalidating;
if (_includeInLayout != value){
_includeInLayout = value;
p = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
dispatchEvent(new Event("includeInLayoutChanged"));
};
}
public function getClassStyleDeclarations():Array{
var myApplicationDomain:ApplicationDomain;
var cache:Array;
var myRoot:DisplayObject;
var s:CSSStyleDeclaration;
var factory:IFlexModuleFactory = ModuleManager.getAssociatedFactory(this);
if (factory != null){
myApplicationDomain = ApplicationDomain(factory.info()["currentDomain"]);
} else {
myRoot = SystemManager.getSWFRoot(this);
if (!myRoot){
return ([]);
};
myApplicationDomain = myRoot.loaderInfo.applicationDomain;
};
var className:String = getQualifiedClassName(this);
className = className.replace("::", ".");
cache = StyleManager.typeSelectorCache[className];
if (cache){
return (cache);
};
var decls:Array = [];
var classNames:Array = [];
var caches:Array = [];
var declcache:Array = [];
while (((((!((className == null))) && (!((className == "mx.core.UIComponent"))))) && (!((className == "mx.core.UITextField"))))) {
cache = StyleManager.typeSelectorCache[className];
if (cache){
decls = decls.concat(cache);
break;
};
s = StyleManager.getStyleDeclaration(className);
if (s){
decls.unshift(s);
classNames.push(className);
caches.push(classNames);
declcache.push(decls);
decls = [];
classNames = [];
} else {
classNames.push(className);
};
className = getQualifiedSuperclassName(myApplicationDomain.getDefinition(className));
className = className.replace("::", ".");
continue;
var _slot1 = e;
className = null;
};
caches.push(classNames);
declcache.push(decls);
decls = [];
while (caches.length) {
classNames = caches.pop();
decls = decls.concat(declcache.pop());
while (classNames.length) {
StyleManager.typeSelectorCache[classNames.pop()] = decls;
};
};
return (decls);
}
public function set measuredMinWidth(value:Number):void{
_measuredMinWidth = value;
}
private function initializeState(stateName:String):void{
var state:State = getState(stateName);
while (state) {
state.initialize();
state = getState(state.basedOn);
};
}
mx_internal function initProtoChain():void{
var classSelector:CSSStyleDeclaration;
var inheritChain:Object;
var typeSelector:CSSStyleDeclaration;
if (styleName){
if ((styleName is CSSStyleDeclaration)){
classSelector = CSSStyleDeclaration(styleName);
} else {
if ((((styleName is IFlexDisplayObject)) || ((styleName is IStyleClient)))){
StyleProtoChain.initProtoChainForUIComponentStyleName(this);
return;
};
if ((styleName is String)){
classSelector = StyleManager.getStyleDeclaration(("." + styleName));
};
};
};
var nonInheritChain:Object = StyleManager.stylesRoot;
if (((nonInheritChain) && (nonInheritChain.effects))){
registerEffects(nonInheritChain.effects);
};
var p:IStyleClient = (parent as IStyleClient);
if (p){
inheritChain = p.inheritingStyles;
if (inheritChain == UIComponent.STYLE_UNINITIALIZED){
inheritChain = nonInheritChain;
};
} else {
if (isPopUp){
if ((((((FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0)) && (_owner))) && ((_owner is IStyleClient)))){
inheritChain = IStyleClient(_owner).inheritingStyles;
} else {
inheritChain = ApplicationGlobals.application.inheritingStyles;
};
} else {
inheritChain = StyleManager.stylesRoot;
};
};
var typeSelectors:Array = getClassStyleDeclarations();
var n:int = typeSelectors.length;
var i:int;
while (i < n) {
typeSelector = typeSelectors[i];
inheritChain = typeSelector.addStyleToProtoChain(inheritChain, this);
nonInheritChain = typeSelector.addStyleToProtoChain(nonInheritChain, this);
if (typeSelector.effects){
registerEffects(typeSelector.effects);
};
i++;
};
if (classSelector){
inheritChain = classSelector.addStyleToProtoChain(inheritChain, this);
nonInheritChain = classSelector.addStyleToProtoChain(nonInheritChain, this);
if (classSelector.effects){
registerEffects(classSelector.effects);
};
};
inheritingStyles = (_styleDeclaration) ? _styleDeclaration.addStyleToProtoChain(inheritChain, this) : inheritChain;
nonInheritingStyles = (_styleDeclaration) ? _styleDeclaration.addStyleToProtoChain(nonInheritChain, this) : nonInheritChain;
}
public function get repeaterIndices():Array{
return ((_repeaterIndices) ? _repeaterIndices.slice() : []);
}
override public function removeChild(child:DisplayObject):DisplayObject{
removingChild(child);
$removeChild(child);
childRemoved(child);
return (child);
}
private function focusObj_moveHandler(event:MoveEvent):void{
adjustFocusRect();
}
public function get styleDeclaration():CSSStyleDeclaration{
return (_styleDeclaration);
}
override public function get doubleClickEnabled():Boolean{
return (super.doubleClickEnabled);
}
public function contentToLocal(point:Point):Point{
return (point);
}
private function creationCompleteHandler(event:FlexEvent):void{
if (_currentStateChanged){
_currentStateChanged = false;
commitCurrentState();
validateNow();
};
removeEventListener(FlexEvent.CREATION_COMPLETE, creationCompleteHandler);
}
public function set measuredHeight(value:Number):void{
_measuredHeight = value;
}
protected function createChildren():void{
}
public function get activeEffects():Array{
return (_effectsStarted);
}
override public function setChildIndex(child:DisplayObject, newIndex:int):void{
if (((overlayReferenceCount) && (!((child == overlay))))){
newIndex = Math.min(newIndex, Math.max(0, (super.numChildren - 2)));
};
super.setChildIndex(child, newIndex);
}
public function regenerateStyleCache(recursive:Boolean):void{
var child:DisplayObject;
initProtoChain();
var childList:IChildList = ((this is IRawChildrenContainer)) ? IRawChildrenContainer(this).rawChildren : IChildList(this);
var n:int = childList.numChildren;
var i:int;
while (i < n) {
child = childList.getChildAt(i);
if ((child is IStyleClient)){
if (IStyleClient(child).inheritingStyles != UIComponent.STYLE_UNINITIALIZED){
IStyleClient(child).regenerateStyleCache(recursive);
};
} else {
if ((child is IUITextField)){
if (IUITextField(child).inheritingStyles){
StyleProtoChain.initTextField(IUITextField(child));
};
};
};
i++;
};
}
public function get updateCompletePendingFlag():Boolean{
return (_updateCompletePendingFlag);
}
protected function focusOutHandler(event:FocusEvent):void{
if (isOurFocus(DisplayObject(event.target))){
drawFocus(false);
};
}
public function getFocus():InteractiveObject{
var sm:ISystemManager = systemManager;
if (!sm){
return (null);
};
if (UIComponentGlobals.nextFocusObject){
return (UIComponentGlobals.nextFocusObject);
};
return (sm.stage.focus);
}
public function endEffectsStarted():void{
var len:int = _effectsStarted.length;
var i:int;
while (i < len) {
_effectsStarted[i].end();
i++;
};
}
protected function get unscaledHeight():Number{
return ((height / Math.abs(scaleY)));
}
public function get enabled():Boolean{
return (_enabled);
}
public function get focusEnabled():Boolean{
return (_focusEnabled);
}
override public function set cacheAsBitmap(value:Boolean):void{
super.cacheAsBitmap = value;
cacheAsBitmapCount = (value) ? 1 : 0;
}
mx_internal function removeOverlay():void{
if ((((((overlayReferenceCount > 0)) && ((--overlayReferenceCount == 0)))) && (overlay))){
removeEventListener("resize", overlay_resizeHandler);
if (super.getChildByName("overlay")){
$removeChild(overlay);
};
overlay = null;
};
}
public function set cacheHeuristic(value:Boolean):void{
if (_cachePolicy == UIComponentCachePolicy.AUTO){
if (value){
cacheAsBitmapCount++;
} else {
if (cacheAsBitmapCount != 0){
cacheAsBitmapCount--;
};
};
super.cacheAsBitmap = !((cacheAsBitmapCount == 0));
};
}
public function get cachePolicy():String{
return (_cachePolicy);
}
public function set maxHeight(value:Number):void{
if (explicitMaxHeight == value){
return;
};
explicitMaxHeight = value;
}
public function getConstraintValue(constraintName:String){
return (getStyle(constraintName));
}
public function set focusManager(value:IFocusManager):void{
_focusManager = value;
}
public function clearStyle(styleProp:String):void{
setStyle(styleProp, undefined);
}
public function get descriptor():UIComponentDescriptor{
return (_descriptor);
}
public function set nonInheritingStyles(value:Object):void{
_nonInheritingStyles = value;
}
public function get cursorManager():ICursorManager{
var cm:ICursorManager;
var o:DisplayObject = parent;
while (o) {
if ((((o is IUIComponent)) && (("cursorManager" in o)))){
cm = o["cursorManager"];
return (cm);
};
o = o.parent;
};
return (CursorManager.getInstance());
}
public function set automationDelegate(value:Object):void{
_automationDelegate = (value as IAutomationObject);
}
public function get measuredMinWidth():Number{
return (_measuredMinWidth);
}
public function createReferenceOnParentDocument(parentDocument:IFlexDisplayObject):void{
var indices:Array;
var r:Object;
var n:int;
var i:int;
var event:PropertyChangeEvent;
var s:Object;
if (((id) && (!((id == ""))))){
indices = _instanceIndices;
if (!indices){
parentDocument[id] = this;
} else {
r = parentDocument[id];
if (!(r is Array)){
r = (parentDocument[id] = []);
};
n = indices.length;
i = 0;
while (i < (n - 1)) {
s = r[indices[i]];
if (!(s is Array)){
s = (r[indices[i]] = []);
};
r = s;
i++;
};
r[indices[(n - 1)]] = this;
event = PropertyChangeEvent.createUpdateEvent(parentDocument, id, parentDocument[id], parentDocument[id]);
parentDocument.dispatchEvent(event);
};
};
}
public function get repeater():IRepeater{
return ((_repeaters) ? _repeaters[(_repeaters.length - 1)] : null);
}
public function set isPopUp(value:Boolean):void{
_isPopUp = value;
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
public function initialize():void{
if (initialized){
return;
};
dispatchEvent(new FlexEvent(FlexEvent.PREINITIALIZE));
createChildren();
childrenCreated();
initializeAccessibility();
initializationComplete();
}
override public function set width(value:Number):void{
var p:IInvalidating;
if (explicitWidth != value){
explicitWidth = value;
invalidateSize();
};
if (_width != value){
invalidateProperties();
invalidateDisplayList();
p = (parent as IInvalidating);
if (((p) && (includeInLayout))){
p.invalidateSize();
p.invalidateDisplayList();
};
_width = value;
dispatchEvent(new Event("widthChanged"));
};
}
public function set percentHeight(value:Number):void{
if (_percentHeight == value){
return;
};
if (!isNaN(value)){
_explicitHeight = NaN;
};
_percentHeight = value;
var p:IInvalidating = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
}
final mx_internal function set $visible(value:Boolean):void{
super.visible = value;
}
private function findCommonBaseState(state1:String, state2:String):String{
var firstState:State = getState(state1);
var secondState:State = getState(state2);
if (((!(firstState)) || (!(secondState)))){
return ("");
};
if (((isBaseState(firstState.basedOn)) && (isBaseState(secondState.basedOn)))){
return ("");
};
var firstBaseStates:Array = getBaseStates(firstState);
var secondBaseStates:Array = getBaseStates(secondState);
var commonBase:String = "";
while (firstBaseStates[(firstBaseStates.length - 1)] == secondBaseStates[(secondBaseStates.length - 1)]) {
commonBase = firstBaseStates.pop();
secondBaseStates.pop();
if (((!(firstBaseStates.length)) || (!(secondBaseStates.length)))){
break;
};
};
if (((firstBaseStates.length) && ((firstBaseStates[(firstBaseStates.length - 1)] == secondState.name)))){
commonBase = secondState.name;
} else {
if (((secondBaseStates.length) && ((secondBaseStates[(secondBaseStates.length - 1)] == firstState.name)))){
commonBase = firstState.name;
};
};
return (commonBase);
}
mx_internal function childRemoved(child:DisplayObject):void{
if ((child is IUIComponent)){
if (IUIComponent(child).document != child){
IUIComponent(child).document = null;
};
IUIComponent(child).parentChanged(null);
};
}
final mx_internal function $removeChildAt(index:int):DisplayObject{
return (super.removeChildAt(index));
}
public function get maxHeight():Number{
return ((isNaN(explicitMaxHeight)) ? DEFAULT_MAX_HEIGHT : explicitMaxHeight);
}
protected function initializeAccessibility():void{
if (UIComponent.createAccessibilityImplementation != null){
UIComponent.createAccessibilityImplementation(this);
};
}
public function set explicitMaxHeight(value:Number):void{
if (_explicitMaxHeight == value){
return;
};
_explicitMaxHeight = value;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
dispatchEvent(new Event("explicitMaxHeightChanged"));
}
public function get focusManager():IFocusManager{
if (_focusManager){
return (_focusManager);
};
var o:DisplayObject = parent;
while (o) {
if ((o is IFocusManagerContainer)){
return (IFocusManagerContainer(o).focusManager);
};
o = o.parent;
};
return (null);
}
public function set styleName(value:Object):void{
if (_styleName === value){
return;
};
_styleName = value;
if (inheritingStyles == UIComponent.STYLE_UNINITIALIZED){
return;
};
regenerateStyleCache(true);
initThemeColor();
styleChanged("styleName");
notifyStyleChangeInChildren("styleName", true);
}
public function get automationDelegate():Object{
return (_automationDelegate);
}
protected function get resourceManager():IResourceManager{
return (_resourceManager);
}
mx_internal function validateBaselinePosition():Boolean{
var w:Number;
var h:Number;
if (!parent){
return (false);
};
if ((((width == 0)) && ((height == 0)))){
validateNow();
w = getExplicitOrMeasuredWidth();
h = getExplicitOrMeasuredHeight();
setActualSize(w, h);
};
validateNow();
return (true);
}
mx_internal function cancelAllCallLaters():void{
var sm:ISystemManager = systemManager;
if (((sm) && (((sm.stage) || (sm.useSWFBridge()))))){
if (listeningForRender){
sm.removeEventListener(FlexEvent.RENDER, callLaterDispatcher);
sm.removeEventListener(FlexEvent.ENTER_FRAME, callLaterDispatcher);
listeningForRender = false;
};
};
methodQueue.splice(0);
}
private function updateCompleteHandler(event:FlexEvent):void{
UIComponentGlobals.layoutManager.removeEventListener(FlexEvent.UPDATE_COMPLETE, updateCompleteHandler);
processEffectFinished(_endingEffectInstances);
_endingEffectInstances = [];
}
public function styleChanged(styleProp:String):void{
if ((((this is IFontContextComponent)) && (hasFontContextChanged()))){
invalidateProperties();
};
if (((((!(styleProp)) || ((styleProp == "styleName")))) || (StyleManager.isSizeInvalidatingStyle(styleProp)))){
invalidateSize();
};
if (((((!(styleProp)) || ((styleProp == "styleName")))) || ((styleProp == "themeColor")))){
initThemeColor();
};
invalidateDisplayList();
if ((parent is IInvalidating)){
if (StyleManager.isParentSizeInvalidatingStyle(styleProp)){
IInvalidating(parent).invalidateSize();
};
if (StyleManager.isParentDisplayListInvalidatingStyle(styleProp)){
IInvalidating(parent).invalidateDisplayList();
};
};
}
final mx_internal function get $visible():Boolean{
return (super.visible);
}
public function drawRoundRect(x:Number, y:Number, w:Number, h:Number, r:Object=null, c:Object=null, alpha:Object=null, rot:Object=null, gradient:String=null, ratios:Array=null, hole:Object=null):void{
var ellipseSize:Number;
var alphas:Array;
var matrix:Matrix;
var holeR:Object;
var g:Graphics = graphics;
if (((!(w)) || (!(h)))){
return;
};
if (c !== null){
if ((c is Array)){
if ((alpha is Array)){
alphas = (alpha as Array);
} else {
alphas = [alpha, alpha];
};
if (!ratios){
ratios = [0, 0xFF];
};
matrix = null;
if (rot){
if ((rot is Matrix)){
matrix = Matrix(rot);
} else {
matrix = new Matrix();
if ((rot is Number)){
matrix.createGradientBox(w, h, ((Number(rot) * Math.PI) / 180), x, y);
} else {
matrix.createGradientBox(rot.w, rot.h, rot.r, rot.x, rot.y);
};
};
};
if (gradient == GradientType.RADIAL){
g.beginGradientFill(GradientType.RADIAL, (c as Array), alphas, ratios, matrix);
} else {
g.beginGradientFill(GradientType.LINEAR, (c as Array), alphas, ratios, matrix);
};
} else {
g.beginFill(Number(c), Number(alpha));
};
};
if (!r){
g.drawRect(x, y, w, h);
} else {
if ((r is Number)){
ellipseSize = (Number(r) * 2);
g.drawRoundRect(x, y, w, h, ellipseSize, ellipseSize);
} else {
GraphicsUtil.drawRoundRectComplex(g, x, y, w, h, r.tl, r.tr, r.bl, r.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 (c !== null){
g.endFill();
};
}
public function move(x:Number, y:Number):void{
var changed:Boolean;
if (x != super.x){
super.x = x;
dispatchEvent(new Event("xChanged"));
changed = true;
};
if (y != super.y){
super.y = y;
dispatchEvent(new Event("yChanged"));
changed = true;
};
if (changed){
dispatchMoveEvent();
};
}
public function set toolTip(value:String):void{
var oldValue:String = _toolTip;
_toolTip = value;
ToolTipManager.registerToolTip(this, oldValue, value);
dispatchEvent(new Event("toolTipChanged"));
}
public function set repeaters(value:Array):void{
_repeaters = value;
}
public function get explicitMaxHeight():Number{
return (_explicitMaxHeight);
}
public function measureText(text:String):TextLineMetrics{
return (determineTextFormatFromStyles().measureText(text));
}
public function get styleName():Object{
return (_styleName);
}
protected function createInModuleContext(moduleFactory:IFlexModuleFactory, className:String):Object{
var newObject:Object;
if (moduleFactory){
newObject = moduleFactory.create(className);
};
return (newObject);
}
public function get parentDocument():Object{
var p:IUIComponent;
var sm:ISystemManager;
if (document == this){
p = (parent as IUIComponent);
if (p){
return (p.document);
};
sm = (parent as ISystemManager);
if (sm){
return (sm.document);
};
return (null);
//unresolved jump
};
return (document);
}
protected function childrenCreated():void{
invalidateProperties();
invalidateSize();
invalidateDisplayList();
}
public function set flexContextMenu(value:IFlexContextMenu):void{
if (_flexContextMenu){
_flexContextMenu.unsetContextMenu(this);
};
_flexContextMenu = value;
if (value != null){
_flexContextMenu.setContextMenu(this);
};
}
public function set explicitWidth(value:Number):void{
if (_explicitWidth == value){
return;
};
if (!isNaN(value)){
_percentWidth = NaN;
};
_explicitWidth = value;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (((p) && (includeInLayout))){
p.invalidateSize();
p.invalidateDisplayList();
};
dispatchEvent(new Event("explicitWidthChanged"));
}
private function setBorderColorForErrorString():void{
if (((!(_errorString)) || ((_errorString.length == 0)))){
if (!isNaN(origBorderColor)){
setStyle("borderColor", origBorderColor);
saveBorderColor = true;
};
} else {
if (saveBorderColor){
saveBorderColor = false;
origBorderColor = getStyle("borderColor");
};
setStyle("borderColor", getStyle("errorColor"));
};
styleChanged("themeColor");
var focusManager:IFocusManager = focusManager;
var focusObj:DisplayObject = (focusManager) ? DisplayObject(focusManager.getFocus()) : null;
if (((((focusManager) && (focusManager.showFocusIndicator))) && ((focusObj == this)))){
drawFocus(true);
};
}
public function get explicitWidth():Number{
return (_explicitWidth);
}
public function invalidateSize():void{
if (!invalidateSizeFlag){
invalidateSizeFlag = true;
if (((parent) && (UIComponentGlobals.layoutManager))){
UIComponentGlobals.layoutManager.invalidateSize(this);
};
};
}
public function set measuredMinHeight(value:Number):void{
_measuredMinHeight = value;
}
protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
}
override public function set filters(value:Array):void{
var n:int;
var i:int;
var e:IEventDispatcher;
if (_filters){
n = _filters.length;
i = 0;
while (i < n) {
e = (_filters[i] as IEventDispatcher);
if (e){
e.removeEventListener("change", filterChangeHandler);
};
i++;
};
};
_filters = value;
if (_filters){
n = _filters.length;
i = 0;
while (i < n) {
e = (_filters[i] as IEventDispatcher);
if (e){
e.addEventListener("change", filterChangeHandler);
};
i++;
};
};
super.filters = _filters;
}
private static function get embeddedFontRegistry():IEmbeddedFontRegistry{
if (!_embeddedFontRegistry){
_embeddedFontRegistry = IEmbeddedFontRegistry(Singleton.getInstance("mx.core::IEmbeddedFontRegistry"));
};
return (_embeddedFontRegistry);
}
public static function resumeBackgroundProcessing():void{
var sm:ISystemManager;
if (UIComponentGlobals.callLaterSuspendCount > 0){
UIComponentGlobals.callLaterSuspendCount--;
if (UIComponentGlobals.callLaterSuspendCount == 0){
sm = SystemManagerGlobals.topLevelSystemManagers[0];
if (((sm) && (sm.stage))){
sm.stage.invalidate();
};
};
};
}
public static function suspendBackgroundProcessing():void{
UIComponentGlobals.callLaterSuspendCount++;
}
}
}//package mx.core
class MethodQueueElement {
public var method:Function;
public var args:Array;
private function MethodQueueElement(method:Function, args:Array=null){
super();
this.method = method;
this.args = args;
}
}
Section 169
//UIComponentCachePolicy (mx.core.UIComponentCachePolicy)
package mx.core {
public final class UIComponentCachePolicy {
public static const AUTO:String = "auto";
public static const ON:String = "on";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const OFF:String = "off";
public function UIComponentCachePolicy(){
super();
}
}
}//package mx.core
Section 170
//UIComponentDescriptor (mx.core.UIComponentDescriptor)
package mx.core {
public class UIComponentDescriptor extends ComponentDescriptor {
mx_internal var instanceIndices:Array;
public var stylesFactory:Function;
public var effects:Array;
mx_internal var repeaters:Array;
mx_internal var repeaterIndices:Array;
mx_internal static const VERSION:String = "3.2.0.3958";
public function UIComponentDescriptor(descriptorProperties:Object){
super(descriptorProperties);
}
override public function toString():String{
return (("UIComponentDescriptor_" + id));
}
}
}//package mx.core
Section 171
//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 172
//UITextField (mx.core.UITextField)
package mx.core {
import flash.display.*;
import mx.managers.*;
import flash.text.*;
import flash.events.*;
import mx.styles.*;
import mx.resources.*;
import mx.automation.*;
import flash.utils.*;
import mx.utils.*;
public class UITextField extends FlexTextField implements IAutomationObject, IIMESupport, IFlexModule, IInvalidating, ISimpleStyleClient, IToolTipManagerClient, IUITextField {
private var _enabled:Boolean;// = true
private var untruncatedText:String;
private var cachedEmbeddedFont:EmbeddedFont;// = null
private var cachedTextFormat:TextFormat;
private var _automationDelegate:IAutomationObject;
private var _automationName:String;
private var _styleName:Object;
private var _document:Object;
mx_internal var _toolTip:String;
private var _nestLevel:int;// = 0
private var _explicitHeight:Number;
private var _moduleFactory:IFlexModuleFactory;
private var _initialized:Boolean;// = false
private var _nonInheritingStyles:Object;
private var _inheritingStyles:Object;
private var _includeInLayout:Boolean;// = true
private var invalidateDisplayListFlag:Boolean;// = true
mx_internal var explicitColor:uint;// = 4294967295
private var _processedDescriptors:Boolean;// = true
private var _updateCompletePendingFlag:Boolean;// = false
private var explicitHTMLText:String;// = null
mx_internal var _parent:DisplayObjectContainer;
private var _imeMode:String;// = null
private var resourceManager:IResourceManager;
mx_internal var styleChangedFlag:Boolean;// = true
private var _ignorePadding:Boolean;// = true
private var _owner:DisplayObjectContainer;
private var _explicitWidth:Number;
mx_internal static const TEXT_WIDTH_PADDING:int = 5;
mx_internal static const TEXT_HEIGHT_PADDING:int = 4;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var truncationIndicatorResource:String;
private static var _embeddedFontRegistry:IEmbeddedFontRegistry;
mx_internal static var debuggingBorders:Boolean = false;
public function UITextField(){
resourceManager = ResourceManager.getInstance();
_inheritingStyles = UIComponent.STYLE_UNINITIALIZED;
_nonInheritingStyles = UIComponent.STYLE_UNINITIALIZED;
super();
super.text = "";
focusRect = false;
selectable = false;
tabEnabled = false;
if (debuggingBorders){
border = true;
};
if (!truncationIndicatorResource){
truncationIndicatorResource = resourceManager.getString("core", "truncationIndicator");
};
addEventListener(Event.CHANGE, changeHandler);
addEventListener("textFieldStyleChange", textFieldStyleChangeHandler);
resourceManager.addEventListener(Event.CHANGE, resourceManager_changeHandler, false, 0, true);
}
public function set imeMode(value:String):void{
_imeMode = value;
}
public function get nestLevel():int{
return (_nestLevel);
}
private function textFieldStyleChangeHandler(event:Event):void{
if (explicitHTMLText != null){
super.htmlText = explicitHTMLText;
};
}
public function truncateToFit(truncationIndicator:String=null):Boolean{
var s:String;
if (!truncationIndicator){
truncationIndicator = truncationIndicatorResource;
};
validateNow();
var originalText:String = super.text;
untruncatedText = originalText;
var w:Number = width;
if (((!((originalText == ""))) && (((textWidth + TEXT_WIDTH_PADDING) > (w + 1E-14))))){
var _local5 = originalText;
super.text = _local5;
s = _local5;
originalText.slice(0, Math.floor(((w / (textWidth + TEXT_WIDTH_PADDING)) * originalText.length)));
while ((((s.length > 1)) && (((textWidth + TEXT_WIDTH_PADDING) > w)))) {
s = s.slice(0, -1);
super.text = (s + truncationIndicator);
};
return (true);
};
return (false);
}
public function set nestLevel(value:int):void{
if ((((value > 1)) && (!((_nestLevel == value))))){
_nestLevel = value;
StyleProtoChain.initTextField(this);
styleChangedFlag = true;
validateNow();
};
}
public function get minHeight():Number{
return (0);
}
public function getExplicitOrMeasuredHeight():Number{
return ((isNaN(explicitHeight)) ? measuredHeight : explicitHeight);
}
public function getStyle(styleProp:String){
if (StyleManager.inheritingStyles[styleProp]){
return ((inheritingStyles) ? inheritingStyles[styleProp] : IStyleClient(parent).getStyle(styleProp));
//unresolved jump
};
return ((nonInheritingStyles) ? nonInheritingStyles[styleProp] : IStyleClient(parent).getStyle(styleProp));
}
public function get className():String{
var name:String = getQualifiedClassName(this);
var index:int = name.indexOf("::");
if (index != -1){
name = name.substr((index + 2));
};
return (name);
}
public function setColor(color:uint):void{
explicitColor = color;
styleChangedFlag = true;
invalidateDisplayListFlag = true;
validateNow();
}
override public function replaceText(beginIndex:int, endIndex:int, newText:String):void{
super.replaceText(beginIndex, endIndex, newText);
dispatchEvent(new Event("textReplace"));
}
private function creatingSystemManager():ISystemManager{
return ((((!((moduleFactory == null))) && ((moduleFactory is ISystemManager)))) ? ISystemManager(moduleFactory) : systemManager);
}
public function set document(value:Object):void{
_document = value;
}
public function get automationName():String{
if (_automationName){
return (_automationName);
};
if (automationDelegate){
return (automationDelegate.automationName);
};
return ("");
}
public function get explicitMinHeight():Number{
return (NaN);
}
public function get focusPane():Sprite{
return (null);
}
public function getTextStyles():TextFormat{
var textFormat:TextFormat = new TextFormat();
textFormat.align = getStyle("textAlign");
textFormat.bold = (getStyle("fontWeight") == "bold");
if (enabled){
if (explicitColor == StyleManager.NOT_A_COLOR){
textFormat.color = getStyle("color");
} else {
textFormat.color = explicitColor;
};
} else {
textFormat.color = getStyle("disabledColor");
};
textFormat.font = StringUtil.trimArrayElements(getStyle("fontFamily"), ",");
textFormat.indent = getStyle("textIndent");
textFormat.italic = (getStyle("fontStyle") == "italic");
textFormat.kerning = getStyle("kerning");
textFormat.leading = getStyle("leading");
textFormat.leftMargin = (ignorePadding) ? 0 : getStyle("paddingLeft");
textFormat.letterSpacing = getStyle("letterSpacing");
textFormat.rightMargin = (ignorePadding) ? 0 : getStyle("paddingRight");
textFormat.size = getStyle("fontSize");
textFormat.underline = (getStyle("textDecoration") == "underline");
cachedTextFormat = textFormat;
return (textFormat);
}
override public function set text(value:String):void{
if (!value){
value = "";
};
if (((!(isHTML)) && ((super.text == value)))){
return;
};
super.text = value;
explicitHTMLText = null;
if (invalidateDisplayListFlag){
validateNow();
};
}
public function getExplicitOrMeasuredWidth():Number{
return ((isNaN(explicitWidth)) ? measuredWidth : explicitWidth);
}
public function get showInAutomationHierarchy():Boolean{
return (true);
}
public function set automationName(value:String):void{
_automationName = value;
}
public function get systemManager():ISystemManager{
var ui:IUIComponent;
var o:DisplayObject = parent;
while (o) {
ui = (o as IUIComponent);
if (ui){
return (ui.systemManager);
};
o = o.parent;
};
return (null);
}
public function setStyle(styleProp:String, value):void{
}
public function get percentWidth():Number{
return (NaN);
}
public function get explicitHeight():Number{
return (_explicitHeight);
}
public function get baselinePosition():Number{
var tlm:TextLineMetrics;
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
tlm = getLineMetrics(0);
return (((height - 4) - tlm.descent));
};
if (!parent){
return (NaN);
};
var isEmpty = (text == "");
if (isEmpty){
super.text = "Wj";
};
tlm = getLineMetrics(0);
if (isEmpty){
super.text = "";
};
return ((2 + tlm.ascent));
}
public function set enabled(value:Boolean):void{
mouseEnabled = value;
_enabled = value;
styleChanged("color");
}
public function get minWidth():Number{
return (0);
}
public function get automationValue():Array{
if (automationDelegate){
return (automationDelegate.automationValue);
};
return ([""]);
}
public function get tweeningProperties():Array{
return (null);
}
public function get measuredWidth():Number{
validateNow();
if (!stage){
return ((textWidth + TEXT_WIDTH_PADDING));
};
return (((textWidth * transform.concatenatedMatrix.d) + TEXT_WIDTH_PADDING));
}
public function set tweeningProperties(value:Array):void{
}
public function createAutomationIDPart(child:IAutomationObject):Object{
return (null);
}
override public function get parent():DisplayObjectContainer{
return ((_parent) ? _parent : super.parent);
}
public function set updateCompletePendingFlag(value:Boolean):void{
_updateCompletePendingFlag = value;
}
public function setActualSize(w:Number, h:Number):void{
if (width != w){
width = w;
};
if (height != h){
height = h;
};
}
public function get numAutomationChildren():int{
return (0);
}
public function set focusPane(value:Sprite):void{
}
public function getAutomationChildAt(index:int):IAutomationObject{
return (null);
}
public function get inheritingStyles():Object{
return (_inheritingStyles);
}
public function get owner():DisplayObjectContainer{
return ((_owner) ? _owner : parent);
}
public function parentChanged(p:DisplayObjectContainer):void{
if (!p){
_parent = null;
_nestLevel = 0;
} else {
if ((p is IStyleClient)){
_parent = p;
} else {
if ((p is SystemManager)){
_parent = p;
} else {
_parent = p.parent;
};
};
};
}
public function get processedDescriptors():Boolean{
return (_processedDescriptors);
}
public function get maxWidth():Number{
return (UIComponent.DEFAULT_MAX_WIDTH);
}
private function getEmbeddedFont(fontName:String, bold:Boolean, italic:Boolean):EmbeddedFont{
if (cachedEmbeddedFont){
if ((((cachedEmbeddedFont.fontName == fontName)) && ((cachedEmbeddedFont.fontStyle == EmbeddedFontRegistry.getFontStyle(bold, italic))))){
return (cachedEmbeddedFont);
};
};
cachedEmbeddedFont = new EmbeddedFont(fontName, bold, italic);
return (cachedEmbeddedFont);
}
public function get initialized():Boolean{
return (_initialized);
}
public function invalidateDisplayList():void{
invalidateDisplayListFlag = true;
}
public function invalidateProperties():void{
}
override public function insertXMLText(beginIndex:int, endIndex:int, richText:String, pasting:Boolean=false):void{
super.insertXMLText(beginIndex, endIndex, richText, pasting);
dispatchEvent(new Event("textInsert"));
}
public function set includeInLayout(value:Boolean):void{
var p:IInvalidating;
if (_includeInLayout != value){
_includeInLayout = value;
p = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
};
}
override public function set htmlText(value:String):void{
if (!value){
value = "";
};
if (((isHTML) && ((super.htmlText == value)))){
return;
};
if (((cachedTextFormat) && ((styleSheet == null)))){
defaultTextFormat = cachedTextFormat;
};
super.htmlText = value;
explicitHTMLText = value;
if (invalidateDisplayListFlag){
validateNow();
};
}
public function set showInAutomationHierarchy(value:Boolean):void{
}
private function resourceManager_changeHandler(event:Event):void{
truncationIndicatorResource = resourceManager.getString("core", "truncationIndicator");
if (untruncatedText != null){
super.text = untruncatedText;
truncateToFit();
};
}
public function set measuredMinWidth(value:Number):void{
}
public function set explicitHeight(value:Number):void{
_explicitHeight = value;
}
public function get explicitMinWidth():Number{
return (NaN);
}
public function set percentWidth(value:Number):void{
}
public function get imeMode():String{
return (_imeMode);
}
public function get moduleFactory():IFlexModuleFactory{
return (_moduleFactory);
}
public function set systemManager(value:ISystemManager):void{
}
public function get explicitMaxWidth():Number{
return (NaN);
}
public function get document():Object{
return (_document);
}
public function get updateCompletePendingFlag():Boolean{
return (_updateCompletePendingFlag);
}
public function replayAutomatableEvent(event:Event):Boolean{
if (automationDelegate){
return (automationDelegate.replayAutomatableEvent(event));
};
return (false);
}
public function get enabled():Boolean{
return (_enabled);
}
public function set owner(value:DisplayObjectContainer):void{
_owner = value;
}
public function get automationTabularData():Object{
return (null);
}
public function set nonInheritingStyles(value:Object):void{
_nonInheritingStyles = value;
}
public function get includeInLayout():Boolean{
return (_includeInLayout);
}
public function get measuredMinWidth():Number{
return (0);
}
public function set isPopUp(value:Boolean):void{
}
public function set automationDelegate(value:Object):void{
_automationDelegate = (value as IAutomationObject);
}
public function get measuredHeight():Number{
validateNow();
if (!stage){
return ((textHeight + TEXT_HEIGHT_PADDING));
};
return (((textHeight * transform.concatenatedMatrix.a) + TEXT_HEIGHT_PADDING));
}
public function set processedDescriptors(value:Boolean):void{
_processedDescriptors = value;
}
public function setFocus():void{
systemManager.stage.focus = this;
}
public function initialize():void{
}
public function set percentHeight(value:Number):void{
}
public function resolveAutomationIDPart(criteria:Object):Array{
return ([]);
}
public function set inheritingStyles(value:Object):void{
_inheritingStyles = value;
}
public function getUITextFormat():UITextFormat{
validateNow();
var textFormat:UITextFormat = new UITextFormat(creatingSystemManager());
textFormat.moduleFactory = moduleFactory;
textFormat.copyFrom(getTextFormat());
textFormat.antiAliasType = antiAliasType;
textFormat.gridFitType = gridFitType;
textFormat.sharpness = sharpness;
textFormat.thickness = thickness;
return (textFormat);
}
private function changeHandler(event:Event):void{
explicitHTMLText = null;
}
public function set initialized(value:Boolean):void{
_initialized = value;
}
public function get nonZeroTextHeight():Number{
var result:Number;
if (super.text == ""){
super.text = "Wj";
result = textHeight;
super.text = "";
return (result);
};
return (textHeight);
}
public function owns(child:DisplayObject):Boolean{
return ((child == this));
}
override public function setTextFormat(format:TextFormat, beginIndex:int=-1, endIndex:int=-1):void{
if (styleSheet){
return;
};
super.setTextFormat(format, beginIndex, endIndex);
dispatchEvent(new Event("textFormatChange"));
}
public function get nonInheritingStyles():Object{
return (_nonInheritingStyles);
}
public function setVisible(visible:Boolean, noEvent:Boolean=false):void{
this.visible = visible;
}
public function get maxHeight():Number{
return (UIComponent.DEFAULT_MAX_HEIGHT);
}
public function get automationDelegate():Object{
return (_automationDelegate);
}
public function get isPopUp():Boolean{
return (false);
}
public function set ignorePadding(value:Boolean):void{
_ignorePadding = value;
styleChanged(null);
}
public function set styleName(value:Object):void{
if (_styleName === value){
return;
};
_styleName = value;
if (parent){
StyleProtoChain.initTextField(this);
styleChanged("styleName");
};
}
public function styleChanged(styleProp:String):void{
styleChangedFlag = true;
if (!invalidateDisplayListFlag){
invalidateDisplayListFlag = true;
if (("callLater" in parent)){
Object(parent).callLater(validateNow);
};
};
}
public function get percentHeight():Number{
return (NaN);
}
private function get isHTML():Boolean{
return (!((explicitHTMLText == null)));
}
public function get explicitMaxHeight():Number{
return (NaN);
}
public function get styleName():Object{
return (_styleName);
}
public function set explicitWidth(value:Number):void{
_explicitWidth = value;
}
public function validateNow():void{
var textFormat:TextFormat;
var embeddedFont:EmbeddedFont;
var fontModuleFactory:IFlexModuleFactory;
var sm:ISystemManager;
if (!parent){
return;
};
if (((!(isNaN(explicitWidth))) && (!((super.width == explicitWidth))))){
super.width = ((explicitWidth)>4) ? explicitWidth : 4;
};
if (((!(isNaN(explicitHeight))) && (!((super.height == explicitHeight))))){
super.height = explicitHeight;
};
if (styleChangedFlag){
textFormat = getTextStyles();
if (textFormat.font){
embeddedFont = getEmbeddedFont(textFormat.font, textFormat.bold, textFormat.italic);
fontModuleFactory = embeddedFontRegistry.getAssociatedModuleFactory(embeddedFont, moduleFactory);
if (fontModuleFactory != null){
embedFonts = true;
} else {
sm = creatingSystemManager();
embedFonts = ((!((sm == null))) && (sm.isFontFaceEmbedded(textFormat)));
};
} else {
embedFonts = getStyle("embedFonts");
};
if (getStyle("fontAntiAliasType") != undefined){
antiAliasType = getStyle("fontAntiAliasType");
gridFitType = getStyle("fontGridFitType");
sharpness = getStyle("fontSharpness");
thickness = getStyle("fontThickness");
};
if (!styleSheet){
super.setTextFormat(textFormat);
defaultTextFormat = textFormat;
};
dispatchEvent(new Event("textFieldStyleChange"));
};
styleChangedFlag = false;
invalidateDisplayListFlag = false;
}
public function set toolTip(value:String):void{
var oldValue:String = _toolTip;
_toolTip = value;
ToolTipManager.registerToolTip(this, oldValue, value);
}
public function move(x:Number, y:Number):void{
if (this.x != x){
this.x = x;
};
if (this.y != y){
this.y = y;
};
}
public function get toolTip():String{
return (_toolTip);
}
public function get ignorePadding():Boolean{
return (_ignorePadding);
}
public function get explicitWidth():Number{
return (_explicitWidth);
}
public function invalidateSize():void{
invalidateDisplayListFlag = true;
}
public function set measuredMinHeight(value:Number):void{
}
public function get measuredMinHeight():Number{
return (0);
}
public function set moduleFactory(factory:IFlexModuleFactory):void{
_moduleFactory = factory;
}
private static function get embeddedFontRegistry():IEmbeddedFontRegistry{
if (!_embeddedFontRegistry){
_embeddedFontRegistry = IEmbeddedFontRegistry(Singleton.getInstance("mx.core::IEmbeddedFontRegistry"));
};
return (_embeddedFontRegistry);
}
}
}//package mx.core
Section 173
//UITextFormat (mx.core.UITextFormat)
package mx.core {
import mx.managers.*;
import flash.text.*;
public class UITextFormat extends TextFormat {
private var systemManager:ISystemManager;
public var sharpness:Number;
public var gridFitType:String;
public var antiAliasType:String;
public var thickness:Number;
private var cachedEmbeddedFont:EmbeddedFont;// = null
private var _moduleFactory:IFlexModuleFactory;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var _embeddedFontRegistry:IEmbeddedFontRegistry;
private static var _textFieldFactory:ITextFieldFactory;
public function UITextFormat(systemManager:ISystemManager, font:String=null, size:Object=null, color:Object=null, bold:Object=null, italic:Object=null, underline:Object=null, url:String=null, target:String=null, align:String=null, leftMargin:Object=null, rightMargin:Object=null, indent:Object=null, leading:Object=null){
this.systemManager = systemManager;
super(font, size, color, bold, italic, underline, url, target, align, leftMargin, rightMargin, indent, leading);
}
public function set moduleFactory(value:IFlexModuleFactory):void{
_moduleFactory = value;
}
mx_internal function copyFrom(source:TextFormat):void{
font = source.font;
size = source.size;
color = source.color;
bold = source.bold;
italic = source.italic;
underline = source.underline;
url = source.url;
target = source.target;
align = source.align;
leftMargin = source.leftMargin;
rightMargin = source.rightMargin;
indent = source.indent;
leading = source.leading;
letterSpacing = source.letterSpacing;
blockIndent = source.blockIndent;
bullet = source.bullet;
display = source.display;
indent = source.indent;
kerning = source.kerning;
tabStops = source.tabStops;
}
private function getEmbeddedFont(fontName:String, bold:Boolean, italic:Boolean):EmbeddedFont{
if (cachedEmbeddedFont){
if ((((cachedEmbeddedFont.fontName == fontName)) && ((cachedEmbeddedFont.fontStyle == EmbeddedFontRegistry.getFontStyle(bold, italic))))){
return (cachedEmbeddedFont);
};
};
cachedEmbeddedFont = new EmbeddedFont(fontName, bold, italic);
return (cachedEmbeddedFont);
}
public function measureText(text:String, roundUp:Boolean=true):TextLineMetrics{
return (measure(text, false, roundUp));
}
private function measure(s:String, html:Boolean, roundUp:Boolean):TextLineMetrics{
if (!s){
s = "";
};
var embeddedFont:Boolean;
var fontModuleFactory:IFlexModuleFactory = embeddedFontRegistry.getAssociatedModuleFactory(getEmbeddedFont(font, bold, italic), moduleFactory);
embeddedFont = !((fontModuleFactory == null));
if (fontModuleFactory == null){
fontModuleFactory = systemManager;
};
var measurementTextField:TextField;
measurementTextField = TextField(textFieldFactory.createTextField(fontModuleFactory));
if (html){
measurementTextField.htmlText = "";
} else {
measurementTextField.text = "";
};
measurementTextField.defaultTextFormat = this;
if (font){
measurementTextField.embedFonts = ((embeddedFont) || (((!((systemManager == null))) && (systemManager.isFontFaceEmbedded(this)))));
} else {
measurementTextField.embedFonts = false;
};
measurementTextField.antiAliasType = antiAliasType;
measurementTextField.gridFitType = gridFitType;
measurementTextField.sharpness = sharpness;
measurementTextField.thickness = thickness;
if (html){
measurementTextField.htmlText = s;
} else {
measurementTextField.text = s;
};
var lineMetrics:TextLineMetrics = measurementTextField.getLineMetrics(0);
if (indent != null){
lineMetrics.width = (lineMetrics.width + indent);
};
if (roundUp){
lineMetrics.width = Math.ceil(lineMetrics.width);
lineMetrics.height = Math.ceil(lineMetrics.height);
};
return (lineMetrics);
}
public function measureHTMLText(htmlText:String, roundUp:Boolean=true):TextLineMetrics{
return (measure(htmlText, true, roundUp));
}
public function get moduleFactory():IFlexModuleFactory{
return (_moduleFactory);
}
private static function get embeddedFontRegistry():IEmbeddedFontRegistry{
if (!_embeddedFontRegistry){
_embeddedFontRegistry = IEmbeddedFontRegistry(Singleton.getInstance("mx.core::IEmbeddedFontRegistry"));
};
return (_embeddedFontRegistry);
}
private static function get textFieldFactory():ITextFieldFactory{
if (!_textFieldFactory){
_textFieldFactory = ITextFieldFactory(Singleton.getInstance("mx.core::ITextFieldFactory"));
};
return (_textFieldFactory);
}
}
}//package mx.core
Section 174
//AddRemoveEffectTargetFilter (mx.effects.effectClasses.AddRemoveEffectTargetFilter)
package mx.effects.effectClasses {
import mx.core.*;
import mx.effects.*;
public class AddRemoveEffectTargetFilter extends EffectTargetFilter {
public var add:Boolean;// = true
mx_internal static const VERSION:String = "3.2.0.3958";
public function AddRemoveEffectTargetFilter(){
super();
filterProperties = ["parent"];
}
override protected function defaultFilterFunction(propChanges:Array, instanceTarget:Object):Boolean{
var props:PropertyChanges;
var n:int = propChanges.length;
var i:int;
while (i < n) {
props = propChanges[i];
if (props.target == instanceTarget){
if (add){
return ((((props.start["parent"] == null)) && (!((props.end["parent"] == null)))));
};
return (((!((props.start["parent"] == null))) && ((props.end["parent"] == null))));
};
i++;
};
return (false);
}
}
}//package mx.effects.effectClasses
Section 175
//BlurInstance (mx.effects.effectClasses.BlurInstance)
package mx.effects.effectClasses {
import flash.events.*;
import flash.filters.*;
public class BlurInstance extends TweenEffectInstance {
public var blurXTo:Number;
public var blurYTo:Number;
public var blurXFrom:Number;
public var blurYFrom:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
public function BlurInstance(target:Object){
super(target);
}
override public function initEffect(event:Event):void{
super.initEffect(event);
}
override public function onTweenEnd(value:Object):void{
setBlurFilter(value[0], value[1]);
super.onTweenEnd(value);
}
private function setBlurFilter(blurX:Number, blurY:Number):void{
var filters:Array = target.filters;
var n:int = filters.length;
var i:int;
while (i < n) {
if ((filters[i] is BlurFilter)){
filters.splice(i, 1);
};
i++;
};
if (((blurX) || (blurY))){
filters.push(new BlurFilter(blurX, blurY));
};
target.filters = filters;
}
override public function play():void{
super.play();
if (isNaN(blurXFrom)){
blurXFrom = 4;
};
if (isNaN(blurXTo)){
blurXTo = 0;
};
if (isNaN(blurYFrom)){
blurYFrom = 4;
};
if (isNaN(blurYTo)){
blurYTo = 0;
};
tween = createTween(this, [blurXFrom, blurYFrom], [blurXTo, blurYTo], duration);
}
override public function onTweenUpdate(value:Object):void{
setBlurFilter(value[0], value[1]);
}
}
}//package mx.effects.effectClasses
Section 176
//FadeInstance (mx.effects.effectClasses.FadeInstance)
package mx.effects.effectClasses {
import mx.core.*;
import flash.events.*;
import mx.events.*;
public class FadeInstance extends TweenEffectInstance {
public var alphaFrom:Number;
private var restoreAlpha:Boolean;
public var alphaTo:Number;
private var origAlpha:Number;// = NAN
mx_internal static const VERSION:String = "3.2.0.3958";
public function FadeInstance(target:Object){
super(target);
}
override public function initEffect(event:Event):void{
super.initEffect(event);
switch (event.type){
case "childrenCreationComplete":
case FlexEvent.CREATION_COMPLETE:
case FlexEvent.SHOW:
case Event.ADDED:
case "resizeEnd":
if (isNaN(alphaFrom)){
alphaFrom = 0;
};
if (isNaN(alphaTo)){
alphaTo = target.alpha;
};
break;
case FlexEvent.HIDE:
case Event.REMOVED:
case "resizeStart":
restoreAlpha = true;
if (isNaN(alphaFrom)){
alphaFrom = target.alpha;
};
if (isNaN(alphaTo)){
alphaTo = 0;
};
break;
};
}
override public function onTweenEnd(value:Object):void{
super.onTweenEnd(value);
if (((mx_internal::hideOnEffectEnd) || (restoreAlpha))){
target.alpha = origAlpha;
};
}
override public function play():void{
super.play();
origAlpha = target.alpha;
var values:PropertyChanges = propertyChanges;
if (((isNaN(alphaFrom)) && (isNaN(alphaTo)))){
if (((values) && (!((values.end["alpha"] === undefined))))){
alphaFrom = origAlpha;
alphaTo = values.end["alpha"];
} else {
if (((values) && (!((values.end["visible"] === undefined))))){
alphaFrom = (values.start["visible"]) ? origAlpha : 0;
alphaTo = (values.end["visible"]) ? origAlpha : 0;
} else {
alphaFrom = 0;
alphaTo = origAlpha;
};
};
} else {
if (isNaN(alphaFrom)){
alphaFrom = ((alphaTo)==0) ? origAlpha : 0;
} else {
if (isNaN(alphaTo)){
if (((values) && (!((values.end["alpha"] === undefined))))){
alphaTo = values.end["alpha"];
} else {
alphaTo = ((alphaFrom)==0) ? origAlpha : 0;
};
};
};
};
tween = createTween(this, alphaFrom, alphaTo, duration);
target.alpha = tween.mx_internal::getCurrentValue(0);
}
override public function onTweenUpdate(value:Object):void{
target.alpha = value;
}
}
}//package mx.effects.effectClasses
Section 177
//HideShowEffectTargetFilter (mx.effects.effectClasses.HideShowEffectTargetFilter)
package mx.effects.effectClasses {
import mx.core.*;
import mx.effects.*;
public class HideShowEffectTargetFilter extends EffectTargetFilter {
public var show:Boolean;// = true
mx_internal static const VERSION:String = "3.2.0.3958";
public function HideShowEffectTargetFilter(){
super();
filterProperties = ["visible"];
}
override protected function defaultFilterFunction(propChanges:Array, instanceTarget:Object):Boolean{
var props:PropertyChanges;
var n:int = propChanges.length;
var i:int;
while (i < n) {
props = propChanges[i];
if (props.target == instanceTarget){
return ((props.end["visible"] == show));
};
i++;
};
return (false);
}
}
}//package mx.effects.effectClasses
Section 178
//PropertyChanges (mx.effects.effectClasses.PropertyChanges)
package mx.effects.effectClasses {
import mx.core.*;
public class PropertyChanges {
public var target:Object;
public var start:Object;
public var end:Object;
mx_internal static const VERSION:String = "3.2.0.3958";
public function PropertyChanges(target:Object){
end = {};
start = {};
super();
this.target = target;
}
}
}//package mx.effects.effectClasses
Section 179
//TweenEffectInstance (mx.effects.effectClasses.TweenEffectInstance)
package mx.effects.effectClasses {
import mx.core.*;
import mx.events.*;
import mx.effects.*;
public class TweenEffectInstance extends EffectInstance {
private var _seekTime:Number;// = 0
public var easingFunction:Function;
public var tween:Tween;
mx_internal var needToLayout:Boolean;// = false
mx_internal static const VERSION:String = "3.2.0.3958";
public function TweenEffectInstance(target:Object){
super(target);
}
override public function stop():void{
super.stop();
if (tween){
tween.stop();
};
}
mx_internal function applyTweenStartValues():void{
if (duration > 0){
onTweenUpdate(tween.getCurrentValue(0));
};
}
override public function get playheadTime():Number{
if (tween){
return ((tween.playheadTime + super.playheadTime));
};
return (0);
}
protected function createTween(listener:Object, startValue:Object, endValue:Object, duration:Number=-1, minFps:Number=-1):Tween{
var newTween:Tween = new Tween(listener, startValue, endValue, duration, minFps);
newTween.addEventListener(TweenEvent.TWEEN_START, tweenEventHandler);
newTween.addEventListener(TweenEvent.TWEEN_UPDATE, tweenEventHandler);
newTween.addEventListener(TweenEvent.TWEEN_END, tweenEventHandler);
if (easingFunction != null){
newTween.easingFunction = easingFunction;
};
if (_seekTime > 0){
newTween.seek(_seekTime);
};
newTween.playReversed = playReversed;
return (newTween);
}
private function tweenEventHandler(event:TweenEvent):void{
dispatchEvent(event);
}
override public function end():void{
stopRepeat = true;
if (delayTimer){
delayTimer.reset();
};
if (tween){
tween.endTween();
tween = null;
};
}
override public function reverse():void{
super.reverse();
if (tween){
tween.reverse();
};
super.playReversed = !(playReversed);
}
override mx_internal function set playReversed(value:Boolean):void{
super.playReversed = value;
if (tween){
tween.playReversed = value;
};
}
override public function resume():void{
super.resume();
if (tween){
tween.resume();
};
}
public function onTweenEnd(value:Object):void{
onTweenUpdate(value);
tween = null;
if (needToLayout){
UIComponentGlobals.layoutManager.validateNow();
};
finishRepeat();
}
public function onTweenUpdate(value:Object):void{
}
override public function pause():void{
super.pause();
if (tween){
tween.pause();
};
}
public function seek(playheadTime:Number):void{
if (tween){
tween.seek(playheadTime);
} else {
_seekTime = playheadTime;
};
}
}
}//package mx.effects.effectClasses
Section 180
//ZoomInstance (mx.effects.effectClasses.ZoomInstance)
package mx.effects.effectClasses {
import mx.core.*;
import flash.events.*;
import mx.events.*;
import mx.effects.*;
public class ZoomInstance extends TweenEffectInstance {
private var newY:Number;
public var originY:Number;
private var origX:Number;
private var origY:Number;
public var originX:Number;
private var origPercentHeight:Number;
public var zoomWidthFrom:Number;
public var zoomWidthTo:Number;
private var newX:Number;
public var captureRollEvents:Boolean;
private var origPercentWidth:Number;
public var zoomHeightFrom:Number;
private var origScaleX:Number;
public var zoomHeightTo:Number;
private var origScaleY:Number;
private var scaledOriginX:Number;
private var scaledOriginY:Number;
private var show:Boolean;// = true
private var _mouseHasMoved:Boolean;// = false
mx_internal static const VERSION:String = "3.2.0.3958";
public function ZoomInstance(target:Object){
super(target);
}
override public function finishEffect():void{
if (captureRollEvents){
target.removeEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false);
target.removeEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false);
target.removeEventListener(MouseEvent.MOUSE_MOVE, mouseEventHandler, false);
};
super.finishEffect();
}
private function getScaleFromWidth(value:Number):Number{
return ((value / (target.width / Math.abs(target.scaleX))));
}
override public function initEffect(event:Event):void{
super.initEffect(event);
if ((((event.type == FlexEvent.HIDE)) || ((event.type == Event.REMOVED)))){
show = false;
};
}
private function getScaleFromHeight(value:Number):Number{
return ((value / (target.height / Math.abs(target.scaleY))));
}
private function applyPropertyChanges():void{
var useSize:Boolean;
var useScale:Boolean;
var values:PropertyChanges = propertyChanges;
if (values){
useSize = false;
useScale = false;
if (values.end["scaleX"] !== undefined){
zoomWidthFrom = (isNaN(zoomWidthFrom)) ? target.scaleX : zoomWidthFrom;
zoomWidthTo = (isNaN(zoomWidthTo)) ? values.end["scaleX"] : zoomWidthTo;
useScale = true;
};
if (values.end["scaleY"] !== undefined){
zoomHeightFrom = (isNaN(zoomHeightFrom)) ? target.scaleY : zoomHeightFrom;
zoomHeightTo = (isNaN(zoomHeightTo)) ? values.end["scaleY"] : zoomHeightTo;
useScale = true;
};
if (useScale){
return;
};
if (values.end["width"] !== undefined){
zoomWidthFrom = (isNaN(zoomWidthFrom)) ? getScaleFromWidth(target.width) : zoomWidthFrom;
zoomWidthTo = (isNaN(zoomWidthTo)) ? getScaleFromWidth(values.end["width"]) : zoomWidthTo;
useSize = true;
};
if (values.end["height"] !== undefined){
zoomHeightFrom = (isNaN(zoomHeightFrom)) ? getScaleFromHeight(target.height) : zoomHeightFrom;
zoomHeightTo = (isNaN(zoomHeightTo)) ? getScaleFromHeight(values.end["height"]) : zoomHeightTo;
useSize = true;
};
if (useSize){
return;
};
if (values.end["visible"] !== undefined){
show = values.end["visible"];
};
};
}
private function mouseEventHandler(event:MouseEvent):void{
if (event.type == MouseEvent.MOUSE_MOVE){
_mouseHasMoved = true;
} else {
if ((((event.type == MouseEvent.ROLL_OUT)) || ((event.type == MouseEvent.ROLL_OVER)))){
if (!_mouseHasMoved){
event.stopImmediatePropagation();
};
_mouseHasMoved = false;
};
};
}
override public function play():void{
super.play();
applyPropertyChanges();
if (((((((isNaN(zoomWidthFrom)) && (isNaN(zoomWidthTo)))) && (isNaN(zoomHeightFrom)))) && (isNaN(zoomHeightTo)))){
if (show){
zoomWidthFrom = (zoomHeightFrom = 0);
zoomWidthTo = target.scaleX;
zoomHeightTo = target.scaleY;
} else {
zoomWidthFrom = target.scaleX;
zoomHeightFrom = target.scaleY;
zoomWidthTo = (zoomHeightTo = 0);
};
} else {
if (((isNaN(zoomWidthFrom)) && (isNaN(zoomWidthTo)))){
zoomWidthFrom = (zoomWidthTo = target.scaleX);
} else {
if (((isNaN(zoomHeightFrom)) && (isNaN(zoomHeightTo)))){
zoomHeightFrom = (zoomHeightTo = target.scaleY);
};
};
if (isNaN(zoomWidthFrom)){
zoomWidthFrom = target.scaleX;
} else {
if (isNaN(zoomWidthTo)){
zoomWidthTo = ((zoomWidthFrom)==1) ? 0 : 1;
};
};
if (isNaN(zoomHeightFrom)){
zoomHeightFrom = target.scaleY;
} else {
if (isNaN(zoomHeightTo)){
zoomHeightTo = ((zoomHeightFrom)==1) ? 0 : 1;
};
};
};
if (zoomWidthFrom < 0.01){
zoomWidthFrom = 0.01;
};
if (zoomWidthTo < 0.01){
zoomWidthTo = 0.01;
};
if (zoomHeightFrom < 0.01){
zoomHeightFrom = 0.01;
};
if (zoomHeightTo < 0.01){
zoomHeightTo = 0.01;
};
origScaleX = target.scaleX;
origScaleY = target.scaleY;
newX = (origX = target.x);
newY = (origY = target.y);
if (isNaN(originX)){
scaledOriginX = (target.width / 2);
} else {
scaledOriginX = (originX * origScaleX);
};
if (isNaN(originY)){
scaledOriginY = (target.height / 2);
} else {
scaledOriginY = (originY * origScaleY);
};
scaledOriginX = Number(scaledOriginX.toFixed(1));
scaledOriginY = Number(scaledOriginY.toFixed(1));
origPercentWidth = target.percentWidth;
if (!isNaN(origPercentWidth)){
target.width = target.width;
};
origPercentHeight = target.percentHeight;
if (!isNaN(origPercentHeight)){
target.height = target.height;
};
tween = createTween(this, [zoomWidthFrom, zoomHeightFrom], [zoomWidthTo, zoomHeightTo], duration);
if (captureRollEvents){
target.addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false);
target.addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false);
target.addEventListener(MouseEvent.MOUSE_MOVE, mouseEventHandler, false);
};
}
override public function onTweenEnd(value:Object):void{
var curWidth:Number;
var curHeight:Number;
if (!isNaN(origPercentWidth)){
curWidth = target.width;
target.percentWidth = origPercentWidth;
if (((target.parent) && ((target.parent.autoLayout == false)))){
target._width = curWidth;
};
};
if (!isNaN(origPercentHeight)){
curHeight = target.height;
target.percentHeight = origPercentHeight;
if (((target.parent) && ((target.parent.autoLayout == false)))){
target._height = curHeight;
};
};
super.onTweenEnd(value);
if (hideOnEffectEnd){
EffectManager.suspendEventHandling();
target.scaleX = origScaleX;
target.scaleY = origScaleY;
target.move(origX, origY);
EffectManager.resumeEventHandling();
};
}
override public function onTweenUpdate(value:Object):void{
EffectManager.suspendEventHandling();
if (Math.abs((newX - target.x)) > 0.1){
origX = (origX + (Number(target.x.toFixed(1)) - newX));
};
if (Math.abs((newY - target.y)) > 0.1){
origY = (origY + (Number(target.y.toFixed(1)) - newY));
};
target.scaleX = value[0];
target.scaleY = value[1];
var ratioX:Number = (value[0] / origScaleX);
var ratioY:Number = (value[1] / origScaleY);
var newOriginX:Number = (scaledOriginX * ratioX);
var newOriginY:Number = (scaledOriginY * ratioY);
newX = ((scaledOriginX - newOriginX) + origX);
newY = ((scaledOriginY - newOriginY) + origY);
newX = Number(newX.toFixed(1));
newY = Number(newY.toFixed(1));
target.move(newX, newY);
if (tween){
tween.needToLayout = true;
} else {
needToLayout = true;
};
EffectManager.resumeEventHandling();
}
}
}//package mx.effects.effectClasses
Section 181
//Blur (mx.effects.Blur)
package mx.effects {
import mx.effects.effectClasses.*;
public class Blur extends TweenEffect {
public var blurXTo:Number;
public var blurXFrom:Number;
public var blurYFrom:Number;
public var blurYTo:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var AFFECTED_PROPERTIES:Array = ["filters"];
public function Blur(target:Object=null){
super(target);
instanceClass = BlurInstance;
}
override public function getAffectedProperties():Array{
return (AFFECTED_PROPERTIES);
}
override protected function initInstance(instance:IEffectInstance):void{
var blurInstance:BlurInstance;
super.initInstance(instance);
blurInstance = BlurInstance(instance);
blurInstance.blurXFrom = blurXFrom;
blurInstance.blurXTo = blurXTo;
blurInstance.blurYFrom = blurYFrom;
blurInstance.blurYTo = blurYTo;
}
}
}//package mx.effects
Section 182
//Effect (mx.effects.Effect)
package mx.effects {
import mx.core.*;
import mx.managers.*;
import flash.events.*;
import mx.events.*;
import flash.utils.*;
import mx.effects.effectClasses.*;
public class Effect extends EventDispatcher implements IEffect {
private var _perElementOffset:Number;// = 0
private var _hideFocusRing:Boolean;// = false
private var _customFilter:EffectTargetFilter;
public var repeatCount:int;// = 1
public var suspendBackgroundProcessing:Boolean;// = false
public var startDelay:int;// = 0
private var _relevantProperties:Array;
private var _callValidateNow:Boolean;// = false
mx_internal var applyActualDimensions:Boolean;// = true
private var _filter:String;
private var _triggerEvent:Event;
private var _effectTargetHost:IEffectTargetHost;
mx_internal var durationExplicitlySet:Boolean;// = false
public var repeatDelay:int;// = 0
private var _targets:Array;
mx_internal var propertyChangesArray:Array;
mx_internal var filterObject:EffectTargetFilter;
protected var endValuesCaptured:Boolean;// = false
public var instanceClass:Class;
private var _duration:Number;// = 500
private var isPaused:Boolean;// = false
private var _relevantStyles:Array;
private var _instances:Array;
mx_internal static const VERSION:String = "3.2.0.3958";
public function Effect(target:Object=null){
_instances = [];
instanceClass = IEffectInstance;
_relevantStyles = [];
_targets = [];
super();
this.target = target;
}
public function get targets():Array{
return (_targets);
}
public function set targets(value:Array):void{
var n:int = value.length;
var i:int = (n - 1);
while (i > 0) {
if (value[i] == null){
value.splice(i, 1);
};
i--;
};
_targets = value;
}
public function set hideFocusRing(value:Boolean):void{
_hideFocusRing = value;
}
public function get hideFocusRing():Boolean{
return (_hideFocusRing);
}
public function stop():void{
var instance:IEffectInstance;
var n:int = _instances.length;
var i:int = n;
while (i >= 0) {
instance = IEffectInstance(_instances[i]);
if (instance){
instance.stop();
};
i--;
};
}
public function captureStartValues():void{
var n:int;
var i:int;
if (targets.length > 0){
propertyChangesArray = [];
_callValidateNow = true;
n = targets.length;
i = 0;
while (i < n) {
propertyChangesArray.push(new PropertyChanges(targets[i]));
i++;
};
propertyChangesArray = captureValues(propertyChangesArray, true);
};
endValuesCaptured = false;
}
mx_internal function captureValues(propChanges:Array, setStartValues:Boolean):Array{
var valueMap:Object;
var target:Object;
var n:int;
var i:int;
var m:int;
var j:int;
var effectProps:Array = (filterObject) ? mergeArrays(relevantProperties, filterObject.filterProperties) : relevantProperties;
if (((effectProps) && ((effectProps.length > 0)))){
n = propChanges.length;
i = 0;
while (i < n) {
target = propChanges[i].target;
valueMap = (setStartValues) ? propChanges[i].start : propChanges[i].end;
m = effectProps.length;
j = 0;
while (j < m) {
valueMap[effectProps[j]] = getValueFromTarget(target, effectProps[j]);
j++;
};
i++;
};
};
var styles:Array = (filterObject) ? mergeArrays(relevantStyles, filterObject.filterStyles) : relevantStyles;
if (((styles) && ((styles.length > 0)))){
n = propChanges.length;
i = 0;
while (i < n) {
target = propChanges[i].target;
valueMap = (setStartValues) ? propChanges[i].start : propChanges[i].end;
m = styles.length;
j = 0;
while (j < m) {
valueMap[styles[j]] = target.getStyle(styles[j]);
j++;
};
i++;
};
};
return (propChanges);
}
protected function getValueFromTarget(target:Object, property:String){
if ((property in target)){
return (target[property]);
};
return (undefined);
}
public function set target(value:Object):void{
_targets.splice(0);
if (value){
_targets[0] = value;
};
}
public function get className():String{
var name:String = getQualifiedClassName(this);
var index:int = name.indexOf("::");
if (index != -1){
name = name.substr((index + 2));
};
return (name);
}
public function set perElementOffset(value:Number):void{
_perElementOffset = value;
}
public function resume():void{
var n:int;
var i:int;
if (((isPlaying) && (isPaused))){
isPaused = false;
n = _instances.length;
i = 0;
while (i < n) {
IEffectInstance(_instances[i]).resume();
i++;
};
};
}
public function set duration(value:Number):void{
durationExplicitlySet = true;
_duration = value;
}
public function play(targets:Array=null, playReversedFromEnd:Boolean=false):Array{
var newInstance:IEffectInstance;
if ((((targets == null)) && (!((propertyChangesArray == null))))){
if (_callValidateNow){
LayoutManager.getInstance().validateNow();
};
if (!endValuesCaptured){
propertyChangesArray = captureValues(propertyChangesArray, false);
};
propertyChangesArray = stripUnchangedValues(propertyChangesArray);
applyStartValues(propertyChangesArray, this.targets);
};
var newInstances:Array = createInstances(targets);
var n:int = newInstances.length;
var i:int;
while (i < n) {
newInstance = IEffectInstance(newInstances[i]);
Object(newInstance).playReversed = playReversedFromEnd;
newInstance.startEffect();
i++;
};
return (newInstances);
}
public function captureEndValues():void{
propertyChangesArray = captureValues(propertyChangesArray, false);
endValuesCaptured = true;
}
protected function filterInstance(propChanges:Array, target:Object):Boolean{
if (filterObject){
return (filterObject.filterInstance(propChanges, effectTargetHost, target));
};
return (true);
}
public function get customFilter():EffectTargetFilter{
return (_customFilter);
}
public function get effectTargetHost():IEffectTargetHost{
return (_effectTargetHost);
}
public function set relevantProperties(value:Array):void{
_relevantProperties = value;
}
public function captureMoreStartValues(targets:Array):void{
var additionalPropertyChangesArray:Array;
var i:int;
if (targets.length > 0){
additionalPropertyChangesArray = [];
i = 0;
while (i < targets.length) {
additionalPropertyChangesArray.push(new PropertyChanges(targets[i]));
i++;
};
additionalPropertyChangesArray = captureValues(additionalPropertyChangesArray, true);
propertyChangesArray = propertyChangesArray.concat(additionalPropertyChangesArray);
};
}
public function deleteInstance(instance:IEffectInstance):void{
EventDispatcher(instance).removeEventListener(EffectEvent.EFFECT_START, effectStartHandler);
EventDispatcher(instance).removeEventListener(EffectEvent.EFFECT_END, effectEndHandler);
var n:int = _instances.length;
var i:int;
while (i < n) {
if (_instances[i] === instance){
_instances.splice(i, 1);
};
i++;
};
}
public function get filter():String{
return (_filter);
}
public function set triggerEvent(value:Event):void{
_triggerEvent = value;
}
public function get target():Object{
if (_targets.length > 0){
return (_targets[0]);
};
return (null);
}
public function get duration():Number{
return (_duration);
}
public function set customFilter(value:EffectTargetFilter):void{
_customFilter = value;
filterObject = value;
}
public function get perElementOffset():Number{
return (_perElementOffset);
}
public function set effectTargetHost(value:IEffectTargetHost):void{
_effectTargetHost = value;
}
public function get isPlaying():Boolean{
return (((_instances) && ((_instances.length > 0))));
}
protected function effectEndHandler(event:EffectEvent):void{
var instance:IEffectInstance = IEffectInstance(event.effectInstance);
deleteInstance(instance);
dispatchEvent(event);
}
public function get relevantProperties():Array{
if (_relevantProperties){
return (_relevantProperties);
};
return (getAffectedProperties());
}
public function createInstance(target:Object=null):IEffectInstance{
var n:int;
var i:int;
if (!target){
target = this.target;
};
var newInstance:IEffectInstance;
var props:PropertyChanges;
var create:Boolean;
var setPropsArray:Boolean;
if (propertyChangesArray){
setPropsArray = true;
create = filterInstance(propertyChangesArray, target);
};
if (create){
newInstance = IEffectInstance(new instanceClass(target));
initInstance(newInstance);
if (setPropsArray){
n = propertyChangesArray.length;
i = 0;
while (i < n) {
if (propertyChangesArray[i].target == target){
newInstance.propertyChanges = propertyChangesArray[i];
};
i++;
};
};
EventDispatcher(newInstance).addEventListener(EffectEvent.EFFECT_START, effectStartHandler);
EventDispatcher(newInstance).addEventListener(EffectEvent.EFFECT_END, effectEndHandler);
_instances.push(newInstance);
if (triggerEvent){
newInstance.initEffect(triggerEvent);
};
};
return (newInstance);
}
protected function effectStartHandler(event:EffectEvent):void{
dispatchEvent(event);
}
public function getAffectedProperties():Array{
return ([]);
}
public function set relevantStyles(value:Array):void{
_relevantStyles = value;
}
public function get triggerEvent():Event{
return (_triggerEvent);
}
protected function applyValueToTarget(target:Object, property:String, value, props:Object):void{
var target = target;
var property = property;
var value = value;
var props = props;
if ((property in target)){
if (((((applyActualDimensions) && ((target is IFlexDisplayObject)))) && ((property == "height")))){
target.setActualSize(target.width, value);
} else {
if (((((applyActualDimensions) && ((target is IFlexDisplayObject)))) && ((property == "width")))){
target.setActualSize(value, target.height);
} else {
target[property] = value;
};
};
//unresolved jump
var _slot1 = e;
};
}
protected function initInstance(instance:IEffectInstance):void{
instance.duration = duration;
Object(instance).durationExplicitlySet = durationExplicitlySet;
instance.effect = this;
instance.effectTargetHost = effectTargetHost;
instance.hideFocusRing = hideFocusRing;
instance.repeatCount = repeatCount;
instance.repeatDelay = repeatDelay;
instance.startDelay = startDelay;
instance.suspendBackgroundProcessing = suspendBackgroundProcessing;
}
mx_internal function applyStartValues(propChanges:Array, targets:Array):void{
var m:int;
var j:int;
var target:Object;
var apply:Boolean;
var effectProps:Array = relevantProperties;
var n:int = propChanges.length;
var i:int;
while (i < n) {
target = propChanges[i].target;
apply = false;
m = targets.length;
j = 0;
while (j < m) {
if (targets[j] == target){
apply = filterInstance(propChanges, target);
break;
};
j++;
};
if (apply){
m = effectProps.length;
j = 0;
while (j < m) {
if ((((effectProps[j] in propChanges[i].start)) && ((effectProps[j] in target)))){
applyValueToTarget(target, effectProps[j], propChanges[i].start[effectProps[j]], propChanges[i].start);
};
j++;
};
m = relevantStyles.length;
j = 0;
while (j < m) {
if ((relevantStyles[j] in propChanges[i].start)){
target.setStyle(relevantStyles[j], propChanges[i].start[relevantStyles[j]]);
};
j++;
};
};
i++;
};
}
public function end(effectInstance:IEffectInstance=null):void{
var n:int;
var i:int;
var instance:IEffectInstance;
if (effectInstance){
effectInstance.end();
} else {
n = _instances.length;
i = n;
while (i >= 0) {
instance = IEffectInstance(_instances[i]);
if (instance){
instance.end();
};
i--;
};
};
}
public function get relevantStyles():Array{
return (_relevantStyles);
}
public function createInstances(targets:Array=null):Array{
var newInstance:IEffectInstance;
if (!targets){
targets = this.targets;
};
var newInstances:Array = [];
var n:int = targets.length;
var offsetDelay:Number = 0;
var i:int;
while (i < n) {
newInstance = createInstance(targets[i]);
if (newInstance){
newInstance.startDelay = (newInstance.startDelay + offsetDelay);
offsetDelay = (offsetDelay + perElementOffset);
newInstances.push(newInstance);
};
i++;
};
triggerEvent = null;
return (newInstances);
}
public function pause():void{
var n:int;
var i:int;
if (((isPlaying) && (!(isPaused)))){
isPaused = true;
n = _instances.length;
i = 0;
while (i < n) {
IEffectInstance(_instances[i]).pause();
i++;
};
};
}
public function set filter(value:String):void{
if (!customFilter){
_filter = value;
switch (value){
case "add":
case "remove":
filterObject = new AddRemoveEffectTargetFilter();
AddRemoveEffectTargetFilter(filterObject).add = (value == "add");
break;
case "hide":
case "show":
filterObject = new HideShowEffectTargetFilter();
HideShowEffectTargetFilter(filterObject).show = (value == "show");
break;
case "move":
filterObject = new EffectTargetFilter();
filterObject.filterProperties = ["x", "y"];
break;
case "resize":
filterObject = new EffectTargetFilter();
filterObject.filterProperties = ["width", "height"];
break;
case "addItem":
filterObject = new EffectTargetFilter();
filterObject.requiredSemantics = {added:true};
break;
case "removeItem":
filterObject = new EffectTargetFilter();
filterObject.requiredSemantics = {removed:true};
break;
case "replacedItem":
filterObject = new EffectTargetFilter();
filterObject.requiredSemantics = {replaced:true};
break;
case "replacementItem":
filterObject = new EffectTargetFilter();
filterObject.requiredSemantics = {replacement:true};
break;
default:
filterObject = null;
break;
};
};
}
public function reverse():void{
var n:int;
var i:int;
if (isPlaying){
n = _instances.length;
i = 0;
while (i < n) {
IEffectInstance(_instances[i]).reverse();
i++;
};
};
}
private static function mergeArrays(a1:Array, a2:Array):Array{
var i2:int;
var addIt:Boolean;
var i1:int;
if (a2){
i2 = 0;
while (i2 < a2.length) {
addIt = true;
i1 = 0;
while (i1 < a1.length) {
if (a1[i1] == a2[i2]){
addIt = false;
break;
};
i1++;
};
if (addIt){
a1.push(a2[i2]);
};
i2++;
};
};
return (a1);
}
private static function stripUnchangedValues(propChanges:Array):Array{
var prop:Object;
var i:int;
while (i < propChanges.length) {
for (prop in propChanges[i].start) {
if ((((propChanges[i].start[prop] == propChanges[i].end[prop])) || ((((((((typeof(propChanges[i].start[prop]) == "number")) && ((typeof(propChanges[i].end[prop]) == "number")))) && (isNaN(propChanges[i].start[prop])))) && (isNaN(propChanges[i].end[prop])))))){
delete propChanges[i].start[prop];
delete propChanges[i].end[prop];
};
};
i++;
};
return (propChanges);
}
}
}//package mx.effects
Section 183
//EffectInstance (mx.effects.EffectInstance)
package mx.effects {
import mx.core.*;
import flash.events.*;
import mx.events.*;
import flash.utils.*;
import mx.effects.effectClasses.*;
public class EffectInstance extends EventDispatcher implements IEffectInstance {
private var _hideFocusRing:Boolean;
private var delayStartTime:Number;// = 0
mx_internal var stopRepeat:Boolean;// = false
private var playCount:int;// = 0
private var _repeatCount:int;// = 0
private var _suspendBackgroundProcessing:Boolean;// = false
mx_internal var delayTimer:Timer;
private var _triggerEvent:Event;
private var _effectTargetHost:IEffectTargetHost;
mx_internal var parentCompositeEffectInstance:EffectInstance;
mx_internal var durationExplicitlySet:Boolean;// = false
private var _effect:IEffect;
private var _target:Object;
mx_internal var hideOnEffectEnd:Boolean;// = false
private var _startDelay:int;// = 0
private var delayElapsedTime:Number;// = 0
private var _repeatDelay:int;// = 0
private var _propertyChanges:PropertyChanges;
private var _duration:Number;// = 500
private var _playReversed:Boolean;
mx_internal static const VERSION:String = "3.2.0.3958";
public function EffectInstance(target:Object){
super();
this.target = target;
}
public function get playheadTime():Number{
return ((((Math.max((playCount - 1), 0) * duration) + (Math.max((playCount - 2), 0) * repeatDelay)) + (playReversed) ? 0 : startDelay));
}
public function get hideFocusRing():Boolean{
return (_hideFocusRing);
}
public function stop():void{
if (delayTimer){
delayTimer.reset();
};
stopRepeat = true;
finishEffect();
}
public function finishEffect():void{
playCount = 0;
dispatchEvent(new EffectEvent(EffectEvent.EFFECT_END, false, false, this));
if (target){
target.dispatchEvent(new EffectEvent(EffectEvent.EFFECT_END, false, false, this));
};
if ((target is UIComponent)){
UIComponent(target).effectFinished(this);
};
EffectManager.effectFinished(this);
}
public function set hideFocusRing(value:Boolean):void{
_hideFocusRing = value;
}
public function finishRepeat():void{
if (((((!(stopRepeat)) && (!((playCount == 0))))) && ((((playCount < repeatCount)) || ((repeatCount == 0)))))){
if (repeatDelay > 0){
delayTimer = new Timer(repeatDelay, 1);
delayStartTime = getTimer();
delayTimer.addEventListener(TimerEvent.TIMER, delayTimerHandler);
delayTimer.start();
} else {
play();
};
} else {
finishEffect();
};
}
mx_internal function get playReversed():Boolean{
return (_playReversed);
}
public function set effect(value:IEffect):void{
_effect = value;
}
public function get className():String{
var name:String = getQualifiedClassName(this);
var index:int = name.indexOf("::");
if (index != -1){
name = name.substr((index + 2));
};
return (name);
}
public function set duration(value:Number):void{
durationExplicitlySet = true;
_duration = value;
}
mx_internal function set playReversed(value:Boolean):void{
_playReversed = value;
}
public function resume():void{
if (((((delayTimer) && (!(delayTimer.running)))) && (!(isNaN(delayElapsedTime))))){
delayTimer.delay = (playReversed) ? delayElapsedTime : (delayTimer.delay - delayElapsedTime);
delayTimer.start();
};
}
public function get propertyChanges():PropertyChanges{
return (_propertyChanges);
}
public function set target(value:Object):void{
_target = value;
}
public function get repeatCount():int{
return (_repeatCount);
}
mx_internal function playWithNoDuration():void{
duration = 0;
repeatCount = 1;
repeatDelay = 0;
startDelay = 0;
startEffect();
}
public function get startDelay():int{
return (_startDelay);
}
mx_internal function get actualDuration():Number{
var value:Number = NaN;
if (repeatCount > 0){
value = (((duration * repeatCount) + ((repeatDelay * repeatCount) - 1)) + startDelay);
};
return (value);
}
public function play():void{
playCount++;
dispatchEvent(new EffectEvent(EffectEvent.EFFECT_START, false, false, this));
if (target){
target.dispatchEvent(new EffectEvent(EffectEvent.EFFECT_START, false, false, this));
};
}
public function get suspendBackgroundProcessing():Boolean{
return (_suspendBackgroundProcessing);
}
public function get effectTargetHost():IEffectTargetHost{
return (_effectTargetHost);
}
public function set repeatDelay(value:int):void{
_repeatDelay = value;
}
public function set propertyChanges(value:PropertyChanges):void{
_propertyChanges = value;
}
mx_internal function eventHandler(event:Event):void{
if ((((event.type == FlexEvent.SHOW)) && ((hideOnEffectEnd == true)))){
hideOnEffectEnd = false;
event.target.removeEventListener(FlexEvent.SHOW, eventHandler);
};
}
public function set repeatCount(value:int):void{
_repeatCount = value;
}
private function delayTimerHandler(event:TimerEvent):void{
delayTimer.reset();
delayStartTime = NaN;
delayElapsedTime = NaN;
play();
}
public function set suspendBackgroundProcessing(value:Boolean):void{
_suspendBackgroundProcessing = value;
}
public function set triggerEvent(value:Event):void{
_triggerEvent = value;
}
public function set startDelay(value:int):void{
_startDelay = value;
}
public function get effect():IEffect{
return (_effect);
}
public function set effectTargetHost(value:IEffectTargetHost):void{
_effectTargetHost = value;
}
public function get target():Object{
return (_target);
}
public function startEffect():void{
EffectManager.effectStarted(this);
if ((target is UIComponent)){
UIComponent(target).effectStarted(this);
};
if ((((startDelay > 0)) && (!(playReversed)))){
delayTimer = new Timer(startDelay, 1);
delayStartTime = getTimer();
delayTimer.addEventListener(TimerEvent.TIMER, delayTimerHandler);
delayTimer.start();
} else {
play();
};
}
public function get repeatDelay():int{
return (_repeatDelay);
}
public function get duration():Number{
if (((!(durationExplicitlySet)) && (parentCompositeEffectInstance))){
return (parentCompositeEffectInstance.duration);
};
return (_duration);
}
public function initEffect(event:Event):void{
triggerEvent = event;
switch (event.type){
case "resizeStart":
case "resizeEnd":
if (!durationExplicitlySet){
duration = 250;
};
break;
case FlexEvent.HIDE:
target.setVisible(true, true);
hideOnEffectEnd = true;
target.addEventListener(FlexEvent.SHOW, eventHandler);
break;
};
}
public function get triggerEvent():Event{
return (_triggerEvent);
}
public function end():void{
if (delayTimer){
delayTimer.reset();
};
stopRepeat = true;
finishEffect();
}
public function reverse():void{
if (repeatCount > 0){
playCount = ((repeatCount - playCount) + 1);
};
}
public function pause():void{
if (((((delayTimer) && (delayTimer.running))) && (!(isNaN(delayStartTime))))){
delayTimer.stop();
delayElapsedTime = (getTimer() - delayStartTime);
};
}
}
}//package mx.effects
Section 184
//EffectManager (mx.effects.EffectManager)
package mx.effects {
import flash.display.*;
import mx.core.*;
import flash.events.*;
import mx.events.*;
import mx.resources.*;
import flash.utils.*;
public class EffectManager extends EventDispatcher {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var _resourceManager:IResourceManager;
private static var effects:Dictionary = new Dictionary(true);
mx_internal static var effectsPlaying:Array = [];
private static var targetsInfo:Array = [];
private static var effectTriggersForEvent:Object = {};
mx_internal static var lastEffectCreated:Effect;
private static var eventHandlingSuspendCount:Number = 0;
private static var eventsForEffectTriggers:Object = {};
public function EffectManager(){
super();
}
public static function suspendEventHandling():void{
eventHandlingSuspendCount++;
}
mx_internal static function registerEffectTrigger(name:String, event:String):void{
var strLen:Number;
if (name != ""){
if (event == ""){
strLen = name.length;
if ((((strLen > 6)) && ((name.substring((strLen - 6)) == "Effect")))){
event = name.substring(0, (strLen - 6));
};
};
if (event != ""){
effectTriggersForEvent[event] = name;
eventsForEffectTriggers[name] = event;
};
};
}
private static function removedEffectHandler(target:DisplayObject, parent:DisplayObjectContainer, index:int, eventObj:Event):void{
suspendEventHandling();
parent.addChildAt(target, index);
resumeEventHandling();
createAndPlayEffect(eventObj, target);
}
private static function createAndPlayEffect(eventObj:Event, target:Object):void{
var n:int;
var i:int;
var m:int;
var j:int;
var message:String;
var type:String;
var tweeningProperties:Array;
var effectProperties:Array;
var affectedProps:Array;
var runningInstances:Array;
var otherInst:EffectInstance;
var effectInst:Effect = createEffectForType(target, eventObj.type);
if (!effectInst){
return;
};
if ((((effectInst is Zoom)) && ((eventObj.type == MoveEvent.MOVE)))){
message = resourceManager.getString("effects", "incorrectTrigger");
throw (new Error(message));
};
if (target.initialized == false){
type = eventObj.type;
if ((((((((((type == MoveEvent.MOVE)) || ((type == ResizeEvent.RESIZE)))) || ((type == FlexEvent.SHOW)))) || ((type == FlexEvent.HIDE)))) || ((type == Event.CHANGE)))){
effectInst = null;
return;
};
};
if ((effectInst.target is IUIComponent)){
tweeningProperties = IUIComponent(effectInst.target).tweeningProperties;
if (((tweeningProperties) && ((tweeningProperties.length > 0)))){
effectProperties = effectInst.getAffectedProperties();
n = tweeningProperties.length;
m = effectProperties.length;
i = 0;
while (i < n) {
j = 0;
while (j < m) {
if (tweeningProperties[i] == effectProperties[j]){
effectInst = null;
return;
};
j++;
};
i++;
};
};
};
if ((((effectInst.target is UIComponent)) && (UIComponent(effectInst.target).isEffectStarted))){
affectedProps = effectInst.getAffectedProperties();
i = 0;
while (i < affectedProps.length) {
runningInstances = effectInst.target.getEffectsForProperty(affectedProps[i]);
if (runningInstances.length > 0){
if (eventObj.type == ResizeEvent.RESIZE){
return;
};
j = 0;
while (j < runningInstances.length) {
otherInst = runningInstances[j];
if ((((eventObj.type == FlexEvent.SHOW)) && (otherInst.hideOnEffectEnd))){
otherInst.target.removeEventListener(FlexEvent.SHOW, otherInst.eventHandler);
otherInst.hideOnEffectEnd = false;
};
otherInst.end();
j++;
};
};
i++;
};
};
effectInst.triggerEvent = eventObj;
effectInst.addEventListener(EffectEvent.EFFECT_END, EffectManager.effectEndHandler);
lastEffectCreated = effectInst;
var instances:Array = effectInst.play();
n = instances.length;
i = 0;
while (i < n) {
effectsPlaying.push(new EffectNode(effectInst, instances[i]));
i++;
};
if (effectInst.suspendBackgroundProcessing){
UIComponent.suspendBackgroundProcessing();
};
}
public static function endEffectsForTarget(target:IUIComponent):void{
var otherInst:EffectInstance;
var n:int = effectsPlaying.length;
var i:int = (n - 1);
while (i >= 0) {
otherInst = effectsPlaying[i].instance;
if (otherInst.target == target){
otherInst.end();
};
i--;
};
}
private static function cacheOrUncacheTargetAsBitmap(target:IUIComponent, effectStart:Boolean=true, bitmapEffect:Boolean=true):void{
var n:int;
var i:int;
var info:Object;
n = targetsInfo.length;
i = 0;
while (i < n) {
if (targetsInfo[i].target == target){
info = targetsInfo[i];
break;
};
i++;
};
if (!info){
info = {target:target, bitmapEffectsCount:0, vectorEffectsCount:0};
targetsInfo.push(info);
};
if (effectStart){
if (bitmapEffect){
info.bitmapEffectsCount++;
if ((((info.vectorEffectsCount == 0)) && ((target is IDeferredInstantiationUIComponent)))){
IDeferredInstantiationUIComponent(target).cacheHeuristic = true;
};
} else {
if ((((((info.vectorEffectsCount++ == 0)) && ((target is IDeferredInstantiationUIComponent)))) && ((IDeferredInstantiationUIComponent(target).cachePolicy == UIComponentCachePolicy.AUTO)))){
target.cacheAsBitmap = false;
};
};
} else {
if (bitmapEffect){
if (info.bitmapEffectsCount != 0){
info.bitmapEffectsCount--;
};
if ((target is IDeferredInstantiationUIComponent)){
IDeferredInstantiationUIComponent(target).cacheHeuristic = false;
};
} else {
if (info.vectorEffectsCount != 0){
if ((((--info.vectorEffectsCount == 0)) && (!((info.bitmapEffectsCount == 0))))){
n = info.bitmapEffectsCount;
i = 0;
while (i < n) {
if ((target is IDeferredInstantiationUIComponent)){
IDeferredInstantiationUIComponent(target).cacheHeuristic = true;
};
i++;
};
};
};
};
if ((((info.bitmapEffectsCount == 0)) && ((info.vectorEffectsCount == 0)))){
n = targetsInfo.length;
i = 0;
while (i < n) {
if (targetsInfo[i].target == target){
targetsInfo.splice(i, 1);
break;
};
i++;
};
};
};
}
mx_internal static function eventHandler(eventObj:Event):void{
var focusEventObj:FocusEvent;
var targ:DisplayObject;
var i:int;
var parent:DisplayObjectContainer;
var index:int;
if (!(eventObj.currentTarget is IFlexDisplayObject)){
return;
};
if (eventHandlingSuspendCount > 0){
return;
};
if ((((eventObj is FocusEvent)) && ((((eventObj.type == FocusEvent.FOCUS_OUT)) || ((eventObj.type == FocusEvent.FOCUS_IN)))))){
focusEventObj = FocusEvent(eventObj);
if (((focusEventObj.relatedObject) && (((focusEventObj.currentTarget.contains(focusEventObj.relatedObject)) || ((focusEventObj.currentTarget == focusEventObj.relatedObject)))))){
return;
};
};
if ((((((eventObj.type == Event.ADDED)) || ((eventObj.type == Event.REMOVED)))) && (!((eventObj.target == eventObj.currentTarget))))){
return;
};
if (eventObj.type == Event.REMOVED){
if ((eventObj.target is UIComponent)){
if (UIComponent(eventObj.target).initialized == false){
return;
};
if (UIComponent(eventObj.target).isEffectStarted){
i = 0;
while (i < UIComponent(eventObj.target)._effectsStarted.length) {
if (UIComponent(eventObj.target)._effectsStarted[i].triggerEvent.type == Event.REMOVED){
return;
};
i++;
};
};
};
targ = (eventObj.target as DisplayObject);
if (targ != null){
parent = (targ.parent as DisplayObjectContainer);
if (parent != null){
index = parent.getChildIndex(targ);
if (index >= 0){
if ((targ is UIComponent)){
UIComponent(targ).callLater(removedEffectHandler, [targ, parent, index, eventObj]);
};
};
};
};
} else {
createAndPlayEffect(eventObj, eventObj.currentTarget);
};
}
mx_internal static function endBitmapEffect(target:IUIComponent):void{
cacheOrUncacheTargetAsBitmap(target, false, true);
}
private static function animateSameProperty(a:Effect, b:Effect, c:EffectInstance):Boolean{
var aProps:Array;
var bProps:Array;
var n:int;
var m:int;
var i:int;
var j:int;
if (a.target == c.target){
aProps = a.getAffectedProperties();
bProps = b.getAffectedProperties();
n = aProps.length;
m = bProps.length;
i = 0;
while (i < n) {
j = 0;
while (j < m) {
if (aProps[i] == bProps[j]){
return (true);
};
j++;
};
i++;
};
};
return (false);
}
mx_internal static function effectFinished(effect:EffectInstance):void{
delete effects[effect];
}
mx_internal static function effectsInEffect():Boolean{
var i:*;
for (i in effects) {
return (true);
};
return (false);
}
mx_internal static function effectEndHandler(event:EffectEvent):void{
var targ:DisplayObject;
var parent:DisplayObjectContainer;
var effectInst:IEffectInstance = event.effectInstance;
var n:int = effectsPlaying.length;
var i:int = (n - 1);
while (i >= 0) {
if (effectsPlaying[i].instance == effectInst){
effectsPlaying.splice(i, 1);
break;
};
i--;
};
if (Object(effectInst).hideOnEffectEnd == true){
effectInst.target.removeEventListener(FlexEvent.SHOW, Object(effectInst).eventHandler);
effectInst.target.setVisible(false, true);
};
if (((effectInst.triggerEvent) && ((effectInst.triggerEvent.type == Event.REMOVED)))){
targ = (effectInst.target as DisplayObject);
if (targ != null){
parent = (targ.parent as DisplayObjectContainer);
if (parent != null){
suspendEventHandling();
parent.removeChild(targ);
resumeEventHandling();
};
};
};
if (effectInst.suspendBackgroundProcessing){
UIComponent.resumeBackgroundProcessing();
};
}
mx_internal static function startBitmapEffect(target:IUIComponent):void{
cacheOrUncacheTargetAsBitmap(target, true, true);
}
mx_internal static function setStyle(styleProp:String, target):void{
var eventName:String = eventsForEffectTriggers[styleProp];
if (((!((eventName == null))) && (!((eventName == ""))))){
target.addEventListener(eventName, EffectManager.eventHandler, false, EventPriority.EFFECT);
};
}
mx_internal static function getEventForEffectTrigger(effectTrigger:String):String{
var effectTrigger = effectTrigger;
if (eventsForEffectTriggers){
return (eventsForEffectTriggers[effectTrigger]);
//unresolved jump
var _slot1 = e;
return ("");
};
return ("");
}
mx_internal static function createEffectForType(target:Object, type:String):Effect{
var cls:Class;
var effectObj:Effect;
var doc:Object;
var target = target;
var type = type;
var trigger:String = effectTriggersForEvent[type];
if (trigger == ""){
trigger = (type + "Effect");
};
var value:Object = target.getStyle(trigger);
if (!value){
return (null);
};
if ((value is Class)){
cls = Class(value);
return (new cls(target));
};
if ((value is String)){
doc = target.parentDocument;
if (!doc){
doc = ApplicationGlobals.application;
};
effectObj = doc[value];
} else {
if ((value is Effect)){
effectObj = Effect(value);
};
};
if (effectObj){
effectObj.target = target;
return (effectObj);
};
//unresolved jump
var _slot1 = e;
var effectClass:Class = Class(target.systemManager.getDefinitionByName(("mx.effects." + value)));
if (effectClass){
return (new effectClass(target));
};
return (null);
}
mx_internal static function effectStarted(effect:EffectInstance):void{
effects[effect] = 1;
}
public static function resumeEventHandling():void{
eventHandlingSuspendCount--;
}
mx_internal static function startVectorEffect(target:IUIComponent):void{
cacheOrUncacheTargetAsBitmap(target, true, false);
}
mx_internal static function endVectorEffect(target:IUIComponent):void{
cacheOrUncacheTargetAsBitmap(target, false, false);
}
private static function get resourceManager():IResourceManager{
if (!_resourceManager){
_resourceManager = ResourceManager.getInstance();
};
return (_resourceManager);
}
}
}//package mx.effects
class EffectNode {
public var factory:Effect;
public var instance:EffectInstance;
private function EffectNode(factory:Effect, instance:EffectInstance){
super();
this.factory = factory;
this.instance = instance;
}
}
Section 185
//EffectTargetFilter (mx.effects.EffectTargetFilter)
package mx.effects {
import mx.core.*;
import mx.effects.effectClasses.*;
public class EffectTargetFilter {
public var filterFunction:Function;
public var filterStyles:Array;
public var filterProperties:Array;
public var requiredSemantics:Object;// = null
mx_internal static const VERSION:String = "3.2.0.3958";
public function EffectTargetFilter(){
filterFunction = defaultFilterFunctionEx;
filterProperties = [];
filterStyles = [];
super();
}
protected function defaultFilterFunctionEx(propChanges:Array, semanticsProvider:IEffectTargetHost, target:Object):Boolean{
var prop:String;
if (requiredSemantics){
for (prop in requiredSemantics) {
if (!semanticsProvider){
return (false);
};
if (semanticsProvider.getRendererSemanticValue(target, prop) != requiredSemantics[prop]){
return (false);
};
};
return (true);
};
return (defaultFilterFunction(propChanges, target));
}
protected function defaultFilterFunction(propChanges:Array, instanceTarget:Object):Boolean{
var props:PropertyChanges;
var triggers:Array;
var m:int;
var j:int;
var n:int = propChanges.length;
var i:int;
while (i < n) {
props = propChanges[i];
if (props.target == instanceTarget){
triggers = filterProperties.concat(filterStyles);
m = triggers.length;
j = 0;
while (j < m) {
if (((!((props.start[triggers[j]] === undefined))) && (!((props.end[triggers[j]] == props.start[triggers[j]]))))){
return (true);
};
j++;
};
};
i++;
};
return (false);
}
public function filterInstance(propChanges:Array, semanticsProvider:IEffectTargetHost, target:Object):Boolean{
if (filterFunction.length == 2){
return (filterFunction(propChanges, target));
};
return (filterFunction(propChanges, semanticsProvider, target));
}
}
}//package mx.effects
Section 186
//Fade (mx.effects.Fade)
package mx.effects {
import mx.effects.effectClasses.*;
public class Fade extends TweenEffect {
public var alphaFrom:Number;
public var alphaTo:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var AFFECTED_PROPERTIES:Array = ["alpha", "visible"];
public function Fade(target:Object=null){
super(target);
instanceClass = FadeInstance;
}
override protected function initInstance(instance:IEffectInstance):void{
super.initInstance(instance);
var fadeInstance:FadeInstance = FadeInstance(instance);
fadeInstance.alphaFrom = alphaFrom;
fadeInstance.alphaTo = alphaTo;
}
override public function getAffectedProperties():Array{
return (AFFECTED_PROPERTIES);
}
}
}//package mx.effects
Section 187
//IAbstractEffect (mx.effects.IAbstractEffect)
package mx.effects {
import flash.events.*;
public interface IAbstractEffect extends IEventDispatcher {
}
}//package mx.effects
Section 188
//IEffect (mx.effects.IEffect)
package mx.effects {
import flash.events.*;
public interface IEffect extends IAbstractEffect {
function captureMoreStartValues(mx.effects:IEffect/mx.effects:IEffect:className/get:Array):void;
function get triggerEvent():Event;
function set targets(mx.effects:IEffect/mx.effects:IEffect:className/get:Array):void;
function captureStartValues():void;
function get hideFocusRing():Boolean;
function get customFilter():EffectTargetFilter;
function get effectTargetHost():IEffectTargetHost;
function set triggerEvent(mx.effects:IEffect/mx.effects:IEffect:className/get:Event):void;
function set hideFocusRing(mx.effects:IEffect/mx.effects:IEffect:className/get:Boolean):void;
function captureEndValues():void;
function get target():Object;
function set customFilter(mx.effects:IEffect/mx.effects:IEffect:className/get:EffectTargetFilter):void;
function get duration():Number;
function get perElementOffset():Number;
function get targets():Array;
function set effectTargetHost(mx.effects:IEffect/mx.effects:IEffect:className/get:IEffectTargetHost):void;
function get relevantStyles():Array;
function set relevantProperties(mx.effects:IEffect/mx.effects:IEffect:className/get:Array):void;
function set target(mx.effects:IEffect/mx.effects:IEffect:className/get:Object):void;
function get className():String;
function get isPlaying():Boolean;
function deleteInstance(mx.effects:IEffect/mx.effects:IEffect:className/get:IEffectInstance):void;
function set duration(mx.effects:IEffect/mx.effects:IEffect:className/get:Number):void;
function createInstances(EffectTargetFilter:Array=null):Array;
function end(mx.effects:IEffect/mx.effects:IEffect:className/get:IEffectInstance=null):void;
function set perElementOffset(mx.effects:IEffect/mx.effects:IEffect:className/get:Number):void;
function resume():void;
function stop():void;
function set filter(mx.effects:IEffect/mx.effects:IEffect:className/get:String):void;
function createInstance(void:Object=null):IEffectInstance;
function play(_arg1:Array=null, _arg2:Boolean=false):Array;
function pause():void;
function get relevantProperties():Array;
function get filter():String;
function reverse():void;
function getAffectedProperties():Array;
function set relevantStyles(mx.effects:IEffect/mx.effects:IEffect:className/get:Array):void;
}
}//package mx.effects
Section 189
//IEffectInstance (mx.effects.IEffectInstance)
package mx.effects {
import flash.events.*;
import mx.effects.effectClasses.*;
public interface IEffectInstance {
function get playheadTime():Number;
function get triggerEvent():Event;
function set triggerEvent(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:Event):void;
function get hideFocusRing():Boolean;
function initEffect(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:Event):void;
function set startDelay(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:int):void;
function get effectTargetHost():IEffectTargetHost;
function finishEffect():void;
function set hideFocusRing(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:Boolean):void;
function finishRepeat():void;
function set repeatDelay(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:int):void;
function get effect():IEffect;
function startEffect():void;
function get duration():Number;
function get target():Object;
function get startDelay():int;
function stop():void;
function set effectTargetHost(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:IEffectTargetHost):void;
function set propertyChanges(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:PropertyChanges):void;
function set effect(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:IEffect):void;
function get className():String;
function set duration(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:Number):void;
function set target(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:Object):void;
function end():void;
function resume():void;
function get propertyChanges():PropertyChanges;
function set repeatCount(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:int):void;
function reverse():void;
function get repeatCount():int;
function pause():void;
function get repeatDelay():int;
function set suspendBackgroundProcessing(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:Boolean):void;
function play():void;
function get suspendBackgroundProcessing():Boolean;
}
}//package mx.effects
Section 190
//IEffectTargetHost (mx.effects.IEffectTargetHost)
package mx.effects {
public interface IEffectTargetHost {
function unconstrainRenderer(:Object):void;
function removeDataEffectItem(:Object):void;
function getRendererSemanticValue(_arg1:Object, _arg2:String):Object;
function addDataEffectItem(:Object):void;
}
}//package mx.effects
Section 191
//Tween (mx.effects.Tween)
package mx.effects {
import mx.core.*;
import flash.events.*;
import mx.events.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var started:Boolean;// = false
private var previousUpdateTime:Number;
public var duration:Number;// = 3000
private var id:int;
private var arrayMode:Boolean;
private var _isPlaying:Boolean;// = true
private var startValue:Object;
public var listener:Object;
private var userEquation:Function;
mx_internal var needToLayout:Boolean;// = false
private var updateFunction:Function;
private var _doSeek:Boolean;// = false
mx_internal var startTime:Number;
private var endFunction:Function;
private var endValue:Object;
private var _doReverse:Boolean;// = false
private var _playheadTime:Number;// = 0
private var _invertValues:Boolean;// = false
private var maxDelay:Number;// = 87.5
mx_internal static const VERSION:String = "3.2.0.3958";
private static var timer:Timer = null;
private static var interval:Number = 10;
mx_internal static var activeTweens:Array = [];
mx_internal static var intervalTime:Number = NAN;
public function Tween(listener:Object, startValue:Object, endValue:Object, duration:Number=-1, minFps:Number=-1, updateFunction:Function=null, endFunction:Function=null){
userEquation = defaultEasingFunction;
super();
if (!listener){
return;
};
if ((startValue is Array)){
arrayMode = true;
};
this.listener = listener;
this.startValue = startValue;
this.endValue = endValue;
if (((!(isNaN(duration))) && (!((duration == -1))))){
this.duration = duration;
};
if (((!(isNaN(minFps))) && (!((minFps == -1))))){
maxDelay = (1000 / minFps);
};
this.updateFunction = updateFunction;
this.endFunction = endFunction;
if (duration == 0){
id = -1;
endTween();
} else {
Tween.addTween(this);
};
}
mx_internal function get playheadTime():Number{
return (_playheadTime);
}
public function stop():void{
if (id >= 0){
Tween.removeTweenAt(id);
};
}
mx_internal function get playReversed():Boolean{
return (_invertValues);
}
mx_internal function set playReversed(value:Boolean):void{
_invertValues = value;
}
public function resume():void{
_isPlaying = true;
startTime = (intervalTime - _playheadTime);
if (_doReverse){
reverse();
_doReverse = false;
};
}
public function setTweenHandlers(updateFunction:Function, endFunction:Function):void{
this.updateFunction = updateFunction;
this.endFunction = endFunction;
}
private function defaultEasingFunction(t:Number, b:Number, c:Number, d:Number):Number{
return ((((c / 2) * (Math.sin((Math.PI * ((t / d) - 0.5))) + 1)) + b));
}
public function set easingFunction(value:Function):void{
userEquation = value;
}
public function endTween():void{
var event:TweenEvent = new TweenEvent(TweenEvent.TWEEN_END);
var value:Object = getCurrentValue(duration);
event.value = value;
dispatchEvent(event);
if (endFunction != null){
endFunction(value);
} else {
listener.onTweenEnd(value);
};
if (id >= 0){
Tween.removeTweenAt(id);
};
}
public function reverse():void{
if (_isPlaying){
_doReverse = false;
seek((duration - _playheadTime));
_invertValues = !(_invertValues);
} else {
_doReverse = !(_doReverse);
};
}
mx_internal function getCurrentValue(currentTime:Number):Object{
var returnArray:Array;
var n:int;
var i:int;
if (duration == 0){
return (endValue);
};
if (_invertValues){
currentTime = (duration - currentTime);
};
if (arrayMode){
returnArray = [];
n = startValue.length;
i = 0;
while (i < n) {
returnArray[i] = userEquation(currentTime, startValue[i], (endValue[i] - startValue[i]), duration);
i++;
};
return (returnArray);
//unresolved jump
};
return (userEquation(currentTime, startValue, (Number(endValue) - Number(startValue)), duration));
}
mx_internal function doInterval():Boolean{
var currentTime:Number;
var currentValue:Object;
var event:TweenEvent;
var startEvent:TweenEvent;
var tweenEnded:Boolean;
previousUpdateTime = intervalTime;
if (((_isPlaying) || (_doSeek))){
currentTime = (intervalTime - startTime);
_playheadTime = currentTime;
currentValue = getCurrentValue(currentTime);
if ((((currentTime >= duration)) && (!(_doSeek)))){
endTween();
tweenEnded = true;
} else {
if (!started){
startEvent = new TweenEvent(TweenEvent.TWEEN_START);
dispatchEvent(startEvent);
started = true;
};
event = new TweenEvent(TweenEvent.TWEEN_UPDATE);
event.value = currentValue;
dispatchEvent(event);
if (updateFunction != null){
updateFunction(currentValue);
} else {
listener.onTweenUpdate(currentValue);
};
};
_doSeek = false;
};
return (tweenEnded);
}
public function pause():void{
_isPlaying = false;
}
public function seek(playheadTime:Number):void{
var clockTime:Number = intervalTime;
previousUpdateTime = clockTime;
startTime = (clockTime - playheadTime);
_doSeek = true;
}
mx_internal static function removeTween(tween:Tween):void{
removeTweenAt(tween.id);
}
private static function addTween(tween:Tween):void{
tween.id = activeTweens.length;
activeTweens.push(tween);
if (!timer){
timer = new Timer(interval);
timer.addEventListener(TimerEvent.TIMER, timerHandler);
timer.start();
} else {
timer.start();
};
if (isNaN(intervalTime)){
intervalTime = getTimer();
};
tween.startTime = (tween.previousUpdateTime = intervalTime);
}
private static function timerHandler(event:TimerEvent):void{
var tween:Tween;
var needToLayout:Boolean;
var oldTime:Number = intervalTime;
intervalTime = getTimer();
var n:int = activeTweens.length;
var i:int = n;
while (i >= 0) {
tween = Tween(activeTweens[i]);
if (tween){
tween.needToLayout = false;
tween.doInterval();
if (tween.needToLayout){
needToLayout = true;
};
};
i--;
};
if (needToLayout){
UIComponentGlobals.layoutManager.validateNow();
};
event.updateAfterEvent();
}
private static function removeTweenAt(index:int):void{
var curTween:Tween;
if ((((index >= activeTweens.length)) || ((index < 0)))){
return;
};
activeTweens.splice(index, 1);
var n:int = activeTweens.length;
var i:int = index;
while (i < n) {
curTween = Tween(activeTweens[i]);
curTween.id--;
i++;
};
if (n == 0){
intervalTime = NaN;
timer.reset();
};
}
}
}//package mx.effects
Section 192
//TweenEffect (mx.effects.TweenEffect)
package mx.effects {
import mx.core.*;
import flash.events.*;
import mx.events.*;
import mx.effects.effectClasses.*;
public class TweenEffect extends Effect {
public var easingFunction:Function;// = null
mx_internal static const VERSION:String = "3.2.0.3958";
public function TweenEffect(target:Object=null){
super(target);
instanceClass = TweenEffectInstance;
}
protected function tweenEventHandler(event:TweenEvent):void{
dispatchEvent(event);
}
override protected function initInstance(instance:IEffectInstance):void{
super.initInstance(instance);
TweenEffectInstance(instance).easingFunction = easingFunction;
EventDispatcher(instance).addEventListener(TweenEvent.TWEEN_START, tweenEventHandler);
EventDispatcher(instance).addEventListener(TweenEvent.TWEEN_UPDATE, tweenEventHandler);
EventDispatcher(instance).addEventListener(TweenEvent.TWEEN_END, tweenEventHandler);
}
}
}//package mx.effects
Section 193
//Zoom (mx.effects.Zoom)
package mx.effects {
import mx.core.*;
import mx.effects.effectClasses.*;
public class Zoom extends TweenEffect {
public var zoomHeightFrom:Number;
public var zoomWidthTo:Number;
public var originX:Number;
public var zoomHeightTo:Number;
public var originY:Number;
public var captureRollEvents:Boolean;
public var zoomWidthFrom:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var AFFECTED_PROPERTIES:Array = ["scaleX", "scaleY", "x", "y", "width", "height"];
public function Zoom(target:Object=null){
super(target);
instanceClass = ZoomInstance;
applyActualDimensions = false;
relevantProperties = ["scaleX", "scaleY", "width", "height", "visible"];
}
override protected function initInstance(instance:IEffectInstance):void{
var zoomInstance:ZoomInstance;
super.initInstance(instance);
zoomInstance = ZoomInstance(instance);
zoomInstance.zoomWidthFrom = zoomWidthFrom;
zoomInstance.zoomWidthTo = zoomWidthTo;
zoomInstance.zoomHeightFrom = zoomHeightFrom;
zoomInstance.zoomHeightTo = zoomHeightTo;
zoomInstance.originX = originX;
zoomInstance.originY = originY;
zoomInstance.captureRollEvents = captureRollEvents;
}
override public function getAffectedProperties():Array{
return (AFFECTED_PROPERTIES);
}
}
}//package mx.effects
Section 194
//ChildExistenceChangedEvent (mx.events.ChildExistenceChangedEvent)
package mx.events {
import flash.display.*;
import mx.core.*;
import flash.events.*;
public class ChildExistenceChangedEvent extends Event {
public var relatedObject:DisplayObject;
public static const CHILD_REMOVE:String = "childRemove";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const OVERLAY_CREATED:String = "overlayCreated";
public static const CHILD_ADD:String = "childAdd";
public function ChildExistenceChangedEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, relatedObject:DisplayObject=null){
super(type, bubbles, cancelable);
this.relatedObject = relatedObject;
}
override public function clone():Event{
return (new ChildExistenceChangedEvent(type, bubbles, cancelable, relatedObject));
}
}
}//package mx.events
Section 195
//CloseEvent (mx.events.CloseEvent)
package mx.events {
import flash.events.*;
public class CloseEvent extends Event {
public var detail:int;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const CLOSE:String = "close";
public function CloseEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, detail:int=-1){
super(type, bubbles, cancelable);
this.detail = detail;
}
override public function clone():Event{
return (new CloseEvent(type, bubbles, cancelable, detail));
}
}
}//package mx.events
Section 196
//DragEvent (mx.events.DragEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
public class DragEvent extends MouseEvent {
public var draggedItem:Object;
public var action:String;
public var dragInitiator:IUIComponent;
public var dragSource:DragSource;
public static const DRAG_DROP:String = "dragDrop";
public static const DRAG_COMPLETE:String = "dragComplete";
public static const DRAG_EXIT:String = "dragExit";
public static const DRAG_ENTER:String = "dragEnter";
public static const DRAG_START:String = "dragStart";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const DRAG_OVER:String = "dragOver";
public function DragEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=true, dragInitiator:IUIComponent=null, dragSource:DragSource=null, action:String=null, ctrlKey:Boolean=false, altKey:Boolean=false, shiftKey:Boolean=false){
super(type, bubbles, cancelable);
this.dragInitiator = dragInitiator;
this.dragSource = dragSource;
this.action = action;
this.ctrlKey = ctrlKey;
this.altKey = altKey;
this.shiftKey = shiftKey;
}
override public function clone():Event{
var cloneEvent:DragEvent = new DragEvent(type, bubbles, cancelable, dragInitiator, dragSource, action, ctrlKey, altKey, shiftKey);
cloneEvent.relatedObject = this.relatedObject;
cloneEvent.localX = this.localX;
cloneEvent.localY = this.localY;
return (cloneEvent);
}
}
}//package mx.events
Section 197
//DynamicEvent (mx.events.DynamicEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
public dynamic class DynamicEvent extends Event {
mx_internal static const VERSION:String = "3.2.0.3958";
public function DynamicEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false){
super(type, bubbles, cancelable);
}
override public function clone():Event{
var p:String;
var event:DynamicEvent = new DynamicEvent(type, bubbles, cancelable);
for (p in this) {
event[p] = this[p];
};
return (event);
}
}
}//package mx.events
Section 198
//EffectEvent (mx.events.EffectEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
import mx.effects.*;
public class EffectEvent extends Event {
public var effectInstance:IEffectInstance;
public static const EFFECT_START:String = "effectStart";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const EFFECT_END:String = "effectEnd";
public function EffectEvent(eventType:String, bubbles:Boolean=false, cancelable:Boolean=false, effectInstance:IEffectInstance=null){
super(eventType, bubbles, cancelable);
this.effectInstance = effectInstance;
}
override public function clone():Event{
return (new EffectEvent(type, bubbles, cancelable, effectInstance));
}
}
}//package mx.events
Section 199
//EventListenerRequest (mx.events.EventListenerRequest)
package mx.events {
import mx.core.*;
import flash.events.*;
public class EventListenerRequest extends SWFBridgeRequest {
private var _priority:int;
private var _useWeakReference:Boolean;
private var _eventType:String;
private var _useCapture:Boolean;
public static const REMOVE_EVENT_LISTENER_REQUEST:String = "removeEventListenerRequest";
public static const ADD_EVENT_LISTENER_REQUEST:String = "addEventListenerRequest";
mx_internal static const VERSION:String = "3.2.0.3958";
public function EventListenerRequest(type:String, bubbles:Boolean=false, cancelable:Boolean=true, eventType:String=null, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false){
super(type, false, false);
_eventType = eventType;
_useCapture = useCapture;
_priority = priority;
_useWeakReference = useWeakReference;
}
public function get priority():int{
return (_priority);
}
public function get useWeakReference():Boolean{
return (_useWeakReference);
}
public function get eventType():String{
return (_eventType);
}
override public function clone():Event{
return (new EventListenerRequest(type, bubbles, cancelable, eventType, useCapture, priority, useWeakReference));
}
public function get useCapture():Boolean{
return (_useCapture);
}
public static function marshal(event:Event):EventListenerRequest{
var eventObj:Object = event;
return (new EventListenerRequest(eventObj.type, eventObj.bubbles, eventObj.cancelable, eventObj.eventType, eventObj.useCapture, eventObj.priority, eventObj.useWeakReference));
}
}
}//package mx.events
Section 200
//FlexEvent (mx.events.FlexEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
public class FlexEvent extends Event {
public static const ADD:String = "add";
public static const TRANSFORM_CHANGE:String = "transformChange";
public static const ENTER_FRAME:String = "flexEventEnterFrame";
public static const INIT_COMPLETE:String = "initComplete";
public static const REMOVE:String = "remove";
public static const BUTTON_DOWN:String = "buttonDown";
public static const EXIT_STATE:String = "exitState";
public static const CREATION_COMPLETE:String = "creationComplete";
public static const REPEAT:String = "repeat";
public static const LOADING:String = "loading";
public static const RENDER:String = "flexEventRender";
public static const REPEAT_START:String = "repeatStart";
public static const INITIALIZE:String = "initialize";
public static const ENTER_STATE:String = "enterState";
public static const URL_CHANGED:String = "urlChanged";
public static const REPEAT_END:String = "repeatEnd";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const HIDE:String = "hide";
public static const ENTER:String = "enter";
public static const PRELOADER_DONE:String = "preloaderDone";
public static const CURSOR_UPDATE:String = "cursorUpdate";
public static const PREINITIALIZE:String = "preinitialize";
public static const INVALID:String = "invalid";
public static const IDLE:String = "idle";
public static const VALID:String = "valid";
public static const DATA_CHANGE:String = "dataChange";
public static const APPLICATION_COMPLETE:String = "applicationComplete";
public static const VALUE_COMMIT:String = "valueCommit";
public static const UPDATE_COMPLETE:String = "updateComplete";
public static const INIT_PROGRESS:String = "initProgress";
public static const SHOW:String = "show";
public function FlexEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false){
super(type, bubbles, cancelable);
}
override public function clone():Event{
return (new FlexEvent(type, bubbles, cancelable));
}
}
}//package mx.events
Section 201
//FlexMouseEvent (mx.events.FlexMouseEvent)
package mx.events {
import flash.display.*;
import mx.core.*;
import flash.events.*;
public class FlexMouseEvent extends MouseEvent {
public static const MOUSE_DOWN_OUTSIDE:String = "mouseDownOutside";
public static const MOUSE_WHEEL_OUTSIDE:String = "mouseWheelOutside";
mx_internal static const VERSION:String = "3.2.0.3958";
public function FlexMouseEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, localX:Number=0, localY:Number=0, relatedObject:InteractiveObject=null, ctrlKey:Boolean=false, altKey:Boolean=false, shiftKey:Boolean=false, buttonDown:Boolean=false, delta:int=0){
super(type, bubbles, cancelable, localX, localY, relatedObject, ctrlKey, altKey, shiftKey, buttonDown, delta);
}
override public function clone():Event{
return (new FlexMouseEvent(type, bubbles, cancelable, localX, localY, relatedObject, ctrlKey, altKey, shiftKey, buttonDown, delta));
}
}
}//package mx.events
Section 202
//FocusRequestDirection (mx.events.FocusRequestDirection)
package mx.events {
public final class FocusRequestDirection {
public static const BACKWARD:String = "backward";
public static const FORWARD:String = "forward";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const BOTTOM:String = "bottom";
public static const TOP:String = "top";
public function FocusRequestDirection(){
super();
}
}
}//package mx.events
Section 203
//IndexChangedEvent (mx.events.IndexChangedEvent)
package mx.events {
import flash.display.*;
import flash.events.*;
public class IndexChangedEvent extends Event {
public var newIndex:Number;
public var triggerEvent:Event;
public var relatedObject:DisplayObject;
public var oldIndex:Number;
public static const HEADER_SHIFT:String = "headerShift";
public static const CHANGE:String = "change";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const CHILD_INDEX_CHANGE:String = "childIndexChange";
public function IndexChangedEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, relatedObject:DisplayObject=null, oldIndex:Number=-1, newIndex:Number=-1, triggerEvent:Event=null){
super(type, bubbles, cancelable);
this.relatedObject = relatedObject;
this.oldIndex = oldIndex;
this.newIndex = newIndex;
this.triggerEvent = triggerEvent;
}
override public function clone():Event{
return (new IndexChangedEvent(type, bubbles, cancelable, relatedObject, oldIndex, newIndex, triggerEvent));
}
}
}//package mx.events
Section 204
//InterManagerRequest (mx.events.InterManagerRequest)
package mx.events {
import mx.core.*;
import flash.events.*;
public class InterManagerRequest extends Event {
public var value:Object;
public var name:String;
public static const TOOLTIP_MANAGER_REQUEST:String = "tooltipManagerRequest";
public static const SYSTEM_MANAGER_REQUEST:String = "systemManagerRequest";
public static const INIT_MANAGER_REQUEST:String = "initManagerRequest";
public static const DRAG_MANAGER_REQUEST:String = "dragManagerRequest";
public static const CURSOR_MANAGER_REQUEST:String = "cursorManagerRequest";
mx_internal static const VERSION:String = "3.2.0.3958";
public function InterManagerRequest(type:String, bubbles:Boolean=false, cancelable:Boolean=false, name:String=null, value:Object=null){
super(type, bubbles, cancelable);
this.name = name;
this.value = value;
}
override public function clone():Event{
var cloneEvent:InterManagerRequest = new InterManagerRequest(type, bubbles, cancelable, name, value);
return (cloneEvent);
}
}
}//package mx.events
Section 205
//InvalidateRequestData (mx.events.InvalidateRequestData)
package mx.events {
import mx.core.*;
public final class InvalidateRequestData {
public static const SIZE:uint = 4;
public static const PROPERTIES:uint = 2;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const DISPLAY_LIST:uint = 1;
public function InvalidateRequestData(){
super();
}
}
}//package mx.events
Section 206
//ModuleEvent (mx.events.ModuleEvent)
package mx.events {
import mx.core.*;
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.2.0.3958";
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 207
//MoveEvent (mx.events.MoveEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
public class MoveEvent extends Event {
public var oldX:Number;
public var oldY:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const MOVE:String = "move";
public function MoveEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, oldX:Number=NaN, oldY:Number=NaN){
super(type, bubbles, cancelable);
this.oldX = oldX;
this.oldY = oldY;
}
override public function clone():Event{
return (new MoveEvent(type, bubbles, cancelable, oldX, oldY));
}
}
}//package mx.events
Section 208
//PropertyChangeEvent (mx.events.PropertyChangeEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
public class PropertyChangeEvent extends Event {
public var newValue:Object;
public var kind:String;
public var property:Object;
public var oldValue:Object;
public var source:Object;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const PROPERTY_CHANGE:String = "propertyChange";
public function PropertyChangeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, kind:String=null, property:Object=null, oldValue:Object=null, newValue:Object=null, source:Object=null){
super(type, bubbles, cancelable);
this.kind = kind;
this.property = property;
this.oldValue = oldValue;
this.newValue = newValue;
this.source = source;
}
override public function clone():Event{
return (new PropertyChangeEvent(type, bubbles, cancelable, kind, property, oldValue, newValue, source));
}
public static function createUpdateEvent(source:Object, property:Object, oldValue:Object, newValue:Object):PropertyChangeEvent{
var event:PropertyChangeEvent = new PropertyChangeEvent(PROPERTY_CHANGE);
event.kind = PropertyChangeEventKind.UPDATE;
event.oldValue = oldValue;
event.newValue = newValue;
event.source = source;
event.property = property;
return (event);
}
}
}//package mx.events
Section 209
//PropertyChangeEventKind (mx.events.PropertyChangeEventKind)
package mx.events {
import mx.core.*;
public final class PropertyChangeEventKind {
mx_internal static const VERSION:String = "3.2.0.3958";
public static const UPDATE:String = "update";
public static const DELETE:String = "delete";
public function PropertyChangeEventKind(){
super();
}
}
}//package mx.events
Section 210
//ResizeEvent (mx.events.ResizeEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
public class ResizeEvent extends Event {
public var oldHeight:Number;
public var oldWidth:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const RESIZE:String = "resize";
public function ResizeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, oldWidth:Number=NaN, oldHeight:Number=NaN){
super(type, bubbles, cancelable);
this.oldWidth = oldWidth;
this.oldHeight = oldHeight;
}
override public function clone():Event{
return (new ResizeEvent(type, bubbles, cancelable, oldWidth, oldHeight));
}
}
}//package mx.events
Section 211
//ResourceEvent (mx.events.ResourceEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
public class ResourceEvent extends ProgressEvent {
public var errorText:String;
mx_internal static const VERSION:String = "3.2.0.3958";
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 212
//RSLEvent (mx.events.RSLEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
import flash.net.*;
public class RSLEvent extends ProgressEvent {
public var errorText:String;
public var rslIndex:int;
public var rslTotal:int;
public var url:URLRequest;
public static const RSL_PROGRESS:String = "rslProgress";
public static const RSL_ERROR:String = "rslError";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const RSL_COMPLETE:String = "rslComplete";
public function RSLEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, bytesLoaded:int=-1, bytesTotal:int=-1, rslIndex:int=-1, rslTotal:int=-1, url:URLRequest=null, errorText:String=null){
super(type, bubbles, cancelable, bytesLoaded, bytesTotal);
this.rslIndex = rslIndex;
this.rslTotal = rslTotal;
this.url = url;
this.errorText = errorText;
}
override public function clone():Event{
return (new RSLEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, rslIndex, rslTotal, url, errorText));
}
}
}//package mx.events
Section 213
//SandboxMouseEvent (mx.events.SandboxMouseEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
public class SandboxMouseEvent extends Event {
public var buttonDown:Boolean;
public var altKey:Boolean;
public var ctrlKey:Boolean;
public var shiftKey:Boolean;
public static const CLICK_SOMEWHERE:String = "clickSomewhere";
public static const MOUSE_UP_SOMEWHERE:String = "mouseUpSomewhere";
public static const DOUBLE_CLICK_SOMEWHERE:String = "coubleClickSomewhere";
public static const MOUSE_WHEEL_SOMEWHERE:String = "mouseWheelSomewhere";
public static const MOUSE_DOWN_SOMEWHERE:String = "mouseDownSomewhere";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const MOUSE_MOVE_SOMEWHERE:String = "mouseMoveSomewhere";
public function SandboxMouseEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, ctrlKey:Boolean=false, altKey:Boolean=false, shiftKey:Boolean=false, buttonDown:Boolean=false){
super(type, bubbles, cancelable);
this.ctrlKey = ctrlKey;
this.altKey = altKey;
this.shiftKey = shiftKey;
this.buttonDown = buttonDown;
}
override public function clone():Event{
return (new SandboxMouseEvent(type, bubbles, cancelable, ctrlKey, altKey, shiftKey, buttonDown));
}
public static function marshal(event:Event):SandboxMouseEvent{
var eventObj:Object = event;
return (new SandboxMouseEvent(eventObj.type, eventObj.bubbles, eventObj.cancelable, eventObj.ctrlKey, eventObj.altKey, eventObj.shiftKey, eventObj.buttonDown));
}
}
}//package mx.events
Section 214
//ScrollEvent (mx.events.ScrollEvent)
package mx.events {
import flash.events.*;
public class ScrollEvent extends Event {
public var detail:String;
public var delta:Number;
public var position:Number;
public var direction:String;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const SCROLL:String = "scroll";
public function ScrollEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, detail:String=null, position:Number=NaN, direction:String=null, delta:Number=NaN){
super(type, bubbles, cancelable);
this.detail = detail;
this.position = position;
this.direction = direction;
this.delta = delta;
}
override public function clone():Event{
return (new ScrollEvent(type, bubbles, cancelable, detail, position, direction, delta));
}
}
}//package mx.events
Section 215
//ScrollEventDetail (mx.events.ScrollEventDetail)
package mx.events {
public final class ScrollEventDetail {
public static const LINE_UP:String = "lineUp";
public static const AT_RIGHT:String = "atRight";
public static const PAGE_UP:String = "pageUp";
public static const LINE_DOWN:String = "lineDown";
public static const PAGE_DOWN:String = "pageDown";
public static const AT_LEFT:String = "atLeft";
public static const PAGE_RIGHT:String = "pageRight";
public static const THUMB_POSITION:String = "thumbPosition";
public static const AT_TOP:String = "atTop";
public static const LINE_LEFT:String = "lineLeft";
public static const AT_BOTTOM:String = "atBottom";
public static const LINE_RIGHT:String = "lineRight";
public static const THUMB_TRACK:String = "thumbTrack";
public static const PAGE_LEFT:String = "pageLeft";
mx_internal static const VERSION:String = "3.2.0.3958";
public function ScrollEventDetail(){
super();
}
}
}//package mx.events
Section 216
//ScrollEventDirection (mx.events.ScrollEventDirection)
package mx.events {
public final class ScrollEventDirection {
public static const HORIZONTAL:String = "horizontal";
public static const VERTICAL:String = "vertical";
mx_internal static const VERSION:String = "3.2.0.3958";
public function ScrollEventDirection(){
super();
}
}
}//package mx.events
Section 217
//StateChangeEvent (mx.events.StateChangeEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
public class StateChangeEvent extends Event {
public var newState:String;
public var oldState:String;
public static const CURRENT_STATE_CHANGING:String = "currentStateChanging";
public static const CURRENT_STATE_CHANGE:String = "currentStateChange";
mx_internal static const VERSION:String = "3.2.0.3958";
public function StateChangeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, oldState:String=null, newState:String=null){
super(type, bubbles, cancelable);
this.oldState = oldState;
this.newState = newState;
}
override public function clone():Event{
return (new StateChangeEvent(type, bubbles, cancelable, oldState, newState));
}
}
}//package mx.events
Section 218
//StyleEvent (mx.events.StyleEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
public class StyleEvent extends ProgressEvent {
public var errorText:String;
mx_internal static const VERSION:String = "3.2.0.3958";
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 219
//SWFBridgeEvent (mx.events.SWFBridgeEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
public class SWFBridgeEvent extends Event {
public var data:Object;
public static const BRIDGE_FOCUS_MANAGER_ACTIVATE:String = "bridgeFocusManagerActivate";
public static const BRIDGE_WINDOW_ACTIVATE:String = "bridgeWindowActivate";
public static const BRIDGE_WINDOW_DEACTIVATE:String = "brdigeWindowDeactivate";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const BRIDGE_NEW_APPLICATION:String = "bridgeNewApplication";
public static const BRIDGE_APPLICATION_UNLOADING:String = "bridgeApplicationUnloading";
public static const BRIDGE_APPLICATION_ACTIVATE:String = "bridgeApplicationActivate";
public function SWFBridgeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, data:Object=null){
super(type, bubbles, cancelable);
this.data = data;
}
override public function clone():Event{
return (new SWFBridgeEvent(type, bubbles, cancelable, data));
}
public static function marshal(event:Event):SWFBridgeEvent{
var eventObj:Object = event;
return (new SWFBridgeEvent(eventObj.type, eventObj.bubbles, eventObj.cancelable, eventObj.data));
}
}
}//package mx.events
Section 220
//SWFBridgeRequest (mx.events.SWFBridgeRequest)
package mx.events {
import mx.core.*;
import flash.events.*;
public class SWFBridgeRequest extends Event {
public var requestor:IEventDispatcher;
public var data:Object;
public static const SHOW_MOUSE_CURSOR_REQUEST:String = "showMouseCursorRequest";
public static const DEACTIVATE_POP_UP_REQUEST:String = "deactivatePopUpRequest";
public static const SET_ACTUAL_SIZE_REQUEST:String = "setActualSizeRequest";
public static const MOVE_FOCUS_REQUEST:String = "moveFocusRequest";
public static const GET_VISIBLE_RECT_REQUEST:String = "getVisibleRectRequest";
public static const ADD_POP_UP_PLACE_HOLDER_REQUEST:String = "addPopUpPlaceHolderRequest";
public static const REMOVE_POP_UP_PLACE_HOLDER_REQUEST:String = "removePopUpPlaceHolderRequest";
public static const RESET_MOUSE_CURSOR_REQUEST:String = "resetMouseCursorRequest";
public static const ADD_POP_UP_REQUEST:String = "addPopUpRequest";
public static const GET_SIZE_REQUEST:String = "getSizeRequest";
public static const SHOW_MODAL_WINDOW_REQUEST:String = "showModalWindowRequest";
public static const ACTIVATE_FOCUS_REQUEST:String = "activateFocusRequest";
public static const DEACTIVATE_FOCUS_REQUEST:String = "deactivateFocusRequest";
public static const HIDE_MOUSE_CURSOR_REQUEST:String = "hideMouseCursorRequest";
public static const ACTIVATE_POP_UP_REQUEST:String = "activatePopUpRequest";
public static const IS_BRIDGE_CHILD_REQUEST:String = "isBridgeChildRequest";
public static const CAN_ACTIVATE_POP_UP_REQUEST:String = "canActivateRequestPopUpRequest";
public static const HIDE_MODAL_WINDOW_REQUEST:String = "hideModalWindowRequest";
public static const INVALIDATE_REQUEST:String = "invalidateRequest";
public static const SET_SHOW_FOCUS_INDICATOR_REQUEST:String = "setShowFocusIndicatorRequest";
public static const CREATE_MODAL_WINDOW_REQUEST:String = "createModalWindowRequest";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const REMOVE_POP_UP_REQUEST:String = "removePopUpRequest";
public function SWFBridgeRequest(type:String, bubbles:Boolean=false, cancelable:Boolean=false, requestor:IEventDispatcher=null, data:Object=null){
super(type, bubbles, cancelable);
this.requestor = requestor;
this.data = data;
}
override public function clone():Event{
return (new SWFBridgeRequest(type, bubbles, cancelable, requestor, data));
}
public static function marshal(event:Event):SWFBridgeRequest{
var eventObj:Object = event;
return (new SWFBridgeRequest(eventObj.type, eventObj.bubbles, eventObj.cancelable, eventObj.requestor, eventObj.data));
}
}
}//package mx.events
Section 221
//ToolTipEvent (mx.events.ToolTipEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
public class ToolTipEvent extends Event {
public var toolTip:IToolTip;
public static const TOOL_TIP_SHOWN:String = "toolTipShown";
public static const TOOL_TIP_CREATE:String = "toolTipCreate";
public static const TOOL_TIP_SHOW:String = "toolTipShow";
public static const TOOL_TIP_HIDE:String = "toolTipHide";
public static const TOOL_TIP_END:String = "toolTipEnd";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const TOOL_TIP_START:String = "toolTipStart";
public function ToolTipEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, toolTip:IToolTip=null){
super(type, bubbles, cancelable);
this.toolTip = toolTip;
}
override public function clone():Event{
return (new ToolTipEvent(type, bubbles, cancelable, toolTip));
}
}
}//package mx.events
Section 222
//TweenEvent (mx.events.TweenEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
public class TweenEvent extends Event {
public var value:Object;
public static const TWEEN_END:String = "tweenEnd";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const TWEEN_UPDATE:String = "tweenUpdate";
public static const TWEEN_START:String = "tweenStart";
public function TweenEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, value:Object=null){
super(type, bubbles, cancelable);
this.value = value;
}
override public function clone():Event{
return (new TweenEvent(type, bubbles, cancelable, value));
}
}
}//package mx.events
Section 223
//ValidationResultEvent (mx.events.ValidationResultEvent)
package mx.events {
import mx.core.*;
import flash.events.*;
public class ValidationResultEvent extends Event {
public var results:Array;
public var field:String;
public static const INVALID:String = "invalid";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const VALID:String = "valid";
public function ValidationResultEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, field:String=null, results:Array=null){
super(type, bubbles, cancelable);
this.field = field;
this.results = results;
}
public function get message():String{
var msg:String = "";
var n:int = results.length;
var i:int;
while (i < n) {
if (results[i].isError){
msg = (msg + ((msg == "")) ? "" : "\n");
msg = (msg + results[i].errorMessage);
};
i++;
};
return (msg);
}
override public function clone():Event{
return (new ValidationResultEvent(type, bubbles, cancelable, field, results));
}
}
}//package mx.events
Section 224
//RectangularDropShadow (mx.graphics.RectangularDropShadow)
package mx.graphics {
import flash.display.*;
import flash.geom.*;
import mx.core.*;
import flash.filters.*;
import mx.utils.*;
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.2.0.3958";
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 225
//RoundedRectangle (mx.graphics.RoundedRectangle)
package mx.graphics {
import flash.geom.*;
import mx.core.*;
public class RoundedRectangle extends Rectangle {
public var cornerRadius:Number;// = 0
mx_internal static const VERSION:String = "3.2.0.3958";
public function RoundedRectangle(x:Number=0, y:Number=0, width:Number=0, height:Number=0, cornerRadius:Number=0){
super(x, y, width, height);
this.cornerRadius = cornerRadius;
}
}
}//package mx.graphics
Section 226
//PriorityQueue (mx.managers.layoutClasses.PriorityQueue)
package mx.managers.layoutClasses {
import flash.display.*;
import mx.core.*;
import mx.managers.*;
public class PriorityQueue {
private var maxPriority:int;// = -1
private var arrayOfArrays:Array;
private var minPriority:int;// = 0
mx_internal static const VERSION:String = "3.2.0.3958";
public function PriorityQueue(){
arrayOfArrays = [];
super();
}
public function addObject(obj:Object, priority:int):void{
if (!arrayOfArrays[priority]){
arrayOfArrays[priority] = [];
};
arrayOfArrays[priority].push(obj);
if (maxPriority < minPriority){
minPriority = (maxPriority = priority);
} else {
if (priority < minPriority){
minPriority = priority;
};
if (priority > maxPriority){
maxPriority = priority;
};
};
}
public function removeSmallest():Object{
var obj:Object;
if (minPriority <= maxPriority){
while (((!(arrayOfArrays[minPriority])) || ((arrayOfArrays[minPriority].length == 0)))) {
minPriority++;
if (minPriority > maxPriority){
return (null);
};
};
obj = arrayOfArrays[minPriority].shift();
while (((!(arrayOfArrays[minPriority])) || ((arrayOfArrays[minPriority].length == 0)))) {
minPriority++;
if (minPriority > maxPriority){
break;
};
};
};
return (obj);
}
public function removeLargestChild(client:ILayoutManagerClient):Object{
var i:int;
var obj:Object;
var max:int = maxPriority;
var min:int = client.nestLevel;
while (min <= max) {
if (((arrayOfArrays[max]) && ((arrayOfArrays[max].length > 0)))){
i = 0;
while (i < arrayOfArrays[max].length) {
if (contains(DisplayObject(client), arrayOfArrays[max][i])){
obj = arrayOfArrays[max][i];
arrayOfArrays[max].splice(i, 1);
return (obj);
};
i++;
};
max--;
} else {
if (max == maxPriority){
maxPriority--;
};
max--;
if (max < min){
break;
};
};
};
return (obj);
}
public function isEmpty():Boolean{
return ((minPriority > maxPriority));
}
public function removeLargest():Object{
var obj:Object;
if (minPriority <= maxPriority){
while (((!(arrayOfArrays[maxPriority])) || ((arrayOfArrays[maxPriority].length == 0)))) {
maxPriority--;
if (maxPriority < minPriority){
return (null);
};
};
obj = arrayOfArrays[maxPriority].shift();
while (((!(arrayOfArrays[maxPriority])) || ((arrayOfArrays[maxPriority].length == 0)))) {
maxPriority--;
if (maxPriority < minPriority){
break;
};
};
};
return (obj);
}
public function removeSmallestChild(client:ILayoutManagerClient):Object{
var i:int;
var obj:Object;
var min:int = client.nestLevel;
while (min <= maxPriority) {
if (((arrayOfArrays[min]) && ((arrayOfArrays[min].length > 0)))){
i = 0;
while (i < arrayOfArrays[min].length) {
if (contains(DisplayObject(client), arrayOfArrays[min][i])){
obj = arrayOfArrays[min][i];
arrayOfArrays[min].splice(i, 1);
return (obj);
};
i++;
};
min++;
} else {
if (min == minPriority){
minPriority++;
};
min++;
if (min > maxPriority){
break;
};
};
};
return (obj);
}
public function removeAll():void{
arrayOfArrays.splice(0);
minPriority = 0;
maxPriority = -1;
}
private function contains(parent:DisplayObject, child:DisplayObject):Boolean{
var rawChildren:IChildList;
if ((parent is IRawChildrenContainer)){
rawChildren = IRawChildrenContainer(parent).rawChildren;
return (rawChildren.contains(child));
};
if ((parent is DisplayObjectContainer)){
return (DisplayObjectContainer(parent).contains(child));
};
return ((parent == child));
}
}
}//package mx.managers.layoutClasses
Section 227
//EventProxy (mx.managers.systemClasses.EventProxy)
package mx.managers.systemClasses {
import mx.managers.*;
import flash.events.*;
import mx.events.*;
import mx.utils.*;
public class EventProxy extends EventDispatcher {
private var systemManager:ISystemManager;
public function EventProxy(systemManager:ISystemManager){
super();
this.systemManager = systemManager;
}
public function marshalListener(event:Event):void{
var me:MouseEvent;
var mme:SandboxMouseEvent;
if ((event is MouseEvent)){
me = (event as MouseEvent);
mme = new SandboxMouseEvent(EventUtil.mouseEventMap[event.type], false, false, me.ctrlKey, me.altKey, me.shiftKey, me.buttonDown);
systemManager.dispatchEventFromSWFBridges(mme, null, true, true);
};
}
}
}//package mx.managers.systemClasses
Section 228
//PlaceholderData (mx.managers.systemClasses.PlaceholderData)
package mx.managers.systemClasses {
import flash.events.*;
public class PlaceholderData {
public var bridge:IEventDispatcher;
public var data:Object;
public var id:String;
public function PlaceholderData(id:String, bridge:IEventDispatcher, data:Object){
super();
this.id = id;
this.bridge = bridge;
this.data = data;
}
}
}//package mx.managers.systemClasses
Section 229
//RemotePopUp (mx.managers.systemClasses.RemotePopUp)
package mx.managers.systemClasses {
public class RemotePopUp {
public var window:Object;
public var bridge:Object;
public function RemotePopUp(window:Object, bridge:Object){
super();
this.window = window;
this.bridge = bridge;
}
}
}//package mx.managers.systemClasses
Section 230
//StageEventProxy (mx.managers.systemClasses.StageEventProxy)
package mx.managers.systemClasses {
import flash.display.*;
import flash.events.*;
public class StageEventProxy {
private var listener:Function;
public function StageEventProxy(listener:Function){
super();
this.listener = listener;
}
public function stageListener(event:Event):void{
if ((event.target is Stage)){
listener(event);
};
}
}
}//package mx.managers.systemClasses
Section 231
//CursorManager (mx.managers.CursorManager)
package mx.managers {
import mx.core.*;
public class CursorManager {
mx_internal static const VERSION:String = "3.2.0.3958";
public static const NO_CURSOR:int = 0;
private static var _impl:ICursorManager;
private static var implClassDependency:CursorManagerImpl;
public function CursorManager(){
super();
}
public static function set currentCursorYOffset(value:Number):void{
impl.currentCursorYOffset = value;
}
mx_internal static function registerToUseBusyCursor(source:Object):void{
impl.registerToUseBusyCursor(source);
}
public static function get currentCursorID():int{
return (impl.currentCursorID);
}
public static function getInstance():ICursorManager{
return (impl);
}
public static function removeBusyCursor():void{
impl.removeBusyCursor();
}
public static function setCursor(cursorClass:Class, priority:int=2, xOffset:Number=0, yOffset:Number=0):int{
return (impl.setCursor(cursorClass, priority, xOffset, yOffset));
}
public static function set currentCursorID(value:int):void{
impl.currentCursorID = value;
}
mx_internal static function unRegisterToUseBusyCursor(source:Object):void{
impl.unRegisterToUseBusyCursor(source);
}
private static function get impl():ICursorManager{
if (!_impl){
_impl = ICursorManager(Singleton.getInstance("mx.managers::ICursorManager"));
};
return (_impl);
}
public static function removeAllCursors():void{
impl.removeAllCursors();
}
public static function setBusyCursor():void{
impl.setBusyCursor();
}
public static function showCursor():void{
impl.showCursor();
}
public static function hideCursor():void{
impl.hideCursor();
}
public static function removeCursor(cursorID:int):void{
impl.removeCursor(cursorID);
}
public static function get currentCursorXOffset():Number{
return (impl.currentCursorXOffset);
}
public static function get currentCursorYOffset():Number{
return (impl.currentCursorYOffset);
}
public static function set currentCursorXOffset(value:Number):void{
impl.currentCursorXOffset = value;
}
}
}//package mx.managers
Section 232
//CursorManagerImpl (mx.managers.CursorManagerImpl)
package mx.managers {
import flash.display.*;
import flash.geom.*;
import mx.core.*;
import flash.text.*;
import flash.events.*;
import mx.events.*;
import mx.styles.*;
import flash.ui.*;
public class CursorManagerImpl implements ICursorManager {
private var showSystemCursor:Boolean;// = false
private var nextCursorID:int;// = 1
private var systemManager:ISystemManager;// = null
private var cursorList:Array;
private var _currentCursorYOffset:Number;// = 0
private var cursorHolder:Sprite;
private var currentCursor:DisplayObject;
private var sandboxRoot:IEventDispatcher;// = null
private var showCustomCursor:Boolean;// = false
private var listenForContextMenu:Boolean;// = false
private var _currentCursorID:int;// = 0
private var initialized:Boolean;// = false
private var overTextField:Boolean;// = false
private var _currentCursorXOffset:Number;// = 0
private var busyCursorList:Array;
private var overLink:Boolean;// = false
private var sourceArray:Array;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var instance:ICursorManager;
public function CursorManagerImpl(systemManager:ISystemManager=null){
cursorList = [];
busyCursorList = [];
sourceArray = [];
super();
if (((instance) && (!(systemManager)))){
throw (new Error("Instance already exists."));
};
if (systemManager){
this.systemManager = (systemManager as ISystemManager);
} else {
this.systemManager = (SystemManagerGlobals.topLevelSystemManagers[0] as ISystemManager);
};
sandboxRoot = this.systemManager.getSandboxRoot();
sandboxRoot.addEventListener(InterManagerRequest.CURSOR_MANAGER_REQUEST, marshalCursorManagerHandler, false, 0, true);
var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "update";
sandboxRoot.dispatchEvent(me);
}
public function set currentCursorYOffset(value:Number):void{
var me:InterManagerRequest;
_currentCursorYOffset = value;
if (!cursorHolder){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "currentCursorYOffset";
me.value = currentCursorYOffset;
sandboxRoot.dispatchEvent(me);
};
}
public function get currentCursorXOffset():Number{
return (_currentCursorXOffset);
}
public function removeCursor(cursorID:int):void{
var i:Object;
var me:InterManagerRequest;
var item:CursorQueueItem;
if (((initialized) && (!(cursorHolder)))){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "removeCursor";
me.value = cursorID;
sandboxRoot.dispatchEvent(me);
return;
};
for (i in cursorList) {
item = cursorList[i];
if (item.cursorID == cursorID){
cursorList.splice(i, 1);
showCurrentCursor();
break;
};
};
}
public function get currentCursorID():int{
return (_currentCursorID);
}
private function marshalMouseMoveHandler(event:Event):void{
var cursorRequest:SWFBridgeRequest;
var bridge:IEventDispatcher;
if (cursorHolder.visible){
cursorHolder.visible = false;
cursorRequest = new SWFBridgeRequest(SWFBridgeRequest.SHOW_MOUSE_CURSOR_REQUEST);
if (systemManager.useSWFBridge()){
bridge = systemManager.swfBridgeGroup.parentBridge;
} else {
bridge = systemManager;
};
cursorRequest.requestor = bridge;
bridge.dispatchEvent(cursorRequest);
if (cursorRequest.data){
Mouse.show();
};
};
}
public function set currentCursorID(value:int):void{
var me:InterManagerRequest;
_currentCursorID = value;
if (!cursorHolder){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "currentCursorID";
me.value = currentCursorID;
sandboxRoot.dispatchEvent(me);
};
}
public function removeAllCursors():void{
var me:InterManagerRequest;
if (((initialized) && (!(cursorHolder)))){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "removeAllCursors";
sandboxRoot.dispatchEvent(me);
return;
};
cursorList.splice(0);
showCurrentCursor();
}
private function priorityCompare(a:CursorQueueItem, b:CursorQueueItem):int{
if (a.priority < b.priority){
return (-1);
};
if (a.priority == b.priority){
return (0);
};
return (1);
}
public function setBusyCursor():void{
var me:InterManagerRequest;
if (((initialized) && (!(cursorHolder)))){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "setBusyCursor";
sandboxRoot.dispatchEvent(me);
return;
};
var cursorManagerStyleDeclaration:CSSStyleDeclaration = StyleManager.getStyleDeclaration("CursorManager");
var busyCursorClass:Class = cursorManagerStyleDeclaration.getStyle("busyCursor");
busyCursorList.push(setCursor(busyCursorClass, CursorManagerPriority.LOW));
}
public function showCursor():void{
var me:InterManagerRequest;
if (cursorHolder){
cursorHolder.visible = true;
} else {
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "showCursor";
sandboxRoot.dispatchEvent(me);
};
}
private function findSource(target:Object):int{
var n:int = sourceArray.length;
var i:int;
while (i < n) {
if (sourceArray[i] === target){
return (i);
};
i++;
};
return (-1);
}
private function showCurrentCursor():void{
var app:InteractiveObject;
var sm:InteractiveObject;
var item:CursorQueueItem;
var me:InterManagerRequest;
var pt:Point;
if (cursorList.length > 0){
if (!initialized){
cursorHolder = new FlexSprite();
cursorHolder.name = "cursorHolder";
cursorHolder.mouseEnabled = false;
cursorHolder.mouseChildren = false;
systemManager.addChildToSandboxRoot("cursorChildren", cursorHolder);
initialized = true;
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "initialized";
sandboxRoot.dispatchEvent(me);
};
item = cursorList[0];
if (currentCursorID == CursorManager.NO_CURSOR){
Mouse.hide();
};
if (item.cursorID != currentCursorID){
if (cursorHolder.numChildren > 0){
cursorHolder.removeChildAt(0);
};
currentCursor = new item.cursorClass();
if (currentCursor){
if ((currentCursor is InteractiveObject)){
InteractiveObject(currentCursor).mouseEnabled = false;
};
if ((currentCursor is DisplayObjectContainer)){
DisplayObjectContainer(currentCursor).mouseChildren = false;
};
cursorHolder.addChild(currentCursor);
if (!listenForContextMenu){
app = (systemManager.document as InteractiveObject);
if (((app) && (app.contextMenu))){
app.contextMenu.addEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelectHandler);
listenForContextMenu = true;
};
sm = (systemManager as InteractiveObject);
if (((sm) && (sm.contextMenu))){
sm.contextMenu.addEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelectHandler);
listenForContextMenu = true;
};
};
if ((systemManager is SystemManager)){
pt = new Point((SystemManager(systemManager).mouseX + item.x), (SystemManager(systemManager).mouseY + item.y));
pt = SystemManager(systemManager).localToGlobal(pt);
pt = cursorHolder.parent.globalToLocal(pt);
cursorHolder.x = pt.x;
cursorHolder.y = pt.y;
} else {
if ((systemManager is DisplayObject)){
pt = new Point((DisplayObject(systemManager).mouseX + item.x), (DisplayObject(systemManager).mouseY + item.y));
pt = DisplayObject(systemManager).localToGlobal(pt);
pt = cursorHolder.parent.globalToLocal(pt);
cursorHolder.x = (DisplayObject(systemManager).mouseX + item.x);
cursorHolder.y = (DisplayObject(systemManager).mouseY + item.y);
} else {
cursorHolder.x = item.x;
cursorHolder.y = item.y;
};
};
if (systemManager.useSWFBridge()){
sandboxRoot.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true, EventPriority.CURSOR_MANAGEMENT);
} else {
systemManager.stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true, EventPriority.CURSOR_MANAGEMENT);
};
sandboxRoot.addEventListener(SandboxMouseEvent.MOUSE_MOVE_SOMEWHERE, marshalMouseMoveHandler, false, EventPriority.CURSOR_MANAGEMENT);
};
currentCursorID = item.cursorID;
currentCursorXOffset = item.x;
currentCursorYOffset = item.y;
};
} else {
if (currentCursorID != CursorManager.NO_CURSOR){
currentCursorID = CursorManager.NO_CURSOR;
currentCursorXOffset = 0;
currentCursorYOffset = 0;
if (systemManager.useSWFBridge()){
sandboxRoot.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true);
} else {
systemManager.stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true);
};
sandboxRoot.removeEventListener(SandboxMouseEvent.MOUSE_MOVE_SOMEWHERE, marshalMouseMoveHandler, false);
cursorHolder.removeChild(currentCursor);
if (listenForContextMenu){
app = (systemManager.document as InteractiveObject);
if (((app) && (app.contextMenu))){
app.contextMenu.removeEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelectHandler);
};
sm = (systemManager as InteractiveObject);
if (((sm) && (sm.contextMenu))){
sm.contextMenu.removeEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelectHandler);
};
listenForContextMenu = false;
};
};
Mouse.show();
};
}
public function get currentCursorYOffset():Number{
return (_currentCursorYOffset);
}
private function contextMenu_menuSelectHandler(event:ContextMenuEvent):void{
showCustomCursor = true;
sandboxRoot.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
}
public function hideCursor():void{
var me:InterManagerRequest;
if (cursorHolder){
cursorHolder.visible = false;
} else {
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "hideCursor";
sandboxRoot.dispatchEvent(me);
};
}
private function marshalCursorManagerHandler(event:Event):void{
var me:InterManagerRequest;
if ((event is InterManagerRequest)){
return;
};
var marshalEvent:Object = event;
switch (marshalEvent.name){
case "initialized":
initialized = marshalEvent.value;
break;
case "currentCursorID":
_currentCursorID = marshalEvent.value;
break;
case "currentCursorXOffset":
_currentCursorXOffset = marshalEvent.value;
break;
case "currentCursorYOffset":
_currentCursorYOffset = marshalEvent.value;
break;
case "showCursor":
if (cursorHolder){
cursorHolder.visible = true;
};
break;
case "hideCursor":
if (cursorHolder){
cursorHolder.visible = false;
};
break;
case "setCursor":
if (cursorHolder){
marshalEvent.value = setCursor.apply(this, marshalEvent.value);
};
break;
case "removeCursor":
if (cursorHolder){
removeCursor.apply(this, [marshalEvent.value]);
};
break;
case "removeAllCursors":
if (cursorHolder){
removeAllCursors();
};
break;
case "setBusyCursor":
if (cursorHolder){
setBusyCursor();
};
break;
case "removeBusyCursor":
if (cursorHolder){
removeBusyCursor();
};
break;
case "registerToUseBusyCursor":
if (cursorHolder){
registerToUseBusyCursor.apply(this, marshalEvent.value);
};
break;
case "unRegisterToUseBusyCursor":
if (cursorHolder){
unRegisterToUseBusyCursor.apply(this, marshalEvent.value);
};
break;
case "update":
if (cursorHolder){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "initialized";
me.value = true;
sandboxRoot.dispatchEvent(me);
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "currentCursorID";
me.value = currentCursorID;
sandboxRoot.dispatchEvent(me);
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "currentCursorXOffset";
me.value = currentCursorXOffset;
sandboxRoot.dispatchEvent(me);
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "currentCursorYOffset";
me.value = currentCursorYOffset;
sandboxRoot.dispatchEvent(me);
};
};
}
public function registerToUseBusyCursor(source:Object):void{
var me:InterManagerRequest;
if (((initialized) && (!(cursorHolder)))){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "registerToUseBusyCursor";
me.value = source;
sandboxRoot.dispatchEvent(me);
return;
};
if (((source) && ((source is EventDispatcher)))){
source.addEventListener(ProgressEvent.PROGRESS, progressHandler);
source.addEventListener(Event.COMPLETE, completeHandler);
source.addEventListener(IOErrorEvent.IO_ERROR, completeHandler);
};
}
private function completeHandler(event:Event):void{
var sourceIndex:int = findSource(event.target);
if (sourceIndex != -1){
sourceArray.splice(sourceIndex, 1);
removeBusyCursor();
};
}
public function removeBusyCursor():void{
var me:InterManagerRequest;
if (((initialized) && (!(cursorHolder)))){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "removeBusyCursor";
sandboxRoot.dispatchEvent(me);
return;
};
if (busyCursorList.length > 0){
removeCursor(int(busyCursorList.pop()));
};
}
public function setCursor(cursorClass:Class, priority:int=2, xOffset:Number=0, yOffset:Number=0):int{
var me:InterManagerRequest;
if (((initialized) && (!(cursorHolder)))){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "setCursor";
me.value = [cursorClass, priority, xOffset, yOffset];
sandboxRoot.dispatchEvent(me);
return ((me.value as int));
};
var cursorID:int = nextCursorID++;
var item:CursorQueueItem = new CursorQueueItem();
item.cursorID = cursorID;
item.cursorClass = cursorClass;
item.priority = priority;
item.x = xOffset;
item.y = yOffset;
if (systemManager){
item.systemManager = systemManager;
} else {
item.systemManager = ApplicationGlobals.application.systemManager;
};
cursorList.push(item);
cursorList.sort(priorityCompare);
showCurrentCursor();
return (cursorID);
}
private function progressHandler(event:ProgressEvent):void{
var sourceIndex:int = findSource(event.target);
if (sourceIndex == -1){
sourceArray.push(event.target);
setBusyCursor();
};
}
private function mouseMoveHandler(event:MouseEvent):void{
var cursorRequest:SWFBridgeRequest;
var bridge:IEventDispatcher;
var pt:Point = new Point(event.stageX, event.stageY);
pt = cursorHolder.parent.globalToLocal(pt);
pt.x = (pt.x + currentCursorXOffset);
pt.y = (pt.y + currentCursorYOffset);
cursorHolder.x = pt.x;
cursorHolder.y = pt.y;
var target:Object = event.target;
if (((((!(overTextField)) && ((target is TextField)))) && ((target.type == TextFieldType.INPUT)))){
overTextField = true;
showSystemCursor = true;
} else {
if (((overTextField) && (!((((target is TextField)) && ((target.type == TextFieldType.INPUT))))))){
overTextField = false;
showCustomCursor = true;
} else {
showCustomCursor = true;
};
};
if (showSystemCursor){
showSystemCursor = false;
cursorHolder.visible = false;
Mouse.show();
};
if (showCustomCursor){
showCustomCursor = false;
cursorHolder.visible = true;
Mouse.hide();
cursorRequest = new SWFBridgeRequest(SWFBridgeRequest.HIDE_MOUSE_CURSOR_REQUEST);
if (systemManager.useSWFBridge()){
bridge = systemManager.swfBridgeGroup.parentBridge;
} else {
bridge = systemManager;
};
cursorRequest.requestor = bridge;
bridge.dispatchEvent(cursorRequest);
};
}
public function unRegisterToUseBusyCursor(source:Object):void{
var me:InterManagerRequest;
if (((initialized) && (!(cursorHolder)))){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "unRegisterToUseBusyCursor";
me.value = source;
sandboxRoot.dispatchEvent(me);
return;
};
if (((source) && ((source is EventDispatcher)))){
source.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
source.removeEventListener(Event.COMPLETE, completeHandler);
source.removeEventListener(IOErrorEvent.IO_ERROR, completeHandler);
};
}
private function mouseOverHandler(event:MouseEvent):void{
sandboxRoot.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
mouseMoveHandler(event);
}
public function set currentCursorXOffset(value:Number):void{
var me:InterManagerRequest;
_currentCursorXOffset = value;
if (!cursorHolder){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "currentCursorXOffset";
me.value = currentCursorXOffset;
sandboxRoot.dispatchEvent(me);
};
}
public static function getInstance():ICursorManager{
if (!instance){
instance = new (CursorManagerImpl);
};
return (instance);
}
}
}//package mx.managers
import mx.core.*;
class CursorQueueItem {
public var priority:int;// = 2
public var cursorClass:Class;// = null
public var cursorID:int;// = 0
public var x:Number;
public var y:Number;
public var systemManager:ISystemManager;
mx_internal static const VERSION:String = "3.2.0.3958";
private function CursorQueueItem(){
super();
}
}
Section 233
//CursorManagerPriority (mx.managers.CursorManagerPriority)
package mx.managers {
import mx.core.*;
public final class CursorManagerPriority {
public static const HIGH:int = 1;
public static const MEDIUM:int = 2;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const LOW:int = 3;
public function CursorManagerPriority(){
super();
}
}
}//package mx.managers
Section 234
//FocusManager (mx.managers.FocusManager)
package mx.managers {
import flash.display.*;
import mx.core.*;
import flash.events.*;
import mx.events.*;
import flash.text.*;
import flash.ui.*;
import flash.system.*;
public class FocusManager implements IFocusManager {
private var lastActiveFocusManager:FocusManager;
private var _showFocusIndicator:Boolean;// = false
private var focusableCandidates:Array;
private var LARGE_TAB_INDEX:int;// = 99999
private var browserFocusComponent:InteractiveObject;
private var calculateCandidates:Boolean;// = true
private var _lastFocus:IFocusManagerComponent;
private var lastAction:String;
private var focusSetLocally:Boolean;
private var focusableObjects:Array;
private var swfBridgeGroup:SWFBridgeGroup;
private var defButton:IButton;
private var _form:IFocusManagerContainer;
private var popup:Boolean;
private var focusChanged:Boolean;
private var _defaultButtonEnabled:Boolean;// = true
private var activated:Boolean;// = false
private var _defaultButton:IButton;
private var fauxFocus:DisplayObject;
private var _focusPane:Sprite;
private var skipBridge:IEventDispatcher;
public var browserMode:Boolean;
mx_internal static const VERSION:String = "3.2.0.3958";
private static const FROM_INDEX_UNSPECIFIED:int = -2;
public function FocusManager(container:IFocusManagerContainer, popup:Boolean=false){
var sm:ISystemManager;
var bridge:IEventDispatcher;
var container = container;
var popup = popup;
super();
this.popup = popup;
browserMode = (((Capabilities.playerType == "ActiveX")) && (!(popup)));
container.focusManager = this;
_form = container;
focusableObjects = [];
focusPane = new FlexSprite();
focusPane.name = "focusPane";
addFocusables(DisplayObject(container));
container.addEventListener(Event.ADDED, addedHandler);
container.addEventListener(Event.REMOVED, removedHandler);
container.addEventListener(FlexEvent.SHOW, showHandler);
container.addEventListener(FlexEvent.HIDE, hideHandler);
if ((container.systemManager is SystemManager)){
if (container != SystemManager(container.systemManager).application){
container.addEventListener(FlexEvent.CREATION_COMPLETE, creationCompleteHandler);
};
};
container.systemManager.addFocusManager(container);
sm = form.systemManager;
swfBridgeGroup = new SWFBridgeGroup(sm);
if (!popup){
swfBridgeGroup.parentBridge = sm.swfBridgeGroup.parentBridge;
};
if (sm.useSWFBridge()){
sm.addEventListener(SWFBridgeEvent.BRIDGE_APPLICATION_UNLOADING, removeFromParentBridge);
bridge = swfBridgeGroup.parentBridge;
if (bridge){
bridge.addEventListener(SWFBridgeRequest.MOVE_FOCUS_REQUEST, focusRequestMoveHandler);
bridge.addEventListener(SWFBridgeRequest.SET_SHOW_FOCUS_INDICATOR_REQUEST, setShowFocusIndicatorRequestHandler);
};
if (((bridge) && (!((form.systemManager is SystemManagerProxy))))){
bridge.addEventListener(SWFBridgeRequest.ACTIVATE_FOCUS_REQUEST, focusRequestActivateHandler);
bridge.addEventListener(SWFBridgeRequest.DEACTIVATE_FOCUS_REQUEST, focusRequestDeactivateHandler);
bridge.addEventListener(SWFBridgeEvent.BRIDGE_FOCUS_MANAGER_ACTIVATE, bridgeEventActivateHandler);
};
container.addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
};
//unresolved jump
var _slot1 = e;
}
private function dispatchSetShowFocusIndicatorRequest(value:Boolean, skip:IEventDispatcher):void{
var request:SWFBridgeRequest = new SWFBridgeRequest(SWFBridgeRequest.SET_SHOW_FOCUS_INDICATOR_REQUEST, false, false, null, value);
dispatchEventFromSWFBridges(request, skip);
}
private function creationCompleteHandler(event:FlexEvent):void{
if (((DisplayObject(form).visible) && (!(activated)))){
form.systemManager.activate(form);
};
}
private function addFocusables(o:DisplayObject, skipTopLevel:Boolean=false):void{
var addToFocusables:Boolean;
var focusable:IFocusManagerComponent;
var doc:DisplayObjectContainer;
var rawChildren:IChildList;
var i:int;
var o = o;
var skipTopLevel = skipTopLevel;
if ((((o is IFocusManagerComponent)) && (!(skipTopLevel)))){
addToFocusables = false;
if ((o is IFocusManagerComponent)){
focusable = IFocusManagerComponent(o);
if (focusable.focusEnabled){
if (((focusable.tabEnabled) && (isTabVisible(o)))){
addToFocusables = true;
};
};
};
if (addToFocusables){
if (focusableObjects.indexOf(o) == -1){
focusableObjects.push(o);
calculateCandidates = true;
};
o.addEventListener("tabEnabledChange", tabEnabledChangeHandler);
o.addEventListener("tabIndexChange", tabIndexChangeHandler);
};
};
if ((o is DisplayObjectContainer)){
doc = DisplayObjectContainer(o);
o.addEventListener("tabChildrenChange", tabChildrenChangeHandler);
if (doc.tabChildren){
if ((o is IRawChildrenContainer)){
rawChildren = IRawChildrenContainer(o).rawChildren;
i = 0;
for (;i < rawChildren.numChildren;(i = (i + 1))) {
addFocusables(rawChildren.getChildAt(i));
continue;
var _slot1 = error;
};
} else {
i = 0;
for (;i < doc.numChildren;(i = (i + 1))) {
addFocusables(doc.getChildAt(i));
continue;
var _slot1 = error;
};
};
};
};
}
private function tabEnabledChangeHandler(event:Event):void{
calculateCandidates = true;
var o:InteractiveObject = InteractiveObject(event.target);
var n:int = focusableObjects.length;
var i:int;
while (i < n) {
if (focusableObjects[i] == o){
break;
};
i++;
};
if (o.tabEnabled){
if ((((i == n)) && (isTabVisible(o)))){
if (focusableObjects.indexOf(o) == -1){
focusableObjects.push(o);
};
};
} else {
if (i < n){
focusableObjects.splice(i, 1);
};
};
}
private function mouseFocusChangeHandler(event:FocusEvent):void{
var tf:TextField;
if ((((((event.relatedObject == null)) && (("isRelatedObjectInaccessible" in event)))) && ((event["isRelatedObjectInaccessible"] == true)))){
return;
};
if ((event.relatedObject is TextField)){
tf = (event.relatedObject as TextField);
if ((((tf.type == "input")) || (tf.selectable))){
return;
};
};
event.preventDefault();
}
public function addSWFBridge(bridge:IEventDispatcher, owner:DisplayObject):void{
if (!owner){
return;
};
var sm:ISystemManager = _form.systemManager;
if (focusableObjects.indexOf(owner) == -1){
focusableObjects.push(owner);
calculateCandidates = true;
};
swfBridgeGroup.addChildBridge(bridge, ISWFBridgeProvider(owner));
bridge.addEventListener(SWFBridgeRequest.MOVE_FOCUS_REQUEST, focusRequestMoveHandler);
bridge.addEventListener(SWFBridgeRequest.SET_SHOW_FOCUS_INDICATOR_REQUEST, setShowFocusIndicatorRequestHandler);
bridge.addEventListener(SWFBridgeEvent.BRIDGE_FOCUS_MANAGER_ACTIVATE, bridgeEventActivateHandler);
}
private function getChildIndex(parent:DisplayObjectContainer, child:DisplayObject):int{
var parent = parent;
var child = child;
return (parent.getChildIndex(child));
//unresolved jump
var _slot1 = e;
if ((parent is IRawChildrenContainer)){
return (IRawChildrenContainer(parent).rawChildren.getChildIndex(child));
};
throw (_slot1);
throw (new Error("FocusManager.getChildIndex failed"));
}
private function bridgeEventActivateHandler(event:Event):void{
if ((event is SWFBridgeEvent)){
return;
};
lastActiveFocusManager = null;
_lastFocus = null;
dispatchActivatedFocusManagerEvent(IEventDispatcher(event.target));
}
private function focusOutHandler(event:FocusEvent):void{
var target:InteractiveObject = InteractiveObject(event.target);
}
private function isValidFocusCandidate(o:DisplayObject, g:String):Boolean{
var tg:IFocusManagerGroup;
if (!isEnabledAndVisible(o)){
return (false);
};
if ((o is IFocusManagerGroup)){
tg = IFocusManagerGroup(o);
if (g == tg.groupName){
return (false);
};
};
return (true);
}
private function removeFocusables(o:DisplayObject, dontRemoveTabChildrenHandler:Boolean):void{
var i:int;
if ((o is DisplayObjectContainer)){
if (!dontRemoveTabChildrenHandler){
o.removeEventListener("tabChildrenChange", tabChildrenChangeHandler);
};
i = 0;
while (i < focusableObjects.length) {
if (isParent(DisplayObjectContainer(o), focusableObjects[i])){
if (focusableObjects[i] == _lastFocus){
_lastFocus.drawFocus(false);
_lastFocus = null;
};
focusableObjects[i].removeEventListener("tabEnabledChange", tabEnabledChangeHandler);
focusableObjects[i].removeEventListener("tabIndexChange", tabIndexChangeHandler);
focusableObjects.splice(i, 1);
i--;
calculateCandidates = true;
};
i++;
};
};
}
private function addedHandler(event:Event):void{
var target:DisplayObject = DisplayObject(event.target);
if (target.stage){
addFocusables(DisplayObject(event.target));
};
}
private function tabChildrenChangeHandler(event:Event):void{
if (event.target != event.currentTarget){
return;
};
calculateCandidates = true;
var o:DisplayObjectContainer = DisplayObjectContainer(event.target);
if (o.tabChildren){
addFocusables(o, true);
} else {
removeFocusables(o, true);
};
}
private function sortByDepth(aa:DisplayObject, bb:DisplayObject):Number{
var index:int;
var tmp:String;
var tmp2:String;
var val1:String = "";
var val2:String = "";
var zeros:String = "0000";
var a:DisplayObject = DisplayObject(aa);
var b:DisplayObject = DisplayObject(bb);
while (((!((a == DisplayObject(form)))) && (a.parent))) {
index = getChildIndex(a.parent, a);
tmp = index.toString(16);
if (tmp.length < 4){
tmp2 = (zeros.substring(0, (4 - tmp.length)) + tmp);
};
val1 = (tmp2 + val1);
a = a.parent;
};
while (((!((b == DisplayObject(form)))) && (b.parent))) {
index = getChildIndex(b.parent, b);
tmp = index.toString(16);
if (tmp.length < 4){
tmp2 = (zeros.substring(0, (4 - tmp.length)) + tmp);
};
val2 = (tmp2 + val2);
b = b.parent;
};
return (((val1 > val2)) ? 1 : ((val1 < val2)) ? -1 : 0);
}
mx_internal function sendDefaultButtonEvent():void{
defButton.dispatchEvent(new MouseEvent("click"));
}
public function getFocus():IFocusManagerComponent{
var o:InteractiveObject = form.systemManager.stage.focus;
return (findFocusManagerComponent(o));
}
private function deactivateHandler(event:Event):void{
}
private function setFocusToBottom():void{
setFocusToNextIndex(focusableObjects.length, true);
}
private function tabIndexChangeHandler(event:Event):void{
calculateCandidates = true;
}
private function sortFocusableObjects():void{
var c:InteractiveObject;
focusableCandidates = [];
var n:int = focusableObjects.length;
var i:int;
while (i < n) {
c = focusableObjects[i];
if (((((c.tabIndex) && (!(isNaN(Number(c.tabIndex)))))) && ((c.tabIndex > 0)))){
sortFocusableObjectsTabIndex();
return;
};
focusableCandidates.push(c);
i++;
};
focusableCandidates.sort(sortByDepth);
}
private function keyFocusChangeHandler(event:FocusEvent):void{
var sm:ISystemManager = form.systemManager;
if (sm.isDisplayObjectInABridgedApplication(DisplayObject(event.target))){
return;
};
showFocusIndicator = true;
focusChanged = false;
if ((((event.keyCode == Keyboard.TAB)) && (!(event.isDefaultPrevented())))){
if (browserFocusComponent){
if (browserFocusComponent.tabIndex == LARGE_TAB_INDEX){
browserFocusComponent.tabIndex = -1;
};
browserFocusComponent = null;
if (SystemManager(form.systemManager).useSWFBridge()){
moveFocusToParent(event.shiftKey);
if (focusChanged){
event.preventDefault();
};
};
return;
};
setFocusToNextObject(event);
if (focusChanged){
event.preventDefault();
};
};
}
private function getNextFocusManagerComponent2(backward:Boolean=false, fromObject:DisplayObject=null, fromIndex:int=-2):FocusInfo{
var o:DisplayObject;
var g:String;
var tg:IFocusManagerGroup;
if (focusableObjects.length == 0){
return (null);
};
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
var i:int = fromIndex;
if (fromIndex == FROM_INDEX_UNSPECIFIED){
o = fromObject;
if (!o){
o = form.systemManager.stage.focus;
};
o = DisplayObject(findFocusManagerComponent2(InteractiveObject(o)));
g = "";
if ((o is IFocusManagerGroup)){
tg = IFocusManagerGroup(o);
g = tg.groupName;
};
i = getIndexOfFocusedObject(o);
};
var bSearchAll:Boolean;
var start:int = i;
if (i == -1){
if (backward){
i = focusableCandidates.length;
};
bSearchAll = true;
};
var j:int = getIndexOfNextObject(i, backward, bSearchAll, g);
var wrapped:Boolean;
if (backward){
if (j >= i){
wrapped = true;
};
} else {
if (j <= i){
wrapped = true;
};
};
var focusInfo:FocusInfo = new FocusInfo();
focusInfo.displayObject = findFocusManagerComponent2(focusableCandidates[j]);
focusInfo.wrapped = wrapped;
return (focusInfo);
}
private function getIndexOfFocusedObject(o:DisplayObject):int{
var iui:IUIComponent;
if (!o){
return (-1);
};
var n:int = focusableCandidates.length;
var i:int;
i = 0;
while (i < n) {
if (focusableCandidates[i] == o){
return (i);
};
i++;
};
i = 0;
while (i < n) {
iui = (focusableCandidates[i] as IUIComponent);
if (((iui) && (iui.owns(o)))){
return (i);
};
i++;
};
return (-1);
}
private function focusRequestActivateHandler(event:Event):void{
skipBridge = IEventDispatcher(event.target);
activate();
skipBridge = null;
}
private function removeFromParentBridge(event:Event):void{
var bridge:IEventDispatcher;
var sm:ISystemManager = form.systemManager;
if (sm.useSWFBridge()){
sm.removeEventListener(SWFBridgeEvent.BRIDGE_APPLICATION_UNLOADING, removeFromParentBridge);
bridge = swfBridgeGroup.parentBridge;
if (bridge){
bridge.removeEventListener(SWFBridgeRequest.MOVE_FOCUS_REQUEST, focusRequestMoveHandler);
bridge.removeEventListener(SWFBridgeRequest.SET_SHOW_FOCUS_INDICATOR_REQUEST, setShowFocusIndicatorRequestHandler);
};
if (((bridge) && (!((form.systemManager is SystemManagerProxy))))){
bridge.removeEventListener(SWFBridgeRequest.ACTIVATE_FOCUS_REQUEST, focusRequestActivateHandler);
bridge.removeEventListener(SWFBridgeRequest.DEACTIVATE_FOCUS_REQUEST, focusRequestDeactivateHandler);
bridge.removeEventListener(SWFBridgeEvent.BRIDGE_FOCUS_MANAGER_ACTIVATE, bridgeEventActivateHandler);
};
};
}
private function getParentBridge():IEventDispatcher{
if (swfBridgeGroup){
return (swfBridgeGroup.parentBridge);
};
return (null);
}
private function setFocusToComponent(o:Object, shiftKey:Boolean):void{
var request:SWFBridgeRequest;
var sandboxBridge:IEventDispatcher;
focusChanged = false;
if (o){
if ((((o is ISWFLoader)) && (ISWFLoader(o).swfBridge))){
request = new SWFBridgeRequest(SWFBridgeRequest.MOVE_FOCUS_REQUEST, false, true, null, (shiftKey) ? FocusRequestDirection.BOTTOM : FocusRequestDirection.TOP);
sandboxBridge = ISWFLoader(o).swfBridge;
if (sandboxBridge){
sandboxBridge.dispatchEvent(request);
focusChanged = request.data;
};
} else {
if ((o is IFocusManagerComplexComponent)){
IFocusManagerComplexComponent(o).assignFocus((shiftKey) ? "bottom" : "top");
focusChanged = true;
} else {
if ((o is IFocusManagerComponent)){
setFocus(IFocusManagerComponent(o));
focusChanged = true;
};
};
};
};
}
private function focusRequestMoveHandler(event:Event):void{
var startingPosition:DisplayObject;
if ((event is SWFBridgeRequest)){
return;
};
focusSetLocally = false;
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if ((((request.data == FocusRequestDirection.TOP)) || ((request.data == FocusRequestDirection.BOTTOM)))){
if (focusableObjects.length == 0){
moveFocusToParent(((request.data == FocusRequestDirection.TOP)) ? false : true);
event["data"] = focusChanged;
return;
};
if (request.data == FocusRequestDirection.TOP){
setFocusToTop();
} else {
setFocusToBottom();
};
event["data"] = focusChanged;
} else {
startingPosition = DisplayObject(_form.systemManager.swfBridgeGroup.getChildBridgeProvider(IEventDispatcher(event.target)));
moveFocus((request.data as String), startingPosition);
event["data"] = focusChanged;
};
if (focusSetLocally){
dispatchActivatedFocusManagerEvent(null);
lastActiveFocusManager = this;
};
}
public function get nextTabIndex():int{
return ((getMaxTabIndex() + 1));
}
private function dispatchActivatedFocusManagerEvent(skip:IEventDispatcher=null):void{
if (lastActiveFocusManager == this){
return;
};
var event:SWFBridgeEvent = new SWFBridgeEvent(SWFBridgeEvent.BRIDGE_FOCUS_MANAGER_ACTIVATE);
dispatchEventFromSWFBridges(event, skip);
}
private function focusRequestDeactivateHandler(event:Event):void{
skipBridge = IEventDispatcher(event.target);
deactivate();
skipBridge = null;
}
public function get focusPane():Sprite{
return (_focusPane);
}
private function keyDownHandler(event:KeyboardEvent):void{
var o:DisplayObject;
var g:String;
var i:int;
var j:int;
var tg:IFocusManagerGroup;
var sm:ISystemManager = form.systemManager;
if (sm.isDisplayObjectInABridgedApplication(DisplayObject(event.target))){
return;
};
if ((sm is SystemManager)){
SystemManager(sm).idleCounter = 0;
};
if (event.keyCode == Keyboard.TAB){
lastAction = "KEY";
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
};
if (browserMode){
if ((((event.keyCode == Keyboard.TAB)) && ((focusableCandidates.length > 0)))){
o = fauxFocus;
if (!o){
o = form.systemManager.stage.focus;
};
o = DisplayObject(findFocusManagerComponent2(InteractiveObject(o)));
g = "";
if ((o is IFocusManagerGroup)){
tg = IFocusManagerGroup(o);
g = tg.groupName;
};
i = getIndexOfFocusedObject(o);
j = getIndexOfNextObject(i, event.shiftKey, false, g);
if (event.shiftKey){
if (j >= i){
browserFocusComponent = getBrowserFocusComponent(event.shiftKey);
if (browserFocusComponent.tabIndex == -1){
browserFocusComponent.tabIndex = 0;
};
};
} else {
if (j <= i){
browserFocusComponent = getBrowserFocusComponent(event.shiftKey);
if (browserFocusComponent.tabIndex == -1){
browserFocusComponent.tabIndex = LARGE_TAB_INDEX;
};
};
};
};
};
if (((((((defaultButtonEnabled) && ((event.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){
defButton.callLater(sendDefaultButtonEvent);
};
}
private function mouseDownHandler(event:MouseEvent):void{
if (event.isDefaultPrevented()){
return;
};
var sm:ISystemManager = form.systemManager;
var o:DisplayObject = getTopLevelFocusTarget(InteractiveObject(event.target));
if (!o){
return;
};
showFocusIndicator = false;
if (((((!((o == _lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((o is TextField))))){
setFocus(IFocusManagerComponent(o));
} else {
if (_lastFocus){
if (((((!(_lastFocus)) && ((o is IEventDispatcher)))) && (SystemManager(form.systemManager).useSWFBridge()))){
IEventDispatcher(o).dispatchEvent(new FocusEvent(FocusEvent.FOCUS_IN));
};
};
};
lastAction = "MOUSEDOWN";
dispatchActivatedFocusManagerEvent(null);
lastActiveFocusManager = this;
}
private function focusInHandler(event:FocusEvent):void{
var x:IButton;
var target:InteractiveObject = InteractiveObject(event.target);
var sm:ISystemManager = form.systemManager;
if (sm.isDisplayObjectInABridgedApplication(DisplayObject(event.target))){
return;
};
if (isParent(DisplayObjectContainer(form), target)){
_lastFocus = findFocusManagerComponent(InteractiveObject(target));
if ((_lastFocus is IButton)){
x = (_lastFocus as IButton);
if (defButton){
defButton.emphasized = false;
defButton = x;
x.emphasized = true;
};
} else {
if (((defButton) && (!((defButton == _defaultButton))))){
defButton.emphasized = false;
defButton = _defaultButton;
_defaultButton.emphasized = true;
};
};
};
}
public function toString():String{
return ((Object(form).toString() + ".focusManager"));
}
public function deactivate():void{
var sm:ISystemManager = form.systemManager;
if (sm){
if (sm.isTopLevelRoot()){
sm.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler);
sm.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
sm.stage.removeEventListener(Event.ACTIVATE, activateHandler);
sm.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler);
} else {
sm.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler);
sm.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
sm.removeEventListener(Event.ACTIVATE, activateHandler);
sm.removeEventListener(Event.DEACTIVATE, deactivateHandler);
};
};
form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = false;
dispatchEventFromSWFBridges(new SWFBridgeRequest(SWFBridgeRequest.DEACTIVATE_FOCUS_REQUEST), skipBridge);
}
private function findFocusManagerComponent2(o:InteractiveObject):DisplayObject{
var o = o;
while (o) {
if ((((((o is IFocusManagerComponent)) && (IFocusManagerComponent(o).focusEnabled))) || ((o is ISWFLoader)))){
return (o);
};
o = o.parent;
};
//unresolved jump
var _slot1 = error;
return (null);
}
private function getIndexOfNextObject(i:int, shiftKey:Boolean, bSearchAll:Boolean, groupName:String):int{
var o:DisplayObject;
var tg1:IFocusManagerGroup;
var j:int;
var obj:DisplayObject;
var tg2:IFocusManagerGroup;
var n:int = focusableCandidates.length;
var start:int = i;
while (true) {
if (shiftKey){
i--;
} else {
i++;
};
if (bSearchAll){
if (((shiftKey) && ((i < 0)))){
break;
};
if (((!(shiftKey)) && ((i == n)))){
break;
};
} else {
i = ((i + n) % n);
if (start == i){
break;
};
};
if (isValidFocusCandidate(focusableCandidates[i], groupName)){
o = DisplayObject(findFocusManagerComponent2(focusableCandidates[i]));
if ((o is IFocusManagerGroup)){
tg1 = IFocusManagerGroup(o);
j = 0;
while (j < focusableCandidates.length) {
obj = focusableCandidates[j];
if ((obj is IFocusManagerGroup)){
tg2 = IFocusManagerGroup(obj);
if ((((tg2.groupName == tg1.groupName)) && (tg2.selected))){
if (((!((InteractiveObject(obj).tabIndex == InteractiveObject(o).tabIndex))) && (!(tg1.selected)))){
return (getIndexOfNextObject(i, shiftKey, bSearchAll, groupName));
};
i = j;
break;
};
};
j++;
};
};
return (i);
};
};
return (i);
}
public function moveFocus(direction:String, fromDisplayObject:DisplayObject=null):void{
if (direction == FocusRequestDirection.TOP){
setFocusToTop();
return;
};
if (direction == FocusRequestDirection.BOTTOM){
setFocusToBottom();
return;
};
var keyboardEvent:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_DOWN);
keyboardEvent.keyCode = Keyboard.TAB;
keyboardEvent.shiftKey = ((direction)==FocusRequestDirection.FORWARD) ? false : true;
fauxFocus = fromDisplayObject;
keyDownHandler(keyboardEvent);
var focusEvent:FocusEvent = new FocusEvent(FocusEvent.KEY_FOCUS_CHANGE);
focusEvent.keyCode = Keyboard.TAB;
focusEvent.shiftKey = ((direction)==FocusRequestDirection.FORWARD) ? false : true;
keyFocusChangeHandler(focusEvent);
fauxFocus = null;
}
private function getMaxTabIndex():int{
var t:Number;
var z:Number = 0;
var n:int = focusableObjects.length;
var i:int;
while (i < n) {
t = focusableObjects[i].tabIndex;
if (!isNaN(t)){
z = Math.max(z, t);
};
i++;
};
return (z);
}
private function isParent(p:DisplayObjectContainer, o:DisplayObject):Boolean{
if ((p is IRawChildrenContainer)){
return (IRawChildrenContainer(p).rawChildren.contains(o));
};
return (p.contains(o));
}
private function showHandler(event:Event):void{
form.systemManager.activate(form);
}
mx_internal function set form(value:IFocusManagerContainer):void{
_form = value;
}
public function setFocus(o:IFocusManagerComponent):void{
o.setFocus();
focusSetLocally = true;
}
public function findFocusManagerComponent(o:InteractiveObject):IFocusManagerComponent{
return ((findFocusManagerComponent2(o) as IFocusManagerComponent));
}
public function removeSWFBridge(bridge:IEventDispatcher):void{
var index:int;
var sm:ISystemManager = _form.systemManager;
var displayObject:DisplayObject = DisplayObject(swfBridgeGroup.getChildBridgeProvider(bridge));
if (displayObject){
index = focusableObjects.indexOf(displayObject);
if (index != -1){
focusableObjects.splice(index, 1);
calculateCandidates = true;
};
} else {
throw (new Error());
};
bridge.removeEventListener(SWFBridgeRequest.MOVE_FOCUS_REQUEST, focusRequestMoveHandler);
bridge.removeEventListener(SWFBridgeRequest.SET_SHOW_FOCUS_INDICATOR_REQUEST, setShowFocusIndicatorRequestHandler);
bridge.removeEventListener(SWFBridgeEvent.BRIDGE_FOCUS_MANAGER_ACTIVATE, bridgeEventActivateHandler);
swfBridgeGroup.removeChildBridge(bridge);
}
private function sortFocusableObjectsTabIndex():void{
var c:IFocusManagerComponent;
focusableCandidates = [];
var n:int = focusableObjects.length;
var i:int;
while (i < n) {
c = (focusableObjects[i] as IFocusManagerComponent);
if (((((((c) && (c.tabIndex))) && (!(isNaN(Number(c.tabIndex)))))) || ((focusableObjects[i] is ISWFLoader)))){
focusableCandidates.push(focusableObjects[i]);
};
i++;
};
focusableCandidates.sort(sortByTabIndex);
}
public function set defaultButton(value:IButton):void{
var button:IButton = (value) ? IButton(value) : null;
if (button != _defaultButton){
if (_defaultButton){
_defaultButton.emphasized = false;
};
if (defButton){
defButton.emphasized = false;
};
_defaultButton = button;
defButton = button;
if (button){
button.emphasized = true;
};
};
}
private function setFocusToNextObject(event:FocusEvent):void{
focusChanged = false;
if (focusableObjects.length == 0){
return;
};
var focusInfo:FocusInfo = getNextFocusManagerComponent2(event.shiftKey, fauxFocus);
if (((!(popup)) && (focusInfo.wrapped))){
if (getParentBridge()){
moveFocusToParent(event.shiftKey);
return;
};
};
setFocusToComponent(focusInfo.displayObject, event.shiftKey);
}
private function getTopLevelFocusTarget(o:InteractiveObject):InteractiveObject{
while (o != InteractiveObject(form)) {
if ((((((((o is IFocusManagerComponent)) && (IFocusManagerComponent(o).focusEnabled))) && (IFocusManagerComponent(o).mouseFocusEnabled))) && (((o is IUIComponent)) ? IUIComponent(o).enabled : true))){
return (o);
};
if ((o.parent is ISWFLoader)){
if (ISWFLoader(o.parent).swfBridge){
return (null);
};
};
o = o.parent;
if (o == null){
break;
};
};
return (null);
}
private function addedToStageHandler(event:Event):void{
_form.removeEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
if (focusableObjects.length == 0){
addFocusables(DisplayObject(_form));
calculateCandidates = true;
};
}
private function hideHandler(event:Event):void{
form.systemManager.deactivate(form);
}
private function isEnabledAndVisible(o:DisplayObject):Boolean{
var formParent:DisplayObjectContainer = DisplayObject(form).parent;
while (o != formParent) {
if ((o is IUIComponent)){
if (!IUIComponent(o).enabled){
return (false);
};
};
if (!o.visible){
return (false);
};
o = o.parent;
};
return (true);
}
public function hideFocus():void{
if (showFocusIndicator){
showFocusIndicator = false;
if (_lastFocus){
_lastFocus.drawFocus(false);
};
};
}
private function getBrowserFocusComponent(shiftKey:Boolean):InteractiveObject{
var index:int;
var focusComponent:InteractiveObject = form.systemManager.stage.focus;
if (!focusComponent){
index = (shiftKey) ? 0 : (focusableCandidates.length - 1);
focusComponent = focusableCandidates[index];
};
return (focusComponent);
}
public function get showFocusIndicator():Boolean{
return (_showFocusIndicator);
}
private function moveFocusToParent(shiftKey:Boolean):Boolean{
var request:SWFBridgeRequest = new SWFBridgeRequest(SWFBridgeRequest.MOVE_FOCUS_REQUEST, false, true, null, (shiftKey) ? FocusRequestDirection.BACKWARD : FocusRequestDirection.FORWARD);
var sandboxBridge:IEventDispatcher = _form.systemManager.swfBridgeGroup.parentBridge;
sandboxBridge.dispatchEvent(request);
focusChanged = request.data;
return (focusChanged);
}
public function set focusPane(value:Sprite):void{
_focusPane = value;
}
mx_internal function get form():IFocusManagerContainer{
return (_form);
}
private function removedHandler(event:Event):void{
var i:int;
var o:DisplayObject = DisplayObject(event.target);
if ((o is IFocusManagerComponent)){
i = 0;
while (i < focusableObjects.length) {
if (o == focusableObjects[i]){
if (o == _lastFocus){
_lastFocus.drawFocus(false);
_lastFocus = null;
};
o.removeEventListener("tabEnabledChange", tabEnabledChangeHandler);
o.removeEventListener("tabIndexChange", tabIndexChangeHandler);
focusableObjects.splice(i, 1);
calculateCandidates = true;
break;
};
i++;
};
};
removeFocusables(o, false);
}
private function dispatchEventFromSWFBridges(event:Event, skip:IEventDispatcher=null):void{
var clone:Event;
var parentBridge:IEventDispatcher;
var sm:ISystemManager = form.systemManager;
if (!popup){
parentBridge = swfBridgeGroup.parentBridge;
if (((parentBridge) && (!((parentBridge == skip))))){
clone = event.clone();
if ((clone is SWFBridgeRequest)){
SWFBridgeRequest(clone).requestor = parentBridge;
};
parentBridge.dispatchEvent(clone);
};
};
var children:Array = swfBridgeGroup.getChildBridges();
var i:int;
while (i < children.length) {
if (children[i] != skip){
clone = event.clone();
if ((clone is SWFBridgeRequest)){
SWFBridgeRequest(clone).requestor = IEventDispatcher(children[i]);
};
IEventDispatcher(children[i]).dispatchEvent(clone);
};
i++;
};
}
public function get defaultButton():IButton{
return (_defaultButton);
}
private function activateHandler(event:Event):void{
if (((_lastFocus) && (!(browserMode)))){
_lastFocus.setFocus();
};
lastAction = "ACTIVATE";
}
public function showFocus():void{
if (!showFocusIndicator){
showFocusIndicator = true;
if (_lastFocus){
_lastFocus.drawFocus(true);
};
};
}
public function getNextFocusManagerComponent(backward:Boolean=false):IFocusManagerComponent{
return ((getNextFocusManagerComponent2(false, fauxFocus) as IFocusManagerComponent));
}
private function setShowFocusIndicatorRequestHandler(event:Event):void{
if ((event is SWFBridgeRequest)){
return;
};
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
_showFocusIndicator = request.data;
dispatchSetShowFocusIndicatorRequest(_showFocusIndicator, IEventDispatcher(event.target));
}
private function setFocusToTop():void{
setFocusToNextIndex(-1, false);
}
private function isTabVisible(o:DisplayObject):Boolean{
var s:DisplayObject = DisplayObject(form.systemManager);
if (!s){
return (false);
};
var p:DisplayObjectContainer = o.parent;
while (((p) && (!((p == s))))) {
if (!p.tabChildren){
return (false);
};
p = p.parent;
};
return (true);
}
mx_internal function get lastFocus():IFocusManagerComponent{
return (_lastFocus);
}
public function set defaultButtonEnabled(value:Boolean):void{
_defaultButtonEnabled = value;
}
public function get defaultButtonEnabled():Boolean{
return (_defaultButtonEnabled);
}
public function set showFocusIndicator(value:Boolean):void{
var changed = !((_showFocusIndicator == value));
_showFocusIndicator = value;
if (((((changed) && (!(popup)))) && (form.systemManager.swfBridgeGroup))){
dispatchSetShowFocusIndicatorRequest(value, null);
};
}
private function sortByTabIndex(a:InteractiveObject, b:InteractiveObject):int{
var aa:int = a.tabIndex;
var bb:int = b.tabIndex;
if (aa == -1){
aa = int.MAX_VALUE;
};
if (bb == -1){
bb = int.MAX_VALUE;
};
return (((aa > bb)) ? 1 : ((aa < bb)) ? -1 : sortByDepth(DisplayObject(a), DisplayObject(b)));
}
public function activate():void{
if (activated){
return;
};
var sm:ISystemManager = form.systemManager;
if (sm){
if (sm.isTopLevelRoot()){
sm.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true);
sm.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true);
sm.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true);
sm.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
} else {
sm.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true);
sm.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true);
sm.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true);
sm.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
};
};
form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = true;
if (_lastFocus){
setFocus(_lastFocus);
};
dispatchEventFromSWFBridges(new SWFBridgeRequest(SWFBridgeRequest.ACTIVATE_FOCUS_REQUEST), skipBridge);
}
private function setFocusToNextIndex(index:int, shiftKey:Boolean):void{
if (focusableObjects.length == 0){
return;
};
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
var focusInfo:FocusInfo = getNextFocusManagerComponent2(shiftKey, null, index);
if (((!(popup)) && (focusInfo.wrapped))){
if (getParentBridge()){
moveFocusToParent(shiftKey);
return;
};
};
setFocusToComponent(focusInfo.displayObject, shiftKey);
}
}
}//package mx.managers
import flash.display.*;
class FocusInfo {
public var displayObject:DisplayObject;
public var wrapped:Boolean;
private function FocusInfo(){
super();
}
}
Section 235
//ICursorManager (mx.managers.ICursorManager)
package mx.managers {
public interface ICursorManager {
function removeAllCursors():void;
function set currentCursorYOffset(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ICursorManager.as:Number):void;
function removeBusyCursor():void;
function unRegisterToUseBusyCursor(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ICursorManager.as:Object):void;
function hideCursor():void;
function get currentCursorID():int;
function registerToUseBusyCursor(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ICursorManager.as:Object):void;
function setBusyCursor():void;
function showCursor():void;
function set currentCursorID(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ICursorManager.as:int):void;
function setCursor(_arg1:Class, _arg2:int=2, _arg3:Number=0, _arg4:Number=0):int;
function removeCursor(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ICursorManager.as:int):void;
function get currentCursorXOffset():Number;
function get currentCursorYOffset():Number;
function set currentCursorXOffset(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ICursorManager.as:Number):void;
}
}//package mx.managers
Section 236
//IFocusManager (mx.managers.IFocusManager)
package mx.managers {
import flash.display.*;
import mx.core.*;
import flash.events.*;
public interface IFocusManager {
function get focusPane():Sprite;
function getFocus():IFocusManagerComponent;
function deactivate():void;
function set defaultButton(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:IButton):void;
function set focusPane(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:Sprite):void;
function set showFocusIndicator(C:\autobuild\3.2.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.2.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.2.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:IFocusManagerComponent):void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:Boolean):void;
function hideFocus():void;
function getNextFocusManagerComponent(value:Boolean=false):IFocusManagerComponent;
}
}//package mx.managers
Section 237
//IFocusManagerComplexComponent (mx.managers.IFocusManagerComplexComponent)
package mx.managers {
public interface IFocusManagerComplexComponent extends IFocusManagerComponent {
function assignFocus(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IFocusManagerComplexComponent.as:String):void;
function get hasFocusableContent():Boolean;
}
}//package mx.managers
Section 238
//IFocusManagerComponent (mx.managers.IFocusManagerComponent)
package mx.managers {
public interface IFocusManagerComponent {
function set focusEnabled(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IFocusManagerComponent.as:Boolean):void;
function drawFocus(C:\autobuild\3.2.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 239
//IFocusManagerContainer (mx.managers.IFocusManagerContainer)
package mx.managers {
import flash.display.*;
import flash.events.*;
public interface IFocusManagerContainer extends IEventDispatcher {
function set focusManager(C:\autobuild\3.2.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 240
//IFocusManagerGroup (mx.managers.IFocusManagerGroup)
package mx.managers {
public interface IFocusManagerGroup {
function get groupName():String;
function get selected():Boolean;
function set groupName(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IFocusManagerGroup.as:String):void;
function set selected(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IFocusManagerGroup.as:Boolean):void;
}
}//package mx.managers
Section 241
//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.2.0\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:ILayoutManagerClient):void;
function set usePhasedInstantiation(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:Boolean):void;
function invalidateSize(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:ILayoutManagerClient):void;
function get usePhasedInstantiation():Boolean;
function invalidateProperties(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:ILayoutManagerClient):void;
}
}//package mx.managers
Section 242
//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.2.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean):void;
function set initialized(C:\autobuild\3.2.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.2.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean=false):void;
function set nestLevel(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:int):void;
function set processedDescriptors(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean):void;
}
}//package mx.managers
Section 243
//IPopUpManager (mx.managers.IPopUpManager)
package mx.managers {
import flash.display.*;
import mx.core.*;
public interface IPopUpManager {
function createPopUp(_arg1:DisplayObject, _arg2:Class, _arg3:Boolean=false, _arg4:String=null):IFlexDisplayObject;
function centerPopUp(childList:IFlexDisplayObject):void;
function removePopUp(childList:IFlexDisplayObject):void;
function addPopUp(_arg1:IFlexDisplayObject, _arg2:DisplayObject, _arg3:Boolean=false, _arg4:String=null):void;
function bringToFront(childList:IFlexDisplayObject):void;
}
}//package mx.managers
Section 244
//ISystemManager (mx.managers.ISystemManager)
package mx.managers {
import flash.display.*;
import flash.geom.*;
import mx.core.*;
import flash.text.*;
import flash.events.*;
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.2.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 245
//IToolTipManager2 (mx.managers.IToolTipManager2)
package mx.managers {
import flash.display.*;
import mx.core.*;
import mx.effects.*;
public interface IToolTipManager2 {
function registerToolTip(_arg1:DisplayObject, _arg2:String, _arg3:String):void;
function get enabled():Boolean;
function set enabled(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:Boolean):void;
function get scrubDelay():Number;
function set hideEffect(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:IAbstractEffect):void;
function createToolTip(_arg1:String, _arg2:Number, _arg3:Number, _arg4:String=null, _arg5:IUIComponent=null):IToolTip;
function set scrubDelay(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:Number):void;
function set hideDelay(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:Number):void;
function get currentTarget():DisplayObject;
function set showDelay(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:Number):void;
function get showDelay():Number;
function get showEffect():IAbstractEffect;
function get hideDelay():Number;
function get currentToolTip():IToolTip;
function get hideEffect():IAbstractEffect;
function set currentToolTip(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:IToolTip):void;
function get toolTipClass():Class;
function registerErrorString(_arg1:DisplayObject, _arg2:String, _arg3:String):void;
function destroyToolTip(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:IToolTip):void;
function set toolTipClass(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:Class):void;
function sizeTip(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:IToolTip):void;
function set currentTarget(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:DisplayObject):void;
function set showEffect(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:IAbstractEffect):void;
}
}//package mx.managers
Section 246
//IToolTipManagerClient (mx.managers.IToolTipManagerClient)
package mx.managers {
import mx.core.*;
public interface IToolTipManagerClient extends IFlexDisplayObject {
function get toolTip():String;
function set toolTip(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\managers;IToolTipManagerClient.as:String):void;
}
}//package mx.managers
Section 247
//LayoutManager (mx.managers.LayoutManager)
package mx.managers {
import flash.display.*;
import mx.core.*;
import flash.events.*;
import mx.events.*;
import mx.managers.layoutClasses.*;
public class LayoutManager extends EventDispatcher implements ILayoutManager {
private var invalidateClientPropertiesFlag:Boolean;// = false
private var invalidateDisplayListQueue:PriorityQueue;
private var updateCompleteQueue:PriorityQueue;
private var invalidateDisplayListFlag:Boolean;// = false
private var invalidateClientSizeFlag:Boolean;// = false
private var invalidateSizeQueue:PriorityQueue;
private var originalFrameRate:Number;
private var invalidatePropertiesFlag:Boolean;// = false
private var invalidatePropertiesQueue:PriorityQueue;
private var invalidateSizeFlag:Boolean;// = false
private var callLaterPending:Boolean;// = false
private var _usePhasedInstantiation:Boolean;// = false
private var callLaterObject:UIComponent;
private var targetLevel:int;// = 2147483647
mx_internal static const VERSION:String = "3.2.0.3958";
private static var instance:LayoutManager;
public function LayoutManager(){
updateCompleteQueue = new PriorityQueue();
invalidatePropertiesQueue = new PriorityQueue();
invalidateSizeQueue = new PriorityQueue();
invalidateDisplayListQueue = new PriorityQueue();
super();
}
public function set usePhasedInstantiation(value:Boolean):void{
var sm:ISystemManager;
var stage:Stage;
var value = value;
if (_usePhasedInstantiation != value){
_usePhasedInstantiation = value;
sm = SystemManagerGlobals.topLevelSystemManagers[0];
stage = SystemManagerGlobals.topLevelSystemManagers[0].stage;
if (stage){
if (value){
originalFrameRate = stage.frameRate;
stage.frameRate = 1000;
} else {
stage.frameRate = originalFrameRate;
};
};
//unresolved jump
var _slot1 = e;
};
}
private function waitAFrame():void{
callLaterObject.callLater(doPhasedInstantiation);
}
public function validateClient(target:ILayoutManagerClient, skipDisplayList:Boolean=false):void{
var obj:ILayoutManagerClient;
var i:int;
var done:Boolean;
var oldTargetLevel:int = targetLevel;
if (targetLevel == int.MAX_VALUE){
targetLevel = target.nestLevel;
};
while (!(done)) {
done = true;
obj = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallestChild(target));
while (obj) {
obj.validateProperties();
if (!obj.updateCompletePendingFlag){
updateCompleteQueue.addObject(obj, obj.nestLevel);
obj.updateCompletePendingFlag = true;
};
obj = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallestChild(target));
};
if (invalidatePropertiesQueue.isEmpty()){
invalidatePropertiesFlag = false;
invalidateClientPropertiesFlag = false;
};
obj = ILayoutManagerClient(invalidateSizeQueue.removeLargestChild(target));
while (obj) {
obj.validateSize();
if (!obj.updateCompletePendingFlag){
updateCompleteQueue.addObject(obj, obj.nestLevel);
obj.updateCompletePendingFlag = true;
};
if (invalidateClientPropertiesFlag){
obj = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallestChild(target));
if (obj){
invalidatePropertiesQueue.addObject(obj, obj.nestLevel);
done = false;
break;
};
};
obj = ILayoutManagerClient(invalidateSizeQueue.removeLargestChild(target));
};
if (invalidateSizeQueue.isEmpty()){
invalidateSizeFlag = false;
invalidateClientSizeFlag = false;
};
if (!skipDisplayList){
obj = ILayoutManagerClient(invalidateDisplayListQueue.removeSmallestChild(target));
while (obj) {
obj.validateDisplayList();
if (!obj.updateCompletePendingFlag){
updateCompleteQueue.addObject(obj, obj.nestLevel);
obj.updateCompletePendingFlag = true;
};
if (invalidateClientPropertiesFlag){
obj = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallestChild(target));
if (obj){
invalidatePropertiesQueue.addObject(obj, obj.nestLevel);
done = false;
break;
};
};
if (invalidateClientSizeFlag){
obj = ILayoutManagerClient(invalidateSizeQueue.removeLargestChild(target));
if (obj){
invalidateSizeQueue.addObject(obj, obj.nestLevel);
done = false;
break;
};
};
obj = ILayoutManagerClient(invalidateDisplayListQueue.removeSmallestChild(target));
};
if (invalidateDisplayListQueue.isEmpty()){
invalidateDisplayListFlag = false;
};
};
};
if (oldTargetLevel == int.MAX_VALUE){
targetLevel = int.MAX_VALUE;
if (!skipDisplayList){
obj = ILayoutManagerClient(updateCompleteQueue.removeLargestChild(target));
while (obj) {
if (!obj.initialized){
obj.initialized = true;
};
obj.dispatchEvent(new FlexEvent(FlexEvent.UPDATE_COMPLETE));
obj.updateCompletePendingFlag = false;
obj = ILayoutManagerClient(updateCompleteQueue.removeLargestChild(target));
};
};
};
}
private function validateProperties():void{
var obj:ILayoutManagerClient = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallest());
while (obj) {
obj.validateProperties();
if (!obj.updateCompletePendingFlag){
updateCompleteQueue.addObject(obj, obj.nestLevel);
obj.updateCompletePendingFlag = true;
};
obj = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallest());
};
if (invalidatePropertiesQueue.isEmpty()){
invalidatePropertiesFlag = false;
};
}
public function invalidateProperties(obj:ILayoutManagerClient):void{
if (((!(invalidatePropertiesFlag)) && (ApplicationGlobals.application.systemManager))){
invalidatePropertiesFlag = true;
if (!callLaterPending){
if (!callLaterObject){
callLaterObject = new UIComponent();
callLaterObject.systemManager = ApplicationGlobals.application.systemManager;
callLaterObject.callLater(waitAFrame);
} else {
callLaterObject.callLater(doPhasedInstantiation);
};
callLaterPending = true;
};
};
if (targetLevel <= obj.nestLevel){
invalidateClientPropertiesFlag = true;
};
invalidatePropertiesQueue.addObject(obj, obj.nestLevel);
}
public function invalidateDisplayList(obj:ILayoutManagerClient):void{
if (((!(invalidateDisplayListFlag)) && (ApplicationGlobals.application.systemManager))){
invalidateDisplayListFlag = true;
if (!callLaterPending){
if (!callLaterObject){
callLaterObject = new UIComponent();
callLaterObject.systemManager = ApplicationGlobals.application.systemManager;
callLaterObject.callLater(waitAFrame);
} else {
callLaterObject.callLater(doPhasedInstantiation);
};
callLaterPending = true;
};
} else {
if (((!(invalidateDisplayListFlag)) && (!(ApplicationGlobals.application.systemManager)))){
};
};
invalidateDisplayListQueue.addObject(obj, obj.nestLevel);
}
private function validateDisplayList():void{
var obj:ILayoutManagerClient = ILayoutManagerClient(invalidateDisplayListQueue.removeSmallest());
while (obj) {
obj.validateDisplayList();
if (!obj.updateCompletePendingFlag){
updateCompleteQueue.addObject(obj, obj.nestLevel);
obj.updateCompletePendingFlag = true;
};
obj = ILayoutManagerClient(invalidateDisplayListQueue.removeSmallest());
};
if (invalidateDisplayListQueue.isEmpty()){
invalidateDisplayListFlag = false;
};
}
public function validateNow():void{
var infiniteLoopGuard:int;
if (!usePhasedInstantiation){
infiniteLoopGuard = 0;
while (((callLaterPending) && ((infiniteLoopGuard < 100)))) {
doPhasedInstantiation();
};
};
}
private function validateSize():void{
var obj:ILayoutManagerClient = ILayoutManagerClient(invalidateSizeQueue.removeLargest());
while (obj) {
obj.validateSize();
if (!obj.updateCompletePendingFlag){
updateCompleteQueue.addObject(obj, obj.nestLevel);
obj.updateCompletePendingFlag = true;
};
obj = ILayoutManagerClient(invalidateSizeQueue.removeLargest());
};
if (invalidateSizeQueue.isEmpty()){
invalidateSizeFlag = false;
};
}
private function doPhasedInstantiation():void{
var obj:ILayoutManagerClient;
if (usePhasedInstantiation){
if (invalidatePropertiesFlag){
validateProperties();
ApplicationGlobals.application.dispatchEvent(new Event("validatePropertiesComplete"));
} else {
if (invalidateSizeFlag){
validateSize();
ApplicationGlobals.application.dispatchEvent(new Event("validateSizeComplete"));
} else {
if (invalidateDisplayListFlag){
validateDisplayList();
ApplicationGlobals.application.dispatchEvent(new Event("validateDisplayListComplete"));
};
};
};
} else {
if (invalidatePropertiesFlag){
validateProperties();
};
if (invalidateSizeFlag){
validateSize();
};
if (invalidateDisplayListFlag){
validateDisplayList();
};
};
if (((((invalidatePropertiesFlag) || (invalidateSizeFlag))) || (invalidateDisplayListFlag))){
callLaterObject.callLater(doPhasedInstantiation);
} else {
usePhasedInstantiation = false;
callLaterPending = false;
obj = ILayoutManagerClient(updateCompleteQueue.removeLargest());
while (obj) {
if (((!(obj.initialized)) && (obj.processedDescriptors))){
obj.initialized = true;
};
obj.dispatchEvent(new FlexEvent(FlexEvent.UPDATE_COMPLETE));
obj.updateCompletePendingFlag = false;
obj = ILayoutManagerClient(updateCompleteQueue.removeLargest());
};
dispatchEvent(new FlexEvent(FlexEvent.UPDATE_COMPLETE));
};
}
public function isInvalid():Boolean{
return (((((invalidatePropertiesFlag) || (invalidateSizeFlag))) || (invalidateDisplayListFlag)));
}
public function get usePhasedInstantiation():Boolean{
return (_usePhasedInstantiation);
}
public function invalidateSize(obj:ILayoutManagerClient):void{
if (((!(invalidateSizeFlag)) && (ApplicationGlobals.application.systemManager))){
invalidateSizeFlag = true;
if (!callLaterPending){
if (!callLaterObject){
callLaterObject = new UIComponent();
callLaterObject.systemManager = ApplicationGlobals.application.systemManager;
callLaterObject.callLater(waitAFrame);
} else {
callLaterObject.callLater(doPhasedInstantiation);
};
callLaterPending = true;
};
};
if (targetLevel <= obj.nestLevel){
invalidateClientSizeFlag = true;
};
invalidateSizeQueue.addObject(obj, obj.nestLevel);
}
public static function getInstance():LayoutManager{
if (!instance){
instance = new (LayoutManager);
};
return (instance);
}
}
}//package mx.managers
Section 248
//PopUpManager (mx.managers.PopUpManager)
package mx.managers {
import flash.display.*;
import mx.core.*;
public class PopUpManager {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var implClassDependency:PopUpManagerImpl;
private static var _impl:IPopUpManager;
public function PopUpManager(){
super();
}
private static function get impl():IPopUpManager{
if (!_impl){
_impl = IPopUpManager(Singleton.getInstance("mx.managers::IPopUpManager"));
};
return (_impl);
}
public static function removePopUp(popUp:IFlexDisplayObject):void{
impl.removePopUp(popUp);
}
public static function addPopUp(window:IFlexDisplayObject, parent:DisplayObject, modal:Boolean=false, childList:String=null):void{
impl.addPopUp(window, parent, modal, childList);
}
public static function centerPopUp(popUp:IFlexDisplayObject):void{
impl.centerPopUp(popUp);
}
public static function bringToFront(popUp:IFlexDisplayObject):void{
impl.bringToFront(popUp);
}
public static function createPopUp(parent:DisplayObject, className:Class, modal:Boolean=false, childList:String=null):IFlexDisplayObject{
return (impl.createPopUp(parent, className, modal, childList));
}
}
}//package mx.managers
Section 249
//PopUpManagerChildList (mx.managers.PopUpManagerChildList)
package mx.managers {
import mx.core.*;
public final class PopUpManagerChildList {
public static const PARENT:String = "parent";
public static const APPLICATION:String = "application";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const POPUP:String = "popup";
public function PopUpManagerChildList(){
super();
}
}
}//package mx.managers
Section 250
//PopUpManagerImpl (mx.managers.PopUpManagerImpl)
package mx.managers {
import flash.display.*;
import mx.core.*;
import flash.geom.*;
import flash.events.*;
import mx.events.*;
import mx.styles.*;
import mx.effects.*;
import mx.automation.*;
import mx.utils.*;
public class PopUpManagerImpl implements IPopUpManager {
private var popupInfo:Array;
mx_internal var modalWindowClass:Class;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var instance:IPopUpManager;
public function PopUpManagerImpl(){
super();
var sm:ISystemManager = ISystemManager(SystemManagerGlobals.topLevelSystemManagers[0]);
sm.addEventListener(SWFBridgeRequest.CREATE_MODAL_WINDOW_REQUEST, createModalWindowRequestHandler, false, 0, true);
sm.addEventListener(SWFBridgeRequest.SHOW_MODAL_WINDOW_REQUEST, showModalWindowRequest, false, 0, true);
sm.addEventListener(SWFBridgeRequest.HIDE_MODAL_WINDOW_REQUEST, hideModalWindowRequest, false, 0, true);
}
private function showModalWindow(o:PopUpData, sm:ISystemManager, sendRequest:Boolean=true):void{
var popUpStyleClient:IStyleClient = (o.owner as IStyleClient);
var duration:Number = 0;
var alpha:Number = 0;
if (!isNaN(o.modalTransparencyDuration)){
duration = o.modalTransparencyDuration;
} else {
if (popUpStyleClient){
duration = popUpStyleClient.getStyle("modalTransparencyDuration");
o.modalTransparencyDuration = duration;
};
};
if (!isNaN(o.modalTransparency)){
alpha = o.modalTransparency;
} else {
if (popUpStyleClient){
alpha = popUpStyleClient.getStyle("modalTransparency");
o.modalTransparency = alpha;
};
};
o.modalWindow.alpha = alpha;
var blurAmount:Number = 0;
if (!isNaN(o.modalTransparencyBlur)){
blurAmount = o.modalTransparencyBlur;
} else {
if (popUpStyleClient){
blurAmount = popUpStyleClient.getStyle("modalTransparencyBlur");
o.modalTransparencyBlur = blurAmount;
};
};
var transparencyColor:Number = 0xFFFFFF;
if (!isNaN(o.modalTransparencyColor)){
transparencyColor = o.modalTransparencyColor;
} else {
if (popUpStyleClient){
transparencyColor = popUpStyleClient.getStyle("modalTransparencyColor");
o.modalTransparencyColor = transparencyColor;
};
};
if ((sm is SystemManagerProxy)){
sm = SystemManagerProxy(sm).systemManager;
};
var sbRoot:DisplayObject = sm.getSandboxRoot();
showModalWindowInternal(o, duration, alpha, transparencyColor, blurAmount, sm, sbRoot);
if (((sendRequest) && (sm.useSWFBridge()))){
dispatchModalWindowRequest(SWFBridgeRequest.SHOW_MODAL_WINDOW_REQUEST, sm, sbRoot, o, true);
};
}
private function popupShowHandler(event:FlexEvent):void{
var o:PopUpData = findPopupInfoByOwner(event.target);
if (o){
showModalWindow(o, getTopLevelSystemManager(o.parent));
};
}
public function bringToFront(popUp:IFlexDisplayObject):void{
var o:PopUpData;
var sm:ISystemManager;
var request:InterManagerRequest;
if (((popUp) && (popUp.parent))){
o = findPopupInfoByOwner(popUp);
if (o){
sm = ISystemManager(popUp.parent);
if ((sm is SystemManagerProxy)){
request = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST, false, false, "bringToFront", {topMost:o.topMost, popUp:sm});
sm.getSandboxRoot().dispatchEvent(request);
} else {
if (o.topMost){
sm.popUpChildren.setChildIndex(DisplayObject(popUp), (sm.popUpChildren.numChildren - 1));
} else {
sm.setChildIndex(DisplayObject(popUp), (sm.numChildren - 1));
};
};
};
};
}
public function centerPopUp(popUp:IFlexDisplayObject):void{
var systemManager:ISystemManager;
var x:Number;
var y:Number;
var appWidth:Number;
var appHeight:Number;
var parentWidth:Number;
var parentHeight:Number;
var s:Rectangle;
var rect:Rectangle;
var clippingOffset:Point;
var pt:Point;
var isTopLevelRoot:Boolean;
var sbRoot:DisplayObject;
var request:InterManagerRequest;
var offset:Point;
if ((popUp is IInvalidating)){
IInvalidating(popUp).validateNow();
};
var o:PopUpData = findPopupInfoByOwner(popUp);
if (((o) && (o.parent))){
systemManager = o.systemManager;
clippingOffset = new Point();
sbRoot = systemManager.getSandboxRoot();
if (systemManager != sbRoot){
request = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST, false, false, "isTopLevelRoot");
sbRoot.dispatchEvent(request);
isTopLevelRoot = Boolean(request.value);
} else {
isTopLevelRoot = systemManager.isTopLevelRoot();
};
if (isTopLevelRoot){
s = systemManager.screen;
appWidth = s.width;
appHeight = s.height;
} else {
if (systemManager != sbRoot){
request = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST, false, false, "getVisibleApplicationRect");
sbRoot.dispatchEvent(request);
rect = Rectangle(request.value);
} else {
rect = systemManager.getVisibleApplicationRect();
};
clippingOffset = new Point(rect.x, rect.y);
clippingOffset = DisplayObject(systemManager).globalToLocal(clippingOffset);
appWidth = rect.width;
appHeight = rect.height;
};
if ((o.parent is UIComponent)){
rect = UIComponent(o.parent).getVisibleRect();
offset = o.parent.globalToLocal(rect.topLeft);
clippingOffset.x = (clippingOffset.x + offset.x);
clippingOffset.y = (clippingOffset.y + offset.y);
parentWidth = rect.width;
parentHeight = rect.height;
} else {
parentWidth = o.parent.width;
parentHeight = o.parent.height;
};
x = Math.max(0, ((Math.min(appWidth, parentWidth) - popUp.width) / 2));
y = Math.max(0, ((Math.min(appHeight, parentHeight) - popUp.height) / 2));
pt = new Point(clippingOffset.x, clippingOffset.y);
pt = o.parent.localToGlobal(pt);
pt = popUp.parent.globalToLocal(pt);
popUp.move((Math.round(x) + pt.x), (Math.round(y) + pt.y));
};
}
private function showModalWindowRequest(event:Event):void{
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if ((event is SWFBridgeRequest)){
request = SWFBridgeRequest(event);
} else {
request = SWFBridgeRequest.marshal(event);
};
var sm:ISystemManager = getTopLevelSystemManager(DisplayObject(ApplicationGlobals.application));
var sbRoot:DisplayObject = sm.getSandboxRoot();
var popUpData:PopUpData = findHighestRemoteModalPopupInfo();
popUpData.excludeRect = Rectangle(request.data);
popUpData.modalTransparency = request.data.transparency;
popUpData.modalTransparencyBlur = 0;
popUpData.modalTransparencyColor = request.data.transparencyColor;
popUpData.modalTransparencyDuration = request.data.transparencyDuration;
if (((popUpData.owner) || (popUpData.parent))){
throw (new Error());
};
showModalWindow(popUpData, sm);
}
private function hideOwnerHandler(event:FlexEvent):void{
var o:PopUpData = findPopupInfoByOwner(event.target);
if (o){
removeMouseOutEventListeners(o);
};
}
private function fadeOutDestroyEffectEndHandler(event:EffectEvent):void{
var sm:ISystemManager;
effectEndHandler(event);
var obj:DisplayObject = DisplayObject(event.effectInstance.target);
var modalMask:DisplayObject = obj.mask;
if (modalMask){
obj.mask = null;
sm.popUpChildren.removeChild(modalMask);
};
if ((obj.parent is ISystemManager)){
sm = ISystemManager(obj.parent);
if (sm.popUpChildren.contains(obj)){
sm.popUpChildren.removeChild(obj);
} else {
sm.removeChild(obj);
};
} else {
if (obj.parent){
obj.parent.removeChild(obj);
};
};
}
private function createModalWindowRequestHandler(event:Event):void{
var request:SWFBridgeRequest;
if ((event is SWFBridgeRequest)){
request = SWFBridgeRequest(event);
} else {
request = SWFBridgeRequest.marshal(event);
};
var sm:ISystemManager = getTopLevelSystemManager(DisplayObject(ApplicationGlobals.application));
var sbRoot:DisplayObject = sm.getSandboxRoot();
var popUpData:PopUpData = new PopUpData();
popUpData.isRemoteModalWindow = true;
popUpData.systemManager = sm;
popUpData.modalTransparency = request.data.transparency;
popUpData.modalTransparencyBlur = 0;
popUpData.modalTransparencyColor = request.data.transparencyColor;
popUpData.modalTransparencyDuration = request.data.transparencyDuration;
popUpData.exclude = (sm.swfBridgeGroup.getChildBridgeProvider(request.requestor) as IUIComponent);
popUpData.useExclude = request.data.useExclude;
popUpData.excludeRect = Rectangle(request.data.excludeRect);
if (!popupInfo){
popupInfo = [];
};
popupInfo.push(popUpData);
createModalWindow(null, popUpData, sm.popUpChildren, request.data.show, sm, sbRoot);
}
private function showOwnerHandler(event:FlexEvent):void{
var o:PopUpData = findPopupInfoByOwner(event.target);
if (o){
addMouseOutEventListeners(o);
};
}
private function addMouseOutEventListeners(o:PopUpData):void{
var sbRoot:DisplayObject = o.systemManager.getSandboxRoot();
if (o.modalWindow){
o.modalWindow.addEventListener(MouseEvent.MOUSE_DOWN, o.mouseDownOutsideHandler);
o.modalWindow.addEventListener(MouseEvent.MOUSE_WHEEL, o.mouseWheelOutsideHandler, true);
} else {
sbRoot.addEventListener(MouseEvent.MOUSE_DOWN, o.mouseDownOutsideHandler);
sbRoot.addEventListener(MouseEvent.MOUSE_WHEEL, o.mouseWheelOutsideHandler, true);
};
sbRoot.addEventListener(SandboxMouseEvent.MOUSE_DOWN_SOMEWHERE, o.marshalMouseOutsideHandler);
sbRoot.addEventListener(SandboxMouseEvent.MOUSE_WHEEL_SOMEWHERE, o.marshalMouseOutsideHandler, true);
}
private function fadeInEffectEndHandler(event:EffectEvent):void{
var o:PopUpData;
effectEndHandler(event);
var n:int = popupInfo.length;
var i:int;
while (i < n) {
o = popupInfo[i];
if (((o.owner) && ((o.modalWindow == event.effectInstance.target)))){
IUIComponent(o.owner).setVisible(true, true);
break;
};
i++;
};
}
private function hideModalWindowRequest(event:Event):void{
var request:SWFBridgeRequest;
if ((event is SWFBridgeRequest)){
request = SWFBridgeRequest(event);
} else {
request = SWFBridgeRequest.marshal(event);
};
var sm:ISystemManager = getTopLevelSystemManager(DisplayObject(ApplicationGlobals.application));
var sbRoot:DisplayObject = sm.getSandboxRoot();
var popUpData:PopUpData = findHighestRemoteModalPopupInfo();
if (((((!(popUpData)) || (popUpData.owner))) || (popUpData.parent))){
throw (new Error());
};
hideModalWindow(popUpData, request.data.remove);
if (request.data.remove){
popupInfo.splice(popupInfo.indexOf(popUpData), 1);
sm.numModalWindows--;
};
}
private function getTopLevelSystemManager(parent:DisplayObject):ISystemManager{
var localRoot:DisplayObjectContainer;
var sm:ISystemManager;
if ((parent.parent is SystemManagerProxy)){
localRoot = DisplayObjectContainer(SystemManagerProxy(parent.parent).systemManager);
} else {
if ((((parent is IUIComponent)) && ((IUIComponent(parent).systemManager is SystemManagerProxy)))){
localRoot = DisplayObjectContainer(SystemManagerProxy(IUIComponent(parent).systemManager).systemManager);
} else {
localRoot = DisplayObjectContainer(parent.root);
};
};
if (((((!(localRoot)) || ((localRoot is Stage)))) && ((parent is IUIComponent)))){
localRoot = DisplayObjectContainer(IUIComponent(parent).systemManager);
};
if ((localRoot is ISystemManager)){
sm = ISystemManager(localRoot);
if (!sm.isTopLevel()){
sm = sm.topLevelSystemManager;
};
};
return (sm);
}
private function hideModalWindow(o:PopUpData, destroy:Boolean=false):void{
var fade:Fade;
var blurAmount:Number;
var blur:Blur;
var sbRoot:DisplayObject;
var modalRequest:SWFBridgeRequest;
var bridge:IEventDispatcher;
var target:IEventDispatcher;
var request:InterManagerRequest;
if (((destroy) && (o.exclude))){
o.exclude.removeEventListener(Event.RESIZE, o.resizeHandler);
o.exclude.removeEventListener(MoveEvent.MOVE, o.resizeHandler);
};
var popUpStyleClient:IStyleClient = (o.owner as IStyleClient);
var duration:Number = 0;
if (popUpStyleClient){
duration = popUpStyleClient.getStyle("modalTransparencyDuration");
};
endEffects(o);
if (duration){
fade = new Fade(o.modalWindow);
fade.alphaFrom = o.modalWindow.alpha;
fade.alphaTo = 0;
fade.duration = duration;
fade.addEventListener(EffectEvent.EFFECT_END, (destroy) ? fadeOutDestroyEffectEndHandler : fadeOutCloseEffectEndHandler);
o.modalWindow.visible = true;
o.fade = fade;
fade.play();
blurAmount = popUpStyleClient.getStyle("modalTransparencyBlur");
if (blurAmount){
blur = new Blur(o.blurTarget);
blur.blurXFrom = (blur.blurYFrom = blurAmount);
blur.blurXTo = (blur.blurYTo = 0);
blur.duration = duration;
blur.addEventListener(EffectEvent.EFFECT_END, effectEndHandler);
o.blur = blur;
blur.play();
};
} else {
o.modalWindow.visible = false;
};
var sm:ISystemManager = ISystemManager(ApplicationGlobals.application.systemManager);
if (sm.useSWFBridge()){
sbRoot = sm.getSandboxRoot();
if (((!(o.isRemoteModalWindow)) && (!((sm == sbRoot))))){
request = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST, false, false, "isTopLevelRoot");
sbRoot.dispatchEvent(request);
if (Boolean(request.value)){
return;
};
};
modalRequest = new SWFBridgeRequest(SWFBridgeRequest.HIDE_MODAL_WINDOW_REQUEST, false, false, null, {skip:((!(o.isRemoteModalWindow)) && (!((sm == sbRoot)))), show:false, remove:destroy});
bridge = sm.swfBridgeGroup.parentBridge;
modalRequest.requestor = bridge;
bridge.dispatchEvent(modalRequest);
};
}
private function popupHideHandler(event:FlexEvent):void{
var o:PopUpData = findPopupInfoByOwner(event.target);
if (o){
hideModalWindow(o);
};
}
private function showModalWindowInternal(o:PopUpData, transparencyDuration:Number, transparency:Number, transparencyColor:Number, transparencyBlur:Number, sm:ISystemManager, sbRoot:DisplayObject):void{
var fade:Fade;
var blurAmount:Number;
var sbRootApp:Object;
var blur:Blur;
var applicationRequest:InterManagerRequest;
endEffects(o);
if (transparencyDuration){
fade = new Fade(o.modalWindow);
fade.alphaFrom = 0;
fade.alphaTo = transparency;
fade.duration = transparencyDuration;
fade.addEventListener(EffectEvent.EFFECT_END, fadeInEffectEndHandler);
o.modalWindow.alpha = 0;
o.modalWindow.visible = true;
o.fade = fade;
if (o.owner){
IUIComponent(o.owner).setVisible(false, true);
};
fade.play();
blurAmount = transparencyBlur;
if (blurAmount){
if (sm != sbRoot){
applicationRequest = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST, false, false, "application", sbRootApp);
sbRoot.dispatchEvent(applicationRequest);
o.blurTarget = applicationRequest.value;
} else {
o.blurTarget = ApplicationGlobals.application;
};
blur = new Blur(o.blurTarget);
blur.blurXFrom = (blur.blurYFrom = 0);
blur.blurXTo = (blur.blurYTo = blurAmount);
blur.duration = transparencyDuration;
blur.addEventListener(EffectEvent.EFFECT_END, effectEndHandler);
o.blur = blur;
blur.play();
};
} else {
if (o.owner){
IUIComponent(o.owner).setVisible(true, true);
};
o.modalWindow.visible = true;
};
}
private function effectEndHandler(event:EffectEvent):void{
var o:PopUpData;
var e:IEffect;
var n:int = popupInfo.length;
var i:int;
while (i < n) {
o = popupInfo[i];
e = event.effectInstance.effect;
if (e == o.fade){
o.fade = null;
} else {
if (e == o.blur){
o.blur = null;
};
};
i++;
};
}
private function createModalWindow(parentReference:DisplayObject, o:PopUpData, childrenList:IChildList, visibleFlag:Boolean, sm:ISystemManager, sbRoot:DisplayObject):void{
var popup:IFlexDisplayObject;
var modalWindow:Sprite;
var smp:SystemManagerProxy;
var realSm:ISystemManager;
popup = IFlexDisplayObject(o.owner);
var popupStyleClient:IStyleClient = (popup as IStyleClient);
var duration:Number = 0;
if (modalWindowClass){
modalWindow = new modalWindowClass();
} else {
modalWindow = new FlexSprite();
modalWindow.name = "modalWindow";
};
if (((!(sm)) && (parentReference))){
sm = IUIComponent(parentReference).systemManager;
};
if ((sm is SystemManagerProxy)){
smp = SystemManagerProxy(sm);
realSm = smp.systemManager;
} else {
realSm = sm;
};
realSm.numModalWindows++;
if (popup){
childrenList.addChildAt(modalWindow, childrenList.getChildIndex(DisplayObject(popup)));
} else {
childrenList.addChild(modalWindow);
};
if ((popup is IAutomationObject)){
IAutomationObject(popup).showInAutomationHierarchy = true;
};
if (!isNaN(o.modalTransparency)){
modalWindow.alpha = o.modalTransparency;
} else {
if (popupStyleClient){
modalWindow.alpha = popupStyleClient.getStyle("modalTransparency");
} else {
modalWindow.alpha = 0;
};
};
o.modalTransparency = modalWindow.alpha;
modalWindow.tabEnabled = false;
var s:Rectangle = realSm.screen;
var g:Graphics = modalWindow.graphics;
var c:Number = 0xFFFFFF;
if (!isNaN(o.modalTransparencyColor)){
c = o.modalTransparencyColor;
} else {
if (popupStyleClient){
c = popupStyleClient.getStyle("modalTransparencyColor");
o.modalTransparencyColor = c;
};
};
g.clear();
g.beginFill(c, 100);
g.drawRect(s.x, s.y, s.width, s.height);
g.endFill();
o.modalWindow = modalWindow;
if (o.exclude){
o.modalMask = new Sprite();
updateModalMask(realSm, modalWindow, (o.useExclude) ? o.exclude : null, o.excludeRect, o.modalMask);
modalWindow.mask = o.modalMask;
childrenList.addChild(o.modalMask);
o.exclude.addEventListener(Event.RESIZE, o.resizeHandler);
o.exclude.addEventListener(MoveEvent.MOVE, o.resizeHandler);
};
o._mouseDownOutsideHandler = dispatchMouseDownOutsideEvent;
o._mouseWheelOutsideHandler = dispatchMouseWheelOutsideEvent;
realSm.addEventListener(Event.RESIZE, o.resizeHandler);
if (popup){
popup.addEventListener(FlexEvent.SHOW, popupShowHandler);
popup.addEventListener(FlexEvent.HIDE, popupHideHandler);
};
if (visibleFlag){
showModalWindow(o, sm, false);
} else {
popup.visible = visibleFlag;
};
if (realSm.useSWFBridge()){
if (popupStyleClient){
o.modalTransparencyDuration = popupStyleClient.getStyle("modalTransparencyDuration");
o.modalTransparencyBlur = popupStyleClient.getStyle("modalTransparencyBlur");
};
dispatchModalWindowRequest(SWFBridgeRequest.CREATE_MODAL_WINDOW_REQUEST, realSm, sbRoot, o, visibleFlag);
};
}
private function findPopupInfoByOwner(owner:Object):PopUpData{
var o:PopUpData;
var n:int = popupInfo.length;
var i:int;
while (i < n) {
o = popupInfo[i];
if (o.owner == owner){
return (o);
};
i++;
};
return (null);
}
private function popupRemovedHandler(event:Event):void{
var o:PopUpData;
var popUp:DisplayObject;
var popUpParent:DisplayObject;
var modalWindow:DisplayObject;
var sm:ISystemManager;
var realSm:ISystemManager;
var parentBridge:IEventDispatcher;
var request:SWFBridgeRequest;
var n:int = popupInfo.length;
var i:int;
while (i < n) {
o = popupInfo[i];
popUp = o.owner;
if (popUp == event.target){
popUpParent = o.parent;
modalWindow = o.modalWindow;
sm = o.systemManager;
if ((sm is SystemManagerProxy)){
realSm = SystemManagerProxy(sm).systemManager;
} else {
realSm = sm;
};
if (!sm.isTopLevel()){
sm = sm.topLevelSystemManager;
};
if ((popUp is IUIComponent)){
IUIComponent(popUp).isPopUp = false;
};
if ((popUp is IFocusManagerContainer)){
sm.removeFocusManager(IFocusManagerContainer(popUp));
};
popUp.removeEventListener(Event.REMOVED, popupRemovedHandler);
if ((sm is SystemManagerProxy)){
parentBridge = realSm.swfBridgeGroup.parentBridge;
request = new SWFBridgeRequest(SWFBridgeRequest.REMOVE_POP_UP_REQUEST, false, false, parentBridge, {window:DisplayObject(sm), parent:o.parent, modal:!((o.modalWindow == null))});
realSm.getSandboxRoot().dispatchEvent(request);
} else {
if (sm.useSWFBridge()){
request = new SWFBridgeRequest(SWFBridgeRequest.REMOVE_POP_UP_PLACE_HOLDER_REQUEST, false, false, null, {window:DisplayObject(popUp)});
request.requestor = sm.swfBridgeGroup.parentBridge;
request.data.placeHolderId = NameUtil.displayObjectToString(DisplayObject(popUp));
sm.dispatchEvent(request);
};
};
if (o.owner){
o.owner.removeEventListener(FlexEvent.SHOW, showOwnerHandler);
o.owner.removeEventListener(FlexEvent.HIDE, hideOwnerHandler);
};
removeMouseOutEventListeners(o);
if (modalWindow){
realSm.removeEventListener(Event.RESIZE, o.resizeHandler);
popUp.removeEventListener(FlexEvent.SHOW, popupShowHandler);
popUp.removeEventListener(FlexEvent.HIDE, popupHideHandler);
hideModalWindow(o, true);
realSm.numModalWindows--;
};
popupInfo.splice(i, 1);
break;
};
i++;
};
}
private function fadeOutCloseEffectEndHandler(event:EffectEvent):void{
effectEndHandler(event);
DisplayObject(event.effectInstance.target).visible = false;
}
private function endEffects(o:PopUpData):void{
if (o.fade){
o.fade.end();
o.fade = null;
};
if (o.blur){
o.blur.end();
o.blur = null;
};
}
public function removePopUp(popUp:IFlexDisplayObject):void{
var o:PopUpData;
var sm:ISystemManager;
var iui:IUIComponent;
if (((popUp) && (popUp.parent))){
o = findPopupInfoByOwner(popUp);
if (o){
sm = o.systemManager;
if (!sm){
iui = (popUp as IUIComponent);
if (iui){
sm = ISystemManager(iui.systemManager);
} else {
return;
};
};
if (o.topMost){
sm.popUpChildren.removeChild(DisplayObject(popUp));
} else {
sm.removeChild(DisplayObject(popUp));
};
};
};
}
public function addPopUp(window:IFlexDisplayObject, parent:DisplayObject, modal:Boolean=false, childList:String=null):void{
var children:IChildList;
var topMost:Boolean;
var visibleFlag:Boolean = window.visible;
if ((((((parent is IUIComponent)) && ((window is IUIComponent)))) && ((IUIComponent(window).document == null)))){
IUIComponent(window).document = IUIComponent(parent).document;
};
if ((((((((parent is IUIComponent)) && ((IUIComponent(parent).document is IFlexModule)))) && ((window is UIComponent)))) && ((UIComponent(window).moduleFactory == null)))){
UIComponent(window).moduleFactory = IFlexModule(IUIComponent(parent).document).moduleFactory;
};
var sm:ISystemManager = getTopLevelSystemManager(parent);
if (!sm){
sm = ISystemManager(SystemManagerGlobals.topLevelSystemManagers[0]);
if (sm.getSandboxRoot() != parent){
return;
};
};
var smp:ISystemManager = sm;
var sbRoot:DisplayObject = sm.getSandboxRoot();
var request:SWFBridgeRequest;
if (sm.useSWFBridge()){
if (sbRoot != sm){
smp = new SystemManagerProxy(sm);
request = new SWFBridgeRequest(SWFBridgeRequest.ADD_POP_UP_REQUEST, false, false, sm.swfBridgeGroup.parentBridge, {window:DisplayObject(smp), parent:parent, modal:modal, childList:childList});
sbRoot.dispatchEvent(request);
} else {
smp = sm;
};
};
if ((window is IUIComponent)){
IUIComponent(window).isPopUp = true;
};
if (((!(childList)) || ((childList == PopUpManagerChildList.PARENT)))){
topMost = smp.popUpChildren.contains(parent);
} else {
topMost = (childList == PopUpManagerChildList.POPUP);
};
children = (topMost) ? smp.popUpChildren : smp;
children.addChild(DisplayObject(window));
window.visible = false;
if (!popupInfo){
popupInfo = [];
};
var o:PopUpData = new PopUpData();
o.owner = DisplayObject(window);
o.topMost = topMost;
o.systemManager = smp;
popupInfo.push(o);
if ((window is IFocusManagerContainer)){
if (IFocusManagerContainer(window).focusManager){
smp.addFocusManager(IFocusManagerContainer(window));
} else {
IFocusManagerContainer(window).focusManager = new FocusManager(IFocusManagerContainer(window), true);
};
};
if (((((!(sm.isTopLevelRoot())) && (sbRoot))) && ((sm == sbRoot)))){
request = new SWFBridgeRequest(SWFBridgeRequest.ADD_POP_UP_PLACE_HOLDER_REQUEST, false, false, null, {window:DisplayObject(window)});
request.requestor = sm.swfBridgeGroup.parentBridge;
request.data.placeHolderId = NameUtil.displayObjectToString(DisplayObject(window));
sm.dispatchEvent(request);
};
if ((window is IAutomationObject)){
IAutomationObject(window).showInAutomationHierarchy = true;
};
if ((window is ILayoutManagerClient)){
UIComponentGlobals.layoutManager.validateClient(ILayoutManagerClient(window), true);
};
o.parent = parent;
if ((window is IUIComponent)){
IUIComponent(window).setActualSize(IUIComponent(window).getExplicitOrMeasuredWidth(), IUIComponent(window).getExplicitOrMeasuredHeight());
};
if (modal){
createModalWindow(parent, o, children, visibleFlag, smp, sbRoot);
} else {
o._mouseDownOutsideHandler = nonmodalMouseDownOutsideHandler;
o._mouseWheelOutsideHandler = nonmodalMouseWheelOutsideHandler;
window.visible = visibleFlag;
};
o.owner.addEventListener(FlexEvent.SHOW, showOwnerHandler);
o.owner.addEventListener(FlexEvent.HIDE, hideOwnerHandler);
addMouseOutEventListeners(o);
window.addEventListener(Event.REMOVED, popupRemovedHandler);
if ((((window is IFocusManagerContainer)) && (visibleFlag))){
if (((!((smp is SystemManagerProxy))) && (smp.useSWFBridge()))){
SystemManager(smp).dispatchActivatedWindowEvent(DisplayObject(window));
} else {
smp.activate(IFocusManagerContainer(window));
};
};
}
private function dispatchModalWindowRequest(type:String, sm:ISystemManager, sbRoot:DisplayObject, o:PopUpData, visibleFlag:Boolean):void{
var request:InterManagerRequest;
if (((!(o.isRemoteModalWindow)) && (!((sm == sbRoot))))){
request = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST, false, false, "isTopLevelRoot");
sbRoot.dispatchEvent(request);
if (Boolean(request.value)){
return;
};
};
var modalRequest:SWFBridgeRequest = new SWFBridgeRequest(type, false, false, null, {skip:((!(o.isRemoteModalWindow)) && (!((sm == sbRoot)))), useExclude:o.useExclude, show:visibleFlag, remove:false, transparencyDuration:o.modalTransparencyDuration, transparency:o.modalTransparency, transparencyColor:o.modalTransparencyColor, transparencyBlur:o.modalTransparencyBlur});
var bridge:IEventDispatcher = sm.swfBridgeGroup.parentBridge;
modalRequest.requestor = bridge;
bridge.dispatchEvent(modalRequest);
}
public function createPopUp(parent:DisplayObject, className:Class, modal:Boolean=false, childList:String=null):IFlexDisplayObject{
var window:IUIComponent = new (className);
addPopUp(window, parent, modal, childList);
return (window);
}
private function removeMouseOutEventListeners(o:PopUpData):void{
var sbRoot:DisplayObject = o.systemManager.getSandboxRoot();
if (o.modalWindow){
o.modalWindow.removeEventListener(MouseEvent.MOUSE_DOWN, o.mouseDownOutsideHandler);
o.modalWindow.removeEventListener(MouseEvent.MOUSE_WHEEL, o.mouseWheelOutsideHandler, true);
} else {
sbRoot.removeEventListener(MouseEvent.MOUSE_DOWN, o.mouseDownOutsideHandler);
sbRoot.removeEventListener(MouseEvent.MOUSE_WHEEL, o.mouseWheelOutsideHandler, true);
};
sbRoot.removeEventListener(SandboxMouseEvent.MOUSE_DOWN_SOMEWHERE, o.marshalMouseOutsideHandler);
sbRoot.removeEventListener(SandboxMouseEvent.MOUSE_WHEEL_SOMEWHERE, o.marshalMouseOutsideHandler, true);
}
private function findHighestRemoteModalPopupInfo():PopUpData{
var o:PopUpData;
var n:int = (popupInfo.length - 1);
var i:int = n;
while (i >= 0) {
o = popupInfo[i];
if (o.isRemoteModalWindow){
return (o);
};
i--;
};
return (null);
}
private static function nonmodalMouseWheelOutsideHandler(owner:DisplayObject, evt:MouseEvent):void{
if (owner.hitTestPoint(evt.stageX, evt.stageY, true)){
} else {
if ((owner is IUIComponent)){
if (IUIComponent(owner).owns(DisplayObject(evt.target))){
return;
};
};
dispatchMouseWheelOutsideEvent(owner, evt);
};
}
private static function dispatchMouseWheelOutsideEvent(owner:DisplayObject, evt:MouseEvent):void{
if (!owner){
return;
};
var event:MouseEvent = new FlexMouseEvent(FlexMouseEvent.MOUSE_WHEEL_OUTSIDE);
var pt:Point = owner.globalToLocal(new Point(evt.stageX, evt.stageY));
event.localX = pt.x;
event.localY = pt.y;
event.buttonDown = evt.buttonDown;
event.shiftKey = evt.shiftKey;
event.altKey = evt.altKey;
event.ctrlKey = evt.ctrlKey;
event.delta = evt.delta;
event.relatedObject = InteractiveObject(evt.target);
owner.dispatchEvent(event);
}
mx_internal static function updateModalMask(sm:ISystemManager, modalWindow:DisplayObject, exclude:IUIComponent, excludeRect:Rectangle, mask:Sprite):void{
var excludeBounds:Rectangle;
var pt:Point;
var rect:Rectangle;
var modalBounds:Rectangle = modalWindow.getBounds(DisplayObject(sm));
if ((exclude is ISWFLoader)){
excludeBounds = ISWFLoader(exclude).getVisibleApplicationRect();
pt = new Point(excludeBounds.x, excludeBounds.y);
pt = DisplayObject(sm).globalToLocal(pt);
excludeBounds.x = pt.x;
excludeBounds.y = pt.y;
} else {
if (!exclude){
excludeBounds = modalBounds.clone();
} else {
excludeBounds = DisplayObject(exclude).getBounds(DisplayObject(sm));
};
};
if (excludeRect){
pt = new Point(excludeRect.x, excludeRect.y);
pt = DisplayObject(sm).globalToLocal(pt);
rect = new Rectangle(pt.x, pt.y, excludeRect.width, excludeRect.height);
excludeBounds = excludeBounds.intersection(rect);
};
mask.graphics.clear();
mask.graphics.beginFill(0);
if (excludeBounds.y > modalBounds.y){
mask.graphics.drawRect(modalBounds.x, modalBounds.y, modalBounds.width, (excludeBounds.y - modalBounds.y));
};
if (modalBounds.x < excludeBounds.x){
mask.graphics.drawRect(modalBounds.x, excludeBounds.y, (excludeBounds.x - modalBounds.x), excludeBounds.height);
};
if ((modalBounds.x + modalBounds.width) > (excludeBounds.x + excludeBounds.width)){
mask.graphics.drawRect((excludeBounds.x + excludeBounds.width), excludeBounds.y, (((modalBounds.x + modalBounds.width) - excludeBounds.x) - excludeBounds.width), excludeBounds.height);
};
if ((excludeBounds.y + excludeBounds.height) < (modalBounds.y + modalBounds.height)){
mask.graphics.drawRect(modalBounds.x, (excludeBounds.y + excludeBounds.height), modalBounds.width, (((modalBounds.y + modalBounds.height) - excludeBounds.y) - excludeBounds.height));
};
mask.graphics.endFill();
}
private static function dispatchMouseDownOutsideEvent(owner:DisplayObject, evt:MouseEvent):void{
if (!owner){
return;
};
var event:MouseEvent = new FlexMouseEvent(FlexMouseEvent.MOUSE_DOWN_OUTSIDE);
var pt:Point = owner.globalToLocal(new Point(evt.stageX, evt.stageY));
event.localX = pt.x;
event.localY = pt.y;
event.buttonDown = evt.buttonDown;
event.shiftKey = evt.shiftKey;
event.altKey = evt.altKey;
event.ctrlKey = evt.ctrlKey;
event.delta = evt.delta;
event.relatedObject = InteractiveObject(evt.target);
owner.dispatchEvent(event);
}
public static function getInstance():IPopUpManager{
if (!instance){
instance = new (PopUpManagerImpl);
};
return (instance);
}
private static function nonmodalMouseDownOutsideHandler(owner:DisplayObject, evt:MouseEvent):void{
if (owner.hitTestPoint(evt.stageX, evt.stageY, true)){
} else {
if ((owner is IUIComponent)){
if (IUIComponent(owner).owns(DisplayObject(evt.target))){
return;
};
};
dispatchMouseDownOutsideEvent(owner, evt);
};
}
}
}//package mx.managers
import flash.display.*;
import mx.core.*;
import flash.geom.*;
import flash.events.*;
import mx.events.*;
import mx.effects.*;
class PopUpData {
public var fade:Effect;
public var modalTransparencyColor:Number;
public var exclude:IUIComponent;
public var isRemoteModalWindow:Boolean;
public var useExclude:Boolean;
public var blurTarget:Object;
public var modalTransparencyDuration:Number;
public var _mouseWheelOutsideHandler:Function;
public var excludeRect:Rectangle;
public var modalTransparency:Number;
public var blur:Effect;
public var parent:DisplayObject;
public var modalTransparencyBlur:Number;
public var _mouseDownOutsideHandler:Function;
public var owner:DisplayObject;
public var topMost:Boolean;
public var modalMask:Sprite;
public var modalWindow:DisplayObject;
public var systemManager:ISystemManager;
private function PopUpData(){
super();
useExclude = true;
}
public function marshalMouseOutsideHandler(event:Event):void{
if (!(event is SandboxMouseEvent)){
event = SandboxMouseEvent.marshal(event);
};
if (owner){
owner.dispatchEvent(event);
};
}
public function mouseDownOutsideHandler(event:MouseEvent):void{
_mouseDownOutsideHandler(owner, event);
}
public function mouseWheelOutsideHandler(event:MouseEvent):void{
_mouseWheelOutsideHandler(owner, event);
}
public function resizeHandler(event:Event):void{
var s:Rectangle;
if (((((owner) && ((owner.stage == DisplayObject(event.target).stage)))) || (((modalWindow) && ((modalWindow.stage == DisplayObject(event.target).stage)))))){
s = systemManager.screen;
modalWindow.width = s.width;
modalWindow.height = s.height;
modalWindow.x = s.x;
modalWindow.y = s.y;
if (modalMask){
PopUpManagerImpl.updateModalMask(systemManager, modalWindow, exclude, excludeRect, modalMask);
};
};
}
}
Section 251
//SystemChildrenList (mx.managers.SystemChildrenList)
package mx.managers {
import flash.display.*;
import flash.geom.*;
import mx.core.*;
public class SystemChildrenList implements IChildList {
private var lowerBoundReference:QName;
private var upperBoundReference:QName;
private var owner:SystemManager;
mx_internal static const VERSION:String = "3.2.0.3958";
public function SystemChildrenList(owner:SystemManager, lowerBoundReference:QName, upperBoundReference:QName){
super();
this.owner = owner;
this.lowerBoundReference = lowerBoundReference;
this.upperBoundReference = upperBoundReference;
}
public function getChildAt(index:int):DisplayObject{
var _local3 = owner;
var retval:DisplayObject = _local3.mx_internal::rawChildren_getChildAt((owner[lowerBoundReference] + index));
return (retval);
}
public function getChildByName(name:String):DisplayObject{
return (owner.mx_internal::rawChildren_getChildByName(name));
}
public function removeChildAt(index:int):DisplayObject{
var _local3 = owner;
var child:DisplayObject = _local3.mx_internal::rawChildren_removeChildAt((index + owner[lowerBoundReference]));
_local3 = owner;
var _local4 = upperBoundReference;
var _local5 = (_local3[_local4] - 1);
_local3[_local4] = _local5;
return (child);
}
public function getChildIndex(child:DisplayObject):int{
var retval:int = owner.mx_internal::rawChildren_getChildIndex(child);
retval = (retval - owner[lowerBoundReference]);
return (retval);
}
public function addChildAt(child:DisplayObject, index:int):DisplayObject{
var _local3 = owner;
_local3.mx_internal::rawChildren_addChildAt(child, (owner[lowerBoundReference] + index));
_local3 = owner;
var _local4 = upperBoundReference;
var _local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
return (child);
}
public function getObjectsUnderPoint(point:Point):Array{
return (owner.mx_internal::rawChildren_getObjectsUnderPoint(point));
}
public function setChildIndex(child:DisplayObject, newIndex:int):void{
var _local3 = owner;
_local3.mx_internal::rawChildren_setChildIndex(child, (owner[lowerBoundReference] + newIndex));
}
public function get numChildren():int{
return ((owner[upperBoundReference] - owner[lowerBoundReference]));
}
public function contains(child:DisplayObject):Boolean{
var childIndex:int;
if (((!((child == owner))) && (owner.mx_internal::rawChildren_contains(child)))){
while (child.parent != owner) {
child = child.parent;
};
childIndex = owner.mx_internal::rawChildren_getChildIndex(child);
if ((((childIndex >= owner[lowerBoundReference])) && ((childIndex < owner[upperBoundReference])))){
return (true);
};
};
return (false);
}
public function removeChild(child:DisplayObject):DisplayObject{
var index:int = owner.mx_internal::rawChildren_getChildIndex(child);
if ((((owner[lowerBoundReference] <= index)) && ((index < owner[upperBoundReference])))){
var _local3 = owner;
_local3.mx_internal::rawChildren_removeChild(child);
_local3 = owner;
var _local4 = upperBoundReference;
var _local5 = (_local3[_local4] - 1);
_local3[_local4] = _local5;
};
return (child);
}
public function addChild(child:DisplayObject):DisplayObject{
var _local2 = owner;
_local2.mx_internal::rawChildren_addChildAt(child, owner[upperBoundReference]);
_local2 = owner;
var _local3 = upperBoundReference;
var _local4 = (_local2[_local3] + 1);
_local2[_local3] = _local4;
return (child);
}
}
}//package mx.managers
Section 252
//SystemManager (mx.managers.SystemManager)
package mx.managers {
import flash.display.*;
import flash.geom.*;
import mx.core.*;
import flash.text.*;
import flash.events.*;
import mx.managers.systemClasses.*;
import mx.events.*;
import mx.styles.*;
import mx.resources.*;
import flash.system.*;
import mx.preloaders.*;
import flash.utils.*;
import mx.messaging.config.*;
import mx.utils.*;
public class SystemManager extends MovieClip implements IChildList, IFlexDisplayObject, IFlexModuleFactory, ISystemManager, ISWFBridgeProvider {
private var _stage:Stage;
mx_internal var nestLevel:int;// = 0
private var currentSandboxEvent:Event;
private var forms:Array;
private var mouseCatcher:Sprite;
private var _height:Number;
private var dispatchingToSystemManagers:Boolean;// = false
private var preloader:Preloader;
private var lastFrame:int;
private var _document:Object;
private var strongReferenceProxies:Dictionary;
private var _rawChildren:SystemRawChildrenList;
private var _topLevelSystemManager:ISystemManager;
private var _toolTipIndex:int;// = 0
private var _explicitHeight:Number;
private var idToPlaceholder:Object;
private var _swfBridgeGroup:ISWFBridgeGroup;
private var _toolTipChildren:SystemChildrenList;
private var form:Object;
private var _width:Number;
private var initialized:Boolean;// = false
private var _focusPane:Sprite;
private var _fontList:Object;// = null
private var isStageRoot:Boolean;// = true
private var _popUpChildren:SystemChildrenList;
private var rslSizes:Array;// = null
private var _topMostIndex:int;// = 0
private var nextFrameTimer:Timer;// = null
mx_internal var topLevel:Boolean;// = true
private var weakReferenceProxies:Dictionary;
private var _cursorIndex:int;// = 0
private var isBootstrapRoot:Boolean;// = false
mx_internal var _mouseY;
private var _numModalWindows:int;// = 0
mx_internal var _mouseX;
private var _screen:Rectangle;
mx_internal var idleCounter:int;// = 0
private var _cursorChildren:SystemChildrenList;
private var initCallbackFunctions:Array;
private var bridgeToFocusManager:Dictionary;
private var _noTopMostIndex:int;// = 0
private var _applicationIndex:int;// = 1
private var isDispatchingResizeEvent:Boolean;
private var idleTimer:Timer;
private var doneExecutingInitCallbacks:Boolean;// = false
private var _explicitWidth:Number;
private var eventProxy:EventProxy;
mx_internal var topLevelWindow:IUIComponent;
private static const IDLE_THRESHOLD:Number = 1000;
private static const IDLE_INTERVAL:Number = 100;
mx_internal static const VERSION:String = "3.2.0.3958";
mx_internal static var lastSystemManager:SystemManager;
mx_internal static var allSystemManagers:Dictionary = new Dictionary(true);
public function SystemManager(){
initCallbackFunctions = [];
forms = [];
weakReferenceProxies = new Dictionary(true);
strongReferenceProxies = new Dictionary(false);
super();
if (stage){
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
};
if ((((SystemManagerGlobals.topLevelSystemManagers.length > 0)) && (!(stage)))){
topLevel = false;
};
if (!stage){
isStageRoot = false;
};
if (topLevel){
SystemManagerGlobals.topLevelSystemManagers.push(this);
};
lastSystemManager = this;
var compiledLocales:Array = info()["compiledLocales"];
ResourceBundle.locale = (((!((compiledLocales == null))) && ((compiledLocales.length > 0)))) ? compiledLocales[0] : "en_US";
executeCallbacks();
stop();
if (((topLevel) && (!((currentFrame == 1))))){
throw (new Error((("The SystemManager constructor was called when the currentFrame was at " + currentFrame) + " Please add this SWF to bug 129782.")));
};
if (((root) && (root.loaderInfo))){
root.loaderInfo.addEventListener(Event.INIT, initHandler);
};
}
private function removeEventListenerFromSandboxes(type:String, listener:Function, useCapture:Boolean=false, skip:IEventDispatcher=null):void{
var i:int;
if (!swfBridgeGroup){
return;
};
var request:EventListenerRequest = new EventListenerRequest(EventListenerRequest.REMOVE_EVENT_LISTENER_REQUEST, false, false, type, useCapture);
var parentBridge:IEventDispatcher = swfBridgeGroup.parentBridge;
if (((parentBridge) && (!((parentBridge == skip))))){
parentBridge.removeEventListener(type, listener, useCapture);
};
var children:Array = swfBridgeGroup.getChildBridges();
while (i < children.length) {
if (children[i] != skip){
IEventDispatcher(children[i]).removeEventListener(type, listener, useCapture);
};
i++;
};
dispatchEventFromSWFBridges(request, skip);
}
mx_internal function addingChild(child:DisplayObject):void{
var obj:DisplayObjectContainer;
var newNestLevel = 1;
if (((!(topLevel)) && (parent))){
obj = parent.parent;
while (obj) {
if ((obj is ILayoutManagerClient)){
newNestLevel = (ILayoutManagerClient(obj).nestLevel + 1);
break;
};
obj = obj.parent;
};
};
nestLevel = newNestLevel;
if ((child is IUIComponent)){
IUIComponent(child).systemManager = this;
};
var uiComponentClassName:Class = Class(getDefinitionByName("mx.core.UIComponent"));
if ((((child is IUIComponent)) && (!(IUIComponent(child).document)))){
IUIComponent(child).document = document;
};
if ((child is ILayoutManagerClient)){
ILayoutManagerClient(child).nestLevel = (nestLevel + 1);
};
if ((child is InteractiveObject)){
if (doubleClickEnabled){
InteractiveObject(child).doubleClickEnabled = true;
};
};
if ((child is IUIComponent)){
IUIComponent(child).parentChanged(this);
};
if ((child is IStyleClient)){
IStyleClient(child).regenerateStyleCache(true);
};
if ((child is ISimpleStyleClient)){
ISimpleStyleClient(child).styleChanged(null);
};
if ((child is IStyleClient)){
IStyleClient(child).notifyStyleChangeInChildren(null, true);
};
if (((uiComponentClassName) && ((child is uiComponentClassName)))){
uiComponentClassName(child).initThemeColor();
};
if (((uiComponentClassName) && ((child is uiComponentClassName)))){
uiComponentClassName(child).stylesInitialized();
};
}
private function dispatchEventToOtherSystemManagers(event:Event):void{
dispatchingToSystemManagers = true;
var arr:Array = SystemManagerGlobals.topLevelSystemManagers;
var n:int = arr.length;
var i:int;
while (i < n) {
if (arr[i] != this){
arr[i].dispatchEvent(event);
};
i++;
};
dispatchingToSystemManagers = false;
}
private function idleTimer_timerHandler(event:TimerEvent):void{
idleCounter++;
if ((idleCounter * IDLE_INTERVAL) > IDLE_THRESHOLD){
dispatchEvent(new FlexEvent(FlexEvent.IDLE));
};
}
private function initManagerHandler(event:Event):void{
var event = event;
if (!dispatchingToSystemManagers){
dispatchEventToOtherSystemManagers(event);
};
if ((event is InterManagerRequest)){
return;
};
var name:String = event["name"];
Singleton.getInstance(name);
//unresolved jump
var _slot1 = e;
}
private function getSizeRequestHandler(event:Event):void{
var eObj:Object = Object(event);
eObj.data = {width:measuredWidth, height:measuredHeight};
}
private function beforeUnloadHandler(event:Event):void{
var sandboxRoot:DisplayObject;
if (((topLevel) && (stage))){
sandboxRoot = getSandboxRoot();
if (sandboxRoot != this){
sandboxRoot.removeEventListener(Event.RESIZE, Stage_resizeHandler);
};
};
removeParentBridgeListeners();
dispatchEvent(event);
}
public function getExplicitOrMeasuredHeight():Number{
return ((isNaN(explicitHeight)) ? measuredHeight : explicitHeight);
}
private function getVisibleRectRequestHandler(event:Event):void{
var localRect:Rectangle;
var pt:Point;
var bridge:IEventDispatcher;
if ((event is SWFBridgeRequest)){
return;
};
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
var rect:Rectangle = Rectangle(request.data);
var owner:DisplayObject = DisplayObject(swfBridgeGroup.getChildBridgeProvider(request.requestor));
var forwardRequest:Boolean;
if (!DisplayObjectContainer(document).contains(owner)){
forwardRequest = false;
};
if ((owner is ISWFLoader)){
localRect = ISWFLoader(owner).getVisibleApplicationRect();
} else {
localRect = owner.getBounds(this);
pt = localToGlobal(localRect.topLeft);
localRect.x = pt.x;
localRect.y = pt.y;
};
rect = rect.intersection(localRect);
request.data = rect;
if (((forwardRequest) && (useSWFBridge()))){
bridge = swfBridgeGroup.parentBridge;
request.requestor = bridge;
bridge.dispatchEvent(request);
};
Object(event).data = request.data;
}
mx_internal function notifyStyleChangeInChildren(styleProp:String, recursive:Boolean):void{
var child:IStyleClient;
var foundTopLevelWindow:Boolean;
var n:int = rawChildren.numChildren;
var i:int;
while (i < n) {
child = (rawChildren.getChildAt(i) as IStyleClient);
if (child){
child.styleChanged(styleProp);
child.notifyStyleChangeInChildren(styleProp, recursive);
};
if (isTopLevelWindow(DisplayObject(child))){
foundTopLevelWindow = true;
};
n = rawChildren.numChildren;
i++;
};
if (((!(foundTopLevelWindow)) && ((topLevelWindow is IStyleClient)))){
IStyleClient(topLevelWindow).styleChanged(styleProp);
IStyleClient(topLevelWindow).notifyStyleChangeInChildren(styleProp, recursive);
};
}
mx_internal function rawChildren_getObjectsUnderPoint(pt:Point):Array{
return (super.getObjectsUnderPoint(pt));
}
private function initHandler(event:Event):void{
var bridgeEvent:SWFBridgeEvent;
var event = event;
if (!isStageRoot){
if (root.loaderInfo.parentAllowsChild){
if (!parent.dispatchEvent(new Event("mx.managers.SystemManager.isBootstrapRoot", false, true))){
isBootstrapRoot = true;
};
//unresolved jump
var _slot1 = e;
};
};
allSystemManagers[this] = this.loaderInfo.url;
root.loaderInfo.removeEventListener(Event.INIT, initHandler);
if (useSWFBridge()){
swfBridgeGroup = new SWFBridgeGroup(this);
swfBridgeGroup.parentBridge = loaderInfo.sharedEvents;
addParentBridgeListeners();
bridgeEvent = new SWFBridgeEvent(SWFBridgeEvent.BRIDGE_NEW_APPLICATION);
bridgeEvent.data = swfBridgeGroup.parentBridge;
swfBridgeGroup.parentBridge.dispatchEvent(bridgeEvent);
addEventListener(SWFBridgeRequest.ADD_POP_UP_PLACE_HOLDER_REQUEST, addPlaceholderPopupRequestHandler);
root.loaderInfo.addEventListener(Event.UNLOAD, unloadHandler, false, 0, true);
};
getSandboxRoot().addEventListener(InterManagerRequest.INIT_MANAGER_REQUEST, initManagerHandler, false, 0, true);
if (getSandboxRoot() == this){
addEventListener(InterManagerRequest.SYSTEM_MANAGER_REQUEST, systemManagerHandler);
addEventListener(InterManagerRequest.DRAG_MANAGER_REQUEST, multiWindowRedispatcher);
addEventListener("dispatchDragEvent", multiWindowRedispatcher);
addEventListener(SWFBridgeRequest.ADD_POP_UP_REQUEST, addPopupRequestHandler);
addEventListener(SWFBridgeRequest.REMOVE_POP_UP_REQUEST, removePopupRequestHandler);
addEventListener(SWFBridgeRequest.ADD_POP_UP_PLACE_HOLDER_REQUEST, addPlaceholderPopupRequestHandler);
addEventListener(SWFBridgeRequest.REMOVE_POP_UP_PLACE_HOLDER_REQUEST, removePlaceholderPopupRequestHandler);
addEventListener(SWFBridgeEvent.BRIDGE_WINDOW_ACTIVATE, activateFormSandboxEventHandler);
addEventListener(SWFBridgeEvent.BRIDGE_WINDOW_DEACTIVATE, deactivateFormSandboxEventHandler);
addEventListener(SWFBridgeRequest.HIDE_MOUSE_CURSOR_REQUEST, hideMouseCursorRequestHandler);
addEventListener(SWFBridgeRequest.SHOW_MOUSE_CURSOR_REQUEST, showMouseCursorRequestHandler);
addEventListener(SWFBridgeRequest.RESET_MOUSE_CURSOR_REQUEST, resetMouseCursorRequestHandler);
};
var docFrame:int = ((totalFrames)==1) ? 0 : 1;
addEventListener(Event.ENTER_FRAME, docFrameListener);
initialize();
}
mx_internal function findFocusManagerContainer(smp:SystemManagerProxy):IFocusManagerContainer{
var child:DisplayObject;
var children:IChildList = smp.rawChildren;
var numChildren:int = children.numChildren;
var i:int;
while (i < numChildren) {
child = children.getChildAt(i);
if ((child is IFocusManagerContainer)){
return (IFocusManagerContainer(child));
};
i++;
};
return (null);
}
private function addPlaceholderPopupRequestHandler(event:Event):void{
var remoteForm:RemotePopUp;
var popUpRequest:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (((!((event.target == this))) && ((event is SWFBridgeRequest)))){
return;
};
if (!forwardPlaceholderRequest(popUpRequest, true)){
remoteForm = new RemotePopUp(popUpRequest.data.placeHolderId, popUpRequest.requestor);
forms.push(remoteForm);
};
}
override public function contains(child:DisplayObject):Boolean{
var childIndex:int;
var i:int;
var myChild:DisplayObject;
if (super.contains(child)){
if (child.parent == this){
childIndex = super.getChildIndex(child);
if (childIndex < noTopMostIndex){
return (true);
};
} else {
i = 0;
while (i < noTopMostIndex) {
myChild = super.getChildAt(i);
if ((myChild is IRawChildrenContainer)){
if (IRawChildrenContainer(myChild).rawChildren.contains(child)){
return (true);
};
};
if ((myChild is DisplayObjectContainer)){
if (DisplayObjectContainer(myChild).contains(child)){
return (true);
};
};
i++;
};
};
};
return (false);
}
private function modalWindowRequestHandler(event:Event):void{
if ((event is SWFBridgeRequest)){
return;
};
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (!preProcessModalWindowRequest(request, getSandboxRoot())){
return;
};
Singleton.getInstance("mx.managers::IPopUpManager");
dispatchEvent(request);
}
private function activateApplicationSandboxEventHandler(event:Event):void{
if (!isTopLevelRoot()){
swfBridgeGroup.parentBridge.dispatchEvent(event);
return;
};
activateForm(document);
}
public function getDefinitionByName(name:String):Object{
var definition:Object;
var domain:ApplicationDomain = (((!(topLevel)) && ((parent is Loader)))) ? Loader(parent).contentLoaderInfo.applicationDomain : (info()["currentDomain"] as ApplicationDomain);
if (domain.hasDefinition(name)){
definition = domain.getDefinition(name);
};
return (definition);
}
public function removeChildFromSandboxRoot(layer:String, child:DisplayObject):void{
var me:InterManagerRequest;
if (getSandboxRoot() == this){
this[layer].removeChild(child);
} else {
removingChild(child);
me = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST);
me.name = (layer + ".removeChild");
me.value = child;
getSandboxRoot().dispatchEvent(me);
childRemoved(child);
};
}
private function removeEventListenerFromOtherSystemManagers(type:String, listener:Function, useCapture:Boolean=false):void{
var arr:Array = SystemManagerGlobals.topLevelSystemManagers;
if (arr.length < 2){
return;
};
SystemManagerGlobals.changingListenersInOtherSystemManagers = true;
var n:int = arr.length;
var i:int;
while (i < n) {
if (arr[i] != this){
arr[i].removeEventListener(type, listener, useCapture);
};
i++;
};
SystemManagerGlobals.changingListenersInOtherSystemManagers = false;
}
private function addEventListenerToOtherSystemManagers(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{
var arr:Array = SystemManagerGlobals.topLevelSystemManagers;
if (arr.length < 2){
return;
};
SystemManagerGlobals.changingListenersInOtherSystemManagers = true;
var n:int = arr.length;
var i:int;
while (i < n) {
if (arr[i] != this){
arr[i].addEventListener(type, listener, useCapture, priority, useWeakReference);
};
i++;
};
SystemManagerGlobals.changingListenersInOtherSystemManagers = false;
}
public function get embeddedFontList():Object{
var o:Object;
var p:String;
var fl:Object;
if (_fontList == null){
_fontList = {};
o = info()["fonts"];
for (p in o) {
_fontList[p] = o[p];
};
if (((!(topLevel)) && (_topLevelSystemManager))){
fl = _topLevelSystemManager.embeddedFontList;
for (p in fl) {
_fontList[p] = fl[p];
};
};
};
return (_fontList);
}
mx_internal function set cursorIndex(value:int):void{
var delta:int = (value - _cursorIndex);
_cursorIndex = value;
}
mx_internal function addChildBridgeListeners(bridge:IEventDispatcher):void{
if (((!(topLevel)) && (topLevelSystemManager))){
SystemManager(topLevelSystemManager).addChildBridgeListeners(bridge);
return;
};
bridge.addEventListener(SWFBridgeRequest.ADD_POP_UP_REQUEST, addPopupRequestHandler);
bridge.addEventListener(SWFBridgeRequest.REMOVE_POP_UP_REQUEST, removePopupRequestHandler);
bridge.addEventListener(SWFBridgeRequest.ADD_POP_UP_PLACE_HOLDER_REQUEST, addPlaceholderPopupRequestHandler);
bridge.addEventListener(SWFBridgeRequest.REMOVE_POP_UP_PLACE_HOLDER_REQUEST, removePlaceholderPopupRequestHandler);
bridge.addEventListener(SWFBridgeEvent.BRIDGE_WINDOW_ACTIVATE, activateFormSandboxEventHandler);
bridge.addEventListener(SWFBridgeEvent.BRIDGE_WINDOW_DEACTIVATE, deactivateFormSandboxEventHandler);
bridge.addEventListener(SWFBridgeEvent.BRIDGE_APPLICATION_ACTIVATE, activateApplicationSandboxEventHandler);
bridge.addEventListener(EventListenerRequest.ADD_EVENT_LISTENER_REQUEST, eventListenerRequestHandler, false, 0, true);
bridge.addEventListener(EventListenerRequest.REMOVE_EVENT_LISTENER_REQUEST, eventListenerRequestHandler, false, 0, true);
bridge.addEventListener(SWFBridgeRequest.CREATE_MODAL_WINDOW_REQUEST, modalWindowRequestHandler);
bridge.addEventListener(SWFBridgeRequest.SHOW_MODAL_WINDOW_REQUEST, modalWindowRequestHandler);
bridge.addEventListener(SWFBridgeRequest.HIDE_MODAL_WINDOW_REQUEST, modalWindowRequestHandler);
bridge.addEventListener(SWFBridgeRequest.GET_VISIBLE_RECT_REQUEST, getVisibleRectRequestHandler);
bridge.addEventListener(SWFBridgeRequest.HIDE_MOUSE_CURSOR_REQUEST, hideMouseCursorRequestHandler);
bridge.addEventListener(SWFBridgeRequest.SHOW_MOUSE_CURSOR_REQUEST, showMouseCursorRequestHandler);
bridge.addEventListener(SWFBridgeRequest.RESET_MOUSE_CURSOR_REQUEST, resetMouseCursorRequestHandler);
}
public function set document(value:Object):void{
_document = value;
}
override public function getChildAt(index:int):DisplayObject{
return (super.getChildAt((applicationIndex + index)));
}
public function get rawChildren():IChildList{
if (!_rawChildren){
_rawChildren = new SystemRawChildrenList(this);
};
return (_rawChildren);
}
private function findLastActiveForm(f:Object):Object{
var n:int = forms.length;
var i:int = (forms.length - 1);
while (i >= 0) {
if (((!((forms[i] == f))) && (canActivatePopUp(forms[i])))){
return (forms[i]);
};
i--;
};
return (null);
}
private function multiWindowRedispatcher(event:Event):void{
if (!dispatchingToSystemManagers){
dispatchEventToOtherSystemManagers(event);
};
}
public function deployMouseShields(deploy:Boolean):void{
var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.DRAG_MANAGER_REQUEST, false, false, "mouseShield", deploy);
getSandboxRoot().dispatchEvent(me);
}
override public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{
var newListener:StageEventProxy;
var actualType:String;
var type = type;
var listener = listener;
var useCapture = useCapture;
var priority = priority;
var useWeakReference = useWeakReference;
if ((((type == FlexEvent.RENDER)) || ((type == FlexEvent.ENTER_FRAME)))){
if (type == FlexEvent.RENDER){
type = Event.RENDER;
} else {
type = Event.ENTER_FRAME;
};
if (stage){
stage.addEventListener(type, listener, useCapture, priority, useWeakReference);
} else {
super.addEventListener(type, listener, useCapture, priority, useWeakReference);
};
//unresolved jump
var _slot1 = error;
super.addEventListener(type, listener, useCapture, priority, useWeakReference);
if (((stage) && ((type == Event.RENDER)))){
stage.invalidate();
};
return;
};
if ((((((((((type == MouseEvent.MOUSE_MOVE)) || ((type == MouseEvent.MOUSE_UP)))) || ((type == MouseEvent.MOUSE_DOWN)))) || ((type == Event.ACTIVATE)))) || ((type == Event.DEACTIVATE)))){
if (stage){
newListener = new StageEventProxy(listener);
stage.addEventListener(type, newListener.stageListener, false, priority, useWeakReference);
if (useWeakReference){
weakReferenceProxies[listener] = newListener;
} else {
strongReferenceProxies[listener] = newListener;
};
};
//unresolved jump
var _slot1 = error;
};
if (((hasSWFBridges()) || ((SystemManagerGlobals.topLevelSystemManagers.length > 1)))){
if (!eventProxy){
eventProxy = new EventProxy(this);
};
actualType = EventUtil.sandboxMouseEventMap[type];
if (actualType){
if (isTopLevelRoot()){
stage.addEventListener(MouseEvent.MOUSE_MOVE, resetMouseCursorTracking, true, (EventPriority.CURSOR_MANAGEMENT + 1), true);
addEventListenerToSandboxes(SandboxMouseEvent.MOUSE_MOVE_SOMEWHERE, resetMouseCursorTracking, true, (EventPriority.CURSOR_MANAGEMENT + 1), true);
} else {
super.addEventListener(MouseEvent.MOUSE_MOVE, resetMouseCursorTracking, true, (EventPriority.CURSOR_MANAGEMENT + 1), true);
};
addEventListenerToSandboxes(type, sandboxMouseListener, useCapture, priority, useWeakReference);
if (!SystemManagerGlobals.changingListenersInOtherSystemManagers){
addEventListenerToOtherSystemManagers(type, otherSystemManagerMouseListener, useCapture, priority, useWeakReference);
};
if (getSandboxRoot() == this){
super.addEventListener(actualType, eventProxy.marshalListener, useCapture, priority, useWeakReference);
};
super.addEventListener(type, listener, false, priority, useWeakReference);
return;
};
};
if ((((type == FlexEvent.IDLE)) && (!(idleTimer)))){
idleTimer = new Timer(IDLE_INTERVAL);
idleTimer.addEventListener(TimerEvent.TIMER, idleTimer_timerHandler);
idleTimer.start();
addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true);
addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler, true);
};
super.addEventListener(type, listener, useCapture, priority, useWeakReference);
}
private function activateForm(f:Object):void{
var z:IFocusManagerContainer;
if (form){
if (((!((form == f))) && ((forms.length > 1)))){
if (isRemotePopUp(form)){
if (!areRemotePopUpsEqual(form, f)){
deactivateRemotePopUp(form);
};
} else {
z = IFocusManagerContainer(form);
z.focusManager.deactivate();
};
};
};
form = f;
if (isRemotePopUp(f)){
activateRemotePopUp(f);
} else {
if (f.focusManager){
f.focusManager.activate();
};
};
updateLastActiveForm();
}
public function removeFocusManager(f:IFocusManagerContainer):void{
var n:int = forms.length;
var i:int;
while (i < n) {
if (forms[i] == f){
if (form == f){
deactivate(f);
};
dispatchDeactivatedWindowEvent(DisplayObject(f));
forms.splice(i, 1);
return;
};
i++;
};
}
private function mouseMoveHandler(event:MouseEvent):void{
idleCounter = 0;
}
private function getSandboxScreen():Rectangle{
var sandboxScreen:Rectangle;
var sm:DisplayObject;
var me:InterManagerRequest;
var sandboxRoot:DisplayObject = getSandboxRoot();
if (sandboxRoot == this){
sandboxScreen = new Rectangle(0, 0, width, height);
} else {
if (sandboxRoot == topLevelSystemManager){
sm = DisplayObject(topLevelSystemManager);
sandboxScreen = new Rectangle(0, 0, sm.width, sm.height);
} else {
me = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST, false, false, "screen");
sandboxRoot.dispatchEvent(me);
sandboxScreen = Rectangle(me.value);
};
};
return (sandboxScreen);
}
public function get focusPane():Sprite{
return (_focusPane);
}
override public function get mouseX():Number{
if (_mouseX === undefined){
return (super.mouseX);
};
return (_mouseX);
}
private function mouseDownHandler(event:MouseEvent):void{
var n:int;
var p:DisplayObject;
var isApplication:Boolean;
var i:int;
var form_i:Object;
var j:int;
var index:int;
var newIndex:int;
var childList:IChildList;
var f:DisplayObject;
var isRemotePopUp:Boolean;
var fChildIndex:int;
idleCounter = 0;
var bridge:IEventDispatcher = getSWFBridgeOfDisplayObject((event.target as DisplayObject));
if (((bridge) && ((bridgeToFocusManager[bridge] == document.focusManager)))){
if (isTopLevelRoot()){
activateForm(document);
} else {
dispatchActivatedApplicationEvent();
};
return;
};
if (numModalWindows == 0){
if (((!(isTopLevelRoot())) || ((forms.length > 1)))){
n = forms.length;
p = DisplayObject(event.target);
isApplication = document.rawChildren.contains(p);
while (p) {
i = 0;
while (i < n) {
form_i = (isRemotePopUp(forms[i])) ? forms[i].window : forms[i];
if (form_i == p){
j = 0;
if (((((!((p == form))) && ((p is IFocusManagerContainer)))) || (((!(isTopLevelRoot())) && ((p == form)))))){
if (isTopLevelRoot()){
activate(IFocusManagerContainer(p));
};
if (p == document){
dispatchActivatedApplicationEvent();
} else {
if ((p is DisplayObject)){
dispatchActivatedWindowEvent(DisplayObject(p));
};
};
};
if (popUpChildren.contains(p)){
childList = popUpChildren;
} else {
childList = this;
};
index = childList.getChildIndex(p);
newIndex = index;
n = forms.length;
j = 0;
for (;j < n;j++) {
isRemotePopUp = isRemotePopUp(forms[j]);
if (isRemotePopUp){
if ((forms[j].window is String)){
continue;
};
f = forms[j].window;
} else {
f = forms[j];
};
if (isRemotePopUp){
fChildIndex = getChildListIndex(childList, f);
if (fChildIndex > index){
newIndex = Math.max(fChildIndex, newIndex);
};
} else {
if (childList.contains(f)){
if (childList.getChildIndex(f) > index){
newIndex = Math.max(childList.getChildIndex(f), newIndex);
};
};
};
};
if ((((newIndex > index)) && (!(isApplication)))){
childList.setChildIndex(p, newIndex);
};
return;
};
i++;
};
p = p.parent;
};
} else {
dispatchActivatedApplicationEvent();
};
};
}
private function removePopupRequestHandler(event:Event):void{
var request:SWFBridgeRequest;
var popUpRequest:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (((swfBridgeGroup.parentBridge) && (SecurityUtil.hasMutualTrustBetweenParentAndChild(this)))){
popUpRequest.requestor = swfBridgeGroup.parentBridge;
getSandboxRoot().dispatchEvent(popUpRequest);
return;
};
if (popUpChildren.contains(popUpRequest.data.window)){
popUpChildren.removeChild(popUpRequest.data.window);
} else {
removeChild(DisplayObject(popUpRequest.data.window));
};
if (popUpRequest.data.modal){
numModalWindows--;
};
removeRemotePopUp(new RemotePopUp(popUpRequest.data.window, popUpRequest.requestor));
if (((!(isTopLevelRoot())) && (swfBridgeGroup))){
request = new SWFBridgeRequest(SWFBridgeRequest.REMOVE_POP_UP_PLACE_HOLDER_REQUEST, false, false, popUpRequest.requestor, {placeHolderId:NameUtil.displayObjectToString(popUpRequest.data.window)});
dispatchEvent(request);
};
}
public function addChildBridge(bridge:IEventDispatcher, owner:DisplayObject):void{
var fm:IFocusManager;
var o:DisplayObject = owner;
while (o) {
if ((o is IFocusManagerContainer)){
fm = IFocusManagerContainer(o).focusManager;
break;
};
o = o.parent;
};
if (!fm){
return;
};
if (!swfBridgeGroup){
swfBridgeGroup = new SWFBridgeGroup(this);
};
swfBridgeGroup.addChildBridge(bridge, ISWFBridgeProvider(owner));
fm.addSWFBridge(bridge, owner);
if (!bridgeToFocusManager){
bridgeToFocusManager = new Dictionary();
};
bridgeToFocusManager[bridge] = fm;
addChildBridgeListeners(bridge);
}
public function get screen():Rectangle{
if (!_screen){
Stage_resizeHandler();
};
if (!isStageRoot){
Stage_resizeHandler();
};
return (_screen);
}
private function resetMouseCursorRequestHandler(event:Event):void{
var bridge:IEventDispatcher;
if (((!(isTopLevelRoot())) && ((event is SWFBridgeRequest)))){
return;
};
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (!isTopLevelRoot()){
bridge = swfBridgeGroup.parentBridge;
request.requestor = bridge;
bridge.dispatchEvent(request);
} else {
if (eventProxy){
SystemManagerGlobals.showMouseCursor = true;
};
};
}
mx_internal function set topMostIndex(value:int):void{
var delta:int = (value - _topMostIndex);
_topMostIndex = value;
toolTipIndex = (toolTipIndex + delta);
}
mx_internal function docFrameHandler(event:Event=null):void{
var textFieldFactory:TextFieldFactory;
var n:int;
var i:int;
var c:Class;
Singleton.registerClass("mx.managers::IBrowserManager", Class(getDefinitionByName("mx.managers::BrowserManagerImpl")));
Singleton.registerClass("mx.managers::ICursorManager", Class(getDefinitionByName("mx.managers::CursorManagerImpl")));
Singleton.registerClass("mx.managers::IHistoryManager", Class(getDefinitionByName("mx.managers::HistoryManagerImpl")));
Singleton.registerClass("mx.managers::ILayoutManager", Class(getDefinitionByName("mx.managers::LayoutManager")));
Singleton.registerClass("mx.managers::IPopUpManager", Class(getDefinitionByName("mx.managers::PopUpManagerImpl")));
Singleton.registerClass("mx.managers::IToolTipManager2", Class(getDefinitionByName("mx.managers::ToolTipManagerImpl")));
if (Capabilities.playerType == "Desktop"){
Singleton.registerClass("mx.managers::IDragManager", Class(getDefinitionByName("mx.managers::NativeDragManagerImpl")));
if (Singleton.getClass("mx.managers::IDragManager") == null){
Singleton.registerClass("mx.managers::IDragManager", Class(getDefinitionByName("mx.managers::DragManagerImpl")));
};
} else {
Singleton.registerClass("mx.managers::IDragManager", Class(getDefinitionByName("mx.managers::DragManagerImpl")));
};
Singleton.registerClass("mx.core::ITextFieldFactory", Class(getDefinitionByName("mx.core::TextFieldFactory")));
executeCallbacks();
doneExecutingInitCallbacks = true;
var mixinList:Array = info()["mixins"];
if (((mixinList) && ((mixinList.length > 0)))){
n = mixinList.length;
i = 0;
while (i < n) {
c = Class(getDefinitionByName(mixinList[i]));
var _local7 = c;
_local7["init"](this);
i++;
};
};
installCompiledResourceBundles();
initializeTopLevelWindow(null);
deferredNextFrame();
}
public function get explicitHeight():Number{
return (_explicitHeight);
}
public function get preloaderBackgroundSize():String{
return (info()["backgroundSize"]);
}
public function isTopLevel():Boolean{
return (topLevel);
}
override public function get mouseY():Number{
if (_mouseY === undefined){
return (super.mouseY);
};
return (_mouseY);
}
public function getExplicitOrMeasuredWidth():Number{
return ((isNaN(explicitWidth)) ? measuredWidth : explicitWidth);
}
public function deactivate(f:IFocusManagerContainer):void{
deactivateForm(Object(f));
}
private function preProcessModalWindowRequest(request:SWFBridgeRequest, sbRoot:DisplayObject):Boolean{
var bridge:IEventDispatcher;
var exclude:ISWFLoader;
var excludeRect:Rectangle;
if (request.data.skip){
request.data.skip = false;
if (useSWFBridge()){
bridge = swfBridgeGroup.parentBridge;
request.requestor = bridge;
bridge.dispatchEvent(request);
};
return (false);
};
if (this != sbRoot){
if ((((request.type == SWFBridgeRequest.CREATE_MODAL_WINDOW_REQUEST)) || ((request.type == SWFBridgeRequest.SHOW_MODAL_WINDOW_REQUEST)))){
exclude = (swfBridgeGroup.getChildBridgeProvider(request.requestor) as ISWFLoader);
if (exclude){
excludeRect = ISWFLoader(exclude).getVisibleApplicationRect();
request.data.excludeRect = excludeRect;
if (!DisplayObjectContainer(document).contains(DisplayObject(exclude))){
request.data.useExclude = false;
};
};
};
bridge = swfBridgeGroup.parentBridge;
request.requestor = bridge;
if (request.type == SWFBridgeRequest.HIDE_MODAL_WINDOW_REQUEST){
sbRoot.dispatchEvent(request);
} else {
bridge.dispatchEvent(request);
};
return (false);
};
request.data.skip = false;
return (true);
}
private function resetMouseCursorTracking(event:Event):void{
var cursorRequest:SWFBridgeRequest;
var bridge:IEventDispatcher;
if (isTopLevelRoot()){
SystemManagerGlobals.showMouseCursor = true;
} else {
if (swfBridgeGroup.parentBridge){
cursorRequest = new SWFBridgeRequest(SWFBridgeRequest.RESET_MOUSE_CURSOR_REQUEST);
bridge = swfBridgeGroup.parentBridge;
cursorRequest.requestor = bridge;
bridge.dispatchEvent(cursorRequest);
};
};
}
mx_internal function addParentBridgeListeners():void{
if (((!(topLevel)) && (topLevelSystemManager))){
SystemManager(topLevelSystemManager).addParentBridgeListeners();
return;
};
var bridge:IEventDispatcher = swfBridgeGroup.parentBridge;
bridge.addEventListener(SWFBridgeRequest.SET_ACTUAL_SIZE_REQUEST, setActualSizeRequestHandler);
bridge.addEventListener(SWFBridgeRequest.GET_SIZE_REQUEST, getSizeRequestHandler);
bridge.addEventListener(SWFBridgeRequest.ACTIVATE_POP_UP_REQUEST, activateRequestHandler);
bridge.addEventListener(SWFBridgeRequest.DEACTIVATE_POP_UP_REQUEST, deactivateRequestHandler);
bridge.addEventListener(SWFBridgeRequest.IS_BRIDGE_CHILD_REQUEST, isBridgeChildHandler);
bridge.addEventListener(EventListenerRequest.ADD_EVENT_LISTENER_REQUEST, eventListenerRequestHandler);
bridge.addEventListener(EventListenerRequest.REMOVE_EVENT_LISTENER_REQUEST, eventListenerRequestHandler);
bridge.addEventListener(SWFBridgeRequest.CAN_ACTIVATE_POP_UP_REQUEST, canActivateHandler);
bridge.addEventListener(SWFBridgeEvent.BRIDGE_APPLICATION_UNLOADING, beforeUnloadHandler);
}
public function get swfBridgeGroup():ISWFBridgeGroup{
if (topLevel){
return (_swfBridgeGroup);
};
if (topLevelSystemManager){
return (topLevelSystemManager.swfBridgeGroup);
};
return (null);
}
override public function getChildByName(name:String):DisplayObject{
return (super.getChildByName(name));
}
public function get measuredWidth():Number{
return ((topLevelWindow) ? topLevelWindow.getExplicitOrMeasuredWidth() : loaderInfo.width);
}
public function removeChildBridge(bridge:IEventDispatcher):void{
var fm:IFocusManager = IFocusManager(bridgeToFocusManager[bridge]);
fm.removeSWFBridge(bridge);
swfBridgeGroup.removeChildBridge(bridge);
delete bridgeToFocusManager[bridge];
removeChildBridgeListeners(bridge);
}
mx_internal function removeChildBridgeListeners(bridge:IEventDispatcher):void{
if (((!(topLevel)) && (topLevelSystemManager))){
SystemManager(topLevelSystemManager).removeChildBridgeListeners(bridge);
return;
};
bridge.removeEventListener(SWFBridgeRequest.ADD_POP_UP_REQUEST, addPopupRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.REMOVE_POP_UP_REQUEST, removePopupRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.ADD_POP_UP_PLACE_HOLDER_REQUEST, addPlaceholderPopupRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.REMOVE_POP_UP_PLACE_HOLDER_REQUEST, removePlaceholderPopupRequestHandler);
bridge.removeEventListener(SWFBridgeEvent.BRIDGE_WINDOW_ACTIVATE, activateFormSandboxEventHandler);
bridge.removeEventListener(SWFBridgeEvent.BRIDGE_WINDOW_DEACTIVATE, deactivateFormSandboxEventHandler);
bridge.removeEventListener(SWFBridgeEvent.BRIDGE_APPLICATION_ACTIVATE, activateApplicationSandboxEventHandler);
bridge.removeEventListener(EventListenerRequest.ADD_EVENT_LISTENER_REQUEST, eventListenerRequestHandler);
bridge.removeEventListener(EventListenerRequest.REMOVE_EVENT_LISTENER_REQUEST, eventListenerRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.CREATE_MODAL_WINDOW_REQUEST, modalWindowRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.SHOW_MODAL_WINDOW_REQUEST, modalWindowRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.HIDE_MODAL_WINDOW_REQUEST, modalWindowRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.GET_VISIBLE_RECT_REQUEST, getVisibleRectRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.HIDE_MOUSE_CURSOR_REQUEST, hideMouseCursorRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.SHOW_MOUSE_CURSOR_REQUEST, showMouseCursorRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.RESET_MOUSE_CURSOR_REQUEST, resetMouseCursorRequestHandler);
}
override public function addChildAt(child:DisplayObject, index:int):DisplayObject{
noTopMostIndex++;
return (rawChildren_addChildAt(child, (applicationIndex + index)));
}
private function Stage_resizeHandler(event:Event=null):void{
var m:Number;
var n:Number;
var sandboxScreen:Rectangle;
var event = event;
if (isDispatchingResizeEvent){
return;
};
var w:Number = 0;
var h:Number = 0;
m = loaderInfo.width;
n = loaderInfo.height;
//unresolved jump
var _slot1 = error;
return;
var align:String = StageAlign.TOP_LEFT;
if (stage){
w = stage.stageWidth;
h = stage.stageHeight;
align = stage.align;
};
//unresolved jump
var _slot1 = error;
sandboxScreen = getSandboxScreen();
w = sandboxScreen.width;
h = sandboxScreen.height;
var x:Number = ((m - w) / 2);
var y:Number = ((n - h) / 2);
if (align == StageAlign.TOP){
y = 0;
} else {
if (align == StageAlign.BOTTOM){
y = (n - h);
} else {
if (align == StageAlign.LEFT){
x = 0;
} else {
if (align == StageAlign.RIGHT){
x = (m - w);
} else {
if ((((align == StageAlign.TOP_LEFT)) || ((align == "LT")))){
y = 0;
x = 0;
} else {
if (align == StageAlign.TOP_RIGHT){
y = 0;
x = (m - w);
} else {
if (align == StageAlign.BOTTOM_LEFT){
y = (n - h);
x = 0;
} else {
if (align == StageAlign.BOTTOM_RIGHT){
y = (n - h);
x = (m - w);
};
};
};
};
};
};
};
};
if (!_screen){
_screen = new Rectangle();
};
_screen.x = x;
_screen.y = y;
_screen.width = w;
_screen.height = h;
if (isStageRoot){
_width = stage.stageWidth;
_height = stage.stageHeight;
};
if (event){
resizeMouseCatcher();
isDispatchingResizeEvent = true;
dispatchEvent(event);
isDispatchingResizeEvent = false;
};
}
public function get swfBridge():IEventDispatcher{
if (swfBridgeGroup){
return (swfBridgeGroup.parentBridge);
};
return (null);
}
private function findRemotePopUp(window:Object, bridge:IEventDispatcher):RemotePopUp{
var popUp:RemotePopUp;
var n:int = forms.length;
var i:int;
while (i < n) {
if (isRemotePopUp(forms[i])){
popUp = RemotePopUp(forms[i]);
if ((((popUp.window == window)) && ((popUp.bridge == bridge)))){
return (popUp);
};
};
i++;
};
return (null);
}
public function info():Object{
return ({});
}
mx_internal function get toolTipIndex():int{
return (_toolTipIndex);
}
public function setActualSize(newWidth:Number, newHeight:Number):void{
if (isStageRoot){
return;
};
_width = newWidth;
_height = newHeight;
if (mouseCatcher){
mouseCatcher.width = newWidth;
mouseCatcher.height = newHeight;
};
dispatchEvent(new Event(Event.RESIZE));
}
private function removePlaceholderPopupRequestHandler(event:Event):void{
var n:int;
var i:int;
var popUpRequest:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (!forwardPlaceholderRequest(popUpRequest, false)){
n = forms.length;
i = 0;
while (i < n) {
if (isRemotePopUp(forms[i])){
if ((((forms[i].window == popUpRequest.data.placeHolderId)) && ((forms[i].bridge == popUpRequest.requestor)))){
forms.splice(i, 1);
break;
};
};
i++;
};
};
}
public function set focusPane(value:Sprite):void{
if (value){
addChild(value);
value.x = 0;
value.y = 0;
value.scrollRect = null;
_focusPane = value;
} else {
removeChild(_focusPane);
_focusPane = null;
};
}
mx_internal function removeParentBridgeListeners():void{
if (((!(topLevel)) && (topLevelSystemManager))){
SystemManager(topLevelSystemManager).removeParentBridgeListeners();
return;
};
var bridge:IEventDispatcher = swfBridgeGroup.parentBridge;
bridge.removeEventListener(SWFBridgeRequest.SET_ACTUAL_SIZE_REQUEST, setActualSizeRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.GET_SIZE_REQUEST, getSizeRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.ACTIVATE_POP_UP_REQUEST, activateRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.DEACTIVATE_POP_UP_REQUEST, deactivateRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.IS_BRIDGE_CHILD_REQUEST, isBridgeChildHandler);
bridge.removeEventListener(EventListenerRequest.ADD_EVENT_LISTENER_REQUEST, eventListenerRequestHandler);
bridge.removeEventListener(EventListenerRequest.REMOVE_EVENT_LISTENER_REQUEST, eventListenerRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.CAN_ACTIVATE_POP_UP_REQUEST, canActivateHandler);
bridge.removeEventListener(SWFBridgeEvent.BRIDGE_APPLICATION_UNLOADING, beforeUnloadHandler);
}
override public function get parent():DisplayObjectContainer{
return (super.parent);
//unresolved jump
var _slot1 = e;
return (null);
}
private function eventListenerRequestHandler(event:Event):void{
var actualType:String;
if ((event is EventListenerRequest)){
return;
};
var request:EventListenerRequest = EventListenerRequest.marshal(event);
if (event.type == EventListenerRequest.ADD_EVENT_LISTENER_REQUEST){
if (!eventProxy){
eventProxy = new EventProxy(this);
};
actualType = EventUtil.sandboxMouseEventMap[request.eventType];
if (actualType){
if (isTopLevelRoot()){
stage.addEventListener(MouseEvent.MOUSE_MOVE, resetMouseCursorTracking, true, (EventPriority.CURSOR_MANAGEMENT + 1), true);
} else {
super.addEventListener(MouseEvent.MOUSE_MOVE, resetMouseCursorTracking, true, (EventPriority.CURSOR_MANAGEMENT + 1), true);
};
addEventListenerToSandboxes(request.eventType, sandboxMouseListener, true, request.priority, request.useWeakReference, (event.target as IEventDispatcher));
addEventListenerToOtherSystemManagers(request.eventType, otherSystemManagerMouseListener, true, request.priority, request.useWeakReference);
if (getSandboxRoot() == this){
if (((isTopLevelRoot()) && ((((actualType == MouseEvent.MOUSE_UP)) || ((actualType == MouseEvent.MOUSE_MOVE)))))){
stage.addEventListener(actualType, eventProxy.marshalListener, false, request.priority, request.useWeakReference);
};
super.addEventListener(actualType, eventProxy.marshalListener, true, request.priority, request.useWeakReference);
};
};
} else {
if (event.type == EventListenerRequest.REMOVE_EVENT_LISTENER_REQUEST){
actualType = EventUtil.sandboxMouseEventMap[request.eventType];
if (actualType){
removeEventListenerFromOtherSystemManagers(request.eventType, otherSystemManagerMouseListener, true);
removeEventListenerFromSandboxes(request.eventType, sandboxMouseListener, true, (event.target as IEventDispatcher));
if (getSandboxRoot() == this){
if (((isTopLevelRoot()) && ((((actualType == MouseEvent.MOUSE_UP)) || ((actualType == MouseEvent.MOUSE_MOVE)))))){
stage.removeEventListener(actualType, eventProxy.marshalListener);
};
super.removeEventListener(actualType, eventProxy.marshalListener, true);
};
};
};
};
}
mx_internal function set applicationIndex(value:int):void{
_applicationIndex = value;
}
private function showMouseCursorRequestHandler(event:Event):void{
var bridge:IEventDispatcher;
if (((!(isTopLevelRoot())) && ((event is SWFBridgeRequest)))){
return;
};
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (!isTopLevelRoot()){
bridge = swfBridgeGroup.parentBridge;
request.requestor = bridge;
bridge.dispatchEvent(request);
Object(event).data = request.data;
} else {
if (eventProxy){
Object(event).data = SystemManagerGlobals.showMouseCursor;
};
};
}
public function get childAllowsParent():Boolean{
return (loaderInfo.childAllowsParent);
//unresolved jump
var _slot1 = error;
return (false);
}
public function dispatchEventFromSWFBridges(event:Event, skip:IEventDispatcher=null, trackClones:Boolean=false, toOtherSystemManagers:Boolean=false):void{
var clone:Event;
if (toOtherSystemManagers){
dispatchEventToOtherSystemManagers(event);
};
if (!swfBridgeGroup){
return;
};
clone = event.clone();
if (trackClones){
currentSandboxEvent = clone;
};
var parentBridge:IEventDispatcher = swfBridgeGroup.parentBridge;
if (((parentBridge) && (!((parentBridge == skip))))){
if ((clone is SWFBridgeRequest)){
SWFBridgeRequest(clone).requestor = parentBridge;
};
parentBridge.dispatchEvent(clone);
};
var children:Array = swfBridgeGroup.getChildBridges();
var i:int;
while (i < children.length) {
if (children[i] != skip){
clone = event.clone();
if (trackClones){
currentSandboxEvent = clone;
};
if ((clone is SWFBridgeRequest)){
SWFBridgeRequest(clone).requestor = IEventDispatcher(children[i]);
};
IEventDispatcher(children[i]).dispatchEvent(clone);
};
i++;
};
currentSandboxEvent = null;
}
private function setActualSizeRequestHandler(event:Event):void{
var eObj:Object = Object(event);
setActualSize(eObj.data.width, eObj.data.height);
}
private function executeCallbacks():void{
var initFunction:Function;
if (((!(parent)) && (parentAllowsChild))){
return;
};
while (initCallbackFunctions.length > 0) {
initFunction = initCallbackFunctions.shift();
initFunction(this);
};
}
private function addPlaceholderId(id:String, previousId:String, bridge:IEventDispatcher, placeholder:Object):void{
if (!bridge){
throw (new Error());
};
if (!idToPlaceholder){
idToPlaceholder = [];
};
idToPlaceholder[id] = new PlaceholderData(previousId, bridge, placeholder);
}
private function canActivateHandler(event:Event):void{
var request:SWFBridgeRequest;
var placeholder:PlaceholderData;
var popUp:RemotePopUp;
var smp:SystemManagerProxy;
var f:IFocusManagerContainer;
var bridge:IEventDispatcher;
var eObj:Object = Object(event);
var child:Object = eObj.data;
var nextId:String;
if ((eObj.data is String)){
placeholder = idToPlaceholder[eObj.data];
child = placeholder.data;
nextId = placeholder.id;
if (nextId == null){
popUp = findRemotePopUp(child, placeholder.bridge);
if (popUp){
request = new SWFBridgeRequest(SWFBridgeRequest.CAN_ACTIVATE_POP_UP_REQUEST, false, false, IEventDispatcher(popUp.bridge), popUp.window);
if (popUp.bridge){
popUp.bridge.dispatchEvent(request);
eObj.data = request.data;
};
return;
};
};
};
if ((child is SystemManagerProxy)){
smp = SystemManagerProxy(child);
f = findFocusManagerContainer(smp);
eObj.data = ((((smp) && (f))) && (canActivateLocalComponent(f)));
} else {
if ((child is IFocusManagerContainer)){
eObj.data = canActivateLocalComponent(child);
} else {
if ((child is IEventDispatcher)){
bridge = IEventDispatcher(child);
request = new SWFBridgeRequest(SWFBridgeRequest.CAN_ACTIVATE_POP_UP_REQUEST, false, false, bridge, nextId);
if (bridge){
bridge.dispatchEvent(request);
eObj.data = request.data;
};
} else {
throw (new Error());
};
};
};
}
private function docFrameListener(event:Event):void{
if (currentFrame == 2){
removeEventListener(Event.ENTER_FRAME, docFrameListener);
if (totalFrames > 2){
addEventListener(Event.ENTER_FRAME, extraFrameListener);
};
docFrameHandler();
};
}
public function get popUpChildren():IChildList{
if (!topLevel){
return (_topLevelSystemManager.popUpChildren);
};
if (!_popUpChildren){
_popUpChildren = new SystemChildrenList(this, new QName(mx_internal, "noTopMostIndex"), new QName(mx_internal, "topMostIndex"));
};
return (_popUpChildren);
}
private function addEventListenerToSandboxes(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false, skip:IEventDispatcher=null):void{
var i:int;
var childBridge:IEventDispatcher;
if (!swfBridgeGroup){
return;
};
var request:EventListenerRequest = new EventListenerRequest(EventListenerRequest.ADD_EVENT_LISTENER_REQUEST, false, false, type, useCapture, priority, useWeakReference);
var parentBridge:IEventDispatcher = swfBridgeGroup.parentBridge;
if (((parentBridge) && (!((parentBridge == skip))))){
parentBridge.addEventListener(type, listener, false, priority, useWeakReference);
};
var children:Array = swfBridgeGroup.getChildBridges();
while (i < children.length) {
childBridge = IEventDispatcher(children[i]);
if (childBridge != skip){
childBridge.addEventListener(type, listener, false, priority, useWeakReference);
};
i++;
};
dispatchEventFromSWFBridges(request, skip);
}
private function forwardFormEvent(event:SWFBridgeEvent):Boolean{
var sbRoot:DisplayObject;
if (isTopLevelRoot()){
return (false);
};
var bridge:IEventDispatcher = swfBridgeGroup.parentBridge;
if (bridge){
sbRoot = getSandboxRoot();
event.data.notifier = bridge;
if (sbRoot == this){
if (!(event.data.window is String)){
event.data.window = NameUtil.displayObjectToString(DisplayObject(event.data.window));
} else {
event.data.window = ((NameUtil.displayObjectToString(DisplayObject(this)) + ".") + event.data.window);
};
bridge.dispatchEvent(event);
} else {
if ((event.data.window is String)){
event.data.window = ((NameUtil.displayObjectToString(DisplayObject(this)) + ".") + event.data.window);
};
sbRoot.dispatchEvent(event);
};
};
return (true);
}
public function set explicitHeight(value:Number):void{
_explicitHeight = value;
}
override public function removeChild(child:DisplayObject):DisplayObject{
noTopMostIndex--;
return (rawChildren_removeChild(child));
}
mx_internal function rawChildren_removeChild(child:DisplayObject):DisplayObject{
removingChild(child);
super.removeChild(child);
childRemoved(child);
return (child);
}
final mx_internal function get $numChildren():int{
return (super.numChildren);
}
public function get toolTipChildren():IChildList{
if (!topLevel){
return (_topLevelSystemManager.toolTipChildren);
};
if (!_toolTipChildren){
_toolTipChildren = new SystemChildrenList(this, new QName(mx_internal, "topMostIndex"), new QName(mx_internal, "toolTipIndex"));
};
return (_toolTipChildren);
}
public function create(... _args):Object{
var url:String;
var dot:int;
var slash:int;
var mainClassName:String = info()["mainClassName"];
if (mainClassName == null){
url = loaderInfo.loaderURL;
dot = url.lastIndexOf(".");
slash = url.lastIndexOf("/");
mainClassName = url.substring((slash + 1), dot);
};
var mainClass:Class = Class(getDefinitionByName(mainClassName));
return ((mainClass) ? new (mainClass) : null);
}
override public function get stage():Stage{
var root:DisplayObject;
if (_stage){
return (_stage);
};
var s:Stage = super.stage;
if (s){
_stage = s;
return (s);
};
if (((!(topLevel)) && (_topLevelSystemManager))){
_stage = _topLevelSystemManager.stage;
return (_stage);
};
if (((!(isStageRoot)) && (topLevel))){
root = getTopLevelRoot();
if (root){
_stage = root.stage;
return (_stage);
};
};
return (null);
}
override public function addChild(child:DisplayObject):DisplayObject{
noTopMostIndex++;
return (rawChildren_addChildAt(child, (noTopMostIndex - 1)));
}
private function removeRemotePopUp(form:RemotePopUp):void{
var n:int = forms.length;
var i:int;
while (i < n) {
if (isRemotePopUp(forms[i])){
if ((((forms[i].window == form.window)) && ((forms[i].bridge == form.bridge)))){
if (forms[i] == form){
deactivateForm(form);
};
forms.splice(i, 1);
break;
};
};
i++;
};
}
private function deactivateRemotePopUp(form:Object):void{
var request:SWFBridgeRequest = new SWFBridgeRequest(SWFBridgeRequest.DEACTIVATE_POP_UP_REQUEST, false, false, form.bridge, form.window);
var bridge:Object = form.bridge;
if (bridge){
bridge.dispatchEvent(request);
};
}
override public function getChildIndex(child:DisplayObject):int{
return ((super.getChildIndex(child) - applicationIndex));
}
mx_internal function rawChildren_getChildIndex(child:DisplayObject):int{
return (super.getChildIndex(child));
}
public function activate(f:IFocusManagerContainer):void{
activateForm(f);
}
public function getSandboxRoot():DisplayObject{
var parent:DisplayObject;
var lastParent:DisplayObject;
var loader:Loader;
var loaderInfo:LoaderInfo;
var sm:ISystemManager = this;
if (sm.topLevelSystemManager){
sm = sm.topLevelSystemManager;
};
parent = DisplayObject(sm).parent;
if ((parent is Stage)){
return (DisplayObject(sm));
};
if (((parent) && (!(parent.dispatchEvent(new Event("mx.managers.SystemManager.isBootstrapRoot", false, true)))))){
return (this);
};
lastParent = parent;
while (parent) {
if ((parent is Stage)){
return (lastParent);
};
if (!parent.dispatchEvent(new Event("mx.managers.SystemManager.isBootstrapRoot", false, true))){
return (lastParent);
};
if ((parent is Loader)){
loader = Loader(parent);
loaderInfo = loader.contentLoaderInfo;
if (!loaderInfo.childAllowsParent){
return (loaderInfo.content);
};
};
lastParent = parent;
parent = parent.parent;
};
//unresolved jump
var _slot1 = error;
return (((lastParent)!=null) ? lastParent : DisplayObject(sm));
}
private function deferredNextFrame():void{
if ((currentFrame + 1) > totalFrames){
return;
};
if ((currentFrame + 1) <= framesLoaded){
nextFrame();
} else {
nextFrameTimer = new Timer(100);
nextFrameTimer.addEventListener(TimerEvent.TIMER, nextFrameTimerHandler);
nextFrameTimer.start();
};
}
mx_internal function get cursorIndex():int{
return (_cursorIndex);
}
mx_internal function rawChildren_contains(child:DisplayObject):Boolean{
return (super.contains(child));
}
override public function setChildIndex(child:DisplayObject, newIndex:int):void{
super.setChildIndex(child, (applicationIndex + newIndex));
}
public function get document():Object{
return (_document);
}
private function resizeMouseCatcher():void{
var g:Graphics;
var s:Rectangle;
if (mouseCatcher){
g = mouseCatcher.graphics;
s = screen;
g.clear();
g.beginFill(0, 0);
g.drawRect(0, 0, s.width, s.height);
g.endFill();
//unresolved jump
var _slot1 = e;
};
}
private function extraFrameListener(event:Event):void{
if (lastFrame == currentFrame){
return;
};
lastFrame = currentFrame;
if ((currentFrame + 1) > totalFrames){
removeEventListener(Event.ENTER_FRAME, extraFrameListener);
};
extraFrameHandler();
}
private function addPopupRequestHandler(event:Event):void{
var topMost:Boolean;
var children:IChildList;
var bridgeProvider:ISWFBridgeProvider;
var request:SWFBridgeRequest;
if (((!((event.target == this))) && ((event is SWFBridgeRequest)))){
return;
};
var popUpRequest:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (event.target != this){
bridgeProvider = swfBridgeGroup.getChildBridgeProvider(IEventDispatcher(event.target));
if (!SecurityUtil.hasMutualTrustBetweenParentAndChild(bridgeProvider)){
return;
};
};
if (((swfBridgeGroup.parentBridge) && (SecurityUtil.hasMutualTrustBetweenParentAndChild(this)))){
popUpRequest.requestor = swfBridgeGroup.parentBridge;
getSandboxRoot().dispatchEvent(popUpRequest);
return;
};
if (((!(popUpRequest.data.childList)) || ((popUpRequest.data.childList == PopUpManagerChildList.PARENT)))){
topMost = ((popUpRequest.data.parent) && (popUpChildren.contains(popUpRequest.data.parent)));
} else {
topMost = (popUpRequest.data.childList == PopUpManagerChildList.POPUP);
};
children = (topMost) ? popUpChildren : this;
children.addChild(DisplayObject(popUpRequest.data.window));
if (popUpRequest.data.modal){
numModalWindows++;
};
var remoteForm:RemotePopUp = new RemotePopUp(popUpRequest.data.window, popUpRequest.requestor);
forms.push(remoteForm);
if (((!(isTopLevelRoot())) && (swfBridgeGroup))){
request = new SWFBridgeRequest(SWFBridgeRequest.ADD_POP_UP_PLACE_HOLDER_REQUEST, false, false, popUpRequest.requestor, {window:popUpRequest.data.window});
request.data.placeHolderId = NameUtil.displayObjectToString(DisplayObject(popUpRequest.data.window));
dispatchEvent(request);
};
}
override public function get height():Number{
return (_height);
}
mx_internal function rawChildren_getChildAt(index:int):DisplayObject{
return (super.getChildAt(index));
}
private function systemManagerHandler(event:Event):void{
if (event["name"] == "sameSandbox"){
event["value"] = (currentSandboxEvent == event["value"]);
return;
};
if (event["name"] == "hasSWFBridges"){
event["value"] = hasSWFBridges();
return;
};
if ((event is InterManagerRequest)){
return;
};
var name:String = event["name"];
switch (name){
case "popUpChildren.addChild":
popUpChildren.addChild(event["value"]);
break;
case "popUpChildren.removeChild":
popUpChildren.removeChild(event["value"]);
break;
case "cursorChildren.addChild":
cursorChildren.addChild(event["value"]);
break;
case "cursorChildren.removeChild":
cursorChildren.removeChild(event["value"]);
break;
case "toolTipChildren.addChild":
toolTipChildren.addChild(event["value"]);
break;
case "toolTipChildren.removeChild":
toolTipChildren.removeChild(event["value"]);
break;
case "screen":
event["value"] = screen;
break;
case "application":
event["value"] = application;
break;
case "isTopLevelRoot":
event["value"] = isTopLevelRoot();
break;
case "getVisibleApplicationRect":
event["value"] = getVisibleApplicationRect();
break;
case "bringToFront":
if (event["value"].topMost){
popUpChildren.setChildIndex(DisplayObject(event["value"].popUp), (popUpChildren.numChildren - 1));
} else {
setChildIndex(DisplayObject(event["value"].popUp), (numChildren - 1));
};
break;
};
}
private function activateRemotePopUp(form:Object):void{
var request:SWFBridgeRequest = new SWFBridgeRequest(SWFBridgeRequest.ACTIVATE_POP_UP_REQUEST, false, false, form.bridge, form.window);
var bridge:Object = form.bridge;
if (bridge){
bridge.dispatchEvent(request);
};
}
mx_internal function set noTopMostIndex(value:int):void{
var delta:int = (value - _noTopMostIndex);
_noTopMostIndex = value;
topMostIndex = (topMostIndex + delta);
}
override public function getObjectsUnderPoint(point:Point):Array{
var child:DisplayObject;
var temp:Array;
var children:Array = [];
var n:int = topMostIndex;
var i:int;
while (i < n) {
child = super.getChildAt(i);
if ((child is DisplayObjectContainer)){
temp = DisplayObjectContainer(child).getObjectsUnderPoint(point);
if (temp){
children = children.concat(temp);
};
};
i++;
};
return (children);
}
mx_internal function get topMostIndex():int{
return (_topMostIndex);
}
mx_internal function regenerateStyleCache(recursive:Boolean):void{
var child:IStyleClient;
var foundTopLevelWindow:Boolean;
var n:int = rawChildren.numChildren;
var i:int;
while (i < n) {
child = (rawChildren.getChildAt(i) as IStyleClient);
if (child){
child.regenerateStyleCache(recursive);
};
if (isTopLevelWindow(DisplayObject(child))){
foundTopLevelWindow = true;
};
n = rawChildren.numChildren;
i++;
};
if (((!(foundTopLevelWindow)) && ((topLevelWindow is IStyleClient)))){
IStyleClient(topLevelWindow).regenerateStyleCache(recursive);
};
}
public function addFocusManager(f:IFocusManagerContainer):void{
forms.push(f);
}
private function deactivateFormSandboxEventHandler(event:Event):void{
if ((event is SWFBridgeRequest)){
return;
};
var bridgeEvent:SWFBridgeEvent = SWFBridgeEvent.marshal(event);
if (!forwardFormEvent(bridgeEvent)){
if (((((isRemotePopUp(form)) && ((RemotePopUp(form).window == bridgeEvent.data.window)))) && ((RemotePopUp(form).bridge == bridgeEvent.data.notifier)))){
deactivateForm(form);
};
};
}
public function set swfBridgeGroup(bridgeGroup:ISWFBridgeGroup):void{
if (topLevel){
_swfBridgeGroup = bridgeGroup;
} else {
if (topLevelSystemManager){
SystemManager(topLevelSystemManager).swfBridgeGroup = bridgeGroup;
};
};
}
mx_internal function rawChildren_setChildIndex(child:DisplayObject, newIndex:int):void{
super.setChildIndex(child, newIndex);
}
private function mouseUpHandler(event:MouseEvent):void{
idleCounter = 0;
}
mx_internal function childAdded(child:DisplayObject):void{
child.dispatchEvent(new FlexEvent(FlexEvent.ADD));
if ((child is IUIComponent)){
IUIComponent(child).initialize();
};
}
public function isFontFaceEmbedded(textFormat:TextFormat):Boolean{
var font:Font;
var style:String;
var fontName:String = textFormat.font;
var fl:Array = Font.enumerateFonts();
var f:int;
while (f < fl.length) {
font = Font(fl[f]);
if (font.fontName == fontName){
style = "regular";
if (((textFormat.bold) && (textFormat.italic))){
style = "boldItalic";
} else {
if (textFormat.bold){
style = "bold";
} else {
if (textFormat.italic){
style = "italic";
};
};
};
if (font.fontStyle == style){
return (true);
};
};
f++;
};
if (((((!(fontName)) || (!(embeddedFontList)))) || (!(embeddedFontList[fontName])))){
return (false);
};
var info:Object = embeddedFontList[fontName];
return (!(((((((textFormat.bold) && (!(info.bold)))) || (((textFormat.italic) && (!(info.italic)))))) || (((((!(textFormat.bold)) && (!(textFormat.italic)))) && (!(info.regular)))))));
}
private function forwardPlaceholderRequest(request:SWFBridgeRequest, addPlaceholder:Boolean):Boolean{
if (isTopLevelRoot()){
return (false);
};
var refObj:Object;
var oldId:String;
if (request.data.window){
refObj = request.data.window;
request.data.window = null;
} else {
refObj = request.requestor;
oldId = request.data.placeHolderId;
request.data.placeHolderId = ((NameUtil.displayObjectToString(this) + ".") + request.data.placeHolderId);
};
if (addPlaceholder){
addPlaceholderId(request.data.placeHolderId, oldId, request.requestor, refObj);
} else {
removePlaceholderId(request.data.placeHolderId);
};
var sbRoot:DisplayObject = getSandboxRoot();
var bridge:IEventDispatcher = swfBridgeGroup.parentBridge;
request.requestor = bridge;
if (sbRoot == this){
bridge.dispatchEvent(request);
} else {
sbRoot.dispatchEvent(request);
};
return (true);
}
public function getTopLevelRoot():DisplayObject{
var sm:ISystemManager;
var parent:DisplayObject;
var lastParent:DisplayObject;
sm = this;
if (sm.topLevelSystemManager){
sm = sm.topLevelSystemManager;
};
parent = DisplayObject(sm).parent;
lastParent = parent;
while (parent) {
if ((parent is Stage)){
return (lastParent);
};
lastParent = parent;
parent = parent.parent;
};
//unresolved jump
var _slot1 = error;
return (null);
}
override public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{
var newListener:StageEventProxy;
var actualType:String;
var type = type;
var listener = listener;
var useCapture = useCapture;
if ((((type == FlexEvent.RENDER)) || ((type == FlexEvent.ENTER_FRAME)))){
if (type == FlexEvent.RENDER){
type = Event.RENDER;
} else {
type = Event.ENTER_FRAME;
};
if (stage){
stage.removeEventListener(type, listener, useCapture);
};
super.removeEventListener(type, listener, useCapture);
//unresolved jump
var _slot1 = error;
super.removeEventListener(type, listener, useCapture);
return;
};
if ((((((((((type == MouseEvent.MOUSE_MOVE)) || ((type == MouseEvent.MOUSE_UP)))) || ((type == MouseEvent.MOUSE_DOWN)))) || ((type == Event.ACTIVATE)))) || ((type == Event.DEACTIVATE)))){
if (stage){
newListener = weakReferenceProxies[listener];
if (!newListener){
newListener = strongReferenceProxies[listener];
if (newListener){
delete strongReferenceProxies[listener];
};
};
if (newListener){
stage.removeEventListener(type, newListener.stageListener, false);
};
};
//unresolved jump
var _slot1 = error;
};
if (((hasSWFBridges()) || ((SystemManagerGlobals.topLevelSystemManagers.length > 1)))){
actualType = EventUtil.sandboxMouseEventMap[type];
if (actualType){
if ((((getSandboxRoot() == this)) && (eventProxy))){
super.removeEventListener(actualType, eventProxy.marshalListener, useCapture);
};
if (!SystemManagerGlobals.changingListenersInOtherSystemManagers){
removeEventListenerFromOtherSystemManagers(type, otherSystemManagerMouseListener, useCapture);
};
removeEventListenerFromSandboxes(type, sandboxMouseListener, useCapture);
super.removeEventListener(type, listener, false);
return;
};
};
if (type == FlexEvent.IDLE){
super.removeEventListener(type, listener, useCapture);
if (((!(hasEventListener(FlexEvent.IDLE))) && (idleTimer))){
idleTimer.stop();
idleTimer = null;
removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
};
} else {
super.removeEventListener(type, listener, useCapture);
};
}
private function extraFrameHandler(event:Event=null):void{
var c:Class;
var frameList:Object = info()["frames"];
if (((frameList) && (frameList[currentLabel]))){
c = Class(getDefinitionByName(frameList[currentLabel]));
var _local4 = c;
_local4["frame"](this);
};
deferredNextFrame();
}
public function isTopLevelRoot():Boolean{
return (((isStageRoot) || (isBootstrapRoot)));
}
public function get application():IUIComponent{
return (IUIComponent(_document));
}
override public function removeChildAt(index:int):DisplayObject{
noTopMostIndex--;
return (rawChildren_removeChildAt((applicationIndex + index)));
}
mx_internal function rawChildren_removeChildAt(index:int):DisplayObject{
var child:DisplayObject = super.getChildAt(index);
removingChild(child);
super.removeChildAt(index);
childRemoved(child);
return (child);
}
private function getSWFBridgeOfDisplayObject(displayObject:DisplayObject):IEventDispatcher{
var request:SWFBridgeRequest;
var children:Array;
var n:int;
var i:int;
var childBridge:IEventDispatcher;
var bp:ISWFBridgeProvider;
if (swfBridgeGroup){
request = new SWFBridgeRequest(SWFBridgeRequest.IS_BRIDGE_CHILD_REQUEST, false, false, null, displayObject);
children = swfBridgeGroup.getChildBridges();
n = children.length;
i = 0;
while (i < n) {
childBridge = IEventDispatcher(children[i]);
bp = swfBridgeGroup.getChildBridgeProvider(childBridge);
if (SecurityUtil.hasMutualTrustBetweenParentAndChild(bp)){
childBridge.dispatchEvent(request);
if (request.data == true){
return (childBridge);
};
request.data = displayObject;
};
i++;
};
};
return (null);
}
private function deactivateRequestHandler(event:Event):void{
var placeholder:PlaceholderData;
var popUp:RemotePopUp;
var smp:SystemManagerProxy;
var f:IFocusManagerContainer;
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
var child:Object = request.data;
var nextId:String;
if ((request.data is String)){
placeholder = idToPlaceholder[request.data];
child = placeholder.data;
nextId = placeholder.id;
if (nextId == null){
popUp = findRemotePopUp(child, placeholder.bridge);
if (popUp){
deactivateRemotePopUp(popUp);
return;
};
};
};
if ((child is SystemManagerProxy)){
smp = SystemManagerProxy(child);
f = findFocusManagerContainer(smp);
if (((smp) && (f))){
smp.deactivateByProxy(f);
};
} else {
if ((child is IFocusManagerContainer)){
IFocusManagerContainer(child).focusManager.deactivate();
} else {
if ((child is IEventDispatcher)){
request.data = nextId;
request.requestor = IEventDispatcher(child);
IEventDispatcher(child).dispatchEvent(request);
return;
};
throw (new Error());
};
};
}
private function installCompiledResourceBundles():void{
var info:Object = this.info();
var applicationDomain:ApplicationDomain = (((!(topLevel)) && ((parent is Loader)))) ? Loader(parent).contentLoaderInfo.applicationDomain : info["currentDomain"];
var compiledLocales:Array = info["compiledLocales"];
var compiledResourceBundleNames:Array = info["compiledResourceBundleNames"];
var resourceManager:IResourceManager = ResourceManager.getInstance();
resourceManager.installCompiledResourceBundles(applicationDomain, compiledLocales, compiledResourceBundleNames);
if (!resourceManager.localeChain){
resourceManager.initializeLocaleChain(compiledLocales);
};
}
private function deactivateForm(f:Object):void{
if (form){
if ((((form == f)) && ((forms.length > 1)))){
if (isRemotePopUp(form)){
deactivateRemotePopUp(form);
} else {
form.focusManager.deactivate();
};
form = findLastActiveForm(f);
if (form){
if (isRemotePopUp(form)){
activateRemotePopUp(form);
} else {
form.focusManager.activate();
};
};
};
};
}
private function unloadHandler(event:Event):void{
dispatchEvent(event);
}
mx_internal function removingChild(child:DisplayObject):void{
child.dispatchEvent(new FlexEvent(FlexEvent.REMOVE));
}
mx_internal function get applicationIndex():int{
return (_applicationIndex);
}
mx_internal function set toolTipIndex(value:int):void{
var delta:int = (value - _toolTipIndex);
_toolTipIndex = value;
cursorIndex = (cursorIndex + delta);
}
private function hasSWFBridges():Boolean{
if (swfBridgeGroup){
return (true);
};
return (false);
}
private function updateLastActiveForm():void{
var n:int = forms.length;
if (n < 2){
return;
};
var index = -1;
var i:int;
while (i < n) {
if (areFormsEqual(form, forms[i])){
index = i;
break;
};
i++;
};
if (index >= 0){
forms.splice(index, 1);
forms.push(form);
} else {
throw (new Error());
};
}
public function get cursorChildren():IChildList{
if (!topLevel){
return (_topLevelSystemManager.cursorChildren);
};
if (!_cursorChildren){
_cursorChildren = new SystemChildrenList(this, new QName(mx_internal, "toolTipIndex"), new QName(mx_internal, "cursorIndex"));
};
return (_cursorChildren);
}
private function sandboxMouseListener(event:Event):void{
if ((event is SandboxMouseEvent)){
return;
};
var marshaledEvent:Event = SandboxMouseEvent.marshal(event);
dispatchEventFromSWFBridges(marshaledEvent, (event.target as IEventDispatcher));
var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST);
me.name = "sameSandbox";
me.value = event;
getSandboxRoot().dispatchEvent(me);
if (!me.value){
dispatchEvent(marshaledEvent);
};
}
public function get preloaderBackgroundImage():Object{
return (info()["backgroundImage"]);
}
public function set numModalWindows(value:int):void{
_numModalWindows = value;
}
public function get preloaderBackgroundAlpha():Number{
return (info()["backgroundAlpha"]);
}
mx_internal function rawChildren_getChildByName(name:String):DisplayObject{
return (super.getChildByName(name));
}
private function dispatchInvalidateRequest():void{
var bridge:IEventDispatcher = swfBridgeGroup.parentBridge;
var request:SWFBridgeRequest = new SWFBridgeRequest(SWFBridgeRequest.INVALIDATE_REQUEST, false, false, bridge, (InvalidateRequestData.SIZE | InvalidateRequestData.DISPLAY_LIST));
bridge.dispatchEvent(request);
}
public function get preloaderBackgroundColor():uint{
var value:* = info()["backgroundColor"];
if (value == undefined){
return (StyleManager.NOT_A_COLOR);
};
return (StyleManager.getColorName(value));
}
public function getVisibleApplicationRect(bounds:Rectangle=null):Rectangle{
var s:Rectangle;
var pt:Point;
var bridge:IEventDispatcher;
var request:SWFBridgeRequest;
if (!bounds){
bounds = getBounds(DisplayObject(this));
s = screen;
pt = new Point(Math.max(0, bounds.x), Math.max(0, bounds.y));
pt = localToGlobal(pt);
bounds.x = pt.x;
bounds.y = pt.y;
bounds.width = s.width;
bounds.height = s.height;
};
if (useSWFBridge()){
bridge = swfBridgeGroup.parentBridge;
request = new SWFBridgeRequest(SWFBridgeRequest.GET_VISIBLE_RECT_REQUEST, false, false, bridge, bounds);
bridge.dispatchEvent(request);
bounds = Rectangle(request.data);
};
return (bounds);
}
public function get topLevelSystemManager():ISystemManager{
if (topLevel){
return (this);
};
return (_topLevelSystemManager);
}
private function appCreationCompleteHandler(event:FlexEvent):void{
var obj:DisplayObjectContainer;
if (((!(topLevel)) && (parent))){
obj = parent.parent;
while (obj) {
if ((obj is IInvalidating)){
IInvalidating(obj).invalidateSize();
IInvalidating(obj).invalidateDisplayList();
return;
};
obj = obj.parent;
};
};
if (((topLevel) && (useSWFBridge()))){
dispatchInvalidateRequest();
};
}
public function addChildToSandboxRoot(layer:String, child:DisplayObject):void{
var me:InterManagerRequest;
if (getSandboxRoot() == this){
this[layer].addChild(child);
} else {
addingChild(child);
me = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST);
me.name = (layer + ".addChild");
me.value = child;
getSandboxRoot().dispatchEvent(me);
childAdded(child);
};
}
private function dispatchDeactivatedWindowEvent(window:DisplayObject):void{
var sbRoot:DisplayObject;
var sendToSbRoot:Boolean;
var bridgeEvent:SWFBridgeEvent;
var bridge:IEventDispatcher = (swfBridgeGroup) ? swfBridgeGroup.parentBridge : null;
if (bridge){
sbRoot = getSandboxRoot();
sendToSbRoot = !((sbRoot == this));
bridgeEvent = new SWFBridgeEvent(SWFBridgeEvent.BRIDGE_WINDOW_DEACTIVATE, false, false, {notifier:bridge, window:(sendToSbRoot) ? window : NameUtil.displayObjectToString(window)});
if (sendToSbRoot){
sbRoot.dispatchEvent(bridgeEvent);
} else {
bridge.dispatchEvent(bridgeEvent);
};
};
}
private function isBridgeChildHandler(event:Event):void{
if ((event is SWFBridgeRequest)){
return;
};
var eObj:Object = Object(event);
eObj.data = ((eObj.data) && (rawChildren.contains((eObj.data as DisplayObject))));
}
public function get measuredHeight():Number{
return ((topLevelWindow) ? topLevelWindow.getExplicitOrMeasuredHeight() : loaderInfo.height);
}
private function activateRequestHandler(event:Event):void{
var placeholder:PlaceholderData;
var popUp:RemotePopUp;
var smp:SystemManagerProxy;
var f:IFocusManagerContainer;
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
var child:Object = request.data;
var nextId:String;
if ((request.data is String)){
placeholder = idToPlaceholder[request.data];
child = placeholder.data;
nextId = placeholder.id;
if (nextId == null){
popUp = findRemotePopUp(child, placeholder.bridge);
if (popUp){
activateRemotePopUp(popUp);
return;
};
};
};
if ((child is SystemManagerProxy)){
smp = SystemManagerProxy(child);
f = findFocusManagerContainer(smp);
if (((smp) && (f))){
smp.activateByProxy(f);
};
} else {
if ((child is IFocusManagerContainer)){
IFocusManagerContainer(child).focusManager.activate();
} else {
if ((child is IEventDispatcher)){
request.data = nextId;
request.requestor = IEventDispatcher(child);
IEventDispatcher(child).dispatchEvent(request);
} else {
throw (new Error());
};
};
};
}
mx_internal function rawChildren_addChildAt(child:DisplayObject, index:int):DisplayObject{
addingChild(child);
super.addChildAt(child, index);
childAdded(child);
return (child);
}
mx_internal function initialize():void{
var n:int;
var i:int;
var fontRegistry:EmbeddedFontRegistry;
var crossDomainRSLItem:Class;
var cdNode:Object;
var node:RSLItem;
if (isStageRoot){
_width = stage.stageWidth;
_height = stage.stageHeight;
} else {
_width = loaderInfo.width;
_height = loaderInfo.height;
};
preloader = new Preloader();
preloader.addEventListener(FlexEvent.INIT_PROGRESS, preloader_initProgressHandler);
preloader.addEventListener(FlexEvent.PRELOADER_DONE, preloader_preloaderDoneHandler);
if (!_popUpChildren){
_popUpChildren = new SystemChildrenList(this, new QName(mx_internal, "noTopMostIndex"), new QName(mx_internal, "topMostIndex"));
};
_popUpChildren.addChild(preloader);
var rsls:Array = info()["rsls"];
var cdRsls:Array = info()["cdRsls"];
var usePreloader:Boolean;
if (info()["usePreloader"] != undefined){
usePreloader = info()["usePreloader"];
};
var preloaderDisplayClass:Class = (info()["preloader"] as Class);
if (((usePreloader) && (!(preloaderDisplayClass)))){
preloaderDisplayClass = DownloadProgressBar;
};
var rslList:Array = [];
if (((cdRsls) && ((cdRsls.length > 0)))){
crossDomainRSLItem = Class(getDefinitionByName("mx.core::CrossDomainRSLItem"));
n = cdRsls.length;
i = 0;
while (i < n) {
cdNode = new crossDomainRSLItem(cdRsls[i]["rsls"], cdRsls[i]["policyFiles"], cdRsls[i]["digests"], cdRsls[i]["types"], cdRsls[i]["isSigned"], this.loaderInfo.url);
rslList.push(cdNode);
i++;
};
};
if (((!((rsls == null))) && ((rsls.length > 0)))){
n = rsls.length;
i = 0;
while (i < n) {
node = new RSLItem(rsls[i].url, this.loaderInfo.url);
rslList.push(node);
i++;
};
};
Singleton.registerClass("mx.resources::IResourceManager", Class(getDefinitionByName("mx.resources::ResourceManagerImpl")));
var resourceManager:IResourceManager = ResourceManager.getInstance();
Singleton.registerClass("mx.core::IEmbeddedFontRegistry", Class(getDefinitionByName("mx.core::EmbeddedFontRegistry")));
Singleton.registerClass("mx.styles::IStyleManager", Class(getDefinitionByName("mx.styles::StyleManagerImpl")));
Singleton.registerClass("mx.styles::IStyleManager2", Class(getDefinitionByName("mx.styles::StyleManagerImpl")));
var localeChainList:String = loaderInfo.parameters["localeChain"];
if (((!((localeChainList == null))) && (!((localeChainList == ""))))){
resourceManager.localeChain = localeChainList.split(",");
};
var resourceModuleURLList:String = loaderInfo.parameters["resourceModuleURLs"];
var resourceModuleURLs:Array = (resourceModuleURLList) ? resourceModuleURLList.split(",") : null;
preloader.initialize(usePreloader, preloaderDisplayClass, preloaderBackgroundColor, preloaderBackgroundAlpha, preloaderBackgroundImage, preloaderBackgroundSize, (isStageRoot) ? stage.stageWidth : loaderInfo.width, (isStageRoot) ? stage.stageHeight : loaderInfo.height, null, null, rslList, resourceModuleURLs);
}
public function useSWFBridge():Boolean{
if (isStageRoot){
return (false);
};
if (((!(topLevel)) && (topLevelSystemManager))){
return (topLevelSystemManager.useSWFBridge());
};
if (((topLevel) && (!((getSandboxRoot() == this))))){
return (true);
};
if (getSandboxRoot() == this){
root.loaderInfo.parentAllowsChild;
if (((parentAllowsChild) && (childAllowsParent))){
if (!parent.dispatchEvent(new Event("mx.managers.SystemManager.isStageRoot", false, true))){
return (true);
};
//unresolved jump
var _slot1 = e;
} else {
return (true);
};
//unresolved jump
var _slot1 = e1;
return (false);
};
return (false);
}
mx_internal function childRemoved(child:DisplayObject):void{
if ((child is IUIComponent)){
IUIComponent(child).parentChanged(null);
};
}
final mx_internal function $removeChildAt(index:int):DisplayObject{
return (super.removeChildAt(index));
}
private function canActivatePopUp(f:Object):Boolean{
var remotePopUp:RemotePopUp;
var event:SWFBridgeRequest;
if (isRemotePopUp(f)){
remotePopUp = RemotePopUp(f);
event = new SWFBridgeRequest(SWFBridgeRequest.CAN_ACTIVATE_POP_UP_REQUEST, false, false, null, remotePopUp.window);
IEventDispatcher(remotePopUp.bridge).dispatchEvent(event);
return (event.data);
};
if (canActivateLocalComponent(f)){
return (true);
};
return (false);
}
mx_internal function get noTopMostIndex():int{
return (_noTopMostIndex);
}
override public function get numChildren():int{
return ((noTopMostIndex - applicationIndex));
}
private function canActivateLocalComponent(o:Object):Boolean{
if ((((((((o is Sprite)) && ((o is IUIComponent)))) && (Sprite(o).visible))) && (IUIComponent(o).enabled))){
return (true);
};
return (false);
}
private function preloader_preloaderDoneHandler(event:Event):void{
var app:IUIComponent = topLevelWindow;
preloader.removeEventListener(FlexEvent.PRELOADER_DONE, preloader_preloaderDoneHandler);
_popUpChildren.removeChild(preloader);
preloader = null;
mouseCatcher = new FlexSprite();
mouseCatcher.name = "mouseCatcher";
noTopMostIndex++;
super.addChildAt(mouseCatcher, 0);
resizeMouseCatcher();
if (!topLevel){
mouseCatcher.visible = false;
mask = mouseCatcher;
};
noTopMostIndex++;
super.addChildAt(DisplayObject(app), 1);
app.dispatchEvent(new FlexEvent(FlexEvent.APPLICATION_COMPLETE));
dispatchEvent(new FlexEvent(FlexEvent.APPLICATION_COMPLETE));
}
private function initializeTopLevelWindow(event:Event):void{
var app:IUIComponent;
var obj:DisplayObjectContainer;
var sm:ISystemManager;
var sandboxRoot:DisplayObject;
initialized = true;
if (((!(parent)) && (parentAllowsChild))){
return;
};
if (!topLevel){
obj = parent.parent;
if (!obj){
return;
};
while (obj) {
if ((obj is IUIComponent)){
sm = IUIComponent(obj).systemManager;
if (((sm) && (!(sm.isTopLevel())))){
sm = sm.topLevelSystemManager;
};
_topLevelSystemManager = sm;
break;
};
obj = obj.parent;
};
};
if (((isTopLevelRoot()) || ((getSandboxRoot() == this)))){
addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler, true);
};
if (((isTopLevelRoot()) && (stage))){
stage.addEventListener(Event.RESIZE, Stage_resizeHandler, false, 0, true);
} else {
if (((topLevel) && (stage))){
sandboxRoot = getSandboxRoot();
if (sandboxRoot != this){
sandboxRoot.addEventListener(Event.RESIZE, Stage_resizeHandler, false, 0, true);
};
};
};
app = (topLevelWindow = IUIComponent(create()));
document = app;
if (document){
IEventDispatcher(app).addEventListener(FlexEvent.CREATION_COMPLETE, appCreationCompleteHandler);
if (!LoaderConfig._url){
LoaderConfig._url = loaderInfo.url;
LoaderConfig._parameters = loaderInfo.parameters;
};
if (((isStageRoot) && (stage))){
_width = stage.stageWidth;
_height = stage.stageHeight;
IFlexDisplayObject(app).setActualSize(_width, _height);
} else {
IFlexDisplayObject(app).setActualSize(loaderInfo.width, loaderInfo.height);
};
if (preloader){
preloader.registerApplication(app);
};
addingChild(DisplayObject(app));
childAdded(DisplayObject(app));
} else {
document = this;
};
}
final mx_internal function $addChildAt(child:DisplayObject, index:int):DisplayObject{
return (super.addChildAt(child, index));
}
mx_internal function dispatchActivatedWindowEvent(window:DisplayObject):void{
var sbRoot:DisplayObject;
var sendToSbRoot:Boolean;
var bridgeEvent:SWFBridgeEvent;
var bridge:IEventDispatcher = (swfBridgeGroup) ? swfBridgeGroup.parentBridge : null;
if (bridge){
sbRoot = getSandboxRoot();
sendToSbRoot = !((sbRoot == this));
bridgeEvent = new SWFBridgeEvent(SWFBridgeEvent.BRIDGE_WINDOW_ACTIVATE, false, false, {notifier:bridge, window:(sendToSbRoot) ? window : NameUtil.displayObjectToString(window)});
if (sendToSbRoot){
sbRoot.dispatchEvent(bridgeEvent);
} else {
bridge.dispatchEvent(bridgeEvent);
};
};
}
private function nextFrameTimerHandler(event:TimerEvent):void{
if ((currentFrame + 1) <= framesLoaded){
nextFrame();
nextFrameTimer.removeEventListener(TimerEvent.TIMER, nextFrameTimerHandler);
nextFrameTimer.reset();
};
}
public function get numModalWindows():int{
return (_numModalWindows);
}
private function areFormsEqual(form1:Object, form2:Object):Boolean{
if (form1 == form2){
return (true);
};
if ((((form1 is RemotePopUp)) && ((form2 is RemotePopUp)))){
return (areRemotePopUpsEqual(form1, form2));
};
return (false);
}
public function isTopLevelWindow(object:DisplayObject):Boolean{
return ((((object is IUIComponent)) && ((IUIComponent(object) == topLevelWindow))));
}
private function removePlaceholderId(id:String):void{
delete idToPlaceholder[id];
}
override public function get width():Number{
return (_width);
}
private function dispatchActivatedApplicationEvent():void{
var bridgeEvent:SWFBridgeEvent;
var bridge:IEventDispatcher = (swfBridgeGroup) ? swfBridgeGroup.parentBridge : null;
if (bridge){
bridgeEvent = new SWFBridgeEvent(SWFBridgeEvent.BRIDGE_APPLICATION_ACTIVATE, false, false);
bridge.dispatchEvent(bridgeEvent);
};
}
private function otherSystemManagerMouseListener(event:SandboxMouseEvent):void{
if (dispatchingToSystemManagers){
return;
};
dispatchEventFromSWFBridges(event);
var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST);
me.name = "sameSandbox";
me.value = event;
getSandboxRoot().dispatchEvent(me);
if (!me.value){
dispatchEvent(event);
};
}
private function hideMouseCursorRequestHandler(event:Event):void{
var bridge:IEventDispatcher;
if (((!(isTopLevelRoot())) && ((event is SWFBridgeRequest)))){
return;
};
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (!isTopLevelRoot()){
bridge = swfBridgeGroup.parentBridge;
request.requestor = bridge;
bridge.dispatchEvent(request);
} else {
if (eventProxy){
SystemManagerGlobals.showMouseCursor = false;
};
};
}
private function getTopLevelSystemManager(parent:DisplayObject):ISystemManager{
var sm:ISystemManager;
var localRoot:DisplayObjectContainer = DisplayObjectContainer(parent.root);
if (((((!(localRoot)) || ((localRoot is Stage)))) && ((parent is IUIComponent)))){
localRoot = DisplayObjectContainer(IUIComponent(parent).systemManager);
};
if ((localRoot is ISystemManager)){
sm = ISystemManager(localRoot);
if (!sm.isTopLevel()){
sm = sm.topLevelSystemManager;
};
};
return (sm);
}
public function isDisplayObjectInABridgedApplication(displayObject:DisplayObject):Boolean{
return (!((getSWFBridgeOfDisplayObject(displayObject) == null)));
}
public function move(x:Number, y:Number):void{
}
public function set explicitWidth(value:Number):void{
_explicitWidth = value;
}
public function get parentAllowsChild():Boolean{
return (loaderInfo.parentAllowsChild);
//unresolved jump
var _slot1 = error;
return (false);
}
private function preloader_initProgressHandler(event:Event):void{
preloader.removeEventListener(FlexEvent.INIT_PROGRESS, preloader_initProgressHandler);
deferredNextFrame();
}
public function get explicitWidth():Number{
return (_explicitWidth);
}
private function activateFormSandboxEventHandler(event:Event):void{
var bridgeEvent:SWFBridgeEvent = SWFBridgeEvent.marshal(event);
if (!forwardFormEvent(bridgeEvent)){
activateForm(new RemotePopUp(bridgeEvent.data.window, bridgeEvent.data.notifier));
};
}
mx_internal function rawChildren_addChild(child:DisplayObject):DisplayObject{
addingChild(child);
super.addChild(child);
childAdded(child);
return (child);
}
public static function getSWFRoot(object:Object):DisplayObject{
var p:*;
var sm:ISystemManager;
var domain:ApplicationDomain;
var cls:Class;
var object = object;
var className:String = getQualifiedClassName(object);
for (p in allSystemManagers) {
sm = (p as ISystemManager);
domain = sm.loaderInfo.applicationDomain;
cls = Class(domain.getDefinition(className));
if ((object is cls)){
return ((sm as DisplayObject));
};
//unresolved jump
var _slot1 = e;
};
return (null);
}
private static function areRemotePopUpsEqual(form1:Object, form2:Object):Boolean{
if (!(form1 is RemotePopUp)){
return (false);
};
if (!(form2 is RemotePopUp)){
return (false);
};
var remotePopUp1:RemotePopUp = RemotePopUp(form1);
var remotePopUp2:RemotePopUp = RemotePopUp(form2);
if ((((((remotePopUp1.window == remotePopUp2.window)) && (remotePopUp1.bridge))) && (remotePopUp2.bridge))){
return (true);
};
return (false);
}
private static function getChildListIndex(childList:IChildList, f:Object):int{
var childList = childList;
var f = f;
var index = -1;
index = childList.getChildIndex(DisplayObject(f));
//unresolved jump
var _slot1 = e;
return (index);
}
mx_internal static function registerInitCallback(initFunction:Function):void{
if (((!(allSystemManagers)) || (!(lastSystemManager)))){
return;
};
var sm:SystemManager = lastSystemManager;
if (sm.doneExecutingInitCallbacks){
initFunction(sm);
} else {
sm.initCallbackFunctions.push(initFunction);
};
}
private static function isRemotePopUp(form:Object):Boolean{
return (!((form is IFocusManagerContainer)));
}
}
}//package mx.managers
Section 253
//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 function SystemManagerGlobals(){
super();
}
}
}//package mx.managers
Section 254
//SystemManagerProxy (mx.managers.SystemManagerProxy)
package mx.managers {
import flash.display.*;
import flash.geom.*;
import mx.core.*;
import flash.events.*;
import mx.events.*;
import mx.utils.*;
public class SystemManagerProxy extends SystemManager {
private var _systemManager:ISystemManager;
mx_internal static const VERSION:String = "3.2.0.3958";
public function SystemManagerProxy(systemManager:ISystemManager){
super();
_systemManager = systemManager;
topLevel = true;
super.addEventListener(MouseEvent.MOUSE_DOWN, proxyMouseDownHandler, true);
}
override public function create(... _args):Object{
return (IFlexModuleFactory(_systemManager).create.apply(this, _args));
}
public function get systemManager():ISystemManager{
return (_systemManager);
}
override public function activate(f:IFocusManagerContainer):void{
var mutualTrust:Boolean;
var bridgeEvent:SWFBridgeEvent;
var bridge:IEventDispatcher = (_systemManager.swfBridgeGroup) ? _systemManager.swfBridgeGroup.parentBridge : null;
if (bridge){
mutualTrust = SecurityUtil.hasMutualTrustBetweenParentAndChild(ISWFBridgeProvider(_systemManager));
bridgeEvent = new SWFBridgeEvent(SWFBridgeEvent.BRIDGE_WINDOW_ACTIVATE, false, false, {notifier:bridge, window:(mutualTrust) ? this : NameUtil.displayObjectToString(this)});
_systemManager.getSandboxRoot().dispatchEvent(bridgeEvent);
};
}
override public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{
super.addEventListener(type, listener, useCapture, priority, useWeakReference);
_systemManager.addEventListener(type, listener, useCapture, priority, useWeakReference);
}
public function deactivateByProxy(f:IFocusManagerContainer):void{
if (f){
f.focusManager.deactivate();
};
}
override public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{
super.removeEventListener(type, listener, useCapture);
_systemManager.removeEventListener(type, listener, useCapture);
}
override public function get document():Object{
return (findFocusManagerContainer(this));
}
public function activateByProxy(f:IFocusManagerContainer):void{
super.activate(f);
}
override public function removeChildBridge(bridge:IEventDispatcher):void{
_systemManager.removeChildBridge(bridge);
}
override public function get swfBridgeGroup():ISWFBridgeGroup{
return (_systemManager.swfBridgeGroup);
}
override public function addChildBridge(bridge:IEventDispatcher, owner:DisplayObject):void{
_systemManager.addChildBridge(bridge, owner);
}
override public function useSWFBridge():Boolean{
return (_systemManager.useSWFBridge());
}
override public function get screen():Rectangle{
return (_systemManager.screen);
}
override public function set swfBridgeGroup(bridgeGroup:ISWFBridgeGroup):void{
}
private function proxyMouseDownHandler(event:MouseEvent):void{
if (findFocusManagerContainer(this)){
SystemManager(_systemManager).dispatchActivatedWindowEvent(this);
};
}
override public function deactivate(f:IFocusManagerContainer):void{
var mutualTrust:Boolean;
var bridgeEvent:SWFBridgeEvent;
var sm:ISystemManager = _systemManager;
var bridge:IEventDispatcher = (sm.swfBridgeGroup) ? sm.swfBridgeGroup.parentBridge : null;
if (bridge){
mutualTrust = SecurityUtil.hasMutualTrustBetweenParentAndChild(ISWFBridgeProvider(_systemManager));
bridgeEvent = new SWFBridgeEvent(SWFBridgeEvent.BRIDGE_WINDOW_DEACTIVATE, false, false, {notifier:bridge, window:(mutualTrust) ? this : NameUtil.displayObjectToString(this)});
_systemManager.getSandboxRoot().dispatchEvent(bridgeEvent);
};
}
override public function set document(value:Object):void{
}
override public function getVisibleApplicationRect(bounds:Rectangle=null):Rectangle{
return (_systemManager.getVisibleApplicationRect(bounds));
}
override public function getDefinitionByName(name:String):Object{
return (_systemManager.getDefinitionByName(name));
}
}
}//package mx.managers
Section 255
//SystemRawChildrenList (mx.managers.SystemRawChildrenList)
package mx.managers {
import flash.display.*;
import flash.geom.*;
import mx.core.*;
public class SystemRawChildrenList implements IChildList {
private var owner:SystemManager;
mx_internal static const VERSION:String = "3.2.0.3958";
public function SystemRawChildrenList(owner:SystemManager){
super();
this.owner = owner;
}
public function getChildAt(index:int):DisplayObject{
return (owner.mx_internal::rawChildren_getChildAt(index));
}
public function addChild(child:DisplayObject):DisplayObject{
return (owner.mx_internal::rawChildren_addChild(child));
}
public function getChildIndex(child:DisplayObject):int{
return (owner.mx_internal::rawChildren_getChildIndex(child));
}
public function setChildIndex(child:DisplayObject, newIndex:int):void{
var _local3 = owner;
_local3.mx_internal::rawChildren_setChildIndex(child, newIndex);
}
public function getChildByName(name:String):DisplayObject{
return (owner.mx_internal::rawChildren_getChildByName(name));
}
public function removeChildAt(index:int):DisplayObject{
return (owner.mx_internal::rawChildren_removeChildAt(index));
}
public function get numChildren():int{
return (owner.mx_internal::$numChildren);
}
public function addChildAt(child:DisplayObject, index:int):DisplayObject{
return (owner.mx_internal::rawChildren_addChildAt(child, index));
}
public function getObjectsUnderPoint(point:Point):Array{
return (owner.mx_internal::rawChildren_getObjectsUnderPoint(point));
}
public function contains(child:DisplayObject):Boolean{
return (owner.mx_internal::rawChildren_contains(child));
}
public function removeChild(child:DisplayObject):DisplayObject{
return (owner.mx_internal::rawChildren_removeChild(child));
}
}
}//package mx.managers
Section 256
//ToolTipManager (mx.managers.ToolTipManager)
package mx.managers {
import flash.display.*;
import mx.core.*;
import flash.events.*;
import mx.effects.*;
public class ToolTipManager extends EventDispatcher {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var implClassDependency:ToolTipManagerImpl;
private static var _impl:IToolTipManager2;
public function ToolTipManager(){
super();
}
mx_internal static function registerToolTip(target:DisplayObject, oldToolTip:String, newToolTip:String):void{
impl.registerToolTip(target, oldToolTip, newToolTip);
}
public static function get enabled():Boolean{
return (impl.enabled);
}
public static function set enabled(value:Boolean):void{
impl.enabled = value;
}
public static function createToolTip(text:String, x:Number, y:Number, errorTipBorderStyle:String=null, context:IUIComponent=null):IToolTip{
return (impl.createToolTip(text, x, y, errorTipBorderStyle, context));
}
public static function set hideDelay(value:Number):void{
impl.hideDelay = value;
}
public static function set showDelay(value:Number):void{
impl.showDelay = value;
}
public static function get showDelay():Number{
return (impl.showDelay);
}
public static function destroyToolTip(toolTip:IToolTip):void{
return (impl.destroyToolTip(toolTip));
}
public static function get scrubDelay():Number{
return (impl.scrubDelay);
}
public static function get toolTipClass():Class{
return (impl.toolTipClass);
}
mx_internal static function registerErrorString(target:DisplayObject, oldErrorString:String, newErrorString:String):void{
impl.registerErrorString(target, oldErrorString, newErrorString);
}
mx_internal static function sizeTip(toolTip:IToolTip):void{
impl.sizeTip(toolTip);
}
public static function set currentTarget(value:DisplayObject):void{
impl.currentTarget = value;
}
public static function set showEffect(value:IAbstractEffect):void{
impl.showEffect = value;
}
private static function get impl():IToolTipManager2{
if (!_impl){
_impl = IToolTipManager2(Singleton.getInstance("mx.managers::IToolTipManager2"));
};
return (_impl);
}
public static function get hideDelay():Number{
return (impl.hideDelay);
}
public static function set hideEffect(value:IAbstractEffect):void{
impl.hideEffect = value;
}
public static function set scrubDelay(value:Number):void{
impl.scrubDelay = value;
}
public static function get currentToolTip():IToolTip{
return (impl.currentToolTip);
}
public static function set currentToolTip(value:IToolTip):void{
impl.currentToolTip = value;
}
public static function get showEffect():IAbstractEffect{
return (impl.showEffect);
}
public static function get currentTarget():DisplayObject{
return (impl.currentTarget);
}
public static function get hideEffect():IAbstractEffect{
return (impl.hideEffect);
}
public static function set toolTipClass(value:Class):void{
impl.toolTipClass = value;
}
}
}//package mx.managers
Section 257
//ToolTipManagerImpl (mx.managers.ToolTipManagerImpl)
package mx.managers {
import flash.display.*;
import flash.geom.*;
import mx.core.*;
import flash.events.*;
import mx.events.*;
import mx.styles.*;
import mx.controls.*;
import mx.effects.*;
import flash.utils.*;
import mx.validators.*;
public class ToolTipManagerImpl extends EventDispatcher implements IToolTipManager2 {
private var _enabled:Boolean;// = true
private var _showDelay:Number;// = 500
private var _hideEffect:IAbstractEffect;
mx_internal var hideTimer:Timer;
private var _scrubDelay:Number;// = 100
private var _toolTipClass:Class;
mx_internal var showTimer:Timer;
private var sandboxRoot:IEventDispatcher;// = null
mx_internal var currentText:String;
private var _currentToolTip:DisplayObject;
mx_internal var scrubTimer:Timer;
mx_internal var previousTarget:DisplayObject;
private var _currentTarget:DisplayObject;
private var systemManager:ISystemManager;// = null
private var _showEffect:IAbstractEffect;
private var _hideDelay:Number;// = 10000
mx_internal var initialized:Boolean;// = false
mx_internal var isError:Boolean;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var instance:IToolTipManager2;
public function ToolTipManagerImpl(){
_toolTipClass = ToolTip;
super();
if (instance){
throw (new Error("Instance already exists."));
};
this.systemManager = (SystemManagerGlobals.topLevelSystemManagers[0] as ISystemManager);
sandboxRoot = this.systemManager.getSandboxRoot();
sandboxRoot.addEventListener(InterManagerRequest.TOOLTIP_MANAGER_REQUEST, marshalToolTipManagerHandler, false, 0, true);
var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.TOOLTIP_MANAGER_REQUEST);
me.name = "update";
sandboxRoot.dispatchEvent(me);
}
mx_internal function systemManager_mouseDownHandler(event:MouseEvent):void{
reset();
}
public function set showDelay(value:Number):void{
_showDelay = value;
}
mx_internal function showTimer_timerHandler(event:TimerEvent):void{
if (currentTarget){
createTip();
initializeTip();
positionTip();
showTip();
};
}
mx_internal function hideEffectEnded():void{
var event:ToolTipEvent;
reset();
if (previousTarget){
event = new ToolTipEvent(ToolTipEvent.TOOL_TIP_END);
event.toolTip = currentToolTip;
previousTarget.dispatchEvent(event);
};
}
public function set scrubDelay(value:Number):void{
_scrubDelay = value;
}
public function get currentToolTip():IToolTip{
return ((_currentToolTip as IToolTip));
}
private function mouseIsOver(target:DisplayObject):Boolean{
if (((!(target)) || (!(target.stage)))){
return (false);
};
if ((((target.stage.mouseX == 0)) && ((target.stage.mouseY == 0)))){
return (false);
};
return (target.hitTestPoint(target.stage.mouseX, target.stage.mouseY, true));
}
mx_internal function toolTipMouseOutHandler(event:MouseEvent):void{
checkIfTargetChanged(event.relatedObject);
}
public function get enabled():Boolean{
return (_enabled);
}
public function createToolTip(text:String, x:Number, y:Number, errorTipBorderStyle:String=null, context:IUIComponent=null):IToolTip{
var toolTip:ToolTip = new ToolTip();
var sm:ISystemManager = (context) ? (context.systemManager as ISystemManager) : (ApplicationGlobals.application.systemManager as ISystemManager);
sm.topLevelSystemManager.addChildToSandboxRoot("toolTipChildren", (toolTip as DisplayObject));
if (errorTipBorderStyle){
toolTip.setStyle("styleName", "errorTip");
toolTip.setStyle("borderStyle", errorTipBorderStyle);
};
toolTip.text = text;
sizeTip(toolTip);
toolTip.move(x, y);
return ((toolTip as IToolTip));
}
mx_internal function reset():void{
var sm:ISystemManager;
showTimer.reset();
hideTimer.reset();
if (currentToolTip){
if (((showEffect) || (hideEffect))){
currentToolTip.removeEventListener(EffectEvent.EFFECT_END, effectEndHandler);
};
EffectManager.endEffectsForTarget(currentToolTip);
sm = (currentToolTip.systemManager as ISystemManager);
sm.topLevelSystemManager.removeChildFromSandboxRoot("toolTipChildren", (currentToolTip as DisplayObject));
currentToolTip = null;
scrubTimer.delay = scrubDelay;
scrubTimer.reset();
if (scrubDelay > 0){
scrubTimer.delay = scrubDelay;
scrubTimer.start();
};
};
}
public function set currentToolTip(value:IToolTip):void{
_currentToolTip = (value as DisplayObject);
var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.TOOLTIP_MANAGER_REQUEST);
me.name = "currentToolTip";
me.value = value;
sandboxRoot.dispatchEvent(me);
}
public function get toolTipClass():Class{
return (_toolTipClass);
}
private function hideImmediately(target:DisplayObject):void{
checkIfTargetChanged(null);
}
mx_internal function showTip():void{
var sm:ISystemManager;
var event:ToolTipEvent = new ToolTipEvent(ToolTipEvent.TOOL_TIP_SHOW);
event.toolTip = currentToolTip;
currentTarget.dispatchEvent(event);
if (isError){
currentTarget.addEventListener("change", changeHandler);
} else {
sm = getSystemManager(currentTarget);
sm.addEventListener(MouseEvent.MOUSE_DOWN, systemManager_mouseDownHandler);
};
currentToolTip.visible = true;
if (!showEffect){
showEffectEnded();
};
}
mx_internal function effectEndHandler(event:EffectEvent):void{
if (event.effectInstance.effect == showEffect){
showEffectEnded();
} else {
if (event.effectInstance.effect == hideEffect){
hideEffectEnded();
};
};
}
public function get hideDelay():Number{
return (_hideDelay);
}
public function get currentTarget():DisplayObject{
return (_currentTarget);
}
mx_internal function showEffectEnded():void{
var event:ToolTipEvent;
if (hideDelay == 0){
hideTip();
} else {
if (hideDelay < Infinity){
hideTimer.delay = hideDelay;
hideTimer.start();
};
};
if (currentTarget){
event = new ToolTipEvent(ToolTipEvent.TOOL_TIP_SHOWN);
event.toolTip = currentToolTip;
currentTarget.dispatchEvent(event);
};
}
public function get hideEffect():IAbstractEffect{
return (_hideEffect);
}
mx_internal function changeHandler(event:Event):void{
reset();
}
public function set enabled(value:Boolean):void{
_enabled = value;
}
mx_internal function errorTipMouseOverHandler(event:MouseEvent):void{
checkIfTargetChanged(DisplayObject(event.target));
}
public function get showDelay():Number{
return (_showDelay);
}
public function get scrubDelay():Number{
return (_scrubDelay);
}
public function registerErrorString(target:DisplayObject, oldErrorString:String, newErrorString:String):void{
if (((!(oldErrorString)) && (newErrorString))){
target.addEventListener(MouseEvent.MOUSE_OVER, errorTipMouseOverHandler);
target.addEventListener(MouseEvent.MOUSE_OUT, errorTipMouseOutHandler);
if (mouseIsOver(target)){
showImmediately(target);
};
} else {
if (((oldErrorString) && (!(newErrorString)))){
target.removeEventListener(MouseEvent.MOUSE_OVER, errorTipMouseOverHandler);
target.removeEventListener(MouseEvent.MOUSE_OUT, errorTipMouseOutHandler);
if (mouseIsOver(target)){
hideImmediately(target);
};
};
};
}
mx_internal function initialize():void{
if (!showTimer){
showTimer = new Timer(0, 1);
showTimer.addEventListener(TimerEvent.TIMER, showTimer_timerHandler);
};
if (!hideTimer){
hideTimer = new Timer(0, 1);
hideTimer.addEventListener(TimerEvent.TIMER, hideTimer_timerHandler);
};
if (!scrubTimer){
scrubTimer = new Timer(0, 1);
};
initialized = true;
}
public function destroyToolTip(toolTip:IToolTip):void{
var sm:ISystemManager = (toolTip.systemManager as ISystemManager);
sm.topLevelSystemManager.removeChildFromSandboxRoot("toolTipChildren", DisplayObject(toolTip));
}
mx_internal function checkIfTargetChanged(displayObject:DisplayObject):void{
if (!enabled){
return;
};
findTarget(displayObject);
if (currentTarget != previousTarget){
targetChanged();
previousTarget = currentTarget;
};
}
private function marshalToolTipManagerHandler(event:Event):void{
var me:InterManagerRequest;
if ((event is InterManagerRequest)){
return;
};
var marshalEvent:Object = event;
switch (marshalEvent.name){
case "currentToolTip":
_currentToolTip = marshalEvent.value;
break;
case ToolTipEvent.TOOL_TIP_HIDE:
if ((_currentToolTip is IToolTip)){
hideTip();
};
break;
case "update":
event.stopImmediatePropagation();
me = new InterManagerRequest(InterManagerRequest.TOOLTIP_MANAGER_REQUEST);
me.name = "currentToolTip";
me.value = _currentToolTip;
sandboxRoot.dispatchEvent(me);
};
}
public function set toolTipClass(value:Class):void{
_toolTipClass = value;
}
private function getGlobalBounds(obj:DisplayObject, parent:DisplayObject):Rectangle{
var upperLeft:Point = new Point(0, 0);
upperLeft = obj.localToGlobal(upperLeft);
upperLeft = parent.globalToLocal(upperLeft);
return (new Rectangle(upperLeft.x, upperLeft.y, obj.width, obj.height));
}
mx_internal function positionTip():void{
var x:Number;
var y:Number;
var targetGlobalBounds:Rectangle;
var pos:Point;
var ctt:IToolTip;
var newWidth:Number;
var oldWidth:Number;
var sm:ISystemManager;
var toolTipWidth:Number;
var toolTipHeight:Number;
var screenWidth:Number = currentToolTip.screen.width;
var screenHeight:Number = currentToolTip.screen.height;
if (isError){
targetGlobalBounds = getGlobalBounds(currentTarget, currentToolTip.root);
x = (targetGlobalBounds.right + 4);
y = (targetGlobalBounds.top - 1);
if ((x + currentToolTip.width) > screenWidth){
newWidth = NaN;
oldWidth = NaN;
x = (targetGlobalBounds.left - 2);
if (((x + currentToolTip.width) + 4) > screenWidth){
newWidth = ((screenWidth - x) - 4);
oldWidth = Object(toolTipClass).maxWidth;
Object(toolTipClass).maxWidth = newWidth;
if ((currentToolTip is IStyleClient)){
IStyleClient(currentToolTip).setStyle("borderStyle", "errorTipAbove");
};
currentToolTip["text"] = currentToolTip["text"];
Object(toolTipClass).maxWidth = oldWidth;
} else {
if ((currentToolTip is IStyleClient)){
IStyleClient(currentToolTip).setStyle("borderStyle", "errorTipAbove");
};
currentToolTip["text"] = currentToolTip["text"];
};
if ((currentToolTip.height + 2) < targetGlobalBounds.top){
y = (targetGlobalBounds.top - (currentToolTip.height + 2));
} else {
y = (targetGlobalBounds.bottom + 2);
if (!isNaN(newWidth)){
Object(toolTipClass).maxWidth = newWidth;
};
if ((currentToolTip is IStyleClient)){
IStyleClient(currentToolTip).setStyle("borderStyle", "errorTipBelow");
};
currentToolTip["text"] = currentToolTip["text"];
if (!isNaN(oldWidth)){
Object(toolTipClass).maxWidth = oldWidth;
};
};
};
sizeTip(currentToolTip);
pos = new Point(x, y);
ctt = currentToolTip;
x = pos.x;
y = pos.y;
} else {
sm = getSystemManager(currentTarget);
x = (DisplayObject(sm).mouseX + 11);
y = (DisplayObject(sm).mouseY + 22);
toolTipWidth = currentToolTip.width;
if ((x + toolTipWidth) > screenWidth){
x = (screenWidth - toolTipWidth);
};
toolTipHeight = currentToolTip.height;
if ((y + toolTipHeight) > screenHeight){
y = (screenHeight - toolTipHeight);
};
pos = new Point(x, y);
pos = DisplayObject(sm).localToGlobal(pos);
pos = DisplayObject(sandboxRoot).globalToLocal(pos);
x = pos.x;
y = pos.y;
};
currentToolTip.move(x, y);
}
mx_internal function errorTipMouseOutHandler(event:MouseEvent):void{
checkIfTargetChanged(event.relatedObject);
}
mx_internal function findTarget(displayObject:DisplayObject):void{
while (displayObject) {
if ((displayObject is IValidatorListener)){
currentText = IValidatorListener(displayObject).errorString;
if (((!((currentText == null))) && (!((currentText == ""))))){
currentTarget = displayObject;
isError = true;
return;
};
};
if ((displayObject is IToolTipManagerClient)){
currentText = IToolTipManagerClient(displayObject).toolTip;
if (currentText != null){
currentTarget = displayObject;
isError = false;
return;
};
};
displayObject = displayObject.parent;
};
currentText = null;
currentTarget = null;
}
public function registerToolTip(target:DisplayObject, oldToolTip:String, newToolTip:String):void{
if (((!(oldToolTip)) && (newToolTip))){
target.addEventListener(MouseEvent.MOUSE_OVER, toolTipMouseOverHandler);
target.addEventListener(MouseEvent.MOUSE_OUT, toolTipMouseOutHandler);
if (mouseIsOver(target)){
showImmediately(target);
};
} else {
if (((oldToolTip) && (!(newToolTip)))){
target.removeEventListener(MouseEvent.MOUSE_OVER, toolTipMouseOverHandler);
target.removeEventListener(MouseEvent.MOUSE_OUT, toolTipMouseOutHandler);
if (mouseIsOver(target)){
hideImmediately(target);
};
};
};
}
private function showImmediately(target:DisplayObject):void{
var oldShowDelay:Number = ToolTipManager.showDelay;
ToolTipManager.showDelay = 0;
checkIfTargetChanged(target);
ToolTipManager.showDelay = oldShowDelay;
}
public function set hideDelay(value:Number):void{
_hideDelay = value;
}
private function getSystemManager(target:DisplayObject):ISystemManager{
return (((target is IUIComponent)) ? IUIComponent(target).systemManager : null);
}
public function set currentTarget(value:DisplayObject):void{
_currentTarget = value;
}
public function sizeTip(toolTip:IToolTip):void{
if ((toolTip is IInvalidating)){
IInvalidating(toolTip).validateNow();
};
toolTip.setActualSize(toolTip.getExplicitOrMeasuredWidth(), toolTip.getExplicitOrMeasuredHeight());
}
public function set showEffect(value:IAbstractEffect):void{
_showEffect = (value as IAbstractEffect);
}
mx_internal function targetChanged():void{
var event:ToolTipEvent;
var me:InterManagerRequest;
if (!initialized){
initialize();
};
if (((previousTarget) && (currentToolTip))){
if ((currentToolTip is IToolTip)){
event = new ToolTipEvent(ToolTipEvent.TOOL_TIP_HIDE);
event.toolTip = currentToolTip;
previousTarget.dispatchEvent(event);
} else {
me = new InterManagerRequest(InterManagerRequest.TOOLTIP_MANAGER_REQUEST);
me.name = ToolTipEvent.TOOL_TIP_HIDE;
sandboxRoot.dispatchEvent(me);
};
};
reset();
if (currentTarget){
if (currentText == ""){
return;
};
event = new ToolTipEvent(ToolTipEvent.TOOL_TIP_START);
currentTarget.dispatchEvent(event);
if ((((showDelay == 0)) || (scrubTimer.running))){
createTip();
initializeTip();
positionTip();
showTip();
} else {
showTimer.delay = showDelay;
showTimer.start();
};
};
}
public function set hideEffect(value:IAbstractEffect):void{
_hideEffect = (value as IAbstractEffect);
}
mx_internal function hideTimer_timerHandler(event:TimerEvent):void{
hideTip();
}
mx_internal function initializeTip():void{
if ((currentToolTip is IToolTip)){
IToolTip(currentToolTip).text = currentText;
};
if (((isError) && ((currentToolTip is IStyleClient)))){
IStyleClient(currentToolTip).setStyle("styleName", "errorTip");
};
sizeTip(currentToolTip);
if ((currentToolTip is IStyleClient)){
if (showEffect){
IStyleClient(currentToolTip).setStyle("showEffect", showEffect);
};
if (hideEffect){
IStyleClient(currentToolTip).setStyle("hideEffect", hideEffect);
};
};
if (((showEffect) || (hideEffect))){
currentToolTip.addEventListener(EffectEvent.EFFECT_END, effectEndHandler);
};
}
public function get showEffect():IAbstractEffect{
return (_showEffect);
}
mx_internal function toolTipMouseOverHandler(event:MouseEvent):void{
checkIfTargetChanged(DisplayObject(event.target));
}
mx_internal function hideTip():void{
var event:ToolTipEvent;
var sm:ISystemManager;
if (previousTarget){
event = new ToolTipEvent(ToolTipEvent.TOOL_TIP_HIDE);
event.toolTip = currentToolTip;
previousTarget.dispatchEvent(event);
};
if (currentToolTip){
currentToolTip.visible = false;
};
if (isError){
if (currentTarget){
currentTarget.removeEventListener("change", changeHandler);
};
} else {
if (previousTarget){
sm = getSystemManager(previousTarget);
sm.removeEventListener(MouseEvent.MOUSE_DOWN, systemManager_mouseDownHandler);
};
};
if (!hideEffect){
hideEffectEnded();
};
}
mx_internal function createTip():void{
var event:ToolTipEvent = new ToolTipEvent(ToolTipEvent.TOOL_TIP_CREATE);
currentTarget.dispatchEvent(event);
if (event.toolTip){
currentToolTip = event.toolTip;
} else {
currentToolTip = new toolTipClass();
};
currentToolTip.visible = false;
var sm:ISystemManager = (getSystemManager(currentTarget) as ISystemManager);
sm.topLevelSystemManager.addChildToSandboxRoot("toolTipChildren", (currentToolTip as DisplayObject));
}
public static function getInstance():IToolTipManager2{
if (!instance){
instance = new (ToolTipManagerImpl);
};
return (instance);
}
}
}//package mx.managers
Section 258
//LoaderConfig (mx.messaging.config.LoaderConfig)
package mx.messaging.config {
import mx.core.*;
public class LoaderConfig {
mx_internal static const VERSION:String = "3.2.0.3958";
mx_internal static var _url:String = null;
mx_internal static var _parameters:Object;
public function LoaderConfig(){
super();
}
public static function get url():String{
return (_url);
}
public static function get parameters():Object{
return (_parameters);
}
}
}//package mx.messaging.config
Section 259
//IModuleInfo (mx.modules.IModuleInfo)
package mx.modules {
import mx.core.*;
import flash.events.*;
import flash.system.*;
import flash.utils.*;
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.2.0\frameworks\projects\framework\src;mx\modules;IModuleInfo.as:IFlexModuleFactory):void;
function get factory():IFlexModuleFactory;
function set data(C:\autobuild\3.2.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 260
//ModuleManager (mx.modules.ModuleManager)
package mx.modules {
import mx.core.*;
public class ModuleManager {
mx_internal static const VERSION:String = "3.2.0.3958";
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 flash.display.*;
import mx.core.*;
import flash.events.*;
import mx.events.*;
import flash.system.*;
import flash.net.*;
import flash.utils.*;
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;
clearLoader();
dispatchEvent(new ModuleEvent(ModuleEvent.READY));
}
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 261
//ModuleManagerGlobals (mx.modules.ModuleManagerGlobals)
package mx.modules {
public class ModuleManagerGlobals {
public static var managerSingleton:Object = null;
public function ModuleManagerGlobals(){
super();
}
}
}//package mx.modules
Section 262
//DownloadProgressBar (mx.preloaders.DownloadProgressBar)
package mx.preloaders {
import flash.display.*;
import flash.geom.*;
import mx.core.*;
import flash.text.*;
import flash.events.*;
import mx.events.*;
import flash.system.*;
import mx.graphics.*;
import flash.net.*;
import flash.utils.*;
public class DownloadProgressBar extends Sprite implements IPreloaderDisplay {
protected var MINIMUM_DISPLAY_TIME:uint;// = 0
private var _barFrameRect:RoundedRectangle;
private var _stageHeight:Number;// = 375
private var _stageWidth:Number;// = 500
private var _percentRect:Rectangle;
private var _percentObj:TextField;
private var _downloadingLabel:String;// = "Loading"
private var _showProgressBar:Boolean;// = true
private var _yOffset:Number;// = 20
private var _initProgressCount:uint;// = 0
private var _barSprite:Sprite;
private var _visible:Boolean;// = false
private var _barRect:RoundedRectangle;
private var _showingDisplay:Boolean;// = false
private var _backgroundSize:String;// = ""
private var _initProgressTotal:uint;// = 12
private var _startedInit:Boolean;// = false
private var _showLabel:Boolean;// = true
private var _value:Number;// = 0
private var _labelRect:Rectangle;
private var _backgroundImage:Object;
private var _backgroundAlpha:Number;// = 1
private var _backgroundColor:uint;
private var _startedLoading:Boolean;// = false
private var _showPercentage:Boolean;// = false
private var _barFrameSprite:Sprite;
protected var DOWNLOAD_PERCENTAGE:uint;// = 60
private var _displayStartCount:uint;// = 0
private var _labelObj:TextField;
private var _borderRect:RoundedRectangle;
private var _maximum:Number;// = 0
private var _displayTime:int;
private var _label:String;// = ""
private var _preloader:Sprite;
private var _xOffset:Number;// = 20
private var _startTime:int;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var _initializingLabel:String = "Initializing";
public function DownloadProgressBar(){
_labelRect = labelRect;
_percentRect = percentRect;
_borderRect = borderRect;
_barFrameRect = barFrameRect;
_barRect = barRect;
super();
}
protected function getPercentLoaded(loaded:Number, total:Number):Number{
var perc:Number;
if ((((((((loaded == 0)) || ((total == 0)))) || (isNaN(total)))) || (isNaN(loaded)))){
return (0);
};
perc = ((100 * loaded) / total);
if (((isNaN(perc)) || ((perc <= 0)))){
return (0);
};
if (perc > 99){
return (99);
};
return (Math.round(perc));
}
protected function get labelFormat():TextFormat{
var tf:TextFormat = new TextFormat();
tf.color = 0x333333;
tf.font = "Verdana";
tf.size = 10;
return (tf);
}
private function calcScale():void{
var scale:Number;
if ((((stageWidth < 160)) || ((stageHeight < 120)))){
scaleX = 1;
scaleY = 1;
} else {
if ((((stageWidth < 240)) || ((stageHeight < 150)))){
createChildren();
scale = Math.min((stageWidth / 240), (stageHeight / 150));
scaleX = scale;
scaleY = scale;
} else {
createChildren();
};
};
}
protected function get percentRect():Rectangle{
return (new Rectangle(108, 4, 34, 16));
}
protected function set showLabel(value:Boolean):void{
_showLabel = value;
draw();
}
private function calcBackgroundSize():Number{
var index:int;
var percentage:Number = NaN;
if (backgroundSize){
index = backgroundSize.indexOf("%");
if (index != -1){
percentage = Number(backgroundSize.substr(0, index));
};
};
return (percentage);
}
private function show():void{
_showingDisplay = true;
calcScale();
draw();
_displayTime = getTimer();
}
private function loadBackgroundImage(classOrString:Object):void{
var cls:Class;
var newStyleObj:DisplayObject;
var loader:Loader;
var loaderContext:LoaderContext;
var classOrString = classOrString;
if (((classOrString) && ((classOrString as Class)))){
cls = Class(classOrString);
initBackgroundImage(new (cls));
} else {
if (((classOrString) && ((classOrString is String)))){
cls = Class(getDefinitionByName(String(classOrString)));
//unresolved jump
var _slot1 = e;
if (cls){
newStyleObj = new (cls);
initBackgroundImage(newStyleObj);
} else {
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loader_completeHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loader_ioErrorHandler);
loaderContext = new LoaderContext();
loaderContext.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
loader.load(new URLRequest(String(classOrString)), loaderContext);
};
};
};
}
protected function set showPercentage(value:Boolean):void{
_showPercentage = value;
draw();
}
protected function get barFrameRect():RoundedRectangle{
return (new RoundedRectangle(14, 40, 154, 4));
}
private function loader_ioErrorHandler(event:IOErrorEvent):void{
}
protected function rslErrorHandler(event:RSLEvent):void{
_preloader.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
_preloader.removeEventListener(Event.COMPLETE, completeHandler);
_preloader.removeEventListener(RSLEvent.RSL_PROGRESS, rslProgressHandler);
_preloader.removeEventListener(RSLEvent.RSL_COMPLETE, rslCompleteHandler);
_preloader.removeEventListener(RSLEvent.RSL_ERROR, rslErrorHandler);
_preloader.removeEventListener(FlexEvent.INIT_PROGRESS, initProgressHandler);
_preloader.removeEventListener(FlexEvent.INIT_COMPLETE, initCompleteHandler);
if (!_showingDisplay){
show();
_showingDisplay = true;
};
label = ((("RSL Error " + (event.rslIndex + 1)) + " of ") + event.rslTotal);
var errorField:ErrorField = new ErrorField(this);
errorField.show(event.errorText);
}
protected function rslCompleteHandler(event:RSLEvent):void{
label = ((("Loaded library " + event.rslIndex) + " of ") + event.rslTotal);
}
protected function get borderRect():RoundedRectangle{
return (new RoundedRectangle(0, 0, 182, 60, 4));
}
protected function showDisplayForDownloading(elapsedTime:int, event:ProgressEvent):Boolean{
return ((((elapsedTime > 700)) && ((event.bytesLoaded < (event.bytesTotal / 2)))));
}
protected function createChildren():void{
var labelObj:TextField;
var percentObj:TextField;
var g:Graphics = graphics;
if (backgroundColor != 4294967295){
g.beginFill(backgroundColor, backgroundAlpha);
g.drawRect(0, 0, stageWidth, stageHeight);
};
if (backgroundImage != null){
loadBackgroundImage(backgroundImage);
};
_barFrameSprite = new Sprite();
_barSprite = new Sprite();
addChild(_barFrameSprite);
addChild(_barSprite);
g.beginFill(0xCCCCCC, 0.4);
g.drawRoundRect(calcX(_borderRect.x), calcY(_borderRect.y), _borderRect.width, _borderRect.height, (_borderRect.cornerRadius * 2), (_borderRect.cornerRadius * 2));
g.drawRoundRect(calcX((_borderRect.x + 1)), calcY((_borderRect.y + 1)), (_borderRect.width - 2), (_borderRect.height - 2), (_borderRect.cornerRadius - (1 * 2)), (_borderRect.cornerRadius - (1 * 2)));
g.endFill();
g.beginFill(0xCCCCCC, 0.4);
g.drawRoundRect(calcX((_borderRect.x + 1)), calcY((_borderRect.y + 1)), (_borderRect.width - 2), (_borderRect.height - 2), (_borderRect.cornerRadius - (1 * 2)), (_borderRect.cornerRadius - (1 * 2)));
g.endFill();
var frame_g:Graphics = _barFrameSprite.graphics;
var matrix:Matrix = new Matrix();
matrix.createGradientBox(_barFrameRect.width, _barFrameRect.height, (Math.PI / 2), calcX(_barFrameRect.x), calcY(_barFrameRect.y));
frame_g.beginGradientFill(GradientType.LINEAR, [6054502, 11909306], [1, 1], [0, 0xFF], matrix);
frame_g.drawRoundRect(calcX(_barFrameRect.x), calcY(_barFrameRect.y), _barFrameRect.width, _barFrameRect.height, (_barFrameRect.cornerRadius * 2), (_barFrameRect.cornerRadius * 2));
frame_g.drawRoundRect(calcX((_barFrameRect.x + 1)), calcY((_barFrameRect.y + 1)), (_barFrameRect.width - 2), (_barFrameRect.height - 2), (_barFrameRect.cornerRadius * 2), (_barFrameRect.cornerRadius * 2));
frame_g.endFill();
_labelObj = new TextField();
_labelObj.x = calcX(_labelRect.x);
_labelObj.y = calcY(_labelRect.y);
_labelObj.width = _labelRect.width;
_labelObj.height = _labelRect.height;
_labelObj.selectable = false;
_labelObj.defaultTextFormat = labelFormat;
addChild(_labelObj);
_percentObj = new TextField();
_percentObj.x = calcX(_percentRect.x);
_percentObj.y = calcY(_percentRect.y);
_percentObj.width = _percentRect.width;
_percentObj.height = _percentRect.height;
_percentObj.selectable = false;
_percentObj.defaultTextFormat = percentFormat;
addChild(_percentObj);
var ds:RectangularDropShadow = new RectangularDropShadow();
ds.color = 0;
ds.angle = 90;
ds.alpha = 0.6;
ds.distance = 2;
ds.tlRadius = (ds.trRadius = (ds.blRadius = (ds.brRadius = _borderRect.cornerRadius)));
ds.drawShadow(g, calcX(_borderRect.x), calcY(_borderRect.y), _borderRect.width, _borderRect.height);
g.lineStyle(1, 0xFFFFFF, 0.3);
g.moveTo((calcX(_borderRect.x) + _borderRect.cornerRadius), calcY(_borderRect.y));
g.lineTo(((calcX(_borderRect.x) - _borderRect.cornerRadius) + _borderRect.width), calcY(_borderRect.y));
}
private function draw():void{
var percentage:Number;
if (_startedLoading){
if (!_startedInit){
percentage = Math.round(((getPercentLoaded(_value, _maximum) * DOWNLOAD_PERCENTAGE) / 100));
} else {
percentage = Math.round((((getPercentLoaded(_value, _maximum) * (100 - DOWNLOAD_PERCENTAGE)) / 100) + DOWNLOAD_PERCENTAGE));
};
} else {
percentage = getPercentLoaded(_value, _maximum);
};
if (_labelObj){
_labelObj.text = _label;
};
if (_percentObj){
if (!_showPercentage){
_percentObj.visible = false;
_percentObj.text = "";
} else {
_percentObj.text = (String(percentage) + "%");
};
};
if (((_barSprite) && (_barFrameSprite))){
if (!_showProgressBar){
_barSprite.visible = false;
_barFrameSprite.visible = false;
} else {
drawProgressBar(percentage);
};
};
}
private function timerHandler(event:Event=null):void{
dispatchEvent(new Event(Event.COMPLETE));
}
private function hide():void{
}
public function get backgroundSize():String{
return (_backgroundSize);
}
protected function center(width:Number, height:Number):void{
_xOffset = Math.floor(((width - _borderRect.width) / 2));
_yOffset = Math.floor(((height - _borderRect.height) / 2));
}
protected function progressHandler(event:ProgressEvent):void{
var loaded:uint = event.bytesLoaded;
var total:uint = event.bytesTotal;
var elapsedTime:int = (getTimer() - _startTime);
if (((_showingDisplay) || (showDisplayForDownloading(elapsedTime, event)))){
if (!_startedLoading){
show();
label = downloadingLabel;
_startedLoading = true;
};
setProgress(event.bytesLoaded, event.bytesTotal);
};
}
protected function initProgressHandler(event:Event):void{
var loaded:Number;
var elapsedTime:int = (getTimer() - _startTime);
_initProgressCount++;
if (((!(_showingDisplay)) && (showDisplayForInit(elapsedTime, _initProgressCount)))){
_displayStartCount = _initProgressCount;
show();
} else {
if (_showingDisplay){
if (!_startedInit){
_startedInit = true;
label = initializingLabel;
};
loaded = ((100 * _initProgressCount) / (_initProgressTotal - _displayStartCount));
setProgress(loaded, 100);
};
};
}
protected function set downloadingLabel(value:String):void{
_downloadingLabel = value;
}
public function get stageWidth():Number{
return (_stageWidth);
}
protected function get showPercentage():Boolean{
return (_showPercentage);
}
override public function get visible():Boolean{
return (_visible);
}
public function set stageHeight(value:Number):void{
_stageHeight = value;
}
public function initialize():void{
_startTime = getTimer();
center(stageWidth, stageHeight);
}
protected function rslProgressHandler(event:RSLEvent):void{
}
protected function get barRect():RoundedRectangle{
return (new RoundedRectangle(14, 39, 154, 6, 0));
}
protected function get percentFormat():TextFormat{
var tf:TextFormat = new TextFormat();
tf.align = "right";
tf.color = 0;
tf.font = "Verdana";
tf.size = 10;
return (tf);
}
public function set backgroundImage(value:Object):void{
_backgroundImage = value;
}
private function calcX(base:Number):Number{
return ((base + _xOffset));
}
private function calcY(base:Number):Number{
return ((base + _yOffset));
}
public function set backgroundAlpha(value:Number):void{
_backgroundAlpha = value;
}
private function initCompleteHandler(event:Event):void{
var timer:Timer;
var elapsedTime:int = (getTimer() - _displayTime);
if (((_showingDisplay) && ((elapsedTime < MINIMUM_DISPLAY_TIME)))){
timer = new Timer((MINIMUM_DISPLAY_TIME - elapsedTime), 1);
timer.addEventListener(TimerEvent.TIMER, timerHandler);
timer.start();
} else {
timerHandler();
};
}
public function set backgroundColor(value:uint):void{
_backgroundColor = value;
}
private function initBackgroundImage(image:DisplayObject):void{
var sX:Number;
var sY:Number;
var scale:Number;
addChildAt(image, 0);
var backgroundImageWidth:Number = image.width;
var backgroundImageHeight:Number = image.height;
var percentage:Number = calcBackgroundSize();
if (isNaN(percentage)){
sX = 1;
sY = 1;
} else {
scale = (percentage * 0.01);
sX = ((scale * stageWidth) / backgroundImageWidth);
sY = ((scale * stageHeight) / backgroundImageHeight);
};
image.scaleX = sX;
image.scaleY = sY;
var offsetX:Number = Math.round((0.5 * (stageWidth - (backgroundImageWidth * sX))));
var offsetY:Number = Math.round((0.5 * (stageHeight - (backgroundImageHeight * sY))));
image.x = offsetX;
image.y = offsetY;
if (!isNaN(backgroundAlpha)){
image.alpha = backgroundAlpha;
};
}
public function set backgroundSize(value:String):void{
_backgroundSize = value;
}
protected function showDisplayForInit(elapsedTime:int, count:int):Boolean{
return ((((elapsedTime > 300)) && ((count == 2))));
}
protected function get downloadingLabel():String{
return (_downloadingLabel);
}
private function loader_completeHandler(event:Event):void{
var target:DisplayObject = DisplayObject(LoaderInfo(event.target).loader);
initBackgroundImage(target);
}
protected function setProgress(completed:Number, total:Number):void{
if (((((((!(isNaN(completed))) && (!(isNaN(total))))) && ((completed >= 0)))) && ((total > 0)))){
_value = Number(completed);
_maximum = Number(total);
draw();
};
}
public function get stageHeight():Number{
return (_stageHeight);
}
public function get backgroundImage():Object{
return (_backgroundImage);
}
public function get backgroundAlpha():Number{
if (!isNaN(_backgroundAlpha)){
return (_backgroundAlpha);
};
return (1);
}
private function drawProgressBar(percentage:Number):void{
var barY2:Number;
var g:Graphics = _barSprite.graphics;
g.clear();
var colors:Array = [0xFFFFFF, 0xFFFFFF];
var ratios:Array = [0, 0xFF];
var matrix:Matrix = new Matrix();
var barWidth:Number = ((_barRect.width * percentage) / 100);
var barWidthSplit:Number = (barWidth / 2);
var barHeight:Number = (_barRect.height - 4);
var barX:Number = calcX(_barRect.x);
var barY:Number = (calcY(_barRect.y) + 2);
matrix.createGradientBox(barWidthSplit, barHeight, 0, barX, barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.39, 0.85], ratios, matrix);
g.drawRect(barX, barY, barWidthSplit, barHeight);
matrix.createGradientBox(barWidthSplit, barHeight, 0, (barX + barWidthSplit), barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.85, 1], ratios, matrix);
g.drawRect((barX + barWidthSplit), barY, barWidthSplit, barHeight);
barWidthSplit = (barWidth / 3);
barHeight = _barRect.height;
barY = calcY(_barRect.y);
barY2 = ((barY + barHeight) - 1);
matrix.createGradientBox(barWidthSplit, barHeight, 0, barX, barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.05, 0.15], ratios, matrix);
g.drawRect(barX, barY, barWidthSplit, 1);
g.drawRect(barX, barY2, barWidthSplit, 1);
matrix.createGradientBox(barWidthSplit, barHeight, 0, (barX + barWidthSplit), barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.15, 0.25], ratios, matrix);
g.drawRect((barX + barWidthSplit), barY, barWidthSplit, 1);
g.drawRect((barX + barWidthSplit), barY2, barWidthSplit, 1);
matrix.createGradientBox(barWidthSplit, barHeight, 0, (barX + (barWidthSplit * 2)), barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.25, 0.1], ratios, matrix);
g.drawRect((barX + (barWidthSplit * 2)), barY, barWidthSplit, 1);
g.drawRect((barX + (barWidthSplit * 2)), barY2, barWidthSplit, 1);
barWidthSplit = (barWidth / 3);
barHeight = _barRect.height;
barY = (calcY(_barRect.y) + 1);
barY2 = ((calcY(_barRect.y) + barHeight) - 2);
matrix.createGradientBox(barWidthSplit, barHeight, 0, barX, barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.15, 0.3], ratios, matrix);
g.drawRect(barX, barY, barWidthSplit, 1);
g.drawRect(barX, barY2, barWidthSplit, 1);
matrix.createGradientBox(barWidthSplit, barHeight, 0, (barX + barWidthSplit), barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.3, 0.4], ratios, matrix);
g.drawRect((barX + barWidthSplit), barY, barWidthSplit, 1);
g.drawRect((barX + barWidthSplit), barY2, barWidthSplit, 1);
matrix.createGradientBox(barWidthSplit, barHeight, 0, (barX + (barWidthSplit * 2)), barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.4, 0.25], ratios, matrix);
g.drawRect((barX + (barWidthSplit * 2)), barY, barWidthSplit, 1);
g.drawRect((barX + (barWidthSplit * 2)), barY2, barWidthSplit, 1);
}
public function get backgroundColor():uint{
return (_backgroundColor);
}
public function set stageWidth(value:Number):void{
_stageWidth = value;
}
protected function completeHandler(event:Event):void{
}
protected function set label(value:String):void{
if (!(value is Function)){
_label = value;
};
draw();
}
public function set preloader(value:Sprite):void{
_preloader = value;
value.addEventListener(ProgressEvent.PROGRESS, progressHandler);
value.addEventListener(Event.COMPLETE, completeHandler);
value.addEventListener(RSLEvent.RSL_PROGRESS, rslProgressHandler);
value.addEventListener(RSLEvent.RSL_COMPLETE, rslCompleteHandler);
value.addEventListener(RSLEvent.RSL_ERROR, rslErrorHandler);
value.addEventListener(FlexEvent.INIT_PROGRESS, initProgressHandler);
value.addEventListener(FlexEvent.INIT_COMPLETE, initCompleteHandler);
}
protected function get label():String{
return (_label);
}
protected function get labelRect():Rectangle{
return (new Rectangle(14, 17, 100, 16));
}
override public function set visible(value:Boolean):void{
if (((!(_visible)) && (value))){
show();
} else {
if (((_visible) && (!(value)))){
hide();
};
};
_visible = value;
}
protected function get showLabel():Boolean{
return (_showLabel);
}
public static function get initializingLabel():String{
return (_initializingLabel);
}
public static function set initializingLabel(value:String):void{
_initializingLabel = value;
}
}
}//package mx.preloaders
import flash.display.*;
import flash.text.*;
import flash.system.*;
class ErrorField extends Sprite {
private const TEXT_MARGIN_PX:int = 10;
private const MAX_WIDTH_INCHES:int = 6;
private const MIN_WIDTH_INCHES:int = 2;
private var downloadProgressBar:DownloadProgressBar;
private function ErrorField(downloadProgressBar:DownloadProgressBar){
super();
this.downloadProgressBar = downloadProgressBar;
}
protected function get labelFormat():TextFormat{
var tf:TextFormat = new TextFormat();
tf.color = 0;
tf.font = "Verdana";
tf.size = 10;
return (tf);
}
public function show(errorText:String):void{
if ((((errorText == null)) || ((errorText.length == 0)))){
return;
};
var screenWidth:Number = downloadProgressBar.stageWidth;
var screenHeight:Number = downloadProgressBar.stageHeight;
var textField:TextField = new TextField();
textField.autoSize = TextFieldAutoSize.LEFT;
textField.multiline = true;
textField.wordWrap = true;
textField.background = true;
textField.defaultTextFormat = labelFormat;
textField.text = errorText;
textField.width = Math.max((MIN_WIDTH_INCHES * Capabilities.screenDPI), (screenWidth - (TEXT_MARGIN_PX * 2)));
textField.width = Math.min((MAX_WIDTH_INCHES * Capabilities.screenDPI), textField.width);
textField.y = Math.max(0, ((screenHeight - TEXT_MARGIN_PX) - textField.height));
textField.x = ((screenWidth - textField.width) / 2);
downloadProgressBar.parent.addChild(this);
this.addChild(textField);
}
}
Section 263
//IPreloaderDisplay (mx.preloaders.IPreloaderDisplay)
package mx.preloaders {
import flash.display.*;
import flash.events.*;
public interface IPreloaderDisplay extends IEventDispatcher {
function set backgroundAlpha(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:Number):void;
function get stageHeight():Number;
function get stageWidth():Number;
function set backgroundColor(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:uint):void;
function set preloader(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:Sprite):void;
function get backgroundImage():Object;
function get backgroundSize():String;
function get backgroundAlpha():Number;
function set stageHeight(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:Number):void;
function get backgroundColor():uint;
function set stageWidth(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:Number):void;
function set backgroundImage(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:Object):void;
function set backgroundSize(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:String):void;
function initialize():void;
}
}//package mx.preloaders
Section 264
//Preloader (mx.preloaders.Preloader)
package mx.preloaders {
import flash.display.*;
import mx.core.*;
import flash.events.*;
import mx.events.*;
import flash.utils.*;
public class Preloader extends Sprite {
private var app:IEventDispatcher;// = null
private var showDisplay:Boolean;
private var timer:Timer;
private var rslDone:Boolean;// = false
private var displayClass:IPreloaderDisplay;// = null
private var rslListLoader:RSLListLoader;
mx_internal static const VERSION:String = "3.2.0.3958";
public function Preloader(){
super();
}
private function getByteValues():Object{
var li:LoaderInfo = root.loaderInfo;
var loaded:int = li.bytesLoaded;
var total:int = li.bytesTotal;
var n:int = (rslListLoader) ? rslListLoader.getItemCount() : 0;
var i:int;
while (i < n) {
loaded = (loaded + rslListLoader.getItem(i).loaded);
total = (total + rslListLoader.getItem(i).total);
i++;
};
return ({loaded:loaded, total:total});
}
private function appProgressHandler(event:Event):void{
dispatchEvent(new FlexEvent(FlexEvent.INIT_PROGRESS));
}
private function dispatchAppEndEvent(event:Object=null):void{
dispatchEvent(new FlexEvent(FlexEvent.INIT_COMPLETE));
if (!showDisplay){
displayClassCompleteHandler(null);
};
}
private function ioErrorHandler(event:IOErrorEvent):void{
}
private function appCreationCompleteHandler(event:FlexEvent):void{
dispatchAppEndEvent();
}
mx_internal function rslErrorHandler(event:ErrorEvent):void{
var index:int = rslListLoader.getIndex();
var item:RSLItem = rslListLoader.getItem(index);
var rslEvent:RSLEvent = new RSLEvent(RSLEvent.RSL_ERROR);
rslEvent.bytesLoaded = 0;
rslEvent.bytesTotal = 0;
rslEvent.rslIndex = index;
rslEvent.rslTotal = rslListLoader.getItemCount();
rslEvent.url = item.urlRequest;
rslEvent.errorText = decodeURI(event.text);
dispatchEvent(rslEvent);
}
public function initialize(showDisplay:Boolean, displayClassName:Class, backgroundColor:uint, backgroundAlpha:Number, backgroundImage:Object, backgroundSize:String, displayWidth:Number, displayHeight:Number, libs:Array=null, sizes:Array=null, rslList:Array=null, resourceModuleURLs:Array=null):void{
var n:int;
var i:int;
var node:RSLItem;
var resourceModuleNode:ResourceModuleRSLItem;
if (((((!((libs == null))) || (!((sizes == null))))) && (!((rslList == null))))){
throw (new Error("RSLs may only be specified by using libs and sizes or rslList, not both."));
};
root.loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
if (((libs) && ((libs.length > 0)))){
if (rslList == null){
rslList = [];
};
n = libs.length;
i = 0;
while (i < n) {
node = new RSLItem(libs[i]);
rslList.push(node);
i++;
};
};
if (((resourceModuleURLs) && ((resourceModuleURLs.length > 0)))){
n = resourceModuleURLs.length;
i = 0;
while (i < n) {
resourceModuleNode = new ResourceModuleRSLItem(resourceModuleURLs[i]);
rslList.push(resourceModuleNode);
i++;
};
};
rslListLoader = new RSLListLoader(rslList);
this.showDisplay = showDisplay;
timer = new Timer(10);
timer.addEventListener(TimerEvent.TIMER, timerHandler);
timer.start();
if (showDisplay){
displayClass = new (displayClassName);
displayClass.addEventListener(Event.COMPLETE, displayClassCompleteHandler);
addChild(DisplayObject(displayClass));
displayClass.backgroundColor = backgroundColor;
displayClass.backgroundAlpha = backgroundAlpha;
displayClass.backgroundImage = backgroundImage;
displayClass.backgroundSize = backgroundSize;
displayClass.stageWidth = displayWidth;
displayClass.stageHeight = displayHeight;
displayClass.initialize();
displayClass.preloader = this;
};
if (rslListLoader.getItemCount() > 0){
rslListLoader.load(mx_internal::rslProgressHandler, mx_internal::rslCompleteHandler, mx_internal::rslErrorHandler, mx_internal::rslErrorHandler, mx_internal::rslErrorHandler);
} else {
rslDone = true;
};
}
mx_internal function rslProgressHandler(event:ProgressEvent):void{
var index:int = rslListLoader.getIndex();
var item:RSLItem = rslListLoader.getItem(index);
var rslEvent:RSLEvent = new RSLEvent(RSLEvent.RSL_PROGRESS);
rslEvent.bytesLoaded = event.bytesLoaded;
rslEvent.bytesTotal = event.bytesTotal;
rslEvent.rslIndex = index;
rslEvent.rslTotal = rslListLoader.getItemCount();
rslEvent.url = item.urlRequest;
dispatchEvent(rslEvent);
}
public function registerApplication(app:IEventDispatcher):void{
app.addEventListener("validatePropertiesComplete", appProgressHandler);
app.addEventListener("validateSizeComplete", appProgressHandler);
app.addEventListener("validateDisplayListComplete", appProgressHandler);
app.addEventListener(FlexEvent.CREATION_COMPLETE, appCreationCompleteHandler);
this.app = app;
}
mx_internal function rslCompleteHandler(event:Event):void{
var index:int = rslListLoader.getIndex();
var item:RSLItem = rslListLoader.getItem(index);
var rslEvent:RSLEvent = new RSLEvent(RSLEvent.RSL_COMPLETE);
rslEvent.bytesLoaded = item.total;
rslEvent.bytesTotal = item.total;
rslEvent.rslIndex = index;
rslEvent.rslTotal = rslListLoader.getItemCount();
rslEvent.url = item.urlRequest;
dispatchEvent(rslEvent);
rslDone = ((index + 1) == rslEvent.rslTotal);
}
private function timerHandler(event:TimerEvent):void{
if (!root){
return;
};
var bytes:Object = getByteValues();
var loaded:int = bytes.loaded;
var total:int = bytes.total;
dispatchEvent(new ProgressEvent(ProgressEvent.PROGRESS, false, false, loaded, total));
if (((rslDone) && ((((((((loaded >= total)) && ((total > 0)))) || ((((total == 0)) && ((loaded > 0)))))) || ((((((root is MovieClip)) && ((MovieClip(root).totalFrames > 2)))) && ((MovieClip(root).framesLoaded >= 2)))))))){
timer.removeEventListener(TimerEvent.TIMER, timerHandler);
timer.reset();
dispatchEvent(new Event(Event.COMPLETE));
dispatchEvent(new FlexEvent(FlexEvent.INIT_PROGRESS));
};
}
private function displayClassCompleteHandler(event:Event):void{
if (displayClass){
displayClass.removeEventListener(Event.COMPLETE, displayClassCompleteHandler);
};
if (root){
root.loaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
};
if (app){
app.removeEventListener("validatePropertiesComplete", appProgressHandler);
app.removeEventListener("validateSizeComplete", appProgressHandler);
app.removeEventListener("validateDisplayListComplete", appProgressHandler);
app.removeEventListener(FlexEvent.CREATION_COMPLETE, appCreationCompleteHandler);
app = null;
};
dispatchEvent(new FlexEvent(FlexEvent.PRELOADER_DONE));
}
}
}//package mx.preloaders
Section 265
//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 266
//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.2.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.2.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.2.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.2.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 267
//IResourceModule (mx.resources.IResourceModule)
package mx.resources {
public interface IResourceModule {
function get resourceBundles():Array;
}
}//package mx.resources
Section 268
//LocaleSorter (mx.resources.LocaleSorter)
package mx.resources {
import mx.core.*;
public class LocaleSorter {
mx_internal static const VERSION:String = "3.2.0.3958";
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];
Array.prototype.push.apply(stack, extended_langs);
if (script != ""){
stack.push(script);
};
if (region != ""){
stack.push(region);
};
Array.prototype.push.apply(stack, variants);
for (i in extensions) {
if (extensions.hasOwnProperty(i)){
stack.push(i);
Array.prototype.push.apply(stack, extensions[i]);
};
};
if (privates.length > 0){
stack.push("x");
Array.prototype.push.apply(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);
}
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 269
//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.2.0.3958";
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 270
//ResourceManager (mx.resources.ResourceManager)
package mx.resources {
import mx.core.*;
public class ResourceManager {
mx_internal static const VERSION:String = "3.2.0.3958";
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 271
//ResourceManagerImpl (mx.resources.ResourceManagerImpl)
package mx.resources {
import mx.core.*;
import flash.events.*;
import mx.events.*;
import flash.system.*;
import mx.modules.*;
import flash.utils.*;
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.2.0.3958";
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{
throw (new Error("unloadResourceModule() is not yet implemented."));
}
public static function getInstance():IResourceManager{
if (!instance){
instance = new (ResourceManagerImpl);
};
return (instance);
}
}
}//package mx.resources
import flash.events.*;
import mx.events.*;
import mx.modules.*;
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 272
//IResponder (mx.rpc.IResponder)
package mx.rpc {
public interface IResponder {
function fault(:Object):void;
function result(:Object):void;
}
}//package mx.rpc
Section 273
//ApplicationBackground (mx.skins.halo.ApplicationBackground)
package mx.skins.halo {
import flash.display.*;
import mx.skins.*;
import mx.utils.*;
public class ApplicationBackground extends ProgrammaticSkin {
mx_internal static const VERSION:String = "3.2.0.3958";
public function ApplicationBackground(){
super();
}
override public function get measuredWidth():Number{
return (8);
}
override public function get measuredHeight():Number{
return (8);
}
override protected function updateDisplayList(w:Number, h:Number):void{
var bgColor:uint;
super.updateDisplayList(w, h);
var g:Graphics = graphics;
var fillColors:Array = getStyle("backgroundGradientColors");
var fillAlphas:Array = getStyle("backgroundGradientAlphas");
if (!fillColors){
bgColor = getStyle("backgroundColor");
if (isNaN(bgColor)){
bgColor = 0xFFFFFF;
};
fillColors = [];
fillColors[0] = ColorUtil.adjustBrightness(bgColor, 15);
fillColors[1] = ColorUtil.adjustBrightness(bgColor, -25);
};
if (!fillAlphas){
fillAlphas = [1, 1];
};
g.clear();
drawRoundRect(0, 0, w, h, 0, fillColors, fillAlphas, verticalGradientMatrix(0, 0, w, h));
}
}
}//package mx.skins.halo
Section 274
//BusyCursor (mx.skins.halo.BusyCursor)
package mx.skins.halo {
import flash.display.*;
import mx.core.*;
import flash.events.*;
import mx.styles.*;
public class BusyCursor extends FlexSprite {
private var hourHand:Shape;
private var minuteHand:Shape;
mx_internal static const VERSION:String = "3.2.0.3958";
public function BusyCursor(){
var g:Graphics;
super();
var cursorManagerStyleDeclaration:CSSStyleDeclaration = StyleManager.getStyleDeclaration("CursorManager");
var cursorClass:Class = cursorManagerStyleDeclaration.getStyle("busyCursorBackground");
var cursorHolder:DisplayObject = new (cursorClass);
if ((cursorHolder is InteractiveObject)){
InteractiveObject(cursorHolder).mouseEnabled = false;
};
addChild(cursorHolder);
var xOff:Number = -0.5;
var yOff:Number = -0.5;
minuteHand = new FlexShape();
minuteHand.name = "minuteHand";
g = minuteHand.graphics;
g.beginFill(0);
g.moveTo(xOff, yOff);
g.lineTo((1 + xOff), (0 + yOff));
g.lineTo((1 + xOff), (5 + yOff));
g.lineTo((0 + xOff), (5 + yOff));
g.lineTo((0 + xOff), (0 + yOff));
g.endFill();
addChild(minuteHand);
hourHand = new FlexShape();
hourHand.name = "hourHand";
g = hourHand.graphics;
g.beginFill(0);
g.moveTo(xOff, yOff);
g.lineTo((4 + xOff), (0 + yOff));
g.lineTo((4 + xOff), (1 + yOff));
g.lineTo((0 + xOff), (1 + yOff));
g.lineTo((0 + xOff), (0 + yOff));
g.endFill();
addChild(hourHand);
addEventListener(Event.ADDED, handleAdded);
addEventListener(Event.REMOVED, handleRemoved);
}
private function enterFrameHandler(event:Event):void{
minuteHand.rotation = (minuteHand.rotation + 12);
hourHand.rotation = (hourHand.rotation + 1);
}
private function handleAdded(event:Event):void{
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
private function handleRemoved(event:Event):void{
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
}
}//package mx.skins.halo
Section 275
//ButtonSkin (mx.skins.halo.ButtonSkin)
package mx.skins.halo {
import flash.display.*;
import mx.core.*;
import mx.styles.*;
import mx.skins.*;
import mx.utils.*;
public class ButtonSkin extends Border {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var cache:Object = {};
public function ButtonSkin(){
super();
}
override public function get measuredWidth():Number{
return (UIComponent.DEFAULT_MEASURED_MIN_WIDTH);
}
override public function get measuredHeight():Number{
return (UIComponent.DEFAULT_MEASURED_MIN_HEIGHT);
}
override protected function updateDisplayList(w:Number, h:Number):void{
var tmp:Number;
var upFillColors:Array;
var upFillAlphas:Array;
var overFillColors:Array;
var overFillAlphas:Array;
var disFillColors:Array;
var disFillAlphas:Array;
super.updateDisplayList(w, h);
var borderColor:uint = getStyle("borderColor");
var cornerRadius:Number = getStyle("cornerRadius");
var fillAlphas:Array = getStyle("fillAlphas");
var fillColors:Array = getStyle("fillColors");
StyleManager.getColorNames(fillColors);
var highlightAlphas:Array = getStyle("highlightAlphas");
var themeColor:uint = getStyle("themeColor");
var derStyles:Object = calcDerivedStyles(themeColor, fillColors[0], fillColors[1]);
var borderColorDrk1:Number = ColorUtil.adjustBrightness2(borderColor, -50);
var themeColorDrk1:Number = ColorUtil.adjustBrightness2(themeColor, -25);
var emph:Boolean;
if ((parent is IButton)){
emph = IButton(parent).emphasized;
};
var cr:Number = Math.max(0, cornerRadius);
var cr1:Number = Math.max(0, (cornerRadius - 1));
var cr2:Number = Math.max(0, (cornerRadius - 2));
graphics.clear();
switch (name){
case "selectedUpSkin":
case "selectedOverSkin":
drawRoundRect(0, 0, w, h, cr, [themeColor, themeColorDrk1], 1, verticalGradientMatrix(0, 0, w, h));
drawRoundRect(1, 1, (w - 2), (h - 2), cr1, [fillColors[1], fillColors[1]], 1, verticalGradientMatrix(0, 0, (w - 2), (h - 2)));
break;
case "upSkin":
upFillColors = [fillColors[0], fillColors[1]];
upFillAlphas = [fillAlphas[0], fillAlphas[1]];
if (emph){
drawRoundRect(0, 0, w, h, cr, [themeColor, themeColorDrk1], 1, verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:2, y:2, w:(w - 4), h:(h - 4), r:(cornerRadius - 2)});
drawRoundRect(2, 2, (w - 4), (h - 4), cr2, upFillColors, upFillAlphas, verticalGradientMatrix(2, 2, (w - 2), (h - 2)));
drawRoundRect(2, 2, (w - 4), ((h - 4) / 2), {tl:cr2, tr:cr2, bl:0, br:0}, [0xFFFFFF, 0xFFFFFF], highlightAlphas, verticalGradientMatrix(1, 1, (w - 2), ((h - 2) / 2)));
} else {
drawRoundRect(0, 0, w, h, cr, [borderColor, borderColorDrk1], 1, verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 2), h:(h - 2), r:(cornerRadius - 1)});
drawRoundRect(1, 1, (w - 2), (h - 2), cr1, upFillColors, upFillAlphas, verticalGradientMatrix(1, 1, (w - 2), (h - 2)));
drawRoundRect(1, 1, (w - 2), ((h - 2) / 2), {tl:cr1, tr:cr1, bl:0, br:0}, [0xFFFFFF, 0xFFFFFF], highlightAlphas, verticalGradientMatrix(1, 1, (w - 2), ((h - 2) / 2)));
};
break;
case "overSkin":
if (fillColors.length > 2){
overFillColors = [fillColors[2], fillColors[3]];
} else {
overFillColors = [fillColors[0], fillColors[1]];
};
if (fillAlphas.length > 2){
overFillAlphas = [fillAlphas[2], fillAlphas[3]];
} else {
overFillAlphas = [fillAlphas[0], fillAlphas[1]];
};
drawRoundRect(0, 0, w, h, cr, [themeColor, themeColorDrk1], 1, verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 2), h:(h - 2), r:(cornerRadius - 1)});
drawRoundRect(1, 1, (w - 2), (h - 2), cr1, overFillColors, overFillAlphas, verticalGradientMatrix(1, 1, (w - 2), (h - 2)));
drawRoundRect(1, 1, (w - 2), ((h - 2) / 2), {tl:cr1, tr:cr1, bl:0, br:0}, [0xFFFFFF, 0xFFFFFF], highlightAlphas, verticalGradientMatrix(1, 1, (w - 2), ((h - 2) / 2)));
break;
case "downSkin":
case "selectedDownSkin":
drawRoundRect(0, 0, w, h, cr, [themeColor, themeColorDrk1], 1, verticalGradientMatrix(0, 0, w, h));
drawRoundRect(1, 1, (w - 2), (h - 2), cr1, [derStyles.fillColorPress1, derStyles.fillColorPress2], 1, verticalGradientMatrix(1, 1, (w - 2), (h - 2)));
drawRoundRect(2, 2, (w - 4), ((h - 4) / 2), {tl:cr2, tr:cr2, bl:0, br:0}, [0xFFFFFF, 0xFFFFFF], highlightAlphas, verticalGradientMatrix(1, 1, (w - 2), ((h - 2) / 2)));
break;
case "disabledSkin":
case "selectedDisabledSkin":
disFillColors = [fillColors[0], fillColors[1]];
disFillAlphas = [Math.max(0, (fillAlphas[0] - 0.15)), Math.max(0, (fillAlphas[1] - 0.15))];
drawRoundRect(0, 0, w, h, cr, [borderColor, borderColorDrk1], 0.5, verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 2), h:(h - 2), r:(cornerRadius - 1)});
drawRoundRect(1, 1, (w - 2), (h - 2), cr1, disFillColors, disFillAlphas, verticalGradientMatrix(1, 1, (w - 2), (h - 2)));
break;
};
}
private static function calcDerivedStyles(themeColor:uint, fillColor0:uint, fillColor1:uint):Object{
var o:Object;
var key:String = HaloColors.getCacheKey(themeColor, fillColor0, fillColor1);
if (!cache[key]){
o = (cache[key] = {});
HaloColors.addHaloColors(o, themeColor, fillColor0, fillColor1);
};
return (cache[key]);
}
}
}//package mx.skins.halo
Section 276
//HaloBorder (mx.skins.halo.HaloBorder)
package mx.skins.halo {
import flash.display.*;
import mx.core.*;
import mx.graphics.*;
import mx.styles.*;
import mx.skins.*;
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.2.0.3958";
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 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){
bottomRadius = (bRoundedCorners) ? radius : 0;
radiusObj = {tl:radius, tr:radius, 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 277
//HaloColors (mx.skins.halo.HaloColors)
package mx.skins.halo {
import mx.utils.*;
public class HaloColors {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var cache:Object = {};
public function HaloColors(){
super();
}
public static function getCacheKey(... _args):String{
return (_args.join(","));
}
public static function addHaloColors(colors:Object, themeColor:uint, fillColor0:uint, fillColor1:uint):void{
var key:String = getCacheKey(themeColor, fillColor0, fillColor1);
var o:Object = cache[key];
if (!o){
o = (cache[key] = {});
o.themeColLgt = ColorUtil.adjustBrightness(themeColor, 100);
o.themeColDrk1 = ColorUtil.adjustBrightness(themeColor, -75);
o.themeColDrk2 = ColorUtil.adjustBrightness(themeColor, -25);
o.fillColorBright1 = ColorUtil.adjustBrightness2(fillColor0, 15);
o.fillColorBright2 = ColorUtil.adjustBrightness2(fillColor1, 15);
o.fillColorPress1 = ColorUtil.adjustBrightness2(themeColor, 85);
o.fillColorPress2 = ColorUtil.adjustBrightness2(themeColor, 60);
o.bevelHighlight1 = ColorUtil.adjustBrightness2(fillColor0, 40);
o.bevelHighlight2 = ColorUtil.adjustBrightness2(fillColor1, 40);
};
colors.themeColLgt = o.themeColLgt;
colors.themeColDrk1 = o.themeColDrk1;
colors.themeColDrk2 = o.themeColDrk2;
colors.fillColorBright1 = o.fillColorBright1;
colors.fillColorBright2 = o.fillColorBright2;
colors.fillColorPress1 = o.fillColorPress1;
colors.fillColorPress2 = o.fillColorPress2;
colors.bevelHighlight1 = o.bevelHighlight1;
colors.bevelHighlight2 = o.bevelHighlight2;
}
}
}//package mx.skins.halo
Section 278
//HaloFocusRect (mx.skins.halo.HaloFocusRect)
package mx.skins.halo {
import flash.display.*;
import mx.styles.*;
import mx.skins.*;
import mx.utils.*;
public class HaloFocusRect extends ProgrammaticSkin implements IStyleClient {
private var _focusColor:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
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();
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 279
//PanelSkin (mx.skins.halo.PanelSkin)
package mx.skins.halo {
import flash.display.*;
import mx.core.*;
import flash.utils.*;
public class PanelSkin extends HaloBorder {
private var oldControlBarHeight:Number;
protected var _panelBorderMetrics:EdgeMetrics;
private var oldHeaderHeight:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var panels:Object = {};
public function PanelSkin(){
super();
}
override public function styleChanged(styleProp:String):void{
super.styleChanged(styleProp);
if ((((((((((((((((((styleProp == null)) || ((styleProp == "styleName")))) || ((styleProp == "borderStyle")))) || ((styleProp == "borderThickness")))) || ((styleProp == "borderThicknessTop")))) || ((styleProp == "borderThicknessBottom")))) || ((styleProp == "borderThicknessLeft")))) || ((styleProp == "borderThicknessRight")))) || ((styleProp == "borderSides")))){
_panelBorderMetrics = null;
};
invalidateDisplayList();
}
override mx_internal function drawBorder(w:Number, h:Number):void{
var contentAlpha:Number;
var backgroundAlpha:Number;
var br:Number;
var g:Graphics;
var parentContainer:IContainer;
var vm:EdgeMetrics;
super.drawBorder(w, h);
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
return;
};
var borderStyle:String = getStyle("borderStyle");
if (borderStyle == "default"){
contentAlpha = getStyle("backgroundAlpha");
backgroundAlpha = getStyle("borderAlpha");
backgroundAlphaName = "borderAlpha";
radiusObj = null;
radius = getStyle("cornerRadius");
bRoundedCorners = (getStyle("roundedBottomCorners").toString().toLowerCase() == "true");
br = (bRoundedCorners) ? radius : 0;
g = graphics;
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");
};
}
override public function get borderMetrics():EdgeMetrics{
var newControlBarHeight:Number;
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
return (super.borderMetrics);
};
var hasPanelParent:Boolean = isPanel(parent);
var controlBar:IUIComponent = (hasPanelParent) ? Object(parent)._controlBar : null;
var hHeight:Number = (hasPanelParent) ? Object(parent).getHeaderHeightProxy() : NaN;
if (((controlBar) && (controlBar.includeInLayout))){
newControlBarHeight = controlBar.getExplicitOrMeasuredHeight();
};
if (((!((newControlBarHeight == oldControlBarHeight))) && (!(((isNaN(oldControlBarHeight)) && (isNaN(newControlBarHeight))))))){
_panelBorderMetrics = null;
};
if (((!((hHeight == oldHeaderHeight))) && (!(((isNaN(hHeight)) && (isNaN(oldHeaderHeight))))))){
_panelBorderMetrics = null;
};
if (_panelBorderMetrics){
return (_panelBorderMetrics);
};
var o:EdgeMetrics = super.borderMetrics;
var vm:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
var bt:Number = getStyle("borderThickness");
var btl:Number = getStyle("borderThicknessLeft");
var btt:Number = getStyle("borderThicknessTop");
var btr:Number = getStyle("borderThicknessRight");
var btb:Number = getStyle("borderThicknessBottom");
vm.left = (o.left + (isNaN(btl)) ? bt : btl);
vm.top = (o.top + (isNaN(btt)) ? bt : btt);
vm.right = (o.bottom + (isNaN(btr)) ? bt : btr);
vm.bottom = (o.bottom + (isNaN(btb)) ? (((controlBar) && (!(isNaN(btt))))) ? btt : (isNaN(btl)) ? bt : btl : btb);
oldHeaderHeight = hHeight;
if (!isNaN(hHeight)){
vm.top = (vm.top + hHeight);
};
oldControlBarHeight = newControlBarHeight;
if (!isNaN(newControlBarHeight)){
vm.bottom = (vm.bottom + newControlBarHeight);
};
_panelBorderMetrics = vm;
return (_panelBorderMetrics);
}
override mx_internal function drawBackground(w:Number, h:Number):void{
var highlightAlphas:Array;
var highlightAlpha:Number;
super.drawBackground(w, h);
if ((((getStyle("headerColors") == null)) && ((getStyle("borderStyle") == "default")))){
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}});
};
}
override mx_internal function getBackgroundColorMetrics():EdgeMetrics{
if (getStyle("borderStyle") == "default"){
return (EdgeMetrics.EMPTY);
};
return (super.borderMetrics);
}
private static function isPanel(parent:Object):Boolean{
var s:String;
var x:XML;
var parent = parent;
s = getQualifiedClassName(parent);
if (panels[s] == 1){
return (true);
};
if (panels[s] == 0){
return (false);
};
if (s == "mx.containers::Panel"){
(panels[s] == 1);
return (true);
};
x = describeType(parent);
var xmllist:XMLList = x.extendsClass.(@type == "mx.containers::Panel");
if (xmllist.length() == 0){
panels[s] = 0;
return (false);
};
panels[s] = 1;
return (true);
}
}
}//package mx.skins.halo
Section 280
//ScrollArrowSkin (mx.skins.halo.ScrollArrowSkin)
package mx.skins.halo {
import flash.display.*;
import mx.core.*;
import mx.controls.scrollClasses.*;
import mx.styles.*;
import mx.skins.*;
import mx.utils.*;
public class ScrollArrowSkin extends Border {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var cache:Object = {};
public function ScrollArrowSkin(){
super();
}
override public function get measuredWidth():Number{
return (ScrollBar.THICKNESS);
}
override public function get measuredHeight():Number{
return (ScrollBar.THICKNESS);
}
override protected function updateDisplayList(w:Number, h:Number):void{
var borderColors:Array;
var upFillColors:Array;
var upFillAlphas:Array;
var overFillColors:Array;
var overFillAlphas:Array;
var disFillColors:Array;
var disFillAlphas:Array;
super.updateDisplayList(w, h);
var backgroundColor:Number = getStyle("backgroundColor");
var borderColor:uint = getStyle("borderColor");
var fillAlphas:Array = getStyle("fillAlphas");
var fillColors:Array = getStyle("fillColors");
StyleManager.getColorNames(fillColors);
var highlightAlphas:Array = getStyle("highlightAlphas");
var themeColor:uint = getStyle("themeColor");
var upArrow = (name.charAt(0) == "u");
var arrowColor:uint = getStyle("iconColor");
var derStyles:Object = calcDerivedStyles(themeColor, borderColor, fillColors[0], fillColors[1]);
var horizontal:Boolean = ((((parent) && (parent.parent))) && (!((parent.parent.rotation == 0))));
if (((upArrow) && (!(horizontal)))){
borderColors = [borderColor, derStyles.borderColorDrk1];
} else {
borderColors = [derStyles.borderColorDrk1, derStyles.borderColorDrk2];
};
var g:Graphics = graphics;
g.clear();
if (isNaN(backgroundColor)){
backgroundColor = 0xFFFFFF;
};
if ((((FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0)) || ((name.indexOf("Disabled") == -1)))){
drawRoundRect(0, 0, w, h, 0, backgroundColor, 1);
};
switch (name){
case "upArrowUpSkin":
if (!horizontal){
drawRoundRect(1, (h - 4), (w - 2), 8, 0, [derStyles.borderColorDrk1, derStyles.borderColorDrk1], [1, 0], verticalGradientMatrix(1, (h - 4), (w - 2), 8), GradientType.LINEAR, null, {x:1, y:(h - 4), w:(w - 2), h:4, r:0});
};
case "downArrowUpSkin":
upFillColors = [fillColors[0], fillColors[1]];
upFillAlphas = [fillAlphas[0], fillAlphas[1]];
drawRoundRect(0, 0, w, h, 0, borderColors, 1, (horizontal) ? horizontalGradientMatrix(0, 0, w, h) : verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 2), h:(h - 2), r:0});
drawRoundRect(1, 1, (w - 2), (h - 2), 0, upFillColors, upFillAlphas, (horizontal) ? horizontalGradientMatrix(0, 0, (w - 2), (h - 2)) : verticalGradientMatrix(0, 0, (w - 2), (h - (2 / 2))));
drawRoundRect(1, 1, (w - 2), (h - (2 / 2)), 0, [0xFFFFFF, 0xFFFFFF], highlightAlphas, (horizontal) ? horizontalGradientMatrix(0, 0, (w - 2), (h - 2)) : verticalGradientMatrix(0, 0, (w - 2), (h - (2 / 2))));
break;
case "upArrowOverSkin":
if (!horizontal){
drawRoundRect(1, (h - 4), (w - 2), 8, 0, [derStyles.borderColorDrk1, derStyles.borderColorDrk1], [1, 0], verticalGradientMatrix(1, (h - 4), (w - 2), 8), GradientType.LINEAR, null, {x:1, y:(h - 4), w:(w - 2), h:4, r:0});
};
case "downArrowOverSkin":
if (fillColors.length > 2){
overFillColors = [fillColors[2], fillColors[3]];
} else {
overFillColors = [fillColors[0], fillColors[1]];
};
if (fillAlphas.length > 2){
overFillAlphas = [fillAlphas[2], fillAlphas[3]];
} else {
overFillAlphas = [fillAlphas[0], fillAlphas[1]];
};
drawRoundRect(0, 0, w, h, 0, 0xFFFFFF, 1);
drawRoundRect(0, 0, w, h, 0, [themeColor, derStyles.themeColDrk1], 1, (horizontal) ? horizontalGradientMatrix(0, 0, w, h) : verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 2), h:(h - 2), r:0});
drawRoundRect(1, 1, (w - 2), (h - 2), 0, overFillColors, overFillAlphas, (horizontal) ? horizontalGradientMatrix(0, 0, (w - 2), (h - 2)) : verticalGradientMatrix(0, 0, (w - 2), (h - 2)));
drawRoundRect(1, 1, (w - 2), (h - (2 / 2)), 0, [0xFFFFFF, 0xFFFFFF], highlightAlphas, (horizontal) ? horizontalGradientMatrix(0, 0, (w - 2), (h - 2)) : verticalGradientMatrix(0, 0, (w - 2), (h - (2 / 2))));
break;
case "upArrowDownSkin":
if (!horizontal){
drawRoundRect(1, (h - 4), (w - 2), 8, 0, [derStyles.borderColorDrk1, derStyles.borderColorDrk1], [1, 0], (horizontal) ? horizontalGradientMatrix(1, (h - 4), (w - 2), 8) : verticalGradientMatrix(1, (h - 4), (w - 2), 8), GradientType.LINEAR, null, {x:1, y:(h - 4), w:(w - 2), h:4, r:0});
};
case "downArrowDownSkin":
drawRoundRect(0, 0, w, h, 0, [themeColor, derStyles.themeColDrk1], 1, (horizontal) ? horizontalGradientMatrix(0, 0, w, h) : verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 2), h:(h - 2), r:0});
drawRoundRect(1, 1, (w - 2), (h - 2), 0, [derStyles.fillColorPress1, derStyles.fillColorPress2], 1, (horizontal) ? horizontalGradientMatrix(0, 0, (w - 2), (h - 2)) : verticalGradientMatrix(0, 0, (w - 2), (h - 2)));
drawRoundRect(1, 1, (w - 2), (h - (2 / 2)), 0, [0xFFFFFF, 0xFFFFFF], highlightAlphas, (horizontal) ? horizontalGradientMatrix(0, 0, (w - 2), (h - 2)) : verticalGradientMatrix(0, 0, (w - 2), (h - (2 / 2))));
break;
case "upArrowDisabledSkin":
if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0){
if (!horizontal){
drawRoundRect(1, (h - 4), (w - 2), 8, 0, [derStyles.borderColorDrk1, derStyles.borderColorDrk1], [0.5, 0], verticalGradientMatrix(1, (h - 4), (w - 2), 8), GradientType.LINEAR, null, {x:1, y:(h - 4), w:(w - 2), h:4, r:0});
};
};
case "downArrowDisabledSkin":
if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0){
disFillColors = [fillColors[0], fillColors[1]];
disFillAlphas = [(fillAlphas[0] - 0.15), (fillAlphas[1] - 0.15)];
drawRoundRect(0, 0, w, h, 0, borderColors, 0.5, (horizontal) ? horizontalGradientMatrix(0, 0, w, h) : verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 2), h:(h - 2), r:0});
drawRoundRect(1, 1, (w - 2), (h - 2), 0, disFillColors, disFillAlphas, (horizontal) ? horizontalGradientMatrix(0, 0, (w - 2), (h - 2)) : verticalGradientMatrix(0, 0, (w - 2), (h - (2 / 2))));
arrowColor = getStyle("disabledIconColor");
} else {
drawRoundRect(0, 0, w, h, 0, 0xFFFFFF, 0);
return;
};
break;
default:
drawRoundRect(0, 0, w, h, 0, 0xFFFFFF, 0);
return;
};
g.beginFill(arrowColor);
if (upArrow){
g.moveTo((w / 2), 6);
g.lineTo((w - 5), (h - 6));
g.lineTo(5, (h - 6));
g.lineTo((w / 2), 6);
} else {
g.moveTo((w / 2), (h - 6));
g.lineTo((w - 5), 6);
g.lineTo(5, 6);
g.lineTo((w / 2), (h - 6));
};
g.endFill();
}
private static function calcDerivedStyles(themeColor:uint, borderColor:uint, fillColor0:uint, fillColor1:uint):Object{
var o:Object;
var key:String = HaloColors.getCacheKey(themeColor, borderColor, fillColor0, fillColor1);
if (!cache[key]){
o = (cache[key] = {});
HaloColors.addHaloColors(o, themeColor, fillColor0, fillColor1);
o.borderColorDrk1 = ColorUtil.adjustBrightness2(borderColor, -25);
o.borderColorDrk2 = ColorUtil.adjustBrightness2(borderColor, -50);
};
return (cache[key]);
}
}
}//package mx.skins.halo
Section 281
//ScrollThumbSkin (mx.skins.halo.ScrollThumbSkin)
package mx.skins.halo {
import flash.display.*;
import mx.styles.*;
import mx.skins.*;
import mx.utils.*;
public class ScrollThumbSkin extends Border {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var cache:Object = {};
public function ScrollThumbSkin(){
super();
}
override public function get measuredWidth():Number{
return (16);
}
override public function get measuredHeight():Number{
return (10);
}
override protected function updateDisplayList(w:Number, h:Number):void{
var upFillColors:Array;
var upFillAlphas:Array;
var overFillColors:Array;
var overFillAlphas:Array;
super.updateDisplayList(w, h);
var backgroundColor:Number = getStyle("backgroundColor");
var borderColor:uint = getStyle("borderColor");
var cornerRadius:Number = getStyle("cornerRadius");
var fillAlphas:Array = getStyle("fillAlphas");
var fillColors:Array = getStyle("fillColors");
StyleManager.getColorNames(fillColors);
var highlightAlphas:Array = getStyle("highlightAlphas");
var themeColor:uint = getStyle("themeColor");
var gripColor:uint = 7305079;
var derStyles:Object = calcDerivedStyles(themeColor, borderColor, fillColors[0], fillColors[1]);
var radius:Number = Math.max((cornerRadius - 1), 0);
var cr:Object = {tl:0, tr:radius, bl:0, br:radius};
radius = Math.max((radius - 1), 0);
var cr1:Object = {tl:0, tr:radius, bl:0, br:radius};
var horizontal:Boolean = ((((parent) && (parent.parent))) && (!((parent.parent.rotation == 0))));
if (isNaN(backgroundColor)){
backgroundColor = 0xFFFFFF;
};
graphics.clear();
drawRoundRect(1, 0, (w - 3), h, cr, backgroundColor, 1);
switch (name){
case "thumbUpSkin":
default:
upFillColors = [fillColors[0], fillColors[1]];
upFillAlphas = [fillAlphas[0], fillAlphas[1]];
drawRoundRect(0, 0, w, h, 0, 0xFFFFFF, 0);
if (horizontal){
drawRoundRect(1, 0, (w - 2), h, cornerRadius, [derStyles.borderColorDrk1, derStyles.borderColorDrk1], [1, 0], horizontalGradientMatrix(2, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 4), h:(h - 2), r:cr1});
} else {
drawRoundRect(1, (h - radius), (w - 3), (radius + 4), {tl:0, tr:0, bl:0, br:radius}, [derStyles.borderColorDrk1, derStyles.borderColorDrk1], [1, 0], (horizontal) ? horizontalGradientMatrix(0, (h - 4), (w - 3), 8) : verticalGradientMatrix(0, (h - 4), (w - 3), 8), GradientType.LINEAR, null, {x:1, y:(h - radius), w:(w - 4), h:radius, r:{tl:0, tr:0, bl:0, br:(radius - 1)}});
};
drawRoundRect(1, 0, (w - 3), h, cr, [borderColor, derStyles.borderColorDrk1], 1, (horizontal) ? horizontalGradientMatrix(0, 0, w, h) : verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 4), h:(h - 2), r:cr1});
drawRoundRect(1, 1, (w - 4), (h - 2), cr1, upFillColors, upFillAlphas, (horizontal) ? horizontalGradientMatrix(1, 0, (w - 2), (h - 2)) : verticalGradientMatrix(1, 0, (w - 2), (h - 2)));
if (horizontal){
drawRoundRect(1, 0, ((w - 4) / 2), (h - 2), 0, [0xFFFFFF, 0xFFFFFF], highlightAlphas, horizontalGradientMatrix(1, 1, (w - 4), ((h - 2) / 2)));
} else {
drawRoundRect(1, 1, (w - 4), ((h - 2) / 2), cr1, [0xFFFFFF, 0xFFFFFF], highlightAlphas, (horizontal) ? horizontalGradientMatrix(1, 0, ((w - 4) / 2), (h - 2)) : verticalGradientMatrix(1, 1, (w - 4), ((h - 2) / 2)));
};
break;
case "thumbOverSkin":
if (fillColors.length > 2){
overFillColors = [fillColors[2], fillColors[3]];
} else {
overFillColors = [fillColors[0], fillColors[1]];
};
if (fillAlphas.length > 2){
overFillAlphas = [fillAlphas[2], fillAlphas[3]];
} else {
overFillAlphas = [fillAlphas[0], fillAlphas[1]];
};
drawRoundRect(0, 0, w, h, 0, 0xFFFFFF, 0);
if (horizontal){
drawRoundRect(1, 0, (w - 2), h, cornerRadius, [derStyles.borderColorDrk1, derStyles.borderColorDrk1], [1, 0], horizontalGradientMatrix(2, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 4), h:(h - 2), r:cr1});
} else {
drawRoundRect(1, (h - radius), (w - 3), (radius + 4), {tl:0, tr:0, bl:0, br:radius}, [derStyles.borderColorDrk1, derStyles.borderColorDrk1], [1, 0], (horizontal) ? horizontalGradientMatrix(0, (h - 4), (w - 3), 8) : verticalGradientMatrix(0, (h - 4), (w - 3), 8), GradientType.LINEAR, null, {x:1, y:(h - radius), w:(w - 4), h:radius, r:{tl:0, tr:0, bl:0, br:(radius - 1)}});
};
drawRoundRect(1, 0, (w - 3), h, cr, [themeColor, derStyles.themeColDrk1], 1, (horizontal) ? horizontalGradientMatrix(1, 0, w, h) : verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 4), h:(h - 2), r:cr1});
drawRoundRect(1, 1, (w - 4), (h - 2), cr1, overFillColors, overFillAlphas, (horizontal) ? horizontalGradientMatrix(1, 0, w, h) : verticalGradientMatrix(1, 0, w, h));
break;
case "thumbDownSkin":
if (horizontal){
drawRoundRect(1, 0, (w - 2), h, cr, [derStyles.borderColorDrk1, derStyles.borderColorDrk1], [1, 0], horizontalGradientMatrix(2, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 4), h:(h - 2), r:cr1});
} else {
drawRoundRect(1, (h - radius), (w - 3), (radius + 4), {tl:0, tr:0, bl:0, br:radius}, [derStyles.borderColorDrk1, derStyles.borderColorDrk1], [1, 0], (horizontal) ? horizontalGradientMatrix(0, (h - 4), (w - 3), 8) : verticalGradientMatrix(0, (h - 4), (w - 3), 8), GradientType.LINEAR, null, {x:1, y:(h - radius), w:(w - 4), h:radius, r:{tl:0, tr:0, bl:0, br:(radius - 1)}});
};
drawRoundRect(1, 0, (w - 3), h, cr, [themeColor, derStyles.themeColDrk2], 1, (horizontal) ? horizontalGradientMatrix(1, 0, w, h) : verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 4), h:(h - 2), r:cr1});
drawRoundRect(1, 1, (w - 4), (h - 2), cr1, [derStyles.fillColorPress1, derStyles.fillColorPress2], 1, (horizontal) ? horizontalGradientMatrix(1, 0, w, h) : verticalGradientMatrix(1, 0, w, h));
break;
case "thumbDisabledSkin":
drawRoundRect(0, 0, w, h, 0, 0xFFFFFF, 0);
drawRoundRect(1, 0, (w - 3), h, cr, 0x999999, 0.5);
drawRoundRect(1, 1, (w - 4), (h - 2), cr1, 0xFFFFFF, 0.5);
break;
};
var gripW:Number = Math.floor(((w / 2) - 4));
drawRoundRect(gripW, Math.floor(((h / 2) - 4)), 5, 1, 0, 0, 0.4);
drawRoundRect(gripW, Math.floor(((h / 2) - 2)), 5, 1, 0, 0, 0.4);
drawRoundRect(gripW, Math.floor((h / 2)), 5, 1, 0, 0, 0.4);
drawRoundRect(gripW, Math.floor(((h / 2) + 2)), 5, 1, 0, 0, 0.4);
drawRoundRect(gripW, Math.floor(((h / 2) + 4)), 5, 1, 0, 0, 0.4);
}
private static function calcDerivedStyles(themeColor:uint, borderColor:uint, fillColor0:uint, fillColor1:uint):Object{
var o:Object;
var key:String = HaloColors.getCacheKey(themeColor, borderColor, fillColor0, fillColor1);
if (!cache[key]){
o = (cache[key] = {});
HaloColors.addHaloColors(o, themeColor, fillColor0, fillColor1);
o.borderColorDrk1 = ColorUtil.adjustBrightness2(borderColor, -50);
};
return (cache[key]);
}
}
}//package mx.skins.halo
Section 282
//ScrollTrackSkin (mx.skins.halo.ScrollTrackSkin)
package mx.skins.halo {
import flash.display.*;
import mx.core.*;
import mx.styles.*;
import mx.skins.*;
import mx.utils.*;
public class ScrollTrackSkin extends Border {
mx_internal static const VERSION:String = "3.2.0.3958";
public function ScrollTrackSkin(){
super();
}
override public function get measuredWidth():Number{
return (16);
}
override public function get measuredHeight():Number{
return (1);
}
override protected function updateDisplayList(w:Number, h:Number):void{
super.updateDisplayList(w, h);
var fillColors:Array = getStyle("trackColors");
StyleManager.getColorNames(fillColors);
var borderColor:uint = ColorUtil.adjustBrightness2(getStyle("borderColor"), -20);
var borderColorDrk1:uint = ColorUtil.adjustBrightness2(borderColor, -30);
graphics.clear();
var fillAlpha:Number = 1;
if ((((name == "trackDisabledSkin")) && ((FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0)))){
fillAlpha = 0.2;
};
drawRoundRect(0, 0, w, h, 0, [borderColor, borderColorDrk1], fillAlpha, verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 2), h:(h - 2), r:0});
drawRoundRect(1, 1, (w - 2), (h - 2), 0, fillColors, fillAlpha, horizontalGradientMatrix(1, 1, ((w / 3) * 2), (h - 2)));
}
}
}//package mx.skins.halo
Section 283
//TitleBackground (mx.skins.halo.TitleBackground)
package mx.skins.halo {
import flash.display.*;
import mx.styles.*;
import mx.skins.*;
import mx.utils.*;
public class TitleBackground extends ProgrammaticSkin {
mx_internal static const VERSION:String = "3.2.0.3958";
public function TitleBackground(){
super();
}
override protected function updateDisplayList(w:Number, h:Number):void{
super.updateDisplayList(w, h);
var borderAlpha:Number = getStyle("borderAlpha");
var cornerRadius:Number = getStyle("cornerRadius");
var highlightAlphas:Array = getStyle("highlightAlphas");
var headerColors:Array = getStyle("headerColors");
var showChrome = !((headerColors == null));
StyleManager.getColorNames(headerColors);
var colorDark:Number = ColorUtil.adjustBrightness2((headerColors) ? headerColors[1] : 0xFFFFFF, -20);
var g:Graphics = graphics;
g.clear();
if (h < 3){
return;
};
if (showChrome){
g.lineStyle(0, colorDark, borderAlpha);
g.moveTo(0, h);
g.lineTo(w, h);
g.lineStyle(0, 0, 0);
drawRoundRect(0, 0, w, h, {tl:cornerRadius, tr:cornerRadius, bl:0, br:0}, headerColors, borderAlpha, verticalGradientMatrix(0, 0, w, h));
drawRoundRect(0, 0, w, (h / 2), {tl:cornerRadius, tr:cornerRadius, bl:0, br:0}, [0xFFFFFF, 0xFFFFFF], highlightAlphas, verticalGradientMatrix(0, 0, w, (h / 2)));
drawRoundRect(0, 0, w, h, {tl:cornerRadius, tr:cornerRadius, bl:0, br:0}, 0xFFFFFF, highlightAlphas[0], null, GradientType.LINEAR, null, {x:0, y:1, w:w, h:(h - 1), r:{tl:cornerRadius, tr:cornerRadius, bl:0, br:0}});
};
}
}
}//package mx.skins.halo
Section 284
//ToolTipBorder (mx.skins.halo.ToolTipBorder)
package mx.skins.halo {
import flash.display.*;
import mx.core.*;
import mx.graphics.*;
import mx.skins.*;
import flash.filters.*;
public class ToolTipBorder extends RectangularBorder {
private var _borderMetrics:EdgeMetrics;
private var dropShadow:RectangularDropShadow;
mx_internal static const VERSION:String = "3.2.0.3958";
public function ToolTipBorder(){
super();
}
override public function get borderMetrics():EdgeMetrics{
if (_borderMetrics){
return (_borderMetrics);
};
var borderStyle:String = getStyle("borderStyle");
switch (borderStyle){
case "errorTipRight":
_borderMetrics = new EdgeMetrics(15, 1, 3, 3);
break;
case "errorTipAbove":
_borderMetrics = new EdgeMetrics(3, 1, 3, 15);
break;
case "errorTipBelow":
_borderMetrics = new EdgeMetrics(3, 13, 3, 3);
break;
default:
_borderMetrics = new EdgeMetrics(3, 1, 3, 3);
break;
};
return (_borderMetrics);
}
override protected function updateDisplayList(w:Number, h:Number):void{
super.updateDisplayList(w, h);
var borderStyle:String = getStyle("borderStyle");
var backgroundColor:uint = getStyle("backgroundColor");
var backgroundAlpha:Number = getStyle("backgroundAlpha");
var borderColor:uint = getStyle("borderColor");
var cornerRadius:Number = getStyle("cornerRadius");
var shadowColor:uint = getStyle("shadowColor");
var shadowAlpha:Number = 0.1;
var g:Graphics = graphics;
g.clear();
filters = [];
switch (borderStyle){
case "toolTip":
drawRoundRect(3, 1, (w - 6), (h - 4), cornerRadius, backgroundColor, backgroundAlpha);
if (!dropShadow){
dropShadow = new RectangularDropShadow();
};
dropShadow.distance = 3;
dropShadow.angle = 90;
dropShadow.color = 0;
dropShadow.alpha = 0.4;
dropShadow.tlRadius = (cornerRadius + 2);
dropShadow.trRadius = (cornerRadius + 2);
dropShadow.blRadius = (cornerRadius + 2);
dropShadow.brRadius = (cornerRadius + 2);
dropShadow.drawShadow(graphics, 3, 0, (w - 6), (h - 4));
break;
case "errorTipRight":
drawRoundRect(11, 0, (w - 11), (h - 2), 3, borderColor, backgroundAlpha);
g.beginFill(borderColor, backgroundAlpha);
g.moveTo(11, 7);
g.lineTo(0, 13);
g.lineTo(11, 19);
g.moveTo(11, 7);
g.endFill();
filters = [new DropShadowFilter(2, 90, 0, 0.4)];
break;
case "errorTipAbove":
drawRoundRect(0, 0, w, (h - 13), 3, borderColor, backgroundAlpha);
g.beginFill(borderColor, backgroundAlpha);
g.moveTo(9, (h - 13));
g.lineTo(15, (h - 2));
g.lineTo(21, (h - 13));
g.moveTo(9, (h - 13));
g.endFill();
filters = [new DropShadowFilter(2, 90, 0, 0.4)];
break;
case "errorTipBelow":
drawRoundRect(0, 11, w, (h - 13), 3, borderColor, backgroundAlpha);
g.beginFill(borderColor, backgroundAlpha);
g.moveTo(9, 11);
g.lineTo(15, 0);
g.lineTo(21, 11);
g.moveTo(10, 11);
g.endFill();
filters = [new DropShadowFilter(2, 90, 0, 0.4)];
break;
};
}
override public function styleChanged(styleProp:String):void{
if ((((((styleProp == "borderStyle")) || ((styleProp == "styleName")))) || ((styleProp == null)))){
_borderMetrics = null;
};
invalidateDisplayList();
}
}
}//package mx.skins.halo
Section 285
//Border (mx.skins.Border)
package mx.skins {
import mx.core.*;
public class Border extends ProgrammaticSkin implements IBorder {
mx_internal static const VERSION:String = "3.2.0.3958";
public function Border(){
super();
}
public function get borderMetrics():EdgeMetrics{
return (EdgeMetrics.EMPTY);
}
}
}//package mx.skins
Section 286
//ProgrammaticSkin (mx.skins.ProgrammaticSkin)
package mx.skins {
import flash.display.*;
import mx.core.*;
import flash.geom.*;
import mx.managers.*;
import mx.styles.*;
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.2.0.3958";
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 287
//RectangularBorder (mx.skins.RectangularBorder)
package mx.skins {
import flash.display.*;
import mx.core.*;
import flash.geom.*;
import flash.events.*;
import mx.resources.*;
import mx.styles.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
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.2.0.3958";
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{
_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 288
//IOverride (mx.states.IOverride)
package mx.states {
import mx.core.*;
public interface IOverride {
function initialize():void;
function remove(:UIComponent):void;
function apply(:UIComponent):void;
}
}//package mx.states
Section 289
//State (mx.states.State)
package mx.states {
import mx.core.*;
import flash.events.*;
import mx.events.*;
public class State extends EventDispatcher {
public var basedOn:String;
private var initialized:Boolean;// = false
public var overrides:Array;
public var name:String;
mx_internal static const VERSION:String = "3.2.0.3958";
public function State(){
overrides = [];
super();
}
mx_internal function initialize():void{
var i:int;
if (!initialized){
initialized = true;
i = 0;
while (i < overrides.length) {
IOverride(overrides[i]).initialize();
i++;
};
};
}
mx_internal function dispatchExitState():void{
dispatchEvent(new FlexEvent(FlexEvent.EXIT_STATE));
}
mx_internal function dispatchEnterState():void{
dispatchEvent(new FlexEvent(FlexEvent.ENTER_STATE));
}
}
}//package mx.states
Section 290
//Transition (mx.states.Transition)
package mx.states {
import mx.core.*;
import mx.effects.*;
public class Transition {
public var effect:IEffect;
public var toState:String;// = "*"
public var fromState:String;// = "*"
mx_internal static const VERSION:String = "3.2.0.3958";
public function Transition(){
super();
}
}
}//package mx.states
Section 291
//CSSStyleDeclaration (mx.styles.CSSStyleDeclaration)
package mx.styles {
import flash.display.*;
import mx.core.*;
import mx.managers.*;
import flash.events.*;
import flash.utils.*;
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.2.0.3958";
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 292
//ISimpleStyleClient (mx.styles.ISimpleStyleClient)
package mx.styles {
public interface ISimpleStyleClient {
function set styleName(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\styles;ISimpleStyleClient.as:Object):void;
function styleChanged(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\styles;ISimpleStyleClient.as:String):void;
function get styleName():Object;
}
}//package mx.styles
Section 293
//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 294
//IStyleManager (mx.styles.IStyleManager)
package mx.styles {
import flash.events.*;
public interface IStyleManager {
function isColorName(value:String):Boolean;
function registerParentDisplayListInvalidatingStyle(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void;
function registerInheritingStyle(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void;
function set stylesRoot(C:\autobuild\3.2.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.2.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:Object):void;
function unloadStyleDeclarations(_arg1:String, _arg2:Boolean=true):void;
function getColorNames(C:\autobuild\3.2.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.2.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.2.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void;
function registerSizeInvalidatingStyle(C:\autobuild\3.2.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 295
//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 296
//IStyleModule (mx.styles.IStyleModule)
package mx.styles {
public interface IStyleModule {
function unload():void;
}
}//package mx.styles
Section 297
//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.2.0.3958";
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 298
//StyleManagerImpl (mx.styles.StyleManagerImpl)
package mx.styles {
import mx.core.*;
import mx.managers.*;
import flash.events.*;
import mx.events.*;
import mx.resources.*;
import flash.system.*;
import mx.modules.*;
import flash.utils.*;
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.2.0.3958";
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.events.*;
import mx.modules.*;
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);
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 299
//StyleProtoChain (mx.styles.StyleProtoChain)
package mx.styles {
import flash.display.*;
import mx.core.*;
public class StyleProtoChain {
mx_internal static const VERSION:String = "3.2.0.3958";
public function StyleProtoChain(){
super();
}
public static function initProtoChainForUIComponentStyleName(obj:IStyleClient):void{
var typeSelector:CSSStyleDeclaration;
var styleName:IStyleClient = IStyleClient(obj.styleName);
var target:DisplayObject = (obj as DisplayObject);
var nonInheritChain:Object = styleName.nonInheritingStyles;
if (((!(nonInheritChain)) || ((nonInheritChain == UIComponent.STYLE_UNINITIALIZED)))){
nonInheritChain = StyleManager.stylesRoot;
if (nonInheritChain.effects){
obj.registerEffects(nonInheritChain.effects);
};
};
var inheritChain:Object = styleName.inheritingStyles;
if (((!(inheritChain)) || ((inheritChain == UIComponent.STYLE_UNINITIALIZED)))){
inheritChain = StyleManager.stylesRoot;
};
var typeSelectors:Array = obj.getClassStyleDeclarations();
var n:int = typeSelectors.length;
if ((styleName is StyleProxy)){
if (n == 0){
nonInheritChain = addProperties(nonInheritChain, styleName, false);
};
target = (StyleProxy(styleName).source as DisplayObject);
};
var i:int;
while (i < n) {
typeSelector = typeSelectors[i];
inheritChain = typeSelector.addStyleToProtoChain(inheritChain, target);
inheritChain = addProperties(inheritChain, styleName, true);
nonInheritChain = typeSelector.addStyleToProtoChain(nonInheritChain, target);
nonInheritChain = addProperties(nonInheritChain, styleName, false);
if (typeSelector.effects){
obj.registerEffects(typeSelector.effects);
};
i++;
};
obj.inheritingStyles = (obj.styleDeclaration) ? obj.styleDeclaration.addStyleToProtoChain(inheritChain, target) : inheritChain;
obj.nonInheritingStyles = (obj.styleDeclaration) ? obj.styleDeclaration.addStyleToProtoChain(nonInheritChain, target) : nonInheritChain;
}
private static function addProperties(chain:Object, obj:IStyleClient, bInheriting:Boolean):Object{
var typeSelector:CSSStyleDeclaration;
var classSelector:CSSStyleDeclaration;
var filterMap:Object = ((((obj is StyleProxy)) && (!(bInheriting)))) ? StyleProxy(obj).filterMap : null;
var curObj:IStyleClient = obj;
while ((curObj is StyleProxy)) {
curObj = StyleProxy(curObj).source;
};
var target:DisplayObject = (curObj as DisplayObject);
var typeSelectors:Array = obj.getClassStyleDeclarations();
var n:int = typeSelectors.length;
var i:int;
while (i < n) {
typeSelector = typeSelectors[i];
chain = typeSelector.addStyleToProtoChain(chain, target, filterMap);
if (typeSelector.effects){
obj.registerEffects(typeSelector.effects);
};
i++;
};
var styleName:Object = obj.styleName;
if (styleName){
if (typeof(styleName) == "object"){
if ((styleName is CSSStyleDeclaration)){
classSelector = CSSStyleDeclaration(styleName);
} else {
chain = addProperties(chain, IStyleClient(styleName), bInheriting);
};
} else {
classSelector = StyleManager.getStyleDeclaration(("." + styleName));
};
if (classSelector){
chain = classSelector.addStyleToProtoChain(chain, target, filterMap);
if (classSelector.effects){
obj.registerEffects(classSelector.effects);
};
};
};
if (obj.styleDeclaration){
chain = obj.styleDeclaration.addStyleToProtoChain(chain, target, filterMap);
};
return (chain);
}
public static function initTextField(obj:IUITextField):void{
var classSelector:CSSStyleDeclaration;
var styleName:Object = obj.styleName;
if (styleName){
if (typeof(styleName) == "object"){
if ((styleName is CSSStyleDeclaration)){
classSelector = CSSStyleDeclaration(styleName);
} else {
if ((styleName is StyleProxy)){
obj.inheritingStyles = IStyleClient(styleName).inheritingStyles;
obj.nonInheritingStyles = addProperties(StyleManager.stylesRoot, IStyleClient(styleName), false);
return;
};
obj.inheritingStyles = IStyleClient(styleName).inheritingStyles;
obj.nonInheritingStyles = IStyleClient(styleName).nonInheritingStyles;
return;
};
} else {
classSelector = StyleManager.getStyleDeclaration(("." + styleName));
};
};
var inheritChain:Object = IStyleClient(obj.parent).inheritingStyles;
var nonInheritChain:Object = StyleManager.stylesRoot;
if (!inheritChain){
inheritChain = StyleManager.stylesRoot;
};
if (classSelector){
inheritChain = classSelector.addStyleToProtoChain(inheritChain, DisplayObject(obj));
nonInheritChain = classSelector.addStyleToProtoChain(nonInheritChain, DisplayObject(obj));
};
obj.inheritingStyles = inheritChain;
obj.nonInheritingStyles = nonInheritChain;
}
}
}//package mx.styles
Section 300
//StyleProxy (mx.styles.StyleProxy)
package mx.styles {
import mx.core.*;
public class StyleProxy implements IStyleClient {
private var _source:IStyleClient;
private var _filterMap:Object;
mx_internal static const VERSION:String = "3.2.0.3958";
public function StyleProxy(source:IStyleClient, filterMap:Object){
super();
this.filterMap = filterMap;
this.source = source;
}
public function styleChanged(styleProp:String):void{
return (_source.styleChanged(styleProp));
}
public function get filterMap():Object{
return (((FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)) ? null : _filterMap);
}
public function set filterMap(value:Object):void{
_filterMap = value;
}
public function get styleDeclaration():CSSStyleDeclaration{
return (_source.styleDeclaration);
}
public function notifyStyleChangeInChildren(styleProp:String, recursive:Boolean):void{
return (_source.notifyStyleChangeInChildren(styleProp, recursive));
}
public function set inheritingStyles(value:Object):void{
}
public function get source():IStyleClient{
return (_source);
}
public function get styleName():Object{
if ((_source.styleName is IStyleClient)){
return (new StyleProxy(IStyleClient(_source.styleName), filterMap));
};
return (_source.styleName);
}
public function registerEffects(effects:Array):void{
return (_source.registerEffects(effects));
}
public function regenerateStyleCache(recursive:Boolean):void{
_source.regenerateStyleCache(recursive);
}
public function get inheritingStyles():Object{
return (_source.inheritingStyles);
}
public function get className():String{
return (_source.className);
}
public function clearStyle(styleProp:String):void{
_source.clearStyle(styleProp);
}
public function getClassStyleDeclarations():Array{
return (_source.getClassStyleDeclarations());
}
public function set nonInheritingStyles(value:Object):void{
}
public function setStyle(styleProp:String, newValue):void{
_source.setStyle(styleProp, newValue);
}
public function get nonInheritingStyles():Object{
return (((FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)) ? _source.nonInheritingStyles : null);
}
public function set styleName(value:Object):void{
_source.styleName = value;
}
public function getStyle(styleProp:String){
return (_source.getStyle(styleProp));
}
public function set source(value:IStyleClient):void{
_source = value;
}
public function set styleDeclaration(value:CSSStyleDeclaration):void{
_source.styleDeclaration = styleDeclaration;
}
}
}//package mx.styles
Section 301
//ColorUtil (mx.utils.ColorUtil)
package mx.utils {
import mx.core.*;
public class ColorUtil {
mx_internal static const VERSION:String = "3.2.0.3958";
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 302
//EventUtil (mx.utils.EventUtil)
package mx.utils {
import mx.core.*;
import flash.events.*;
import mx.events.*;
public class EventUtil {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var _sandboxEventMap:Object;
private static var _mouseEventMap:Object;
public function EventUtil(){
super();
}
public static function get sandboxMouseEventMap():Object{
if (!_sandboxEventMap){
_sandboxEventMap = {};
_sandboxEventMap[SandboxMouseEvent.CLICK_SOMEWHERE] = MouseEvent.CLICK;
_sandboxEventMap[SandboxMouseEvent.DOUBLE_CLICK_SOMEWHERE] = MouseEvent.DOUBLE_CLICK;
_sandboxEventMap[SandboxMouseEvent.MOUSE_DOWN_SOMEWHERE] = MouseEvent.MOUSE_DOWN;
_sandboxEventMap[SandboxMouseEvent.MOUSE_MOVE_SOMEWHERE] = MouseEvent.MOUSE_MOVE;
_sandboxEventMap[SandboxMouseEvent.MOUSE_UP_SOMEWHERE] = MouseEvent.MOUSE_UP;
_sandboxEventMap[SandboxMouseEvent.MOUSE_WHEEL_SOMEWHERE] = MouseEvent.MOUSE_WHEEL;
};
return (_sandboxEventMap);
}
public static function get mouseEventMap():Object{
if (!_mouseEventMap){
_mouseEventMap = {};
_mouseEventMap[MouseEvent.CLICK] = SandboxMouseEvent.CLICK_SOMEWHERE;
_mouseEventMap[MouseEvent.DOUBLE_CLICK] = SandboxMouseEvent.DOUBLE_CLICK_SOMEWHERE;
_mouseEventMap[MouseEvent.MOUSE_DOWN] = SandboxMouseEvent.MOUSE_DOWN_SOMEWHERE;
_mouseEventMap[MouseEvent.MOUSE_MOVE] = SandboxMouseEvent.MOUSE_MOVE_SOMEWHERE;
_mouseEventMap[MouseEvent.MOUSE_UP] = SandboxMouseEvent.MOUSE_UP_SOMEWHERE;
_mouseEventMap[MouseEvent.MOUSE_WHEEL] = SandboxMouseEvent.MOUSE_WHEEL_SOMEWHERE;
};
return (_mouseEventMap);
}
}
}//package mx.utils
Section 303
//GraphicsUtil (mx.utils.GraphicsUtil)
package mx.utils {
import flash.display.*;
import mx.core.*;
public class GraphicsUtil {
mx_internal static const VERSION:String = "3.2.0.3958";
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 304
//LoaderUtil (mx.utils.LoaderUtil)
package mx.utils {
import flash.display.*;
public class LoaderUtil {
public function LoaderUtil(){
super();
}
public static function normalizeURL(loaderInfo:LoaderInfo):String{
var url:String = loaderInfo.url;
var results:Array = url.split("/[[DYNAMIC]]/");
return (results[0]);
}
public static function createAbsoluteURL(rootURL:String, url:String):String{
var lastIndex:int;
var parentIndex:int;
var absoluteURL:String = url;
if (!(((((url.indexOf(":") > -1)) || ((url.indexOf("/") == 0)))) || ((url.indexOf("\\") == 0)))){
if (rootURL){
lastIndex = Math.max(rootURL.lastIndexOf("\\"), rootURL.lastIndexOf("/"));
if (lastIndex <= 8){
rootURL = (rootURL + "/");
lastIndex = (rootURL.length - 1);
};
if (url.indexOf("./") == 0){
url = url.substring(2);
} else {
while (url.indexOf("../") == 0) {
url = url.substring(3);
parentIndex = Math.max(rootURL.lastIndexOf("\\", (lastIndex - 1)), rootURL.lastIndexOf("/", (lastIndex - 1)));
if (parentIndex <= 8){
parentIndex = lastIndex;
};
lastIndex = parentIndex;
};
};
if (lastIndex != -1){
absoluteURL = (rootURL.substr(0, (lastIndex + 1)) + url);
};
};
};
return (absoluteURL);
}
}
}//package mx.utils
Section 305
//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.2.0.3958";
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 306
//SecurityUtil (mx.utils.SecurityUtil)
package mx.utils {
import mx.core.*;
public class SecurityUtil {
mx_internal static const VERSION:String = "3.2.0.3958";
public function SecurityUtil(){
super();
}
public static function hasMutualTrustBetweenParentAndChild(bp:ISWFBridgeProvider):Boolean{
if (((((bp) && (bp.childAllowsParent))) && (bp.parentAllowsChild))){
return (true);
};
return (false);
}
}
}//package mx.utils
Section 307
//StringUtil (mx.utils.StringUtil)
package mx.utils {
import mx.core.*;
public class StringUtil {
mx_internal static const VERSION:String = "3.2.0.3958";
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 308
//IValidatorListener (mx.validators.IValidatorListener)
package mx.validators {
import mx.events.*;
public interface IValidatorListener {
function set errorString(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\validators;IValidatorListener.as:String):void;
function get validationSubField():String;
function validationResultHandler(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\validators;IValidatorListener.as:ValidationResultEvent):void;
function set validationSubField(C:\autobuild\3.2.0\frameworks\projects\framework\src;mx\validators;IValidatorListener.as:String):void;
function get errorString():String;
}
}//package mx.validators
Section 309
//ValidationResult (mx.validators.ValidationResult)
package mx.validators {
import mx.core.*;
public class ValidationResult {
public var subField:String;
public var errorCode:String;
public var isError:Boolean;
public var errorMessage:String;
mx_internal static const VERSION:String = "3.2.0.3958";
public function ValidationResult(isError:Boolean, subField:String="", errorCode:String="", errorMessage:String=""){
super();
this.isError = isError;
this.subField = subField;
this.errorMessage = errorMessage;
this.errorCode = errorCode;
}
}
}//package mx.validators
Section 310
//Camera3D (org.papervision3d.cameras.Camera3D)
package org.papervision3d.cameras {
import org.papervision3d.core.proto.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.math.*;
public class Camera3D extends CameraObject3D {
public var goto:Number3D;
public var target:DisplayObject3D;
public static const TYPE:String = "CAMERA3D";
public function Camera3D(target:DisplayObject3D=null, zoom:Number=2, focus:Number=100, initObject:Object=null){
super(zoom, focus, initObject);
this.target = ((target) || (DisplayObject3D.ZERO));
this.goto = new Number3D(this.x, this.y, this.z);
}
override public function transformView(transform:Matrix3D=null):void{
this.lookAt(this.target);
super.transformView();
}
public function hover(type:Number, mouseX:Number, mouseY:Number):void{
var target:DisplayObject3D;
var goto:Number3D;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
target = this.target;
goto = this.goto;
var camSpeed:Number = 8;
switch (type){
case 0:
_local7 = (goto.x - target.x);
_local8 = (goto.z - target.z);
_local9 = Math.atan2(_local8, _local7);
_local10 = Math.sqrt(((_local7 * _local7) + (_local8 * _local8)));
_local11 = (0.5 * mouseX);
_local12 = (_local10 * Math.cos((_local9 - _local11)));
_local13 = (_local10 * Math.sin((_local9 - _local11)));
_local14 = (goto.y - (300 * mouseY));
this.x = (this.x - ((this.x - _local12) / camSpeed));
this.y = (this.y - ((this.y - _local14) / camSpeed));
this.z = (this.z - ((this.z - _local13) / camSpeed));
break;
case 1:
this.x = (this.x - ((this.x - (1000 * mouseX)) / camSpeed));
this.y = (this.y - ((this.y - (1000 * mouseY)) / camSpeed));
break;
};
}
}
}//package org.papervision3d.cameras
Section 311
//AbstractController (org.papervision3d.core.animation.core.AbstractController)
package org.papervision3d.core.animation.core {
import flash.events.*;
public class AbstractController extends EventDispatcher {
protected var engine:AnimationEngine;
protected var totalFrames:uint;// = 0
protected var split:Number;
public var duration:uint;// = 0
protected var firstFrame:uint;// = 0
public var frames:Array;
public var playing:Boolean;
protected var currentFrame:int;// = 0
protected var lastFrame:uint;// = 0
protected var nextFrame:int;// = 0
public function AbstractController():void{
super();
this.frames = new Array();
this.engine = AnimationEngine.getInstance();
playing = false;
currentFrame = 0;
nextFrame = 1;
firstFrame = uint.MAX_VALUE;
lastFrame = uint.MIN_VALUE;
}
public function gotoAndPlay(frame:uint=0):void{
currentFrame = (frame % this.frames.length);
nextFrame = ((frame + 1) % this.frames.length);
playing = true;
}
public function stop():void{
playing = false;
}
public function addFrame(frame:AnimationFrame):void{
this.frames[frame.frame] = frame;
totalFrames++;
firstFrame = Math.min(firstFrame, frame.frame);
lastFrame = Math.max(lastFrame, frame.frame);
}
public function findFrameByName(name:String, ignoreTrailingDigits:Boolean):AnimationFrame{
var frame:AnimationFrame;
var pattern:RegExp;
var matches:Object;
if (ignoreTrailingDigits){
pattern = /^([a-z]+)(\d+)$/i;
matches = pattern.exec(name);
if (((((matches) && (matches[1]))) && (matches[2]))){
name = matches[1];
};
};
for each (frame in this.frames) {
if (frame.name == name){
return (frame);
};
};
return (null);
}
public function tick(dt:Number):void{
}
public function gotoAndStop(frame:uint=0):void{
currentFrame = (frame % this.frames.length);
nextFrame = ((frame + 1) % this.frames.length);
}
public function play():void{
gotoAndPlay(currentFrame);
}
}
}//package org.papervision3d.core.animation.core
Section 312
//AnimationEngine (org.papervision3d.core.animation.core.AnimationEngine)
package org.papervision3d.core.animation.core {
import org.papervision3d.objects.*;
import flash.utils.*;
import org.papervision3d.*;
import org.papervision3d.core.animation.controllers.*;
public class AnimationEngine {
public var maxTime:Number;
public var currentFrame:uint;// = 0
public var time:Number;// = 0
public static var TICK:Number = 50;
private static var _controllers:Array;
private static var _animatedObjects:Dictionary;
private static var instance:AnimationEngine = new (AnimationEngine);
;
private static var _time:Number;
public static var NUM_FRAMES:uint = 100;
public function AnimationEngine():void{
maxTime = (NUM_FRAMES * TICK);
super();
if (instance){
throw (new Error("org.papervision3d.animation.AnimationEngine is a singleton class!"));
};
_animatedObjects = new Dictionary();
_controllers = new Array();
_time = getTimer();
Papervision3D.log(((("[AnimationEngine] initialized => NUM_FRAMES:" + NUM_FRAMES) + " TICK:") + TICK));
}
public function tick():void{
var obj:*;
var controllers:Array;
var i:int;
time = (getTimer() - _time);
if (time > TICK){
_time = getTimer();
currentFrame = ((currentFrame < (NUM_FRAMES - 1))) ? (currentFrame + 1) : 0;
};
for (obj in _animatedObjects) {
controllers = _animatedObjects[obj];
i = 0;
while (i < controllers.length) {
controllers[i].tick(time);
i++;
};
};
}
public static function getControllers(object:DisplayObject3D):Array{
if (_animatedObjects[object]){
return (_animatedObjects[object]);
};
return (null);
}
public static function getInstance():AnimationEngine{
return (instance);
}
public static function millisToFrame(millis:Number):uint{
return (Math.floor((millis / TICK)));
}
public static function secondsToFrame(seconds:Number):uint{
return (millisToFrame((seconds * 1000)));
}
public static function setControllers(object:DisplayObject3D, controllers:Array, overwrite:Boolean=false):void{
if (overwrite){
_animatedObjects[object] = new Array();
};
var i:int;
while (i < controllers.length) {
addController(object, controllers[i]);
i++;
};
}
public static function addController(object:DisplayObject3D, controller:AbstractController):AbstractController{
var frame:AnimationFrame;
var framenum:uint;
var nframes:uint = NUM_FRAMES;
if (!_animatedObjects[object]){
_animatedObjects[object] = new Array();
};
var maxframes:uint;
for each (frame in controller.frames) {
framenum = frame.frame;
if (framenum > NUM_FRAMES){
NUM_FRAMES = framenum;
};
maxframes = Math.max(maxframes, framenum);
};
instance.maxTime = (NUM_FRAMES * TICK);
if (NUM_FRAMES > nframes){
Papervision3D.log((("[AnimationEngine] resizing timeline to " + NUM_FRAMES) + " frames"));
};
if (NUM_FRAMES > maxframes){
NUM_FRAMES = maxframes;
Papervision3D.log((("[AnimationEngine] resizing timeline to " + NUM_FRAMES) + " frames"));
};
_animatedObjects[object].push(controller);
return (controller);
}
}
}//package org.papervision3d.core.animation.core
Section 313
//AnimationFrame (org.papervision3d.core.animation.core.AnimationFrame)
package org.papervision3d.core.animation.core {
public class AnimationFrame {
public var type:uint;
public var values:Array;
public var nextFrame:uint;
public var name:String;
public var frame:uint;
public var duration:uint;
public function AnimationFrame(frame:uint, duration:uint=1, values:Array=null, name:String=""):void{
super();
this.frame = frame;
this.duration = duration;
this.values = ((values) || (new Array()));
this.name = name;
}
}
}//package org.papervision3d.core.animation.core
Section 314
//CoordinateTools (org.papervision3d.core.components.as3.utils.CoordinateTools)
package org.papervision3d.core.components.as3.utils {
import flash.display.*;
import flash.geom.*;
public class CoordinateTools {
public function CoordinateTools(){
super();
}
public static function random(range:Number):Number{
return (Math.floor((Math.random() * range)));
}
public static function localToLocal(containerFrom:DisplayObject, containerTo:DisplayObject, origin:Point=null):Point{
var point:Point = (origin) ? origin : new Point();
point = containerFrom.localToGlobal(point);
point = containerTo.globalToLocal(point);
return (point);
}
}
}//package org.papervision3d.core.components.as3.utils
Section 315
//DefaultParticleCuller (org.papervision3d.core.culling.DefaultParticleCuller)
package org.papervision3d.core.culling {
import org.papervision3d.core.geom.renderables.*;
public class DefaultParticleCuller implements IParticleCuller {
public function DefaultParticleCuller(){
super();
}
public function testParticle(particle:Particle):Boolean{
if (particle.material.invisible == false){
if (particle.vertex3D.vertex3DInstance.visible == true){
return (true);
};
};
return (false);
}
}
}//package org.papervision3d.core.culling
Section 316
//DefaultTriangleCuller (org.papervision3d.core.culling.DefaultTriangleCuller)
package org.papervision3d.core.culling {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.geom.renderables.*;
public class DefaultTriangleCuller implements ITriangleCuller {
private static var y2:Number;
private static var y1:Number;
private static var y0:Number;
private static var x0:Number;
private static var x1:Number;
private static var x2:Number;
public function DefaultTriangleCuller(){
super();
}
public function testFace(face:Triangle3D, vertex0:Vertex3DInstance, vertex1:Vertex3DInstance, vertex2:Vertex3DInstance):Boolean{
var material:MaterialObject3D;
if (((((vertex0.visible) && (vertex1.visible))) && (vertex2.visible))){
material = (face.material) ? face.material : face.instance.material;
if (material.invisible){
return (false);
};
x0 = vertex0.x;
y0 = vertex0.y;
x1 = vertex1.x;
y1 = vertex1.y;
x2 = vertex2.x;
y2 = vertex2.y;
if (material.oneSide){
if (material.opposite){
if ((((x2 - x0) * (y1 - y0)) - ((y2 - y0) * (x1 - x0))) > 0){
return (false);
};
} else {
if ((((x2 - x0) * (y1 - y0)) - ((y2 - y0) * (x1 - x0))) < 0){
return (false);
};
};
};
return (true);
};
return (false);
}
}
}//package org.papervision3d.core.culling
Section 317
//IObjectCuller (org.papervision3d.core.culling.IObjectCuller)
package org.papervision3d.core.culling {
import org.papervision3d.objects.*;
public interface IObjectCuller {
function testObject(:DisplayObject3D):int;
}
}//package org.papervision3d.core.culling
Section 318
//IParticleCuller (org.papervision3d.core.culling.IParticleCuller)
package org.papervision3d.core.culling {
import org.papervision3d.core.geom.renderables.*;
public interface IParticleCuller {
function testParticle(:Particle):Boolean;
}
}//package org.papervision3d.core.culling
Section 319
//ITriangleCuller (org.papervision3d.core.culling.ITriangleCuller)
package org.papervision3d.core.culling {
import org.papervision3d.core.geom.renderables.*;
public interface ITriangleCuller {
function testFace(_arg1:Triangle3D, _arg2:Vertex3DInstance, _arg3:Vertex3DInstance, _arg4:Vertex3DInstance):Boolean;
}
}//package org.papervision3d.core.culling
Section 320
//RectangleParticleCuller (org.papervision3d.core.culling.RectangleParticleCuller)
package org.papervision3d.core.culling {
import flash.geom.*;
import org.papervision3d.core.geom.renderables.*;
public class RectangleParticleCuller implements IParticleCuller {
public var cullingRectangle:Rectangle;
private static var vInstance:Vertex3DInstance;
private static var testPoint:Point;
public function RectangleParticleCuller(cullingRectangle:Rectangle=null){
super();
this.cullingRectangle = cullingRectangle;
testPoint = new Point();
}
public function testParticle(particle:Particle):Boolean{
vInstance = particle.vertex3D.vertex3DInstance;
if (vInstance.visible){
testPoint.x = vInstance.x;
testPoint.y = vInstance.y;
if (cullingRectangle.containsPoint(testPoint)){
return (true);
};
};
return (false);
}
}
}//package org.papervision3d.core.culling
Section 321
//RectangleTriangleCuller (org.papervision3d.core.culling.RectangleTriangleCuller)
package org.papervision3d.core.culling {
import flash.geom.*;
import org.papervision3d.core.geom.renderables.*;
public class RectangleTriangleCuller extends DefaultTriangleCuller implements ITriangleCuller {
public var cullingRectangle:Rectangle;
private static const DEFAULT_RECT_X:Number = -((DEFAULT_RECT_W / 2));
private static const DEFAULT_RECT_W:Number = 640;
private static const DEFAULT_RECT_H:Number = 480;
private static const DEFAULT_RECT_Y:Number = -((DEFAULT_RECT_H / 2));
private static var hitRect:Rectangle = new Rectangle();
public function RectangleTriangleCuller(cullingRectangle:Rectangle=null):void{
cullingRectangle = new Rectangle(DEFAULT_RECT_X, DEFAULT_RECT_Y, DEFAULT_RECT_W, DEFAULT_RECT_H);
super();
if (cullingRectangle){
this.cullingRectangle = cullingRectangle;
};
}
override public function testFace(face:Triangle3D, vertex0:Vertex3DInstance, vertex1:Vertex3DInstance, vertex2:Vertex3DInstance):Boolean{
if (super.testFace(face, vertex0, vertex1, vertex2)){
hitRect.x = Math.min(vertex2.x, Math.min(vertex1.x, vertex0.x));
hitRect.width = (Math.max(vertex2.x, Math.max(vertex1.x, vertex0.x)) + Math.abs(hitRect.x));
hitRect.y = Math.min(vertex2.y, Math.min(vertex1.y, vertex0.y));
hitRect.height = (Math.max(vertex2.y, Math.max(vertex1.y, vertex0.y)) + Math.abs(hitRect.y));
return (cullingRectangle.intersects(hitRect));
};
return (false);
}
}
}//package org.papervision3d.core.culling
Section 322
//ViewportObjectFilter (org.papervision3d.core.culling.ViewportObjectFilter)
package org.papervision3d.core.culling {
import org.papervision3d.objects.*;
import flash.utils.*;
public class ViewportObjectFilter implements IObjectCuller {
protected var _mode:int;
protected var objects:Dictionary;
public function ViewportObjectFilter(mode:int):void{
super();
this.mode = mode;
init();
}
public function addObject(do3d:DisplayObject3D):void{
objects[do3d] = do3d;
}
public function get mode():int{
return (_mode);
}
public function set mode(mode:int):void{
_mode = mode;
}
public function removeObject(do3d:DisplayObject3D):void{
delete objects[do3d];
}
private function init():void{
objects = new Dictionary(true);
}
public function testObject(object:DisplayObject3D):int{
if (objects[object]){
if (_mode == ViewportObjectFilterMode.INCLUSIVE){
return (1);
};
if (_mode == ViewportObjectFilterMode.EXCLUSIVE){
return (0);
};
} else {
if (_mode == ViewportObjectFilterMode.INCLUSIVE){
return (0);
};
if (_mode == ViewportObjectFilterMode.EXCLUSIVE){
return (1);
};
};
return (0);
}
public function destroy():void{
objects = null;
}
}
}//package org.papervision3d.core.culling
Section 323
//ViewportObjectFilterMode (org.papervision3d.core.culling.ViewportObjectFilterMode)
package org.papervision3d.core.culling {
public class ViewportObjectFilterMode {
public static const INCLUSIVE:int = 0;
public static const EXCLUSIVE:int = 1;
public function ViewportObjectFilterMode(){
super();
}
}
}//package org.papervision3d.core.culling
Section 324
//IRenderable (org.papervision3d.core.geom.renderables.IRenderable)
package org.papervision3d.core.geom.renderables {
import org.papervision3d.core.render.command.*;
public interface IRenderable {
function getRenderListItem():IRenderListItem;
}
}//package org.papervision3d.core.geom.renderables
Section 325
//Particle (org.papervision3d.core.geom.renderables.Particle)
package org.papervision3d.core.geom.renderables {
import org.papervision3d.core.render.command.*;
import org.papervision3d.materials.special.*;
import org.papervision3d.core.geom.*;
public class Particle implements IRenderable {
public var size:int;
public var renderCommand:RenderParticle;
public var material:ParticleMaterial;
public var renderScale:Number;
public var instance:Particles;
public var vertex3D:Vertex3D;
public function Particle(material:ParticleMaterial, size:int=1, x:Number=0, y:Number=0, z:Number=0){
super();
this.material = material;
this.size = size;
this.renderCommand = new RenderParticle(this);
vertex3D = new Vertex3D(x, y, z);
}
public function get y():Number{
return (vertex3D.y);
}
public function set x(x:Number):void{
vertex3D.x = x;
}
public function set y(y:Number):void{
vertex3D.y = y;
}
public function get x():Number{
return (vertex3D.x);
}
public function get z():Number{
return (vertex3D.z);
}
public function set z(z:Number):void{
vertex3D.z = z;
}
public function getRenderListItem():IRenderListItem{
return (renderCommand);
}
}
}//package org.papervision3d.core.geom.renderables
Section 326
//Triangle3D (org.papervision3d.core.geom.renderables.Triangle3D)
package org.papervision3d.core.geom.renderables {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.render.command.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.math.*;
public class Triangle3D implements IRenderable {
private var _uvArray:Array;
public var face3DInstance:Triangle3DInstance;
public var instance:DisplayObject3D;
public var id:Number;
public var material:MaterialObject3D;
public var faceNormal:Number3D;
public var renderCommand:RenderTriangle;
public var screenZ:Number;
public var uv0:NumberUV;
public var uv1:NumberUV;
public var _materialName:String;
public var visible:Boolean;
public var uv2:NumberUV;
public var vertices:Array;
public var v0:Vertex3D;
public var v1:Vertex3D;
public var v2:Vertex3D;
private static var _totalFaces:Number = 0;
public function Triangle3D(do3dInstance:DisplayObject3D, vertices:Array, material:MaterialObject3D=null, uv:Array=null){
super();
this.instance = do3dInstance;
this.renderCommand = new RenderTriangle(this);
face3DInstance = new Triangle3DInstance(this, do3dInstance);
this.vertices = vertices;
v0 = vertices[0];
v1 = vertices[1];
v2 = vertices[2];
this.material = material;
this.uv = uv;
this.id = _totalFaces++;
createNormal();
}
public function set uv(uv:Array):void{
uv0 = NumberUV(uv[0]);
uv1 = NumberUV(uv[1]);
uv2 = NumberUV(uv[2]);
_uvArray = uv;
}
public function getRenderListItem():IRenderListItem{
return (renderCommand);
}
public function createNormal():void{
var vn0:Number3D = v0.toNumber3D();
var vn1:Number3D = v1.toNumber3D();
var vn2:Number3D = v2.toNumber3D();
var vt1:Number3D = Number3D.sub(vn1, vn0);
var vt2:Number3D = Number3D.sub(vn2, vn0);
faceNormal = Number3D.cross(vt1, vt2);
faceNormal.normalize();
}
public function get uv():Array{
return (_uvArray);
}
}
}//package org.papervision3d.core.geom.renderables
Section 327
//Triangle3DInstance (org.papervision3d.core.geom.renderables.Triangle3DInstance)
package org.papervision3d.core.geom.renderables {
import flash.display.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.math.*;
public class Triangle3DInstance {
public var container:Sprite;
public var instance:DisplayObject3D;
public var visible:Boolean;// = false
public var faceNormal:Number3D;
public var screenZ:Number;
public function Triangle3DInstance(face:Triangle3D, instance:DisplayObject3D){
super();
this.instance = instance;
faceNormal = new Number3D();
}
}
}//package org.papervision3d.core.geom.renderables
Section 328
//Vertex3D (org.papervision3d.core.geom.renderables.Vertex3D)
package org.papervision3d.core.geom.renderables {
import org.papervision3d.core.render.command.*;
import org.papervision3d.core.math.*;
import flash.utils.*;
public class Vertex3D implements IRenderable {
public var normal:Number3D;
public var vertex3DInstance:Vertex3DInstance;
public var connectedFaces:Dictionary;
public var extra:Object;
public var x:Number;
public var y:Number;
public var z:Number;
public function Vertex3D(x:Number=0, y:Number=0, z:Number=0){
super();
this.x = x;
this.y = y;
this.z = z;
this.vertex3DInstance = new Vertex3DInstance();
this.normal = new Number3D();
this.connectedFaces = new Dictionary();
}
public function getRenderListItem():IRenderListItem{
return (null);
}
public function toNumber3D():Number3D{
return (new Number3D(x, y, z));
}
public function calculateNormal():void{
var face:Triangle3D;
normal = new Number3D();
var count:Number = 0;
for each (face in connectedFaces) {
count++;
normal = Number3D.add(face.faceNormal, normal);
};
normal.x = (normal.x / count);
normal.y = (normal.y / count);
normal.z = (normal.z / count);
normal.normalize();
}
public function clone():Vertex3D{
var clone:Vertex3D = new Vertex3D(x, y, z);
clone.extra = extra;
clone.vertex3DInstance = vertex3DInstance.clone();
clone.normal = normal.clone();
return (clone);
}
}
}//package org.papervision3d.core.geom.renderables
Section 329
//Vertex3DInstance (org.papervision3d.core.geom.renderables.Vertex3DInstance)
package org.papervision3d.core.geom.renderables {
import org.papervision3d.core.math.*;
public class Vertex3DInstance {
public var y:Number;
public var normal:Number3D;
public var visible:Boolean;
public var extra:Object;
public var x:Number;
public var z:Number;
public function Vertex3DInstance(x:Number=0, y:Number=0, z:Number=0){
super();
this.x = x;
this.y = y;
this.z = z;
this.visible = false;
this.normal = new Number3D();
}
public function clone():Vertex3DInstance{
var clone:Vertex3DInstance = new Vertex3DInstance(x, y, z);
clone.visible = visible;
clone.extra = extra;
return (clone);
}
public static function cross(v0:Vertex3DInstance, v1:Vertex3DInstance):Number{
return (((v0.x * v1.y) - (v1.x * v0.y)));
}
public static function dot(v0:Vertex3DInstance, v1:Vertex3DInstance):Number{
return (((v0.x * v1.x) + (v0.y * v1.y)));
}
public static function sub(v0:Vertex3DInstance, v1:Vertex3DInstance):Vertex3DInstance{
return (new Vertex3DInstance((v1.x - v0.x), (v1.y - v0.y)));
}
}
}//package org.papervision3d.core.geom.renderables
Section 330
//Particles (org.papervision3d.core.geom.Particles)
package org.papervision3d.core.geom {
import org.papervision3d.core.render.data.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.geom.renderables.*;
public class Particles extends Vertices3D {
private var vertices:Array;
public var particles:Array;
public function Particles(name:String="VertexParticles"){
this.vertices = new Array();
this.particles = new Array();
super(vertices, name);
}
public function removeParticle(particle:Particle):void{
particle.instance = null;
particles.splice(particles.indexOf(particle, 0));
vertices.splice(vertices.indexOf(particle.vertex3D, 0));
}
public function addParticle(particle:Particle):void{
particle.instance = this;
particles.push(particle);
vertices.push(particle.vertex3D);
}
override public function project(parent:DisplayObject3D, renderSessionData:RenderSessionData):Number{
var p:Particle;
super.project(parent, renderSessionData);
var fz:Number = (renderSessionData.camera.focus * renderSessionData.camera.zoom);
for each (p in particles) {
if (renderSessionData.viewPort.particleCuller.testParticle(p)){
p.renderScale = (fz / (renderSessionData.camera.focus + p.vertex3D.vertex3DInstance.z));
p.renderCommand.screenDepth = p.vertex3D.vertex3DInstance.z;
renderSessionData.renderer.addToRenderList(p.renderCommand);
} else {
renderSessionData.renderStatistics.culledParticles++;
};
};
return (1);
}
public function removeAllParticles():void{
particles = new Array();
vertices = new Array();
geometry.vertices = vertices;
}
}
}//package org.papervision3d.core.geom
Section 331
//TriangleMesh3D (org.papervision3d.core.geom.TriangleMesh3D)
package org.papervision3d.core.geom {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.core.render.command.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.culling.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.math.*;
import flash.utils.*;
import org.papervision3d.core.render.draw.*;
public class TriangleMesh3D extends Vertices3D {
public function TriangleMesh3D(material:MaterialObject3D, vertices:Array, faces:Array, name:String=null, initObject:Object=null){
super(vertices, name, initObject);
this.geometry.faces = ((faces) || (new Array()));
this.material = ((material) || (MaterialObject3D.DEFAULT));
}
public function mergeVertices():void{
var v:Vertex3D;
var f:Triangle3D;
var vu:Vertex3D;
var uniqueDic:Dictionary = new Dictionary();
var uniqueList:Array = new Array();
for each (v in this.geometry.vertices) {
for each (vu in uniqueDic) {
if ((((((v.x == vu.x)) && ((v.y == vu.y)))) && ((v.z == vu.z)))){
uniqueDic[v] = vu;
break;
};
};
if (!uniqueDic[v]){
uniqueDic[v] = v;
uniqueList.push(v);
};
};
this.geometry.vertices = uniqueList;
for each (f in geometry.faces) {
f.v0 = uniqueDic[f.v0];
f.v1 = uniqueDic[f.v1];
f.v2 = uniqueDic[f.v2];
};
}
override public function project(parent:DisplayObject3D, renderSessionData:RenderSessionData):Number{
var faces:Array;
var screenZs:Number;
var visibleFaces:Number;
var triCuller:ITriangleCuller;
var vertex0:Vertex3DInstance;
var vertex1:Vertex3DInstance;
var vertex2:Vertex3DInstance;
var iFace:Triangle3DInstance;
var face:Triangle3D;
var mat:MaterialObject3D;
var rc:RenderTriangle;
super.project(parent, renderSessionData);
if (!this.culled){
faces = this.geometry.faces;
screenZs = 0;
visibleFaces = 0;
triCuller = renderSessionData.triangleCuller;
for each (face in faces) {
mat = (face.material) ? face.material : material;
iFace = face.face3DInstance;
vertex0 = face.v0.vertex3DInstance;
vertex1 = face.v1.vertex3DInstance;
vertex2 = face.v2.vertex3DInstance;
if ((iFace.visible = triCuller.testFace(face, vertex0, vertex1, vertex2))){
screenZs = (screenZs + (iFace.screenZ = (((vertex0.z + vertex1.z) + vertex2.z) / 3)));
rc = face.renderCommand;
visibleFaces++;
rc.renderer = (mat as ITriangleDrawer);
rc.screenDepth = iFace.screenZ;
renderSessionData.renderer.addToRenderList(rc);
} else {
renderSessionData.renderStatistics.culledTriangles++;
};
};
return ((this.screenZ = (screenZs / visibleFaces)));
//unresolved jump
};
return (0);
}
public function projectTexture(u:String="x", v:String="y"):void{
var i:String;
var myFace:Triangle3D;
var myVertices:Array;
var a:Vertex3D;
var b:Vertex3D;
var c:Vertex3D;
var uvA:NumberUV;
var uvB:NumberUV;
var uvC:NumberUV;
var faces:Array = this.geometry.faces;
var bBox:Object = this.boundingBox();
var minX:Number = bBox.min[u];
var sizeX:Number = bBox.size[u];
var minY:Number = bBox.min[v];
var sizeY:Number = bBox.size[v];
var objectMaterial:MaterialObject3D = this.material;
for (i in faces) {
myFace = faces[Number(i)];
myVertices = myFace.vertices;
a = myVertices[0];
b = myVertices[1];
c = myVertices[2];
uvA = new NumberUV(((a[u] - minX) / sizeX), ((a[v] - minY) / sizeY));
uvB = new NumberUV(((b[u] - minX) / sizeX), ((b[v] - minY) / sizeY));
uvC = new NumberUV(((c[u] - minX) / sizeX), ((c[v] - minY) / sizeY));
myFace.uv = [uvA, uvB, uvC];
};
}
public function quarterFaces():void{
var face:Triangle3D;
var v0:Vertex3D;
var v1:Vertex3D;
var v2:Vertex3D;
var v01:Vertex3D;
var v12:Vertex3D;
var v20:Vertex3D;
var t0:NumberUV;
var t1:NumberUV;
var t2:NumberUV;
var t01:NumberUV;
var t12:NumberUV;
var t20:NumberUV;
var f0:Triangle3D;
var f1:Triangle3D;
var f2:Triangle3D;
var f3:Triangle3D;
var newverts:Array = new Array();
var newfaces:Array = new Array();
var faces:Array = this.geometry.faces;
var i:int = faces.length;
while ((face = faces[--i])) {
v0 = face.v0;
v1 = face.v1;
v2 = face.v2;
v01 = new Vertex3D(((v0.x + v1.x) / 2), ((v0.y + v1.y) / 2), ((v0.z + v1.z) / 2));
v12 = new Vertex3D(((v1.x + v2.x) / 2), ((v1.y + v2.y) / 2), ((v1.z + v2.z) / 2));
v20 = new Vertex3D(((v2.x + v0.x) / 2), ((v2.y + v0.y) / 2), ((v2.z + v0.z) / 2));
this.geometry.vertices.push(v01, v12, v20);
t0 = face.uv[0];
t1 = face.uv[1];
t2 = face.uv[2];
t01 = new NumberUV(((t0.u + t1.u) / 2), ((t0.v + t1.v) / 2));
t12 = new NumberUV(((t1.u + t2.u) / 2), ((t1.v + t2.v) / 2));
t20 = new NumberUV(((t2.u + t0.u) / 2), ((t2.v + t0.v) / 2));
f0 = new Triangle3D(this, [v0, v01, v20], face.material, [t0, t01, t20]);
f1 = new Triangle3D(this, [v01, v1, v12], face.material, [t01, t1, t12]);
f2 = new Triangle3D(this, [v20, v12, v2], face.material, [t20, t12, t2]);
f3 = new Triangle3D(this, [v01, v12, v20], face.material, [t01, t12, t20]);
newfaces.push(f0, f1, f2, f3);
};
this.geometry.faces = newfaces;
this.mergeVertices();
this.geometry.ready = true;
}
}
}//package org.papervision3d.core.geom
Section 332
//Vertices3D (org.papervision3d.core.geom.Vertices3D)
package org.papervision3d.core.geom {
import flash.geom.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.culling.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.math.*;
public class Vertices3D extends DisplayObject3D {
public function Vertices3D(vertices:Array, name:String=null, initObject:Object=null){
super(name, new GeometryObject3D(), initObject);
this.geometry.vertices = ((vertices) || (new Array()));
}
public function projectFrustum(parent:DisplayObject3D, renderSessionData:RenderSessionData):Number{
var vx:Number;
var vy:Number;
var vz:Number;
var s_x:Number;
var s_y:Number;
var s_z:Number;
var s_w:Number;
var vertex:Vertex3D;
var screen:Vertex3DInstance;
var view:Matrix3D = this.view;
var viewport:Rectangle = renderSessionData.camera.viewport;
var m11:Number = view.n11;
var m12:Number = view.n12;
var m13:Number = view.n13;
var m21:Number = view.n21;
var m22:Number = view.n22;
var m23:Number = view.n23;
var m31:Number = view.n31;
var m32:Number = view.n32;
var m33:Number = view.n33;
var m41:Number = view.n41;
var m42:Number = view.n42;
var m43:Number = view.n43;
var vpw:Number = (viewport.width / 2);
var vph:Number = (viewport.height / 2);
var vertices:Array = this.geometry.vertices;
var i:int = vertices.length;
while ((vertex = vertices[--i])) {
vx = vertex.x;
vy = vertex.y;
vz = vertex.z;
s_z = ((((vx * m31) + (vy * m32)) + (vz * m33)) + view.n34);
s_w = ((((vx * m41) + (vy * m42)) + (vz * m43)) + view.n44);
screen = vertex.vertex3DInstance;
s_z = (s_z / s_w);
if ((screen.visible = (((s_z > 0)) && ((s_z < 1))))){
s_x = (((((vx * m11) + (vy * m12)) + (vz * m13)) + view.n14) / s_w);
s_y = (((((vx * m21) + (vy * m22)) + (vz * m23)) + view.n24) / s_w);
screen.x = (s_x * vpw);
screen.y = (s_y * vph);
screen.z = s_z;
};
};
return (0);
}
override public function project(parent:DisplayObject3D, renderSessionData:RenderSessionData):Number{
var vx:Number;
var vy:Number;
var vz:Number;
var s_x:Number;
var s_y:Number;
var s_z:Number;
var vertex:Vertex3D;
var screen:Vertex3DInstance;
var persp:Number;
super.project(parent, renderSessionData);
if (this.culled){
return (0);
};
if ((renderSessionData.camera is IObjectCuller)){
return (projectFrustum(parent, renderSessionData));
};
var view:Matrix3D = this.view;
var m11:Number = view.n11;
var m12:Number = view.n12;
var m13:Number = view.n13;
var m21:Number = view.n21;
var m22:Number = view.n22;
var m23:Number = view.n23;
var m31:Number = view.n31;
var m32:Number = view.n32;
var m33:Number = view.n33;
var vertices:Array = this.geometry.vertices;
var i:int = vertices.length;
var focus:Number = renderSessionData.camera.focus;
var fz:Number = (focus * renderSessionData.camera.zoom);
while ((vertex = vertices[--i])) {
vx = vertex.x;
vy = vertex.y;
vz = vertex.z;
s_z = ((((vx * m31) + (vy * m32)) + (vz * m33)) + view.n34);
screen = vertex.vertex3DInstance;
if ((screen.visible = (s_z > 0))){
s_x = ((((vx * m11) + (vy * m12)) + (vz * m13)) + view.n14);
s_y = ((((vx * m21) + (vy * m22)) + (vz * m23)) + view.n24);
persp = (fz / (focus + s_z));
screen.x = (s_x * persp);
screen.y = (s_y * persp);
screen.z = s_z;
};
};
return (0);
}
public function transformVertices(transformation:Matrix3D):void{
var vertex:Vertex3D;
var vx:Number;
var vy:Number;
var vz:Number;
var tx:Number;
var ty:Number;
var tz:Number;
var m11:Number = transformation.n11;
var m12:Number = transformation.n12;
var m13:Number = transformation.n13;
var m21:Number = transformation.n21;
var m22:Number = transformation.n22;
var m23:Number = transformation.n23;
var m31:Number = transformation.n31;
var m32:Number = transformation.n32;
var m33:Number = transformation.n33;
var m14:Number = transformation.n14;
var m24:Number = transformation.n24;
var m34:Number = transformation.n34;
var vertices:Array = this.geometry.vertices;
var i:int = vertices.length;
while ((vertex = vertices[--i])) {
vx = vertex.x;
vy = vertex.y;
vz = vertex.z;
tx = ((((vx * m11) + (vy * m12)) + (vz * m13)) + m14);
ty = ((((vx * m21) + (vy * m22)) + (vz * m23)) + m24);
tz = ((((vx * m31) + (vy * m32)) + (vz * m33)) + m34);
vertex.x = tx;
vertex.y = ty;
vertex.z = tz;
};
}
public function boundingBox():Object{
var i:String;
var v:Vertex3D;
var vertices:Object = this.geometry.vertices;
var bBox:Object = new Object();
bBox.min = new Number3D();
bBox.max = new Number3D();
bBox.size = new Number3D();
for (i in vertices) {
v = vertices[Number(i)];
bBox.min.x = ((bBox.min.x)==undefined) ? v.x : Math.min(v.x, bBox.min.x);
bBox.max.x = ((bBox.max.x)==undefined) ? v.x : Math.max(v.x, bBox.max.x);
bBox.min.y = ((bBox.min.y)==undefined) ? v.y : Math.min(v.y, bBox.min.y);
bBox.max.y = ((bBox.max.y)==undefined) ? v.y : Math.max(v.y, bBox.max.y);
bBox.min.z = ((bBox.min.z)==undefined) ? v.z : Math.min(v.z, bBox.min.z);
bBox.max.z = ((bBox.max.z)==undefined) ? v.z : Math.max(v.z, bBox.max.z);
};
bBox.size.x = (bBox.max.x - bBox.min.x);
bBox.size.y = (bBox.max.y - bBox.min.y);
bBox.size.z = (bBox.max.z - bBox.min.z);
return (bBox);
}
}
}//package org.papervision3d.core.geom
Section 333
//TriangleMaterial (org.papervision3d.core.material.TriangleMaterial)
package org.papervision3d.core.material {
import flash.display.*;
import flash.geom.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.render.draw.*;
public class TriangleMaterial extends MaterialObject3D implements ITriangleDrawer {
public function TriangleMaterial(){
super();
}
override public function drawTriangle(face3D:Triangle3D, graphics:Graphics, renderSessionData:RenderSessionData, altBitmap:BitmapData=null, altUV:Matrix=null):void{
}
}
}//package org.papervision3d.core.material
Section 334
//Matrix3D (org.papervision3d.core.math.Matrix3D)
package org.papervision3d.core.math {
public class Matrix3D {
public var n31:Number;
public var n32:Number;
public var n11:Number;
public var n34:Number;
public var n13:Number;
public var n14:Number;
public var n33:Number;
public var n12:Number;
public var n41:Number;
public var n42:Number;
public var n21:Number;
public var n22:Number;
public var n23:Number;
public var n24:Number;
public var n44:Number;
public var n43:Number;
private static var _cos:Function = Math.cos;
private static var _sin:Function = Math.sin;
private static var toDEGREES:Number = 57.2957795130823;
private static var toRADIANS:Number = 0.0174532925199433;
public function Matrix3D(args:Array=null){
super();
if (((!(args)) || ((args.length < 12)))){
n11 = (n22 = (n33 = (n44 = 1)));
n12 = (n13 = (n14 = (n21 = (n23 = (n24 = (n31 = (n32 = (n34 = (n41 = (n42 = (n43 = 0)))))))))));
} else {
n11 = args[0];
n12 = args[1];
n13 = args[2];
n14 = args[3];
n21 = args[4];
n22 = args[5];
n23 = args[6];
n24 = args[7];
n31 = args[8];
n32 = args[9];
n33 = args[10];
n34 = args[11];
if (args.length == 16){
n41 = args[12];
n42 = args[13];
n43 = args[14];
n44 = args[15];
};
};
}
public function calculateMultiply3x3(a:Matrix3D, b:Matrix3D):void{
var a11:Number = a.n11;
var b11:Number = b.n11;
var a21:Number = a.n21;
var b21:Number = b.n21;
var a31:Number = a.n31;
var b31:Number = b.n31;
var a12:Number = a.n12;
var b12:Number = b.n12;
var a22:Number = a.n22;
var b22:Number = b.n22;
var a32:Number = a.n32;
var b32:Number = b.n32;
var a13:Number = a.n13;
var b13:Number = b.n13;
var a23:Number = a.n23;
var b23:Number = b.n23;
var a33:Number = a.n33;
var b33:Number = b.n33;
this.n11 = (((a11 * b11) + (a12 * b21)) + (a13 * b31));
this.n12 = (((a11 * b12) + (a12 * b22)) + (a13 * b32));
this.n13 = (((a11 * b13) + (a12 * b23)) + (a13 * b33));
this.n21 = (((a21 * b11) + (a22 * b21)) + (a23 * b31));
this.n22 = (((a21 * b12) + (a22 * b22)) + (a23 * b32));
this.n23 = (((a21 * b13) + (a22 * b23)) + (a23 * b33));
this.n31 = (((a31 * b11) + (a32 * b21)) + (a33 * b31));
this.n32 = (((a31 * b12) + (a32 * b22)) + (a33 * b32));
this.n33 = (((a31 * b13) + (a32 * b23)) + (a33 * b33));
}
public function get trace():Number{
return ((((this.n11 + this.n22) + this.n33) + 1));
}
public function calculateMultiply4x4(a:Matrix3D, b:Matrix3D):void{
var a11:Number = a.n11;
var b11:Number = b.n11;
var a21:Number = a.n21;
var b21:Number = b.n21;
var a31:Number = a.n31;
var b31:Number = b.n31;
var a41:Number = a.n41;
var b41:Number = b.n41;
var a12:Number = a.n12;
var b12:Number = b.n12;
var a22:Number = a.n22;
var b22:Number = b.n22;
var a32:Number = a.n32;
var b32:Number = b.n32;
var a42:Number = a.n42;
var b42:Number = b.n42;
var a13:Number = a.n13;
var b13:Number = b.n13;
var a23:Number = a.n23;
var b23:Number = b.n23;
var a33:Number = a.n33;
var b33:Number = b.n33;
var a43:Number = a.n43;
var b43:Number = b.n43;
var a14:Number = a.n14;
var b14:Number = b.n14;
var a24:Number = a.n24;
var b24:Number = b.n24;
var a34:Number = a.n34;
var b34:Number = b.n34;
var a44:Number = a.n44;
var b44:Number = b.n44;
this.n11 = (((a11 * b11) + (a12 * b21)) + (a13 * b31));
this.n12 = (((a11 * b12) + (a12 * b22)) + (a13 * b32));
this.n13 = (((a11 * b13) + (a12 * b23)) + (a13 * b33));
this.n14 = ((((a11 * b14) + (a12 * b24)) + (a13 * b34)) + a14);
this.n21 = (((a21 * b11) + (a22 * b21)) + (a23 * b31));
this.n22 = (((a21 * b12) + (a22 * b22)) + (a23 * b32));
this.n23 = (((a21 * b13) + (a22 * b23)) + (a23 * b33));
this.n24 = ((((a21 * b14) + (a22 * b24)) + (a23 * b34)) + a24);
this.n31 = (((a31 * b11) + (a32 * b21)) + (a33 * b31));
this.n32 = (((a31 * b12) + (a32 * b22)) + (a33 * b32));
this.n33 = (((a31 * b13) + (a32 * b23)) + (a33 * b33));
this.n34 = ((((a31 * b14) + (a32 * b24)) + (a33 * b34)) + a34);
this.n41 = (((a41 * b11) + (a42 * b21)) + (a43 * b31));
this.n42 = (((a41 * b12) + (a42 * b22)) + (a43 * b32));
this.n43 = (((a41 * b13) + (a42 * b23)) + (a43 * b33));
this.n44 = ((((a41 * b14) + (a42 * b24)) + (a43 * b34)) + a44);
}
public function get det():Number{
return ((((((this.n11 * this.n22) - (this.n21 * this.n12)) * this.n33) - (((this.n11 * this.n32) - (this.n31 * this.n12)) * this.n23)) + (((this.n21 * this.n32) - (this.n31 * this.n22)) * this.n13)));
}
public function copy(m:Matrix3D):Matrix3D{
this.n11 = m.n11;
this.n12 = m.n12;
this.n13 = m.n13;
this.n14 = m.n14;
this.n21 = m.n21;
this.n22 = m.n22;
this.n23 = m.n23;
this.n24 = m.n24;
this.n31 = m.n31;
this.n32 = m.n32;
this.n33 = m.n33;
this.n34 = m.n34;
return (this);
}
public function copy3x3(m:Matrix3D):Matrix3D{
this.n11 = m.n11;
this.n12 = m.n12;
this.n13 = m.n13;
this.n21 = m.n21;
this.n22 = m.n22;
this.n23 = m.n23;
this.n31 = m.n31;
this.n32 = m.n32;
this.n33 = m.n33;
return (this);
}
public function calculateAdd(a:Matrix3D, b:Matrix3D):void{
this.n11 = (a.n11 + b.n11);
this.n12 = (a.n12 + b.n12);
this.n13 = (a.n13 + b.n13);
this.n14 = (a.n14 + b.n14);
this.n21 = (a.n21 + b.n21);
this.n22 = (a.n22 + b.n22);
this.n23 = (a.n23 + b.n23);
this.n24 = (a.n24 + b.n24);
this.n31 = (a.n31 + b.n31);
this.n32 = (a.n32 + b.n32);
this.n33 = (a.n33 + b.n33);
this.n34 = (a.n34 + b.n34);
}
public function calculateMultiply(a:Matrix3D, b:Matrix3D):void{
var a11:Number = a.n11;
var b11:Number = b.n11;
var a21:Number = a.n21;
var b21:Number = b.n21;
var a31:Number = a.n31;
var b31:Number = b.n31;
var a12:Number = a.n12;
var b12:Number = b.n12;
var a22:Number = a.n22;
var b22:Number = b.n22;
var a32:Number = a.n32;
var b32:Number = b.n32;
var a13:Number = a.n13;
var b13:Number = b.n13;
var a23:Number = a.n23;
var b23:Number = b.n23;
var a33:Number = a.n33;
var b33:Number = b.n33;
var a14:Number = a.n14;
var b14:Number = b.n14;
var a24:Number = a.n24;
var b24:Number = b.n24;
var a34:Number = a.n34;
var b34:Number = b.n34;
this.n11 = (((a11 * b11) + (a12 * b21)) + (a13 * b31));
this.n12 = (((a11 * b12) + (a12 * b22)) + (a13 * b32));
this.n13 = (((a11 * b13) + (a12 * b23)) + (a13 * b33));
this.n14 = ((((a11 * b14) + (a12 * b24)) + (a13 * b34)) + a14);
this.n21 = (((a21 * b11) + (a22 * b21)) + (a23 * b31));
this.n22 = (((a21 * b12) + (a22 * b22)) + (a23 * b32));
this.n23 = (((a21 * b13) + (a22 * b23)) + (a23 * b33));
this.n24 = ((((a21 * b14) + (a22 * b24)) + (a23 * b34)) + a24);
this.n31 = (((a31 * b11) + (a32 * b21)) + (a33 * b31));
this.n32 = (((a31 * b12) + (a32 * b22)) + (a33 * b32));
this.n33 = (((a31 * b13) + (a32 * b23)) + (a33 * b33));
this.n34 = ((((a31 * b14) + (a32 * b24)) + (a33 * b34)) + a34);
}
public function calculateInverse(m:Matrix3D):void{
var m11:Number;
var m21:Number;
var m31:Number;
var m12:Number;
var m22:Number;
var m32:Number;
var m13:Number;
var m23:Number;
var m33:Number;
var m14:Number;
var m24:Number;
var m34:Number;
var d:Number = m.det;
if (Math.abs(d) > 0.001){
d = (1 / d);
m11 = m.n11;
m21 = m.n21;
m31 = m.n31;
m12 = m.n12;
m22 = m.n22;
m32 = m.n32;
m13 = m.n13;
m23 = m.n23;
m33 = m.n33;
m14 = m.n14;
m24 = m.n24;
m34 = m.n34;
this.n11 = (d * ((m22 * m33) - (m32 * m23)));
this.n12 = (-(d) * ((m12 * m33) - (m32 * m13)));
this.n13 = (d * ((m12 * m23) - (m22 * m13)));
this.n14 = (-(d) * (((m12 * ((m23 * m34) - (m33 * m24))) - (m22 * ((m13 * m34) - (m33 * m14)))) + (m32 * ((m13 * m24) - (m23 * m14)))));
this.n21 = (-(d) * ((m21 * m33) - (m31 * m23)));
this.n22 = (d * ((m11 * m33) - (m31 * m13)));
this.n23 = (-(d) * ((m11 * m23) - (m21 * m13)));
this.n24 = (d * (((m11 * ((m23 * m34) - (m33 * m24))) - (m21 * ((m13 * m34) - (m33 * m14)))) + (m31 * ((m13 * m24) - (m23 * m14)))));
this.n31 = (d * ((m21 * m32) - (m31 * m22)));
this.n32 = (-(d) * ((m11 * m32) - (m31 * m12)));
this.n33 = (d * ((m11 * m22) - (m21 * m12)));
this.n34 = (-(d) * (((m11 * ((m22 * m34) - (m32 * m24))) - (m21 * ((m12 * m34) - (m32 * m14)))) + (m31 * ((m12 * m24) - (m22 * m14)))));
};
}
public function toString():String{
var s:String = "";
s = (s + ((((((((int((n11 * 1000)) / 1000) + "\t\t") + (int((n12 * 1000)) / 1000)) + "\t\t") + (int((n13 * 1000)) / 1000)) + "\t\t") + (int((n14 * 1000)) / 1000)) + "\n"));
s = (s + ((((((((int((n21 * 1000)) / 1000) + "\t\t") + (int((n22 * 1000)) / 1000)) + "\t\t") + (int((n23 * 1000)) / 1000)) + "\t\t") + (int((n24 * 1000)) / 1000)) + "\n"));
s = (s + ((((((((int((n31 * 1000)) / 1000) + "\t\t") + (int((n32 * 1000)) / 1000)) + "\t\t") + (int((n33 * 1000)) / 1000)) + "\t\t") + (int((n34 * 1000)) / 1000)) + "\n"));
s = (s + ((((((((int((n41 * 1000)) / 1000) + "\t\t") + (int((n42 * 1000)) / 1000)) + "\t\t") + (int((n43 * 1000)) / 1000)) + "\t\t") + (int((n44 * 1000)) / 1000)) + "\n"));
return (s);
}
public static function rotationMatrixWithReference(axis:Number3D, rad:Number, ref:Number3D):Matrix3D{
var m:Matrix3D = Matrix3D.translationMatrix(ref.x, -(ref.y), ref.z);
m.calculateMultiply(m, Matrix3D.rotationMatrix(axis.x, axis.y, axis.z, rad));
m.calculateMultiply(m, Matrix3D.translationMatrix(-(ref.x), ref.y, -(ref.z)));
return (m);
}
public static function multiplyVector3x3(m:Matrix3D, v:Number3D):void{
var vx:Number = v.x;
var vy:Number = v.y;
var vz:Number = v.z;
v.x = (((vx * m.n11) + (vy * m.n12)) + (vz * m.n13));
v.y = (((vx * m.n21) + (vy * m.n22)) + (vz * m.n23));
v.z = (((vx * m.n31) + (vy * m.n32)) + (vz * m.n33));
}
public static function multiply3x3(a:Matrix3D, b:Matrix3D):Matrix3D{
var m:Matrix3D = new (Matrix3D);
m.calculateMultiply3x3(a, b);
return (m);
}
public static function normalizeQuaternion(q:Object):Object{
var mag:Number = magnitudeQuaternion(q);
q.x = (q.x / mag);
q.y = (q.y / mag);
q.z = (q.z / mag);
q.w = (q.w / mag);
return (q);
}
public static function multiplyVector(m:Matrix3D, v:Number3D):void{
var vx:Number = v.x;
var vy:Number = v.y;
var vz:Number = v.z;
v.x = ((((vx * m.n11) + (vy * m.n12)) + (vz * m.n13)) + m.n14);
v.y = ((((vx * m.n21) + (vy * m.n22)) + (vz * m.n23)) + m.n24);
v.z = ((((vx * m.n31) + (vy * m.n32)) + (vz * m.n33)) + m.n34);
}
public static function axis2quaternion(x:Number, y:Number, z:Number, angle:Number):Object{
var sin:Number = Math.sin((angle / 2));
var cos:Number = Math.cos((angle / 2));
var q:Object = new Object();
q.x = (x * sin);
q.y = (y * sin);
q.z = (z * sin);
q.w = cos;
return (normalizeQuaternion(q));
}
public static function translationMatrix(x:Number, y:Number, z:Number):Matrix3D{
var m:Matrix3D = IDENTITY;
m.n14 = x;
m.n24 = y;
m.n34 = z;
return (m);
}
public static function magnitudeQuaternion(q:Object):Number{
return (Math.sqrt(((((q.w * q.w) + (q.x * q.x)) + (q.y * q.y)) + (q.z * q.z))));
}
public static function euler2quaternion(ax:Number, ay:Number, az:Number):Object{
var fSinPitch:Number = Math.sin((ax * 0.5));
var fCosPitch:Number = Math.cos((ax * 0.5));
var fSinYaw:Number = Math.sin((ay * 0.5));
var fCosYaw:Number = Math.cos((ay * 0.5));
var fSinRoll:Number = Math.sin((az * 0.5));
var fCosRoll:Number = Math.cos((az * 0.5));
var fCosPitchCosYaw:Number = (fCosPitch * fCosYaw);
var fSinPitchSinYaw:Number = (fSinPitch * fSinYaw);
var q:Object = new Object();
q.x = ((fSinRoll * fCosPitchCosYaw) - (fCosRoll * fSinPitchSinYaw));
q.y = (((fCosRoll * fSinPitch) * fCosYaw) + ((fSinRoll * fCosPitch) * fSinYaw));
q.z = (((fCosRoll * fCosPitch) * fSinYaw) - ((fSinRoll * fSinPitch) * fCosYaw));
q.w = ((fCosRoll * fCosPitchCosYaw) + (fSinRoll * fSinPitchSinYaw));
return (q);
}
public static function rotationX(rad:Number):Matrix3D{
var m:Matrix3D = IDENTITY;
var c:Number = Math.cos(rad);
var s:Number = Math.sin(rad);
m.n22 = c;
m.n23 = -(s);
m.n32 = s;
m.n33 = c;
return (m);
}
public static function rotationY(rad:Number):Matrix3D{
var m:Matrix3D = IDENTITY;
var c:Number = Math.cos(rad);
var s:Number = Math.sin(rad);
m.n11 = c;
m.n13 = -(s);
m.n31 = s;
m.n33 = c;
return (m);
}
public static function rotationZ(rad:Number):Matrix3D{
var m:Matrix3D = IDENTITY;
var c:Number = Math.cos(rad);
var s:Number = Math.sin(rad);
m.n11 = c;
m.n12 = -(s);
m.n21 = s;
m.n22 = c;
return (m);
}
public static function clone(m:Matrix3D):Matrix3D{
return (new Matrix3D([m.n11, m.n12, m.n13, m.n14, m.n21, m.n22, m.n23, m.n24, m.n31, m.n32, m.n33, m.n34]));
}
public static function rotationMatrix(x:Number, y:Number, z:Number, rad:Number):Matrix3D{
var m:Matrix3D = IDENTITY;
var nCos:Number = Math.cos(rad);
var nSin:Number = Math.sin(rad);
var scos:Number = (1 - nCos);
var sxy:Number = ((x * y) * scos);
var syz:Number = ((y * z) * scos);
var sxz:Number = ((x * z) * scos);
var sz:Number = (nSin * z);
var sy:Number = (nSin * y);
var sx:Number = (nSin * x);
m.n11 = (nCos + ((x * x) * scos));
m.n12 = (-(sz) + sxy);
m.n13 = (sy + sxz);
m.n21 = (sz + sxy);
m.n22 = (nCos + ((y * y) * scos));
m.n23 = (-(sx) + syz);
m.n31 = (-(sy) + sxz);
m.n32 = (sx + syz);
m.n33 = (nCos + ((z * z) * scos));
return (m);
}
public static function add(a:Matrix3D, b:Matrix3D):Matrix3D{
var m:Matrix3D = new (Matrix3D);
m.calculateAdd(a, b);
return (m);
}
public static function rotateAxis(m:Matrix3D, v:Number3D):void{
var vx:Number = v.x;
var vy:Number = v.y;
var vz:Number = v.z;
v.x = (((vx * m.n11) + (vy * m.n12)) + (vz * m.n13));
v.y = (((vx * m.n21) + (vy * m.n22)) + (vz * m.n23));
v.z = (((vx * m.n31) + (vy * m.n32)) + (vz * m.n33));
v.normalize();
}
public static function multiply(a:Matrix3D, b:Matrix3D):Matrix3D{
var m:Matrix3D = new (Matrix3D);
m.calculateMultiply(a, b);
return (m);
}
public static function multiplyQuaternion(a:Object, b:Object):Object{
var ax:Number = a.x;
var ay:Number = a.y;
var az:Number = a.z;
var aw:Number = a.w;
var bx:Number = b.x;
var by:Number = b.y;
var bz:Number = b.z;
var bw:Number = b.w;
var q:Object = new Object();
q.x = ((((aw * bx) + (ax * bw)) + (ay * bz)) - (az * by));
q.y = ((((aw * by) + (ay * bw)) + (az * bx)) - (ax * bz));
q.z = ((((aw * bz) + (az * bw)) + (ax * by)) - (ay * bx));
q.w = ((((aw * bw) - (ax * bx)) - (ay * by)) - (az * bz));
return (q);
}
public static function euler2matrix(deg:Number3D):Matrix3D{
var m:Matrix3D = IDENTITY;
var ax:Number = (deg.x * toRADIANS);
var ay:Number = (deg.y * toRADIANS);
var az:Number = (deg.z * toRADIANS);
var a:Number = Math.cos(ax);
var b:Number = Math.sin(ax);
var c:Number = Math.cos(ay);
var d:Number = Math.sin(ay);
var e:Number = Math.cos(az);
var f:Number = Math.sin(az);
var ad:Number = (a * d);
var bd:Number = (b * d);
m.n11 = (c * e);
m.n12 = (-(c) * f);
m.n13 = d;
m.n21 = ((bd * e) + (a * f));
m.n22 = ((-(bd) * f) + (a * e));
m.n23 = (-(b) * c);
m.n31 = ((-(ad) * e) + (b * f));
m.n32 = ((ad * f) + (b * e));
m.n33 = (a * c);
return (m);
}
public static function scaleMatrix(x:Number, y:Number, z:Number):Matrix3D{
var m:Matrix3D = IDENTITY;
m.n11 = x;
m.n22 = y;
m.n33 = z;
return (m);
}
public static function quaternion2matrix(x:Number, y:Number, z:Number, w:Number):Matrix3D{
var xx:Number = (x * x);
var xy:Number = (x * y);
var xz:Number = (x * z);
var xw:Number = (x * w);
var yy:Number = (y * y);
var yz:Number = (y * z);
var yw:Number = (y * w);
var zz:Number = (z * z);
var zw:Number = (z * w);
var m:Matrix3D = IDENTITY;
m.n11 = (1 - (2 * (yy + zz)));
m.n12 = (2 * (xy - zw));
m.n13 = (2 * (xz + yw));
m.n21 = (2 * (xy + zw));
m.n22 = (1 - (2 * (xx + zz)));
m.n23 = (2 * (yz - xw));
m.n31 = (2 * (xz - yw));
m.n32 = (2 * (yz + xw));
m.n33 = (1 - (2 * (xx + yy)));
return (m);
}
public static function inverse(m:Matrix3D):Matrix3D{
var inv:Matrix3D = new (Matrix3D);
inv.calculateInverse(m);
return (inv);
}
public static function matrix2euler(t:Matrix3D):Number3D{
var rot:Number3D = new Number3D();
var i:Number3D = new Number3D(t.n11, t.n21, t.n31);
var j:Number3D = new Number3D(t.n12, t.n22, t.n32);
var k:Number3D = new Number3D(t.n13, t.n23, t.n33);
i.normalize();
j.normalize();
k.normalize();
var m:Matrix3D = new Matrix3D([i.x, j.x, k.x, 0, i.y, j.y, k.y, 0, i.z, j.z, k.z, 0]);
rot.x = Math.atan2(m.n23, m.n33);
var rx:Matrix3D = Matrix3D.rotationX(-(rot.x));
var n:Matrix3D = Matrix3D.multiply(rx, m);
var cy:Number = Math.sqrt(((n.n11 * n.n11) + (n.n21 * n.n21)));
rot.y = Math.atan2(-(n.n31), cy);
rot.z = Math.atan2(-(n.n12), n.n11);
if (rot.x == Math.PI){
if (rot.y > 0){
rot.y = (rot.y - Math.PI);
} else {
rot.y = (rot.y + Math.PI);
};
rot.x = 0;
rot.z = (rot.z + Math.PI);
};
rot.x = (rot.x * toDEGREES);
rot.y = (rot.y * toDEGREES);
rot.z = (rot.z * toDEGREES);
return (rot);
}
public static function get IDENTITY():Matrix3D{
return (new Matrix3D([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]));
}
}
}//package org.papervision3d.core.math
Section 335
//Number3D (org.papervision3d.core.math.Number3D)
package org.papervision3d.core.math {
public class Number3D {
public var x:Number;
public var y:Number;
public var z:Number;
public function Number3D(x:Number=0, y:Number=0, z:Number=0){
super();
this.x = x;
this.y = y;
this.z = z;
}
public function get modulo():Number{
return (Math.sqrt((((this.x * this.x) + (this.y * this.y)) + (this.z * this.z))));
}
public function copyTo(n:Number3D):void{
n.x = x;
n.y = y;
n.z = z;
}
public function toString():String{
return (((((("x:" + x) + " y:") + y) + " z:") + z));
}
public function normalize():void{
var mod:Number = this.modulo;
if (((!((mod == 0))) && (!((mod == 1))))){
this.x = (this.x / mod);
this.y = (this.y / mod);
this.z = (this.z / mod);
};
}
public function clone():Number3D{
return (new Number3D(this.x, this.y, this.z));
}
public static function sub(v:Number3D, w:Number3D):Number3D{
return (new Number3D((v.x - w.x), (v.y - w.y), (v.z - w.z)));
}
public static function add(v:Number3D, w:Number3D):Number3D{
return (new Number3D((v.x + w.x), (v.y + w.y), (v.z + w.z)));
}
public static function cross(v:Number3D, w:Number3D):Number3D{
return (new Number3D(((w.y * v.z) - (w.z * v.y)), ((w.z * v.x) - (w.x * v.z)), ((w.x * v.y) - (w.y * v.x))));
}
public static function get ZERO():Number3D{
return (new Number3D(0, 0, 0));
}
public static function dot(v:Number3D, w:Number3D):Number{
return ((((v.x * w.x) + (v.y * w.y)) + (w.z * v.z)));
}
}
}//package org.papervision3d.core.math
Section 336
//NumberUV (org.papervision3d.core.math.NumberUV)
package org.papervision3d.core.math {
public class NumberUV {
public var u:Number;
public var v:Number;
public function NumberUV(u:Number=0, v:Number=0){
super();
this.u = u;
this.v = v;
}
public function toString():String{
return (((("u:" + u) + " v:") + v));
}
public function clone():NumberUV{
return (new NumberUV(this.u, this.v));
}
public static function get ZERO():NumberUV{
return (new NumberUV(0, 0));
}
}
}//package org.papervision3d.core.math
Section 337
//pv3dview (org.papervision3d.core.ns.pv3dview)
package org.papervision3d.core.ns {
public namespace pv3dview;
}//package org.papervision3d.core.ns
Section 338
//CameraObject3D (org.papervision3d.core.proto.CameraObject3D)
package org.papervision3d.core.proto {
import flash.geom.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.math.*;
public class CameraObject3D extends DisplayObject3D {
public var viewport:Rectangle;
public var eye:Matrix3D;
public var zoom:Number;
public var focus:Number;
public var sort:Boolean;
public static const TYPE:String = "ABSTRACT";
public static var DEFAULT_POS:Number3D = new Number3D(0, 0, -1000);
private static var _flipY:Matrix3D = Matrix3D.scaleMatrix(1, -1, 1);
public function CameraObject3D(zoom:Number=3, focus:Number=500, initObject:Object=null){
super();
this.x = (initObject) ? ((initObject.x) || (DEFAULT_POS.x)) : DEFAULT_POS.x;
this.y = (initObject) ? ((initObject.y) || (DEFAULT_POS.y)) : DEFAULT_POS.y;
this.z = (initObject) ? ((initObject.z) || (DEFAULT_POS.z)) : DEFAULT_POS.z;
this.zoom = zoom;
this.focus = focus;
this.eye = Matrix3D.IDENTITY;
this.sort = (initObject) ? !((initObject.sort == false)) : true;
}
public function transformView(transform:Matrix3D=null):void{
this.eye = Matrix3D.inverse(Matrix3D.multiply(((transform) || (this.transform)), _flipY));
}
public function pan(angle:Number):void{
super.yaw(angle);
}
public function tilt(angle:Number):void{
super.pitch(angle);
}
}
}//package org.papervision3d.core.proto
Section 339
//DisplayObjectContainer3D (org.papervision3d.core.proto.DisplayObjectContainer3D)
package org.papervision3d.core.proto {
import flash.events.*;
import org.papervision3d.materials.utils.*;
import org.papervision3d.objects.*;
import flash.utils.*;
import org.papervision3d.*;
public class DisplayObjectContainer3D extends EventDispatcher {
public var root:DisplayObjectContainer3D;
private var _childrenTotal:int;
protected var _childrenByName:Object;
protected var _children:Dictionary;
public function DisplayObjectContainer3D():void{
super();
this._children = new Dictionary(false);
this._childrenByName = new Dictionary(true);
this._childrenTotal = 0;
}
public function addChildren(parent:DisplayObject3D):DisplayObjectContainer3D{
var child:DisplayObject3D;
for each (child in parent.children) {
parent.removeChild(child);
this.addChild(child);
};
return (this);
}
public function get numChildren():int{
return (this._childrenTotal);
}
public function getChildByName(name:String):DisplayObject3D{
return (this._childrenByName[name]);
}
override public function toString():String{
return (childrenList());
}
public function addCollada(filename:String, materials:MaterialsList=null, scale:Number=1):void{
Papervision3D.log("The addCollada() method has been deprecated. Use addChildren( new Collada( filename ) )");
}
public function removeChild(child:DisplayObject3D):DisplayObject3D{
if (child){
delete this._childrenByName[this._children[child]];
delete this._children[child];
child.parent = null;
child.root = null;
return (child);
};
return (null);
}
public function removeChildByName(name:String):DisplayObject3D{
return (removeChild(getChildByName(name)));
}
public function addChild(child:DisplayObject3D, name:String=null):DisplayObject3D{
name = ((((name) || (child.name))) || (String(child.id)));
this._children[child] = name;
this._childrenByName[name] = child;
this._childrenTotal++;
child.parent = this;
child.root = this.root;
return (child);
}
public function childrenList():String{
var name:String;
var list:String = "";
for (name in this._children) {
list = (list + (name + "\n"));
};
return (list);
}
public function get children():Object{
return (this._childrenByName);
}
}
}//package org.papervision3d.core.proto
Section 340
//GeometryObject3D (org.papervision3d.core.proto.GeometryObject3D)
package org.papervision3d.core.proto {
import flash.events.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.math.*;
import flash.utils.*;
public class GeometryObject3D extends EventDispatcher {
protected var _boundingSphere2:Number;
protected var _boundingSphereDirty:Boolean;// = true
public var _ready:Boolean;// = false
public var dirty:Boolean;
public var faces:Array;
public var vertices:Array;
public function GeometryObject3D(initObject:Object=null):void{
super();
this.dirty = true;
}
public function get boundingSphere2():Number{
if (_boundingSphereDirty){
return (getBoundingSphere2());
};
return (_boundingSphere2);
}
public function get ready():Boolean{
return (_ready);
}
public function transformVertices(transformation:Matrix3D):void{
}
public function set ready(b:Boolean):void{
if (b){
createVertexNormals();
this.dirty = false;
};
_ready = b;
}
public function transformUV(material:MaterialObject3D):void{
var i:String;
if (material.bitmap){
for (i in this.faces) {
faces[i].transformUV(material);
};
};
}
public function getBoundingSphere2():Number{
var d:Number;
var v:Vertex3D;
var max:Number = 0;
for each (v in this.vertices) {
d = (((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
max = ((d)>max) ? d : max;
};
this._boundingSphereDirty = false;
return ((_boundingSphere2 = max));
}
private function createVertexNormals():void{
var face:Triangle3D;
var vertex3D:Vertex3D;
var tempVertices:Dictionary = new Dictionary(true);
for each (face in faces) {
face.v0.connectedFaces[face] = face;
face.v1.connectedFaces[face] = face;
face.v2.connectedFaces[face] = face;
tempVertices[face.v0] = face.v0;
tempVertices[face.v1] = face.v1;
tempVertices[face.v2] = face.v2;
};
for each (vertex3D in tempVertices) {
vertex3D.calculateNormal();
};
}
}
}//package org.papervision3d.core.proto
Section 341
//MaterialObject3D (org.papervision3d.core.proto.MaterialObject3D)
package org.papervision3d.core.proto {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.render.material.*;
import flash.utils.*;
import org.papervision3d.core.render.draw.*;
import org.papervision3d.materials.*;
public class MaterialObject3D extends EventDispatcher implements ITriangleDrawer {
public var widthOffset:Number;// = 0
public var name:String;
public var scene:SceneObject3D;
protected var objects:Dictionary;
public var heightOffset:Number;// = 0
public var fillColor:Number;
public var fillAlpha:Number;// = 0
public var id:Number;
public var invisible:Boolean;// = false
public var smooth:Boolean;// = false
public var bitmap:BitmapData;
public var lineAlpha:Number;// = 0
public var lineColor:Number;
public var lineThickness:Number;// = 1
public var interactive:Boolean;// = false
public var oneSide:Boolean;// = true
public var opposite:Boolean;// = false
public var maxU:Number;
public var tiled:Boolean;// = false
public var maxV:Number;
public static var DEFAULT_COLOR:int = 0;
public static var DEBUG_COLOR:int = 0xFF00FF;
private static var _totalMaterialObjects:Number = 0;
public function MaterialObject3D(){
lineColor = DEFAULT_COLOR;
fillColor = DEFAULT_COLOR;
super();
this.id = _totalMaterialObjects++;
MaterialManager.registerMaterial(this);
objects = new Dictionary();
}
override public function toString():String{
return (((((("[MaterialObject3D] bitmap:" + this.bitmap) + " lineColor:") + this.lineColor) + " fillColor:") + fillColor));
}
public function get doubleSided():Boolean{
return (!(this.oneSide));
}
public function unregisterObject(displayObject3D:DisplayObject3D):void{
if (objects[displayObject3D] != null){
delete objects[displayObject3D];
};
}
public function set doubleSided(double:Boolean):void{
this.oneSide = !(double);
}
public function registerObject(displayObject3D:DisplayObject3D):void{
objects[displayObject3D] = displayObject3D;
}
public function updateBitmap():void{
}
public function clone():MaterialObject3D{
var cloned:MaterialObject3D = new MaterialObject3D();
cloned.copy(this);
return (cloned);
}
public function copy(material:MaterialObject3D):void{
this.bitmap = material.bitmap;
this.smooth = material.smooth;
this.lineColor = material.lineColor;
this.lineAlpha = material.lineAlpha;
this.fillColor = material.fillColor;
this.fillAlpha = material.fillAlpha;
this.oneSide = material.oneSide;
this.opposite = material.opposite;
this.invisible = material.invisible;
this.scene = material.scene;
this.name = material.name;
this.maxU = material.maxU;
this.maxV = material.maxV;
}
protected function destroy():void{
MaterialManager.unRegisterMaterial(this);
}
public function drawTriangle(face3D:Triangle3D, graphics:Graphics, renderSessionData:RenderSessionData, altBitmap:BitmapData=null, altUV:Matrix=null):void{
}
public static function get DEFAULT():MaterialObject3D{
var defMaterial:MaterialObject3D = new WireframeMaterial();
defMaterial.lineColor = (0xFFFFFF * Math.random());
defMaterial.lineAlpha = 1;
defMaterial.fillColor = DEFAULT_COLOR;
defMaterial.fillAlpha = 1;
defMaterial.doubleSided = false;
return (defMaterial);
}
public static function get DEBUG():MaterialObject3D{
var defMaterial:MaterialObject3D = new (MaterialObject3D);
defMaterial.lineColor = (0xFFFFFF * Math.random());
defMaterial.lineAlpha = 1;
defMaterial.fillColor = DEBUG_COLOR;
defMaterial.fillAlpha = 0.37;
defMaterial.doubleSided = true;
return (defMaterial);
}
}
}//package org.papervision3d.core.proto
Section 342
//SceneObject3D (org.papervision3d.core.proto.SceneObject3D)
package org.papervision3d.core.proto {
import org.papervision3d.materials.utils.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.animation.core.*;
import org.papervision3d.*;
public class SceneObject3D extends DisplayObjectContainer3D {
public var animated:Boolean;// = false
public var objects:Array;
public var materials:MaterialsList;
public var animationEngine:AnimationEngine;
public function SceneObject3D(){
super();
this.objects = new Array();
this.materials = new MaterialsList();
Papervision3D.log((((((Papervision3D.NAME + " ") + Papervision3D.VERSION) + " (") + Papervision3D.DATE) + ")\n"));
trace("PV3D 2.0a WARNING : DO NOT USE WITH BETA 9 PLAYERS. ONLY WITH OFFICIAL TO TEST.");
trace("CHECK YOUR VERSION!");
this.root = this;
}
override public function addChild(child:DisplayObject3D, name:String=null):DisplayObject3D{
var newChild:DisplayObject3D = super.addChild(child, (name) ? name : child.name);
child.scene = this;
this.objects.push(newChild);
return (newChild);
}
override public function removeChild(child:DisplayObject3D):DisplayObject3D{
super.removeChild(child);
var i:int;
while (i < this.objects.length) {
if (this.objects[i] === child){
this.objects.splice(i, 1);
return (child);
};
i++;
};
return (child);
}
}
}//package org.papervision3d.core.proto
Section 343
//AbstractRenderListItem (org.papervision3d.core.render.command.AbstractRenderListItem)
package org.papervision3d.core.render.command {
import org.papervision3d.core.render.data.*;
public class AbstractRenderListItem implements IRenderListItem {
public var screenDepth:Number;
public function AbstractRenderListItem(){
super();
}
public function render(renderSessionData:RenderSessionData):void{
}
}
}//package org.papervision3d.core.render.command
Section 344
//IRenderListItem (org.papervision3d.core.render.command.IRenderListItem)
package org.papervision3d.core.render.command {
import org.papervision3d.core.render.data.*;
public interface IRenderListItem {
function render(:RenderSessionData):void;
}
}//package org.papervision3d.core.render.command
Section 345
//RenderableListItem (org.papervision3d.core.render.command.RenderableListItem)
package org.papervision3d.core.render.command {
import flash.geom.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
public class RenderableListItem extends AbstractRenderListItem {
public var renderable:Class;
public var renderableInstance:IRenderable;
public function RenderableListItem(){
super();
}
public function hitTestPoint2D(point:Point, renderHitData:RenderHitData):RenderHitData{
return (renderHitData);
}
}
}//package org.papervision3d.core.render.command
Section 346
//RenderParticle (org.papervision3d.core.render.command.RenderParticle)
package org.papervision3d.core.render.command {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.materials.special.*;
public class RenderParticle extends RenderableListItem implements IRenderListItem {
public var particle:Particle;
public var renderer:ParticleMaterial;
public function RenderParticle(particle:Particle){
super();
this.particle = particle;
}
override public function render(renderSessionData:RenderSessionData):void{
particle.material.drawParticle(particle, renderSessionData.container.graphics, renderSessionData);
}
}
}//package org.papervision3d.core.render.command
Section 347
//RenderTriangle (org.papervision3d.core.render.command.RenderTriangle)
package org.papervision3d.core.render.command {
import flash.display.*;
import flash.geom.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.math.*;
import org.papervision3d.core.render.draw.*;
import org.papervision3d.materials.*;
public class RenderTriangle extends RenderableListItem implements IRenderListItem {
public var container:Sprite;
public var renderer:ITriangleDrawer;
public var triangle:Triangle3D;
private var position:Number3D;
public var renderMat:MaterialObject3D;
public function RenderTriangle(triangle:Triangle3D):void{
position = new Number3D();
super();
this.triangle = triangle;
renderableInstance = triangle;
renderable = Triangle3D;
}
override public function hitTestPoint2D(point:Point, renderhitData:RenderHitData):RenderHitData{
var vPoint:Vertex3DInstance;
var vx0:Vertex3DInstance;
var vx1:Vertex3DInstance;
var vx2:Vertex3DInstance;
renderMat = triangle.material;
if (!renderMat){
renderMat = triangle.instance.material;
};
if (renderMat.interactive){
vPoint = new Vertex3DInstance(point.x, point.y);
vx0 = triangle.v0.vertex3DInstance;
vx1 = triangle.v1.vertex3DInstance;
vx2 = triangle.v2.vertex3DInstance;
if (sameSide(vPoint, vx0, vx1, vx2)){
if (sameSide(vPoint, vx1, vx0, vx2)){
if (sameSide(vPoint, vx2, vx0, vx1)){
return (deepHitTest(triangle, vPoint, renderhitData));
};
};
};
};
return (renderhitData);
}
public function sameSide(point:Vertex3DInstance, ref:Vertex3DInstance, a:Vertex3DInstance, b:Vertex3DInstance):Boolean{
var n:Number = (Vertex3DInstance.cross(Vertex3DInstance.sub(b, a), Vertex3DInstance.sub(point, a)) * Vertex3DInstance.cross(Vertex3DInstance.sub(b, a), Vertex3DInstance.sub(ref, a)));
return ((n > 0));
}
override public function render(renderSessionData:RenderSessionData):void{
renderer.drawTriangle(triangle, renderSessionData.container.graphics, renderSessionData);
}
private function deepHitTest(face:Triangle3D, vPoint:Vertex3DInstance, rhd:RenderHitData):RenderHitData{
var v0:Vertex3DInstance = face.v0.vertex3DInstance;
var v1:Vertex3DInstance = face.v1.vertex3DInstance;
var v2:Vertex3DInstance = face.v2.vertex3DInstance;
var v0_x:Number = (v2.x - v0.x);
var v0_y:Number = (v2.y - v0.y);
var v1_x:Number = (v1.x - v0.x);
var v1_y:Number = (v1.y - v0.y);
var v2_x:Number = (vPoint.x - v0.x);
var v2_y:Number = (vPoint.y - v0.y);
var dot00:Number = ((v0_x * v0_x) + (v0_y * v0_y));
var dot01:Number = ((v0_x * v1_x) + (v0_y * v1_y));
var dot02:Number = ((v0_x * v2_x) + (v0_y * v2_y));
var dot11:Number = ((v1_x * v1_x) + (v1_y * v1_y));
var dot12:Number = ((v1_x * v2_x) + (v1_y * v2_y));
var invDenom:Number = (1 / ((dot00 * dot11) - (dot01 * dot01)));
var u:Number = (((dot11 * dot02) - (dot01 * dot12)) * invDenom);
var v:Number = (((dot00 * dot12) - (dot01 * dot02)) * invDenom);
var rv0_x:Number = (face.v2.x - face.v0.x);
var rv0_y:Number = (face.v2.y - face.v0.y);
var rv0_z:Number = (face.v2.z - face.v0.z);
var rv1_x:Number = (face.v1.x - face.v0.x);
var rv1_y:Number = (face.v1.y - face.v0.y);
var rv1_z:Number = (face.v1.z - face.v0.z);
var hx:Number = ((face.v0.x + (rv0_x * u)) + (rv1_x * v));
var hy:Number = ((face.v0.y + (rv0_y * u)) + (rv1_y * v));
var hz:Number = ((face.v0.z + (rv0_z * u)) + (rv1_z * v));
var uv:Array = face.uv;
var uu0:Number = uv[0].u;
var uu1:Number = uv[1].u;
var uu2:Number = uv[2].u;
var uv0:Number = uv[0].v;
var uv1:Number = uv[1].v;
var uv2:Number = uv[2].v;
var v_x:Number = ((((uu1 - uu0) * v) + ((uu2 - uu0) * u)) + uu0);
var v_y:Number = ((((uv1 - uv0) * v) + ((uv2 - uv0) * u)) + uv0);
if (triangle.material){
renderMat = face.material;
} else {
renderMat = face.instance.material;
};
var bitmap:BitmapData = renderMat.bitmap;
var width:Number = 1;
var height:Number = 1;
if (bitmap){
width = (BitmapMaterial.AUTO_MIP_MAPPING) ? renderMat.widthOffset : bitmap.width;
height = (BitmapMaterial.AUTO_MIP_MAPPING) ? renderMat.heightOffset : bitmap.height;
};
rhd.displayObject3D = face.instance;
rhd.material = renderMat;
rhd.renderable = face;
rhd.hasHit = true;
position.x = hx;
position.y = hy;
position.z = hz;
Matrix3D.multiplyVector(face.instance.world, position);
rhd.x = position.x;
rhd.y = position.y;
rhd.z = position.z;
rhd.u = (v_x * width);
rhd.v = (height - (v_y * height));
return (rhd);
}
}
}//package org.papervision3d.core.render.command
Section 348
//RenderHitData (org.papervision3d.core.render.data.RenderHitData)
package org.papervision3d.core.render.data {
import org.papervision3d.core.proto.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.geom.renderables.*;
public class RenderHitData {
public var material:MaterialObject3D;
public var endTime:int;// = 0
public var startTime:int;// = 0
public var hasHit:Boolean;// = false
public var displayObject3D:DisplayObject3D;
public var u:Number;
public var v:Number;
public var renderable:IRenderable;
public var x:Number;
public var z:Number;
public var y:Number;
public function RenderHitData(){
super();
}
public function toString():String{
return (((displayObject3D + " ") + renderable));
}
}
}//package org.papervision3d.core.render.data
Section 349
//RenderSessionData (org.papervision3d.core.render.data.RenderSessionData)
package org.papervision3d.core.render.data {
import flash.display.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.view.*;
import org.papervision3d.core.culling.*;
import org.papervision3d.core.render.*;
public class RenderSessionData {
public var container:Sprite;
public var renderer:IRenderEngine;
public var particleCuller:IParticleCuller;
public var viewPort:Viewport3D;
public var triangleCuller:ITriangleCuller;
public var scene:SceneObject3D;
public var camera:CameraObject3D;
public var renderStatistics:RenderStatistics;
public var sorted:Boolean;
public function RenderSessionData():void{
super();
this.renderStatistics = new RenderStatistics();
}
}
}//package org.papervision3d.core.render.data
Section 350
//RenderStatistics (org.papervision3d.core.render.data.RenderStatistics)
package org.papervision3d.core.render.data {
public class RenderStatistics {
public var renderTime:int;// = 0
public var triangles:int;// = 0
public var particles:int;// = 0
public var lines:int;// = 0
public var culledObjects:int;// = 0
public var rendered:int;// = 0
public var culledTriangles:int;// = 0
public var shadedTriangles:int;// = 0
public var projectionTime:int;// = 0
public var filteredObjects:int;// = 0
public var culledParticles:int;// = 0
public function RenderStatistics(){
super();
}
public function toString():String{
return (new String((((((((((((((((((("ProjectionTime:" + projectionTime) + " RenderTime:") + renderTime) + " Particles:") + particles) + " CulledParticles :") + culledParticles) + " Triangles:") + triangles) + " ShadedTriangles :") + shadedTriangles) + " CulledTriangles:") + culledTriangles) + " FilteredObjects:") + filteredObjects) + " CulledObjects:") + culledObjects) + "")));
}
public function clear():void{
projectionTime = 0;
renderTime = 0;
rendered = 0;
particles = 0;
triangles = 0;
culledTriangles = 0;
culledParticles = 0;
lines = 0;
shadedTriangles = 0;
filteredObjects = 0;
culledObjects = 0;
}
}
}//package org.papervision3d.core.render.data
Section 351
//IParticleDrawer (org.papervision3d.core.render.draw.IParticleDrawer)
package org.papervision3d.core.render.draw {
import flash.display.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
public interface IParticleDrawer {
function drawParticle(_arg1:Particle, _arg2:Graphics, _arg3:RenderSessionData):void;
}
}//package org.papervision3d.core.render.draw
Section 352
//ITriangleDrawer (org.papervision3d.core.render.draw.ITriangleDrawer)
package org.papervision3d.core.render.draw {
import flash.display.*;
import flash.geom.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
public interface ITriangleDrawer {
function drawTriangle(_arg1:Triangle3D, _arg2:Graphics, _arg3:RenderSessionData, _arg4:BitmapData=null, _arg5:Matrix=null):void;
}
}//package org.papervision3d.core.render.draw
Section 353
//BasicRenderFilter (org.papervision3d.core.render.filter.BasicRenderFilter)
package org.papervision3d.core.render.filter {
public class BasicRenderFilter implements IRenderFilter {
public function BasicRenderFilter(){
super();
}
public function filter(array:Array):int{
return (0);
}
}
}//package org.papervision3d.core.render.filter
Section 354
//IRenderFilter (org.papervision3d.core.render.filter.IRenderFilter)
package org.papervision3d.core.render.filter {
public interface IRenderFilter {
function filter(:Array):int;
}
}//package org.papervision3d.core.render.filter
Section 355
//IUpdateAfterMaterial (org.papervision3d.core.render.material.IUpdateAfterMaterial)
package org.papervision3d.core.render.material {
import org.papervision3d.core.render.data.*;
public interface IUpdateAfterMaterial {
function updateAfterRender(:RenderSessionData):void;
}
}//package org.papervision3d.core.render.material
Section 356
//IUpdateBeforeMaterial (org.papervision3d.core.render.material.IUpdateBeforeMaterial)
package org.papervision3d.core.render.material {
import org.papervision3d.core.render.data.*;
public interface IUpdateBeforeMaterial {
function updateBeforeRender(:RenderSessionData):void;
}
}//package org.papervision3d.core.render.material
Section 357
//MaterialManager (org.papervision3d.core.render.material.MaterialManager)
package org.papervision3d.core.render.material {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import flash.utils.*;
public class MaterialManager {
private var materials:Dictionary;
private static var instance:MaterialManager;
public function MaterialManager():void{
super();
if (instance){
throw (new Error("Only 1 instance of materialmanager allowed"));
};
init();
}
private function init():void{
materials = new Dictionary();
}
private function _unRegisterMaterial(material:MaterialObject3D):void{
delete materials[material];
}
public function updateMaterialsAfterRender(renderSessionData:RenderSessionData):void{
var um:IUpdateAfterMaterial;
var m:MaterialObject3D;
for each (m in materials) {
if ((m is IUpdateAfterMaterial)){
um = (m as IUpdateAfterMaterial);
um.updateAfterRender(renderSessionData);
};
};
}
private function _registerMaterial(material:MaterialObject3D):void{
materials[material] = material;
}
public function updateMaterialsBeforeRender(renderSessionData:RenderSessionData):void{
var um:IUpdateBeforeMaterial;
var m:MaterialObject3D;
for each (m in materials) {
if ((m is IUpdateBeforeMaterial)){
um = (m as IUpdateBeforeMaterial);
um.updateBeforeRender(renderSessionData);
};
};
}
public static function getInstance():MaterialManager{
if (!instance){
instance = new (MaterialManager);
};
return (instance);
}
public static function unRegisterMaterial(material:MaterialObject3D):void{
getInstance()._unRegisterMaterial(material);
}
public static function registerMaterial(material:MaterialObject3D):void{
getInstance()._registerMaterial(material);
}
}
}//package org.papervision3d.core.render.material
Section 358
//BasicRenderSorter (org.papervision3d.core.render.sort.BasicRenderSorter)
package org.papervision3d.core.render.sort {
public class BasicRenderSorter implements IRenderSorter {
public function BasicRenderSorter(){
super();
}
public function sort(array:Array):void{
array.sortOn("screenDepth", Array.NUMERIC);
}
}
}//package org.papervision3d.core.render.sort
Section 359
//IRenderSorter (org.papervision3d.core.render.sort.IRenderSorter)
package org.papervision3d.core.render.sort {
public interface IRenderSorter {
function sort(:Array):void;
}
}//package org.papervision3d.core.render.sort
Section 360
//AbstractRenderEngine (org.papervision3d.core.render.AbstractRenderEngine)
package org.papervision3d.core.render {
import flash.events.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.view.*;
import org.papervision3d.core.render.command.*;
public class AbstractRenderEngine extends EventDispatcher implements IRenderEngine {
public function AbstractRenderEngine(target:IEventDispatcher=null){
super(target);
}
public function addToRenderList(renderCommand:IRenderListItem):int{
return (0);
}
public function removeFromRenderList(renderCommand:IRenderListItem):int{
return (0);
}
public function renderScene(scene:SceneObject3D, camera:CameraObject3D, viewPort:Viewport3D, updateAnimation:Boolean=true):RenderStatistics{
return (null);
}
}
}//package org.papervision3d.core.render
Section 361
//IRenderEngine (org.papervision3d.core.render.IRenderEngine)
package org.papervision3d.core.render {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.view.*;
import org.papervision3d.core.render.command.*;
public interface IRenderEngine {
function addToRenderList(updateAnimation:IRenderListItem):int;
function removeFromRenderList(updateAnimation:IRenderListItem):int;
function renderScene(_arg1:SceneObject3D, _arg2:CameraObject3D, _arg3:Viewport3D, _arg4:Boolean=true):RenderStatistics;
}
}//package org.papervision3d.core.render
Section 362
//IVirtualMouseEvent (org.papervision3d.core.utils.virtualmouse.IVirtualMouseEvent)
package org.papervision3d.core.utils.virtualmouse {
public interface IVirtualMouseEvent {
}
}//package org.papervision3d.core.utils.virtualmouse
Section 363
//VirtualMouse (org.papervision3d.core.utils.virtualmouse.VirtualMouse)
package org.papervision3d.core.utils.virtualmouse {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.utils.*;
import org.papervision3d.core.components.as3.utils.*;
public class VirtualMouse extends EventDispatcher {
private var _container:Sprite;
private var _stage:Stage;
private var lastDownTarget:DisplayObject;
private var target:InteractiveObject;
private var updateMouseDown:Boolean;// = false
private var eventEvent:Class;
private var _lastEvent:Event;
private var mouseEventEvent:Class;
private var location:Point;
private var delta:int;// = 0
private var disabledEvents:Object;
private var ignoredInstances:Dictionary;
private var isLocked:Boolean;// = false
private var lastWithinStage:Boolean;// = true
private var lastLocation:Point;
private var isDoubleClickEvent:Boolean;// = false
private var lastMouseDown:Boolean;// = false
private var ctrlKey:Boolean;// = false
private var altKey:Boolean;// = false
private var _useNativeEvents:Boolean;// = false
private var shiftKey:Boolean;// = false
public static const UPDATE:String = "update";
private static var _mouseIsDown:Boolean = false;
public function VirtualMouse(stage:Stage=null, container:Sprite=null, startX:Number=0, startY:Number=0){
disabledEvents = new Object();
ignoredInstances = new Dictionary(true);
eventEvent = VirtualMouseEvent;
mouseEventEvent = VirtualMouseMouseEvent;
super();
this.stage = stage;
this.container = container;
location = new Point(startX, startY);
lastLocation = location.clone();
addEventListener(UPDATE, handleUpdate);
update();
}
public function get mouseIsDown():Boolean{
return (_mouseIsDown);
}
public function get container():Sprite{
return (_container);
}
public function exitContainer():void{
var targetLocal:Point = target.globalToLocal(location);
if (!disabledEvents[MouseEvent.MOUSE_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, targetLocal.x, targetLocal.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
container.dispatchEvent(new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, targetLocal.x, targetLocal.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
dispatchEvent(new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, targetLocal.x, targetLocal.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
};
if (!disabledEvents[MouseEvent.ROLL_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, targetLocal.x, targetLocal.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
container.dispatchEvent(new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, targetLocal.x, targetLocal.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
dispatchEvent(new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, targetLocal.x, targetLocal.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
};
if (target != container){
if (!disabledEvents[MouseEvent.MOUSE_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, targetLocal.x, targetLocal.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
target.dispatchEvent(new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, targetLocal.x, targetLocal.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
dispatchEvent(new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, targetLocal.x, targetLocal.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
};
if (!disabledEvents[MouseEvent.ROLL_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, targetLocal.x, targetLocal.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
target.dispatchEvent(new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, targetLocal.x, targetLocal.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
dispatchEvent(new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, targetLocal.x, targetLocal.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
};
};
target = _stage;
}
public function release():void{
updateMouseDown = true;
_mouseIsDown = false;
if (!isLocked){
update();
};
}
private function keyHandler(event:KeyboardEvent):void{
altKey = event.altKey;
ctrlKey = event.ctrlKey;
shiftKey = event.shiftKey;
}
public function click():void{
press();
release();
}
public function disableEvent(type:String):void{
disabledEvents[type] = true;
}
public function set container(value:Sprite):void{
_container = value;
}
public function get lastEvent():Event{
return (_lastEvent);
}
private function handleUpdate(event:Event):void{
var currentTarget:InteractiveObject;
var currentParent:DisplayObject;
var withinStage:Boolean;
if (!container){
return;
};
var p:Point = CoordinateTools.localToLocal(container, stage, location);
var objectsUnderPoint:Array = container.getObjectsUnderPoint(location);
var i:int = objectsUnderPoint.length;
while (i--) {
currentParent = objectsUnderPoint[i];
while (currentParent) {
if (ignoredInstances[currentParent]){
currentTarget = null;
break;
};
if (((currentTarget) && ((currentParent is SimpleButton)))){
currentTarget = null;
} else {
if (((currentTarget) && (!(DisplayObjectContainer(currentParent).mouseChildren)))){
currentTarget = null;
};
};
if (((((!(currentTarget)) && ((currentParent is InteractiveObject)))) && (InteractiveObject(currentParent).mouseEnabled))){
currentTarget = InteractiveObject(currentParent);
};
currentParent = currentParent.parent;
};
if (currentTarget){
break;
};
};
if (!currentTarget){
currentTarget = _stage;
};
var targetLocal:Point = target.globalToLocal(location);
var currentTargetLocal:Point = currentTarget.globalToLocal(location);
if (((!((lastLocation.x == location.x))) || (!((lastLocation.y == location.y))))){
withinStage = false;
if (stage){
withinStage = (((((((location.x >= 0)) && ((location.y >= 0)))) && ((location.x <= stage.stageWidth)))) && ((location.y <= stage.stageHeight)));
};
if (((((!(withinStage)) && (lastWithinStage))) && (!(disabledEvents[Event.MOUSE_LEAVE])))){
_lastEvent = new eventEvent(Event.MOUSE_LEAVE, false, false);
stage.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (((withinStage) && (!(disabledEvents[MouseEvent.MOUSE_MOVE])))){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_MOVE, true, false, currentTargetLocal.x, currentTargetLocal.y, currentTarget, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
currentTarget.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
lastWithinStage = withinStage;
};
if (currentTarget != target){
if (!disabledEvents[MouseEvent.MOUSE_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, targetLocal.x, targetLocal.y, currentTarget, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
target.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (!disabledEvents[MouseEvent.ROLL_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, targetLocal.x, targetLocal.y, currentTarget, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
target.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (!disabledEvents[MouseEvent.MOUSE_OVER]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_OVER, true, false, currentTargetLocal.x, currentTargetLocal.y, target, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
currentTarget.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (!disabledEvents[MouseEvent.ROLL_OVER]){
_lastEvent = new mouseEventEvent(MouseEvent.ROLL_OVER, false, false, currentTargetLocal.x, currentTargetLocal.y, target, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
currentTarget.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
};
if (updateMouseDown){
if (_mouseIsDown){
if (!disabledEvents[MouseEvent.MOUSE_DOWN]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_DOWN, true, false, currentTargetLocal.x, currentTargetLocal.y, currentTarget, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
currentTarget.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
lastDownTarget = currentTarget;
updateMouseDown = false;
} else {
if (!disabledEvents[MouseEvent.MOUSE_UP]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_UP, true, false, currentTargetLocal.x, currentTargetLocal.y, currentTarget, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
currentTarget.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (((!(disabledEvents[MouseEvent.CLICK])) && ((currentTarget == lastDownTarget)))){
_lastEvent = new mouseEventEvent(MouseEvent.CLICK, true, false, currentTargetLocal.x, currentTargetLocal.y, currentTarget, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
currentTarget.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
lastDownTarget = null;
updateMouseDown = false;
};
};
if (((((isDoubleClickEvent) && (!(disabledEvents[MouseEvent.DOUBLE_CLICK])))) && (currentTarget.doubleClickEnabled))){
_lastEvent = new mouseEventEvent(MouseEvent.DOUBLE_CLICK, true, false, currentTargetLocal.x, currentTargetLocal.y, currentTarget, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
currentTarget.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
lastLocation = location.clone();
lastMouseDown = _mouseIsDown;
target = currentTarget;
}
public function getLocation():Point{
return (location.clone());
}
public function lock():void{
isLocked = true;
}
public function get useNativeEvents():Boolean{
return (_useNativeEvents);
}
public function setLocation(a, b=null):void{
var loc:Point;
if ((a is Point)){
loc = (a as Point);
trace(loc);
location.x = loc.x;
location.y = loc.y;
} else {
location.x = Number(a);
location.y = Number(b);
};
if (!isLocked){
update();
};
}
public function unignore(instance:DisplayObject):void{
if ((instance in ignoredInstances)){
delete ignoredInstances[instance];
};
}
public function doubleClick():void{
if (isLocked){
release();
} else {
click();
press();
isDoubleClickEvent = true;
release();
isDoubleClickEvent = false;
};
}
public function update():void{
dispatchEvent(new Event(UPDATE, false, false));
}
public function unlock():void{
isLocked = false;
update();
}
public function ignore(instance:DisplayObject):void{
ignoredInstances[instance] = true;
}
public function enableEvent(type:String):void{
if ((type in disabledEvents)){
delete disabledEvents[type];
};
}
public function press():void{
updateMouseDown = true;
_mouseIsDown = true;
if (!isLocked){
update();
};
}
public function set useNativeEvents(b:Boolean):void{
if (b == _useNativeEvents){
return;
};
_useNativeEvents = b;
if (_useNativeEvents){
eventEvent = VirtualMouseEvent;
mouseEventEvent = VirtualMouseMouseEvent;
} else {
eventEvent = Event;
mouseEventEvent = MouseEvent;
};
}
public function set x(n:Number):void{
location.x = n;
if (!isLocked){
update();
};
}
public function set y(n:Number):void{
location.y = n;
if (!isLocked){
update();
};
}
public function get y():Number{
return (location.y);
}
public function set stage(s:Stage):void{
var hadStage:Boolean;
if (_stage){
hadStage = true;
_stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyHandler);
_stage.removeEventListener(KeyboardEvent.KEY_UP, keyHandler);
} else {
hadStage = false;
};
_stage = s;
if (_stage){
_stage.addEventListener(KeyboardEvent.KEY_DOWN, keyHandler);
_stage.addEventListener(KeyboardEvent.KEY_UP, keyHandler);
target = _stage;
if (!hadStage){
update();
};
};
}
public function get stage():Stage{
return (_stage);
}
public function get x():Number{
return (location.x);
}
}
}//package org.papervision3d.core.utils.virtualmouse
Section 364
//VirtualMouseEvent (org.papervision3d.core.utils.virtualmouse.VirtualMouseEvent)
package org.papervision3d.core.utils.virtualmouse {
import flash.events.*;
public class VirtualMouseEvent extends Event implements IVirtualMouseEvent {
public function VirtualMouseEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false){
super(type, bubbles, cancelable);
}
}
}//package org.papervision3d.core.utils.virtualmouse
Section 365
//VirtualMouseMouseEvent (org.papervision3d.core.utils.virtualmouse.VirtualMouseMouseEvent)
package org.papervision3d.core.utils.virtualmouse {
import flash.display.*;
import flash.events.*;
public class VirtualMouseMouseEvent extends MouseEvent implements IVirtualMouseEvent {
public function VirtualMouseMouseEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, localX:Number=NaN, localY:Number=NaN, relatedObject:InteractiveObject=null, ctrlKey:Boolean=false, altKey:Boolean=false, shiftKey:Boolean=false, buttonDown:Boolean=false, delta:int=0){
super(type, bubbles, cancelable, localX, localY, relatedObject, ctrlKey, altKey, shiftKey, buttonDown, delta);
}
}
}//package org.papervision3d.core.utils.virtualmouse
Section 366
//InteractiveSceneManager (org.papervision3d.core.utils.InteractiveSceneManager)
package org.papervision3d.core.utils {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.view.*;
import org.papervision3d.objects.*;
import org.papervision3d.events.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.materials.*;
import org.papervision3d.core.utils.virtualmouse.*;
public class InteractiveSceneManager extends EventDispatcher {
public var currentMaterial:MaterialObject3D;
public var container:Sprite;
public var debug:Boolean;// = false
public var mouse3D:Mouse3D;
public var enableOverOut:Boolean;// = true
public var currentDisplayObject3D:DisplayObject3D;
public var virtualMouse:VirtualMouse;
public var viewport:Viewport3D;
public var renderHitData:RenderHitData;
public var currentMouseDO3D:DisplayObject3D;// = null
public static var MOUSE_IS_DOWN:Boolean = false;
public function InteractiveSceneManager(viewport:Viewport3D){
virtualMouse = new VirtualMouse();
mouse3D = new Mouse3D();
super();
this.viewport = viewport;
this.container = viewport.containerSprite;
init();
}
protected function dispatchObjectEvent(event:String, DO3D:DisplayObject3D):void{
var x:Number;
var y:Number;
if (((renderHitData) && (renderHitData.hasHit))){
x = (renderHitData.u) ? renderHitData.u : 0;
y = (renderHitData.v) ? renderHitData.v : 0;
dispatchEvent(new InteractiveScene3DEvent(event, DO3D, container, (renderHitData.renderable as Triangle3D), x, y));
DO3D.dispatchEvent(new InteractiveScene3DEvent(event, DO3D, container, (renderHitData.renderable as Triangle3D), x, y));
} else {
dispatchEvent(new InteractiveScene3DEvent(event, DO3D, container));
if (DO3D){
DO3D.dispatchEvent(new InteractiveScene3DEvent(event, DO3D, container));
};
};
}
protected function initVirtualMouse():void{
virtualMouse.stage = container.stage;
virtualMouse.container = container;
}
public function initListeners():void{
if (viewport.interactive){
container.addEventListener(MouseEvent.MOUSE_DOWN, handleMousePress);
container.addEventListener(MouseEvent.MOUSE_UP, handleMouseRelease);
container.addEventListener(MouseEvent.CLICK, handleMouseClick);
container.stage.addEventListener(MouseEvent.MOUSE_MOVE, handleMouseMove);
};
}
protected function handleMouseOver(DO3D:DisplayObject3D):void{
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_OVER, DO3D);
}
protected function handleMouseMove(e:MouseEvent):void{
var mat:MovieMaterial;
if ((e is IVirtualMouseEvent)){
return;
};
if (((virtualMouse) && (renderHitData))){
mat = (currentMaterial as MovieMaterial);
if (mat){
virtualMouse.container = (mat.movie as Sprite);
};
if (virtualMouse.container){
virtualMouse.setLocation(renderHitData.u, renderHitData.v);
};
if (((((Mouse3D.enabled) && (renderHitData))) && (!((renderHitData.renderable == null))))){
mouse3D.updatePosition(renderHitData);
};
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_MOVE, currentDisplayObject3D);
} else {
if (((renderHitData) && (renderHitData.hasHit))){
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_MOVE, currentDisplayObject3D);
};
};
}
protected function resolveRenderHitData():void{
var point:Point = new Point();
point.x = container.mouseX;
point.y = container.mouseY;
renderHitData = (viewport.hitTestPoint2D(point) as RenderHitData);
}
public function updateRenderHitData():void{
resolveRenderHitData();
currentDisplayObject3D = renderHitData.displayObject3D;
currentMaterial = renderHitData.material;
manageOverOut();
}
public function init():void{
if (container){
if (container.stage){
initVirtualMouse();
} else {
container.addEventListener(Event.ADDED_TO_STAGE, handleAddedToStage);
};
};
}
protected function handleMouseRelease(e:MouseEvent):void{
if ((e is IVirtualMouseEvent)){
return;
};
MOUSE_IS_DOWN = false;
if (virtualMouse){
virtualMouse.release();
};
if (((renderHitData) && (renderHitData.hasHit))){
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_RELEASE, currentDisplayObject3D);
};
}
protected function handleAddedToStage(e:Event):void{
initVirtualMouse();
initListeners();
}
protected function handleMouseOut(DO3D:DisplayObject3D):void{
var mat:MovieMaterial;
if (DO3D){
mat = (DO3D.material as MovieMaterial);
if (mat){
virtualMouse.exitContainer();
};
};
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_OUT, DO3D);
}
protected function manageOverOut():void{
if (!enableOverOut){
return;
};
if (((renderHitData) && (renderHitData.hasHit))){
if (((!(currentMouseDO3D)) && (currentDisplayObject3D))){
handleMouseOver(currentDisplayObject3D);
currentMouseDO3D = currentDisplayObject3D;
} else {
if (((currentMouseDO3D) && (!((currentMouseDO3D == currentDisplayObject3D))))){
handleMouseOut(currentMouseDO3D);
handleMouseOver(currentDisplayObject3D);
currentMouseDO3D = currentDisplayObject3D;
};
};
} else {
if (currentMouseDO3D != null){
handleMouseOut(currentMouseDO3D);
currentMouseDO3D = null;
};
};
}
protected function handleMouseClick(e:MouseEvent):void{
if ((e is IVirtualMouseEvent)){
return;
};
if (((renderHitData) && (renderHitData.hasHit))){
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_CLICK, currentDisplayObject3D);
};
}
protected function handleMousePress(e:MouseEvent):void{
if ((e is IVirtualMouseEvent)){
return;
};
MOUSE_IS_DOWN = true;
if (virtualMouse){
virtualMouse.press();
};
if (((renderHitData) && (renderHitData.hasHit))){
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_PRESS, currentDisplayObject3D);
};
}
}
}//package org.papervision3d.core.utils
Section 367
//Mouse3D (org.papervision3d.core.utils.Mouse3D)
package org.papervision3d.core.utils {
import org.papervision3d.core.render.data.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.math.*;
public class Mouse3D extends DisplayObject3D {
public static var enabled:Boolean = false;
private static var UP:Number3D = new Number3D(0, 1, 0);
public function Mouse3D(initObject:Object=null):void{
super();
}
public function updatePosition(rhd:RenderHitData):void{
var xAxis:Number3D;
var yAxis:Number3D;
var look:Matrix3D;
var face3d:Triangle3D = (rhd.renderable as Triangle3D);
var position:Number3D = new Number3D(0, 0, 0);
var target:Number3D = new Number3D(face3d.faceNormal.x, face3d.faceNormal.y, face3d.faceNormal.z);
var zAxis:Number3D = Number3D.sub(target, position);
zAxis.normalize();
if (zAxis.modulo > 0.1){
xAxis = Number3D.cross(zAxis, UP);
xAxis.normalize();
yAxis = Number3D.cross(zAxis, xAxis);
yAxis.normalize();
look = this.transform;
look.n11 = xAxis.x;
look.n21 = xAxis.y;
look.n31 = xAxis.z;
look.n12 = -(yAxis.x);
look.n22 = -(yAxis.y);
look.n32 = -(yAxis.z);
look.n13 = zAxis.x;
look.n23 = zAxis.y;
look.n33 = zAxis.z;
};
var m:Matrix3D = Matrix3D.IDENTITY;
this.transform = Matrix3D.multiply(face3d.instance.world, look);
x = rhd.x;
y = rhd.y;
z = rhd.z;
}
}
}//package org.papervision3d.core.utils
Section 368
//StopWatch (org.papervision3d.core.utils.StopWatch)
package org.papervision3d.core.utils {
import flash.events.*;
import flash.utils.*;
public class StopWatch extends EventDispatcher {
private var startTime:int;
private var elapsedTime:int;
private var isRunning:Boolean;
private var stopTime:int;
public function StopWatch(){
super();
}
public function start():void{
if (!isRunning){
startTime = getTimer();
isRunning = true;
};
}
public function stop():int{
if (isRunning){
stopTime = getTimer();
elapsedTime = (stopTime - startTime);
isRunning = false;
return (elapsedTime);
};
return (0);
}
public function reset():void{
isRunning = false;
}
}
}//package org.papervision3d.core.utils
Section 369
//IViewport3D (org.papervision3d.core.view.IViewport3D)
package org.papervision3d.core.view {
public interface IViewport3D {
function updateAfterRender():void;
function updateBeforeRender():void;
}
}//package org.papervision3d.core.view
Section 370
//InteractiveScene3DEvent (org.papervision3d.events.InteractiveScene3DEvent)
package org.papervision3d.events {
import flash.display.*;
import flash.events.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.geom.renderables.*;
public class InteractiveScene3DEvent extends Event {
public var y:Number;// = 0
public var sprite:Sprite;// = null
public var renderHitData:RenderHitData;
public var face3d:Triangle3D;// = null
public var x:Number;// = 0
public var displayObject3D:DisplayObject3D;// = null
public static const OBJECT_ADDED:String = "objectAdded";
public static const OBJECT_PRESS:String = "mousePress";
public static const OBJECT_RELEASE:String = "mouseRelease";
public static const OBJECT_CLICK:String = "mouseClick";
public static const OBJECT_RELEASE_OUTSIDE:String = "mouseReleaseOutside";
public static const OBJECT_OUT:String = "mouseOut";
public static const OBJECT_MOVE:String = "mouseMove";
public static const OBJECT_OVER:String = "mouseOver";
public function InteractiveScene3DEvent(type:String, container3d:DisplayObject3D=null, sprite:Sprite=null, face3d:Triangle3D=null, x:Number=0, y:Number=0, renderhitData:RenderHitData=null, bubbles:Boolean=false, cancelable:Boolean=false){
super(type, bubbles, cancelable);
this.displayObject3D = container3d;
this.sprite = sprite;
this.face3d = face3d;
this.x = x;
this.y = y;
this.renderHitData = renderhitData;
}
}
}//package org.papervision3d.events
Section 371
//RendererEvent (org.papervision3d.events.RendererEvent)
package org.papervision3d.events {
import flash.events.*;
import org.papervision3d.core.render.data.*;
public class RendererEvent extends Event {
public var renderSessionData:RenderSessionData;
public static var RENDER_DONE:String = "onRenderDone";
public function RendererEvent(type:String, renderSessionData:RenderSessionData){
super(type);
this.renderSessionData = renderSessionData;
}
}
}//package org.papervision3d.events
Section 372
//ParticleMaterial (org.papervision3d.materials.special.ParticleMaterial)
package org.papervision3d.materials.special {
import flash.display.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.render.draw.*;
public class ParticleMaterial extends MaterialObject3D implements IParticleDrawer {
public function ParticleMaterial(color:Number, alpha:Number){
super();
this.fillAlpha = alpha;
this.fillColor = color;
}
public function drawParticle(particle:Particle, graphics:Graphics, renderSessionData:RenderSessionData):void{
graphics.beginFill(fillColor, fillAlpha);
if (particle.size == 0){
graphics.drawRect(particle.vertex3D.vertex3DInstance.x, particle.vertex3D.vertex3DInstance.y, 1, 1);
} else {
graphics.drawRect(particle.vertex3D.vertex3DInstance.x, particle.vertex3D.vertex3DInstance.y, particle.renderScale, particle.renderScale);
};
graphics.endFill();
renderSessionData.renderStatistics.particles++;
}
}
}//package org.papervision3d.materials.special
Section 373
//MaterialsList (org.papervision3d.materials.utils.MaterialsList)
package org.papervision3d.materials.utils {
import org.papervision3d.core.proto.*;
import flash.utils.*;
public class MaterialsList {
protected var _materials:Dictionary;
public var materialsByName:Dictionary;
private var _materialsTotal:int;
public function MaterialsList(materials=null):void{
var i:String;
var name:String;
super();
this.materialsByName = new Dictionary(true);
this._materials = new Dictionary(false);
this._materialsTotal = 0;
if (materials){
if ((materials is Array)){
for (i in materials) {
this.addMaterial(materials[i]);
};
} else {
if ((materials is Object)){
for (name in materials) {
this.addMaterial(materials[name], name);
};
};
};
};
}
public function get numMaterials():int{
return (this._materialsTotal);
}
public function addMaterial(material:MaterialObject3D, name:String=null):MaterialObject3D{
name = ((((name) || (material.name))) || (String(material.id)));
this._materials[material] = name;
this.materialsByName[name] = material;
this._materialsTotal++;
return (material);
}
public function removeMaterial(material:MaterialObject3D):MaterialObject3D{
delete this.materialsByName[this._materials[material]];
delete this._materials[material];
return (material);
}
public function toString():String{
var m:MaterialObject3D;
var list:String = "";
for each (m in this.materialsByName) {
list = (list + (this._materials[m] + "\n"));
};
return (list);
}
public function removeMaterialByName(name:String):MaterialObject3D{
return (removeMaterial(getMaterialByName(name)));
}
public function clone():MaterialsList{
var m:MaterialObject3D;
var cloned:MaterialsList = new MaterialsList();
for each (m in this.materialsByName) {
cloned.addMaterial(m.clone(), this._materials[m]);
};
return (cloned);
}
public function getMaterialByName(name:String):MaterialObject3D{
return ((this.materialsByName[name]) ? this.materialsByName[name] : this.materialsByName["all"]);
}
}
}//package org.papervision3d.materials.utils
Section 374
//BitmapMaterial (org.papervision3d.materials.BitmapMaterial)
package org.papervision3d.materials {
import flash.display.*;
import flash.geom.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.core.geom.renderables.*;
import flash.utils.*;
import org.papervision3d.core.render.draw.*;
import org.papervision3d.core.material.*;
import org.papervision3d.*;
public class BitmapMaterial extends TriangleMaterial implements ITriangleDrawer {
public var focus:Number;// = 100
public var uvMatrices:Dictionary;
protected var _texture:Object;
private var _precise:Boolean;
public var minimumRenderSize:Number;// = 2
public var precision:Number;// = 8
protected static var _triMap:Matrix;
public static var AUTO_MIP_MAPPING:Boolean = false;
protected static var _localMatrix:Matrix = new Matrix();
public static var MIP_MAP_DEPTH:Number = 8;
protected static var _triMatrix:Matrix = new Matrix();
public function BitmapMaterial(asset:BitmapData=null, precise:Boolean=false){
uvMatrices = new Dictionary();
super();
if (asset){
texture = asset;
};
this.precise = precise;
}
public function set texture(asset:Object):void{
if ((asset is BitmapData) == false){
Papervision3D.log("Error: BitmapMaterial.texture requires a BitmapData object for the texture");
return;
};
bitmap = createBitmap(BitmapData(asset));
_texture = asset;
}
protected function createBitmap(asset:BitmapData):BitmapData{
resetMapping();
if (AUTO_MIP_MAPPING){
return (correctBitmap(asset));
};
this.maxU = (this.maxV = 1);
return (asset);
}
public function transformUV(face3D:Triangle3D):Matrix{
var uv:Array;
var w:Number;
var h:Number;
var u0:Number;
var v0:Number;
var u1:Number;
var v1:Number;
var u2:Number;
var v2:Number;
var at:Number;
var bt:Number;
var ct:Number;
var dt:Number;
var m:Matrix;
var mapping:Matrix;
if (!face3D.uv){
Papervision3D.log("MaterialObject3D: transformUV() uv not found!");
} else {
if (bitmap){
uv = face3D.uv;
w = (bitmap.width * maxU);
h = (bitmap.height * maxV);
u0 = (w * face3D.uv0.u);
v0 = (h * (1 - face3D.uv0.v));
u1 = (w * face3D.uv1.u);
v1 = (h * (1 - face3D.uv1.v));
u2 = (w * face3D.uv2.u);
v2 = (h * (1 - face3D.uv2.v));
if ((((((u0 == u1)) && ((v0 == v1)))) || ((((u0 == u2)) && ((v0 == v2)))))){
u0 = (u0 - ((u0)>0.05) ? 0.05 : -0.05);
v0 = (v0 - ((v0)>0.07) ? 0.07 : -0.07);
};
if ((((u2 == u1)) && ((v2 == v1)))){
u2 = (u2 - ((u2)>0.05) ? 0.04 : -0.04);
v2 = (v2 - ((v2)>0.06) ? 0.06 : -0.06);
};
at = (u1 - u0);
bt = (v1 - v0);
ct = (u2 - u0);
dt = (v2 - v0);
m = new Matrix(at, bt, ct, dt, u0, v0);
m.invert();
mapping = ((uvMatrices[face3D]) || ((uvMatrices[face3D] = m.clone())));
mapping.a = m.a;
mapping.b = m.b;
mapping.c = m.c;
mapping.d = m.d;
mapping.tx = m.tx;
mapping.ty = m.ty;
} else {
Papervision3D.log("MaterialObject3D: transformUV() material.bitmap not found!");
};
};
return (mapping);
}
public function renderTriangleBitmap(graphics:Graphics, a:Number, b:Number, c:Number, d:Number, tx:Number, ty:Number, v0x:Number, v0y:Number, v1x:Number, v1y:Number, v2x:Number, v2y:Number, smooth:Boolean, repeat:Boolean, bitmapData:BitmapData):void{
var a2:Number = (v1x - v0x);
var b2:Number = (v1y - v0y);
var c2:Number = (v2x - v0x);
var d2:Number = (v2y - v0y);
var matrix:Matrix = new Matrix(((a * a2) + (b * c2)), ((a * b2) + (b * d2)), ((c * a2) + (d * c2)), ((c * b2) + (d * d2)), (((tx * a2) + (ty * c2)) + v0x), (((tx * b2) + (ty * d2)) + v0y));
graphics.beginBitmapFill(bitmapData, matrix, repeat, smooth);
graphics.moveTo(v0x, v0y);
graphics.lineTo(v1x, v1y);
graphics.lineTo(v2x, v2y);
graphics.endFill();
}
public function renderRec(graphics:Graphics, ta:Number, tb:Number, tc:Number, td:Number, tx:Number, ty:Number, ax:Number, ay:Number, az:Number, bx:Number, by:Number, bz:Number, cx:Number, cy:Number, cz:Number, index:Number, renderSessionData:RenderSessionData, bitmap:BitmapData):void{
if ((((((az <= 0)) && ((bz <= 0)))) && ((cz <= 0)))){
return;
};
if ((((((((index >= 100)) || ((focus == Infinity)))) || (((Math.max(Math.max(ax, bx), cx) - Math.min(Math.min(ax, bx), cx)) < minimumRenderSize)))) || (((Math.max(Math.max(ay, by), cy) - Math.min(Math.min(ay, by), cy)) < minimumRenderSize)))){
renderTriangleBitmap(graphics, ta, tb, tc, td, tx, ty, ax, ay, bx, by, cx, cy, smooth, tiled, bitmap);
renderSessionData.renderStatistics.triangles++;
return;
};
var faz:Number = (focus + az);
var fbz:Number = (focus + bz);
var fcz:Number = (focus + cz);
var mabz:Number = (2 / (faz + fbz));
var mbcz:Number = (2 / (fbz + fcz));
var mcaz:Number = (2 / (fcz + faz));
var mabx:Number = (((ax * faz) + (bx * fbz)) * mabz);
var maby:Number = (((ay * faz) + (by * fbz)) * mabz);
var mbcx:Number = (((bx * fbz) + (cx * fcz)) * mbcz);
var mbcy:Number = (((by * fbz) + (cy * fcz)) * mbcz);
var mcax:Number = (((cx * fcz) + (ax * faz)) * mcaz);
var mcay:Number = (((cy * fcz) + (ay * faz)) * mcaz);
var dabx:Number = ((ax + bx) - mabx);
var daby:Number = ((ay + by) - maby);
var dbcx:Number = ((bx + cx) - mbcx);
var dbcy:Number = ((by + cy) - mbcy);
var dcax:Number = ((cx + ax) - mcax);
var dcay:Number = ((cy + ay) - mcay);
var dsab:Number = ((dabx * dabx) + (daby * daby));
var dsbc:Number = ((dbcx * dbcx) + (dbcy * dbcy));
var dsca:Number = ((dcax * dcax) + (dcay * dcay));
if ((((((dsab <= precision)) && ((dsca <= precision)))) && ((dsbc <= precision)))){
renderTriangleBitmap(graphics, ta, tb, tc, td, tx, ty, ax, ay, bx, by, cx, cy, smooth, tiled, bitmap);
renderSessionData.renderStatistics.triangles++;
return;
};
if ((((((dsab > precision)) && ((dsca > precision)))) && ((dsbc > precision)))){
renderRec(graphics, (ta * 2), (tb * 2), (tc * 2), (td * 2), (tx * 2), (ty * 2), ax, ay, az, (mabx * 0.5), (maby * 0.5), ((az + bz) * 0.5), (mcax * 0.5), (mcay * 0.5), ((cz + az) * 0.5), (index + 1), renderSessionData, bitmap);
renderRec(graphics, (ta * 2), (tb * 2), (tc * 2), (td * 2), ((tx * 2) - 1), (ty * 2), (mabx * 0.5), (maby * 0.5), ((az + bz) * 0.5), bx, by, bz, (mbcx * 0.5), (mbcy * 0.5), ((bz + cz) * 0.5), (index + 1), renderSessionData, bitmap);
renderRec(graphics, (ta * 2), (tb * 2), (tc * 2), (td * 2), (tx * 2), ((ty * 2) - 1), (mcax * 0.5), (mcay * 0.5), ((cz + az) * 0.5), (mbcx * 0.5), (mbcy * 0.5), ((bz + cz) * 0.5), cx, cy, cz, (index + 1), renderSessionData, bitmap);
renderRec(graphics, (-(ta) * 2), (-(tb) * 2), (-(tc) * 2), (-(td) * 2), ((-(tx) * 2) + 1), ((-(ty) * 2) + 1), (mbcx * 0.5), (mbcy * 0.5), ((bz + cz) * 0.5), (mcax * 0.5), (mcay * 0.5), ((cz + az) * 0.5), (mabx * 0.5), (maby * 0.5), ((az + bz) * 0.5), (index + 1), renderSessionData, bitmap);
return;
};
var dmax:Number = Math.max(dsab, Math.max(dsca, dsbc));
if (dsab == dmax){
renderRec(graphics, (ta * 2), (tb * 1), (tc * 2), (td * 1), (tx * 2), (ty * 1), ax, ay, az, (mabx * 0.5), (maby * 0.5), ((az + bz) * 0.5), cx, cy, cz, (index + 1), renderSessionData, bitmap);
renderRec(graphics, ((ta * 2) + tb), (tb * 1), ((2 * tc) + td), (td * 1), (((tx * 2) + ty) - 1), (ty * 1), (mabx * 0.5), (maby * 0.5), ((az + bz) * 0.5), bx, by, bz, cx, cy, cz, (index + 1), renderSessionData, bitmap);
return;
};
if (dsca == dmax){
renderRec(graphics, (ta * 1), (tb * 2), (tc * 1), (td * 2), (tx * 1), (ty * 2), ax, ay, az, bx, by, bz, (mcax * 0.5), (mcay * 0.5), ((cz + az) * 0.5), (index + 1), renderSessionData, bitmap);
renderRec(graphics, (ta * 1), ((tb * 2) + ta), (tc * 1), ((td * 2) + tc), tx, (((ty * 2) + tx) - 1), (mcax * 0.5), (mcay * 0.5), ((cz + az) * 0.5), bx, by, bz, cx, cy, cz, (index + 1), renderSessionData, bitmap);
return;
};
renderRec(graphics, (ta - tb), (tb * 2), (tc - td), (td * 2), (tx - ty), (ty * 2), ax, ay, az, bx, by, bz, (mbcx * 0.5), (mbcy * 0.5), ((bz + cz) * 0.5), (index + 1), renderSessionData, bitmap);
renderRec(graphics, (2 * ta), (tb - ta), (tc * 2), (td - tc), (2 * tx), (ty - tx), ax, ay, az, (mbcx * 0.5), (mbcy * 0.5), ((bz + cz) * 0.5), cx, cy, cz, (index + 1), renderSessionData, bitmap);
}
override public function clone():MaterialObject3D{
var cloned:MaterialObject3D = super.clone();
cloned.maxU = this.maxU;
cloned.maxV = this.maxV;
return (cloned);
}
public function get precise():Boolean{
return (_precise);
}
public function get texture():Object{
return (this._texture);
}
protected function extendBitmapEdges(bmp:BitmapData, originalWidth:Number, originalHeight:Number):void{
var i:int;
var srcRect:Rectangle = new Rectangle();
var dstPoint:Point = new Point();
if (bmp.width > originalWidth){
srcRect.x = (originalWidth - 1);
srcRect.y = 0;
srcRect.width = 1;
srcRect.height = originalHeight;
dstPoint.y = 0;
i = originalWidth;
while (i < bmp.width) {
dstPoint.x = i;
bmp.copyPixels(bmp, srcRect, dstPoint);
i++;
};
};
if (bmp.height > originalHeight){
srcRect.x = 0;
srcRect.y = (originalHeight - 1);
srcRect.width = bmp.width;
srcRect.height = 1;
dstPoint.x = 0;
i = originalHeight;
while (i < bmp.height) {
dstPoint.y = i;
bmp.copyPixels(bmp, srcRect, dstPoint);
i++;
};
};
}
override public function drawTriangle(face3D:Triangle3D, graphics:Graphics, renderSessionData:RenderSessionData, altBitmap:BitmapData=null, altUV:Matrix=null):void{
var x0:Number;
var y0:Number;
var x1:Number;
var y1:Number;
var x2:Number;
var y2:Number;
if (!_precise){
if (lineAlpha){
graphics.lineStyle(lineThickness, lineColor, lineAlpha);
};
if (bitmap){
_triMap = (altUV) ? altUV : ((uvMatrices[face3D]) || (transformUV(face3D)));
x0 = face3D.v0.vertex3DInstance.x;
y0 = face3D.v0.vertex3DInstance.y;
x1 = face3D.v1.vertex3DInstance.x;
y1 = face3D.v1.vertex3DInstance.y;
x2 = face3D.v2.vertex3DInstance.x;
y2 = face3D.v2.vertex3DInstance.y;
_triMatrix.a = (x1 - x0);
_triMatrix.b = (y1 - y0);
_triMatrix.c = (x2 - x0);
_triMatrix.d = (y2 - y0);
_triMatrix.tx = x0;
_triMatrix.ty = y0;
_localMatrix.a = _triMap.a;
_localMatrix.b = _triMap.b;
_localMatrix.c = _triMap.c;
_localMatrix.d = _triMap.d;
_localMatrix.tx = _triMap.tx;
_localMatrix.ty = _triMap.ty;
_localMatrix.concat(_triMatrix);
graphics.beginBitmapFill((altBitmap) ? altBitmap : bitmap, _localMatrix, tiled, smooth);
};
graphics.moveTo(x0, y0);
graphics.lineTo(x1, y1);
graphics.lineTo(x2, y2);
graphics.lineTo(x0, y0);
if (bitmap){
graphics.endFill();
};
if (lineAlpha){
graphics.lineStyle();
};
renderSessionData.renderStatistics.triangles++;
} else {
_triMap = (altUV) ? altUV : ((uvMatrices[face3D]) || (transformUV(face3D)));
focus = renderSessionData.camera.focus;
renderRec(graphics, _triMap.a, _triMap.b, _triMap.c, _triMap.d, _triMap.tx, _triMap.ty, face3D.v0.vertex3DInstance.x, face3D.v0.vertex3DInstance.y, face3D.v0.vertex3DInstance.z, face3D.v1.vertex3DInstance.x, face3D.v1.vertex3DInstance.y, face3D.v1.vertex3DInstance.z, face3D.v2.vertex3DInstance.x, face3D.v2.vertex3DInstance.y, face3D.v2.vertex3DInstance.z, 0, renderSessionData, (altBitmap) ? altBitmap : bitmap);
};
}
override public function copy(material:MaterialObject3D):void{
super.copy(material);
this.maxU = material.maxU;
this.maxV = material.maxV;
}
protected function correctBitmap(bitmap:BitmapData):BitmapData{
var okBitmap:BitmapData;
var levels:Number = (1 << MIP_MAP_DEPTH);
var bWidth:Number = (bitmap.width / levels);
bWidth = ((bWidth == uint(bWidth))) ? bWidth : (uint(bWidth) + 1);
var bHeight:Number = (bitmap.height / levels);
bHeight = ((bHeight == uint(bHeight))) ? bHeight : (uint(bHeight) + 1);
var width:Number = (levels * bWidth);
var height:Number = (levels * bHeight);
var ok:Boolean;
if (width > 2880){
width = bitmap.width;
ok = false;
};
if (height > 2880){
height = bitmap.height;
ok = false;
};
if (!ok){
Papervision3D.log((("Material " + this.name) + ": Texture too big for mip mapping. Resizing recommended for better performance and quality."));
};
if (((bitmap) && (((!(((bitmap.width % levels) == 0))) || (!(((bitmap.height % levels) == 0))))))){
okBitmap = new BitmapData(width, height, bitmap.transparent, 0);
widthOffset = bitmap.width;
heightOffset = bitmap.height;
this.maxU = (bitmap.width / width);
this.maxV = (bitmap.height / height);
okBitmap.draw(bitmap);
extendBitmapEdges(okBitmap, bitmap.width, bitmap.height);
} else {
this.maxU = (this.maxV = 1);
okBitmap = bitmap;
};
return (okBitmap);
}
override public function toString():String{
return (((((("Texture:" + this.texture) + " lineColor:") + this.lineColor) + " lineAlpha:") + this.lineAlpha));
}
public function set precise(boolean:Boolean):void{
_precise = boolean;
}
public function resetMapping():void{
uvMatrices = new Dictionary();
}
}
}//package org.papervision3d.materials
Section 375
//MovieMaterial (org.papervision3d.materials.MovieMaterial)
package org.papervision3d.materials {
import flash.display.*;
import flash.geom.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.render.material.*;
import org.papervision3d.core.render.draw.*;
import org.papervision3d.*;
public class MovieMaterial extends BitmapMaterial implements ITriangleDrawer, IUpdateBeforeMaterial {
public var movieTransparent:Boolean;
private var _animated:Boolean;
public var allowAutoResize:Boolean;// = true
public var movie:DisplayObject;
public function MovieMaterial(movieAsset:DisplayObject=null, transparent:Boolean=false, animated:Boolean=false, precise:Boolean=false){
super();
movieTransparent = transparent;
this.animated = animated;
this.interactive = interactive;
this.precise = precise;
if (movieAsset){
texture = movieAsset;
};
}
override protected function destroy():void{
super.destroy();
bitmap.dispose();
}
public function get animated():Boolean{
return (_animated);
}
public function set animated(status:Boolean):void{
_animated = status;
}
public function drawBitmap():void{
bitmap.fillRect(bitmap.rect, this.fillColor);
var mtx:Matrix = new Matrix();
mtx.scale(movie.scaleX, movie.scaleY);
bitmap.draw(movie, mtx, movie.transform.colorTransform);
}
override public function set texture(asset:Object):void{
if ((asset is DisplayObject) == false){
Papervision3D.log("Error: MovieMaterial.texture requires a Sprite to be passed as the object");
return;
};
bitmap = createBitmapFromSprite(DisplayObject(asset));
_texture = asset;
}
protected function createBitmapFromSprite(asset:DisplayObject):BitmapData{
movie = asset;
initBitmap(movie);
drawBitmap();
bitmap = super.createBitmap(bitmap);
return (bitmap);
}
override public function get texture():Object{
return (this._texture);
}
public function updateBeforeRender(renderSessionData:RenderSessionData):void{
var mWidth:int;
var mHeight:int;
if (_animated){
mWidth = int(movie.width);
mHeight = int(movie.height);
if (((allowAutoResize) && (((!((mWidth == bitmap.width))) || (!((mHeight == bitmap.height))))))){
initBitmap(movie);
};
drawBitmap();
};
}
protected function initBitmap(asset:DisplayObject):void{
if (bitmap){
bitmap.dispose();
};
bitmap = new BitmapData(asset.width, asset.height, this.movieTransparent);
}
}
}//package org.papervision3d.materials
Section 376
//WireframeMaterial (org.papervision3d.materials.WireframeMaterial)
package org.papervision3d.materials {
import flash.display.*;
import flash.geom.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.render.draw.*;
import org.papervision3d.core.material.*;
public class WireframeMaterial extends TriangleMaterial implements ITriangleDrawer {
public function WireframeMaterial(color:Number=0xFF00FF, alpha:Number=100, thickness:Number=0){
super();
this.lineColor = color;
this.lineAlpha = alpha;
this.lineThickness = thickness;
this.doubleSided = false;
}
override public function toString():String{
return (((("WireframeMaterial - color:" + this.lineColor) + " alpha:") + this.lineAlpha));
}
override public function drawTriangle(face3D:Triangle3D, graphics:Graphics, renderSessionData:RenderSessionData, altBitmap:BitmapData=null, altUV:Matrix=null):void{
var x0:Number = face3D.v0.vertex3DInstance.x;
var y0:Number = face3D.v0.vertex3DInstance.y;
if (lineAlpha){
graphics.lineStyle(lineThickness, lineColor, lineAlpha);
graphics.moveTo(x0, y0);
graphics.lineTo(face3D.v1.vertex3DInstance.x, face3D.v1.vertex3DInstance.y);
graphics.lineTo(face3D.v2.vertex3DInstance.x, face3D.v2.vertex3DInstance.y);
graphics.lineTo(x0, y0);
graphics.lineStyle();
renderSessionData.renderStatistics.triangles++;
};
}
}
}//package org.papervision3d.materials
Section 377
//Plane (org.papervision3d.objects.primitives.Plane)
package org.papervision3d.objects.primitives {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.math.*;
import org.papervision3d.core.geom.*;
public class Plane extends TriangleMesh3D {
public var segmentsH:Number;
public var segmentsW:Number;
public static var DEFAULT_SCALE:Number = 1;
public static var DEFAULT_SEGMENTS:Number = 1;
public static var DEFAULT_SIZE:Number = 500;
public function Plane(material:MaterialObject3D=null, width:Number=0, height:Number=0, segmentsW:Number=0, segmentsH:Number=0, initObject:Object=null){
super(material, new Array(), new Array(), null, initObject);
this.segmentsW = ((segmentsW) || (DEFAULT_SEGMENTS));
this.segmentsH = ((segmentsH) || (this.segmentsW));
var scale:Number = DEFAULT_SCALE;
if (!height){
if (width){
scale = width;
};
if (((material) && (material.bitmap))){
width = (material.bitmap.width * scale);
height = (material.bitmap.height * scale);
} else {
width = (DEFAULT_SIZE * scale);
height = (DEFAULT_SIZE * scale);
};
};
buildPlane(width, height);
}
private function buildPlane(width:Number, height:Number):void{
var uvA:NumberUV;
var uvC:NumberUV;
var uvB:NumberUV;
var iy:int;
var x:Number;
var y:Number;
var a:Vertex3D;
var c:Vertex3D;
var b:Vertex3D;
var gridX:Number = this.segmentsW;
var gridY:Number = this.segmentsH;
var gridX1:Number = (gridX + 1);
var gridY1:Number = (gridY + 1);
var vertices:Array = this.geometry.vertices;
var faces:Array = this.geometry.faces;
var textureX:Number = (width / 2);
var textureY:Number = (height / 2);
var iW:Number = (width / gridX);
var iH:Number = (height / gridY);
var ix:int;
while (ix < (gridX + 1)) {
iy = 0;
while (iy < gridY1) {
x = ((ix * iW) - textureX);
y = ((iy * iH) - textureY);
vertices.push(new Vertex3D(x, y, 0));
iy++;
};
ix++;
};
ix = 0;
while (ix < gridX) {
iy = 0;
while (iy < gridY) {
a = vertices[((ix * gridY1) + iy)];
c = vertices[((ix * gridY1) + (iy + 1))];
b = vertices[(((ix + 1) * gridY1) + iy)];
uvA = new NumberUV((ix / gridX), (iy / gridY));
uvC = new NumberUV((ix / gridX), ((iy + 1) / gridY));
uvB = new NumberUV(((ix + 1) / gridX), (iy / gridY));
faces.push(new Triangle3D(this, [a, b, c], null, [uvA, uvB, uvC]));
a = vertices[(((ix + 1) * gridY1) + (iy + 1))];
c = vertices[(((ix + 1) * gridY1) + iy)];
b = vertices[((ix * gridY1) + (iy + 1))];
uvA = new NumberUV(((ix + 1) / gridX), ((iy + 1) / gridY));
uvC = new NumberUV(((ix + 1) / gridX), (iy / gridY));
uvB = new NumberUV((ix / gridX), ((iy + 1) / gridY));
faces.push(new Triangle3D(this, [a, b, c], null, [uvA, uvB, uvC]));
iy++;
};
ix++;
};
this.geometry.ready = true;
}
}
}//package org.papervision3d.objects.primitives
Section 378
//BookPage3D (org.papervision3d.objects.special.BookPage3D)
package org.papervision3d.objects.special {
import flash.display.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.math.*;
import org.papervision3d.core.geom.*;
import org.papervision3d.materials.*;
public class BookPage3D extends TriangleMesh3D {
private const DEGREE:Number = 0.0174532925199433;
private var width:Number;
private var boundary1:Number;// = 55
private var boundary2:Number;// = 130
private var flipped:Boolean;
private var vStripWidths:Array;
private var stripsU:Array;
private var origVerts:Array;
private var height:Number;
private var segmentsH:int;
private var boundary2Mod:Number;// = 0.6
private var segmentsW:int;// = 5
private var vertices:Array;
private var boundary1Mod:Number;// = 1.35
public var rotation:Number;// = 0
public static const MAX_ROTATION:Number = 180;
public function BookPage3D(bmp:BitmapData, width:Number, height:Number, flipped:Boolean=false, numHorizontalStrips:int=5){
var uvA:NumberUV;
var uvC:NumberUV;
var uvB:NumberUV;
var iy:int;
var idx:Number;
var x:Number;
var y:Number;
var a:Vertex3D;
var c:Vertex3D;
var b:Vertex3D;
stripsU = new Array();
vStripWidths = new Array();
origVerts = new Array();
this.width = width;
this.height = height;
this.flipped = flipped;
segmentsH = Math.floor(numHorizontalStrips);
if (segmentsH < 1){
segmentsH = 1;
};
var i:int;
while (i <= segmentsW) {
stripsU[i] = (Math.log((i + 1)) / Math.log((segmentsW + 1)));
i++;
};
super(new BitmapMaterial(bmp), new Array(), new Array(), null, null);
this.material.smooth = true;
vertices = this.geometry.vertices;
var faces:Array = this.geometry.faces;
var gridX:Number = segmentsW;
var gridY:Number = segmentsH;
var gridX1:Number = (gridX + 1);
var gridY1:Number = (gridY + 1);
var iW:Number = (width / gridX);
var iH:Number = (height / gridY);
var ix:int;
while (ix < gridX1) {
iy = 0;
while (iy < gridY1) {
idx = Math.floor((ix / (segmentsH + 1)));
x = (stripsU[idx] * width);
y = ((iy * iH) - (height / 2));
if (flipped){
x = (width - x);
};
vertices.push(new Vertex3D(x, y, 0));
iy++;
};
ix++;
};
if (flipped){
vertices.reverse();
};
ix = 0;
while (ix < gridX) {
iy = 0;
while (iy < gridY) {
a = vertices[((ix * gridY1) + iy)];
c = vertices[((ix * gridY1) + (iy + 1))];
b = vertices[(((ix + 1) * gridY1) + iy)];
uvA = new NumberUV(stripsU[ix], (iy / gridY));
uvC = new NumberUV(stripsU[ix], ((iy + 1) / gridY));
uvB = new NumberUV(stripsU[(ix + 1)], (iy / gridY));
if (flipped){
uvA.u = (1 - uvA.u);
uvA.v = (1 - uvA.v);
uvB.u = (1 - uvB.u);
uvB.v = (1 - uvB.v);
uvC.u = (1 - uvC.u);
uvC.v = (1 - uvC.v);
faces.push(new Triangle3D(this, [a, b, c], null, [uvA, uvB, uvC]));
} else {
faces.push(new Triangle3D(this, [a, b, c], null, [uvA, uvB, uvC]));
};
a = vertices[(((ix + 1) * gridY1) + (iy + 1))];
c = vertices[(((ix + 1) * gridY1) + iy)];
b = vertices[((ix * gridY1) + (iy + 1))];
uvA = new NumberUV(stripsU[(ix + 1)], ((iy + 1) / gridY));
uvC = new NumberUV(stripsU[(ix + 1)], (iy / gridY));
uvB = new NumberUV(stripsU[ix], ((iy + 1) / gridY));
if (flipped){
uvA.u = (1 - uvA.u);
uvA.v = (1 - uvA.v);
uvB.u = (1 - uvB.u);
uvB.v = (1 - uvB.v);
uvC.u = (1 - uvC.u);
uvC.v = (1 - uvC.v);
faces.push(new Triangle3D(this, [a, b, c], null, [uvA, uvB, uvC]));
} else {
faces.push(new Triangle3D(this, [a, b, c], null, [uvA, uvB, uvC]));
};
iy++;
};
ix++;
};
var l:int;
while (l < vertices.length) {
origVerts[l] = new Vertex3D();
origVerts[l].x = vertices[l].x;
origVerts[l].y = vertices[l].y;
origVerts[l].z = vertices[l].z;
l++;
};
vStripWidths = new Array();
var m:int;
while (m < segmentsW) {
vStripWidths[m] = ((stripsU[(m + 1)] * width) - (stripsU[m] * width));
m++;
};
rotate(0);
this.geometry.ready = true;
}
private function calcVerts(degRot:Number):Array{
var rMod:Number;
var a:Number;
var j:int;
var diff:Number;
var rotMult:Number;
var idx:Number;
var idx2:Number;
if (degRot < 0){
degRot = 0;
};
if (degRot > MAX_ROTATION){
degRot = MAX_ROTATION;
};
var myVerts:Array = new Array();
var vStripRots:Array = new Array();
var r:Number = (-(degRot) * DEGREE);
rMod = boundary1Mod;
if (degRot > boundary1){
a = (degRot - boundary1);
a = ((a / (boundary2 - boundary1)) * boundary2Mod);
rMod = (rMod - a);
};
var i:int;
while (i < segmentsW) {
vStripRots[i] = r;
r = (r * rMod);
i++;
};
if (degRot >= boundary2){
j = 0;
while (j < vStripRots.length) {
diff = ((MAX_ROTATION * DEGREE) - Math.abs(vStripRots[j]));
rotMult = (degRot - boundary2);
rotMult = (rotMult / (MAX_ROTATION - boundary2));
vStripRots[j] = (vStripRots[j] - (diff * rotMult));
j++;
};
};
var k:int;
while (k < vertices.length) {
idx = (Math.floor((k / (segmentsH + 1))) - 1);
if (idx >= 0){
myVerts[k] = new Vertex3D(vStripWidths[idx], origVerts[k].y, origVerts[k].z);
} else {
if (flipped){
myVerts[k] = new Vertex3D((width - origVerts[k].x), origVerts[k].y, origVerts[k].z);
} else {
myVerts[k] = new Vertex3D(origVerts[k].x, origVerts[k].y, origVerts[k].z);
};
};
k++;
};
var l:int = (segmentsH + 1);
while (l < myVerts.length) {
idx2 = (Math.floor((l / (segmentsH + 1))) - 1);
myVerts[l] = rotateVertexY(myVerts[l], vStripRots[idx2]);
l++;
};
var m:int = ((segmentsH + 1) * 2);
while (m < myVerts.length) {
myVerts[m].x = (myVerts[m].x + myVerts[(m - (segmentsH + 1))].x);
myVerts[m].z = (myVerts[m].z + myVerts[(m - (segmentsH + 1))].z);
m++;
};
return (myVerts);
}
private function applyVerts(v:Array):void{
var i:int;
while (i < vertices.length) {
vertices[i].x = v[i].x;
vertices[i].y = v[i].y;
vertices[i].z = v[i].z;
i++;
};
}
public function rotate(degree:Number):void{
if (degree < 0){
degree = 0;
};
if (degree > MAX_ROTATION){
degree = MAX_ROTATION;
};
applyVerts(calcVerts(degree));
}
private function rotateVertexY(p:Vertex3D, angleY:Number):Vertex3D{
var x:Number = ((Math.cos(angleY) * p.x) - (Math.sin(angleY) * p.z));
var z:Number = ((Math.cos(angleY) * p.z) + (Math.sin(angleY) * p.x));
var y:Number = p.y;
return (new Vertex3D(x, y, z));
}
}
}//package org.papervision3d.objects.special
Section 379
//DisplayObject3D (org.papervision3d.objects.DisplayObject3D)
package org.papervision3d.objects {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.materials.utils.*;
import org.papervision3d.view.layer.*;
import org.papervision3d.core.culling.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.math.*;
import org.papervision3d.*;
public class DisplayObject3D extends DisplayObjectContainer3D {
public var extra:Object;
public var id:int;
private var _rotationY:Number;
private var _rotationZ:Number;
private var _rotationX:Number;
public var meshSort:uint;// = 1
public var materials:MaterialsList;
private var _scaleDirty:Boolean;// = false
private var _scaleX:Number;
public var screenZ:Number;
public var geometry:GeometryObject3D;
public var transform:Matrix3D;
private var _scaleY:Number;
private var _scaleZ:Number;
public var screen:Number3D;
public var visible:Boolean;
protected var _useOwnContainer:Boolean;
protected var _containerSortMode:int;
public var name:String;
protected var _scene:SceneObject3D;// = null
public var culled:Boolean;
public var world:Matrix3D;
public var view:Matrix3D;
private var _material:MaterialObject3D;
public var parent:DisplayObjectContainer3D;
protected var _containerBlendMode:int;
protected var _filters:Array;
public var faces:Array;
protected var _transformDirty:Boolean;// = false
private var _boundingbox:Vertex3D;
private var _rotationDirty:Boolean;// = false
private var _centre:Vertex3D;
protected var _sorted:Array;
public static const MESH_SORT_CENTER:uint = 1;
public static const MESH_SORT_CLOSE:uint = 3;
public static const MESH_SORT_FAR:uint = 2;
private static var entry_count:uint = 0;
private static var LEFT:Number3D = new Number3D(-1, 0, 0);
private static var _totalDisplayObjects:int = 0;
private static var UP:Number3D = new Number3D(0, 1, 0);
public static var sortedArray:Array = new Array();
private static var BACKWARD:Number3D = new Number3D(0, 0, -1);
private static var FORWARD:Number3D = new Number3D(0, 0, 1);
private static var DOWN:Number3D = new Number3D(0, -1, 0);
public static var faceLevelMode:Boolean;
private static var toDEGREES:Number = 57.2957795130823;
private static var toRADIANS:Number = 0.0174532925199433;
private static var RIGHT:Number3D = new Number3D(1, 0, 0);
public function DisplayObject3D(name:String=null, geometry:GeometryObject3D=null, initObject:Object=null):void{
screen = new Number3D();
faces = new Array();
_centre = new Vertex3D(0, 0, 0);
_boundingbox = new Vertex3D(0, 0, 0);
super();
Papervision3D.log(("DisplayObject3D: " + name));
this.culled = false;
this.transform = Matrix3D.IDENTITY;
this.world = Matrix3D.IDENTITY;
this.view = Matrix3D.IDENTITY;
if (initObject != null){
this.x = (initObject.x) ? ((initObject.x) || (0)) : 0;
this.y = (initObject.y) ? ((initObject.y) || (0)) : 0;
this.z = (initObject.z) ? ((initObject.z) || (0)) : 0;
};
rotationX = (initObject) ? ((initObject.rotationX) || (0)) : 0;
rotationY = (initObject) ? ((initObject.rotationY) || (0)) : 0;
rotationZ = (initObject) ? ((initObject.rotationZ) || (0)) : 0;
var scaleDefault:Number = (Papervision3D.usePERCENT) ? 100 : 1;
scaleX = (initObject) ? ((initObject.scaleX) || (scaleDefault)) : scaleDefault;
scaleY = (initObject) ? ((initObject.scaleY) || (scaleDefault)) : scaleDefault;
scaleZ = (initObject) ? ((initObject.scaleZ) || (scaleDefault)) : scaleDefault;
if (((initObject) && (initObject.extra))){
this.extra = initObject.extra;
};
this.visible = true;
this.id = _totalDisplayObjects++;
this.name = ((name) || (String(this.id)));
if (geometry){
addGeometry(geometry);
};
}
function setLayerForViewport(layer:ViewportLayer):void{
}
public function get containerSortMode():int{
return (_containerSortMode);
}
public function set containerSortMode(sortMode:int):void{
_containerSortMode = sortMode;
}
public function get filters():Array{
return (_filters);
}
public function moveDown(distance:Number):void{
translate(distance, DOWN);
}
public function set scene(p_scene:SceneObject3D):void{
var child:DisplayObject3D;
_scene = p_scene;
for each (child in this._childrenByName) {
if (child.scene == null){
child.scene = _scene;
};
};
}
public function project(parent:DisplayObject3D, renderSessionData:RenderSessionData):Number{
var child:DisplayObject3D;
if (renderSessionData.viewPort.viewportObjectFilter){
if (renderSessionData.viewPort.viewportObjectFilter.testObject(this) == 0){
return (0);
};
};
if (this._transformDirty){
updateTransform();
};
this.world.calculateMultiply(parent.world, this.transform);
if ((renderSessionData.camera is IObjectCuller)){
if (this === renderSessionData.camera){
this.culled = true;
} else {
this.culled = (IObjectCuller(renderSessionData.camera).testObject(this) < 0);
};
if (this.culled){
renderSessionData.renderStatistics.culledObjects++;
return (0);
};
if (parent !== renderSessionData.camera){
this.view.calculateMultiply4x4(parent.view, this.transform);
};
} else {
if (parent !== renderSessionData.camera){
this.view.calculateMultiply(parent.view, this.transform);
};
};
calculateScreenCoords(renderSessionData.camera);
var screenZs:Number = 0;
var children:Number = 0;
if (_useOwnContainer){
};
for each (child in this._childrenByName) {
if (child.visible){
screenZs = (screenZs + child.project(this, renderSessionData));
children++;
};
};
return ((this.screenZ = (screenZs / children)));
}
public function set containerBlendMode(blendmode:int):void{
_containerBlendMode = blendmode;
}
public function get material():MaterialObject3D{
return (_material);
}
public function distanceToPoint(vertex:Vertex3D):Number{
var x:Number = (this.x - vertex.x);
var y:Number = (this.y - vertex.y);
var z:Number = (this.z - vertex.z);
return (Math.sqrt((((x * x) + (y * y)) + (z * z))));
}
private function calculateScreenCoords(camera:CameraObject3D):void{
var persp:Number = ((camera.focus * camera.zoom) / (camera.focus + view.n34));
screen.x = (view.n14 * persp);
screen.y = (view.n24 * persp);
screen.z = view.n34;
}
public function lookAt(targetObject:DisplayObject3D, upAxis:Number3D=null):void{
var xAxis:Number3D;
var yAxis:Number3D;
var look:Matrix3D;
var position:Number3D = new Number3D(this.x, this.y, this.z);
var target:Number3D = new Number3D(targetObject.x, targetObject.y, targetObject.z);
var zAxis:Number3D = Number3D.sub(target, position);
zAxis.normalize();
if (zAxis.modulo > 0.1){
xAxis = Number3D.cross(zAxis, ((upAxis) || (UP)));
xAxis.normalize();
yAxis = Number3D.cross(zAxis, xAxis);
yAxis.normalize();
look = this.transform;
look.n11 = (xAxis.x * _scaleX);
look.n21 = (xAxis.y * _scaleX);
look.n31 = (xAxis.z * _scaleX);
look.n12 = (-(yAxis.x) * _scaleY);
look.n22 = (-(yAxis.y) * _scaleY);
look.n32 = (-(yAxis.z) * _scaleY);
look.n13 = (zAxis.x * _scaleZ);
look.n23 = (zAxis.y * _scaleZ);
look.n33 = (zAxis.z * _scaleZ);
this._transformDirty = false;
this._rotationDirty = true;
};
}
public function set rotationX(rot:Number):void{
this._rotationX = (Papervision3D.useDEGREES) ? (-(rot) * toRADIANS) : -(rot);
this._transformDirty = true;
}
public function get containerBlendMode():int{
return (_containerBlendMode);
}
public function set rotationZ(rot:Number):void{
this._rotationZ = (Papervision3D.useDEGREES) ? (-(rot) * toRADIANS) : -(rot);
this._transformDirty = true;
}
public function addGeometry(geometry:GeometryObject3D=null):void{
if (geometry){
this.geometry = geometry;
};
}
public function set rotationY(rot:Number):void{
this._rotationY = (Papervision3D.useDEGREES) ? (-(rot) * toRADIANS) : -(rot);
this._transformDirty = true;
}
public function pitch(angle:Number):void{
angle = (Papervision3D.useDEGREES) ? (angle * toRADIANS) : angle;
var vector:Number3D = RIGHT.clone();
if (this._transformDirty){
updateTransform();
};
Matrix3D.rotateAxis(transform, vector);
var m:Matrix3D = Matrix3D.rotationMatrix(vector.x, vector.y, vector.z, angle);
this.transform.calculateMultiply3x3(m, transform);
this._rotationDirty = true;
}
public function get scale():Number{
if ((((this._scaleX == this._scaleY)) && ((this._scaleX == this._scaleZ)))){
if (Papervision3D.usePERCENT){
return ((this._scaleX * 100));
};
return (this._scaleX);
//unresolved jump
};
return (NaN);
}
public function get sceneX():Number{
return (this.world.n14);
}
public function get sceneY():Number{
return (this.world.n24);
}
public function translate(distance:Number, axis:Number3D):void{
var vector:Number3D = axis.clone();
if (this._transformDirty){
updateTransform();
};
Matrix3D.rotateAxis(transform, vector);
this.x = (this.x + (distance * vector.x));
this.y = (this.y + (distance * vector.y));
this.z = (this.z + (distance * vector.z));
}
public function get scaleY():Number{
if (Papervision3D.usePERCENT){
return ((this._scaleY * 100));
};
return (this._scaleY);
}
public function get scaleZ():Number{
if (Papervision3D.usePERCENT){
return ((this._scaleZ * 100));
};
return (this._scaleZ);
}
public function moveUp(distance:Number):void{
translate(distance, UP);
}
public function get scaleX():Number{
if (Papervision3D.usePERCENT){
return ((this._scaleX * 100));
};
return (this._scaleX);
}
public function distanceTo(obj:DisplayObject3D):Number{
var x:Number = (this.x - obj.x);
var y:Number = (this.y - obj.y);
var z:Number = (this.z - obj.z);
return (Math.sqrt((((x * x) + (y * y)) + (z * z))));
}
public function set boundingbox(boundingbox:Vertex3D):void{
this._boundingbox = boundingbox;
}
public function hitTestObject(obj:DisplayObject3D, multiplier:Number=1):Boolean{
var dx:Number = (this.x - obj.x);
var dy:Number = (this.y - obj.y);
var dz:Number = (this.z - obj.z);
var d2:Number = (((dx * dx) + (dy * dy)) + (dz * dz));
var sA:Number = (this.geometry) ? this.geometry.boundingSphere2 : 0;
var sB:Number = (obj.geometry) ? obj.geometry.boundingSphere2 : 0;
sA = (sA * multiplier);
return (((sA + sB) > d2));
}
public function get sceneZ():Number{
return (this.world.n34);
}
private function updateRotation():void{
var rot:Number3D = Matrix3D.matrix2euler(this.transform);
this._rotationX = (rot.x * toRADIANS);
this._rotationY = (rot.y * toRADIANS);
this._rotationZ = (rot.z * toRADIANS);
this._rotationDirty = false;
}
override public function toString():String{
return (((((((this.name + ": x:") + Math.round(this.x)) + " y:") + Math.round(this.y)) + " z:") + Math.round(this.z)));
}
public function yaw(angle:Number):void{
angle = (Papervision3D.useDEGREES) ? (angle * toRADIANS) : angle;
var vector:Number3D = UP.clone();
if (this._transformDirty){
updateTransform();
};
Matrix3D.rotateAxis(transform, vector);
var m:Matrix3D = Matrix3D.rotationMatrix(vector.x, vector.y, vector.z, angle);
this.transform.calculateMultiply3x3(m, transform);
this._rotationDirty = true;
}
public function set material(material:MaterialObject3D):void{
if (_material){
_material.unregisterObject(this);
};
_material = material;
_material.registerObject(this);
}
public function copyTransform(reference):void{
var trans:Matrix3D;
var matrix:Matrix3D;
trans = this.transform;
matrix = ((reference is DisplayObject3D)) ? reference.transform : reference;
trans.n11 = matrix.n11;
trans.n12 = matrix.n12;
trans.n13 = matrix.n13;
trans.n14 = matrix.n14;
trans.n21 = matrix.n21;
trans.n22 = matrix.n22;
trans.n23 = matrix.n23;
trans.n24 = matrix.n24;
trans.n31 = matrix.n31;
trans.n32 = matrix.n32;
trans.n33 = matrix.n33;
trans.n34 = matrix.n34;
this._transformDirty = false;
this._rotationDirty = true;
}
public function moveLeft(distance:Number):void{
translate(distance, LEFT);
}
public function get y():Number{
return (this.transform.n24);
}
public function get z():Number{
return (this.transform.n34);
}
public function roll(angle:Number):void{
angle = (Papervision3D.useDEGREES) ? (angle * toRADIANS) : angle;
var vector:Number3D = FORWARD.clone();
if (this._transformDirty){
updateTransform();
};
Matrix3D.rotateAxis(transform, vector);
var m:Matrix3D = Matrix3D.rotationMatrix(vector.x, vector.y, vector.z, angle);
this.transform.calculateMultiply3x3(m, transform);
this._rotationDirty = true;
}
public function lookAtPoint(targetObject:Vertex3D, upAxis:Number3D=null):void{
var xAxis:Number3D;
var yAxis:Number3D;
var look:Matrix3D;
var position:Number3D = new Number3D(this.x, this.y, this.z);
var target:Number3D = new Number3D(targetObject.x, targetObject.y, targetObject.z);
var zAxis:Number3D = Number3D.sub(target, position);
zAxis.normalize();
if (zAxis.modulo > 0.1){
xAxis = Number3D.cross(zAxis, ((upAxis) || (UP)));
xAxis.normalize();
yAxis = Number3D.cross(zAxis, xAxis);
yAxis.normalize();
look = this.transform;
look.n11 = (xAxis.x * _scaleX);
look.n21 = (xAxis.y * _scaleX);
look.n31 = (xAxis.z * _scaleX);
look.n12 = (-(yAxis.x) * _scaleY);
look.n22 = (-(yAxis.y) * _scaleY);
look.n32 = (-(yAxis.z) * _scaleY);
look.n13 = (zAxis.x * _scaleZ);
look.n23 = (zAxis.y * _scaleZ);
look.n33 = (zAxis.z * _scaleZ);
this._transformDirty = false;
this._rotationDirty = true;
};
}
public function get x():Number{
return (this.transform.n14);
}
public function set useOwnContainer(b:Boolean):void{
_useOwnContainer = b;
}
public function getMaterialByName(name:String):MaterialObject3D{
var child:DisplayObject3D;
var material:MaterialObject3D = this.materials.getMaterialByName(name);
if (material){
return (material);
};
for each (child in this._childrenByName) {
material = child.getMaterialByName(name);
if (material){
return (material);
};
};
return (null);
}
public function get scene():SceneObject3D{
return (_scene);
}
public function set scale(scale:Number):void{
if (Papervision3D.usePERCENT){
scale = (scale / 100);
};
this._scaleX = (this._scaleY = (this._scaleZ = scale));
this._transformDirty = true;
}
public function get rotationX():Number{
if (this._rotationDirty){
updateRotation();
};
return ((Papervision3D.useDEGREES) ? (-(this._rotationX) * toDEGREES) : -(this._rotationX));
}
public function get rotationY():Number{
if (this._rotationDirty){
updateRotation();
};
return ((Papervision3D.useDEGREES) ? (-(this._rotationY) * toDEGREES) : -(this._rotationY));
}
public function set scaleX(scale:Number):void{
if (Papervision3D.usePERCENT){
this._scaleX = (scale / 100);
} else {
this._scaleX = scale;
};
this._transformDirty = true;
}
public function set scaleY(scale:Number):void{
if (Papervision3D.usePERCENT){
this._scaleY = (scale / 100);
} else {
this._scaleY = scale;
};
this._transformDirty = true;
}
public function set scaleZ(scale:Number):void{
if (Papervision3D.usePERCENT){
this._scaleZ = (scale / 100);
} else {
this._scaleZ = scale;
};
this._transformDirty = true;
}
public function get rotationZ():Number{
if (this._rotationDirty){
updateRotation();
};
return ((Papervision3D.useDEGREES) ? (-(this._rotationZ) * toDEGREES) : -(this._rotationZ));
}
public function get boundingbox():Vertex3D{
return (new Vertex3D((this._boundingbox.x * this._scaleX), (this._boundingbox.y * this._scaleY), (this._boundingbox.z * this._scaleZ)));
}
protected function updateTransform():void{
var q:Object = Matrix3D.euler2quaternion(-(this._rotationY), -(this._rotationZ), this._rotationX);
var m:Matrix3D = Matrix3D.quaternion2matrix(q.x, q.y, q.z, q.w);
var transform:Matrix3D = this.transform;
m.n14 = transform.n14;
m.n24 = transform.n24;
m.n34 = transform.n34;
transform.copy(m);
var scaleM:Matrix3D = Matrix3D.IDENTITY;
scaleM.n11 = this._scaleX;
scaleM.n22 = this._scaleY;
scaleM.n33 = this._scaleZ;
this.transform.calculateMultiply(transform, scaleM);
this._transformDirty = false;
}
public function moveForward(distance:Number):void{
translate(distance, FORWARD);
}
public function set centre(centre:Vertex3D):void{
this._centre = centre;
}
public function copyPosition(reference):void{
var trans:Matrix3D = this.transform;
var matrix:Matrix3D = ((reference is DisplayObject3D)) ? reference.transform : reference;
trans.n14 = matrix.n14;
trans.n24 = matrix.n24;
trans.n34 = matrix.n34;
}
public function get useOwnContainer():Boolean{
return (_useOwnContainer);
}
public function hitTestPoint(x:Number, y:Number, z:Number):Boolean{
var dx:Number = (this.x - x);
var dy:Number = (this.y - y);
var dz:Number = (this.z - z);
var d2:Number = (((dx * dx) + (dy * dy)) + (dz * dz));
var sA:Number = (this.geometry) ? this.geometry.boundingSphere2 : 0;
return ((sA > d2));
}
public function moveRight(distance:Number):void{
translate(distance, RIGHT);
}
public function moveBackward(distance:Number):void{
translate(distance, BACKWARD);
}
public function get centre():Vertex3D{
return (new Vertex3D((this._centre.x * this.scaleX), (this._centre.y * this.scaleY), (this._centre.z * this.scaleZ)));
}
public function materialsList():String{
var name:String;
var child:DisplayObject3D;
var list:String = "";
for (name in this.materials) {
list = (list + (name + "\n"));
};
for each (child in this._childrenByName) {
for (name in child.materials.materialsByName) {
list = (list + (("+ " + name) + "\n"));
};
};
return (list);
}
public function set x(value:Number):void{
this.transform.n14 = value;
}
public function set y(value:Number):void{
this.transform.n24 = value;
}
public function set z(value:Number):void{
this.transform.n34 = value;
}
public function set filters(filters:Array):void{
_filters = filters;
}
override public function addChild(child:DisplayObject3D, name:String=null):DisplayObject3D{
child = super.addChild(child, name);
if (child.scene == null){
child.scene = scene;
};
return (child);
}
public static function get ZERO():DisplayObject3D{
return (new (DisplayObject3D));
}
}
}//package org.papervision3d.objects
Section 380
//BasicRenderEngine (org.papervision3d.render.BasicRenderEngine)
package org.papervision3d.render {
import flash.geom.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.view.*;
import org.papervision3d.core.render.command.*;
import org.papervision3d.objects.*;
import org.papervision3d.events.*;
import org.papervision3d.core.culling.*;
import org.papervision3d.core.render.material.*;
import org.papervision3d.core.render.*;
import org.papervision3d.core.render.sort.*;
import org.papervision3d.core.utils.*;
import org.papervision3d.core.render.filter.*;
public class BasicRenderEngine extends AbstractRenderEngine implements IRenderEngine {
protected var cleanRHD:RenderHitData;
public var sorter:IRenderSorter;
protected var stopWatch:StopWatch;
protected var renderSessionData:RenderSessionData;
public var filter:IRenderFilter;
protected var renderStatistics:RenderStatistics;
protected var renderList:Array;
public function BasicRenderEngine():void{
cleanRHD = new RenderHitData();
super();
init();
}
protected function doRender(renderSessionData:RenderSessionData):RenderStatistics{
var rc:IRenderListItem;
stopWatch.reset();
stopWatch.start();
MaterialManager.getInstance().updateMaterialsBeforeRender(renderSessionData);
filter.filter(renderList);
sorter.sort(renderList);
while ((rc = renderList.pop())) {
rc.render(renderSessionData);
renderSessionData.viewPort.lastRenderList.push(rc);
};
MaterialManager.getInstance().updateMaterialsAfterRender(renderSessionData);
renderSessionData.renderStatistics.renderTime = stopWatch.stop();
renderSessionData.viewPort.updateAfterRender();
return (renderStatistics);
}
override public function removeFromRenderList(renderCommand:IRenderListItem):int{
return (renderList.splice(renderList.indexOf(renderCommand), 1));
}
public function hitTestPoint2D(point:Point, viewPort3D:Viewport3D):RenderHitData{
return (viewPort3D.hitTestPoint2D(point));
}
protected function doProject(renderSessionData:RenderSessionData):void{
var p:DisplayObject3D;
stopWatch.reset();
stopWatch.start();
renderSessionData.camera.transformView();
var objects:Array = renderSessionData.scene.objects;
var i:Number = objects.length;
if ((renderSessionData.camera is IObjectCuller)){
for each (p in objects) {
if (p.visible){
if (renderSessionData.viewPort.viewportObjectFilter){
if (renderSessionData.viewPort.viewportObjectFilter.testObject(p)){
p.view.calculateMultiply4x4(renderSessionData.camera.eye, p.transform);
p.project(renderSessionData.camera, renderSessionData);
} else {
renderSessionData.renderStatistics.filteredObjects++;
};
} else {
p.view.calculateMultiply4x4(renderSessionData.camera.eye, p.transform);
p.project(renderSessionData.camera, renderSessionData);
};
};
};
} else {
for each (p in objects) {
if (p.visible){
if (renderSessionData.viewPort.viewportObjectFilter){
if (renderSessionData.viewPort.viewportObjectFilter.testObject(p)){
p.view.calculateMultiply(renderSessionData.camera.eye, p.transform);
p.project(renderSessionData.camera, renderSessionData);
} else {
renderSessionData.renderStatistics.filteredObjects++;
};
} else {
p.view.calculateMultiply(renderSessionData.camera.eye, p.transform);
p.project(renderSessionData.camera, renderSessionData);
};
};
};
};
renderSessionData.renderStatistics.projectionTime = stopWatch.stop();
}
protected function init():void{
renderStatistics = new RenderStatistics();
stopWatch = new StopWatch();
sorter = new BasicRenderSorter();
filter = new BasicRenderFilter();
renderList = new Array();
renderSessionData = new RenderSessionData();
renderSessionData.renderer = this;
}
override public function renderScene(scene:SceneObject3D, camera:CameraObject3D, viewPort:Viewport3D, updateAnimation:Boolean=true):RenderStatistics{
viewPort.updateBeforeRender();
viewPort.lastRenderer = this;
if (((scene.animationEngine) && ((updateAnimation == true)))){
scene.animationEngine.tick();
};
renderSessionData.scene = scene;
renderSessionData.camera = camera;
renderSessionData.viewPort = viewPort;
renderSessionData.container = viewPort.containerSprite;
renderSessionData.triangleCuller = viewPort.triangleCuller;
renderSessionData.particleCuller = viewPort.particleCuller;
renderSessionData.renderStatistics.clear();
doProject(renderSessionData);
doRender(renderSessionData);
dispatchEvent(new RendererEvent(RendererEvent.RENDER_DONE, renderSessionData));
return (renderSessionData.renderStatistics);
}
override public function addToRenderList(renderCommand:IRenderListItem):int{
return (renderList.push(renderCommand));
}
}
}//package org.papervision3d.render
Section 381
//Scene3D (org.papervision3d.scenes.Scene3D)
package org.papervision3d.scenes {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.animation.core.*;
public class Scene3D extends SceneObject3D {
public function Scene3D(animated:Boolean=false){
super();
this.animated = animated;
if (animated){
this.animationEngine = AnimationEngine.getInstance();
};
}
}
}//package org.papervision3d.scenes
Section 382
//ViewportBaseLayer (org.papervision3d.view.layer.ViewportBaseLayer)
package org.papervision3d.view.layer {
import org.papervision3d.view.*;
public class ViewportBaseLayer extends ViewportLayer {
public function ViewportBaseLayer(viewport:Viewport3D){
super(viewport, null);
}
}
}//package org.papervision3d.view.layer
Section 383
//ViewportLayer (org.papervision3d.view.layer.ViewportLayer)
package org.papervision3d.view.layer {
import flash.display.*;
import org.papervision3d.view.*;
import org.papervision3d.objects.*;
public class ViewportLayer extends Sprite {
private var childLayers:Array;
protected var _displayObject3D:DisplayObject3D;
protected var viewport:Viewport3D;
public function ViewportLayer(viewport:Viewport3D, do3d:DisplayObject3D){
super();
this.viewport = viewport;
this.displayObject3D = do3d;
init();
}
public function set displayObject3D(do3d:DisplayObject3D):void{
_displayObject3D = do3d;
}
function clear():void{
var vpl:ViewportLayer;
for each (vpl in childLayers) {
vpl.clear();
removeChild(vpl);
};
graphics.clear();
}
private function init():void{
childLayers = new Array();
}
public function get displayObject3D():DisplayObject3D{
return (_displayObject3D);
}
function getChildLayerFor(displayObject3D:DisplayObject3D):ViewportLayer{
var vpl:ViewportLayer;
if (displayObject3D){
vpl = new ViewportLayer(viewport, displayObject3D);
addChild(vpl);
return (vpl);
};
trace("Needs to be a do3d");
return (null);
}
}
}//package org.papervision3d.view.layer
Section 384
//Viewport3D (org.papervision3d.view.Viewport3D)
package org.papervision3d.view {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.render.command.*;
import org.papervision3d.events.*;
import org.papervision3d.render.*;
import org.papervision3d.view.layer.*;
import org.papervision3d.core.culling.*;
import org.papervision3d.core.render.*;
import org.papervision3d.core.utils.*;
import org.papervision3d.core.view.*;
public class Viewport3D extends Sprite implements IViewport3D {
public var interactiveSceneManager:InteractiveSceneManager;
public var lastRenderList:Array;
protected var cullingRectangle:Rectangle;
protected var _interactive:Boolean;
protected var _viewportObjectFilter:ViewportObjectFilter;
protected var _autoCulling:Boolean;
public var particleCuller:IParticleCuller;
protected var _height:Number;
protected var _width:Number;
protected var _autoScaleToStage:Boolean;
public var triangleCuller:ITriangleCuller;
protected var _lastRenderer:IRenderEngine;
protected var _hWidth:Number;
protected var _containerSprite:ViewportBaseLayer;
protected var _hHeight:Number;
public var sizeRectangle:Rectangle;
protected var _autoClipping:Boolean;
public function Viewport3D(viewportWidth:Number=640, viewportHeight:Number=480, autoScaleToStage:Boolean=false, interactive:Boolean=false, autoClipping:Boolean=true, autoCulling:Boolean=true){
super();
this.interactive = interactive;
init();
this.viewportWidth = viewportWidth;
this.viewportHeight = viewportHeight;
this.autoClipping = autoClipping;
this.autoCulling = autoCulling;
this.autoScaleToStage = autoScaleToStage;
}
protected function handleRenderDone(e:RendererEvent):void{
interactiveSceneManager.updateRenderHitData();
}
public function get autoCulling():Boolean{
return (_autoCulling);
}
public function set autoCulling(culling:Boolean):void{
if (culling){
triangleCuller = new RectangleTriangleCuller(cullingRectangle);
particleCuller = new RectangleParticleCuller(cullingRectangle);
} else {
if (!culling){
triangleCuller = new DefaultTriangleCuller();
particleCuller = new DefaultParticleCuller();
};
};
_autoCulling = culling;
}
public function set viewportWidth(width:Number):void{
_width = width;
_hWidth = (width / 2);
containerSprite.x = _hWidth;
sizeRectangle.width = width;
cullingRectangle.x = -(_hWidth);
cullingRectangle.width = width;
scrollRect = sizeRectangle;
}
public function updateAfterRender():void{
}
protected function init():void{
lastRenderList = new Array();
sizeRectangle = new Rectangle();
cullingRectangle = new Rectangle();
_containerSprite = new ViewportBaseLayer(this);
addChild(_containerSprite);
if (interactive){
interactiveSceneManager = new InteractiveSceneManager(this);
};
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
}
public function get autoClipping():Boolean{
return (_autoClipping);
}
protected function onAddedToStage(event:Event):void{
stage.addEventListener(Event.RESIZE, onStageResize);
onStageResize();
}
public function get containerSprite():ViewportLayer{
return (_containerSprite);
}
public function set autoClipping(clip:Boolean):void{
if (clip){
scrollRect = sizeRectangle;
} else {
scrollRect = null;
};
_autoClipping = clip;
}
public function get viewportWidth():Number{
return (_width);
}
public function set viewportObjectFilter(vof:ViewportObjectFilter):void{
_viewportObjectFilter = vof;
}
public function set interactive(b:Boolean):void{
_interactive = b;
}
public function set autoScaleToStage(scale:Boolean):void{
_autoScaleToStage = scale;
if (((scale) && (!((stage == null))))){
onStageResize();
};
}
public function set viewportHeight(height:Number):void{
_height = height;
_hHeight = (height / 2);
containerSprite.y = _hHeight;
sizeRectangle.height = height;
cullingRectangle.y = -(_hHeight);
cullingRectangle.height = height;
scrollRect = sizeRectangle;
}
public function updateBeforeRender():void{
lastRenderList.length = 0;
_containerSprite.clear();
}
public function hitTestMouse():RenderHitData{
var p:Point = new Point(containerSprite.mouseX, containerSprite.mouseY);
return (hitTestPoint2D(p));
}
public function get interactive():Boolean{
return (_interactive);
}
public function hitTestPoint2D(point:Point):RenderHitData{
var rli:RenderableListItem;
var rhd:RenderHitData;
var rc:IRenderListItem;
var i:uint;
if (interactive){
rhd = new RenderHitData();
i = lastRenderList.length;
while ((rc = lastRenderList[--i])) {
if ((rc is RenderableListItem)){
rli = (rc as RenderableListItem);
rhd = rli.hitTestPoint2D(point, rhd);
if (rhd.hasHit){
return (rhd);
};
};
};
};
return (new RenderHitData());
}
public function get autoScaleToStage():Boolean{
return (_autoScaleToStage);
}
public function get viewportObjectFilter():ViewportObjectFilter{
return (_viewportObjectFilter);
}
public function get viewportHeight():Number{
return (_height);
}
public function set lastRenderer(value:BasicRenderEngine):void{
if (!interactive){
return;
};
value.removeEventListener(RendererEvent.RENDER_DONE, handleRenderDone);
value.addEventListener(RendererEvent.RENDER_DONE, handleRenderDone);
}
protected function onRemovedFromStage(event:Event):void{
stage.removeEventListener(Event.RESIZE, onStageResize);
}
protected function onStageResize(event:Event=null):void{
if (_autoScaleToStage){
viewportWidth = stage.stageWidth;
viewportHeight = stage.stageHeight;
};
}
}
}//package org.papervision3d.view
Section 385
//Papervision3D (org.papervision3d.Papervision3D)
package org.papervision3d {
public class Papervision3D {
public static var useDEGREES:Boolean = true;
public static var VERBOSE:Boolean = true;
public static var AUTHOR:String = "(c) 2006-2007 Copyright by Carlos Ulloa - | John Grden | Ralph Hauwert | Tim Knip";
public static var DATE:String = "3.12.07";
public static var NAME:String = "Papervision3D";
public static var VERSION:String = "Public Alpha 2.0 - Great White";
public static var usePERCENT:Boolean = false;
public function Papervision3D(){
super();
}
public static function log(message:String):void{
if (Papervision3D.VERBOSE){
trace(message);
};
}
}
}//package org.papervision3d
Section 386
//_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 387
//_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 388
//_advancedDataGridStylesStyle (_advancedDataGridStylesStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _advancedDataGridStylesStyle {
public static function init(:IFlexModuleFactory):void{
var fbs = ;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".advancedDataGridStyles");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".advancedDataGridStyles", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 389
//_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 390
//_AlertStyle (_AlertStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _AlertStyle {
public static function init(backgroundAlpha:IFlexModuleFactory):void{
var fbs = backgroundAlpha;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("Alert");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("Alert", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 2;
this.borderColor = 8821927;
this.paddingLeft = 10;
this.color = 0xFFFFFF;
this.roundedBottomCorners = true;
this.paddingRight = 10;
this.backgroundAlpha = 0.9;
this.paddingBottom = 2;
this.borderAlpha = 0.9;
this.buttonStyleName = "alertButtonStyle";
this.backgroundColor = 8821927;
};
};
}
}
}//package
Section 391
//_ApplicationStyle (_ApplicationStyle)
package {
import mx.core.*;
import mx.styles.*;
import mx.skins.halo.*;
public class _ApplicationStyle {
public static function init(paddingRight:IFlexModuleFactory):void{
var fbs = paddingRight;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("Application");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("Application", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 24;
this.paddingLeft = 24;
this.backgroundGradientAlphas = [1, 1];
this.horizontalAlign = "center";
this.paddingRight = 24;
this.backgroundImage = ApplicationBackground;
this.paddingBottom = 24;
this.backgroundSize = "100%";
this.backgroundColor = 8821927;
};
};
}
}
}//package
Section 392
//_ButtonStyle (_ButtonStyle)
package {
import mx.core.*;
import mx.styles.*;
import mx.skins.halo.*;
public class _ButtonStyle {
public static function init(paddingLeft:IFlexModuleFactory):void{
var fbs = paddingLeft;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("Button");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("Button", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 2;
this.textAlign = "center";
this.skin = ButtonSkin;
this.paddingLeft = 10;
this.fontWeight = "bold";
this.cornerRadius = 4;
this.paddingRight = 10;
this.verticalGap = 2;
this.horizontalGap = 2;
this.paddingBottom = 2;
};
};
}
}
}//package
Section 393
//_comboDropdownStyle (_comboDropdownStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _comboDropdownStyle {
public static function init(dropShadowEnabled:IFlexModuleFactory):void{
var fbs = dropShadowEnabled;
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.paddingLeft = 5;
this.fontWeight = "normal";
this.cornerRadius = 0;
this.paddingRight = 5;
this.dropShadowEnabled = true;
this.shadowDirection = "center";
this.leading = 0;
this.borderThickness = 0;
this.shadowDistance = 1;
this.backgroundColor = 0xFFFFFF;
};
};
}
}
}//package
Section 394
//_ContainerStyle (_ContainerStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _ContainerStyle {
public static function init(:IFlexModuleFactory):void{
var fbs = ;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("Container");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("Container", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.borderStyle = "none";
};
};
}
}
}//package
Section 395
//_ControlBarStyle (_ControlBarStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _ControlBarStyle {
public static function init(paddingLeft:IFlexModuleFactory):void{
var fbs = paddingLeft;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("ControlBar");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("ControlBar", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 10;
this.disabledOverlayAlpha = 0;
this.paddingLeft = 10;
this.paddingRight = 10;
this.verticalAlign = "middle";
this.paddingBottom = 10;
this.borderStyle = "controlBar";
};
};
}
}
}//package
Section 396
//_CursorManagerStyle (_CursorManagerStyle)
package {
import mx.core.*;
import mx.styles.*;
import mx.skins.halo.*;
public class _CursorManagerStyle {
private static var _embed_css_Assets_swf_mx_skins_cursor_BusyCursor_31630188:Class = _CursorManagerStyle__embed_css_Assets_swf_mx_skins_cursor_BusyCursor_31630188;
public static function init(mx.skins.halo:IFlexModuleFactory):void{
var fbs = mx.skins.halo;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("CursorManager");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("CursorManager", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.busyCursor = BusyCursor;
this.busyCursorBackground = _embed_css_Assets_swf_mx_skins_cursor_BusyCursor_31630188;
};
};
}
}
}//package
Section 397
//_CursorManagerStyle__embed_css_Assets_swf_mx_skins_cursor_BusyCursor_31630188 (_CursorManagerStyle__embed_css_Assets_swf_mx_skins_cursor_BusyCursor_31630188)
package {
import mx.core.*;
public class _CursorManagerStyle__embed_css_Assets_swf_mx_skins_cursor_BusyCursor_31630188 extends SpriteAsset {
}
}//package
Section 398
//_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 399
//_dateFieldPopupStyle (_dateFieldPopupStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _dateFieldPopupStyle {
public static function init(_dateFieldPopupStyle.as$22:IFlexModuleFactory):void{
var fbs = _dateFieldPopupStyle.as$22;
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.borderThickness = 0;
this.backgroundColor = 0xFFFFFF;
};
};
}
}
}//package
Section 400
//_DifferenceGamePlayer_FlexInit (_DifferenceGamePlayer_FlexInit)
package {
import mx.core.*;
import mx.styles.*;
import mx.effects.*;
import flash.utils.*;
import flash.system.*;
public class _DifferenceGamePlayer_FlexInit {
public static function init(added:IFlexModuleFactory):void{
var _local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("addedEffect", "added");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("creationCompleteEffect", "creationComplete");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("focusInEffect", "focusIn");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("focusOutEffect", "focusOut");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("hideEffect", "hide");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("mouseDownEffect", "mouseDown");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("mouseUpEffect", "mouseUp");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("moveEffect", "move");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("removedEffect", "removed");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("resizeEffect", "resize");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("resizeEndEffect", "resizeEnd");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("resizeStartEffect", "resizeStart");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("rollOutEffect", "rollOut");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("rollOverEffect", "rollOver");
_local4 = EffectManager;
_local4.mx_internal::registerEffectTrigger("showEffect", "show");
var _local2:Array = ["fontWeight", "modalTransparencyBlur", "textRollOverColor", "backgroundDisabledColor", "textIndent", "barColor", "fontSize", "kerning", "footerColors", "textAlign", "fontStyle", "modalTransparencyDuration", "textSelectedColor", "modalTransparency", "fontGridFitType", "disabledColor", "fontAntiAliasType", "modalTransparencyColor", "leading", "dropShadowColor", "themeColor", "letterSpacing", "fontFamily", "color", "fontThickness", "errorColor", "headerColors", "fontSharpness", "textDecoration"];
var _local3:int;
while (_local3 < _local2.length) {
StyleManager.registerInheritingStyle(_local2[_local3]);
_local3++;
};
}
}
}//package
Section 401
//_DifferenceGamePlayer_mx_managers_SystemManager (_DifferenceGamePlayer_mx_managers_SystemManager)
package {
import mx.core.*;
import mx.managers.*;
import flash.system.*;
import com.evilfree.*;
public class _DifferenceGamePlayer_mx_managers_SystemManager extends SystemManager implements IFlexModuleFactory {
override public function create(... _args):Object{
if ((((_args.length > 0)) && (!((_args[0] is String))))){
return (super.create.apply(this, _args));
};
var _local2:String = ((_args.length == 0)) ? "DifferenceGamePlayer" : String(_args[0]);
var _local3:Class = Class(getDefinitionByName(_local2));
if (!_local3){
return (null);
};
var _local4:Object = new (_local3);
if ((_local4 is IFlexModule)){
IFlexModule(_local4).moduleFactory = this;
};
if (_args.length == 0){
EmbeddedFontRegistry.registerFonts(info()["fonts"], this);
};
return (_local4);
}
override public function info():Object{
return ({addedToStage:"ini(event)", backgroundColor:"#000000", backgroundGradientAlphas:"[1.0, 1.0]", backgroundGradientColors:"[#000000, #000000]", borderStyle:"solid", borderThickness:"0", compiledLocales:["en_US"], compiledResourceBundleNames:["containers", "controls", "core", "effects", "skins", "styles"], currentDomain:ApplicationDomain.currentDomain, fonts:{MaiandraBold:{regular:false, bold:true, italic:false, boldItalic:false}, Verdana:{regular:true, bold:false, italic:false, boldItalic:false}}, height:"560", layout:"absolute", mainClassName:"DifferenceGamePlayer", mixins:["_DifferenceGamePlayer_FlexInit", "_alertButtonStyleStyle", "_ControlBarStyle", "_ScrollBarStyle", "_activeTabStyleStyle", "_textAreaHScrollBarStyleStyle", "_ToolTipStyle", "_advancedDataGridStylesStyle", "_comboDropdownStyle", "_ContainerStyle", "_textAreaVScrollBarStyleStyle", "_linkButtonStyleStyle", "_globalStyle", "_windowStatusStyle", "_windowStylesStyle", "_PanelStyle", "_activeButtonStyleStyle", "_errorTipStyle", "_richTextEditorTextAreaStyleStyle", "_CursorManagerStyle", "_todayStyleStyle", "_dateFieldPopupStyle", "_plainStyle", "_dataGridStylesStyle", "_ApplicationStyle", "_headerDateTextStyle", "_ButtonStyle", "_popUpMenuStyle", "_AlertStyle", "_swatchPanelTextFieldStyle", "_opaquePanelStyle", "_weekDayStyleStyle", "_headerDragProxyStyleStyle"], preloader:Preloader, themeColor:"#000000", width:"560"});
}
}
}//package
Section 402
//_errorTipStyle (_errorTipStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _errorTipStyle {
public static function init(fontWeight:IFlexModuleFactory):void{
var fbs = fontWeight;
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.paddingTop = 4;
this.borderColor = 13510953;
this.paddingLeft = 4;
this.color = 0xFFFFFF;
this.fontWeight = "bold";
this.paddingRight = 4;
this.shadowColor = 0;
this.fontSize = 9;
this.paddingBottom = 4;
this.borderStyle = "errorTipRight";
};
};
}
}
}//package
Section 403
//_globalStyle (_globalStyle)
package {
import mx.core.*;
import mx.styles.*;
import mx.skins.halo.*;
public class _globalStyle {
public static function init(borderAlpha:IFlexModuleFactory):void{
var fbs = borderAlpha;
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.fontWeight = "normal";
this.modalTransparencyBlur = 3;
this.verticalGridLineColor = 14015965;
this.borderStyle = "inset";
this.buttonColor = 7305079;
this.borderCapColor = 9542041;
this.textAlign = "left";
this.disabledIconColor = 0x999999;
this.stroked = false;
this.fillColors = [0xFFFFFF, 0xCCCCCC, 0xFFFFFF, 0xEEEEEE];
this.fontStyle = "normal";
this.borderSides = "left top right bottom";
this.borderThickness = 1;
this.modalTransparencyDuration = 100;
this.useRollOver = true;
this.strokeWidth = 1;
this.filled = true;
this.borderColor = 12040892;
this.horizontalGridLines = false;
this.horizontalGridLineColor = 0xF7F7F7;
this.shadowCapColor = 14015965;
this.fontGridFitType = "pixel";
this.horizontalAlign = "left";
this.modalTransparencyColor = 0xDDDDDD;
this.disabledColor = 11187123;
this.borderSkin = HaloBorder;
this.dropShadowColor = 0;
this.paddingBottom = 0;
this.indentation = 17;
this.version = "3.0.0";
this.fontThickness = 0;
this.verticalGridLines = true;
this.embedFonts = false;
this.fontSharpness = 0;
this.shadowDirection = "center";
this.textDecoration = "none";
this.selectionDuration = 250;
this.bevel = true;
this.fillColor = 0xFFFFFF;
this.focusBlendMode = "normal";
this.dropShadowEnabled = false;
this.textRollOverColor = 2831164;
this.textIndent = 0;
this.fontSize = 10;
this.openDuration = 250;
this.closeDuration = 250;
this.kerning = false;
this.paddingTop = 0;
this.highlightAlphas = [0.3, 0];
this.cornerRadius = 0;
this.horizontalGap = 8;
this.textSelectedColor = 2831164;
this.paddingLeft = 0;
this.modalTransparency = 0.5;
this.roundedBottomCorners = true;
this.repeatDelay = 500;
this.selectionDisabledColor = 0xDDDDDD;
this.fontAntiAliasType = "advanced";
this.focusSkin = HaloFocusRect;
this.verticalGap = 6;
this.leading = 2;
this.shadowColor = 0xEEEEEE;
this.backgroundAlpha = 1;
this.iconColor = 0x111111;
this.focusAlpha = 0.4;
this.borderAlpha = 1;
this.focusThickness = 2;
this.themeColor = 40447;
this.backgroundSize = "auto";
this.indicatorGap = 14;
this.letterSpacing = 0;
this.fontFamily = "Verdana";
this.fillAlphas = [0.6, 0.4, 0.75, 0.65];
this.color = 734012;
this.paddingRight = 0;
this.errorColor = 0xFF0000;
this.verticalAlign = "top";
this.focusRoundedCorners = "tl tr bl br";
this.shadowDistance = 2;
this.repeatInterval = 35;
};
};
}
}
}//package
Section 404
//_headerDateTextStyle (_headerDateTextStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _headerDateTextStyle {
public static function init(center:IFlexModuleFactory):void{
var fbs = center;
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.textAlign = "center";
this.fontWeight = "bold";
};
};
}
}
}//package
Section 405
//_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 406
//_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.paddingRight = 2;
this.paddingBottom = 2;
};
};
}
}
}//package
Section 407
//_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.footerColors = [0xE7E7E7, 0xC7C7C7];
this.borderColor = 0xFFFFFF;
this.headerColors = [0xE7E7E7, 0xD9D9D9];
this.borderAlpha = 1;
this.backgroundColor = 0xFFFFFF;
};
};
}
}
}//package
Section 408
//_PanelStyle (_PanelStyle)
package {
import mx.core.*;
import mx.styles.*;
import mx.skins.halo.*;
public class _PanelStyle {
public static function init(windowStyles:IFlexModuleFactory):void{
var effects:Array;
var fbs = windowStyles;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("Panel");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("Panel", style, false);
effects = style.mx_internal::effects;
if (!effects){
effects = (style.mx_internal::effects = new Array());
};
effects.push("resizeEndEffect");
effects.push("resizeStartEffect");
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.borderColor = 0xE2E2E2;
this.paddingLeft = 0;
this.roundedBottomCorners = false;
this.dropShadowEnabled = true;
this.resizeStartEffect = "Dissolve";
this.borderSkin = PanelSkin;
this.statusStyleName = "windowStatus";
this.borderAlpha = 0.4;
this.borderStyle = "default";
this.paddingBottom = 0;
this.resizeEndEffect = "Dissolve";
this.paddingTop = 0;
this.borderThicknessRight = 10;
this.titleStyleName = "windowStyles";
this.cornerRadius = 4;
this.paddingRight = 0;
this.borderThicknessLeft = 10;
this.titleBackgroundSkin = TitleBackground;
this.borderThickness = 0;
this.borderThicknessTop = 2;
this.backgroundColor = 0xFFFFFF;
};
};
}
}
}//package
Section 409
//_plainStyle (_plainStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _plainStyle {
public static function init(left:IFlexModuleFactory):void{
var fbs = left;
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.paddingLeft = 0;
this.horizontalAlign = "left";
this.paddingRight = 0;
this.backgroundImage = "";
this.paddingBottom = 0;
this.backgroundColor = 0xFFFFFF;
};
};
}
}
}//package
Section 410
//_popUpMenuStyle (_popUpMenuStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _popUpMenuStyle {
public static function init(left:IFlexModuleFactory):void{
var fbs = left;
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.textAlign = "left";
this.fontWeight = "normal";
};
};
}
}
}//package
Section 411
//_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 412
//_ScrollBarStyle (_ScrollBarStyle)
package {
import mx.core.*;
import mx.styles.*;
import mx.skins.halo.*;
public class _ScrollBarStyle {
public static function init(ScrollTrackSkin:IFlexModuleFactory):void{
var fbs = ScrollTrackSkin;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("ScrollBar");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("ScrollBar", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.trackColors = [9738651, 0xE7E7E7];
this.thumbOffset = 0;
this.paddingTop = 0;
this.downArrowSkin = ScrollArrowSkin;
this.borderColor = 12040892;
this.paddingLeft = 0;
this.cornerRadius = 4;
this.paddingRight = 0;
this.trackSkin = ScrollTrackSkin;
this.thumbSkin = ScrollThumbSkin;
this.paddingBottom = 0;
this.upArrowSkin = ScrollArrowSkin;
};
};
}
}
}//package
Section 413
//_swatchPanelTextFieldStyle (_swatchPanelTextFieldStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _swatchPanelTextFieldStyle {
public static function init(shadowColor:IFlexModuleFactory):void{
var fbs = shadowColor;
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.highlightColor = 12897484;
this.borderColor = 14015965;
this.paddingLeft = 5;
this.shadowCapColor = 14015965;
this.paddingRight = 5;
this.shadowColor = 14015965;
this.borderStyle = "inset";
this.buttonColor = 7305079;
this.backgroundColor = 0xFFFFFF;
this.borderCapColor = 9542041;
};
};
}
}
}//package
Section 414
//_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 415
//_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 416
//_todayStyleStyle (_todayStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _todayStyleStyle {
public static function init(center:IFlexModuleFactory):void{
var fbs = center;
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.textAlign = "center";
this.color = 0xFFFFFF;
};
};
}
}
}//package
Section 417
//_ToolTipStyle (_ToolTipStyle)
package {
import mx.core.*;
import mx.styles.*;
import mx.skins.halo.*;
public class _ToolTipStyle {
public static function init(mx.skins.halo:IFlexModuleFactory):void{
var fbs = mx.skins.halo;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("ToolTip");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("ToolTip", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 2;
this.borderColor = 9542041;
this.paddingLeft = 4;
this.cornerRadius = 2;
this.paddingRight = 4;
this.shadowColor = 0;
this.fontSize = 9;
this.borderSkin = ToolTipBorder;
this.backgroundAlpha = 0.95;
this.paddingBottom = 2;
this.borderStyle = "toolTip";
this.backgroundColor = 16777164;
};
};
}
}
}//package
Section 418
//_weekDayStyleStyle (_weekDayStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _weekDayStyleStyle {
public static function init(center:IFlexModuleFactory):void{
var fbs = center;
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.textAlign = "center";
this.fontWeight = "bold";
};
};
}
}
}//package
Section 419
//_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 420
//_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 421
//DifferenceGame (DifferenceGame)
package {
import flash.display.*;
import mx.core.*;
import flash.geom.*;
import flash.events.*;
import com.kongregate.as3.client.*;
import mx.styles.*;
import flash.text.*;
import com.evilfree.*;
import flash.ui.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.media.*;
import flash.filters.*;
import mx.binding.*;
import flash.external.*;
import flash.accessibility.*;
import flash.debugger.*;
import flash.errors.*;
import flash.printing.*;
import flash.profiler.*;
import flash.xml.*;
public class DifferenceGame extends UIComponent {
public var Org17:Class;
public var Org8Dif1:Class;
public var Org8Dif2:Class;
public var Org8Dif5:Class;
public var Org8Dif6:Class;
public var Org0Dif5:Class;
public var Org8Dif0:Class;
public var Org8Dif3:Class;
public var Org19:Class;
public var Org0Dif6:Class;
public var Org0Dif7:Class;
public var se1:Class;
public var se2:Class;
public var se3:Class;
public var se4:Class;
public var se5:Class;
public var se6:Class;
public var Org21:Class;
public var scoreTimer:EvilFreeTimer;
private var gameBranch:Array;
public var Org20:Class;
private var scenesByName:Object;
private var timedGame:Boolean;// = false
public var difData:XML;
private var overlay:MovieClip;
public var Org14Dif0:Class;
public var Org14Dif1:Class;
public var Org14Dif2:Class;
public var Org14Dif3:Class;
public var Org14Dif4:Class;
public var Org14Dif5:Class;
public var Org14Dif6:Class;
public var Org14Dif7:Class;
public var Org14Dif8:Class;
public var Org14Dif9:Class;
public var Org7Dif0:Class;
public var Org7Dif1:Class;
public var Org7Dif2:Class;
public var Org7Dif3:Class;
public var Org7Dif4:Class;
public var Org7Dif5:Class;
public var Org7Dif6:Class;
public var Org7Dif7:Class;
public var Org7Dif8:Class;
private var _cheatDispatch:CheatDispatcher;
public var branchStore:SharedObject;
private var template:MovieClip;
public var imageTransitionManager:ImageTransitionManager;
private var overlayLoader:Loader;
private var coverBitmapData:BitmapData;
private var prevSnap:BitmapData;
public var hiliteState:String;
public var Org13Dif0:Class;
public var Org13Dif1:Class;
public var Org13Dif2:Class;
public var Org13Dif3:Class;
public var Org13Dif4:Class;
public var Org13Dif5:Class;
public var Org13Dif6:Class;
public var Org13Dif7:Class;
public var Org13Dif8:Class;
public var Org13Dif9:Class;
public var Org6Dif0:Class;
public var Org6Dif1:Class;
public var Org6Dif2:Class;
public var Org6Dif3:Class;
public var Org6Dif4:Class;
public var Org6Dif5:Class;
public var Org6Dif6:Class;
public var Org6Dif7:Class;
private var gameBranchIndex:Number;// = 0
private var currentBranchIndex:Number;// = 0
private var internalLoader:Loader;
public var sounds:SoundManager;
public var bonusbox:SceneTextEffect;
public var menuManager:MenuManager;
private var menubutton:TextField;
public var Org12Dif0:Class;
public var Org12Dif1:Class;
public var Org12Dif2:Class;
public var Org12Dif3:Class;
public var Org12Dif4:Class;
public var Org12Dif5:Class;
public var Org12Dif6:Class;
public var Org12Dif7:Class;
public var Org12Dif8:Class;
public var Org12Dif9:Class;
public var menu:MovieClip;
public var Org5Dif0:Class;
public var Org5Dif1:Class;
public var Org5Dif2:Class;
public var Org5Dif3:Class;
public var Org5Dif4:Class;
public var Org5Dif5:Class;
public var Org5Dif6:Class;
public var Org5Dif7:Class;
public var Org5Dif8:Class;
public var Org5Dif9:Class;
private var nextSceneTimer:Timer;
private var scenes:Array;
private var menuButton:MovieClip;
public var badClickMc:MovieClip;
private var sceneMask:Sprite;
public var Org11Dif0:Class;
public var Org11Dif1:Class;
public var Org11Dif2:Class;
public var Org11Dif3:Class;
public var Org11Dif4:Class;
public var Org11Dif5:Class;
public var Org11Dif6:Class;
public var Org11Dif7:Class;
public var Org11Dif8:Class;
public var Org11Dif9:Class;
public var Org19Dif2:Class;
public var Org4Dif0:Class;
public var Org4Dif1:Class;
public var Org4Dif2:Class;
public var Org4Dif3:Class;
public var Org4Dif4:Class;
public var Org4Dif5:Class;
public var Org4Dif6:Class;
public var Org4Dif8:Class;
public var Org4Dif9:Class;
public var Org19Dif7:Class;
public var Org19Dif0:Class;
public var Org19Dif1:Class;
public var Org0:Class;
public var Org1:Class;
public var Org2:Class;
public var Org3:Class;
public var Org4:Class;
public var Org5:Class;
public var Org6:Class;
public var XMLFILE:Class;
public var Org8:Class;
public var Org9:Class;
public var Org19Dif3:Class;
public var Org19Dif5:Class;
public var Org19Dif6:Class;
public var Org7:Class;
public var Org19Dif8:Class;
public var Org19Dif9:Class;
public var Org4Dif7:Class;
public var Org19Dif4:Class;
public var goodClickMc:MovieClip;
public var noPoints:Boolean;// = false
private var _parent:DifferenceGamePlayer;
public var GAME_STATE:String;// = "_loading"
public var imageArray:Array;
private var myHeight:Number;// = 530
public var prevScene:BitmapData;
private var scorebox:TextField;
private var curSnap:BitmapData;
public var curScene:DifferenceScene;
public var countdown:EvilFreeTimer;
public var scenetimer:EvilFreeTimer;
public var Org10Dif0:Class;
public var Org10Dif1:Class;
public var Org10Dif2:Class;
public var Org10Dif3:Class;
public var Org10Dif4:Class;
public var Org10Dif5:Class;
public var Org10Dif6:Class;
public var Org10Dif7:Class;
public var Org10Dif8:Class;
public var Org10Dif9:Class;
public var Org18Dif2:Class;
public var Org18Dif3:Class;
public var Org3Dif0:Class;
public var Org3Dif1:Class;
public var Org3Dif2:Class;
public var Org3Dif3:Class;
public var Org3Dif4:Class;
public var Org3Dif5:Class;
public var Org3Dif6:Class;
public var Org3Dif7:Class;
public var Org3Dif8:Class;
public var Org18Dif6:Class;
public var Org18Dif7:Class;
public var Org18Dif0:Class;
public var Org18Dif1:Class;
public var Org18Dif4:Class;
public var Org18Dif5:Class;
public var Org18Dif8:Class;
public var Org18Dif9:Class;
public var Org21Dif1:Class;
public var Org21Dif2:Class;
public var Org21Dif3:Class;
public var Org21Dif4:Class;
public var Org21Dif5:Class;
public var Org21Dif6:Class;
public var Org21Dif0:Class;
public var Org21Dif8:Class;
public var Org21Dif9:Class;
public var mochiBots:Object;
public var missedClicks:Number;
public var Org21Dif7:Class;
public var MenuBg0:Class;
public var MenuBg1:Class;
public var MenuBg2:Class;
public var MenuBg3:Class;
public var MenuBg4:Class;
public var score:Number;// = 0
public var currentScene:Number;
private var curtain:MovieClip;
private var timeeffect:SceneTextEffect;
public var initGameFirst:Boolean;// = true
public var Org17Dif2:Class;
public var Org17Dif3:Class;
public var Org2Dif0:Class;
public var Org2Dif1:Class;
public var Org2Dif2:Class;
public var Org2Dif3:Class;
public var Org2Dif4:Class;
public var Org2Dif5:Class;
public var Org2Dif6:Class;
public var Org2Dif7:Class;
public var Org2Dif8:Class;
public var Org17Dif6:Class;
public var Org17Dif7:Class;
public var Org17Dif8:Class;
public var Org17Dif9:Class;
public var Org17Dif4:Class;
public var Org17Dif5:Class;
public var Org17Dif1:Class;
public var Org20Dif3:Class;
public var Org20Dif4:Class;
public var Org20Dif5:Class;
public var Org20Dif6:Class;
public var Org20Dif0:Class;
public var Org20Dif2:Class;
public var Org17Dif0:Class;
public var matchClick:Boolean;
private var myMask:Sprite;
public var Org20Dif7:Class;
public var Org20Dif8:Class;
public var Org20Dif1:Class;
private var branching:Boolean;// = false
public var Org20Dif9:Class;
public var differenceArray:Array;
public var timer:EvilFreeTimer;
public var Org16Dif0:Class;
public var Org16Dif1:Class;
public var Org16Dif2:Class;
public var Org16Dif3:Class;
public var Org1Dif0:Class;
public var Org1Dif1:Class;
public var Org1Dif2:Class;
public var Org1Dif3:Class;
public var Org1Dif4:Class;
public var Org1Dif5:Class;
public var Org1Dif6:Class;
public var Org1Dif7:Class;
public var Org1Dif8:Class;
public var Org9Dif1:Class;
public var Org9Dif2:Class;
public var Org9Dif3:Class;
public var Org16Dif9:Class;
public var Org9Dif5:Class;
public var Org9Dif6:Class;
public var Org9Dif7:Class;
public var Org9Dif8:Class;
public var Org9Dif9:Class;
public var Org16Dif7:Class;
public var Org9Dif4:Class;
private var numDifferences:Number;
public var Org9Dif0:Class;
public var Org16Dif4:Class;
public var Org16Dif5:Class;
public var Org16Dif6:Class;
public var Org16Dif8:Class;
private var myWidth:Number;// = 345
private var timedScene:Boolean;// = false
public var Org15Dif0:Class;
public var Org15Dif1:Class;
public var Org15Dif2:Class;
public var Org15Dif3:Class;
public var Org0Dif0:Class;
public var Org0Dif2:Class;
public var Org0Dif3:Class;
public var Org0Dif4:Class;
public var Org15Dif4:Class;
public var Org0Dif8:Class;
public var Org11:Class;
public var Org15Dif7:Class;
public var Org13:Class;
public var Org15Dif9:Class;
public var Org15:Class;
public var Org16:Class;
public var Org10:Class;
public var Org8Dif8:Class;
public var Org12:Class;
public var Org14:Class;
public var Org8Dif7:Class;
public var Org18:Class;
public var Org15Dif5:Class;
public var Org15Dif6:Class;
public var Org15Dif8:Class;
public var Org0Dif1:Class;
public var Org8Dif4:Class;
public static const templateE:Class = DifferenceGame_templateE;
public static const overlayE:Class = DifferenceGame_overlayE;
private static var STATE_PLAYING:String = "_playing";
private static var STATE_WON:String = "_won";
private static var STATE_MENU:String = "_menu";
private static var STATE_LOST:String = "_lost";
private static var STATE_PAUSED:String = "_paused";
mx_internal static var _DifferenceGame_StylesInit_done:Boolean = false;
public function DifferenceGame(){
XMLFILE = DifferenceGame_XMLFILE;
se1 = DifferenceGame_se1;
se2 = DifferenceGame_se2;
se3 = DifferenceGame_se3;
se4 = DifferenceGame_se4;
se5 = DifferenceGame_se5;
se6 = DifferenceGame_se6;
MenuBg0 = DifferenceGame_MenuBg0;
MenuBg1 = DifferenceGame_MenuBg1;
MenuBg2 = DifferenceGame_MenuBg2;
MenuBg3 = DifferenceGame_MenuBg3;
MenuBg4 = DifferenceGame_MenuBg4;
Org0 = DifferenceGame_Org0;
Org0Dif0 = DifferenceGame_Org0Dif0;
Org0Dif1 = DifferenceGame_Org0Dif1;
Org0Dif2 = DifferenceGame_Org0Dif2;
Org0Dif3 = DifferenceGame_Org0Dif3;
Org0Dif4 = DifferenceGame_Org0Dif4;
Org0Dif5 = DifferenceGame_Org0Dif5;
Org0Dif6 = DifferenceGame_Org0Dif6;
Org0Dif7 = DifferenceGame_Org0Dif7;
Org0Dif8 = DifferenceGame_Org0Dif8;
Org1 = DifferenceGame_Org1;
Org1Dif0 = DifferenceGame_Org1Dif0;
Org1Dif1 = DifferenceGame_Org1Dif1;
Org1Dif2 = DifferenceGame_Org1Dif2;
Org1Dif3 = DifferenceGame_Org1Dif3;
Org1Dif4 = DifferenceGame_Org1Dif4;
Org1Dif5 = DifferenceGame_Org1Dif5;
Org1Dif6 = DifferenceGame_Org1Dif6;
Org1Dif7 = DifferenceGame_Org1Dif7;
Org1Dif8 = DifferenceGame_Org1Dif8;
Org2 = DifferenceGame_Org2;
Org2Dif0 = DifferenceGame_Org2Dif0;
Org2Dif1 = DifferenceGame_Org2Dif1;
Org2Dif2 = DifferenceGame_Org2Dif2;
Org2Dif3 = DifferenceGame_Org2Dif3;
Org2Dif4 = DifferenceGame_Org2Dif4;
Org2Dif5 = DifferenceGame_Org2Dif5;
Org2Dif6 = DifferenceGame_Org2Dif6;
Org2Dif7 = DifferenceGame_Org2Dif7;
Org2Dif8 = DifferenceGame_Org2Dif8;
Org3 = DifferenceGame_Org3;
Org3Dif0 = DifferenceGame_Org3Dif0;
Org3Dif1 = DifferenceGame_Org3Dif1;
Org3Dif2 = DifferenceGame_Org3Dif2;
Org3Dif3 = DifferenceGame_Org3Dif3;
Org3Dif4 = DifferenceGame_Org3Dif4;
Org3Dif5 = DifferenceGame_Org3Dif5;
Org3Dif6 = DifferenceGame_Org3Dif6;
Org3Dif7 = DifferenceGame_Org3Dif7;
Org3Dif8 = DifferenceGame_Org3Dif8;
Org4 = DifferenceGame_Org4;
Org4Dif0 = DifferenceGame_Org4Dif0;
Org4Dif1 = DifferenceGame_Org4Dif1;
Org4Dif2 = DifferenceGame_Org4Dif2;
Org4Dif3 = DifferenceGame_Org4Dif3;
Org4Dif4 = DifferenceGame_Org4Dif4;
Org4Dif5 = DifferenceGame_Org4Dif5;
Org4Dif6 = DifferenceGame_Org4Dif6;
Org4Dif7 = DifferenceGame_Org4Dif7;
Org4Dif8 = DifferenceGame_Org4Dif8;
Org4Dif9 = DifferenceGame_Org4Dif9;
Org5 = DifferenceGame_Org5;
Org5Dif0 = DifferenceGame_Org5Dif0;
Org5Dif1 = DifferenceGame_Org5Dif1;
Org5Dif2 = DifferenceGame_Org5Dif2;
Org5Dif3 = DifferenceGame_Org5Dif3;
Org5Dif4 = DifferenceGame_Org5Dif4;
Org5Dif5 = DifferenceGame_Org5Dif5;
Org5Dif6 = DifferenceGame_Org5Dif6;
Org5Dif7 = DifferenceGame_Org5Dif7;
Org5Dif8 = DifferenceGame_Org5Dif8;
Org5Dif9 = DifferenceGame_Org5Dif9;
Org6 = DifferenceGame_Org6;
Org6Dif0 = DifferenceGame_Org6Dif0;
Org6Dif1 = DifferenceGame_Org6Dif1;
Org6Dif2 = DifferenceGame_Org6Dif2;
Org6Dif3 = DifferenceGame_Org6Dif3;
Org6Dif4 = DifferenceGame_Org6Dif4;
Org6Dif5 = DifferenceGame_Org6Dif5;
Org6Dif6 = DifferenceGame_Org6Dif6;
Org6Dif7 = DifferenceGame_Org6Dif7;
Org7 = DifferenceGame_Org7;
Org7Dif0 = DifferenceGame_Org7Dif0;
Org7Dif1 = DifferenceGame_Org7Dif1;
Org7Dif2 = DifferenceGame_Org7Dif2;
Org7Dif3 = DifferenceGame_Org7Dif3;
Org7Dif4 = DifferenceGame_Org7Dif4;
Org7Dif5 = DifferenceGame_Org7Dif5;
Org7Dif6 = DifferenceGame_Org7Dif6;
Org7Dif7 = DifferenceGame_Org7Dif7;
Org7Dif8 = DifferenceGame_Org7Dif8;
Org8 = DifferenceGame_Org8;
Org8Dif0 = DifferenceGame_Org8Dif0;
Org8Dif1 = DifferenceGame_Org8Dif1;
Org8Dif2 = DifferenceGame_Org8Dif2;
Org8Dif3 = DifferenceGame_Org8Dif3;
Org8Dif4 = DifferenceGame_Org8Dif4;
Org8Dif5 = DifferenceGame_Org8Dif5;
Org8Dif6 = DifferenceGame_Org8Dif6;
Org8Dif7 = DifferenceGame_Org8Dif7;
Org8Dif8 = DifferenceGame_Org8Dif8;
Org9 = DifferenceGame_Org9;
Org9Dif0 = DifferenceGame_Org9Dif0;
Org9Dif1 = DifferenceGame_Org9Dif1;
Org9Dif2 = DifferenceGame_Org9Dif2;
Org9Dif3 = DifferenceGame_Org9Dif3;
Org9Dif4 = DifferenceGame_Org9Dif4;
Org9Dif5 = DifferenceGame_Org9Dif5;
Org9Dif6 = DifferenceGame_Org9Dif6;
Org9Dif7 = DifferenceGame_Org9Dif7;
Org9Dif8 = DifferenceGame_Org9Dif8;
Org9Dif9 = DifferenceGame_Org9Dif9;
Org10 = DifferenceGame_Org10;
Org10Dif0 = DifferenceGame_Org10Dif0;
Org10Dif1 = DifferenceGame_Org10Dif1;
Org10Dif2 = DifferenceGame_Org10Dif2;
Org10Dif3 = DifferenceGame_Org10Dif3;
Org10Dif4 = DifferenceGame_Org10Dif4;
Org10Dif5 = DifferenceGame_Org10Dif5;
Org10Dif6 = DifferenceGame_Org10Dif6;
Org10Dif7 = DifferenceGame_Org10Dif7;
Org10Dif8 = DifferenceGame_Org10Dif8;
Org10Dif9 = DifferenceGame_Org10Dif9;
Org11 = DifferenceGame_Org11;
Org11Dif0 = DifferenceGame_Org11Dif0;
Org11Dif1 = DifferenceGame_Org11Dif1;
Org11Dif2 = DifferenceGame_Org11Dif2;
Org11Dif3 = DifferenceGame_Org11Dif3;
Org11Dif4 = DifferenceGame_Org11Dif4;
Org11Dif5 = DifferenceGame_Org11Dif5;
Org11Dif6 = DifferenceGame_Org11Dif6;
Org11Dif7 = DifferenceGame_Org11Dif7;
Org11Dif8 = DifferenceGame_Org11Dif8;
Org11Dif9 = DifferenceGame_Org11Dif9;
Org12 = DifferenceGame_Org12;
Org12Dif0 = DifferenceGame_Org12Dif0;
Org12Dif1 = DifferenceGame_Org12Dif1;
Org12Dif2 = DifferenceGame_Org12Dif2;
Org12Dif3 = DifferenceGame_Org12Dif3;
Org12Dif4 = DifferenceGame_Org12Dif4;
Org12Dif5 = DifferenceGame_Org12Dif5;
Org12Dif6 = DifferenceGame_Org12Dif6;
Org12Dif7 = DifferenceGame_Org12Dif7;
Org12Dif8 = DifferenceGame_Org12Dif8;
Org12Dif9 = DifferenceGame_Org12Dif9;
Org13 = DifferenceGame_Org13;
Org13Dif0 = DifferenceGame_Org13Dif0;
Org13Dif1 = DifferenceGame_Org13Dif1;
Org13Dif2 = DifferenceGame_Org13Dif2;
Org13Dif3 = DifferenceGame_Org13Dif3;
Org13Dif4 = DifferenceGame_Org13Dif4;
Org13Dif5 = DifferenceGame_Org13Dif5;
Org13Dif6 = DifferenceGame_Org13Dif6;
Org13Dif7 = DifferenceGame_Org13Dif7;
Org13Dif8 = DifferenceGame_Org13Dif8;
Org13Dif9 = DifferenceGame_Org13Dif9;
Org14 = DifferenceGame_Org14;
Org14Dif0 = DifferenceGame_Org14Dif0;
Org14Dif1 = DifferenceGame_Org14Dif1;
Org14Dif2 = DifferenceGame_Org14Dif2;
Org14Dif3 = DifferenceGame_Org14Dif3;
Org14Dif4 = DifferenceGame_Org14Dif4;
Org14Dif5 = DifferenceGame_Org14Dif5;
Org14Dif6 = DifferenceGame_Org14Dif6;
Org14Dif7 = DifferenceGame_Org14Dif7;
Org14Dif8 = DifferenceGame_Org14Dif8;
Org14Dif9 = DifferenceGame_Org14Dif9;
Org15 = DifferenceGame_Org15;
Org15Dif0 = DifferenceGame_Org15Dif0;
Org15Dif1 = DifferenceGame_Org15Dif1;
Org15Dif2 = DifferenceGame_Org15Dif2;
Org15Dif3 = DifferenceGame_Org15Dif3;
Org15Dif4 = DifferenceGame_Org15Dif4;
Org15Dif5 = DifferenceGame_Org15Dif5;
Org15Dif6 = DifferenceGame_Org15Dif6;
Org15Dif7 = DifferenceGame_Org15Dif7;
Org15Dif8 = DifferenceGame_Org15Dif8;
Org15Dif9 = DifferenceGame_Org15Dif9;
Org16 = DifferenceGame_Org16;
Org16Dif0 = DifferenceGame_Org16Dif0;
Org16Dif1 = DifferenceGame_Org16Dif1;
Org16Dif2 = DifferenceGame_Org16Dif2;
Org16Dif3 = DifferenceGame_Org16Dif3;
Org16Dif4 = DifferenceGame_Org16Dif4;
Org16Dif5 = DifferenceGame_Org16Dif5;
Org16Dif6 = DifferenceGame_Org16Dif6;
Org16Dif7 = DifferenceGame_Org16Dif7;
Org16Dif8 = DifferenceGame_Org16Dif8;
Org16Dif9 = DifferenceGame_Org16Dif9;
Org17 = DifferenceGame_Org17;
Org17Dif0 = DifferenceGame_Org17Dif0;
Org17Dif1 = DifferenceGame_Org17Dif1;
Org17Dif2 = DifferenceGame_Org17Dif2;
Org17Dif3 = DifferenceGame_Org17Dif3;
Org17Dif4 = DifferenceGame_Org17Dif4;
Org17Dif5 = DifferenceGame_Org17Dif5;
Org17Dif6 = DifferenceGame_Org17Dif6;
Org17Dif7 = DifferenceGame_Org17Dif7;
Org17Dif8 = DifferenceGame_Org17Dif8;
Org17Dif9 = DifferenceGame_Org17Dif9;
Org18 = DifferenceGame_Org18;
Org18Dif0 = DifferenceGame_Org18Dif0;
Org18Dif1 = DifferenceGame_Org18Dif1;
Org18Dif2 = DifferenceGame_Org18Dif2;
Org18Dif3 = DifferenceGame_Org18Dif3;
Org18Dif4 = DifferenceGame_Org18Dif4;
Org18Dif5 = DifferenceGame_Org18Dif5;
Org18Dif6 = DifferenceGame_Org18Dif6;
Org18Dif7 = DifferenceGame_Org18Dif7;
Org18Dif8 = DifferenceGame_Org18Dif8;
Org18Dif9 = DifferenceGame_Org18Dif9;
Org19 = DifferenceGame_Org19;
Org19Dif0 = DifferenceGame_Org19Dif0;
Org19Dif1 = DifferenceGame_Org19Dif1;
Org19Dif2 = DifferenceGame_Org19Dif2;
Org19Dif3 = DifferenceGame_Org19Dif3;
Org19Dif4 = DifferenceGame_Org19Dif4;
Org19Dif5 = DifferenceGame_Org19Dif5;
Org19Dif6 = DifferenceGame_Org19Dif6;
Org19Dif7 = DifferenceGame_Org19Dif7;
Org19Dif8 = DifferenceGame_Org19Dif8;
Org19Dif9 = DifferenceGame_Org19Dif9;
Org20 = DifferenceGame_Org20;
Org20Dif0 = DifferenceGame_Org20Dif0;
Org20Dif1 = DifferenceGame_Org20Dif1;
Org20Dif2 = DifferenceGame_Org20Dif2;
Org20Dif3 = DifferenceGame_Org20Dif3;
Org20Dif4 = DifferenceGame_Org20Dif4;
Org20Dif5 = DifferenceGame_Org20Dif5;
Org20Dif6 = DifferenceGame_Org20Dif6;
Org20Dif7 = DifferenceGame_Org20Dif7;
Org20Dif8 = DifferenceGame_Org20Dif8;
Org20Dif9 = DifferenceGame_Org20Dif9;
Org21 = DifferenceGame_Org21;
Org21Dif0 = DifferenceGame_Org21Dif0;
Org21Dif1 = DifferenceGame_Org21Dif1;
Org21Dif2 = DifferenceGame_Org21Dif2;
Org21Dif3 = DifferenceGame_Org21Dif3;
Org21Dif4 = DifferenceGame_Org21Dif4;
Org21Dif5 = DifferenceGame_Org21Dif5;
Org21Dif6 = DifferenceGame_Org21Dif6;
Org21Dif7 = DifferenceGame_Org21Dif7;
Org21Dif8 = DifferenceGame_Org21Dif8;
Org21Dif9 = DifferenceGame_Org21Dif9;
internalLoader = new Loader();
overlayLoader = new Loader();
sceneMask = new Sprite();
scenes = new Array();
timer = new EvilFreeTimer(1000);
scoreTimer = new EvilFreeTimer(1000, true, 30);
scenetimer = new EvilFreeTimer(1000);
countdown = new EvilFreeTimer(1000, true, 0);
scenesByName = new Object();
menubutton = new TextField();
nextSceneTimer = new Timer(1500);
menu = new MovieClip();
curtain = new MovieClip();
_cheatDispatch = new CheatDispatcher({s..:"sceneForward", s,,:"sceneBackward"});
mochiBots = {A:"", B:"", C:"", D:"", E:"", F:""};
gameBranch = [];
branchStore = SharedObject.getLocal("branching");
super();
mx_internal::_DifferenceGame_StylesInit();
}
public function setDifferenceCountGraphics(val:String):void{
if (template.difText){
template.difText.text = val;
};
if (template.setDifferences){
template.setDifferences(Number(val));
};
if (overlay.difText){
overlay.difText.text = val;
};
if (overlay.setDifferences){
overlay.setDifferences(Number(val));
};
}
public function uninitMenu():void{
menuManager.hide();
menuManager.removeEventListener("button_play_over", mOverPlay);
menuManager.removeEventListener("button_play_out", mOutPlay);
menuManager.removeEventListener("button_play_click", mClickPlay);
menuManager.removeEventListener("button_credits_over", mOverCredits);
menuManager.removeEventListener("button_credits_out", mOutCredits);
menuManager.removeEventListener("button_credits_click", mClickCredits);
menuManager.removeEventListener("button_options_over", mOverOptions);
menuManager.removeEventListener("button_options_out", mOutOptions);
menuManager.removeEventListener("button_options_click", mClickOptions);
menuManager.removeEventListener("button_mainmenu_over", mOverMenu);
menuManager.removeEventListener("button_mainmenu_out", mOutMenu);
menuManager.removeEventListener("button_mainmenu_click", mClickMenu);
menuManager.optionsDialog.fromMenu = false;
removeChild(menuManager);
menuButton.visible = true;
}
public function ini():void{
var bitRef:Bitmap;
var difNode:XML;
var branches:Array;
_parent = (parent as DifferenceGamePlayer);
imageArray = [];
differenceArray = [];
bitRef = new Org0();
imageArray.push(bitRef);
differenceArray[0] = [];
bitRef = new Org0Dif0();
differenceArray[0].push(bitRef);
bitRef = new Org0Dif1();
differenceArray[0].push(bitRef);
bitRef = new Org0Dif2();
differenceArray[0].push(bitRef);
bitRef = new Org0Dif3();
differenceArray[0].push(bitRef);
bitRef = new Org0Dif4();
differenceArray[0].push(bitRef);
bitRef = new Org0Dif5();
differenceArray[0].push(bitRef);
bitRef = new Org0Dif6();
differenceArray[0].push(bitRef);
bitRef = new Org0Dif7();
differenceArray[0].push(bitRef);
bitRef = new Org0Dif8();
differenceArray[0].push(bitRef);
bitRef = new Org1();
imageArray.push(bitRef);
differenceArray[1] = [];
bitRef = new Org1Dif0();
differenceArray[1].push(bitRef);
bitRef = new Org1Dif1();
differenceArray[1].push(bitRef);
bitRef = new Org1Dif2();
differenceArray[1].push(bitRef);
bitRef = new Org1Dif3();
differenceArray[1].push(bitRef);
bitRef = new Org1Dif4();
differenceArray[1].push(bitRef);
bitRef = new Org1Dif5();
differenceArray[1].push(bitRef);
bitRef = new Org1Dif6();
differenceArray[1].push(bitRef);
bitRef = new Org1Dif7();
differenceArray[1].push(bitRef);
bitRef = new Org1Dif8();
differenceArray[1].push(bitRef);
bitRef = new Org2();
imageArray.push(bitRef);
differenceArray[2] = [];
bitRef = new Org2Dif0();
differenceArray[2].push(bitRef);
bitRef = new Org2Dif1();
differenceArray[2].push(bitRef);
bitRef = new Org2Dif2();
differenceArray[2].push(bitRef);
bitRef = new Org2Dif3();
differenceArray[2].push(bitRef);
bitRef = new Org2Dif4();
differenceArray[2].push(bitRef);
bitRef = new Org2Dif5();
differenceArray[2].push(bitRef);
bitRef = new Org2Dif6();
differenceArray[2].push(bitRef);
bitRef = new Org2Dif7();
differenceArray[2].push(bitRef);
bitRef = new Org2Dif8();
differenceArray[2].push(bitRef);
bitRef = new Org3();
imageArray.push(bitRef);
differenceArray[3] = [];
bitRef = new Org3Dif0();
differenceArray[3].push(bitRef);
bitRef = new Org3Dif1();
differenceArray[3].push(bitRef);
bitRef = new Org3Dif2();
differenceArray[3].push(bitRef);
bitRef = new Org3Dif3();
differenceArray[3].push(bitRef);
bitRef = new Org3Dif4();
differenceArray[3].push(bitRef);
bitRef = new Org3Dif5();
differenceArray[3].push(bitRef);
bitRef = new Org3Dif6();
differenceArray[3].push(bitRef);
bitRef = new Org3Dif7();
differenceArray[3].push(bitRef);
bitRef = new Org3Dif8();
differenceArray[3].push(bitRef);
bitRef = new Org4();
imageArray.push(bitRef);
differenceArray[4] = [];
bitRef = new Org4Dif0();
differenceArray[4].push(bitRef);
bitRef = new Org4Dif1();
differenceArray[4].push(bitRef);
bitRef = new Org4Dif2();
differenceArray[4].push(bitRef);
bitRef = new Org4Dif3();
differenceArray[4].push(bitRef);
bitRef = new Org4Dif4();
differenceArray[4].push(bitRef);
bitRef = new Org4Dif5();
differenceArray[4].push(bitRef);
bitRef = new Org4Dif6();
differenceArray[4].push(bitRef);
bitRef = new Org4Dif7();
differenceArray[4].push(bitRef);
bitRef = new Org4Dif8();
differenceArray[4].push(bitRef);
bitRef = new Org4Dif9();
differenceArray[4].push(bitRef);
bitRef = new Org5();
imageArray.push(bitRef);
differenceArray[5] = [];
bitRef = new Org5Dif0();
differenceArray[5].push(bitRef);
bitRef = new Org5Dif1();
differenceArray[5].push(bitRef);
bitRef = new Org5Dif2();
differenceArray[5].push(bitRef);
bitRef = new Org5Dif3();
differenceArray[5].push(bitRef);
bitRef = new Org5Dif4();
differenceArray[5].push(bitRef);
bitRef = new Org5Dif5();
differenceArray[5].push(bitRef);
bitRef = new Org5Dif6();
differenceArray[5].push(bitRef);
bitRef = new Org5Dif7();
differenceArray[5].push(bitRef);
bitRef = new Org5Dif8();
differenceArray[5].push(bitRef);
bitRef = new Org5Dif9();
differenceArray[5].push(bitRef);
bitRef = new Org6();
imageArray.push(bitRef);
differenceArray[6] = [];
bitRef = new Org6Dif0();
differenceArray[6].push(bitRef);
bitRef = new Org6Dif1();
differenceArray[6].push(bitRef);
bitRef = new Org6Dif2();
differenceArray[6].push(bitRef);
bitRef = new Org6Dif3();
differenceArray[6].push(bitRef);
bitRef = new Org6Dif4();
differenceArray[6].push(bitRef);
bitRef = new Org6Dif5();
differenceArray[6].push(bitRef);
bitRef = new Org6Dif6();
differenceArray[6].push(bitRef);
bitRef = new Org6Dif7();
differenceArray[6].push(bitRef);
bitRef = new Org7();
imageArray.push(bitRef);
differenceArray[7] = [];
bitRef = new Org7Dif0();
differenceArray[7].push(bitRef);
bitRef = new Org7Dif1();
differenceArray[7].push(bitRef);
bitRef = new Org7Dif2();
differenceArray[7].push(bitRef);
bitRef = new Org7Dif3();
differenceArray[7].push(bitRef);
bitRef = new Org7Dif4();
differenceArray[7].push(bitRef);
bitRef = new Org7Dif5();
differenceArray[7].push(bitRef);
bitRef = new Org7Dif6();
differenceArray[7].push(bitRef);
bitRef = new Org7Dif7();
differenceArray[7].push(bitRef);
bitRef = new Org7Dif8();
differenceArray[7].push(bitRef);
bitRef = new Org8();
imageArray.push(bitRef);
differenceArray[8] = [];
bitRef = new Org8Dif0();
differenceArray[8].push(bitRef);
bitRef = new Org8Dif1();
differenceArray[8].push(bitRef);
bitRef = new Org8Dif2();
differenceArray[8].push(bitRef);
bitRef = new Org8Dif3();
differenceArray[8].push(bitRef);
bitRef = new Org8Dif4();
differenceArray[8].push(bitRef);
bitRef = new Org8Dif5();
differenceArray[8].push(bitRef);
bitRef = new Org8Dif6();
differenceArray[8].push(bitRef);
bitRef = new Org8Dif7();
differenceArray[8].push(bitRef);
bitRef = new Org8Dif8();
differenceArray[8].push(bitRef);
bitRef = new Org9();
imageArray.push(bitRef);
differenceArray[9] = [];
bitRef = new Org9Dif0();
differenceArray[9].push(bitRef);
bitRef = new Org9Dif1();
differenceArray[9].push(bitRef);
bitRef = new Org9Dif2();
differenceArray[9].push(bitRef);
bitRef = new Org9Dif3();
differenceArray[9].push(bitRef);
bitRef = new Org9Dif4();
differenceArray[9].push(bitRef);
bitRef = new Org9Dif5();
differenceArray[9].push(bitRef);
bitRef = new Org9Dif6();
differenceArray[9].push(bitRef);
bitRef = new Org9Dif7();
differenceArray[9].push(bitRef);
bitRef = new Org9Dif8();
differenceArray[9].push(bitRef);
bitRef = new Org9Dif9();
differenceArray[9].push(bitRef);
bitRef = new Org10();
imageArray.push(bitRef);
differenceArray[10] = [];
bitRef = new Org10Dif0();
differenceArray[10].push(bitRef);
bitRef = new Org10Dif1();
differenceArray[10].push(bitRef);
bitRef = new Org10Dif2();
differenceArray[10].push(bitRef);
bitRef = new Org10Dif3();
differenceArray[10].push(bitRef);
bitRef = new Org10Dif4();
differenceArray[10].push(bitRef);
bitRef = new Org10Dif5();
differenceArray[10].push(bitRef);
bitRef = new Org10Dif6();
differenceArray[10].push(bitRef);
bitRef = new Org10Dif7();
differenceArray[10].push(bitRef);
bitRef = new Org10Dif8();
differenceArray[10].push(bitRef);
bitRef = new Org10Dif9();
differenceArray[10].push(bitRef);
bitRef = new Org11();
imageArray.push(bitRef);
differenceArray[11] = [];
bitRef = new Org11Dif0();
differenceArray[11].push(bitRef);
bitRef = new Org11Dif1();
differenceArray[11].push(bitRef);
bitRef = new Org11Dif2();
differenceArray[11].push(bitRef);
bitRef = new Org11Dif3();
differenceArray[11].push(bitRef);
bitRef = new Org11Dif4();
differenceArray[11].push(bitRef);
bitRef = new Org11Dif5();
differenceArray[11].push(bitRef);
bitRef = new Org11Dif6();
differenceArray[11].push(bitRef);
bitRef = new Org11Dif7();
differenceArray[11].push(bitRef);
bitRef = new Org11Dif8();
differenceArray[11].push(bitRef);
bitRef = new Org11Dif9();
differenceArray[11].push(bitRef);
bitRef = new Org12();
imageArray.push(bitRef);
differenceArray[12] = [];
bitRef = new Org12Dif0();
differenceArray[12].push(bitRef);
bitRef = new Org12Dif1();
differenceArray[12].push(bitRef);
bitRef = new Org12Dif2();
differenceArray[12].push(bitRef);
bitRef = new Org12Dif3();
differenceArray[12].push(bitRef);
bitRef = new Org12Dif4();
differenceArray[12].push(bitRef);
bitRef = new Org12Dif5();
differenceArray[12].push(bitRef);
bitRef = new Org12Dif6();
differenceArray[12].push(bitRef);
bitRef = new Org12Dif7();
differenceArray[12].push(bitRef);
bitRef = new Org12Dif8();
differenceArray[12].push(bitRef);
bitRef = new Org12Dif9();
differenceArray[12].push(bitRef);
bitRef = new Org13();
imageArray.push(bitRef);
differenceArray[13] = [];
bitRef = new Org13Dif0();
differenceArray[13].push(bitRef);
bitRef = new Org13Dif1();
differenceArray[13].push(bitRef);
bitRef = new Org13Dif2();
differenceArray[13].push(bitRef);
bitRef = new Org13Dif3();
differenceArray[13].push(bitRef);
bitRef = new Org13Dif4();
differenceArray[13].push(bitRef);
bitRef = new Org13Dif5();
differenceArray[13].push(bitRef);
bitRef = new Org13Dif6();
differenceArray[13].push(bitRef);
bitRef = new Org13Dif7();
differenceArray[13].push(bitRef);
bitRef = new Org13Dif8();
differenceArray[13].push(bitRef);
bitRef = new Org13Dif9();
differenceArray[13].push(bitRef);
bitRef = new Org14();
imageArray.push(bitRef);
differenceArray[14] = [];
bitRef = new Org14Dif0();
differenceArray[14].push(bitRef);
bitRef = new Org14Dif1();
differenceArray[14].push(bitRef);
bitRef = new Org14Dif2();
differenceArray[14].push(bitRef);
bitRef = new Org14Dif3();
differenceArray[14].push(bitRef);
bitRef = new Org14Dif4();
differenceArray[14].push(bitRef);
bitRef = new Org14Dif5();
differenceArray[14].push(bitRef);
bitRef = new Org14Dif6();
differenceArray[14].push(bitRef);
bitRef = new Org14Dif7();
differenceArray[14].push(bitRef);
bitRef = new Org14Dif8();
differenceArray[14].push(bitRef);
bitRef = new Org14Dif9();
differenceArray[14].push(bitRef);
bitRef = new Org15();
imageArray.push(bitRef);
differenceArray[15] = [];
bitRef = new Org15Dif0();
differenceArray[15].push(bitRef);
bitRef = new Org15Dif1();
differenceArray[15].push(bitRef);
bitRef = new Org15Dif2();
differenceArray[15].push(bitRef);
bitRef = new Org15Dif3();
differenceArray[15].push(bitRef);
bitRef = new Org15Dif4();
differenceArray[15].push(bitRef);
bitRef = new Org15Dif5();
differenceArray[15].push(bitRef);
bitRef = new Org15Dif6();
differenceArray[15].push(bitRef);
bitRef = new Org15Dif7();
differenceArray[15].push(bitRef);
bitRef = new Org15Dif8();
differenceArray[15].push(bitRef);
bitRef = new Org15Dif9();
differenceArray[15].push(bitRef);
bitRef = new Org16();
imageArray.push(bitRef);
differenceArray[16] = [];
bitRef = new Org16Dif0();
differenceArray[16].push(bitRef);
bitRef = new Org16Dif1();
differenceArray[16].push(bitRef);
bitRef = new Org16Dif2();
differenceArray[16].push(bitRef);
bitRef = new Org16Dif3();
differenceArray[16].push(bitRef);
bitRef = new Org16Dif4();
differenceArray[16].push(bitRef);
bitRef = new Org16Dif5();
differenceArray[16].push(bitRef);
bitRef = new Org16Dif6();
differenceArray[16].push(bitRef);
bitRef = new Org16Dif7();
differenceArray[16].push(bitRef);
bitRef = new Org16Dif8();
differenceArray[16].push(bitRef);
bitRef = new Org16Dif9();
differenceArray[16].push(bitRef);
bitRef = new Org17();
imageArray.push(bitRef);
differenceArray[17] = [];
bitRef = new Org17Dif0();
differenceArray[17].push(bitRef);
bitRef = new Org17Dif1();
differenceArray[17].push(bitRef);
bitRef = new Org17Dif2();
differenceArray[17].push(bitRef);
bitRef = new Org17Dif3();
differenceArray[17].push(bitRef);
bitRef = new Org17Dif4();
differenceArray[17].push(bitRef);
bitRef = new Org17Dif5();
differenceArray[17].push(bitRef);
bitRef = new Org17Dif6();
differenceArray[17].push(bitRef);
bitRef = new Org17Dif7();
differenceArray[17].push(bitRef);
bitRef = new Org17Dif8();
differenceArray[17].push(bitRef);
bitRef = new Org17Dif9();
differenceArray[17].push(bitRef);
bitRef = new Org18();
imageArray.push(bitRef);
differenceArray[18] = [];
bitRef = new Org18Dif0();
differenceArray[18].push(bitRef);
bitRef = new Org18Dif1();
differenceArray[18].push(bitRef);
bitRef = new Org18Dif2();
differenceArray[18].push(bitRef);
bitRef = new Org18Dif3();
differenceArray[18].push(bitRef);
bitRef = new Org18Dif4();
differenceArray[18].push(bitRef);
bitRef = new Org18Dif5();
differenceArray[18].push(bitRef);
bitRef = new Org18Dif6();
differenceArray[18].push(bitRef);
bitRef = new Org18Dif7();
differenceArray[18].push(bitRef);
bitRef = new Org18Dif8();
differenceArray[18].push(bitRef);
bitRef = new Org18Dif9();
differenceArray[18].push(bitRef);
bitRef = new Org19();
imageArray.push(bitRef);
differenceArray[19] = [];
bitRef = new Org19Dif0();
differenceArray[19].push(bitRef);
bitRef = new Org19Dif1();
differenceArray[19].push(bitRef);
bitRef = new Org19Dif2();
differenceArray[19].push(bitRef);
bitRef = new Org19Dif3();
differenceArray[19].push(bitRef);
bitRef = new Org19Dif4();
differenceArray[19].push(bitRef);
bitRef = new Org19Dif5();
differenceArray[19].push(bitRef);
bitRef = new Org19Dif6();
differenceArray[19].push(bitRef);
bitRef = new Org19Dif7();
differenceArray[19].push(bitRef);
bitRef = new Org19Dif8();
differenceArray[19].push(bitRef);
bitRef = new Org19Dif9();
differenceArray[19].push(bitRef);
bitRef = new Org20();
imageArray.push(bitRef);
differenceArray[20] = [];
bitRef = new Org20Dif0();
differenceArray[20].push(bitRef);
bitRef = new Org20Dif1();
differenceArray[20].push(bitRef);
bitRef = new Org20Dif2();
differenceArray[20].push(bitRef);
bitRef = new Org20Dif3();
differenceArray[20].push(bitRef);
bitRef = new Org20Dif4();
differenceArray[20].push(bitRef);
bitRef = new Org20Dif5();
differenceArray[20].push(bitRef);
bitRef = new Org20Dif6();
differenceArray[20].push(bitRef);
bitRef = new Org20Dif7();
differenceArray[20].push(bitRef);
bitRef = new Org20Dif8();
differenceArray[20].push(bitRef);
bitRef = new Org20Dif9();
differenceArray[20].push(bitRef);
bitRef = new Org21();
imageArray.push(bitRef);
differenceArray[21] = [];
bitRef = new Org21Dif0();
differenceArray[21].push(bitRef);
bitRef = new Org21Dif1();
differenceArray[21].push(bitRef);
bitRef = new Org21Dif2();
differenceArray[21].push(bitRef);
bitRef = new Org21Dif3();
differenceArray[21].push(bitRef);
bitRef = new Org21Dif4();
differenceArray[21].push(bitRef);
bitRef = new Org21Dif5();
differenceArray[21].push(bitRef);
bitRef = new Org21Dif6();
differenceArray[21].push(bitRef);
bitRef = new Org21Dif7();
differenceArray[21].push(bitRef);
bitRef = new Org21Dif8();
differenceArray[21].push(bitRef);
bitRef = new Org21Dif9();
differenceArray[21].push(bitRef);
addChild(internalLoader);
internalLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onInternalLoaded);
internalLoader.loadBytes(new templateE());
overlayLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onOverlayLoaded);
overlayLoader.loadBytes(new overlayE());
sounds = new SoundManager((new se1() as SoundAsset), (new se2() as SoundAsset), (new se3() as SoundAsset), (new se4() as SoundAsset), (new se5() as SoundAsset), (new se6() as SoundAsset));
var ba:ByteArray = new XMLFILE();
difData = new XML(ba.readUTFBytes(ba.length));
mochiBots.A = difData.config[0].mochiA[0].@code[0].toString();
mochiBots.B = difData.config[0].mochiB[0].@code[0].toString();
mochiBots.C = difData.config[0].mochiC[0].@code[0].toString();
mochiBots.D = difData.config[0].mochiD[0].@code[0].toString();
mochiBots.E = difData.config[0].mochiE[0].@code[0].toString();
mochiBots.F = difData.config[0].mochiF[0].@code[0].toString();
if (difData.config[0].gameType[0].@branches[0].toString() == "true"){
if (branchStore.data.currentBranch != null){
branchStore.data.currentBranch++;
} else {
branchStore.data.currentBranch = 0;
};
branches = BranchCalculator.findBranches(difData);
if (branchStore.data.currentBranch >= branches.length){
branchStore.data.currentBranch = 0;
};
gameBranch = branches[branchStore.data.currentBranch];
gameBranchIndex = branchStore.data.currentBranch;
branching = true;
} else {
branching = false;
};
//unresolved jump
var _slot1 = e;
branching = false;
if (difData.config.gameType.@value == "timed"){
timedGame = true;
} else {
timedGame = false;
};
var x:Number = 0;
menuManager = new MenuManager(difData.menu, (_parent as DifferenceGamePlayer));
setState(STATE_MENU);
if (_parent.__options.music == 0){
sounds.musicMuted = true;
};
if (_parent.__options.sound == 0){
sounds.soundMuted = true;
};
missedClicks = 0;
trace(">>>>>>>>>>>>>> NOW");
}
public function setNumberOfDifferences(dNum:Number):void{
numDifferences = dNum;
curScene.numDifferences = dNum;
}
private function mOutOptions(e:Event):void{
menuManager.setFilters("options", [new DropShadowFilter(1)]);
}
private function mOverMenu(e:Event):void{
menuManager.setFilters("mainmenu", [new GlowFilter(0xFFFFFF, 0.75, 4, 4)]);
}
public function bonusboxTransitionComplete(e:Event):void{
removeChild(bonusbox);
}
private function preloadScene(num:Number):void{
var sx:Number = num;
var tmpScene:DifferenceScene = scenes[sx];
if (tmpScene.loaded == true){
return;
};
tmpScene.loaded = true;
trace(("PRELOADING " + num));
tmpScene.setBitmaps(imageArray[sx]);
tmpScene.timeLimit = difData.imageSet[sx].@timelimit;
var difList:XMLList = difData.imageSet[sx].difArea;
var aArray:Array = differenceArray[sx];
tmpScene.prepareDifferences(difList, aArray, difData.imageSet[sx].@correctSide);
}
private function onMissedClick(e:Event):void{
missedClicks++;
if (!noPoints){
score = (score - 5);
setScoreGraphics(score.toString());
sounds.play(SoundManager.BAD_CLICK);
};
}
private function transComplete(e:Event):void{
curScene.visible = true;
scoreTimer.start();
}
public function setTimerGraphics(val:String):void{
if (template.timerText){
template.timerText.text = val;
};
}
public function initLost():void{
menuManager.show("lost");
menuManager.addEventListener("button_mainmenu_over", mOverMenu);
menuManager.addEventListener("button_mainmenu_out", mOutMenu);
menuManager.addEventListener("button_mainmenu_click", mClickMenu);
addChild(menuManager);
menuButton.visible = false;
curScene.visible = false;
}
private function mOutPlay2(e:Event):void{
menuManager.setFilters("play2", [new DropShadowFilter(1)]);
}
public function setMusicOn(e:Event):void{
sounds.musicMuted = false;
_parent.__options.music = 1;
if (e == null){
menuManager.optionsDialog.setState(menuManager.optionsDialog.musicButton, 1);
};
}
public function setSceneOnTemplate(sceneNum:Number):void{
var branchData:XMLList = difData.imageSet[sceneNum].branch;
var branchOptions:Array = [];
var i:Number = 0;
while (i < branchData.length()) {
branchOptions.push({sceneName:branchData[i].@target, scoreTarget:branchData[i].@max});
i++;
};
overlay.setSceneData(sceneNum, branchOptions);
}
public function setSoundOff(e:Event):void{
sounds.soundMuted = true;
_parent.__options.sound = 0;
if (e == null){
menuManager.optionsDialog.setState(menuManager.optionsDialog.soundButton, 3);
};
}
public function setSoundOn(e:Event):void{
sounds.soundMuted = false;
_parent.__options.sound = 1;
if (e == null){
menuManager.optionsDialog.setState(menuManager.optionsDialog.soundButton, 1);
};
}
private function mOverOptions(e:Event):void{
menuManager.setFilters("options", [new GlowFilter(0xFFFFFF, 1, 4, 4)]);
}
private function resetScene(sceneNum:Number):void{
}
private function mOutMenu(e:Event):void{
menuManager.setFilters("mainmenu", [new DropShadowFilter(1)]);
}
public function uninitWon():void{
menuManager.hide();
removeChild(menuManager);
}
private function preloadScenes():void{
var sx:Number;
var tmpScene:DifferenceScene;
var tmpImageSet:XML;
var difList:XMLList;
var aArray:Array;
sx = 0;
while (sx < imageArray.length) {
tmpScene = new DifferenceScene(this);
tmpImageSet = difData.imageSet[sx];
if (!tmpImageSet.@displaycount){
tmpScene.numDifferences = 10;
} else {
tmpScene.numDifferences = tmpImageSet.@displaycount;
};
if (tmpScene.numDifferences <= 0){
tmpScene.numDifferences = 5;
};
trace("Number of Differences:", tmpScene.numDifferences);
if (!tmpImageSet.@findcount){
tmpScene.threshold = 0;
} else {
tmpScene.threshold = tmpImageSet.@findcount;
};
trace("Difference Threshold:", tmpScene.threshold);
tmpScene.timeLimit = difData.imageSet[sx].@timelimit;
difList = difData.imageSet[sx].difArea;
aArray = differenceArray[sx];
tmpScene.x = template.origin.x;
tmpScene.y = template.origin.y;
if (tmpImageSet.@transition){
tmpScene.transition = tmpImageSet.@transition;
};
tmpScene.sceneType = tmpImageSet.@type;
tmpScene.failScene = tmpImageSet.@failscene;
if ((((tmpImageSet.@final == "true")) || ((tmpImageSet.@end == "true")))){
tmpScene.isFinal = true;
};
scenes[sx] = tmpScene;
scenesByName[tmpImageSet.@name] = sx;
sx++;
};
trace(">>>>>>>>>>>>> SCENES PRELOADED");
}
private function onOverlayLoaded(e:Event):void{
overlay = (overlayLoader.contentLoaderInfo.content as MovieClip);
if (overlay.menuButton){
menuButton = overlay.menuButton;
menuButton.buttonMode = true;
menuButton.visible = false;
menuButton.addEventListener(MouseEvent.CLICK, onMenuButtonClick);
};
if (overlay.scoreText){
overlay.scoreText.text = "0";
};
if (overlay.timerText){
overlay.timerText.text = "0";
};
}
private function onInternalLoaded(e:Event):void{
template = (internalLoader.contentLoaderInfo.content as MovieClip);
if (template.scoreText){
template.scoreText.text = "0";
};
if (template.timerText){
template.timerText.text = "0";
};
menuManager.x = 0;
menuManager.y = 0;
goodClickMc = template.goodClick;
badClickMc = template.badClick;
if (menuButton == null){
menuButton = template.menuButton;
menuButton.buttonMode = true;
menuButton.visible = false;
menuButton.addEventListener(MouseEvent.CLICK, onMenuButtonClick);
};
_cheatDispatch.addEventListener("sceneForward", cheatNextScene);
_cheatDispatch.addEventListener("sceneBackward", cheatPrevScene);
stage.addEventListener(KeyboardEvent.KEY_UP, _cheatDispatch.addKeyFromEvent);
var tmpBmpD:BitmapData = new BitmapData((myWidth + template.origin.x), (myHeight + template.origin.y));
tmpBmpD.draw(this);
coverBitmapData = new BitmapData(menuManager.width, menuManager.height);
coverBitmapData.copyPixels(tmpBmpD, new Rectangle(template.origin.x, template.origin.y, myWidth, myHeight), new Point(0, 0));
preloadScenes();
preloadScene(0);
}
private function mClickOptions(e:Event):void{
sounds.play(SoundManager.GOOD_CLICK);
menuManager.show("pause");
}
public function setMatchClick(mc:Boolean):void{
matchClick = mc;
}
mx_internal function _DifferenceGame_StylesInit():void{
var style:CSSStyleDeclaration;
var effects:Array;
if (mx_internal::_DifferenceGame_StylesInit_done){
return;
};
mx_internal::_DifferenceGame_StylesInit_done = true;
style = StyleManager.getStyleDeclaration(".display");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".display", style, false);
};
if (style.factory == null){
style.factory = function ():void{
this.fontSize = 24;
this.fontFamily = "Verdana";
};
};
}
private function mOverPlay2(e:Event):void{
menuManager.setFilters("play2", [new GlowFilter(0xFFFFFF, 1, 4, 4)]);
}
private function mClickMenu(e:Event):void{
sounds.play(SoundManager.GOOD_CLICK);
if (GAME_STATE == STATE_MENU){
menuManager.show("root");
} else {
setState(STATE_MENU);
};
}
public function initGame():void{
if (initGameFirst){
curScene = scenes[0];
if (difData.config.matchClick.@value == "false"){
matchClick = false;
} else {
matchClick = true;
};
nextSceneTimer.addEventListener(TimerEvent.TIMER, nextScene);
addChild(curScene);
imageTransitionManager = new ImageTransitionManager(template.origin.x, template.origin.y);
imageTransitionManager.transType = difData.config.initialTransition.@value;
addChild(imageTransitionManager);
addChild(overlay);
if (timedGame){
timer.addEventListener(TimerEvent.TIMER, onTimerTick);
countdown.addEventListener(TimerEvent.TIMER_COMPLETE, onCountdownComplete);
};
hiliteState = "none";
bonusbox = new SceneTextEffect("", (SceneTextEffect.FADE + SceneTextEffect.ZOOMIN), 0, 0, 400, 200, [new GlowFilter(0)], new TextFormat("MaiandraBold", 30, 0xFFFFFF));
bonusbox.addEventListener(SceneTextEffect.COMPLETED_EVENT.type, bonusboxTransitionComplete);
bonusbox.duration = 2800;
bonusbox.x = (template.origin.x + 100);
bonusbox.y = (template.origin.y + 100);
numDifferences = 10;
showScene(0, true);
initGameFirst = false;
if (_parent.__options.hints == 0){
setHintsOff(null);
} else {
setHintsOn(null);
};
};
if (timedGame){
timer.start();
scenetimer.start();
};
curScene.visible = true;
}
public function setState(state:String):void{
if (GAME_STATE == state){
return;
};
trace(("Setting state to: " + state));
switch (GAME_STATE){
case STATE_MENU:
uninitMenu();
break;
case STATE_PLAYING:
uninitGame();
break;
case STATE_PAUSED:
uninitPaused();
break;
case STATE_WON:
uninitWon();
break;
};
switch (state){
case STATE_MENU:
initMenu();
break;
case STATE_PLAYING:
initGame();
break;
case STATE_PAUSED:
initPaused();
break;
case STATE_WON:
initWon();
break;
};
GAME_STATE = state;
}
public function initWon():void{
MochiBot.track(this, mochiBots.F);
menuManager.show("won");
menuManager.addEventListener("button_mainmenu_over", mOverMenu);
menuManager.addEventListener("button_mainmenu_out", mOutMenu);
menuManager.addEventListener("button_mainmenu_click", mClickMenu);
addChild(menuManager);
menuButton.visible = false;
curScene.visible = false;
MochiBot.track(this, mochiBots.F);
menuManager.show("won");
menuManager.addEventListener("button_mainmenu_over", mOverMenu);
menuManager.addEventListener("button_mainmenu_out", mOutMenu);
menuManager.addEventListener("button_mainmenu_click", mClickMenu);
addChild(menuManager);
var kongregate:KongregateAPI = KongregateAPI.getInstance();
kongregate.scores.submit(this.score);
kongregate.stats.submit("mis-clicks:", missedClicks);
missedClicks = 0;
menuButton.visible = false;
curScene.visible = false;
}
public function nextScene(e:TimerEvent):void{
nextSceneTimer.stop();
if (scenes[currentScene].sceneType == "failscene"){
preloadScene(scenes[currentScene].failFrom);
showScene(scenes[currentScene].failFrom, false, true);
return;
};
if (branching){
currentBranchIndex++;
if (scenes[gameBranch[currentBranchIndex]] != null){
showScene(gameBranch[currentBranchIndex]);
};
return;
};
if (((!(scenes[(currentScene + 1)])) || ((difData.imageSet[currentScene].@end == "true")))){
sounds.play(SoundManager.WIN);
addChild(bonusbox);
bonusbox.text = "Win";
bonusbox.run();
finishGame(true);
return;
};
while (scenes[(currentScene + 1)].sceneType == "failscene") {
trace("Skipped scene number", (currentScene + 1), "because it's a fail scene.");
currentScene++;
};
trace("Showing Scene", (currentScene + 1));
preloadScene((currentScene + 1));
showScene((currentScene + 1));
}
public function setHintsOff(e:Event):void{
var s:DifferenceScene;
_parent.__options.hints = 0;
if (curScene){
curScene.showHints = false;
};
for each (s in scenes) {
s.showHints = false;
};
if (e == null){
menuManager.optionsDialog.setState(menuManager.optionsDialog.hintsButton, 3);
};
}
private function mOverPlay(e:Event):void{
menuManager.setFilters("play", [new GlowFilter(0xFFFFFF, 1, 4, 4)]);
}
public function uninitPaused():void{
menuManager.hide();
curScene.visible = true;
menuManager.removeEventListener("button_resume_click", mClickPlay);
removeChild(menuManager);
if (timedGame){
countdown.start();
timer.start();
};
scoreTimer.start();
menuButton.visible = true;
}
public function uninitLost():void{
menuManager.hide();
removeChild(menuManager);
}
private function cheatNextScene(e:Event):void{
if (scenes[(currentScene + 1)]){
preloadScene((currentScene + 1));
showScene((currentScene + 1));
};
}
private function mOutCredits(e:Event):void{
menuManager.setFilters("credits", [new DropShadowFilter(1)]);
}
public function setScoreGraphics(val:String):void{
FacebookIntegration.sendScore(score, root.loaderInfo.parameters.cid);
if (template.scoreText){
template.scoreText.text = val;
};
if (overlay.scoreText){
overlay.scoreText.text = val;
overlay.setScore(Number(val));
};
}
private function resetGame(e:Event):void{
dispatchEvent(e);
}
public function dispose():void{
switch (GAME_STATE){
case STATE_MENU:
uninitMenu();
break;
case STATE_PLAYING:
uninitGame();
break;
case STATE_PAUSED:
uninitPaused();
break;
case STATE_WON:
uninitWon();
break;
};
sounds.stopAll();
}
public function onFoundAll():void{
var loaded:Boolean;
var bonus:Number;
if (scenes[currentScene].isFinal == false){
if (scenes[currentScene].sceneType == "failscene"){
resetScene(scenes[currentScene].failFrom);
};
loaded = false;
if (scenes[currentScene].sceneType == "failscene"){
preloadScene(scenes[currentScene].failFrom);
loaded = true;
};
if (!loaded){
if (branching){
if (scenes[gameBranch[(currentBranchIndex + 1)]] != null){
preloadScene(gameBranch[(currentBranchIndex + 1)]);
};
loaded = true;
};
};
if (!loaded){
if (scenes[(currentScene + 1)] != null){
preloadScene((currentScene + 1));
};
};
nextSceneTimer.start();
if (timedGame){
countdown.stop();
};
sounds.play(SoundManager.NEXT_SCENE);
if (((!(timedGame)) && (!(noPoints)))){
addChild(bonusbox);
if (scoreTimer.time < 0){
scoreTimer.time = 0;
};
bonus = (parseInt(difData.config[0].timeBonus[0].@min) + ((scoreTimer.time / parseInt(difData.config[0].timeBonus[0].@time)) * (parseInt(difData.config[0].timeBonus[0].@max) - parseInt(difData.config[0].timeBonus[0].@min))));
if (bonus > parseInt(difData.config[0].timeBonus[0].@min)){
bonusbox.text = (("Time Bonus\n+" + bonus) + "!");
bonusbox.run();
this.score = (this.score + bonus);
};
setScoreGraphics(this.score.toString());
} else {
if (!noPoints){
if (countdown.time > 0){
addChild(bonusbox);
if (scoreTimer.time < 0){
scoreTimer.time = 0;
};
bonus = (parseInt(difData.config[0].timeBonus[0].@min) + ((scoreTimer.time / parseInt(difData.config[0].timeBonus[0].@time)) * (parseInt(difData.config[0].timeBonus[0].@max) - parseInt(difData.config[0].timeBonus[0].@min))));
if (bonus > parseInt(difData.config[0].timeBonus[0].@min)){
bonusbox.text = (("Time Bonus\n+" + bonus) + "!");
bonusbox.run();
this.score = (this.score + bonus);
};
setScoreGraphics(this.score.toString());
};
};
};
} else {
sounds.play(SoundManager.WIN);
addChild(bonusbox);
bonusbox.text = "Win";
bonusbox.run();
finishGame(true);
};
}
public function onCountdownComplete(e:Event):void{
if (timedScene){
scenes[scenesByName[curScene.failScene]].failFrom = currentScene;
preloadScene(scenesByName[curScene.failScene]);
showScene(scenesByName[curScene.failScene]);
};
}
private function mOutPlay(e:Event):void{
menuManager.setFilters("play", [new DropShadowFilter(1)]);
}
public function foundDifference(iPos:Number):void{
curScene.resetHints();
sounds.play(SoundManager.GOOD_CLICK);
if (noPoints){
this.curScene.orgImage.foundDifference(iPos);
} else {
this.score = (this.score + this.curScene.orgImage.foundDifference(iPos));
};
this.curScene.difImage.foundDifference(iPos);
if (!noPoints){
setScoreGraphics(this.score.toString());
};
curScene.currentDifferences--;
setDifferenceCountGraphics((curScene.currentDifferences - curScene.threshold).toString());
trace(curScene.currentDifferences, curScene.threshold);
if (curScene.currentDifferences == curScene.threshold){
onFoundAll();
};
}
public function reloadScene(e:Event):void{
showScene(currentScene);
}
private function cheatPrevScene(e:Event):void{
finishGame(true);
}
public function initPaused():void{
addChild(menuManager);
curScene.visible = false;
menuManager.show("pause");
menuManager.addEventListener("button_resume_click", mClickPlay);
countdown.stop();
timer.stop();
scoreTimer.stop();
menuButton.visible = false;
}
private function mOverCredits(e:Event):void{
menuManager.setFilters("credits", [new GlowFilter(0xFFFFFF, 1, 4, 4)]);
}
public function initMenu():void{
trace("Initialising Menu:");
sounds.play(SoundManager.MUSIC, true);
addChild(menuManager);
menuManager.addEventListener("soundOn", setSoundOn);
menuManager.addEventListener("soundOff", setSoundOff);
menuManager.addEventListener("musicOn", setMusicOn);
menuManager.addEventListener("musicOff", setMusicOff);
menuManager.addEventListener("hintsOn", setHintsOn);
menuManager.addEventListener("hintsOff", setHintsOff);
menuManager.addEventListener("button_play_over", mOverPlay);
menuManager.addEventListener("button_play_out", mOutPlay);
menuManager.addEventListener("button_play2_click", mClickPlay2);
menuManager.addEventListener("button_play2_over", mOverPlay2);
menuManager.addEventListener("button_play2_out", mOutPlay2);
menuManager.addEventListener("button_play_click", mClickPlay);
menuManager.addEventListener("button_credits_over", mOverCredits);
menuManager.addEventListener("button_credits_out", mOutCredits);
menuManager.addEventListener("button_credits_click", mClickCredits);
menuManager.addEventListener("button_options_over", mOverOptions);
menuManager.addEventListener("button_options_out", mOutOptions);
menuManager.addEventListener("button_options_click", mClickOptions);
menuManager.addEventListener("button_mainmenu_over", mOverMenu);
menuManager.addEventListener("button_mainmenu_out", mOutMenu);
menuManager.addEventListener("button_mainmenu_click", mClickMenu);
menuManager.addEventListener("reset", resetGame);
menuManager.setBackground("root", (new MenuBg0() as Bitmap));
menuManager.setBackground("credits", (new MenuBg1() as Bitmap));
menuManager.setBackground("pause", (new MenuBg2() as Bitmap));
menuManager.setBackground("won", (new MenuBg3() as Bitmap));
menuManager.show("root");
if (menuManager.optionsDialog){
menuManager.optionsDialog.fromMenu = true;
};
}
private function mClickCredits(e:Event):void{
sounds.play(SoundManager.GOOD_CLICK);
menuManager.show("credits");
}
private function onMenuButtonClick(e:MouseEvent):void{
setState(STATE_PAUSED);
}
public function setHiliteState(hState:String):void{
hiliteState = hState;
this.curScene.orgImage.updateHilites();
this.curScene.difImage.updateHilites();
}
public function uninitGame():void{
timer.stop();
scenetimer.stop();
countdown.stop();
}
public function setHintsOn(e:Event):void{
var s:DifferenceScene;
_parent.__options.hints = 1;
if (curScene){
curScene.showHints = true;
};
for each (s in scenes) {
s.showHints = true;
};
if (e == null){
menuManager.optionsDialog.setState(menuManager.optionsDialog.hintsButton, 1);
};
}
private function mClickPlay(e:Event):void{
sounds.play(SoundManager.GOOD_CLICK);
setState(STATE_PLAYING);
}
private function mClickPlay2(e:Event):void{
setHintsOff(null);
sounds.play(SoundManager.GOOD_CLICK);
setState(STATE_PLAYING);
}
public function finishGame(won:Boolean=false):void{
var hiScore:HiScores;
var wHiScore:WhiteHiScores;
FacebookIntegration.saveHiscore(score, root.loaderInfo.parameters.cid);
for each (hiScore in menuManager.hiScores) {
hiScore.setDetails(parseInt(difData.config[0].hiScores[0].@code), gameBranchIndex, difData.config[0].hiScores[0].@game, false, score, score.toString(), "points!");
};
for each (wHiScore in menuManager.whiteHiScores) {
wHiScore.setScore(score);
};
countdown.stop();
if (won){
setState(STATE_WON);
} else {
setState(STATE_LOST);
};
}
public function onTimerTick(e:Event):void{
if (timedScene){
setTimerGraphics(countdown.time.toString());
if (countdown.time <= 5){
timeeffect = new SceneTextEffect(countdown.time.toString(), (SceneTextEffect.ZOOMIN + SceneTextEffect.FADE), 0, 0, 50, 50, [new GlowFilter(0xFFFF00, 0.5)], new TextFormat("MaiandraBold", null, 0xFF3600));
addChild(timeeffect);
timeeffect.x = 60;
timeeffect.y = 60;
timeeffect.run();
};
};
}
public function setMusicOff(e:Event):void{
sounds.musicMuted = true;
_parent.__options.music = 0;
if (e == null){
menuManager.optionsDialog.setState(menuManager.optionsDialog.musicButton, 3);
};
}
public function showScene(sceneNum:Number, first:Boolean=false, noTimer:Boolean=false):void{
preloadScene(sceneNum);
setSceneOnTemplate(sceneNum);
curScene.mask = null;
var cBMD:BitmapData = new BitmapData(curScene.bgSprite.width, curScene.bgSprite.height);
cBMD.draw(curScene);
if (first){
cBMD.draw(coverBitmapData);
};
var nBMD:BitmapData = new BitmapData(curScene.bgSprite.width, curScene.bgSprite.height);
nBMD.draw(scenes[sceneNum]);
setChildIndex(imageTransitionManager, 2);
currentScene = sceneNum;
removeChild(curScene);
curScene.removeEventListener(DifferenceEvent.MISSED_CLICK.type, onMissedClick);
curScene = scenes[sceneNum];
curScene.addEventListener(DifferenceEvent.MISSED_CLICK.type, onMissedClick);
setDifferenceCountGraphics((curScene.currentDifferences - curScene.threshold).toString());
imageTransitionManager.transType = curScene.transition;
if (curScene.timeLimit == 0){
noTimer = true;
};
curScene.receiveMcs(goodClickMc, badClickMc);
if (scenes[currentScene].sceneType == "failscene"){
noPoints = true;
setTimerGraphics("Too Slow!");
} else {
if (noTimer){
setTimerGraphics("Try Again!");
noPoints = false;
} else {
noPoints = false;
};
};
if ((((scenes[currentScene].sceneType == "failscene")) || (noTimer))){
timer.stop();
countdown.time = 0;
countdown.stop();
scenetimer.reset();
scenetimer.stop();
timedScene = false;
} else {
timedScene = true;
timer.start();
countdown.time = curScene.timeLimit;
countdown.start();
scenetimer.reset();
scenetimer.start();
};
scoreTimer.time = difData.config[0].timeBonus[0].@time;
scoreTimer.stop();
addChildAt(curScene, 1);
curScene.visible = false;
curScene.resetHints();
imageTransitionManager.addEventListener(imageTransitionManager.TRANSITION_COMPLETE, transComplete);
imageTransitionManager.trans(cBMD, nBMD);
}
override public function initialize():void{
super.initialize();
}
}
}//package
Section 422
//DifferenceGame_MenuBg0 (DifferenceGame_MenuBg0)
package {
import mx.core.*;
public class DifferenceGame_MenuBg0 extends BitmapAsset {
}
}//package
Section 423
//DifferenceGame_MenuBg1 (DifferenceGame_MenuBg1)
package {
import mx.core.*;
public class DifferenceGame_MenuBg1 extends BitmapAsset {
}
}//package
Section 424
//DifferenceGame_MenuBg2 (DifferenceGame_MenuBg2)
package {
import mx.core.*;
public class DifferenceGame_MenuBg2 extends BitmapAsset {
}
}//package
Section 425
//DifferenceGame_MenuBg3 (DifferenceGame_MenuBg3)
package {
import mx.core.*;
public class DifferenceGame_MenuBg3 extends BitmapAsset {
}
}//package
Section 426
//DifferenceGame_MenuBg4 (DifferenceGame_MenuBg4)
package {
import mx.core.*;
public class DifferenceGame_MenuBg4 extends BitmapAsset {
}
}//package
Section 427
//DifferenceGame_Org0 (DifferenceGame_Org0)
package {
import mx.core.*;
public class DifferenceGame_Org0 extends BitmapAsset {
}
}//package
Section 428
//DifferenceGame_Org0Dif0 (DifferenceGame_Org0Dif0)
package {
import mx.core.*;
public class DifferenceGame_Org0Dif0 extends BitmapAsset {
}
}//package
Section 429
//DifferenceGame_Org0Dif1 (DifferenceGame_Org0Dif1)
package {
import mx.core.*;
public class DifferenceGame_Org0Dif1 extends BitmapAsset {
}
}//package
Section 430
//DifferenceGame_Org0Dif2 (DifferenceGame_Org0Dif2)
package {
import mx.core.*;
public class DifferenceGame_Org0Dif2 extends BitmapAsset {
}
}//package
Section 431
//DifferenceGame_Org0Dif3 (DifferenceGame_Org0Dif3)
package {
import mx.core.*;
public class DifferenceGame_Org0Dif3 extends BitmapAsset {
}
}//package
Section 432
//DifferenceGame_Org0Dif4 (DifferenceGame_Org0Dif4)
package {
import mx.core.*;
public class DifferenceGame_Org0Dif4 extends BitmapAsset {
}
}//package
Section 433
//DifferenceGame_Org0Dif5 (DifferenceGame_Org0Dif5)
package {
import mx.core.*;
public class DifferenceGame_Org0Dif5 extends BitmapAsset {
}
}//package
Section 434
//DifferenceGame_Org0Dif6 (DifferenceGame_Org0Dif6)
package {
import mx.core.*;
public class DifferenceGame_Org0Dif6 extends BitmapAsset {
}
}//package
Section 435
//DifferenceGame_Org0Dif7 (DifferenceGame_Org0Dif7)
package {
import mx.core.*;
public class DifferenceGame_Org0Dif7 extends BitmapAsset {
}
}//package
Section 436
//DifferenceGame_Org0Dif8 (DifferenceGame_Org0Dif8)
package {
import mx.core.*;
public class DifferenceGame_Org0Dif8 extends BitmapAsset {
}
}//package
Section 437
//DifferenceGame_Org1 (DifferenceGame_Org1)
package {
import mx.core.*;
public class DifferenceGame_Org1 extends BitmapAsset {
}
}//package
Section 438
//DifferenceGame_Org10 (DifferenceGame_Org10)
package {
import mx.core.*;
public class DifferenceGame_Org10 extends BitmapAsset {
}
}//package
Section 439
//DifferenceGame_Org10Dif0 (DifferenceGame_Org10Dif0)
package {
import mx.core.*;
public class DifferenceGame_Org10Dif0 extends BitmapAsset {
}
}//package
Section 440
//DifferenceGame_Org10Dif1 (DifferenceGame_Org10Dif1)
package {
import mx.core.*;
public class DifferenceGame_Org10Dif1 extends BitmapAsset {
}
}//package
Section 441
//DifferenceGame_Org10Dif2 (DifferenceGame_Org10Dif2)
package {
import mx.core.*;
public class DifferenceGame_Org10Dif2 extends BitmapAsset {
}
}//package
Section 442
//DifferenceGame_Org10Dif3 (DifferenceGame_Org10Dif3)
package {
import mx.core.*;
public class DifferenceGame_Org10Dif3 extends BitmapAsset {
}
}//package
Section 443
//DifferenceGame_Org10Dif4 (DifferenceGame_Org10Dif4)
package {
import mx.core.*;
public class DifferenceGame_Org10Dif4 extends BitmapAsset {
}
}//package
Section 444
//DifferenceGame_Org10Dif5 (DifferenceGame_Org10Dif5)
package {
import mx.core.*;
public class DifferenceGame_Org10Dif5 extends BitmapAsset {
}
}//package
Section 445
//DifferenceGame_Org10Dif6 (DifferenceGame_Org10Dif6)
package {
import mx.core.*;
public class DifferenceGame_Org10Dif6 extends BitmapAsset {
}
}//package
Section 446
//DifferenceGame_Org10Dif7 (DifferenceGame_Org10Dif7)
package {
import mx.core.*;
public class DifferenceGame_Org10Dif7 extends BitmapAsset {
}
}//package
Section 447
//DifferenceGame_Org10Dif8 (DifferenceGame_Org10Dif8)
package {
import mx.core.*;
public class DifferenceGame_Org10Dif8 extends BitmapAsset {
}
}//package
Section 448
//DifferenceGame_Org10Dif9 (DifferenceGame_Org10Dif9)
package {
import mx.core.*;
public class DifferenceGame_Org10Dif9 extends BitmapAsset {
}
}//package
Section 449
//DifferenceGame_Org11 (DifferenceGame_Org11)
package {
import mx.core.*;
public class DifferenceGame_Org11 extends BitmapAsset {
}
}//package
Section 450
//DifferenceGame_Org11Dif0 (DifferenceGame_Org11Dif0)
package {
import mx.core.*;
public class DifferenceGame_Org11Dif0 extends BitmapAsset {
}
}//package
Section 451
//DifferenceGame_Org11Dif1 (DifferenceGame_Org11Dif1)
package {
import mx.core.*;
public class DifferenceGame_Org11Dif1 extends BitmapAsset {
}
}//package
Section 452
//DifferenceGame_Org11Dif2 (DifferenceGame_Org11Dif2)
package {
import mx.core.*;
public class DifferenceGame_Org11Dif2 extends BitmapAsset {
}
}//package
Section 453
//DifferenceGame_Org11Dif3 (DifferenceGame_Org11Dif3)
package {
import mx.core.*;
public class DifferenceGame_Org11Dif3 extends BitmapAsset {
}
}//package
Section 454
//DifferenceGame_Org11Dif4 (DifferenceGame_Org11Dif4)
package {
import mx.core.*;
public class DifferenceGame_Org11Dif4 extends BitmapAsset {
}
}//package
Section 455
//DifferenceGame_Org11Dif5 (DifferenceGame_Org11Dif5)
package {
import mx.core.*;
public class DifferenceGame_Org11Dif5 extends BitmapAsset {
}
}//package
Section 456
//DifferenceGame_Org11Dif6 (DifferenceGame_Org11Dif6)
package {
import mx.core.*;
public class DifferenceGame_Org11Dif6 extends BitmapAsset {
}
}//package
Section 457
//DifferenceGame_Org11Dif7 (DifferenceGame_Org11Dif7)
package {
import mx.core.*;
public class DifferenceGame_Org11Dif7 extends BitmapAsset {
}
}//package
Section 458
//DifferenceGame_Org11Dif8 (DifferenceGame_Org11Dif8)
package {
import mx.core.*;
public class DifferenceGame_Org11Dif8 extends BitmapAsset {
}
}//package
Section 459
//DifferenceGame_Org11Dif9 (DifferenceGame_Org11Dif9)
package {
import mx.core.*;
public class DifferenceGame_Org11Dif9 extends BitmapAsset {
}
}//package
Section 460
//DifferenceGame_Org12 (DifferenceGame_Org12)
package {
import mx.core.*;
public class DifferenceGame_Org12 extends BitmapAsset {
}
}//package
Section 461
//DifferenceGame_Org12Dif0 (DifferenceGame_Org12Dif0)
package {
import mx.core.*;
public class DifferenceGame_Org12Dif0 extends BitmapAsset {
}
}//package
Section 462
//DifferenceGame_Org12Dif1 (DifferenceGame_Org12Dif1)
package {
import mx.core.*;
public class DifferenceGame_Org12Dif1 extends BitmapAsset {
}
}//package
Section 463
//DifferenceGame_Org12Dif2 (DifferenceGame_Org12Dif2)
package {
import mx.core.*;
public class DifferenceGame_Org12Dif2 extends BitmapAsset {
}
}//package
Section 464
//DifferenceGame_Org12Dif3 (DifferenceGame_Org12Dif3)
package {
import mx.core.*;
public class DifferenceGame_Org12Dif3 extends BitmapAsset {
}
}//package
Section 465
//DifferenceGame_Org12Dif4 (DifferenceGame_Org12Dif4)
package {
import mx.core.*;
public class DifferenceGame_Org12Dif4 extends BitmapAsset {
}
}//package
Section 466
//DifferenceGame_Org12Dif5 (DifferenceGame_Org12Dif5)
package {
import mx.core.*;
public class DifferenceGame_Org12Dif5 extends BitmapAsset {
}
}//package
Section 467
//DifferenceGame_Org12Dif6 (DifferenceGame_Org12Dif6)
package {
import mx.core.*;
public class DifferenceGame_Org12Dif6 extends BitmapAsset {
}
}//package
Section 468
//DifferenceGame_Org12Dif7 (DifferenceGame_Org12Dif7)
package {
import mx.core.*;
public class DifferenceGame_Org12Dif7 extends BitmapAsset {
}
}//package
Section 469
//DifferenceGame_Org12Dif8 (DifferenceGame_Org12Dif8)
package {
import mx.core.*;
public class DifferenceGame_Org12Dif8 extends BitmapAsset {
}
}//package
Section 470
//DifferenceGame_Org12Dif9 (DifferenceGame_Org12Dif9)
package {
import mx.core.*;
public class DifferenceGame_Org12Dif9 extends BitmapAsset {
}
}//package
Section 471
//DifferenceGame_Org13 (DifferenceGame_Org13)
package {
import mx.core.*;
public class DifferenceGame_Org13 extends BitmapAsset {
}
}//package
Section 472
//DifferenceGame_Org13Dif0 (DifferenceGame_Org13Dif0)
package {
import mx.core.*;
public class DifferenceGame_Org13Dif0 extends BitmapAsset {
}
}//package
Section 473
//DifferenceGame_Org13Dif1 (DifferenceGame_Org13Dif1)
package {
import mx.core.*;
public class DifferenceGame_Org13Dif1 extends BitmapAsset {
}
}//package
Section 474
//DifferenceGame_Org13Dif2 (DifferenceGame_Org13Dif2)
package {
import mx.core.*;
public class DifferenceGame_Org13Dif2 extends BitmapAsset {
}
}//package
Section 475
//DifferenceGame_Org13Dif3 (DifferenceGame_Org13Dif3)
package {
import mx.core.*;
public class DifferenceGame_Org13Dif3 extends BitmapAsset {
}
}//package
Section 476
//DifferenceGame_Org13Dif4 (DifferenceGame_Org13Dif4)
package {
import mx.core.*;
public class DifferenceGame_Org13Dif4 extends BitmapAsset {
}
}//package
Section 477
//DifferenceGame_Org13Dif5 (DifferenceGame_Org13Dif5)
package {
import mx.core.*;
public class DifferenceGame_Org13Dif5 extends BitmapAsset {
}
}//package
Section 478
//DifferenceGame_Org13Dif6 (DifferenceGame_Org13Dif6)
package {
import mx.core.*;
public class DifferenceGame_Org13Dif6 extends BitmapAsset {
}
}//package
Section 479
//DifferenceGame_Org13Dif7 (DifferenceGame_Org13Dif7)
package {
import mx.core.*;
public class DifferenceGame_Org13Dif7 extends BitmapAsset {
}
}//package
Section 480
//DifferenceGame_Org13Dif8 (DifferenceGame_Org13Dif8)
package {
import mx.core.*;
public class DifferenceGame_Org13Dif8 extends BitmapAsset {
}
}//package
Section 481
//DifferenceGame_Org13Dif9 (DifferenceGame_Org13Dif9)
package {
import mx.core.*;
public class DifferenceGame_Org13Dif9 extends BitmapAsset {
}
}//package
Section 482
//DifferenceGame_Org14 (DifferenceGame_Org14)
package {
import mx.core.*;
public class DifferenceGame_Org14 extends BitmapAsset {
}
}//package
Section 483
//DifferenceGame_Org14Dif0 (DifferenceGame_Org14Dif0)
package {
import mx.core.*;
public class DifferenceGame_Org14Dif0 extends BitmapAsset {
}
}//package
Section 484
//DifferenceGame_Org14Dif1 (DifferenceGame_Org14Dif1)
package {
import mx.core.*;
public class DifferenceGame_Org14Dif1 extends BitmapAsset {
}
}//package
Section 485
//DifferenceGame_Org14Dif2 (DifferenceGame_Org14Dif2)
package {
import mx.core.*;
public class DifferenceGame_Org14Dif2 extends BitmapAsset {
}
}//package
Section 486
//DifferenceGame_Org14Dif3 (DifferenceGame_Org14Dif3)
package {
import mx.core.*;
public class DifferenceGame_Org14Dif3 extends BitmapAsset {
}
}//package
Section 487
//DifferenceGame_Org14Dif4 (DifferenceGame_Org14Dif4)
package {
import mx.core.*;
public class DifferenceGame_Org14Dif4 extends BitmapAsset {
}
}//package
Section 488
//DifferenceGame_Org14Dif5 (DifferenceGame_Org14Dif5)
package {
import mx.core.*;
public class DifferenceGame_Org14Dif5 extends BitmapAsset {
}
}//package
Section 489
//DifferenceGame_Org14Dif6 (DifferenceGame_Org14Dif6)
package {
import mx.core.*;
public class DifferenceGame_Org14Dif6 extends BitmapAsset {
}
}//package
Section 490
//DifferenceGame_Org14Dif7 (DifferenceGame_Org14Dif7)
package {
import mx.core.*;
public class DifferenceGame_Org14Dif7 extends BitmapAsset {
}
}//package
Section 491
//DifferenceGame_Org14Dif8 (DifferenceGame_Org14Dif8)
package {
import mx.core.*;
public class DifferenceGame_Org14Dif8 extends BitmapAsset {
}
}//package
Section 492
//DifferenceGame_Org14Dif9 (DifferenceGame_Org14Dif9)
package {
import mx.core.*;
public class DifferenceGame_Org14Dif9 extends BitmapAsset {
}
}//package
Section 493
//DifferenceGame_Org15 (DifferenceGame_Org15)
package {
import mx.core.*;
public class DifferenceGame_Org15 extends BitmapAsset {
}
}//package
Section 494
//DifferenceGame_Org15Dif0 (DifferenceGame_Org15Dif0)
package {
import mx.core.*;
public class DifferenceGame_Org15Dif0 extends BitmapAsset {
}
}//package
Section 495
//DifferenceGame_Org15Dif1 (DifferenceGame_Org15Dif1)
package {
import mx.core.*;
public class DifferenceGame_Org15Dif1 extends BitmapAsset {
}
}//package
Section 496
//DifferenceGame_Org15Dif2 (DifferenceGame_Org15Dif2)
package {
import mx.core.*;
public class DifferenceGame_Org15Dif2 extends BitmapAsset {
}
}//package
Section 497
//DifferenceGame_Org15Dif3 (DifferenceGame_Org15Dif3)
package {
import mx.core.*;
public class DifferenceGame_Org15Dif3 extends BitmapAsset {
}
}//package
Section 498
//DifferenceGame_Org15Dif4 (DifferenceGame_Org15Dif4)
package {
import mx.core.*;
public class DifferenceGame_Org15Dif4 extends BitmapAsset {
}
}//package
Section 499
//DifferenceGame_Org15Dif5 (DifferenceGame_Org15Dif5)
package {
import mx.core.*;
public class DifferenceGame_Org15Dif5 extends BitmapAsset {
}
}//package
Section 500
//DifferenceGame_Org15Dif6 (DifferenceGame_Org15Dif6)
package {
import mx.core.*;
public class DifferenceGame_Org15Dif6 extends BitmapAsset {
}
}//package
Section 501
//DifferenceGame_Org15Dif7 (DifferenceGame_Org15Dif7)
package {
import mx.core.*;
public class DifferenceGame_Org15Dif7 extends BitmapAsset {
}
}//package
Section 502
//DifferenceGame_Org15Dif8 (DifferenceGame_Org15Dif8)
package {
import mx.core.*;
public class DifferenceGame_Org15Dif8 extends BitmapAsset {
}
}//package
Section 503
//DifferenceGame_Org15Dif9 (DifferenceGame_Org15Dif9)
package {
import mx.core.*;
public class DifferenceGame_Org15Dif9 extends BitmapAsset {
}
}//package
Section 504
//DifferenceGame_Org16 (DifferenceGame_Org16)
package {
import mx.core.*;
public class DifferenceGame_Org16 extends BitmapAsset {
}
}//package
Section 505
//DifferenceGame_Org16Dif0 (DifferenceGame_Org16Dif0)
package {
import mx.core.*;
public class DifferenceGame_Org16Dif0 extends BitmapAsset {
}
}//package
Section 506
//DifferenceGame_Org16Dif1 (DifferenceGame_Org16Dif1)
package {
import mx.core.*;
public class DifferenceGame_Org16Dif1 extends BitmapAsset {
}
}//package
Section 507
//DifferenceGame_Org16Dif2 (DifferenceGame_Org16Dif2)
package {
import mx.core.*;
public class DifferenceGame_Org16Dif2 extends BitmapAsset {
}
}//package
Section 508
//DifferenceGame_Org16Dif3 (DifferenceGame_Org16Dif3)
package {
import mx.core.*;
public class DifferenceGame_Org16Dif3 extends BitmapAsset {
}
}//package
Section 509
//DifferenceGame_Org16Dif4 (DifferenceGame_Org16Dif4)
package {
import mx.core.*;
public class DifferenceGame_Org16Dif4 extends BitmapAsset {
}
}//package
Section 510
//DifferenceGame_Org16Dif5 (DifferenceGame_Org16Dif5)
package {
import mx.core.*;
public class DifferenceGame_Org16Dif5 extends BitmapAsset {
}
}//package
Section 511
//DifferenceGame_Org16Dif6 (DifferenceGame_Org16Dif6)
package {
import mx.core.*;
public class DifferenceGame_Org16Dif6 extends BitmapAsset {
}
}//package
Section 512
//DifferenceGame_Org16Dif7 (DifferenceGame_Org16Dif7)
package {
import mx.core.*;
public class DifferenceGame_Org16Dif7 extends BitmapAsset {
}
}//package
Section 513
//DifferenceGame_Org16Dif8 (DifferenceGame_Org16Dif8)
package {
import mx.core.*;
public class DifferenceGame_Org16Dif8 extends BitmapAsset {
}
}//package
Section 514
//DifferenceGame_Org16Dif9 (DifferenceGame_Org16Dif9)
package {
import mx.core.*;
public class DifferenceGame_Org16Dif9 extends BitmapAsset {
}
}//package
Section 515
//DifferenceGame_Org17 (DifferenceGame_Org17)
package {
import mx.core.*;
public class DifferenceGame_Org17 extends BitmapAsset {
}
}//package
Section 516
//DifferenceGame_Org17Dif0 (DifferenceGame_Org17Dif0)
package {
import mx.core.*;
public class DifferenceGame_Org17Dif0 extends BitmapAsset {
}
}//package
Section 517
//DifferenceGame_Org17Dif1 (DifferenceGame_Org17Dif1)
package {
import mx.core.*;
public class DifferenceGame_Org17Dif1 extends BitmapAsset {
}
}//package
Section 518
//DifferenceGame_Org17Dif2 (DifferenceGame_Org17Dif2)
package {
import mx.core.*;
public class DifferenceGame_Org17Dif2 extends BitmapAsset {
}
}//package
Section 519
//DifferenceGame_Org17Dif3 (DifferenceGame_Org17Dif3)
package {
import mx.core.*;
public class DifferenceGame_Org17Dif3 extends BitmapAsset {
}
}//package
Section 520
//DifferenceGame_Org17Dif4 (DifferenceGame_Org17Dif4)
package {
import mx.core.*;
public class DifferenceGame_Org17Dif4 extends BitmapAsset {
}
}//package
Section 521
//DifferenceGame_Org17Dif5 (DifferenceGame_Org17Dif5)
package {
import mx.core.*;
public class DifferenceGame_Org17Dif5 extends BitmapAsset {
}
}//package
Section 522
//DifferenceGame_Org17Dif6 (DifferenceGame_Org17Dif6)
package {
import mx.core.*;
public class DifferenceGame_Org17Dif6 extends BitmapAsset {
}
}//package
Section 523
//DifferenceGame_Org17Dif7 (DifferenceGame_Org17Dif7)
package {
import mx.core.*;
public class DifferenceGame_Org17Dif7 extends BitmapAsset {
}
}//package
Section 524
//DifferenceGame_Org17Dif8 (DifferenceGame_Org17Dif8)
package {
import mx.core.*;
public class DifferenceGame_Org17Dif8 extends BitmapAsset {
}
}//package
Section 525
//DifferenceGame_Org17Dif9 (DifferenceGame_Org17Dif9)
package {
import mx.core.*;
public class DifferenceGame_Org17Dif9 extends BitmapAsset {
}
}//package
Section 526
//DifferenceGame_Org18 (DifferenceGame_Org18)
package {
import mx.core.*;
public class DifferenceGame_Org18 extends BitmapAsset {
}
}//package
Section 527
//DifferenceGame_Org18Dif0 (DifferenceGame_Org18Dif0)
package {
import mx.core.*;
public class DifferenceGame_Org18Dif0 extends BitmapAsset {
}
}//package
Section 528
//DifferenceGame_Org18Dif1 (DifferenceGame_Org18Dif1)
package {
import mx.core.*;
public class DifferenceGame_Org18Dif1 extends BitmapAsset {
}
}//package
Section 529
//DifferenceGame_Org18Dif2 (DifferenceGame_Org18Dif2)
package {
import mx.core.*;
public class DifferenceGame_Org18Dif2 extends BitmapAsset {
}
}//package
Section 530
//DifferenceGame_Org18Dif3 (DifferenceGame_Org18Dif3)
package {
import mx.core.*;
public class DifferenceGame_Org18Dif3 extends BitmapAsset {
}
}//package
Section 531
//DifferenceGame_Org18Dif4 (DifferenceGame_Org18Dif4)
package {
import mx.core.*;
public class DifferenceGame_Org18Dif4 extends BitmapAsset {
}
}//package
Section 532
//DifferenceGame_Org18Dif5 (DifferenceGame_Org18Dif5)
package {
import mx.core.*;
public class DifferenceGame_Org18Dif5 extends BitmapAsset {
}
}//package
Section 533
//DifferenceGame_Org18Dif6 (DifferenceGame_Org18Dif6)
package {
import mx.core.*;
public class DifferenceGame_Org18Dif6 extends BitmapAsset {
}
}//package
Section 534
//DifferenceGame_Org18Dif7 (DifferenceGame_Org18Dif7)
package {
import mx.core.*;
public class DifferenceGame_Org18Dif7 extends BitmapAsset {
}
}//package
Section 535
//DifferenceGame_Org18Dif8 (DifferenceGame_Org18Dif8)
package {
import mx.core.*;
public class DifferenceGame_Org18Dif8 extends BitmapAsset {
}
}//package
Section 536
//DifferenceGame_Org18Dif9 (DifferenceGame_Org18Dif9)
package {
import mx.core.*;
public class DifferenceGame_Org18Dif9 extends BitmapAsset {
}
}//package
Section 537
//DifferenceGame_Org19 (DifferenceGame_Org19)
package {
import mx.core.*;
public class DifferenceGame_Org19 extends BitmapAsset {
}
}//package
Section 538
//DifferenceGame_Org19Dif0 (DifferenceGame_Org19Dif0)
package {
import mx.core.*;
public class DifferenceGame_Org19Dif0 extends BitmapAsset {
}
}//package
Section 539
//DifferenceGame_Org19Dif1 (DifferenceGame_Org19Dif1)
package {
import mx.core.*;
public class DifferenceGame_Org19Dif1 extends BitmapAsset {
}
}//package
Section 540
//DifferenceGame_Org19Dif2 (DifferenceGame_Org19Dif2)
package {
import mx.core.*;
public class DifferenceGame_Org19Dif2 extends BitmapAsset {
}
}//package
Section 541
//DifferenceGame_Org19Dif3 (DifferenceGame_Org19Dif3)
package {
import mx.core.*;
public class DifferenceGame_Org19Dif3 extends BitmapAsset {
}
}//package
Section 542
//DifferenceGame_Org19Dif4 (DifferenceGame_Org19Dif4)
package {
import mx.core.*;
public class DifferenceGame_Org19Dif4 extends BitmapAsset {
}
}//package
Section 543
//DifferenceGame_Org19Dif5 (DifferenceGame_Org19Dif5)
package {
import mx.core.*;
public class DifferenceGame_Org19Dif5 extends BitmapAsset {
}
}//package
Section 544
//DifferenceGame_Org19Dif6 (DifferenceGame_Org19Dif6)
package {
import mx.core.*;
public class DifferenceGame_Org19Dif6 extends BitmapAsset {
}
}//package
Section 545
//DifferenceGame_Org19Dif7 (DifferenceGame_Org19Dif7)
package {
import mx.core.*;
public class DifferenceGame_Org19Dif7 extends BitmapAsset {
}
}//package
Section 546
//DifferenceGame_Org19Dif8 (DifferenceGame_Org19Dif8)
package {
import mx.core.*;
public class DifferenceGame_Org19Dif8 extends BitmapAsset {
}
}//package
Section 547
//DifferenceGame_Org19Dif9 (DifferenceGame_Org19Dif9)
package {
import mx.core.*;
public class DifferenceGame_Org19Dif9 extends BitmapAsset {
}
}//package
Section 548
//DifferenceGame_Org1Dif0 (DifferenceGame_Org1Dif0)
package {
import mx.core.*;
public class DifferenceGame_Org1Dif0 extends BitmapAsset {
}
}//package
Section 549
//DifferenceGame_Org1Dif1 (DifferenceGame_Org1Dif1)
package {
import mx.core.*;
public class DifferenceGame_Org1Dif1 extends BitmapAsset {
}
}//package
Section 550
//DifferenceGame_Org1Dif2 (DifferenceGame_Org1Dif2)
package {
import mx.core.*;
public class DifferenceGame_Org1Dif2 extends BitmapAsset {
}
}//package
Section 551
//DifferenceGame_Org1Dif3 (DifferenceGame_Org1Dif3)
package {
import mx.core.*;
public class DifferenceGame_Org1Dif3 extends BitmapAsset {
}
}//package
Section 552
//DifferenceGame_Org1Dif4 (DifferenceGame_Org1Dif4)
package {
import mx.core.*;
public class DifferenceGame_Org1Dif4 extends BitmapAsset {
}
}//package
Section 553
//DifferenceGame_Org1Dif5 (DifferenceGame_Org1Dif5)
package {
import mx.core.*;
public class DifferenceGame_Org1Dif5 extends BitmapAsset {
}
}//package
Section 554
//DifferenceGame_Org1Dif6 (DifferenceGame_Org1Dif6)
package {
import mx.core.*;
public class DifferenceGame_Org1Dif6 extends BitmapAsset {
}
}//package
Section 555
//DifferenceGame_Org1Dif7 (DifferenceGame_Org1Dif7)
package {
import mx.core.*;
public class DifferenceGame_Org1Dif7 extends BitmapAsset {
}
}//package
Section 556
//DifferenceGame_Org1Dif8 (DifferenceGame_Org1Dif8)
package {
import mx.core.*;
public class DifferenceGame_Org1Dif8 extends BitmapAsset {
}
}//package
Section 557
//DifferenceGame_Org2 (DifferenceGame_Org2)
package {
import mx.core.*;
public class DifferenceGame_Org2 extends BitmapAsset {
}
}//package
Section 558
//DifferenceGame_Org20 (DifferenceGame_Org20)
package {
import mx.core.*;
public class DifferenceGame_Org20 extends BitmapAsset {
}
}//package
Section 559
//DifferenceGame_Org20Dif0 (DifferenceGame_Org20Dif0)
package {
import mx.core.*;
public class DifferenceGame_Org20Dif0 extends BitmapAsset {
}
}//package
Section 560
//DifferenceGame_Org20Dif1 (DifferenceGame_Org20Dif1)
package {
import mx.core.*;
public class DifferenceGame_Org20Dif1 extends BitmapAsset {
}
}//package
Section 561
//DifferenceGame_Org20Dif2 (DifferenceGame_Org20Dif2)
package {
import mx.core.*;
public class DifferenceGame_Org20Dif2 extends BitmapAsset {
}
}//package
Section 562
//DifferenceGame_Org20Dif3 (DifferenceGame_Org20Dif3)
package {
import mx.core.*;
public class DifferenceGame_Org20Dif3 extends BitmapAsset {
}
}//package
Section 563
//DifferenceGame_Org20Dif4 (DifferenceGame_Org20Dif4)
package {
import mx.core.*;
public class DifferenceGame_Org20Dif4 extends BitmapAsset {
}
}//package
Section 564
//DifferenceGame_Org20Dif5 (DifferenceGame_Org20Dif5)
package {
import mx.core.*;
public class DifferenceGame_Org20Dif5 extends BitmapAsset {
}
}//package
Section 565
//DifferenceGame_Org20Dif6 (DifferenceGame_Org20Dif6)
package {
import mx.core.*;
public class DifferenceGame_Org20Dif6 extends BitmapAsset {
}
}//package
Section 566
//DifferenceGame_Org20Dif7 (DifferenceGame_Org20Dif7)
package {
import mx.core.*;
public class DifferenceGame_Org20Dif7 extends BitmapAsset {
}
}//package
Section 567
//DifferenceGame_Org20Dif8 (DifferenceGame_Org20Dif8)
package {
import mx.core.*;
public class DifferenceGame_Org20Dif8 extends BitmapAsset {
}
}//package
Section 568
//DifferenceGame_Org20Dif9 (DifferenceGame_Org20Dif9)
package {
import mx.core.*;
public class DifferenceGame_Org20Dif9 extends BitmapAsset {
}
}//package
Section 569
//DifferenceGame_Org21 (DifferenceGame_Org21)
package {
import mx.core.*;
public class DifferenceGame_Org21 extends BitmapAsset {
}
}//package
Section 570
//DifferenceGame_Org21Dif0 (DifferenceGame_Org21Dif0)
package {
import mx.core.*;
public class DifferenceGame_Org21Dif0 extends BitmapAsset {
}
}//package
Section 571
//DifferenceGame_Org21Dif1 (DifferenceGame_Org21Dif1)
package {
import mx.core.*;
public class DifferenceGame_Org21Dif1 extends BitmapAsset {
}
}//package
Section 572
//DifferenceGame_Org21Dif2 (DifferenceGame_Org21Dif2)
package {
import mx.core.*;
public class DifferenceGame_Org21Dif2 extends BitmapAsset {
}
}//package
Section 573
//DifferenceGame_Org21Dif3 (DifferenceGame_Org21Dif3)
package {
import mx.core.*;
public class DifferenceGame_Org21Dif3 extends BitmapAsset {
}
}//package
Section 574
//DifferenceGame_Org21Dif4 (DifferenceGame_Org21Dif4)
package {
import mx.core.*;
public class DifferenceGame_Org21Dif4 extends BitmapAsset {
}
}//package
Section 575
//DifferenceGame_Org21Dif5 (DifferenceGame_Org21Dif5)
package {
import mx.core.*;
public class DifferenceGame_Org21Dif5 extends BitmapAsset {
}
}//package
Section 576
//DifferenceGame_Org21Dif6 (DifferenceGame_Org21Dif6)
package {
import mx.core.*;
public class DifferenceGame_Org21Dif6 extends BitmapAsset {
}
}//package
Section 577
//DifferenceGame_Org21Dif7 (DifferenceGame_Org21Dif7)
package {
import mx.core.*;
public class DifferenceGame_Org21Dif7 extends BitmapAsset {
}
}//package
Section 578
//DifferenceGame_Org21Dif8 (DifferenceGame_Org21Dif8)
package {
import mx.core.*;
public class DifferenceGame_Org21Dif8 extends BitmapAsset {
}
}//package
Section 579
//DifferenceGame_Org21Dif9 (DifferenceGame_Org21Dif9)
package {
import mx.core.*;
public class DifferenceGame_Org21Dif9 extends BitmapAsset {
}
}//package
Section 580
//DifferenceGame_Org2Dif0 (DifferenceGame_Org2Dif0)
package {
import mx.core.*;
public class DifferenceGame_Org2Dif0 extends BitmapAsset {
}
}//package
Section 581
//DifferenceGame_Org2Dif1 (DifferenceGame_Org2Dif1)
package {
import mx.core.*;
public class DifferenceGame_Org2Dif1 extends BitmapAsset {
}
}//package
Section 582
//DifferenceGame_Org2Dif2 (DifferenceGame_Org2Dif2)
package {
import mx.core.*;
public class DifferenceGame_Org2Dif2 extends BitmapAsset {
}
}//package
Section 583
//DifferenceGame_Org2Dif3 (DifferenceGame_Org2Dif3)
package {
import mx.core.*;
public class DifferenceGame_Org2Dif3 extends BitmapAsset {
}
}//package
Section 584
//DifferenceGame_Org2Dif4 (DifferenceGame_Org2Dif4)
package {
import mx.core.*;
public class DifferenceGame_Org2Dif4 extends BitmapAsset {
}
}//package
Section 585
//DifferenceGame_Org2Dif5 (DifferenceGame_Org2Dif5)
package {
import mx.core.*;
public class DifferenceGame_Org2Dif5 extends BitmapAsset {
}
}//package
Section 586
//DifferenceGame_Org2Dif6 (DifferenceGame_Org2Dif6)
package {
import mx.core.*;
public class DifferenceGame_Org2Dif6 extends BitmapAsset {
}
}//package
Section 587
//DifferenceGame_Org2Dif7 (DifferenceGame_Org2Dif7)
package {
import mx.core.*;
public class DifferenceGame_Org2Dif7 extends BitmapAsset {
}
}//package
Section 588
//DifferenceGame_Org2Dif8 (DifferenceGame_Org2Dif8)
package {
import mx.core.*;
public class DifferenceGame_Org2Dif8 extends BitmapAsset {
}
}//package
Section 589
//DifferenceGame_Org3 (DifferenceGame_Org3)
package {
import mx.core.*;
public class DifferenceGame_Org3 extends BitmapAsset {
}
}//package
Section 590
//DifferenceGame_Org3Dif0 (DifferenceGame_Org3Dif0)
package {
import mx.core.*;
public class DifferenceGame_Org3Dif0 extends BitmapAsset {
}
}//package
Section 591
//DifferenceGame_Org3Dif1 (DifferenceGame_Org3Dif1)
package {
import mx.core.*;
public class DifferenceGame_Org3Dif1 extends BitmapAsset {
}
}//package
Section 592
//DifferenceGame_Org3Dif2 (DifferenceGame_Org3Dif2)
package {
import mx.core.*;
public class DifferenceGame_Org3Dif2 extends BitmapAsset {
}
}//package
Section 593
//DifferenceGame_Org3Dif3 (DifferenceGame_Org3Dif3)
package {
import mx.core.*;
public class DifferenceGame_Org3Dif3 extends BitmapAsset {
}
}//package
Section 594
//DifferenceGame_Org3Dif4 (DifferenceGame_Org3Dif4)
package {
import mx.core.*;
public class DifferenceGame_Org3Dif4 extends BitmapAsset {
}
}//package
Section 595
//DifferenceGame_Org3Dif5 (DifferenceGame_Org3Dif5)
package {
import mx.core.*;
public class DifferenceGame_Org3Dif5 extends BitmapAsset {
}
}//package
Section 596
//DifferenceGame_Org3Dif6 (DifferenceGame_Org3Dif6)
package {
import mx.core.*;
public class DifferenceGame_Org3Dif6 extends BitmapAsset {
}
}//package
Section 597
//DifferenceGame_Org3Dif7 (DifferenceGame_Org3Dif7)
package {
import mx.core.*;
public class DifferenceGame_Org3Dif7 extends BitmapAsset {
}
}//package
Section 598
//DifferenceGame_Org3Dif8 (DifferenceGame_Org3Dif8)
package {
import mx.core.*;
public class DifferenceGame_Org3Dif8 extends BitmapAsset {
}
}//package
Section 599
//DifferenceGame_Org4 (DifferenceGame_Org4)
package {
import mx.core.*;
public class DifferenceGame_Org4 extends BitmapAsset {
}
}//package
Section 600
//DifferenceGame_Org4Dif0 (DifferenceGame_Org4Dif0)
package {
import mx.core.*;
public class DifferenceGame_Org4Dif0 extends BitmapAsset {
}
}//package
Section 601
//DifferenceGame_Org4Dif1 (DifferenceGame_Org4Dif1)
package {
import mx.core.*;
public class DifferenceGame_Org4Dif1 extends BitmapAsset {
}
}//package
Section 602
//DifferenceGame_Org4Dif2 (DifferenceGame_Org4Dif2)
package {
import mx.core.*;
public class DifferenceGame_Org4Dif2 extends BitmapAsset {
}
}//package
Section 603
//DifferenceGame_Org4Dif3 (DifferenceGame_Org4Dif3)
package {
import mx.core.*;
public class DifferenceGame_Org4Dif3 extends BitmapAsset {
}
}//package
Section 604
//DifferenceGame_Org4Dif4 (DifferenceGame_Org4Dif4)
package {
import mx.core.*;
public class DifferenceGame_Org4Dif4 extends BitmapAsset {
}
}//package
Section 605
//DifferenceGame_Org4Dif5 (DifferenceGame_Org4Dif5)
package {
import mx.core.*;
public class DifferenceGame_Org4Dif5 extends BitmapAsset {
}
}//package
Section 606
//DifferenceGame_Org4Dif6 (DifferenceGame_Org4Dif6)
package {
import mx.core.*;
public class DifferenceGame_Org4Dif6 extends BitmapAsset {
}
}//package
Section 607
//DifferenceGame_Org4Dif7 (DifferenceGame_Org4Dif7)
package {
import mx.core.*;
public class DifferenceGame_Org4Dif7 extends BitmapAsset {
}
}//package
Section 608
//DifferenceGame_Org4Dif8 (DifferenceGame_Org4Dif8)
package {
import mx.core.*;
public class DifferenceGame_Org4Dif8 extends BitmapAsset {
}
}//package
Section 609
//DifferenceGame_Org4Dif9 (DifferenceGame_Org4Dif9)
package {
import mx.core.*;
public class DifferenceGame_Org4Dif9 extends BitmapAsset {
}
}//package
Section 610
//DifferenceGame_Org5 (DifferenceGame_Org5)
package {
import mx.core.*;
public class DifferenceGame_Org5 extends BitmapAsset {
}
}//package
Section 611
//DifferenceGame_Org5Dif0 (DifferenceGame_Org5Dif0)
package {
import mx.core.*;
public class DifferenceGame_Org5Dif0 extends BitmapAsset {
}
}//package
Section 612
//DifferenceGame_Org5Dif1 (DifferenceGame_Org5Dif1)
package {
import mx.core.*;
public class DifferenceGame_Org5Dif1 extends BitmapAsset {
}
}//package
Section 613
//DifferenceGame_Org5Dif2 (DifferenceGame_Org5Dif2)
package {
import mx.core.*;
public class DifferenceGame_Org5Dif2 extends BitmapAsset {
}
}//package
Section 614
//DifferenceGame_Org5Dif3 (DifferenceGame_Org5Dif3)
package {
import mx.core.*;
public class DifferenceGame_Org5Dif3 extends BitmapAsset {
}
}//package
Section 615
//DifferenceGame_Org5Dif4 (DifferenceGame_Org5Dif4)
package {
import mx.core.*;
public class DifferenceGame_Org5Dif4 extends BitmapAsset {
}
}//package
Section 616
//DifferenceGame_Org5Dif5 (DifferenceGame_Org5Dif5)
package {
import mx.core.*;
public class DifferenceGame_Org5Dif5 extends BitmapAsset {
}
}//package
Section 617
//DifferenceGame_Org5Dif6 (DifferenceGame_Org5Dif6)
package {
import mx.core.*;
public class DifferenceGame_Org5Dif6 extends BitmapAsset {
}
}//package
Section 618
//DifferenceGame_Org5Dif7 (DifferenceGame_Org5Dif7)
package {
import mx.core.*;
public class DifferenceGame_Org5Dif7 extends BitmapAsset {
}
}//package
Section 619
//DifferenceGame_Org5Dif8 (DifferenceGame_Org5Dif8)
package {
import mx.core.*;
public class DifferenceGame_Org5Dif8 extends BitmapAsset {
}
}//package
Section 620
//DifferenceGame_Org5Dif9 (DifferenceGame_Org5Dif9)
package {
import mx.core.*;
public class DifferenceGame_Org5Dif9 extends BitmapAsset {
}
}//package
Section 621
//DifferenceGame_Org6 (DifferenceGame_Org6)
package {
import mx.core.*;
public class DifferenceGame_Org6 extends BitmapAsset {
}
}//package
Section 622
//DifferenceGame_Org6Dif0 (DifferenceGame_Org6Dif0)
package {
import mx.core.*;
public class DifferenceGame_Org6Dif0 extends BitmapAsset {
}
}//package
Section 623
//DifferenceGame_Org6Dif1 (DifferenceGame_Org6Dif1)
package {
import mx.core.*;
public class DifferenceGame_Org6Dif1 extends BitmapAsset {
}
}//package
Section 624
//DifferenceGame_Org6Dif2 (DifferenceGame_Org6Dif2)
package {
import mx.core.*;
public class DifferenceGame_Org6Dif2 extends BitmapAsset {
}
}//package
Section 625
//DifferenceGame_Org6Dif3 (DifferenceGame_Org6Dif3)
package {
import mx.core.*;
public class DifferenceGame_Org6Dif3 extends BitmapAsset {
}
}//package
Section 626
//DifferenceGame_Org6Dif4 (DifferenceGame_Org6Dif4)
package {
import mx.core.*;
public class DifferenceGame_Org6Dif4 extends BitmapAsset {
}
}//package
Section 627
//DifferenceGame_Org6Dif5 (DifferenceGame_Org6Dif5)
package {
import mx.core.*;
public class DifferenceGame_Org6Dif5 extends BitmapAsset {
}
}//package
Section 628
//DifferenceGame_Org6Dif6 (DifferenceGame_Org6Dif6)
package {
import mx.core.*;
public class DifferenceGame_Org6Dif6 extends BitmapAsset {
}
}//package
Section 629
//DifferenceGame_Org6Dif7 (DifferenceGame_Org6Dif7)
package {
import mx.core.*;
public class DifferenceGame_Org6Dif7 extends BitmapAsset {
}
}//package
Section 630
//DifferenceGame_Org7 (DifferenceGame_Org7)
package {
import mx.core.*;
public class DifferenceGame_Org7 extends BitmapAsset {
}
}//package
Section 631
//DifferenceGame_Org7Dif0 (DifferenceGame_Org7Dif0)
package {
import mx.core.*;
public class DifferenceGame_Org7Dif0 extends BitmapAsset {
}
}//package
Section 632
//DifferenceGame_Org7Dif1 (DifferenceGame_Org7Dif1)
package {
import mx.core.*;
public class DifferenceGame_Org7Dif1 extends BitmapAsset {
}
}//package
Section 633
//DifferenceGame_Org7Dif2 (DifferenceGame_Org7Dif2)
package {
import mx.core.*;
public class DifferenceGame_Org7Dif2 extends BitmapAsset {
}
}//package
Section 634
//DifferenceGame_Org7Dif3 (DifferenceGame_Org7Dif3)
package {
import mx.core.*;
public class DifferenceGame_Org7Dif3 extends BitmapAsset {
}
}//package
Section 635
//DifferenceGame_Org7Dif4 (DifferenceGame_Org7Dif4)
package {
import mx.core.*;
public class DifferenceGame_Org7Dif4 extends BitmapAsset {
}
}//package
Section 636
//DifferenceGame_Org7Dif5 (DifferenceGame_Org7Dif5)
package {
import mx.core.*;
public class DifferenceGame_Org7Dif5 extends BitmapAsset {
}
}//package
Section 637
//DifferenceGame_Org7Dif6 (DifferenceGame_Org7Dif6)
package {
import mx.core.*;
public class DifferenceGame_Org7Dif6 extends BitmapAsset {
}
}//package
Section 638
//DifferenceGame_Org7Dif7 (DifferenceGame_Org7Dif7)
package {
import mx.core.*;
public class DifferenceGame_Org7Dif7 extends BitmapAsset {
}
}//package
Section 639
//DifferenceGame_Org7Dif8 (DifferenceGame_Org7Dif8)
package {
import mx.core.*;
public class DifferenceGame_Org7Dif8 extends BitmapAsset {
}
}//package
Section 640
//DifferenceGame_Org8 (DifferenceGame_Org8)
package {
import mx.core.*;
public class DifferenceGame_Org8 extends BitmapAsset {
}
}//package
Section 641
//DifferenceGame_Org8Dif0 (DifferenceGame_Org8Dif0)
package {
import mx.core.*;
public class DifferenceGame_Org8Dif0 extends BitmapAsset {
}
}//package
Section 642
//DifferenceGame_Org8Dif1 (DifferenceGame_Org8Dif1)
package {
import mx.core.*;
public class DifferenceGame_Org8Dif1 extends BitmapAsset {
}
}//package
Section 643
//DifferenceGame_Org8Dif2 (DifferenceGame_Org8Dif2)
package {
import mx.core.*;
public class DifferenceGame_Org8Dif2 extends BitmapAsset {
}
}//package
Section 644
//DifferenceGame_Org8Dif3 (DifferenceGame_Org8Dif3)
package {
import mx.core.*;
public class DifferenceGame_Org8Dif3 extends BitmapAsset {
}
}//package
Section 645
//DifferenceGame_Org8Dif4 (DifferenceGame_Org8Dif4)
package {
import mx.core.*;
public class DifferenceGame_Org8Dif4 extends BitmapAsset {
}
}//package
Section 646
//DifferenceGame_Org8Dif5 (DifferenceGame_Org8Dif5)
package {
import mx.core.*;
public class DifferenceGame_Org8Dif5 extends BitmapAsset {
}
}//package
Section 647
//DifferenceGame_Org8Dif6 (DifferenceGame_Org8Dif6)
package {
import mx.core.*;
public class DifferenceGame_Org8Dif6 extends BitmapAsset {
}
}//package
Section 648
//DifferenceGame_Org8Dif7 (DifferenceGame_Org8Dif7)
package {
import mx.core.*;
public class DifferenceGame_Org8Dif7 extends BitmapAsset {
}
}//package
Section 649
//DifferenceGame_Org8Dif8 (DifferenceGame_Org8Dif8)
package {
import mx.core.*;
public class DifferenceGame_Org8Dif8 extends BitmapAsset {
}
}//package
Section 650
//DifferenceGame_Org9 (DifferenceGame_Org9)
package {
import mx.core.*;
public class DifferenceGame_Org9 extends BitmapAsset {
}
}//package
Section 651
//DifferenceGame_Org9Dif0 (DifferenceGame_Org9Dif0)
package {
import mx.core.*;
public class DifferenceGame_Org9Dif0 extends BitmapAsset {
}
}//package
Section 652
//DifferenceGame_Org9Dif1 (DifferenceGame_Org9Dif1)
package {
import mx.core.*;
public class DifferenceGame_Org9Dif1 extends BitmapAsset {
}
}//package
Section 653
//DifferenceGame_Org9Dif2 (DifferenceGame_Org9Dif2)
package {
import mx.core.*;
public class DifferenceGame_Org9Dif2 extends BitmapAsset {
}
}//package
Section 654
//DifferenceGame_Org9Dif3 (DifferenceGame_Org9Dif3)
package {
import mx.core.*;
public class DifferenceGame_Org9Dif3 extends BitmapAsset {
}
}//package
Section 655
//DifferenceGame_Org9Dif4 (DifferenceGame_Org9Dif4)
package {
import mx.core.*;
public class DifferenceGame_Org9Dif4 extends BitmapAsset {
}
}//package
Section 656
//DifferenceGame_Org9Dif5 (DifferenceGame_Org9Dif5)
package {
import mx.core.*;
public class DifferenceGame_Org9Dif5 extends BitmapAsset {
}
}//package
Section 657
//DifferenceGame_Org9Dif6 (DifferenceGame_Org9Dif6)
package {
import mx.core.*;
public class DifferenceGame_Org9Dif6 extends BitmapAsset {
}
}//package
Section 658
//DifferenceGame_Org9Dif7 (DifferenceGame_Org9Dif7)
package {
import mx.core.*;
public class DifferenceGame_Org9Dif7 extends BitmapAsset {
}
}//package
Section 659
//DifferenceGame_Org9Dif8 (DifferenceGame_Org9Dif8)
package {
import mx.core.*;
public class DifferenceGame_Org9Dif8 extends BitmapAsset {
}
}//package
Section 660
//DifferenceGame_Org9Dif9 (DifferenceGame_Org9Dif9)
package {
import mx.core.*;
public class DifferenceGame_Org9Dif9 extends BitmapAsset {
}
}//package
Section 661
//DifferenceGame_overlayE (DifferenceGame_overlayE)
package {
import mx.core.*;
public class DifferenceGame_overlayE extends ByteArrayAsset {
}
}//package
Section 662
//DifferenceGame_se1 (DifferenceGame_se1)
package {
import mx.core.*;
public class DifferenceGame_se1 extends SoundAsset {
}
}//package
Section 663
//DifferenceGame_se2 (DifferenceGame_se2)
package {
import mx.core.*;
public class DifferenceGame_se2 extends SoundAsset {
}
}//package
Section 664
//DifferenceGame_se3 (DifferenceGame_se3)
package {
import mx.core.*;
public class DifferenceGame_se3 extends SoundAsset {
}
}//package
Section 665
//DifferenceGame_se4 (DifferenceGame_se4)
package {
import mx.core.*;
public class DifferenceGame_se4 extends SoundAsset {
}
}//package
Section 666
//DifferenceGame_se5 (DifferenceGame_se5)
package {
import mx.core.*;
public class DifferenceGame_se5 extends SoundAsset {
}
}//package
Section 667
//DifferenceGame_se6 (DifferenceGame_se6)
package {
import mx.core.*;
public class DifferenceGame_se6 extends SoundAsset {
}
}//package
Section 668
//DifferenceGame_templateE (DifferenceGame_templateE)
package {
import mx.core.*;
public class DifferenceGame_templateE extends ByteArrayAsset {
}
}//package
Section 669
//DifferenceGame_XMLFILE (DifferenceGame_XMLFILE)
package {
import mx.core.*;
public class DifferenceGame_XMLFILE extends ByteArrayAsset {
}
}//package
Section 670
//DifferenceGamePlayer (DifferenceGamePlayer)
package {
import flash.display.*;
import mx.core.*;
import flash.geom.*;
import flash.events.*;
import mx.controls.*;
import com.kongregate.as3.client.*;
import mx.styles.*;
import flash.text.*;
import flash.ui.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.media.*;
import flash.filters.*;
import mx.binding.*;
import flash.external.*;
import flash.accessibility.*;
import flash.debugger.*;
import flash.errors.*;
import flash.printing.*;
import flash.profiler.*;
import flash.xml.*;
import caurina.transitions.*;
public class DifferenceGamePlayer extends Application {
private var _documentDescriptor_:UIComponentDescriptor;
private var difData:XML;
public var siteLock:Array;
private var _embed__font_Verdana_medium_normal_2067159803:Class;
public var kongregate:KongregateAPI;
public var _mochiads_game_id:String;// = "0a322fe91500640d"
public var host:String;
private var _embed__font_MaiandraBold_bold_normal_1656384707:Class;
public var mochiBots:Object;
public var xmlFile:Class;
public var dGame:DifferenceGame;
public var __options:Object;
mx_internal static var _DifferenceGamePlayer_StylesInit_done:Boolean = false;
public function DifferenceGamePlayer(){
_documentDescriptor_ = new UIComponentDescriptor({type:Application, propertiesFactory:function ():Object{
return ({width:560, height:560});
}});
xmlFile = DifferenceGamePlayer_xmlFile;
dGame = new DifferenceGame();
siteLock = ["differencegames.com", "www.differencegames.com", "flashgamelicense.com", "www.flashgamelicense.com", "www.gimme5games.com", "gimme5games.com", "staging-dg"];
__options = {};
mochiBots = {A:"", B:"", C:"", D:"", E:""};
_embed__font_MaiandraBold_bold_normal_1656384707 = DifferenceGamePlayer__embed__font_MaiandraBold_bold_normal_1656384707;
_embed__font_Verdana_medium_normal_2067159803 = DifferenceGamePlayer__embed__font_Verdana_medium_normal_2067159803;
super();
mx_internal::_document = this;
if (!this.styleDeclaration){
this.styleDeclaration = new CSSStyleDeclaration();
};
this.styleDeclaration.defaultFactory = function ():void{
this.backgroundColor = 0;
this.backgroundGradientColors = [0, 0];
this.borderStyle = "solid";
this.borderThickness = 0;
this.themeColor = 0;
this.backgroundGradientAlphas = [1, 1];
};
mx_internal::_DifferenceGamePlayer_StylesInit();
this.layout = "absolute";
this.width = 560;
this.height = 560;
this.addEventListener("addedToStage", ___DifferenceGamePlayer_Application1_addedToStage);
}
override public function initialize():void{
mx_internal::setDocumentDescriptor(_documentDescriptor_);
super.initialize();
}
public function ___DifferenceGamePlayer_Application1_addedToStage(event:Event):void{
ini(event);
}
private function resetGame(e:Event):void{
MochiBot.track(this, mochiBots.A);
removeChild(dGame);
dGame.dispose();
dGame = new DifferenceGame();
dGame.addEventListener("reset", resetGame);
addChild(dGame);
dGame.alpha = 0;
dGame.ini();
Tweener.addTween(dGame, {alpha:1, time:1});
}
mx_internal function _DifferenceGamePlayer_StylesInit():void{
var _local1:CSSStyleDeclaration;
var _local2:Array;
if (mx_internal::_DifferenceGamePlayer_StylesInit_done){
return;
};
mx_internal::_DifferenceGamePlayer_StylesInit_done = true;
var _local3 = StyleManager;
_local3.mx_internal::initProtoChainRoots();
}
private function securityOK(e:Event):void{
}
public function ini(e:Event):void{
var site:String;
siteLock.push("differencebuilder.com");
siteLock.push("differencegames.com");
siteLock.push("flashgamelicense.com");
siteLock.push("gimme5games.com");
siteLock.push("staging-dg");
var ba:ByteArray = new xmlFile();
difData = new XML(ba.readUTFBytes(ba.length));
mochiBots.A = difData.config[0].mochiA[0].@code[0].toString();
mochiBots.B = difData.config[0].mochiB[0].@code[0].toString();
mochiBots.C = difData.config[0].mochiC[0].@code[0].toString();
mochiBots.D = difData.config[0].mochiD[0].@code[0].toString();
mochiBots.E = difData.config[0].mochiE[0].@code[0].toString();
__options.music = 1;
__options.sound = 1;
__options.hints = 1;
var hostDomain:String = stage.loaderInfo.url.split("/")[2];
var locked:Boolean;
var hostBits:Array = hostDomain.split(".");
if (hostBits.length > 1){
host = ((hostBits[(hostBits.length - 2)] + ".") + hostBits[(hostBits.length - 1)]);
} else {
host = hostBits[0];
};
trace("Running on:", hostDomain, "Host:", host);
for each (site in siteLock) {
if ((((site == hostDomain)) || ((site == host)))){
locked = false;
};
};
if (locked){
MochiBot.track(this, mochiBots.E);
Alert.show("This game is not allowed to be played on this website!", "Site Locked");
} else {
MochiBot.track(this, mochiBots.A);
dGame.addEventListener("reset", resetGame);
addChild(dGame);
dGame.alpha = 0;
dGame.ini();
Tweener.addTween(dGame, {alpha:1, time:1});
};
var n:UIComponent = new UIComponent();
addChild(n);
kongregate = new KongregateAPI();
n.addChild(kongregate);
}
private function securityError(e:Event):void{
Alert.show("This game has failed game jacket security!", "Security Error Locked");
dGame.x = -2000;
}
}
}//package
Section 671
//DifferenceGamePlayer__embed__font_MaiandraBold_bold_normal_1656384707 (DifferenceGamePlayer__embed__font_MaiandraBold_bold_normal_1656384707)
package {
import mx.core.*;
public class DifferenceGamePlayer__embed__font_MaiandraBold_bold_normal_1656384707 extends FontAsset {
}
}//package
Section 672
//DifferenceGamePlayer__embed__font_Verdana_medium_normal_2067159803 (DifferenceGamePlayer__embed__font_Verdana_medium_normal_2067159803)
package {
import mx.core.*;
public class DifferenceGamePlayer__embed__font_Verdana_medium_normal_2067159803 extends FontAsset {
}
}//package
Section 673
//DifferenceGamePlayer_xmlFile (DifferenceGamePlayer_xmlFile)
package {
import mx.core.*;
public class DifferenceGamePlayer_xmlFile extends ByteArrayAsset {
}
}//package
Section 674
//en_US$containers_properties (en_US$containers_properties)
package {
import mx.resources.*;
public class en_US$containers_properties extends ResourceBundle {
public function en_US$containers_properties(){
super("en_US", "containers");
}
override protected function getContent():Object{
var _local1:Object = {noColumnsFound:"No ConstraintColumns found.", noRowsFound:"No ConstraintRows found.", rowNotFound:"ConstraintRow '{0}' not found.", columnNotFound:"ConstraintColumn '{0}' not found."};
return (_local1);
}
}
}//package
Section 675
//en_US$controls_properties (en_US$controls_properties)
package {
import mx.resources.*;
public class en_US$controls_properties extends ResourceBundle {
public function en_US$controls_properties(){
super("en_US", "controls");
}
override protected function getContent():Object{
var _local1:Object = {undefinedParameter:"CuePoint parameter undefined.", nullURL:"Null URL sent to VideoPlayer.load.", incorrectType:"Type must be 0, 1 or 2.", okLabel:"OK", noLabel:"No", wrongNumParams:"Num params must be number.", wrongDisabled:"Disabled must be number.", wrongTime:"Time must be number.", dayNamesShortest:"S,M,T,W,T,F,S", wrongType:"Type must be number.", firstDayOfWeek:"0", rootNotSMIL:"URL: '{0}' Root node not smil: '{1}'.", errorMessages:"Unable to make connection to server or to find FLV on server.,No matching cue point found.,Illegal cue point.,Invalid seek.,Invalid contentPath.,Invalid XML.,No bitrate match; must be no default FLV.,Cannot delete default VideoPlayer.", unexpectedEnd:"Unexpected end of cuePoint param string.", rootNotFound:"URL: '{0}' No root node found; if file is an flv, it must have a .flv extension.", errWrongContainer:"ERROR: The dataProvider of '{0}' must not contain objects of type flash.display.DisplayObject.", invalidCall:"Cannot call reconnect on an http connection.", cancelLabel:"Cancel", errWrongType:"ERROR: The dataProvider of '{0}' must be String, ViewStack, Array, or IList.", badArgs:"Bad args to _play.", missingRoot:"URL: '{0}' No root node found; if URL is for an FLV, it must have a .flv extension and take no parameters.", notLoadable:"Unable to load '{0}'.", wrongName:"Name cannot be undefined or null.", wrongTimeName:"Time must be number and/or name must not be undefined or null.", yesLabel:"Yes", undefinedArray:"CuePoint.array undefined.", missingProxy:"URL: '{0}' fpad xml requires proxy tag.", unknownInput:"Unknown inputType '{0}'.", missingAttributeSrc:"URL: '{0}' Attribute src is required in '{1}' tag.", yearSymbol:"", wrongIndex:"CuePoint.index must be number between -1 and cuePoint.array.length.", notImplemented:"'{0}' not implemented yet.", label:"LOADING %3%%", wrongFormat:"Unexpected cuePoint parameter format.", tagNotFound:"URL: '{0}' At least one video of ref tag is required.", unsupportedMode:"IMEMode '{0}' not supported.", cannotDisable:"Cannot disable actionscript cue points.", missingAttributes:"URL: '{0}' Tag '{1}' requires attributes id, width, and height. Width and height must be numbers greater than or equal to 0.", notfpad:"URL: '{0}' Root node not fpad."};
return (_local1);
}
}
}//package
Section 676
//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 677
//en_US$effects_properties (en_US$effects_properties)
package {
import mx.resources.*;
public class en_US$effects_properties extends ResourceBundle {
public function en_US$effects_properties(){
super("en_US", "effects");
}
override protected function getContent():Object{
var _local1:Object = {incorrectTrigger:"The Zoom effect can not be triggered by a moveEffect trigger.", incorrectSource:"Source property must be a Class or String."};
return (_local1);
}
}
}//package
Section 678
//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 679
//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 680
//HiScoreRow (HiScoreRow)
package {
public class HiScoreRow {
private var name:String;// = ""
private var score:Number;// = 0
private var levelId:Number;// = 0
public function HiScoreRow(){
levelId = 0;
name = "";
score = 0;
super();
}
public function getName():String{
return (this.name);
}
public function getLevelId():Number{
return (this.levelId);
}
public function toString():String{
return ((((((("[" + getLevelId()) + ",") + getName()) + ",") + getScore()) + "]"));
}
public function setName(_arg1:String):void{
this.name = _arg1;
}
public function setScore(_arg1:Number):void{
this.score = _arg1;
}
public function getScore():Number{
return (this.score);
}
public function setLevelId(_arg1:Number):void{
this.levelId = _arg1;
}
}
}//package
Section 681
//HiScores (HiScores)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.external.*;
public dynamic class HiScores extends MovieClip {
private var HS_SERVLET_URL:String;// = ""
private var fbUserExists:Boolean;
private var SKIN_ID:int;// = 0
private var KEY:String;// = "rocket"
private var HI_SCORE_URL:String;// = ""
private var NUM_SKINS:int;// = 2
private var SERVER_URL:String;// = ""
private var g5UserExists:Boolean;
private var autoEntryScreen:MovieClip;// = null
private var theSkin:MovieClip;// = null
private var SERVER_URLS:Array;
private var caller:Object;
public var movSkin0:MovieClip;
private var score:Number;
public var movSkin1:MovieClip;
private var g5User:Object;
private var lowIsBest:Boolean;
private var gameId:Number;
private var infoScreen:MovieClip;// = null
private var fbUser:Object;
private var levelId:Number;
private var msg1:String;
private var msg2:String;
private var entryScreen:MovieClip;// = null
private var gameCode:String;
private static var OP_HS_GET_DATA:Number = 1;
public static var HS_DATA_DELIM_COL:String = "/";
public static var G5HS_TOO_MANY_SCORES:Number = -2;
public static var HS_DATA_DELIM_ROW:String = ">";
public static var G5HS_SERVER_ERROR:Number = -1;
public static var G5HS_SUCCESS:Number = 1;
public function HiScores(){
SKIN_ID = 0;
NUM_SKINS = 2;
KEY = "rocket";
SERVER_URLS = new Array("http://www.gimme5games.com", "http://www.differencegames.com");
SERVER_URL = "";
HS_SERVLET_URL = "";
HI_SCORE_URL = "";
theSkin = null;
entryScreen = null;
autoEntryScreen = null;
infoScreen = null;
super();
this.visible = false;
setSkin(0);
}
public function setSkin(_arg1:Number):void{
this.SKIN_ID = _arg1;
SERVER_URL = SERVER_URLS[SKIN_ID];
HS_SERVLET_URL = (SERVER_URL + "/servlet/hiServlet");
HI_SCORE_URL = (SERVER_URL + "/index.jsp?id=");
}
public function submitHiScoreHandler(_arg1:Event):void{
var loader:URLLoader;
var resCode:Number;
var event = _arg1;
loader = URLLoader(event.target);
resCode = loader.data.res;
if (resCode == -1){
showInfoMessage("Could not store hi-score details. Click on back, generate a new security code and re-submit.", true);
} else {
if (resCode == 0){
showInfoMessage("Sorry, a better score already exists with that name.", false);
} else {
if (resCode == 1){
showInfoMessage("Congratulations! You made it into the\nhi-score table.", false);
try {
if (fbUserExists){
ExternalInterface.call("setFBHiScoresRefresh", true);
};
} catch(err:Error) {
};
};
};
};
}
public function enterAnotherName():void{
this.g5UserExists = false;
autoEntryScreen.visible = false;
showEntryScreen();
}
public function secCodeLoad():void{
var _local1:Loader;
var _local2:String;
_local1 = new Loader();
_local1.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, secCodeLoadError);
_local2 = ((HS_SERVLET_URL + "?type=genCode&cachebuster=") + new Date().getTime());
_local1.load(new URLRequest(_local2));
entryScreen["movCode"].addChild(_local1);
}
public function showInfoMessage(_arg1:String, _arg2:Boolean):void{
infoScreen["txtInfo"].text = _arg1;
infoScreen["btnBack"].visible = _arg2;
infoScreen["btnView"].visible = !(_arg2);
}
private function showEntryScreen():void{
entryScreen["txtMsg1"].text = msg1;
entryScreen["txtMsg2"].text = msg2;
entryScreen["txtName"].text = "";
entryScreen["txtCode"].text = "";
entryScreen.visible = true;
secCodeLoad();
}
public function secCodeLoadError(_arg1:IOErrorEvent):void{
entryScreen.visible = false;
infoScreen.visible = true;
showInfoMessage("Could not generate a security code. Click on back and try to refresh the code window.", true);
}
public function setDetails(_arg1:Number, _arg2:Number, _arg3:String, _arg4:Boolean, _arg5:Number, _arg6:String, _arg7:String):void{
var i:Number;
var gameId = _arg1;
var levelId = _arg2;
var gameCode = _arg3;
var lowIsBest = _arg4;
var score = _arg5;
var msg1 = _arg6;
var msg2 = _arg7;
try {
this.g5User = ExternalInterface.call("getG5User");
this.g5UserExists = ((g5User == null)) ? false : !(isNaN(this.g5User[0]));
if (!g5UserExists){
this.fbUser = ExternalInterface.call("getFBUser");
this.fbUserExists = ((fbUser == null)) ? false : !(isNaN(this.fbUser[0]));
};
} catch(err:Error) {
};
this.gameId = gameId;
this.levelId = levelId;
this.gameCode = gameCode;
this.lowIsBest = lowIsBest;
this.score = score;
this.msg1 = msg1;
this.msg2 = msg2;
i = 0;
while (i < NUM_SKINS) {
this[("movSkin" + i)].visible = false;
i = (i + 1);
};
theSkin = this[("movSkin" + SKIN_ID)];
theSkin.visible = true;
entryScreen = theSkin["movEntryScreen"];
autoEntryScreen = theSkin["movAutoEntryScreen"];
infoScreen = theSkin["movInfoScreen"];
entryScreen.visible = false;
autoEntryScreen.visible = false;
infoScreen.visible = false;
entryScreen["btnRefreshCode"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
entryScreen["btnSubmit"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
autoEntryScreen["btnSubmit"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
autoEntryScreen["btnEnterAnother"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
infoScreen["btnView"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
infoScreen["btnBack"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
if (((this.g5UserExists) || (this.fbUserExists))){
showAutoEntryScreen();
} else {
showEntryScreen();
};
this.visible = true;
}
public function getHiScoreData(_arg1:Object, _arg2:Number, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:Boolean):void{
var maxRecs:Number;
var vars:URLVariables;
var request:URLRequest;
var loader:URLLoader;
var caller = _arg1;
var gameId = _arg2;
var startPos = _arg3;
var endPos = _arg4;
var startLevel = _arg5;
var endLevel = _arg6;
var lowIsBest = _arg7;
this.caller = caller;
maxRecs = (((endPos + 1) - startPos) * ((endLevel + 1) - startLevel));
if (maxRecs <= 100){
vars = new URLVariables();
vars.op = OP_HS_GET_DATA;
vars.gameId = gameId;
vars.startPos = startPos;
vars.endPos = endPos;
vars.startLevel = startLevel;
vars.endLevel = endLevel;
vars.lowIsBest = lowIsBest;
request = new URLRequest(HS_SERVLET_URL);
loader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
request.data = vars;
request.method = URLRequestMethod.POST;
loader.addEventListener(Event.COMPLETE, function (_arg1:Event):void{
loadHandler(true, _arg1);
});
loader.addEventListener(IOErrorEvent.IO_ERROR, function (_arg1:Event):void{
loadHandler(false, _arg1);
});
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, function (_arg1:Event):void{
loadHandler(false, _arg1);
});
loader.load(request);
} else {
caller.getHiScoreData_Callback(G5HS_TOO_MANY_SCORES, null);
};
}
public function submitScore():void{
var _local1:Boolean;
var _local2:String;
var _local3:String;
var _local4:Number;
var _local5:Number;
var _local6:URLVariables;
var _local7:URLRequest;
var _local8:URLLoader;
entryScreen.visible = false;
autoEntryScreen.visible = false;
infoScreen.visible = true;
_local1 = true;
if (((!(this.g5UserExists)) && ((entryScreen["txtName"].text.length == 0)))){
showInfoMessage("Please enter your name.", true);
} else {
if (((!(this.g5UserExists)) && (!((entryScreen["txtCode"].text.length == 5))))){
showInfoMessage("Please enter all 5 letters of the security code.", true);
} else {
showInfoMessage("Submitting hi-score details to the server, please wait.", true);
infoScreen["btnBack"].visible = false;
_local1 = false;
};
};
if (!_local1){
_local2 = "save|";
if (this.g5UserExists){
_local2 = (_local2 + ((((((("----------|-----|" + score) + "|") + gameId) + "|") + levelId) + "|") + this.g5User[0]));
} else {
if (this.fbUserExists){
_local2 = (_local2 + ((((((("----------|-----|" + score) + "|") + gameId) + "|") + levelId) + "|-----|") + this.fbUser[0]));
} else {
_local2 = (_local2 + ((((((((entryScreen["txtName"].text + "|") + entryScreen["txtCode"].text) + "|") + score) + "|") + gameId) + "|") + levelId));
};
};
_local3 = "";
_local4 = 0;
_local5 = 0;
while (_local4 < _local2.length) {
if (_local5 >= KEY.length){
_local5 = 0;
};
_local3 = (_local3 + String.fromCharCode(((_local2.charCodeAt(_local4) ^ KEY.charCodeAt(_local5)) + 1)));
_local4++;
_local5++;
};
_local6 = new URLVariables();
_local6.ffdata = _local3;
_local6.lowIsBest = lowIsBest;
_local7 = new URLRequest(HS_SERVLET_URL);
_local8 = new URLLoader();
_local8.dataFormat = URLLoaderDataFormat.VARIABLES;
_local7.data = _local6;
_local7.method = URLRequestMethod.POST;
_local8.addEventListener(Event.COMPLETE, submitHiScoreHandler);
_local8.addEventListener(IOErrorEvent.IO_ERROR, submitHiScoreError);
_local8.load(_local7);
};
}
public function submitHiScoreError(_arg1:IOErrorEvent):void{
showInfoMessage("A serious problem was encountered with the server, please try again in a few minutes.", true);
}
public function loadHandler(_arg1:Boolean, _arg2:Event):void{
var _local3:URLLoader;
var _local4:URLVariables;
var _local5:Array;
var _local6:Array;
var _local7:Number;
var _local8:Array;
var _local9:HiScoreRow;
if (_arg1){
_local3 = URLLoader(_arg2.target);
_local4 = new URLVariables(_local3.data);
_local5 = new Array();
_local6 = _local3.data.res.split(HS_DATA_DELIM_ROW);
_local7 = 0;
while (_local7 < _local6.length) {
_local8 = _local6[_local7].split(HS_DATA_DELIM_COL);
if (_local8[1] != null){
_local9 = new HiScoreRow();
_local9.setLevelId(_local8[0]);
_local9.setName(_local8[1]);
_local9.setScore(_local8[2]);
_local5.push(_local9);
};
_local7++;
};
caller.getHiScoreData_Callback(G5HS_SUCCESS, _local5);
} else {
caller.getHiScoreData_Callback(G5HS_SERVER_ERROR, null);
};
}
public function onButtonPress(_arg1:MouseEvent):void{
switch (_arg1.target.name){
case "btnRefreshCode":
secCodeLoad();
break;
case "btnSubmit":
submitScore();
break;
case "btnEnterAnother":
enterAnotherName();
break;
case "btnView":
viewScore();
break;
case "btnBack":
back();
break;
};
}
private function showAutoEntryScreen():void{
autoEntryScreen["txtMsg1"].text = msg1;
autoEntryScreen["txtMsg2"].text = msg2;
autoEntryScreen["txtName"].text = (g5UserExists) ? g5User[1] : fbUser[1];
autoEntryScreen["btnEnterAnother"].visible = g5UserExists;
autoEntryScreen.visible = true;
}
public function viewScore():void{
var _local1:URLRequest;
_local1 = null;
if (this.g5UserExists){
_local1 = new URLRequest(((((((((HI_SCORE_URL + gameCode) + "_hs") + "&userId=") + this.g5User[0]) + "&levelId=") + levelId) + "&cachebuster=") + new Date().getTime()));
} else {
_local1 = new URLRequest(((((((((HI_SCORE_URL + gameCode) + "_hs") + "&name=") + entryScreen["txtName"].text) + "&levelId=") + levelId) + "&cachebuster=") + new Date().getTime()));
};
navigateToURL(_local1, "_blank");
}
public function back():void{
entryScreen.visible = true;
infoScreen.visible = false;
}
}
}//package
Section 682
//MochiBot (MochiBot)
package {
import flash.display.*;
import mx.core.*;
import flash.system.*;
import flash.net.*;
public dynamic class MochiBot extends UIComponent {
public function MochiBot(){
super();
}
public static function track(parent:Sprite, tag:String):MochiBot{
if (Security.sandboxType == "localWithFile"){
return (null);
};
var self:MochiBot = new (MochiBot);
parent.addChild(self);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
var server:String = "http://core.mochibot.com/my/core.swf";
var lv:URLVariables = new URLVariables();
lv["sb"] = Security.sandboxType;
lv["v"] = Capabilities.version;
lv["swfid"] = tag;
lv["mv"] = "8";
lv["fv"] = "9";
var url:String = self.root.loaderInfo.loaderURL;
if (url.indexOf("http") == 0){
lv["url"] = url;
} else {
lv["url"] = "local";
};
var req:URLRequest = new URLRequest(server);
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
var loader:Loader = new Loader();
self.addChild(loader);
loader.load(req);
return (null);
}
}
}//package