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

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

fxctplayer.swf

This is the info page for
Flash #161199

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


ActionScript [AS3]
Section 1
//AccImpl (mx.accessibility.AccImpl) package mx.accessibility { import mx.core.*; import flash.events.*; import flash.accessibility.*; public class AccImpl extends AccessibilityImplementation { protected var master:UIComponent; protected var role:uint; private static const STATE_SYSTEM_NORMAL:uint = 0; private static const STATE_SYSTEM_UNAVAILABLE:uint = 1; private static const STATE_SYSTEM_FOCUSABLE:uint = 0x100000; private static const STATE_SYSTEM_FOCUSED:uint = 4; private static const EVENT_OBJECT_NAMECHANGE:uint = 32780; mx_internal static const VERSION:String = "3.0.0.0"; public function AccImpl(master:UIComponent){ var n:int; var i:int; super(); this.master = master; stub = false; master.accessibilityProperties = new AccessibilityProperties(); var events:Array = eventsToHandle; if (events){ n = events.length; i = 0; while (i < n) { master.addEventListener(events[i], eventHandler); i++; }; }; } protected function eventHandler(event:Event):void{ switch (event.type){ case "errorStringChanged": Accessibility.sendEvent(master, 0, EVENT_OBJECT_NAMECHANGE); Accessibility.updateProperties(); break; case "toolTipChanged": Accessibility.sendEvent(master, 0, EVENT_OBJECT_NAMECHANGE); Accessibility.updateProperties(); break; }; } protected function getName(childID:uint):String{ return (null); } private function getStatusName():String{ var statusName:String = ""; if (master.toolTip){ statusName = (statusName + (" " + master.toolTip)); }; if ((((master is UIComponent)) && (UIComponent(master).errorString))){ statusName = (statusName + (" " + UIComponent(master).errorString)); }; return (statusName); } override public function get_accName(childID:uint):String{ var accName:String = UIComponentAccImpl.getFormName(master); if ((((((((childID == 0)) && (master.accessibilityProperties))) && (master.accessibilityProperties.name))) && (!((master.accessibilityProperties.name == ""))))){ accName = (accName + (master.accessibilityProperties.name + " ")); }; accName = (accName + (getName(childID) + getStatusName())); return ((((!((accName == null))) && (!((accName == ""))))) ? accName : null); } protected function get eventsToHandle():Array{ return (["errorStringChanged", "toolTipChanged"]); } protected function getState(childID:uint):uint{ var accState:uint = STATE_SYSTEM_NORMAL; if (!UIComponent(master).enabled){ accState = (accState | STATE_SYSTEM_UNAVAILABLE); } else { accState = (accState | STATE_SYSTEM_FOCUSABLE); if (UIComponent(master) == UIComponent(master).getFocus()){ accState = (accState | STATE_SYSTEM_FOCUSED); }; }; return (accState); } override public function get_accRole(childID:uint):uint{ return (role); } mx_internal static function createAccessibilityImplementation(component:UIComponent):void{ } public static function enableAccessibility():void{ } } }//package mx.accessibility
Section 2
//ButtonAccImpl (mx.accessibility.ButtonAccImpl) package mx.accessibility { import mx.core.*; import flash.events.*; import mx.controls.*; import flash.accessibility.*; import flash.ui.*; public class ButtonAccImpl extends AccImpl { private static const EVENT_OBJECT_STATECHANGE:uint = 32778; private static const STATE_SYSTEM_PRESSED:uint = 8; private static const EVENT_OBJECT_NAMECHANGE:uint = 32780; mx_internal static const VERSION:String = "3.0.0.0"; private static var accessibilityHooked:Boolean = hookAccessibility(); public function ButtonAccImpl(master:UIComponent){ super(master); role = 43; } override protected function eventHandler(event:Event):void{ switch (event.type){ case "click": Accessibility.sendEvent(master, 0, EVENT_OBJECT_STATECHANGE); Accessibility.updateProperties(); break; case "labelChanged": Accessibility.sendEvent(master, 0, EVENT_OBJECT_NAMECHANGE); Accessibility.updateProperties(); break; }; } override protected function getName(childID:uint):String{ var label:String = Button(master).label; return ((((!((label == null))) && (!((label == ""))))) ? label : ""); } override public function get_accState(childID:uint):uint{ var accState:uint = getState(childID); if (Button(master).selected){ accState = (accState | STATE_SYSTEM_PRESSED); }; return (accState); } override public function accDoDefaultAction(childID:uint):void{ var event:KeyboardEvent; if (master.enabled){ event = new KeyboardEvent(KeyboardEvent.KEY_DOWN); event.keyCode = Keyboard.SPACE; master.dispatchEvent(event); event = new KeyboardEvent(KeyboardEvent.KEY_UP); event.keyCode = Keyboard.SPACE; master.dispatchEvent(event); }; } override protected function get eventsToHandle():Array{ return (super.eventsToHandle.concat(["click", "labelChanged"])); } override public function get_accDefaultAction(childID:uint):String{ return ("Press"); } mx_internal static function createAccessibilityImplementation(component:UIComponent):void{ component.accessibilityImplementation = new ButtonAccImpl(component); } private static function hookAccessibility():Boolean{ Button.createAccessibilityImplementation = createAccessibilityImplementation; return (true); } public static function enableAccessibility():void{ } } }//package mx.accessibility
Section 3
//PanelAccImpl (mx.accessibility.PanelAccImpl) package mx.accessibility { import mx.core.*; import mx.containers.*; public class PanelAccImpl extends AccImpl { private static const ROLE_SYSTEM_TITLEBAR:uint = 1; private static const ROLE_SYSTEM_DIALOG:uint = 18; private static const STATE_SYSTEM_FOCUSED:uint = 4; mx_internal static const VERSION:String = "3.0.0.0"; private static var accessibilityHooked:Boolean = hookAccessibility(); public function PanelAccImpl(master:UIComponent){ super(master); role = 9; } override public function getChildIDArray():Array{ var childIDs:Array = []; var i:int; while (i < 2) { childIDs[i] = (i + 1); i++; }; return (childIDs); } override public function get_accState(childID:uint):uint{ var accState:uint = getState(childID); switch (childID){ case 1: break; case 2: accState = (accState | STATE_SYSTEM_FOCUSED); break; default: break; }; return (accState); } override protected function getName(childID:uint):String{ var name:String = Panel(master).title; switch (childID){ case 1: name = ""; break; case 2: name = ""; break; default: name = ((Panel(master).title + " ") + Panel(master).className); break; }; return (name); } override public function accLocation(childID:uint){ var location:Object = master; switch (childID){ case 1: location = Panel(master).getTitleBar(); break; case 2: location = Panel(master).contentPane; break; default: break; }; return (location); } override public function get_accRole(childID:uint):uint{ var accRole:uint = role; switch (childID){ case 1: accRole = ROLE_SYSTEM_TITLEBAR; break; case 2: accRole = ROLE_SYSTEM_DIALOG; break; default: accRole = role; break; }; return (accRole); } private static function hookAccessibility():Boolean{ Panel.createAccessibilityImplementation = createAccessibilityImplementation; return (true); } public static function enableAccessibility():void{ } mx_internal static function createAccessibilityImplementation(component:UIComponent):void{ Panel(component).getTitleBar().accessibilityImplementation = new PanelAccImpl(component); } } }//package mx.accessibility
Section 4
//UIComponentAccImpl (mx.accessibility.UIComponentAccImpl) package mx.accessibility { import flash.display.*; import mx.core.*; import flash.events.*; import mx.controls.*; import mx.controls.scrollClasses.*; import flash.accessibility.*; import mx.containers.*; public class UIComponentAccImpl extends AccessibilityProperties { protected var master:UIComponent; private var oldErrorString:String; private var oldToolTip:String; mx_internal static const VERSION:String = "3.0.0.0"; private static var accessibilityHooked:Boolean = hookAccessibility(); public function UIComponentAccImpl(component:UIComponent){ var formName:String; super(); master = component; if (component.accessibilityProperties){ silent = component.accessibilityProperties.silent; forceSimple = component.accessibilityProperties.forceSimple; noAutoLabeling = component.accessibilityProperties.noAutoLabeling; if (component.accessibilityProperties.name){ name = component.accessibilityProperties.name; }; if (component.accessibilityProperties.description){ description = component.accessibilityProperties.description; }; if (component.accessibilityProperties.shortcut){ shortcut = component.accessibilityProperties.shortcut; }; }; if ((master is ScrollBar)){ silent = true; } else { if ((master is FormItemLabel)){ name = getFormName(master); silent = true; } else { formName = getFormName(master); if (((formName) && (!((formName.length == 0))))){ name = (formName + name); }; if (((master.toolTip) && (!((master.toolTip.length == 0))))){ oldToolTip = (" " + master.toolTip); name = (name + oldToolTip); }; if (((master.errorString) && (!((master.errorString.length == 0))))){ oldErrorString = (" " + master.errorString); name = (name + oldErrorString); }; master.addEventListener("toolTipChanged", eventHandler); master.addEventListener("errorStringChanged", eventHandler); }; }; } protected function eventHandler(event:Event):void{ var pos:int; switch (event.type){ case "errorStringChanged": if (((((name) && (!((name.length == 0))))) && (oldErrorString))){ pos = name.indexOf(oldErrorString); if (pos != -1){ name = (name.substring(0, pos) + name.substring((pos + oldErrorString.length))); }; oldErrorString = null; }; if (((master.errorString) && (!((master.errorString.length == 0))))){ if (!name){ name = ""; }; oldErrorString = (" " + master.errorString); name = (name + oldErrorString); }; Accessibility.updateProperties(); case "toolTipChanged": if (((((name) && (!((name.length == 0))))) && (oldToolTip))){ pos = name.indexOf(oldToolTip); if (pos != -1){ name = (name.substring(0, pos) + name.substring((pos + oldToolTip.length))); }; oldToolTip = null; }; if (((master.toolTip) && (!((master.toolTip.length == 0))))){ if (!name){ name = ""; }; oldToolTip = (" " + master.toolTip); name = (name + oldToolTip); }; Accessibility.updateProperties(); }; } private static function updateFormItemString(formItem:FormItem):String{ var itemLabel:Label; var formItemIndex:int; var i:int; var child:UIComponent; var formName:String = ""; itemLabel = formItem.itemLabel; var accProp:AccessibilityProperties = (itemLabel) ? itemLabel.accessibilityProperties : null; if (((accProp) && (accProp.silent))){ return (accProp.name); }; var form:UIComponent = UIComponent(formItem.parent); if ((form is Form)){ formItemIndex = form.getChildIndex(formItem); i = formItemIndex; while (i >= 0) { child = UIComponent(form.getChildAt(i)); if ((child is FormHeading)){ formName = (FormHeading(child).label + " "); break; }; i--; }; }; if (formItem.required){ formName = (formName + "Required Field "); }; if (formItem.label != ""){ formName = (formName + (formItem.label + " ")); }; if (((accProp) && (!(accProp.silent)))){ accProp.silent = true; accProp.name = formName; }; return (formName); } mx_internal static function createAccessibilityImplementation(component:UIComponent):void{ component.accessibilityProperties = new UIComponentAccImpl(component); } public static function getFormName(component:UIComponent):String{ var formName:String = ""; if ((component is Container)){ return (formName); }; var par:DisplayObjectContainer = component.parent; while (((((((par) && (!((par is FormItem))))) && (!((par is Application))))) && (!((par == component.root))))) { par = par.parent; }; if (((par) && ((par is FormItem)))){ formName = updateFormItemString(FormItem(par)); }; return (formName); } public static function enableAccessibility():void{ } private static function hookAccessibility():Boolean{ UIComponent.createAccessibilityImplementation = createAccessibilityImplementation; return (true); } } }//package mx.accessibility
Section 5
//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(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\automation;IAutomationObject.as:Object):void; function get automationValue():Array; function get numAutomationChildren():int; function set showInAutomationHierarchy(E:\dev\3.0.x\frameworks\projects\framework\src;mx\automation;IAutomationObject.as:Boolean):void; } }//package mx.automation
Section 6
//BindabilityInfo (mx.binding.BindabilityInfo) package mx.binding { import mx.events.*; public class BindabilityInfo { private var classChangeEvents:Object; private var typeDescription:XML; private var childChangeEvents:Object; public static const METHOD:String = "method"; public static const ACCESSOR:String = "accessor"; public static const CHANGE_EVENT:String = "ChangeEvent"; public static const NON_COMMITTING_CHANGE_EVENT:String = "NonCommittingChangeEvent"; public static const BINDABLE:String = "Bindable"; mx_internal static const VERSION:String = "3.0.0.0"; public static const MANAGED:String = "Managed"; public function BindabilityInfo(typeDescription:XML){ childChangeEvents = {}; super(); this.typeDescription = typeDescription; } private function addChangeEvents(metadata:XMLList, eventListObj:Object, isCommit:Boolean):void{ var md:XML; var arg:XMLList; var eventName:String; for each (md in metadata) { arg = md.arg; if (arg.length() > 0){ eventName = arg[0].@value; eventListObj[eventName] = isCommit; } else { trace((("warning: unconverted Bindable metadata in class '" + typeDescription.@name) + "'")); }; }; } private function getClassChangeEvents():Object{ if (!classChangeEvents){ classChangeEvents = {}; addBindabilityEvents(typeDescription.metadata, classChangeEvents); if (typeDescription.metadata.(@name == MANAGED).length() > 0){ classChangeEvents[PropertyChangeEvent.PROPERTY_CHANGE] = true; }; }; return (classChangeEvents); } private function addBindabilityEvents(metadata:XMLList, eventListObj:Object):void{ var metadata = metadata; var eventListObj = eventListObj; addChangeEvents(metadata.(@name == BINDABLE), eventListObj, true); addChangeEvents(metadata.(@name == CHANGE_EVENT), eventListObj, true); addChangeEvents(metadata.(@name == NON_COMMITTING_CHANGE_EVENT), eventListObj, false); } private function copyProps(from:Object, to:Object):Object{ var propName:String; for (propName in from) { to[propName] = from[propName]; }; return (to); } public function getChangeEvents(childName:String):Object{ var childDesc:XMLList; var numChildren:int; var childName = childName; var changeEvents:Object = childChangeEvents[childName]; if (!changeEvents){ changeEvents = copyProps(getClassChangeEvents(), {}); childDesc = (typeDescription.accessor.(@name == childName) + typeDescription.method.(@name == childName)); numChildren = childDesc.length(); if (numChildren == 0){ if (!typeDescription.@dynamic){ trace((((("warning: no describeType entry for '" + childName) + "' on non-dynamic type '") + typeDescription.@name) + "'")); }; } else { if (numChildren > 1){ trace(((((("warning: multiple describeType entries for '" + childName) + "' on type '") + typeDescription.@name) + "':\n") + childDesc)); }; addBindabilityEvents(childDesc.metadata, changeEvents); }; childChangeEvents[childName] = changeEvents; }; return (changeEvents); } } }//package mx.binding
Section 7
//Binding (mx.binding.Binding) package mx.binding { 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 isExecuting:Boolean; mx_internal var isHandlingEvent:Boolean; public var twoWayCounterpart:Binding; mx_internal var isEnabled:Boolean; public var uiComponentWatcher:int; private var lastValue:Object; private var wrappedFunctionSuccessful:Boolean; mx_internal static const VERSION:String = "3.0.0.0"; 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); } 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); } 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); } 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; }; } public function execute(o:Object=null):void{ var o = o; if (!isEnabled){ return; }; if (((isExecuting) || (((twoWayCounterpart) && (twoWayCounterpart.isExecuting))))){ hasHadValue = true; return; }; try { try { isExecuting = true; wrapFunctionCall(this, innerExecute, o); } finally { }; } finally { isExecuting = false; }; } 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 8
//BindingManager (mx.binding.BindingManager) package mx.binding { public class BindingManager { mx_internal static const VERSION:String = "3.0.0.0"; 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 9
//EvalBindingResponder (mx.binding.EvalBindingResponder) package mx.binding { import mx.rpc.*; public class EvalBindingResponder implements IResponder { private var binding:Binding; private var object:Object; mx_internal static const VERSION:String = "3.0.0.0"; 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 10
//IBindingClient (mx.binding.IBindingClient) package mx.binding { public interface IBindingClient { } }//package mx.binding
Section 11
//IWatcherSetupUtil (mx.binding.IWatcherSetupUtil) package mx.binding { public interface IWatcherSetupUtil { function setup(_arg1:Object, _arg2:Function, _arg3:Array, _arg4:Array):void; } }//package mx.binding
Section 12
//PropertyWatcher (mx.binding.PropertyWatcher) package mx.binding { import mx.core.*; import flash.events.*; import mx.events.*; import flash.utils.*; import mx.utils.*; public class PropertyWatcher extends Watcher { protected var propertyGetter:Function; private var parentObj:Object; protected var events:Object; private var useRTTI:Boolean; private var _propertyName:String; mx_internal static const VERSION:String = "3.0.0.0"; public function PropertyWatcher(propertyName:String, events:Object, listeners:Array, propertyGetter:Function=null){ super(listeners); _propertyName = propertyName; this.events = events; this.propertyGetter = propertyGetter; useRTTI = !(events); } private function eventNamesToString():String{ var ev:String; var s:String = " "; for (ev in events) { s = (s + (ev + " ")); }; return (s); } override public function updateParent(parent:Object):void{ var eventType:String; var info:BindabilityInfo; if (((parentObj) && ((parentObj is IEventDispatcher)))){ for (eventType in events) { parentObj.removeEventListener(eventType, eventHandler); }; }; if ((parent is Watcher)){ parentObj = parent.value; } else { parentObj = parent; }; if (parentObj){ if (useRTTI){ events = {}; if ((parentObj is IEventDispatcher)){ info = DescribeTypeCache.describeType(parentObj).bindabilityInfo; events = info.getChangeEvents(_propertyName); if (objectIsEmpty(events)){ trace((((("warning: unable to bind to property '" + _propertyName) + "' on class '") + getQualifiedClassName(parentObj)) + "'")); } else { addParentEventListeners(); }; } else { trace((((("warning: unable to bind to property '" + _propertyName) + "' on class '") + getQualifiedClassName(parentObj)) + "' (class is not an IEventDispatcher)")); }; } else { if ((parentObj is IEventDispatcher)){ addParentEventListeners(); }; }; }; wrapUpdate(updateProperty); } private function objectIsEmpty(o:Object):Boolean{ var p:String; for (p in o) { return (false); }; return (true); } override protected function shallowClone():Watcher{ var clone:PropertyWatcher = new PropertyWatcher(_propertyName, events, listeners, propertyGetter); return (clone); } private function traceInfo():String{ return ((((((("Watcher(" + getQualifiedClassName(parentObj)) + ".") + _propertyName) + "): events = [") + eventNamesToString()) + (useRTTI) ? "] (RTTI)" : "]")); } public function get propertyName():String{ return (_propertyName); } private function addParentEventListeners():void{ var eventType:String; for (eventType in events) { if (eventType != "__NoChangeEvent__"){ parentObj.addEventListener(eventType, eventHandler, false, EventPriority.BINDING, true); }; }; } private function updateProperty():void{ if (parentObj){ if (_propertyName == "this"){ value = parentObj; } else { if (propertyGetter != null){ value = propertyGetter.apply(parentObj, [_propertyName]); } else { value = parentObj[_propertyName]; }; }; } else { value = null; }; updateChildren(); } public function eventHandler(event:Event):void{ var propName:Object; if ((event is PropertyChangeEvent)){ propName = PropertyChangeEvent(event).property; if (propName != _propertyName){ return; }; }; wrapUpdate(updateProperty); notifyListeners(events[event.type]); } } }//package mx.binding
Section 13
//Watcher (mx.binding.Watcher) package mx.binding { public class Watcher { protected var children:Array; public var value:Object; protected var cloneIndex:int; protected var listeners:Array; mx_internal static const VERSION:String = "3.0.0.0"; public function Watcher(listeners:Array=null){ super(); this.listeners = listeners; } public function removeChildren(startingIndex:int):void{ children.splice(startingIndex); } public function updateChildren():void{ var n:int; var i:int; if (children){ n = children.length; i = 0; while (i < n) { children[i].updateParent(this); i++; }; }; } protected function shallowClone():Watcher{ return (new Watcher()); } protected function wrapUpdate(wrappedFunction:Function):void{ var wrappedFunction = wrappedFunction; wrappedFunction.apply(this); //unresolved jump var _slot1 = itemPendingError; value = null; //unresolved jump var _slot1 = rangeError; value = null; //unresolved jump var _slot1 = error; if (((((((((!((_slot1.errorID == 1006))) && (!((_slot1.errorID == 1009))))) && (!((_slot1.errorID == 1010))))) && (!((_slot1.errorID == 1055))))) && (!((_slot1.errorID == 1069))))){ throw (_slot1); }; } private function valueChanged(oldval:Object):Boolean{ if ((((oldval == null)) && ((value == null)))){ return (false); }; var valType = typeof(value); if (valType == "string"){ if ((((oldval == null)) && ((value == "")))){ return (false); }; return (!((oldval == value))); }; if (valType == "number"){ if ((((oldval == null)) && ((value == 0)))){ return (false); }; return (!((oldval == value))); }; if (valType == "boolean"){ if ((((oldval == null)) && ((value == false)))){ return (false); }; return (!((oldval == value))); }; return (true); } public function notifyListeners(commitEvent:Boolean):void{ var n:int; var i:int; if (listeners){ n = listeners.length; i = 0; while (i < n) { listeners[i].watcherFired(commitEvent, cloneIndex); i++; }; }; } protected function deepClone(index:int):Watcher{ var n:int; var i:int; var clonedChild:Watcher; var w:Watcher = shallowClone(); w.cloneIndex = index; if (listeners){ w.listeners = listeners.concat(); }; if (children){ n = children.length; i = 0; while (i < n) { clonedChild = children[i].deepClone(index); w.addChild(clonedChild); i++; }; }; return (w); } public function updateParent(parent:Object):void{ } public function addChild(child:Watcher):void{ if (!children){ children = [child]; } else { children.push(child); }; child.updateParent(this); } } }//package mx.binding
Section 14
//ItemPendingError (mx.collections.errors.ItemPendingError) package mx.collections.errors { import mx.rpc.*; public class ItemPendingError extends Error { private var _responders:Array; mx_internal static const VERSION:String = "3.0.0.0"; 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 15
//ConstraintError (mx.containers.errors.ConstraintError) package mx.containers.errors { public class ConstraintError extends Error { mx_internal static const VERSION:String = "3.0.0.0"; public function ConstraintError(message:String){ super(message); } } }//package mx.containers.errors
Section 16
//ApplicationLayout (mx.containers.utilityClasses.ApplicationLayout) package mx.containers.utilityClasses { import mx.core.*; public class ApplicationLayout extends BoxLayout { mx_internal static const VERSION:String = "3.0.0.0"; 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 17
//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.0.0.0"; 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 18
//CanvasLayout (mx.containers.utilityClasses.CanvasLayout) package mx.containers.utilityClasses { import flash.display.*; import flash.geom.*; import mx.core.*; 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.0.0.0"; 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 19
//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.0.0.0"; 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 20
//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.0.0.0"; 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 21
//Flex (mx.containers.utilityClasses.Flex) package mx.containers.utilityClasses { import mx.core.*; public class Flex { mx_internal static const VERSION:String = "3.0.0.0"; 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 22
//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.0.0.0"; public function FlexChildInfo(){ super(); } } }//package mx.containers.utilityClasses
Section 23
//IConstraintLayout (mx.containers.utilityClasses.IConstraintLayout) package mx.containers.utilityClasses { public interface IConstraintLayout { function get constraintColumns():Array; function set constraintRows(E:\dev\3.0.x\frameworks\projects\framework\src;mx\containers\utilityClasses;IConstraintLayout.as:Array):void; function get constraintRows():Array; function set constraintColumns(E:\dev\3.0.x\frameworks\projects\framework\src;mx\containers\utilityClasses;IConstraintLayout.as:Array):void; } }//package mx.containers.utilityClasses
Section 24
//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.0.0.0"; 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 25
//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.0.0.0"; 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 26
//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.0.0.0"; public function BoxDirection(){ super(); } } }//package mx.containers
Section 27
//ControlBar (mx.containers.ControlBar) package mx.containers { import mx.core.*; public class ControlBar extends Box { mx_internal static const VERSION:String = "3.0.0.0"; 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 28
//Form (mx.containers.Form) package mx.containers { import flash.display.*; import mx.core.*; import mx.styles.*; import mx.controls.*; import mx.containers.utilityClasses.*; public class Form extends Container { mx_internal var layoutObject:BoxLayout; private var measuredLabelWidth:Number; mx_internal static const VERSION:String = "3.0.0.0"; private static var classInitialized:Boolean = false; public function Form(){ layoutObject = new BoxLayout(); super(); if (!classInitialized){ initializeClass(); classInitialized = true; }; showInAutomationHierarchy = true; mx_internal::layoutObject.target = this; mx_internal::layoutObject.direction = BoxDirection.VERTICAL; } override public function addChild(child:DisplayObject):DisplayObject{ invalidateLabelWidth(); return (super.addChild(child)); } override public function styleChanged(styleProp:String):void{ if (((((!(styleProp)) || ((styleProp == "styleName")))) || (StyleManager.isSizeInvalidatingStyle(styleProp)))){ invalidateLabelWidth(); }; super.styleChanged(styleProp); } override public function removeChildAt(index:int):DisplayObject{ invalidateLabelWidth(); return (super.removeChildAt(index)); } function calculateLabelWidth():Number{ var child:DisplayObject; if (!isNaN(measuredLabelWidth)){ return (measuredLabelWidth); }; var labelWidth:Number = 0; var labelWidthSet:Boolean; var n:int = numChildren; var i:int; while (i < n) { child = getChildAt(i); if ((child is FormItem)){ labelWidth = Math.max(labelWidth, FormItem(child).getPreferredLabelWidth()); labelWidthSet = true; }; i++; }; if (labelWidthSet){ measuredLabelWidth = labelWidth; }; return (labelWidth); } function invalidateLabelWidth():void{ var n:int; var i:int; var child:IUIComponent; if (((!(isNaN(measuredLabelWidth))) && (initialized))){ measuredLabelWidth = NaN; n = numChildren; i = 0; while (i < n) { child = IUIComponent(getChildAt(i)); if ((child is IInvalidating)){ IInvalidating(child).invalidateSize(); }; i++; }; }; } public function get maxLabelWidth():Number{ var child:DisplayObject; var itemLabel:Label; var n:int = numChildren; var i:int; while (i < n) { child = getChildAt(i); if ((child is FormItem)){ itemLabel = FormItem(child).itemLabel; if (itemLabel){ return (itemLabel.width); }; }; i++; }; return (0); } override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{ super.updateDisplayList(unscaledWidth, unscaledHeight); mx_internal::layoutObject.updateDisplayList(unscaledWidth, unscaledHeight); } override public function addChildAt(child:DisplayObject, index:int):DisplayObject{ invalidateLabelWidth(); return (super.addChildAt(child, index)); } override protected function measure():void{ super.measure(); mx_internal::layoutObject.measure(); calculateLabelWidth(); } override public function removeChild(child:DisplayObject):DisplayObject{ invalidateLabelWidth(); return (super.removeChild(child)); } private static function initializeClass():void{ StyleManager.registerInheritingStyle("labelWidth"); StyleManager.registerSizeInvalidatingStyle("labelWidth"); StyleManager.registerInheritingStyle("indicatorGap"); StyleManager.registerSizeInvalidatingStyle("indicatorGap"); } } }//package mx.containers
Section 29
//FormHeading (mx.containers.FormHeading) package mx.containers { import mx.core.*; import flash.events.*; import mx.controls.*; public class FormHeading extends UIComponent { private var labelObj:Label; private var _label:String;// = "" mx_internal static const VERSION:String = "3.0.0.0"; public function FormHeading(){ super(); } private function getLabelWidth():Number{ var labelWidth:Number = getStyle("labelWidth"); if (labelWidth == 0){ labelWidth = NaN; }; if (((isNaN(labelWidth)) && ((parent is Form)))){ labelWidth = Form(parent).calculateLabelWidth(); }; if (isNaN(labelWidth)){ labelWidth = 0; }; return (labelWidth); } override protected function commitProperties():void{ super.commitProperties(); createLabel(); } public function get label():String{ return (_label); } override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{ var indicatorGap:Number; var paddingTop:Number; var labelWidth:Number; var vm:EdgeMetrics; super.updateDisplayList(unscaledWidth, unscaledHeight); if (labelObj){ indicatorGap = getStyle("indicatorGap"); paddingTop = getStyle("paddingTop"); labelWidth = width; labelObj.move((getLabelWidth() + indicatorGap), paddingTop); if (((parent) && ((parent is Form)))){ vm = Form(parent).viewMetricsAndPadding; labelWidth = (parent.width - (((getLabelWidth() + indicatorGap) + vm.left) + vm.right)); }; labelObj.setActualSize(labelWidth, height); }; } public function set label(value:String):void{ _label = value; invalidateProperties(); dispatchEvent(new Event("labelChanged")); } override protected function measure():void{ super.measure(); var preferredWidth:Number = 0; var preferredHeight:Number = getStyle("paddingTop"); if (labelObj){ if (isNaN(labelObj.measuredWidth)){ labelObj.validateSize(); }; preferredWidth = labelObj.measuredWidth; preferredHeight = (preferredHeight + labelObj.measuredHeight); }; preferredWidth = (preferredWidth + (getLabelWidth() + getStyle("indicatorGap"))); measuredMinWidth = preferredWidth; measuredMinHeight = preferredHeight; measuredWidth = preferredWidth; measuredHeight = preferredHeight; } private function createLabel():void{ if (_label.length > 0){ if (!labelObj){ labelObj = new Label(); labelObj.styleName = this; addChild(labelObj); }; if (labelObj.text != _label){ labelObj.text = _label; labelObj.validateSize(); invalidateSize(); invalidateDisplayList(); }; }; if ((((_label.length == 0)) && (labelObj))){ removeChild(labelObj); labelObj = null; invalidateSize(); invalidateDisplayList(); }; } } }//package mx.containers
Section 30
//FormItem (mx.containers.FormItem) package mx.containers { import flash.display.*; import mx.core.*; import flash.events.*; import mx.styles.*; import mx.controls.*; import mx.containers.utilityClasses.*; public class FormItem extends Container { private var _direction:String;// = "vertical" private var guessedNumColumns:int; private var _required:Boolean;// = false mx_internal var verticalLayoutObject:BoxLayout; private var labelChanged:Boolean;// = false private var guessedRowWidth:Number; private var labelObj:Label; private var numberOfGuesses:int;// = 0 private var indicatorObj:IFlexDisplayObject; private var _label:String;// = "" mx_internal static const VERSION:String = "3.0.0.0"; public function FormItem(){ verticalLayoutObject = new BoxLayout(); super(); _horizontalScrollPolicy = ScrollPolicy.OFF; _verticalScrollPolicy = ScrollPolicy.OFF; verticalLayoutObject.target = this; verticalLayoutObject.direction = BoxDirection.VERTICAL; } override public function styleChanged(styleProp:String):void{ var labelStyleName:String; var styleDecl:CSSStyleDeclaration; super.styleChanged(styleProp); var allStyles:Boolean = (((styleProp == null)) || ((styleProp == "styleName"))); if (((allStyles) || ((styleProp == "labelStyleName")))){ if (labelObj){ labelStyleName = getStyle("labelStyleName"); if (labelStyleName){ styleDecl = StyleManager.getStyleDeclaration(("." + labelStyleName)); if (styleDecl){ labelObj.styleDeclaration = styleDecl; labelObj.regenerateStyleCache(true); }; }; }; }; } mx_internal function getHorizontalAlignValue():Number{ var horizontalAlign:String = getStyle("horizontalAlign"); if (horizontalAlign == "center"){ return (0.5); }; if (horizontalAlign == "right"){ return (1); }; return (0); } private function calcNumColumns(w:Number):int{ var child:IUIComponent; var childWidth:Number; var totalWidth:Number = 0; var maxChildWidth:Number = 0; var horizontalGap:Number = getStyle("horizontalGap"); if (direction != FormItemDirection.HORIZONTAL){ return (1); }; var numChildrenWithOwnSpace:Number = numChildren; var i:int; while (i < numChildren) { child = IUIComponent(getChildAt(i)); if (!child.includeInLayout){ numChildrenWithOwnSpace--; } else { childWidth = child.getExplicitOrMeasuredWidth(); maxChildWidth = Math.max(maxChildWidth, childWidth); totalWidth = (totalWidth + childWidth); if (i > 0){ totalWidth = (totalWidth + horizontalGap); }; }; i++; }; if (((isNaN(w)) || ((totalWidth <= w)))){ return (numChildrenWithOwnSpace); }; if ((maxChildWidth * 2) <= w){ return (2); }; return (1); } override protected function commitProperties():void{ super.commitProperties(); if (labelChanged){ labelObj.text = label; labelObj.validateSize(); labelChanged = false; }; } mx_internal function get labelObject():Object{ return (labelObj); } private function previousUpdateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{ var i:int; var child:IUIComponent; var childBaseline:Number; var childWidth:Number; var horizontalGap:Number; var verticalGap:Number; var horizontalAlignValue:Number; var maxWidth:Number; var numColumns:int; var x:Number; var col:int; var h:Number; var excessSpace:Number; var widthSlop:Number; var xOffset:Number; super.updateDisplayList(unscaledWidth, unscaledHeight); var vm:EdgeMetrics = viewMetricsAndPadding; var left:Number = vm.left; var top:Number = vm.top; var y:Number = top; var labelWidth:Number = calculateLabelWidth(); var indicatorGap:Number = getStyle("indicatorGap"); var horizontalAlign:String = getStyle("horizontalAlign"); if (horizontalAlign == "right"){ horizontalAlignValue = 1; } else { if (horizontalAlign == "center"){ horizontalAlignValue = 0.5; } else { horizontalAlignValue = 0; }; }; var n:int = numChildren; if (n > 0){ child = IUIComponent(getChildAt(0)); childBaseline = child.baselinePosition; if (!isNaN(childBaseline)){ y = (y + (childBaseline - labelObj.baselinePosition)); }; }; labelObj.setActualSize(labelWidth, labelObj.getExplicitOrMeasuredHeight()); labelObj.move(left, y); left = (left + labelWidth); displayIndicator(left, y); left = (left + indicatorGap); var controlWidth:Number = ((unscaledWidth - vm.right) - left); if (controlWidth < 0){ controlWidth = 0; }; if (direction == FormItemDirection.HORIZONTAL){ maxWidth = 0; numColumns = calcNumColumns(controlWidth); col = 0; horizontalGap = getStyle("horizontalGap"); verticalGap = getStyle("verticalGap"); if (((!((numColumns == guessedNumColumns))) && ((numberOfGuesses == 0)))){ guessedRowWidth = controlWidth; numberOfGuesses = 1; invalidateSize(); } else { numberOfGuesses = 0; }; if (numColumns == n){ h = (height - (top + vm.bottom)); excessSpace = Flex.flexChildWidthsProportionally(this, (controlWidth - ((n - 1) * horizontalGap)), h); left = (left + (excessSpace * horizontalAlignValue)); i = 0; while (i < n) { child = IUIComponent(getChildAt(i)); child.move(Math.floor(left), top); left = (left + (child.width + horizontalGap)); i++; }; } else { i = 0; while (i < n) { child = IUIComponent(getChildAt(i)); maxWidth = Math.max(maxWidth, child.getExplicitOrMeasuredWidth()); i++; }; widthSlop = (controlWidth - ((numColumns * maxWidth) + ((numColumns - 1) * horizontalGap))); if (widthSlop < 0){ widthSlop = 0; }; left = (left + (widthSlop * horizontalAlignValue)); x = left; i = 0; while (i < n) { child = IUIComponent(getChildAt(i)); childWidth = Math.min(maxWidth, child.getExplicitOrMeasuredWidth()); child.setActualSize(childWidth, child.getExplicitOrMeasuredHeight()); child.move(x, top); ++col; if (col >= numColumns){ x = left; col = 0; top = (top + (child.height + verticalGap)); } else { x = (x + (maxWidth + horizontalGap)); }; i++; }; }; } else { verticalGap = getStyle("verticalGap"); i = 0; while (i < n) { child = IUIComponent(getChildAt(i)); if (!isNaN(child.percentWidth)){ childWidth = Math.floor(((controlWidth * Math.min(child.percentWidth, 100)) / 100)); } else { childWidth = child.getExplicitOrMeasuredWidth(); if (isNaN(child.explicitWidth)){ if (childWidth < Math.floor((controlWidth * 0.25))){ childWidth = Math.floor((controlWidth * 0.25)); } else { if (childWidth < Math.floor((controlWidth * 0.5))){ childWidth = Math.floor((controlWidth * 0.5)); } else { if (childWidth < Math.floor((controlWidth * 0.75))){ childWidth = Math.floor((controlWidth * 0.75)); } else { if (childWidth < Math.floor(controlWidth)){ childWidth = Math.floor(controlWidth); }; }; }; }; }; }; child.setActualSize(childWidth, child.getExplicitOrMeasuredHeight()); xOffset = ((controlWidth - childWidth) * horizontalAlignValue); child.move((left + xOffset), top); top = (top + child.height); top = (top + verticalGap); i++; }; }; y = vm.top; if (n > 0){ child = IUIComponent(getChildAt(0)); childBaseline = child.baselinePosition; if (!isNaN(childBaseline)){ y = (y + (childBaseline - labelObj.baselinePosition)); }; }; labelObj.move(labelObj.x, y); } override protected function createChildren():void{ var labelStyleName:String; var styleDecl:CSSStyleDeclaration; super.createChildren(); if (!labelObj){ labelObj = new FormItemLabel(); labelStyleName = getStyle("labelStyleName"); if (labelStyleName){ styleDecl = StyleManager.getStyleDeclaration(("." + labelStyleName)); if (styleDecl){ labelObj.styleDeclaration = styleDecl; }; }; rawChildren.addChild(labelObj); dispatchEvent(new Event("itemLabelChanged")); }; } function getPreferredLabelWidth():Number{ if (((!(label)) || ((label == "")))){ return (0); }; if (isNaN(labelObj.measuredWidth)){ labelObj.validateSize(); }; var labelWidth:Number = labelObj.measuredWidth; if (isNaN(labelWidth)){ return (0); }; return (labelWidth); } override protected function measure():void{ if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){ previousMeasure(); return; }; super.measure(); if (direction == FormItemDirection.VERTICAL){ measureVertical(); } else { measureHorizontal(); }; } public function get itemLabel():Label{ return (labelObj); } public function get required():Boolean{ return (_required); } private function previousMeasure():void{ var preferredWidth:Number; var preferredHeight:Number; var i:int; var child:IUIComponent; super.measure(); var numColumns:int = (guessedNumColumns = calcNumColumns(guessedRowWidth)); var horizontalGap:Number = getStyle("horizontalGap"); var verticalGap:Number = getStyle("verticalGap"); var indicatorGap:Number = getStyle("indicatorGap"); var col:int; var tempMinWidth:Number = 0; var tempWidth:Number = 0; var tempMinHeight:Number = 0; var tempHeight:Number = 0; var minWidth:Number = 0; var minHeight:Number = 0; preferredWidth = 0; preferredHeight = 0; var maxPreferredWidth:Number = 0; var n:int = numChildren; if ((((direction == FormItemDirection.HORIZONTAL)) && ((numColumns < n)))){ i = 0; while (i < n) { child = IUIComponent(getChildAt(i)); maxPreferredWidth = Math.max(maxPreferredWidth, child.getExplicitOrMeasuredWidth()); i++; }; }; i = 0; while (i < n) { child = IUIComponent(getChildAt(i)); if (col < numColumns){ tempMinWidth = (tempMinWidth + (isNaN(child.percentWidth)) ? child.getExplicitOrMeasuredWidth() : child.minWidth); tempWidth = (tempWidth + ((maxPreferredWidth)>0) ? maxPreferredWidth : child.getExplicitOrMeasuredWidth()); if (col > 0){ tempMinWidth = (tempMinWidth + horizontalGap); tempWidth = (tempWidth + horizontalGap); }; tempMinHeight = Math.max(tempMinHeight, (isNaN(child.percentHeight)) ? child.getExplicitOrMeasuredHeight() : child.minHeight); tempHeight = Math.max(tempHeight, child.getExplicitOrMeasuredHeight()); }; col++; if ((((col >= numColumns)) || ((i == (n - 1))))){ minWidth = Math.max(minWidth, tempMinWidth); preferredWidth = Math.max(preferredWidth, tempWidth); minHeight = (minHeight + tempMinHeight); preferredHeight = (preferredHeight + tempHeight); if (i > 0){ minHeight = (minHeight + verticalGap); preferredHeight = (preferredHeight + verticalGap); }; col = 0; tempMinWidth = 0; tempWidth = 0; tempMinHeight = 0; tempHeight = 0; }; i++; }; var labelWidth:Number = (calculateLabelWidth() + indicatorGap); minWidth = (minWidth + labelWidth); preferredWidth = (preferredWidth + labelWidth); if (((!((label == null))) && (!((label == ""))))){ minHeight = Math.max(minHeight, labelObj.getExplicitOrMeasuredHeight()); preferredHeight = Math.max(preferredHeight, labelObj.getExplicitOrMeasuredHeight()); }; var vm:EdgeMetrics = viewMetricsAndPadding; minHeight = (minHeight + (vm.top + vm.bottom)); minWidth = (minWidth + (vm.left + vm.right)); preferredHeight = (preferredHeight + (vm.top + vm.bottom)); preferredWidth = (preferredWidth + (vm.left + vm.right)); measuredMinWidth = minWidth; measuredMinHeight = minHeight; measuredWidth = preferredWidth; measuredHeight = preferredHeight; } private function measureHorizontal():void{ var minHeight:Number; var preferredHeight:Number; var i:int; var child:IUIComponent; var numColumns:int = (guessedNumColumns = calcNumColumns(guessedRowWidth)); var horizontalGap:Number = getStyle("horizontalGap"); var verticalGap:Number = getStyle("verticalGap"); var indicatorGap:Number = getStyle("indicatorGap"); var tempMinWidth:Number = 0; var tempWidth:Number = 0; var tempMinHeight:Number = 0; var tempHeight:Number = 0; var minWidth:Number = 0; minHeight = 0; var preferredWidth:Number = 0; preferredHeight = 0; var maxPreferredWidth:Number = 0; var col:int; if (numColumns < numChildren){ i = 0; while (i < numChildren) { child = IUIComponent(getChildAt(i)); if (!child.includeInLayout){ } else { maxPreferredWidth = Math.max(maxPreferredWidth, child.getExplicitOrMeasuredWidth()); }; i++; }; }; var row:int; i = 0; while (i < numChildren) { child = IUIComponent(getChildAt(i)); if (!child.includeInLayout){ } else { tempMinWidth = (tempMinWidth + (isNaN(child.percentWidth)) ? child.getExplicitOrMeasuredWidth() : child.minWidth); tempWidth = (tempWidth + ((maxPreferredWidth)>0) ? maxPreferredWidth : child.getExplicitOrMeasuredWidth()); if (col > 0){ tempMinWidth = (tempMinWidth + horizontalGap); tempWidth = (tempWidth + horizontalGap); }; tempMinHeight = Math.max(tempMinHeight, (isNaN(child.percentHeight)) ? child.getExplicitOrMeasuredHeight() : child.minHeight); tempHeight = Math.max(tempHeight, child.getExplicitOrMeasuredHeight()); col++; if ((((col >= numColumns)) || ((i == (numChildren - 1))))){ minWidth = Math.max(minWidth, tempMinWidth); preferredWidth = Math.max(preferredWidth, tempWidth); minHeight = (minHeight + tempMinHeight); preferredHeight = (preferredHeight + tempHeight); if (row > 0){ minHeight = (minHeight + verticalGap); preferredHeight = (preferredHeight + verticalGap); }; col = 0; row++; tempMinWidth = 0; tempWidth = 0; tempMinHeight = 0; tempHeight = 0; }; }; i++; }; var labelWidth:Number = (calculateLabelWidth() + indicatorGap); minWidth = (minWidth + labelWidth); preferredWidth = (preferredWidth + labelWidth); if (((!((label == null))) && (!((label == ""))))){ minHeight = Math.max(minHeight, labelObj.getExplicitOrMeasuredHeight()); preferredHeight = Math.max(preferredHeight, labelObj.getExplicitOrMeasuredHeight()); }; var vm:EdgeMetrics = viewMetricsAndPadding; minHeight = (minHeight + (vm.top + vm.bottom)); minWidth = (minWidth + (vm.left + vm.right)); preferredHeight = (preferredHeight + (vm.top + vm.bottom)); preferredWidth = (preferredWidth + (vm.left + vm.right)); measuredMinWidth = minWidth; measuredMinHeight = minHeight; measuredWidth = preferredWidth; measuredHeight = preferredHeight; } public function set required(value:Boolean):void{ if (value != _required){ _required = value; invalidateDisplayList(); dispatchEvent(new Event("requiredChanged")); }; } private function updateDisplayListVerticalChildren(unscaledWidth:Number, unscaledHeight:Number):void{ var child:IUIComponent; var extraWidth:Number = (calculateLabelWidth() + getStyle("indicatorGap")); if (!isNaN(explicitMinWidth)){ _explicitMinWidth = (_explicitMinWidth - extraWidth); } else { if (!isNaN(measuredMinWidth)){ measuredMinWidth = (measuredMinWidth - extraWidth); }; }; verticalLayoutObject.updateDisplayList((unscaledWidth - extraWidth), unscaledHeight); if (!isNaN(explicitMinWidth)){ _explicitMinWidth = (_explicitMinWidth + extraWidth); } else { if (!isNaN(measuredMinWidth)){ measuredMinWidth = (measuredMinWidth + extraWidth); }; }; var n:Number = numChildren; var i:Number = 0; while (i < n) { child = IUIComponent(getChildAt(i)); child.move((child.x + extraWidth), child.y); i++; }; } private function displayIndicator(xPos:Number, yPos:Number):void{ var indicatorClass:Class; if (required){ if (!indicatorObj){ indicatorClass = (getStyle("indicatorSkin") as Class); indicatorObj = IFlexDisplayObject(new (indicatorClass)); rawChildren.addChild(DisplayObject(indicatorObj)); }; indicatorObj.x = (xPos + ((getStyle("indicatorGap") - indicatorObj.width) / 2)); if (labelObj){ indicatorObj.y = (yPos + ((labelObj.getExplicitOrMeasuredHeight() - indicatorObj.measuredHeight) / 2)); }; } else { if (indicatorObj){ rawChildren.removeChild(DisplayObject(indicatorObj)); indicatorObj = null; }; }; } override public function set label(value:String):void{ _label = value; labelChanged = true; invalidateProperties(); invalidateSize(); invalidateDisplayList(); if ((parent is Form)){ Form(parent).invalidateLabelWidth(); }; dispatchEvent(new Event("labelChanged")); } private function updateDisplayListHorizontalChildren(unscaledWidth:Number, unscaledHeight:Number):void{ var i:int; var child:IUIComponent; var childWidth:Number; var childHeight:Number; var wPref:Number; var hPref:Number; var percentWidth:Number; var percentHeight:Number; var excessSpace:Number; var widthSlop:Number; var rowPercentHeight:Number; var rowMaxHeight:Number; var totalPercentHeight:Number; var heightSpaceForChildren:Number; var heightSpaceToDistribute:Number; var done:Boolean; var explicitHeightChildren:Array; var unused:Number; var heightSpacePerPercent:*; var rowMaxChildHeight:*; var xOffset:*; var vm:EdgeMetrics = viewMetricsAndPadding; var labelWidth:Number = calculateLabelWidth(); var indicatorGap:Number = getStyle("indicatorGap"); var horizontalGap:Number = getStyle("horizontalGap"); var verticalGap:Number = getStyle("verticalGap"); var paddingLeft:Number = getStyle("paddingLeft"); var paddingTop:Number = getStyle("paddingTop"); var horizontalAlignValue:Number = getHorizontalAlignValue(); var mw:Number = ((((scaleX > 0)) && (!((scaleX == 1))))) ? (minWidth / Math.abs(scaleX)) : minWidth; var mh:Number = ((((scaleY > 0)) && (!((scaleY == 1))))) ? (minHeight / Math.abs(scaleY)) : minHeight; var w:Number = ((Math.max(unscaledWidth, mw) - vm.left) - vm.right); var h:Number = ((Math.max(unscaledHeight, mh) - vm.top) - vm.bottom); var maxWidth:Number = 0; var controlWidth:Number = ((w - labelWidth) - indicatorGap); if (controlWidth < 0){ controlWidth = 0; }; var numColumns:int = calcNumColumns(controlWidth); var col:int; if (numColumns != guessedNumColumns){ if (numberOfGuesses < 2){ guessedRowWidth = controlWidth; numberOfGuesses++; invalidateSize(); return; }; numColumns = guessedNumColumns; numberOfGuesses = 0; } else { numberOfGuesses = 0; }; var left:Number = ((paddingLeft + labelWidth) + indicatorGap); var top:Number = paddingTop; var x:Number = left; var y:Number = top; var numChildrenWithOwnSpace:int = numChildren; i = 0; while (i < numChildren) { if (!IUIComponent(getChildAt(i)).includeInLayout){ numChildrenWithOwnSpace--; }; i++; }; if (numColumns == numChildrenWithOwnSpace){ excessSpace = Flex.flexChildWidthsProportionally(this, (controlWidth - ((numChildrenWithOwnSpace - 1) * horizontalGap)), h); left = (left + (excessSpace * horizontalAlignValue)); i = 0; while (i < numChildren) { child = IUIComponent(getChildAt(i)); if (!child.includeInLayout){ } else { child.move(Math.floor(left), top); left = (left + (child.width + horizontalGap)); }; i++; }; } else { i = 0; while (i < numChildren) { child = IUIComponent(getChildAt(i)); if (!child.includeInLayout){ } else { wPref = child.getExplicitOrMeasuredWidth(); percentWidth = child.percentWidth; childWidth = (isNaN(percentWidth)) ? wPref : ((percentWidth * controlWidth) / 100); childWidth = Math.max(child.minWidth, Math.min(child.maxWidth, childWidth)); maxWidth = Math.max(maxWidth, childWidth); }; i++; }; maxWidth = Math.min(maxWidth, Math.floor(((controlWidth - ((numColumns - 1) * horizontalGap)) / numColumns))); widthSlop = (controlWidth - ((numColumns * maxWidth) + ((numColumns - 1) * horizontalGap))); if (widthSlop < 0){ widthSlop = 0; }; left = (left + (widthSlop * horizontalAlignValue)); rowPercentHeight = 0; rowMaxHeight = 0; totalPercentHeight = 0; heightSpaceForChildren = h; heightSpaceToDistribute = heightSpaceForChildren; col = 0; i = 0; while (i < numChildren) { child = IUIComponent(getChildAt(i)); if (!child.includeInLayout){ if (i == (numChildren - 1)){ heightSpaceToDistribute = (heightSpaceToDistribute - rowMaxHeight); if (i != (numChildren - 1)){ heightSpaceToDistribute = (heightSpaceToDistribute - verticalGap); }; if ((((rowMaxHeight > 0)) && ((rowPercentHeight > 0)))){ rowPercentHeight = Math.max(0, (rowPercentHeight - ((100 * rowMaxHeight) / heightSpaceForChildren))); }; totalPercentHeight = (totalPercentHeight + rowPercentHeight); rowMaxHeight = 0; rowPercentHeight = 0; col = 0; }; } else { if (!isNaN(child.percentHeight)){ rowPercentHeight = Math.max(rowPercentHeight, child.percentHeight); } else { rowMaxHeight = Math.max(rowMaxHeight, child.getExplicitOrMeasuredHeight()); }; ++col; if ((((col >= numColumns)) || ((i == (numChildren - 1))))){ heightSpaceToDistribute = (heightSpaceToDistribute - rowMaxHeight); if (i != (numChildren - 1)){ heightSpaceToDistribute = (heightSpaceToDistribute - verticalGap); }; if ((((rowMaxHeight > 0)) && ((rowPercentHeight > 0)))){ rowPercentHeight = Math.max(0, (rowPercentHeight - ((100 * rowMaxHeight) / heightSpaceForChildren))); }; totalPercentHeight = (totalPercentHeight + rowPercentHeight); rowMaxHeight = 0; rowPercentHeight = 0; col = 0; }; }; i++; }; done = false; explicitHeightChildren = new Array(numChildren); i = 0; while (i < numChildren) { explicitHeightChildren[i] = -1; i++; }; unused = (heightSpaceToDistribute - ((heightSpaceForChildren * totalPercentHeight) / 100)); if (unused > 0){ heightSpaceToDistribute = (heightSpaceToDistribute - unused); }; do { done = true; heightSpacePerPercent = (heightSpaceToDistribute / totalPercentHeight); col = 0; x = left; y = top; rowMaxChildHeight = 0; i = 0; while (i < numChildren) { child = IUIComponent(getChildAt(i)); if (!child.includeInLayout){ } else { wPref = child.getExplicitOrMeasuredWidth(); hPref = child.getExplicitOrMeasuredHeight(); percentWidth = child.percentWidth; percentHeight = child.percentHeight; childWidth = Math.min(maxWidth, (isNaN(percentWidth)) ? wPref : ((percentWidth * controlWidth) / 100)); childWidth = Math.max(child.minWidth, Math.min(child.maxWidth, childWidth)); if (explicitHeightChildren[i] != -1){ childHeight = explicitHeightChildren[i]; } else { childHeight = (isNaN(percentHeight)) ? hPref : (percentHeight * heightSpacePerPercent); if (childHeight < child.minHeight){ childHeight = child.minHeight; totalPercentHeight = (totalPercentHeight - child.percentHeight); heightSpaceToDistribute = (heightSpaceToDistribute - childHeight); explicitHeightChildren[i] = childHeight; done = false; break; } else { if (childHeight > child.maxHeight){ childHeight = child.maxHeight; totalPercentHeight = (totalPercentHeight - child.percentHeight); heightSpaceToDistribute = (heightSpaceToDistribute - childHeight); explicitHeightChildren[i] = childHeight; done = false; break; }; }; }; if ((((child.scaleX == 1)) && ((child.scaleY == 1)))){ child.setActualSize(Math.floor(childWidth), Math.floor(childHeight)); } else { child.setActualSize(childWidth, childHeight); }; xOffset = ((maxWidth - child.width) * horizontalAlignValue); child.move(Math.floor((x + xOffset)), Math.floor(y)); rowMaxChildHeight = Math.max(rowMaxChildHeight, child.height); ++col; if (col >= numColumns){ x = left; col = 0; y = (y + (rowMaxChildHeight + verticalGap)); rowMaxChildHeight = 0; } else { x = (x + (maxWidth + horizontalGap)); }; }; i++; }; } while (!(done)); }; } override public function get label():String{ return (_label); } override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{ var child:IUIComponent; var childBaseline:Number; if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){ previousUpdateDisplayList(unscaledWidth, unscaledHeight); return; }; super.updateDisplayList(unscaledWidth, unscaledHeight); if (direction == FormItemDirection.VERTICAL){ updateDisplayListVerticalChildren(unscaledWidth, unscaledHeight); } else { updateDisplayListHorizontalChildren(unscaledWidth, unscaledHeight); }; var vm:EdgeMetrics = viewMetricsAndPadding; var x:Number = vm.left; var y:Number = vm.top; var labelWidth:Number = calculateLabelWidth(); if (numChildren > 0){ child = IUIComponent(getChildAt(0)); childBaseline = child.baselinePosition; if (!isNaN(childBaseline)){ y = (y + (childBaseline - labelObj.baselinePosition)); }; }; labelObj.setActualSize(labelWidth, labelObj.getExplicitOrMeasuredHeight()); labelObj.move(x, y); x = (x + labelWidth); displayIndicator(x, y); } private function calculateLabelWidth():Number{ var labelWidth:Number = getStyle("labelWidth"); if (labelWidth == 0){ labelWidth = NaN; }; if (((isNaN(labelWidth)) && ((parent is Form)))){ labelWidth = Form(parent).calculateLabelWidth(); }; if (isNaN(labelWidth)){ labelWidth = getPreferredLabelWidth(); }; return (labelWidth); } private function measureVertical():void{ var labelHeight:Number; verticalLayoutObject.measure(); var extraWidth:Number = (calculateLabelWidth() + getStyle("indicatorGap")); measuredMinWidth = (measuredMinWidth + extraWidth); measuredWidth = (measuredWidth + extraWidth); labelHeight = labelObj.getExplicitOrMeasuredHeight(); measuredMinHeight = Math.max(measuredMinHeight, labelHeight); measuredHeight = Math.max(measuredHeight, labelHeight); } public function set direction(value:String):void{ _direction = value; invalidateSize(); invalidateDisplayList(); dispatchEvent(new Event("directionChanged")); } public function get direction():String{ return (_direction); } } }//package mx.containers
Section 31
//FormItemDirection (mx.containers.FormItemDirection) package mx.containers { public final class FormItemDirection { public static const HORIZONTAL:String = "horizontal"; public static const VERTICAL:String = "vertical"; mx_internal static const VERSION:String = "3.0.0.0"; public function FormItemDirection(){ super(); } } }//package mx.containers
Section 32
//HBox (mx.containers.HBox) package mx.containers { import mx.core.*; public class HBox extends Box { mx_internal static const VERSION:String = "3.0.0.0"; public function HBox(){ super(); mx_internal::layoutObject.direction = BoxDirection.HORIZONTAL; } override public function set direction(value:String):void{ } } }//package mx.containers
Section 33
//Panel (mx.containers.Panel) package mx.containers { import flash.display.*; import flash.geom.*; import flash.text.*; import mx.core.*; import mx.automation.*; import flash.events.*; import mx.events.*; import mx.styles.*; import mx.controls.*; import mx.effects.*; import flash.utils.*; import mx.containers.utilityClasses.*; 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.0.0.0"; 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{ systemManager.removeEventListener(MouseEvent.MOUSE_MOVE, systemManager_mouseMoveHandler, true); systemManager.removeEventListener(MouseEvent.MOUSE_UP, systemManager_mouseUpHandler, true); systemManager.stage.removeEventListener(Event.MOUSE_LEAVE, stage_mouseLeaveHandler); regX = NaN; regY = NaN; } 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); systemManager.addEventListener(MouseEvent.MOUSE_MOVE, systemManager_mouseMoveHandler, true); systemManager.addEventListener(MouseEvent.MOUSE_UP, systemManager_mouseUpHandler, true); systemManager.stage.addEventListener(Event.MOUSE_LEAVE, stage_mouseLeaveHandler); } 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(); 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 34
//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.0.0.0"; 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 35
//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.0.0.0"; 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 36
//IDropInListItemRenderer (mx.controls.listClasses.IDropInListItemRenderer) package mx.controls.listClasses { public interface IDropInListItemRenderer { function get listData():BaseListData; function set listData(E:\dev\3.0.x\frameworks\projects\framework\src;mx\controls\listClasses;IDropInListItemRenderer.as:BaseListData):void; } }//package mx.controls.listClasses
Section 37
//IListItemRenderer (mx.controls.listClasses.IListItemRenderer) package mx.controls.listClasses { import mx.core.*; import mx.managers.*; import flash.events.*; import mx.styles.*; public interface IListItemRenderer extends IDataRenderer, IEventDispatcher, IFlexDisplayObject, ILayoutManagerClient, ISimpleStyleClient, IUIComponent { } }//package mx.controls.listClasses
Section 38
//ScrollBar (mx.controls.scrollClasses.ScrollBar) package mx.controls.scrollClasses { import flash.geom.*; import mx.core.*; import flash.events.*; import mx.events.*; import mx.styles.*; import mx.controls.*; import flash.utils.*; import flash.ui.*; 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.0.0.0"; 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; systemManager.addEventListener(MouseEvent.MOUSE_UP, scrollTrack_mouseUpHandler, true); systemManager.addEventListener(MouseEvent.MOUSE_MOVE, scrollTrack_mouseMoveHandler, true); systemManager.stage.addEventListener(MouseEvent.MOUSE_MOVE, stage_scrollTrack_mouseMoveHandler); systemManager.stage.addEventListener(Event.MOUSE_LEAVE, scrollTrack_mouseLeaveHandler); 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; } 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); } private function stage_scrollTrack_mouseMoveHandler(event:MouseEvent):void{ if (event.target != stage){ return; }; scrollTrack_mouseMoveHandler(event); } 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; } 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; systemManager.removeEventListener(MouseEvent.MOUSE_UP, scrollTrack_mouseUpHandler, true); systemManager.removeEventListener(MouseEvent.MOUSE_MOVE, scrollTrack_mouseMoveHandler, true); systemManager.stage.removeEventListener(MouseEvent.MOUSE_MOVE, stage_scrollTrack_mouseMoveHandler); systemManager.stage.removeEventListener(Event.MOUSE_LEAVE, scrollTrack_mouseLeaveHandler); 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 39
//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.0.0.0"; public function ScrollBarDirection(){ super(); } } }//package mx.controls.scrollClasses
Section 40
//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.0.0.0"; 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.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true); systemManager.stage.removeEventListener(MouseEvent.MOUSE_MOVE, stage_mouseMoveHandler); } override protected function mouseDownHandler(event:MouseEvent):void{ super.mouseDownHandler(event); var scrollBar:ScrollBar = ScrollBar(parent); scrollBar.oldPosition = scrollBar.scrollPosition; lastY = event.localY; systemManager.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true); systemManager.stage.addEventListener(MouseEvent.MOUSE_MOVE, stage_mouseMoveHandler); } 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(); } private function stage_mouseMoveHandler(event:MouseEvent):void{ if (event.target != stage){ return; }; mouseMoveHandler(event); } 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 41
//Button (mx.controls.Button) package mx.controls { import flash.display.*; import flash.text.*; import mx.core.*; import mx.managers.*; import flash.events.*; import mx.events.*; import mx.styles.*; import mx.controls.listClasses.*; import flash.utils.*; import flash.ui.*; 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; 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.0.0.0"; mx_internal static var createAccessibilityImplementation:Function; mx_internal static var TEXT_WIDTH_PADDING:Number = (UITextField.TEXT_WIDTH_PADDING + 1); public function Button(){ skins = []; icons = []; extraSpacing = (10 + 10); 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)))){ 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.addEventListener(MouseEvent.MOUSE_UP, systemManager_mouseUpHandler, true); systemManager.stage.addEventListener(Event.MOUSE_LEAVE, 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.removeEventListener(MouseEvent.MOUSE_UP, systemManager_mouseUpHandler, true); systemManager.stage.removeEventListener(Event.MOUSE_LEAVE, 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 42
//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.0.0.0"; public static const BOTTOM:String = "bottom"; public static const RIGHT:String = "right"; public function ButtonLabelPlacement(){ super(); } } }//package mx.controls
Section 43
//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.0.0.0"; public static const UP:String = "up"; public function ButtonPhase(){ super(); } } }//package mx.controls
Section 44
//FormItemLabel (mx.controls.FormItemLabel) package mx.controls { public class FormItemLabel extends Label { mx_internal static const VERSION:String = "3.0.0.0"; public function FormItemLabel(){ super(); } } }//package mx.controls
Section 45
//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.0.0.0"; 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 46
//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 47
//Label (mx.controls.Label) package mx.controls { import flash.display.*; import flash.geom.*; import flash.text.*; import mx.core.*; import flash.events.*; import mx.events.*; import mx.controls.listClasses.*; public class Label extends UIComponent implements IDataRenderer, IDropInListItemRenderer, IListItemRenderer, IFontContextComponent { private var _selectable:Boolean;// = false private var _text:String;// = "" private var _data:Object; mx_internal var htmlTextChanged:Boolean;// = false private var _tabIndex:int;// = -1 private var _textWidth:Number; private var explicitHTMLText:String;// = null private var enabledChanged:Boolean;// = false private var condenseWhiteChanged:Boolean;// = false private var _listData:BaseListData; private var _textHeight:Number; protected var textField:IUITextField; private var _htmlText:String;// = "" private var _condenseWhite:Boolean;// = false mx_internal var textChanged:Boolean;// = false public var truncateToFit:Boolean;// = true private var textSet:Boolean; private var selectableChanged:Boolean; private var toolTipSet:Boolean;// = false mx_internal static const VERSION:String = "3.0.0.0"; public function Label(){ super(); } override public function set enabled(value:Boolean):void{ if (value == enabled){ return; }; super.enabled = value; enabledChanged = true; invalidateProperties(); } private function textField_textFieldStyleChangeHandler(event:Event):void{ textFieldChanged(true); } override public function get baselinePosition():Number{ var t:String; var lineMetrics:TextLineMetrics; if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){ if (!textField){ return (NaN); }; validateNow(); t = (isHTML) ? explicitHTMLText : text; if (t == ""){ t = " "; }; lineMetrics = (isHTML) ? measureHTMLText(t) : measureText(t); return ((textField.y + lineMetrics.ascent)); }; if (!validateBaselinePosition()){ return (NaN); }; return ((textField.y + textField.baselinePosition)); } public function set condenseWhite(value:Boolean):void{ if (value == _condenseWhite){ return; }; _condenseWhite = value; condenseWhiteChanged = true; if (isHTML){ htmlTextChanged = true; }; invalidateProperties(); invalidateSize(); invalidateDisplayList(); dispatchEvent(new Event("condenseWhiteChanged")); } public function get textWidth():Number{ return (_textWidth); } override protected function createChildren():void{ super.createChildren(); if (!textField){ createTextField(-1); }; } mx_internal function getTextField():IUITextField{ return (textField); } private function measureTextFieldBounds(s:String):Rectangle{ var lineMetrics:TextLineMetrics = (isHTML) ? measureHTMLText(s) : measureText(s); return (new Rectangle(0, 0, (lineMetrics.width + UITextField.TEXT_WIDTH_PADDING), (lineMetrics.height + UITextField.TEXT_HEIGHT_PADDING))); } mx_internal function getMinimumText(t:String):String{ if (((!(t)) || ((t.length < 2)))){ t = "Wj"; }; return (t); } private function textFieldChanged(styleChangeOnly:Boolean):void{ var changed1:Boolean; var changed2:Boolean; if (!styleChangeOnly){ changed1 = !((_text == textField.text)); _text = textField.text; }; changed2 = !((_htmlText == textField.htmlText)); _htmlText = textField.htmlText; if (changed1){ dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT)); }; if (changed2){ dispatchEvent(new Event("htmlTextChanged")); }; _textWidth = textField.textWidth; _textHeight = textField.textHeight; } public function get data():Object{ return (_data); } public function get text():String{ return (_text); } mx_internal function removeTextField():void{ if (textField){ textField.removeEventListener("textFieldStyleChange", textField_textFieldStyleChangeHandler); textField.removeEventListener("textInsert", textField_textModifiedHandler); textField.removeEventListener("textReplace", textField_textModifiedHandler); removeChild(DisplayObject(textField)); textField = null; }; } public function get textHeight():Number{ return (_textHeight); } mx_internal function get styleSheet():StyleSheet{ return (textField.styleSheet); } public function set selectable(value:Boolean):void{ if (value == selectable){ return; }; _selectable = value; selectableChanged = true; invalidateProperties(); } override public function get tabIndex():int{ return (_tabIndex); } public function set fontContext(moduleFactory:IFlexModuleFactory):void{ this.moduleFactory = moduleFactory; } override public function set toolTip(value:String):void{ super.toolTip = value; toolTipSet = !((value == null)); } mx_internal function createTextField(childIndex:int):void{ if (!textField){ textField = IUITextField(createInFontContext(UITextField)); textField.enabled = enabled; textField.ignorePadding = true; textField.selectable = selectable; textField.styleName = this; textField.addEventListener("textFieldStyleChange", textField_textFieldStyleChangeHandler); textField.addEventListener("textInsert", textField_textModifiedHandler); textField.addEventListener("textReplace", textField_textModifiedHandler); if (childIndex == -1){ addChild(DisplayObject(textField)); } else { addChildAt(DisplayObject(textField), childIndex); }; }; } override protected function commitProperties():void{ super.commitProperties(); if (((hasFontContextChanged()) && (!((textField == null))))){ removeTextField(); condenseWhiteChanged = true; enabledChanged = true; selectableChanged = true; textChanged = true; }; if (!textField){ createTextField(-1); }; if (condenseWhiteChanged){ textField.condenseWhite = _condenseWhite; condenseWhiteChanged = false; }; textField.tabIndex = tabIndex; if (enabledChanged){ textField.enabled = enabled; enabledChanged = false; }; if (selectableChanged){ textField.selectable = _selectable; selectableChanged = false; }; if (((textChanged) || (htmlTextChanged))){ if (isHTML){ textField.htmlText = explicitHTMLText; } else { textField.text = _text; }; textFieldChanged(false); textChanged = false; htmlTextChanged = false; }; } public function get condenseWhite():Boolean{ return (_condenseWhite); } public function set listData(value:BaseListData):void{ _listData = value; } private function get isHTML():Boolean{ return (!((explicitHTMLText == null))); } public function get selectable():Boolean{ return (_selectable); } public function set text(value:String):void{ textSet = true; if (!value){ value = ""; }; if (((!(isHTML)) && ((value == _text)))){ return; }; _text = value; textChanged = true; _htmlText = null; explicitHTMLText = null; invalidateProperties(); invalidateSize(); invalidateDisplayList(); dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT)); } public function set data(value:Object):void{ var newText:*; _data = value; if (_listData){ newText = _listData.label; } else { if (_data != null){ if ((_data is String)){ newText = String(_data); } else { newText = _data.toString(); }; }; }; if (((!((newText === undefined))) && (!(textSet)))){ text = newText; textSet = false; }; dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE)); } override protected function measure():void{ super.measure(); var t:String = (isHTML) ? explicitHTMLText : text; t = getMinimumText(t); var textFieldBounds:Rectangle = measureTextFieldBounds(t); measuredMinWidth = (measuredWidth = ((textFieldBounds.width + getStyle("paddingLeft")) + getStyle("paddingRight"))); measuredMinHeight = (measuredHeight = ((textFieldBounds.height + getStyle("paddingTop")) + getStyle("paddingBottom"))); } public function get fontContext():IFlexModuleFactory{ return (moduleFactory); } private function textField_textModifiedHandler(event:Event):void{ textFieldChanged(false); } public function get listData():BaseListData{ return (_listData); } mx_internal function set styleSheet(value:StyleSheet):void{ textField.styleSheet = value; } public function set htmlText(value:String):void{ textSet = true; if (!value){ value = ""; }; if (((isHTML) && ((value == explicitHTMLText)))){ return; }; _htmlText = value; htmlTextChanged = true; _text = null; explicitHTMLText = value; invalidateProperties(); invalidateSize(); invalidateDisplayList(); dispatchEvent(new Event("htmlTextChanged")); } override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{ var truncated:Boolean; super.updateDisplayList(unscaledWidth, unscaledHeight); var paddingLeft:Number = getStyle("paddingLeft"); var paddingTop:Number = getStyle("paddingTop"); var paddingRight:Number = getStyle("paddingRight"); var paddingBottom:Number = getStyle("paddingBottom"); textField.setActualSize(((unscaledWidth - paddingLeft) - paddingRight), ((unscaledHeight - paddingTop) - paddingBottom)); textField.x = paddingLeft; textField.y = paddingTop; var t:String = (isHTML) ? explicitHTMLText : text; var textFieldBounds:Rectangle = measureTextFieldBounds(t); if (truncateToFit){ if (isHTML){ truncated = (textFieldBounds.width > textField.width); } else { textField.text = _text; truncated = textField.truncateToFit(); }; if (!toolTipSet){ super.toolTip = (truncated) ? text : null; }; }; } public function get htmlText():String{ return (_htmlText); } public function getLineMetrics(lineIndex:int):TextLineMetrics{ return ((textField) ? textField.getLineMetrics(lineIndex) : null); } override public function set tabIndex(value:int):void{ _tabIndex = value; invalidateProperties(); } } }//package mx.controls
Section 48
//ProgressBar (mx.controls.ProgressBar) package mx.controls { import flash.display.*; import flash.text.*; import mx.core.*; import flash.events.*; import mx.styles.*; import flash.utils.*; public class ProgressBar extends UIComponent implements IFontContextComponent { private var _direction:String;// = "right" private var stopPolledMode:Boolean;// = false mx_internal var _labelField:IUITextField; mx_internal var _determinateBar:IFlexDisplayObject; private var sourceChanged:Boolean;// = false private var _interval:Number;// = 30 private var trackSkinChanged:Boolean;// = false mx_internal var _content:UIComponent; private var _source:Object; mx_internal var _track:IFlexDisplayObject; mx_internal var _bar:UIComponent; mx_internal var _barMask:IFlexDisplayObject; private var barSkinChanged:Boolean;// = false private var _stringSource:String; private var _labelPlacement:String;// = "bottom" private var _value:Number;// = 0 private var indeterminateChanged:Boolean;// = true private var _mode:String;// = "event" private var stringSourceChanged:Boolean;// = false private var modeChanged:Boolean;// = false private var _conversion:Number;// = 1 mx_internal var _indeterminateBar:IFlexDisplayObject; private var indeterminateSkinChanged:Boolean;// = false private var _indeterminate:Boolean;// = false private var pollTimer:Timer; private var _minimum:Number;// = 0 private var labelOverride:String; private var _maximum:Number;// = 0 private var visibleChanged:Boolean;// = false private var indeterminatePlaying:Boolean;// = false private var _label:String; mx_internal static const VERSION:String = "3.0.0.0"; public function ProgressBar(){ super(); pollTimer = new Timer(_interval); cacheAsBitmap = true; } public function get minimum():Number{ return (_minimum); } public function get conversion():Number{ return (_conversion); } private function completeHandler(event:Event):void{ dispatchEvent(event); invalidateDisplayList(); } public function get source():Object{ return (_source); } public function set minimum(value:Number):void{ if (((((!(isNaN(value))) && ((_mode == ProgressBarMode.MANUAL)))) && (!((value == _minimum))))){ _minimum = value; invalidateDisplayList(); dispatchEvent(new Event("minimumChanged")); }; } public function get maximum():Number{ return (_maximum); } override protected function createChildren():void{ var barMaskClass:Class; super.createChildren(); if (!_content){ _content = new UIComponent(); addChild(_content); }; if (!_bar){ _bar = new UIComponent(); _content.addChild(_bar); }; if (!_barMask){ if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0){ barMaskClass = getStyle("maskSkin"); _barMask = new (barMaskClass); } else { _barMask = new UIComponent(); }; _barMask.visible = true; _bar.addChild(DisplayObject(_barMask)); UIComponent(_bar).mask = DisplayObject(_barMask); }; if (!_labelField){ _labelField = IUITextField(createInFontContext(UITextField)); _labelField.styleName = this; addChild(DisplayObject(_labelField)); }; } public function set source(value:Object):void{ var value = value; if ((value is String)){ _stringSource = String(value); value = document[_stringSource]; //unresolved jump var _slot1 = e; stringSourceChanged = true; }; if (value){ _source = value; sourceChanged = true; modeChanged = true; indeterminateChanged = true; invalidateProperties(); invalidateDisplayList(); } else { if (_source != null){ _source = null; sourceChanged = true; indeterminateChanged = true; invalidateProperties(); invalidateDisplayList(); pollTimer.reset(); }; }; } public function set conversion(value:Number):void{ if (((((!(isNaN(value))) && ((Number(value) > 0)))) && (!((value == _conversion))))){ _conversion = Number(value); invalidateDisplayList(); dispatchEvent(new Event("conversionChanged")); }; } public function set maximum(value:Number):void{ if (((((!(isNaN(value))) && ((_mode == ProgressBarMode.MANUAL)))) && (!((value == _maximum))))){ _maximum = value; invalidateDisplayList(); dispatchEvent(new Event("maximumChanged")); }; } public function set mode(value:String):void{ if (value != _mode){ if (_mode == ProgressBarMode.POLLED){ stopPolledMode = true; }; _mode = value; modeChanged = true; indeterminateChanged = true; invalidateProperties(); invalidateDisplayList(); }; } private function stopPlayingIndeterminate():void{ if (indeterminatePlaying){ indeterminatePlaying = false; pollTimer.removeEventListener(TimerEvent.TIMER, updateIndeterminateHandler); if (_mode != ProgressBarMode.POLLED){ pollTimer.reset(); }; }; } public function get labelPlacement():String{ return (_labelPlacement); } private function progressHandler(event:ProgressEvent):void{ _setProgress(event.bytesLoaded, event.bytesTotal); } override protected function measure():void{ var prefWidth:Number; var prefHeight:Number; super.measure(); var minWidth:Number = NaN; var minHeight:Number = NaN; var trackHeight:Number = getStyle("trackHeight"); var preferredTrackWidth:Number = _track.measuredWidth; var preferredTrackHeight:Number = (isNaN(trackHeight)) ? _track.measuredHeight : trackHeight; var horizontalGap:Number = getStyle("horizontalGap"); var verticalGap:Number = getStyle("verticalGap"); var paddingLeft:Number = getStyle("paddingLeft"); var paddingRight:Number = getStyle("paddingRight"); var paddingTop:Number = getStyle("paddingTop"); var paddingBottom:Number = getStyle("paddingBottom"); var labelWidth:Number = getStyle("labelWidth"); var lineMetrics:TextLineMetrics = measureText(predictLabelText()); var textWidth:Number = (isNaN(labelWidth)) ? (lineMetrics.width + UITextField.TEXT_WIDTH_PADDING) : labelWidth; var textHeight:Number = (lineMetrics.height + UITextField.TEXT_HEIGHT_PADDING); switch (labelPlacement){ case ProgressBarLabelPlacement.LEFT: case ProgressBarLabelPlacement.RIGHT: prefWidth = ((((textWidth + preferredTrackWidth) + paddingLeft) + paddingRight) + horizontalGap); prefHeight = ((Math.max(textHeight, preferredTrackHeight) + paddingTop) + paddingBottom); measuredMinWidth = prefWidth; break; case ProgressBarLabelPlacement.CENTER: prefWidth = (((Math.max(textWidth, preferredTrackWidth) + paddingLeft) + paddingRight) + horizontalGap); prefHeight = ((Math.max(textHeight, preferredTrackHeight) + paddingTop) + paddingBottom); measuredMinWidth = textWidth; break; default: prefWidth = ((Math.max(textWidth, preferredTrackWidth) + paddingLeft) + paddingRight); prefHeight = ((((textHeight + preferredTrackHeight) + paddingTop) + paddingBottom) + verticalGap); measuredMinWidth = textWidth; break; }; measuredWidth = prefWidth; measuredMinHeight = (measuredHeight = prefHeight); if (!isNaN(minWidth)){ measuredMinWidth = minWidth; }; if (!isNaN(minHeight)){ measuredMinHeight = minHeight; }; } public function get fontContext():IFlexModuleFactory{ return (moduleFactory); } private function predictLabelText():String{ var largestValue:Number; if (label == null){ return (""); }; var labelText:String = label; if (_maximum != 0){ largestValue = _maximum; } else { largestValue = 100000; }; if (labelText){ if (_indeterminate){ labelText = labelText.replace("%1", String(Math.floor((largestValue / _conversion)))); labelText = labelText.replace("%2", "??"); labelText = labelText.replace("%3", ""); labelText = labelText.replace("%%", ""); } else { labelText = labelText.replace("%1", String(Math.floor((largestValue / _conversion)))); labelText = labelText.replace("%2", String(Math.floor((largestValue / _conversion)))); labelText = labelText.replace("%3", "100"); labelText = labelText.replace("%%", "%"); }; }; var actualText:String = getFullLabelText(); if (labelText.length > actualText.length){ return (labelText); }; return (actualText); } public function get value():Number{ return (_value); } public function set indeterminate(value:Boolean):void{ _indeterminate = value; indeterminateChanged = true; invalidateProperties(); invalidateDisplayList(); dispatchEvent(new Event("indeterminateChanged")); } private function createBar():void{ if (_determinateBar){ _bar.removeChild(DisplayObject(_determinateBar)); _determinateBar = null; }; var barClass:Class = getStyle("barSkin"); if (barClass){ _determinateBar = new (barClass); if ((_determinateBar is ISimpleStyleClient)){ ISimpleStyleClient(_determinateBar).styleName = this; }; _bar.addChild(DisplayObject(_determinateBar)); }; } private function createIndeterminateBar():void{ if (_indeterminateBar){ _bar.removeChild(DisplayObject(_indeterminateBar)); _indeterminateBar = null; }; var indeterminateClass:Class = getStyle("indeterminateSkin"); if (indeterminateClass){ _indeterminateBar = new (indeterminateClass); if ((_indeterminateBar is ISimpleStyleClient)){ ISimpleStyleClient(_indeterminateBar).styleName = this; }; _indeterminateBar.visible = false; _bar.addChild(DisplayObject(_indeterminateBar)); }; } public function get direction():String{ return (_direction); } private function updatePolledHandler(event:Event):void{ var comp:Object; var bytesLoaded:Number; var bytesTotal:Number; if (_source){ comp = _source; bytesLoaded = comp.bytesLoaded; bytesTotal = comp.bytesTotal; if (((!(isNaN(bytesLoaded))) && (!(isNaN(bytesTotal))))){ _setProgress(bytesLoaded, bytesTotal); if ((((percentComplete >= 100)) && ((_value > 0)))){ pollTimer.reset(); }; }; }; } private function updateIndeterminateHandler(event:Event):void{ if (_indeterminateBar.x < 1){ _indeterminateBar.x = (_indeterminateBar.x + 1); } else { _indeterminateBar.x = -((getStyle("indeterminateMoveInterval") - 2)); }; } public function set labelPlacement(value:String):void{ if (value != _labelPlacement){ _labelPlacement = value; }; invalidateSize(); invalidateDisplayList(); dispatchEvent(new Event("labelPlacementChanged")); } public function get mode():String{ return (_mode); } public function get percentComplete():Number{ if ((((_value < _minimum)) || ((_maximum < _minimum)))){ return (0); }; if ((_maximum - _minimum) == 0){ return (0); }; var perc:Number = ((100 * (_value - _minimum)) / (_maximum - _minimum)); if (((isNaN(perc)) || ((perc < 0)))){ return (0); }; if (perc > 100){ return (100); }; return (perc); } public function setProgress(value:Number, total:Number):void{ if (_mode == ProgressBarMode.MANUAL){ _setProgress(value, total); }; } private function createTrack():void{ if (_track){ _content.removeChild(DisplayObject(_track)); _track = null; }; var trackClass:Class = getStyle("trackSkin"); if (trackClass){ _track = new (trackClass); if ((_track is ISimpleStyleClient)){ ISimpleStyleClient(_track).styleName = this; }; _content.addChildAt(DisplayObject(_track), 0); }; } public function get indeterminate():Boolean{ return (_indeterminate); } private function startPlayingIndeterminate():void{ if (!indeterminatePlaying){ indeterminatePlaying = true; pollTimer.addEventListener(TimerEvent.TIMER, updateIndeterminateHandler, false, 0, true); pollTimer.start(); }; } override public function styleChanged(styleProp:String):void{ var invalidate:Boolean; super.styleChanged(styleProp); if ((((styleProp == null)) || ((styleProp == "styleName")))){ barSkinChanged = (trackSkinChanged = (indeterminateSkinChanged = true)); invalidate = true; } else { if (styleProp == "barSkin"){ barSkinChanged = true; invalidate = true; } else { if (styleProp == "trackSkin"){ trackSkinChanged = true; invalidate = true; } else { if (styleProp == "indeterminateSkin"){ indeterminateSkinChanged = true; invalidate = true; }; }; }; }; if (invalidate){ invalidateProperties(); invalidateSize(); invalidateDisplayList(); }; } private function getFullLabelText():String{ var current:Number = Math.max(_value, 0); var total:Number = Math.max(_maximum, 0); var labelText:String = label; if (labelText){ if (_indeterminate){ labelText = labelText.replace("%1", String(Math.floor((current / _conversion)))); labelText = labelText.replace("%2", "??"); labelText = labelText.replace("%3", ""); labelText = labelText.replace("%%", ""); } else { labelText = labelText.replace("%1", String(Math.floor((current / _conversion)))); labelText = labelText.replace("%2", String(Math.floor((total / _conversion)))); labelText = labelText.replace("%3", String(Math.floor(percentComplete))); labelText = labelText.replace("%%", "%"); }; }; return (labelText); } override protected function commitProperties():void{ var index:int; super.commitProperties(); if (((hasFontContextChanged()) && (!((_labelField == null))))){ index = getChildIndex(DisplayObject(_labelField)); removeChild(DisplayObject(_labelField)); _labelField = IUITextField(createInFontContext(UITextField)); _labelField.styleName = this; addChildAt(DisplayObject(_labelField), index); }; if (trackSkinChanged){ trackSkinChanged = false; createTrack(); }; if (barSkinChanged){ barSkinChanged = false; createBar(); }; if (indeterminateSkinChanged){ indeterminateSkinChanged = false; createIndeterminateBar(); }; if (stringSourceChanged){ stringSourceChanged = false; _source = document[_stringSource]; //unresolved jump var _slot1 = e; }; if (sourceChanged){ sourceChanged = false; dispatchEvent(new Event("sourceChanged")); }; if (modeChanged){ modeChanged = false; if (_source){ if (_mode == ProgressBarMode.EVENT){ if ((_source is IEventDispatcher)){ _source.addEventListener(ProgressEvent.PROGRESS, progressHandler); _source.addEventListener(Event.COMPLETE, completeHandler); } else { _source = null; }; } else { _source.removeEventListener(ProgressEvent.PROGRESS, progressHandler); _source.removeEventListener(Event.COMPLETE, completeHandler); }; }; if (_mode == ProgressBarMode.POLLED){ pollTimer.addEventListener(TimerEvent.TIMER, updatePolledHandler, false, 0, true); pollTimer.start(); } else { if (stopPolledMode){ stopPolledMode = false; pollTimer.removeEventListener(TimerEvent.TIMER, updatePolledHandler); pollTimer.reset(); }; }; dispatchEvent(new Event("modeChanged")); }; } override protected function resourcesChanged():void{ super.resourcesChanged(); label = labelOverride; } public function set fontContext(moduleFactory:IFlexModuleFactory):void{ this.moduleFactory = moduleFactory; } override public function set visible(value:Boolean):void{ super.visible = value; visibleChanged = true; invalidateDisplayList(); } public function set label(value:String):void{ labelOverride = value; _label = ((value)!=null) ? value : resourceManager.getString("controls", "label"); invalidateDisplayList(); dispatchEvent(new Event("labelChanged")); } override protected function childrenCreated():void{ super.childrenCreated(); trackSkinChanged = true; barSkinChanged = true; indeterminateSkinChanged = true; } private function layoutContent(newWidth:Number, newHeight:Number):void{ _track.move(0, 0); _track.setActualSize(newWidth, newHeight); _bar.move(0, 0); _determinateBar.move(0, 0); _indeterminateBar.setActualSize((newWidth + getStyle("indeterminateMoveInterval")), newHeight); } private function _setProgress(value:Number, maximum:Number):void{ var progressEvent:ProgressEvent; if (((((enabled) && (!(isNaN(value))))) && (!(isNaN(maximum))))){ _value = value; _maximum = maximum; dispatchEvent(new Event(Event.CHANGE)); progressEvent = new ProgressEvent(ProgressEvent.PROGRESS); progressEvent.bytesLoaded = value; progressEvent.bytesTotal = maximum; dispatchEvent(progressEvent); if (_indeterminate){ startPlayingIndeterminate(); }; if ((((_value == _maximum)) && ((_value > 0)))){ if (_indeterminate){ stopPlayingIndeterminate(); }; if (mode != ProgressBarMode.EVENT){ dispatchEvent(new Event(Event.COMPLETE)); }; }; invalidateDisplayList(); }; } public function get label():String{ return (_label); } override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{ var cWidth:Number; var g:Graphics; var w:Number; super.updateDisplayList(unscaledWidth, unscaledHeight); var horizontalGap:Number = getStyle("horizontalGap"); var verticalGap:Number = getStyle("verticalGap"); var paddingLeft:Number = getStyle("paddingLeft"); var paddingRight:Number = getStyle("paddingRight"); var paddingTop:Number = getStyle("paddingTop"); var paddingBottom:Number = getStyle("paddingBottom"); var left:Number = paddingLeft; var top:Number = paddingTop; var labelWidth:Number = getStyle("labelWidth"); var trackHeight:Number = getStyle("trackHeight"); trackHeight = (isNaN(trackHeight)) ? _track.measuredHeight : trackHeight; var lineMetrics:TextLineMetrics = measureText(predictLabelText()); var textWidth:Number = (isNaN(labelWidth)) ? (lineMetrics.width + UITextField.TEXT_WIDTH_PADDING) : labelWidth; var textHeight:Number = (lineMetrics.height + UITextField.TEXT_HEIGHT_PADDING); switch (labelPlacement){ case ProgressBarLabelPlacement.TOP: _labelField.move(left, top); _labelField.setActualSize(textWidth, textHeight); _content.move(left, ((top + textHeight) + verticalGap)); layoutContent(((unscaledWidth - left) - paddingRight), trackHeight); break; case ProgressBarLabelPlacement.RIGHT: cWidth = ((((unscaledWidth - left) - paddingRight) - textWidth) - horizontalGap); _labelField.move(((left + cWidth) + horizontalGap), ((unscaledHeight - textHeight) / 2)); _labelField.setActualSize(textWidth, textHeight); _content.move(left, (top + ((textHeight - trackHeight) / 2))); layoutContent(cWidth, trackHeight); break; case ProgressBarLabelPlacement.LEFT: _labelField.move(left, (top + ((unscaledHeight - textHeight) / 2))); _labelField.setActualSize(textWidth, textHeight); _content.move(((left + textWidth) + horizontalGap), (top + ((textHeight - trackHeight) / 2))); layoutContent(((((unscaledWidth - left) - textWidth) - verticalGap) - paddingRight), trackHeight); break; case ProgressBarLabelPlacement.CENTER: _labelField.move(((unscaledWidth - textWidth) / 2), ((unscaledHeight - textHeight) / 2)); _labelField.setActualSize(textWidth, textHeight); _content.move(left, top); layoutContent((unscaledWidth - paddingRight), (unscaledHeight - paddingBottom)); break; default: _labelField.move(left, ((top + trackHeight) + verticalGap)); _labelField.setActualSize(textWidth, textHeight); _content.move(left, top); layoutContent(((unscaledWidth - left) - paddingRight), trackHeight); break; }; if (_barMask){ _barMask.move(0, 0); if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0){ _barMask.setActualSize(_track.width, _track.height); } else { g = UIComponent(_barMask).graphics; g.clear(); g.beginFill(0xFFFF00); g.drawRect(1, 1, (_track.width - 2), (_track.height - 2)); g.endFill(); }; }; _labelField.text = getFullLabelText(); _indeterminateBar.visible = _indeterminate; if (((indeterminateChanged) || (visibleChanged))){ indeterminateChanged = false; visibleChanged = false; _indeterminateBar.visible = _indeterminate; if (((((((_indeterminate) && ((_source == null)))) && ((_mode == ProgressBarMode.EVENT)))) && (visible))){ startPlayingIndeterminate(); } else { stopPlayingIndeterminate(); }; }; if (_indeterminate){ _determinateBar.setActualSize(_track.width, _track.height); } else { w = Math.max(0, ((_track.width * percentComplete) / 100)); _determinateBar.setActualSize(w, _track.height); _determinateBar.x = ((direction == ProgressBarDirection.RIGHT)) ? 0 : (_track.width - w); }; } public function set direction(value:String):void{ if ((((value == ProgressBarDirection.LEFT)) || ((value == ProgressBarDirection.RIGHT)))){ _direction = value; }; invalidateDisplayList(); dispatchEvent(new Event("directionChanged")); } } }//package mx.controls
Section 49
//ProgressBarDirection (mx.controls.ProgressBarDirection) package mx.controls { public final class ProgressBarDirection { public static const LEFT:String = "left"; mx_internal static const VERSION:String = "3.0.0.0"; public static const RIGHT:String = "right"; public function ProgressBarDirection(){ super(); } } }//package mx.controls
Section 50
//ProgressBarLabelPlacement (mx.controls.ProgressBarLabelPlacement) package mx.controls { public final class ProgressBarLabelPlacement { public static const RIGHT:String = "right"; public static const LEFT:String = "left"; public static const BOTTOM:String = "bottom"; public static const TOP:String = "top"; mx_internal static const VERSION:String = "3.0.0.0"; public static const CENTER:String = "center"; public function ProgressBarLabelPlacement(){ super(); } } }//package mx.controls
Section 51
//ProgressBarMode (mx.controls.ProgressBarMode) package mx.controls { public final class ProgressBarMode { public static const MANUAL:String = "manual"; mx_internal static const VERSION:String = "3.0.0.0"; public static const EVENT:String = "event"; public static const POLLED:String = "polled"; public function ProgressBarMode(){ super(); } } }//package mx.controls
Section 52
//TextArea (mx.controls.TextArea) package mx.controls { import flash.display.*; import flash.text.*; import mx.core.*; import mx.managers.*; import flash.events.*; import mx.events.*; import mx.controls.listClasses.*; import flash.accessibility.*; import flash.system.*; public class TextArea extends ScrollControlBase implements IDataRenderer, IDropInListItemRenderer, IFocusManagerComponent, IIMESupport, IListItemRenderer, IFontContextComponent { private var _text:String;// = "" private var _selectable:Boolean;// = true private var _textWidth:Number; private var _restrict:String;// = null private var htmlTextChanged:Boolean;// = false private var _maxChars:int;// = 0 private var enabledChanged:Boolean;// = false private var _condenseWhite:Boolean;// = false private var accessibilityPropertiesChanged:Boolean;// = false private var _hScrollPosition:Number; private var _textHeight:Number; private var displayAsPasswordChanged:Boolean;// = false private var prevMode:String;// = null private var selectableChanged:Boolean;// = false private var restrictChanged:Boolean;// = false private var selectionChanged:Boolean;// = false private var maxCharsChanged:Boolean;// = false private var _tabIndex:int;// = -1 private var errorCaught:Boolean;// = false private var _selectionBeginIndex:int;// = 0 private var wordWrapChanged:Boolean;// = false private var _data:Object; private var explicitHTMLText:String;// = null private var styleSheetChanged:Boolean;// = false private var tabIndexChanged:Boolean;// = false private var editableChanged:Boolean;// = false private var _editable:Boolean;// = true private var allowScrollEvent:Boolean;// = true private var _imeMode:String;// = null private var condenseWhiteChanged:Boolean;// = false protected var textField:IUITextField; private var _listData:BaseListData; private var _displayAsPassword:Boolean;// = false private var _wordWrap:Boolean;// = true private var _styleSheet:StyleSheet; private var textChanged:Boolean;// = false private var _accessibilityProperties:AccessibilityProperties; private var _selectionEndIndex:int;// = 0 private var _htmlText:String;// = "" private var _vScrollPosition:Number; private var textSet:Boolean; mx_internal static const VERSION:String = "3.0.0.0"; public function TextArea(){ super(); tabChildren = true; _horizontalScrollPolicy = ScrollPolicy.AUTO; _verticalScrollPolicy = ScrollPolicy.AUTO; } public function get imeMode():String{ return (_imeMode); } public function set imeMode(value:String):void{ _imeMode = value; } override protected function focusOutHandler(event:FocusEvent):void{ var fm:IFocusManager = focusManager; if (fm){ fm.defaultButtonEnabled = true; }; super.focusOutHandler(event); if (((!((_imeMode == null))) && (_editable))){ if (((!((IME.conversionMode == IMEConversionMode.UNKNOWN))) && (!((prevMode == IMEConversionMode.UNKNOWN))))){ IME.conversionMode = prevMode; }; IME.enabled = false; }; dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT)); } mx_internal function getTextField():IUITextField{ return (textField); } private function textField_textInputHandler(event:TextEvent):void{ event.stopImmediatePropagation(); var newEvent:TextEvent = new TextEvent(TextEvent.TEXT_INPUT, false, true); newEvent.text = event.text; dispatchEvent(newEvent); if (newEvent.isDefaultPrevented()){ event.preventDefault(); }; } override public function get accessibilityProperties():AccessibilityProperties{ return (_accessibilityProperties); } override protected function createChildren():void{ super.createChildren(); createTextField(-1); } private function adjustScrollBars():void{ var visibleRows:Number = ((textField.bottomScrollV - textField.scrollV) + 1); var rows:Number = textField.numLines; setScrollBarProperties((textField.width + textField.maxScrollH), textField.width, textField.numLines, visibleRows); } private function textFieldChanged(styleChangeOnly:Boolean, dispatchValueCommitEvent:Boolean):void{ var changed1:Boolean; var changed2:Boolean; if (!styleChangeOnly){ changed1 = !((_text == textField.text)); _text = textField.text; }; changed2 = !((_htmlText == textField.htmlText)); _htmlText = textField.htmlText; if (changed1){ dispatchEvent(new Event("textChanged")); if (dispatchValueCommitEvent){ dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT)); }; }; if (changed2){ dispatchEvent(new Event("htmlTextChanged")); }; _textWidth = textField.textWidth; _textHeight = textField.textHeight; } private function textField_ioErrorHandler(event:IOErrorEvent):void{ } public function get text():String{ return (_text); } public function get styleSheet():StyleSheet{ return (_styleSheet); } mx_internal function createTextField(childIndex:int):void{ if (!textField){ textField = IUITextField(createInFontContext(UITextField)); textField.autoSize = TextFieldAutoSize.NONE; textField.enabled = enabled; textField.ignorePadding = true; textField.multiline = true; textField.selectable = true; textField.styleName = this; textField.tabEnabled = true; textField.type = TextFieldType.INPUT; textField.useRichTextClipboard = true; textField.wordWrap = true; textField.addEventListener(Event.CHANGE, textField_changeHandler); textField.addEventListener(Event.SCROLL, textField_scrollHandler); textField.addEventListener(IOErrorEvent.IO_ERROR, textField_ioErrorHandler); textField.addEventListener(TextEvent.TEXT_INPUT, textField_textInputHandler); textField.addEventListener("textFieldStyleChange", textField_textFieldStyleChangeHandler); textField.addEventListener("textFormatChange", textField_textFormatChangeHandler); textField.addEventListener("textInsert", textField_textModifiedHandler); textField.addEventListener("textReplace", textField_textModifiedHandler); if (childIndex == -1){ addChild(DisplayObject(textField)); } else { addChildAt(DisplayObject(textField), childIndex); }; }; } override public function get tabIndex():int{ return (_tabIndex); } override public function set accessibilityProperties(value:AccessibilityProperties):void{ if (value == _accessibilityProperties){ return; }; _accessibilityProperties = value; accessibilityPropertiesChanged = true; invalidateProperties(); } public function setSelection(beginIndex:int, endIndex:int):void{ _selectionBeginIndex = beginIndex; _selectionEndIndex = endIndex; selectionChanged = true; invalidateProperties(); } public function get condenseWhite():Boolean{ return (_condenseWhite); } override protected function isOurFocus(target:DisplayObject):Boolean{ return ((((target == textField)) || (super.isOurFocus(target)))); } public function get displayAsPassword():Boolean{ return (_displayAsPassword); } public function get selectionBeginIndex():int{ return ((textField) ? textField.selectionBeginIndex : _selectionBeginIndex); } public function get selectable():Boolean{ return (_selectable); } override public function set verticalScrollPosition(value:Number):void{ super.verticalScrollPosition = value; _vScrollPosition = value; if (textField){ textField.scrollV = (value + 1); textField.background = false; } else { invalidateProperties(); }; } public function set text(value:String):void{ textSet = true; if (!value){ value = ""; }; if (((!(isHTML)) && ((value == _text)))){ return; }; _text = value; textChanged = true; _htmlText = null; explicitHTMLText = null; invalidateProperties(); invalidateSize(); invalidateDisplayList(); dispatchEvent(new Event("textChanged")); dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT)); } public function set data(value:Object):void{ var newText:*; _data = value; if (_listData){ newText = _listData.label; } else { if (_data != null){ if ((_data is String)){ newText = String(_data); } else { newText = _data.toString(); }; }; }; if (((!((newText === undefined))) && (!(textSet)))){ text = newText; textSet = false; }; dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE)); } public function set styleSheet(value:StyleSheet):void{ _styleSheet = value; styleSheetChanged = true; htmlTextChanged = true; invalidateProperties(); } override protected function measure():void{ super.measure(); measuredMinWidth = DEFAULT_MEASURED_MIN_WIDTH; measuredWidth = DEFAULT_MEASURED_WIDTH; measuredMinHeight = (measuredHeight = (2 * DEFAULT_MEASURED_MIN_HEIGHT)); } public function get fontContext():IFlexModuleFactory{ return (moduleFactory); } public function get selectionEndIndex():int{ return ((textField) ? textField.selectionEndIndex : _selectionEndIndex); } public function get editable():Boolean{ return (_editable); } override protected function focusInHandler(event:FocusEvent):void{ var message:String; var event = event; if (event.target == this){ systemManager.stage.focus = TextField(textField); }; var fm:IFocusManager = focusManager; if (((editable) && (fm))){ fm.showFocusIndicator = true; }; if (fm){ fm.defaultButtonEnabled = false; }; super.focusInHandler(event); if (((!((_imeMode == null))) && (_editable))){ IME.enabled = true; prevMode = IME.conversionMode; if (((!(errorCaught)) && (!((IME.conversionMode == IMEConversionMode.UNKNOWN))))){ IME.conversionMode = _imeMode; }; errorCaught = false; //unresolved jump var _slot1 = e; errorCaught = true; message = resourceManager.getString("controls", "unsupportedMode", [_imeMode]); throw (new Error(message)); }; } public function get listData():BaseListData{ return (_listData); } public function get wordWrap():Boolean{ return (_wordWrap); } override public function set tabIndex(value:int):void{ if (value == _tabIndex){ return; }; _tabIndex = value; tabIndexChanged = true; invalidateProperties(); } public function get htmlText():String{ return (_htmlText); } override public function set enabled(value:Boolean):void{ if (value == enabled){ return; }; super.enabled = value; enabledChanged = true; if (verticalScrollBar){ verticalScrollBar.enabled = value; }; if (horizontalScrollBar){ horizontalScrollBar.enabled = value; }; invalidateProperties(); if (((border) && ((border is IInvalidating)))){ IInvalidating(border).invalidateDisplayList(); }; } private function textField_textFieldStyleChangeHandler(event:Event):void{ textFieldChanged(true, false); } public function set restrict(value:String):void{ if (value == _restrict){ return; }; _restrict = value; restrictChanged = true; invalidateProperties(); dispatchEvent(new Event("restrictChanged")); } override public function get baselinePosition():Number{ var t:String; if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){ t = text; if (((!(t)) || ((t == "")))){ t = " "; }; return ((viewMetrics.top + measureText(t).ascent)); }; if (!validateBaselinePosition()){ return (NaN); }; return ((textField.y + textField.baselinePosition)); } private function textField_changeHandler(event:Event):void{ textFieldChanged(false, false); adjustScrollBars(); textChanged = false; htmlTextChanged = false; event.stopImmediatePropagation(); dispatchEvent(new Event(Event.CHANGE)); } public function set condenseWhite(value:Boolean):void{ if (value == _condenseWhite){ return; }; _condenseWhite = value; condenseWhiteChanged = true; if (isHTML){ htmlTextChanged = true; }; invalidateProperties(); invalidateSize(); invalidateDisplayList(); dispatchEvent(new Event("condenseWhiteChanged")); } public function get textWidth():Number{ return (_textWidth); } public function set displayAsPassword(value:Boolean):void{ if (value == _displayAsPassword){ return; }; _displayAsPassword = value; displayAsPasswordChanged = true; invalidateProperties(); invalidateSize(); invalidateDisplayList(); dispatchEvent(new Event("displayAsPasswordChanged")); } override public function get horizontalScrollPolicy():String{ return (((height <= 40)) ? ScrollPolicy.OFF : _horizontalScrollPolicy); } public function get data():Object{ return (_data); } override public function get maxVerticalScrollPosition():Number{ return ((textField) ? (textField.maxScrollV - 1) : 0); } public function set maxChars(value:int):void{ if (value == _maxChars){ return; }; _maxChars = value; maxCharsChanged = true; invalidateProperties(); dispatchEvent(new Event("maxCharsChanged")); } public function set selectable(value:Boolean):void{ if (value == selectable){ return; }; _selectable = value; selectableChanged = true; invalidateProperties(); } override public function set horizontalScrollPosition(value:Number):void{ super.horizontalScrollPosition = value; _hScrollPosition = value; if (textField){ textField.scrollH = value; textField.background = false; } else { invalidateProperties(); }; } override public function setFocus():void{ var vScrollPos:int = verticalScrollPosition; allowScrollEvent = false; textField.setFocus(); verticalScrollPosition = vScrollPos; allowScrollEvent = true; } public function set selectionBeginIndex(value:int):void{ _selectionBeginIndex = value; selectionChanged = true; invalidateProperties(); } public function get restrict():String{ return (_restrict); } override protected function scrollHandler(event:Event):void{ if ((event is ScrollEvent)){ if (((!(liveScrolling)) && ((ScrollEvent(event).detail == ScrollEventDetail.THUMB_TRACK)))){ return; }; super.scrollHandler(event); textField.scrollH = horizontalScrollPosition; textField.scrollV = (verticalScrollPosition + 1); _vScrollPosition = (textField.scrollV - 1); _hScrollPosition = textField.scrollH; }; } public function set fontContext(moduleFactory:IFlexModuleFactory):void{ this.moduleFactory = moduleFactory; } mx_internal function removeTextField():void{ if (textField){ textField.removeEventListener(Event.CHANGE, textField_changeHandler); textField.removeEventListener(Event.SCROLL, textField_scrollHandler); textField.removeEventListener(IOErrorEvent.IO_ERROR, textField_ioErrorHandler); textField.removeEventListener(TextEvent.TEXT_INPUT, textField_textInputHandler); textField.removeEventListener("textFieldStyleChange", textField_textFieldStyleChangeHandler); textField.removeEventListener("textFormatChange", textField_textFormatChangeHandler); textField.removeEventListener("textInsert", textField_textModifiedHandler); textField.removeEventListener("textReplace", textField_textModifiedHandler); removeChild(DisplayObject(textField)); textField = null; }; } public function set selectionEndIndex(value:int):void{ _selectionEndIndex = value; selectionChanged = true; invalidateProperties(); } public function get textHeight():Number{ return (_textHeight); } public function set editable(value:Boolean):void{ if (value == _editable){ return; }; _editable = value; editableChanged = true; invalidateProperties(); dispatchEvent(new Event("editableChanged")); } override protected function commitProperties():void{ super.commitProperties(); if (((hasFontContextChanged()) && (!((textField == null))))){ removeTextField(); createTextField(-1); accessibilityPropertiesChanged = true; condenseWhiteChanged = true; displayAsPasswordChanged = true; editableChanged = true; enabledChanged = true; maxCharsChanged = true; restrictChanged = true; selectableChanged = true; tabIndexChanged = true; wordWrapChanged = true; textChanged = true; selectionChanged = true; }; if (accessibilityPropertiesChanged){ textField.accessibilityProperties = _accessibilityProperties; accessibilityPropertiesChanged = false; }; if (condenseWhiteChanged){ textField.condenseWhite = _condenseWhite; condenseWhiteChanged = false; }; if (displayAsPasswordChanged){ textField.displayAsPassword = _displayAsPassword; displayAsPasswordChanged = false; }; if (editableChanged){ textField.type = (((_editable) && (enabled))) ? TextFieldType.INPUT : TextFieldType.DYNAMIC; editableChanged = false; }; if (enabledChanged){ textField.enabled = enabled; enabledChanged = false; }; if (maxCharsChanged){ textField.maxChars = _maxChars; maxCharsChanged = false; }; if (restrictChanged){ textField.restrict = _restrict; restrictChanged = false; }; if (selectableChanged){ textField.selectable = _selectable; selectableChanged = false; }; if (styleSheetChanged){ textField.styleSheet = _styleSheet; styleSheetChanged = false; }; if (tabIndexChanged){ textField.tabIndex = _tabIndex; tabIndexChanged = false; }; if (wordWrapChanged){ textField.wordWrap = _wordWrap; wordWrapChanged = false; }; if (((textChanged) || (htmlTextChanged))){ if (isHTML){ textField.htmlText = explicitHTMLText; } else { textField.text = _text; }; textFieldChanged(false, true); textChanged = false; htmlTextChanged = false; }; if (selectionChanged){ textField.setSelection(_selectionBeginIndex, _selectionEndIndex); selectionChanged = false; }; if (!isNaN(_hScrollPosition)){ horizontalScrollPosition = _hScrollPosition; }; if (!isNaN(_vScrollPosition)){ verticalScrollPosition = _vScrollPosition; }; } private function get isHTML():Boolean{ return (!((explicitHTMLText == null))); } public function set listData(value:BaseListData):void{ _listData = value; } public function get maxChars():int{ return (_maxChars); } override public function get maxHorizontalScrollPosition():Number{ return ((textField) ? textField.maxScrollH : 0); } override protected function mouseWheelHandler(event:MouseEvent):void{ event.stopPropagation(); } private function textField_scrollHandler(event:Event):void{ var deltaX:int; var deltaY:int; var scrollEvent:ScrollEvent; if (((initialized) && (allowScrollEvent))){ deltaX = (textField.scrollH - horizontalScrollPosition); deltaY = ((textField.scrollV - 1) - verticalScrollPosition); horizontalScrollPosition = textField.scrollH; verticalScrollPosition = (textField.scrollV - 1); if (deltaX){ scrollEvent = new ScrollEvent(ScrollEvent.SCROLL, false, false, null, horizontalScrollPosition, ScrollEventDirection.HORIZONTAL, deltaX); dispatchEvent(scrollEvent); }; if (deltaY){ scrollEvent = new ScrollEvent(ScrollEvent.SCROLL, false, false, null, verticalScrollPosition, ScrollEventDirection.VERTICAL, deltaY); dispatchEvent(scrollEvent); }; }; } public function set wordWrap(value:Boolean):void{ if (value == _wordWrap){ return; }; _wordWrap = value; wordWrapChanged = true; invalidateProperties(); invalidateDisplayList(); dispatchEvent(new Event("wordWrapChanged")); } private function textField_textModifiedHandler(event:Event):void{ textFieldChanged(false, true); } private function textField_textFormatChangeHandler(event:Event):void{ textFieldChanged(true, false); } public function set htmlText(value:String):void{ textSet = true; if (!value){ value = ""; }; _htmlText = value; htmlTextChanged = true; _text = null; explicitHTMLText = value; invalidateProperties(); invalidateSize(); invalidateDisplayList(); dispatchEvent(new Event("htmlTextChanged")); } override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{ super.updateDisplayList(unscaledWidth, unscaledHeight); var vm:EdgeMetrics = viewMetrics; vm.left = (vm.left + getStyle("paddingLeft")); vm.top = (vm.top + getStyle("paddingTop")); vm.right = (vm.right + getStyle("paddingRight")); vm.bottom = (vm.bottom + getStyle("paddingBottom")); textField.move(vm.left, vm.top); var w:Number = ((unscaledWidth - vm.left) - vm.right); var h:Number = ((unscaledHeight - vm.top) - vm.bottom); if ((vm.top + vm.bottom) > 0){ h++; }; textField.setActualSize(Math.max(4, w), Math.max(4, h)); if (!initialized){ callLater(invalidateDisplayList); } else { callLater(adjustScrollBars); }; if (isNaN(_hScrollPosition)){ _hScrollPosition = 0; }; if (isNaN(_vScrollPosition)){ _vScrollPosition = 0; }; var p:Number = Math.min(textField.maxScrollH, _hScrollPosition); if (p != textField.scrollH){ horizontalScrollPosition = p; }; p = Math.min((textField.maxScrollV - 1), _vScrollPosition); if (p != (textField.scrollV - 1)){ verticalScrollPosition = p; }; } public function getLineMetrics(lineIndex:int):TextLineMetrics{ return ((textField) ? textField.getLineMetrics(lineIndex) : null); } override public function get verticalScrollPolicy():String{ return (((height <= 40)) ? ScrollPolicy.OFF : _verticalScrollPolicy); } public function get length():int{ return (((text)!=null) ? text.length : -1); } } }//package mx.controls
Section 53
//TextInput (mx.controls.TextInput) package mx.controls { import flash.display.*; import flash.text.*; import mx.core.*; import mx.managers.*; import flash.events.*; import mx.events.*; import mx.styles.*; import mx.controls.listClasses.*; import flash.accessibility.*; import flash.ui.*; import flash.system.*; public class TextInput extends UIComponent implements IDataRenderer, IDropInListItemRenderer, IFocusManagerComponent, IIMESupport, IListItemRenderer, IFontContextComponent { private var _text:String;// = "" private var _textWidth:Number; private var _restrict:String; private var htmlTextChanged:Boolean;// = false mx_internal var border:IFlexDisplayObject; private var enabledChanged:Boolean;// = false private var _maxChars:int;// = 0 private var _condenseWhite:Boolean;// = false private var accessibilityPropertiesChanged:Boolean;// = false private var _textHeight:Number; private var displayAsPasswordChanged:Boolean;// = false private var prevMode:String;// = null private var selectableChanged:Boolean;// = false private var restrictChanged:Boolean;// = false private var selectionChanged:Boolean;// = false private var _data:Object; private var maxCharsChanged:Boolean;// = false private var _tabIndex:int;// = -1 private var errorCaught:Boolean;// = false private var _selectionBeginIndex:int;// = 0 private var explicitHTMLText:String;// = null private var editableChanged:Boolean;// = false mx_internal var parentDrawsFocus:Boolean;// = false private var tabIndexChanged:Boolean;// = false private var _horizontalScrollPosition:Number;// = 0 private var _editable:Boolean;// = true private var _imeMode:String;// = null private var condenseWhiteChanged:Boolean;// = false protected var textField:IUITextField; private var _listData:BaseListData; private var _displayAsPassword:Boolean;// = false private var textChanged:Boolean;// = false private var _htmlText:String;// = "" private var _accessibilityProperties:AccessibilityProperties; private var _selectionEndIndex:int;// = 0 private var textSet:Boolean; private var horizontalScrollPositionChanged:Boolean;// = false private var _selectable:Boolean;// = true mx_internal static const VERSION:String = "3.0.0.0"; public function TextInput(){ super(); tabChildren = true; } public function get imeMode():String{ return (_imeMode); } public function set imeMode(value:String):void{ _imeMode = value; } override protected function focusOutHandler(event:FocusEvent):void{ super.focusOutHandler(event); if (((!((_imeMode == null))) && (_editable))){ if (((!((IME.conversionMode == IMEConversionMode.UNKNOWN))) && (!((prevMode == IMEConversionMode.UNKNOWN))))){ IME.conversionMode = prevMode; }; IME.enabled = false; }; dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT)); } override public function drawFocus(isFocused:Boolean):void{ if (parentDrawsFocus){ IFocusManagerComponent(parent).drawFocus(isFocused); return; }; super.drawFocus(isFocused); } mx_internal function getTextField():IUITextField{ return (textField); } private function textField_textInputHandler(event:TextEvent):void{ event.stopImmediatePropagation(); var newEvent:TextEvent = new TextEvent(TextEvent.TEXT_INPUT, false, true); newEvent.text = event.text; dispatchEvent(newEvent); if (newEvent.isDefaultPrevented()){ event.preventDefault(); }; } override public function get accessibilityProperties():AccessibilityProperties{ return (_accessibilityProperties); } override protected function createChildren():void{ super.createChildren(); createBorder(); createTextField(-1); } private function textFieldChanged(styleChangeOnly:Boolean, dispatchValueCommitEvent:Boolean):void{ var changed1:Boolean; var changed2:Boolean; if (!styleChangeOnly){ changed1 = !((_text == textField.text)); _text = textField.text; }; changed2 = !((_htmlText == textField.htmlText)); _htmlText = textField.htmlText; if (changed1){ dispatchEvent(new Event("textChanged")); if (dispatchValueCommitEvent){ dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT)); }; }; if (changed2){ dispatchEvent(new Event("htmlTextChanged")); }; _textWidth = textField.textWidth; _textHeight = textField.textHeight; } public function get text():String{ return (_text); } mx_internal function createTextField(childIndex:int):void{ if (!textField){ textField = IUITextField(createInFontContext(UITextField)); textField.autoSize = TextFieldAutoSize.NONE; textField.enabled = enabled; textField.ignorePadding = false; textField.multiline = false; textField.tabEnabled = true; textField.wordWrap = false; if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){ textField.styleName = this; }; textField.addEventListener(Event.CHANGE, textField_changeHandler); textField.addEventListener(TextEvent.TEXT_INPUT, textField_textInputHandler); textField.addEventListener(Event.SCROLL, textField_scrollHandler); textField.addEventListener("textFieldStyleChange", textField_textFieldStyleChangeHandler); textField.addEventListener("textFormatChange", textField_textFormatChangeHandler); textField.addEventListener("textInsert", textField_textModifiedHandler); textField.addEventListener("textReplace", textField_textModifiedHandler); if (childIndex == -1){ addChild(DisplayObject(textField)); } else { addChildAt(DisplayObject(textField), childIndex); }; }; } override public function get tabIndex():int{ return (_tabIndex); } override public function set accessibilityProperties(value:AccessibilityProperties):void{ if (value == _accessibilityProperties){ return; }; _accessibilityProperties = value; accessibilityPropertiesChanged = true; invalidateProperties(); } public function setSelection(beginIndex:int, endIndex:int):void{ _selectionBeginIndex = beginIndex; _selectionEndIndex = endIndex; selectionChanged = true; invalidateProperties(); } public function get condenseWhite():Boolean{ return (_condenseWhite); } override protected function isOurFocus(target:DisplayObject):Boolean{ return ((((target == textField)) || (super.isOurFocus(target)))); } public function get displayAsPassword():Boolean{ return (_displayAsPassword); } public function set data(value:Object):void{ var newText:*; _data = value; if (_listData){ newText = _listData.label; } else { if (_data != null){ if ((_data is String)){ newText = String(_data); } else { newText = _data.toString(); }; }; }; if (((!((newText === undefined))) && (!(textSet)))){ text = newText; textSet = false; }; dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE)); } public function get selectionBeginIndex():int{ return ((textField) ? textField.selectionBeginIndex : _selectionBeginIndex); } mx_internal function get selectable():Boolean{ return (_selectable); } protected function createBorder():void{ var borderClass:Class; if (!border){ borderClass = getStyle("borderSkin"); if (borderClass != null){ border = new (borderClass); if ((border is ISimpleStyleClient)){ ISimpleStyleClient(border).styleName = this; }; addChildAt(DisplayObject(border), 0); invalidateDisplayList(); }; }; } public function get horizontalScrollPosition():Number{ return (_horizontalScrollPosition); } override protected function measure():void{ var w:Number; var h:Number; var lineMetrics:TextLineMetrics; super.measure(); var bm:EdgeMetrics = (((border) && ((border is IRectangularBorder)))) ? IRectangularBorder(border).borderMetrics : EdgeMetrics.EMPTY; measuredWidth = DEFAULT_MEASURED_WIDTH; if (maxChars){ measuredWidth = Math.min(measuredWidth, ((((measureText("W").width * maxChars) + bm.left) + bm.right) + 8)); }; if (((!(text)) || ((text == "")))){ w = DEFAULT_MEASURED_MIN_WIDTH; h = (((measureText(" ").height + bm.top) + bm.bottom) + UITextField.TEXT_HEIGHT_PADDING); if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0){ h = (h + (getStyle("paddingTop") + getStyle("paddingBottom"))); }; } else { lineMetrics = measureText(text); w = (((lineMetrics.width + bm.left) + bm.right) + 8); h = (((lineMetrics.height + bm.top) + bm.bottom) + UITextField.TEXT_HEIGHT_PADDING); if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0){ w = (w + (getStyle("paddingLeft") + getStyle("paddingRight"))); h = (h + (getStyle("paddingTop") + getStyle("paddingBottom"))); }; }; measuredWidth = Math.max(w, measuredWidth); measuredHeight = Math.max(h, DEFAULT_MEASURED_HEIGHT); measuredMinWidth = DEFAULT_MEASURED_MIN_WIDTH; measuredMinHeight = DEFAULT_MEASURED_MIN_HEIGHT; } public function get fontContext():IFlexModuleFactory{ return (moduleFactory); } public function set text(value:String):void{ textSet = true; if (!value){ value = ""; }; if (((!(isHTML)) && ((value == _text)))){ return; }; _text = value; textChanged = true; _htmlText = null; explicitHTMLText = null; invalidateProperties(); invalidateSize(); invalidateDisplayList(); dispatchEvent(new Event("textChanged")); dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT)); } public function get selectionEndIndex():int{ return ((textField) ? textField.selectionEndIndex : _selectionEndIndex); } public function get editable():Boolean{ return (_editable); } public function get listData():BaseListData{ return (_listData); } override protected function keyDownHandler(event:KeyboardEvent):void{ switch (event.keyCode){ case Keyboard.ENTER: dispatchEvent(new FlexEvent(FlexEvent.ENTER)); break; }; } override protected function focusInHandler(event:FocusEvent):void{ var message:String; var event = event; if (event.target == this){ systemManager.stage.focus = TextField(textField); }; var fm:IFocusManager = focusManager; if (((editable) && (fm))){ fm.showFocusIndicator = true; if (((textField.selectable) && ((_selectionBeginIndex == _selectionEndIndex)))){ textField.setSelection(0, textField.length); }; }; super.focusInHandler(event); if (((!((_imeMode == null))) && (_editable))){ IME.enabled = true; prevMode = IME.conversionMode; if (((!(errorCaught)) && (!((IME.conversionMode == IMEConversionMode.UNKNOWN))))){ IME.conversionMode = _imeMode; }; errorCaught = false; //unresolved jump var _slot1 = e; errorCaught = true; message = resourceManager.getString("controls", "unsupportedMode", [_imeMode]); throw (new Error(message)); }; } public function get htmlText():String{ return (_htmlText); } override public function set tabIndex(value:int):void{ if (value == _tabIndex){ return; }; _tabIndex = value; tabIndexChanged = true; invalidateProperties(); } public function set restrict(value:String):void{ if (value == _restrict){ return; }; _restrict = value; restrictChanged = true; invalidateProperties(); dispatchEvent(new Event("restrictChanged")); } private function textField_textFieldStyleChangeHandler(event:Event):void{ textFieldChanged(true, false); } private function textField_changeHandler(event:Event):void{ textFieldChanged(false, false); textChanged = false; htmlTextChanged = false; event.stopImmediatePropagation(); dispatchEvent(new Event(Event.CHANGE)); } override public function set enabled(value:Boolean):void{ if (value == enabled){ return; }; super.enabled = value; enabledChanged = true; invalidateProperties(); if (((border) && ((border is IInvalidating)))){ IInvalidating(border).invalidateDisplayList(); }; } override public function get baselinePosition():Number{ var t:String; if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){ t = text; if (t == ""){ t = " "; }; return (((((border) && ((border is IRectangularBorder)))) ? IRectangularBorder(border).borderMetrics.top : 0 + measureText(t).ascent)); }; if (!validateBaselinePosition()){ return (NaN); }; return ((textField.y + textField.baselinePosition)); } public function set condenseWhite(value:Boolean):void{ if (value == _condenseWhite){ return; }; _condenseWhite = value; condenseWhiteChanged = true; if (isHTML){ htmlTextChanged = true; }; invalidateProperties(); invalidateSize(); invalidateDisplayList(); dispatchEvent(new Event("condenseWhiteChanged")); } public function get textWidth():Number{ return (_textWidth); } public function set displayAsPassword(value:Boolean):void{ if (value == _displayAsPassword){ return; }; _displayAsPassword = value; displayAsPasswordChanged = true; invalidateProperties(); invalidateSize(); invalidateDisplayList(); dispatchEvent(new Event("displayAsPasswordChanged")); } mx_internal function removeTextField():void{ if (textField){ textField.removeEventListener(Event.CHANGE, textField_changeHandler); textField.removeEventListener(TextEvent.TEXT_INPUT, textField_textInputHandler); textField.removeEventListener(Event.SCROLL, textField_scrollHandler); textField.removeEventListener("textFieldStyleChange", textField_textFieldStyleChangeHandler); textField.removeEventListener("textFormatChange", textField_textFormatChangeHandler); textField.removeEventListener("textInsert", textField_textModifiedHandler); textField.removeEventListener("textReplace", textField_textModifiedHandler); removeChild(DisplayObject(textField)); textField = null; }; } public function get data():Object{ return (_data); } public function set maxChars(value:int):void{ if (value == _maxChars){ return; }; _maxChars = value; maxCharsChanged = true; invalidateProperties(); dispatchEvent(new Event("maxCharsChanged")); } public function set horizontalScrollPosition(value:Number):void{ if (value == _horizontalScrollPosition){ return; }; _horizontalScrollPosition = value; horizontalScrollPositionChanged = true; invalidateProperties(); dispatchEvent(new Event("horizontalScrollPositionChanged")); } override public function setFocus():void{ textField.setFocus(); } public function get restrict():String{ return (_restrict); } public function set fontContext(moduleFactory:IFlexModuleFactory):void{ this.moduleFactory = moduleFactory; } public function set selectionBeginIndex(value:int):void{ _selectionBeginIndex = value; selectionChanged = true; invalidateProperties(); } public function set selectionEndIndex(value:int):void{ _selectionEndIndex = value; selectionChanged = true; invalidateProperties(); } private function textField_scrollHandler(event:Event):void{ _horizontalScrollPosition = textField.scrollH; } public function get textHeight():Number{ return (_textHeight); } public function set editable(value:Boolean):void{ if (value == _editable){ return; }; _editable = value; editableChanged = true; invalidateProperties(); dispatchEvent(new Event("editableChanged")); } override protected function commitProperties():void{ var childIndex:int; super.commitProperties(); if (((hasFontContextChanged()) && (!((textField == null))))){ childIndex = getChildIndex(DisplayObject(textField)); removeTextField(); createTextField(childIndex); accessibilityPropertiesChanged = true; condenseWhiteChanged = true; displayAsPasswordChanged = true; enabledChanged = true; maxCharsChanged = true; restrictChanged = true; tabIndexChanged = true; textChanged = true; selectionChanged = true; horizontalScrollPositionChanged = true; }; if (accessibilityPropertiesChanged){ textField.accessibilityProperties = _accessibilityProperties; accessibilityPropertiesChanged = false; }; if (condenseWhiteChanged){ textField.condenseWhite = _condenseWhite; condenseWhiteChanged = false; }; if (displayAsPasswordChanged){ textField.displayAsPassword = _displayAsPassword; displayAsPasswordChanged = false; }; if (((enabledChanged) || (editableChanged))){ textField.type = (((enabled) && (_editable))) ? TextFieldType.INPUT : TextFieldType.DYNAMIC; if (enabledChanged){ if (textField.enabled != enabled){ textField.enabled = enabled; }; enabledChanged = false; }; selectableChanged = true; editableChanged = false; }; if (selectableChanged){ if (_editable){ textField.selectable = enabled; } else { textField.selectable = ((enabled) && (_selectable)); }; selectableChanged = false; }; if (maxCharsChanged){ textField.maxChars = _maxChars; maxCharsChanged = false; }; if (restrictChanged){ textField.restrict = _restrict; restrictChanged = false; }; if (tabIndexChanged){ textField.tabIndex = _tabIndex; tabIndexChanged = false; }; if (((textChanged) || (htmlTextChanged))){ if (isHTML){ textField.htmlText = explicitHTMLText; } else { textField.text = _text; }; textFieldChanged(false, true); textChanged = false; htmlTextChanged = false; }; if (selectionChanged){ textField.setSelection(_selectionBeginIndex, _selectionEndIndex); selectionChanged = false; }; if (horizontalScrollPositionChanged){ textField.scrollH = _horizontalScrollPosition; horizontalScrollPositionChanged = false; }; } override public function styleChanged(styleProp:String):void{ var allStyles:Boolean = (((styleProp == null)) || ((styleProp == "styleName"))); super.styleChanged(styleProp); if (((allStyles) || ((styleProp == "borderSkin")))){ if (border){ removeChild(DisplayObject(border)); border = null; createBorder(); }; }; } private function get isHTML():Boolean{ return (!((explicitHTMLText == null))); } public function get maxChars():int{ return (_maxChars); } public function get maxHorizontalScrollPosition():Number{ return ((textField) ? textField.maxScrollH : 0); } mx_internal function set selectable(value:Boolean):void{ if (_selectable == value){ return; }; _selectable = value; selectableChanged = true; invalidateProperties(); } public function get length():int{ return (((text)!=null) ? text.length : -1); } public function set listData(value:BaseListData):void{ _listData = value; } private function textField_textModifiedHandler(event:Event):void{ textFieldChanged(false, true); } private function textField_textFormatChangeHandler(event:Event):void{ textFieldChanged(true, false); } public function set htmlText(value:String):void{ textSet = true; if (!value){ value = ""; }; _htmlText = value; htmlTextChanged = true; _text = null; explicitHTMLText = value; invalidateProperties(); invalidateSize(); invalidateDisplayList(); dispatchEvent(new Event("htmlTextChanged")); } override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{ var bm:EdgeMetrics; super.updateDisplayList(unscaledWidth, unscaledHeight); if (border){ border.setActualSize(unscaledWidth, unscaledHeight); bm = ((border is IRectangularBorder)) ? IRectangularBorder(border).borderMetrics : EdgeMetrics.EMPTY; } else { bm = EdgeMetrics.EMPTY; }; var paddingLeft:Number = getStyle("paddingLeft"); var paddingRight:Number = getStyle("paddingRight"); var paddingTop:Number = getStyle("paddingTop"); var paddingBottom:Number = getStyle("paddingBottom"); var widthPad:Number = (bm.left + bm.right); var heightPad:Number = ((bm.top + bm.bottom) + 1); textField.x = bm.left; textField.y = bm.top; if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0){ textField.x = (textField.x + paddingLeft); textField.y = (textField.y + paddingTop); widthPad = (widthPad + (paddingLeft + paddingRight)); heightPad = (heightPad + (paddingTop + paddingBottom)); }; textField.width = Math.max(0, (unscaledWidth - widthPad)); textField.height = Math.max(0, (unscaledHeight - heightPad)); } public function getLineMetrics(lineIndex:int):TextLineMetrics{ return ((textField) ? textField.getLineMetrics(lineIndex) : null); } } }//package mx.controls
Section 54
//ToolTip (mx.controls.ToolTip) package mx.controls { import flash.display.*; import flash.text.*; import mx.core.*; 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.0.0.0"; 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 55
//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.0.0.0"; 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 56
//Application (mx.core.Application) package mx.core { import flash.display.*; import mx.managers.*; import flash.events.*; import mx.events.*; import mx.styles.*; import mx.effects.*; import flash.utils.*; import mx.containers.utilityClasses.*; import flash.ui.*; import flash.system.*; import flash.external.*; import flash.net.*; 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.0.0.0"; 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.isTopLevel()) && ((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 57
//ApplicationGlobals (mx.core.ApplicationGlobals) package mx.core { public class ApplicationGlobals { public static var application:Object; public function ApplicationGlobals(){ super(); } } }//package mx.core
Section 58
//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.0.0.0"; 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 59
//Container (mx.core.Container) package mx.core { import flash.display.*; import flash.geom.*; import flash.text.*; import mx.managers.*; import flash.events.*; import mx.events.*; import mx.styles.*; import mx.controls.*; import mx.graphics.*; import mx.controls.scrollClasses.*; import mx.binding.*; import mx.controls.listClasses.*; import flash.utils.*; import flash.ui.*; 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.0.0.0"; 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)); 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))))){ 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); }; if ((child is IDeferredInstantiationUIComponent)){ IDeferredInstantiationUIComponent(child).executeBindings(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 60
//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.0.0.0"; public static const AUTO:String = "auto"; public function ContainerCreationPolicy(){ super(); } } }//package mx.core
Section 61
//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 62
//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.0.0.0"; public function ContainerLayout(){ super(); } } }//package mx.core
Section 63
//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.0.0.0"; 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 64
//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.0.0.0"; 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 65
//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.0.0.0"; 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 66
//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.0.0.0"; 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 67
//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.0.0.0"; 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 68
//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.0.0.0"; public function EventPriority(){ super(); } } }//package mx.core
Section 69
//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.0.0.0"; 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 70
//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.0.0.0"; 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 71
//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.0.0.0"; 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 72
//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.0.0.0"; 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 73
//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.0.0.0"; 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 74
//IBorder (mx.core.IBorder) package mx.core { public interface IBorder { function get borderMetrics():EdgeMetrics; } }//package mx.core
Section 75
//IButton (mx.core.IButton) package mx.core { public interface IButton extends IUIComponent { function get emphasized():Boolean; function set emphasized(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IButton.as:Boolean):void; function callLater(_arg1:Function, _arg2:Array=null):void; } }//package mx.core
Section 76
//IChildList (mx.core.IChildList) package mx.core { import flash.display.*; import flash.geom.*; public interface IChildList { function get numChildren():int; function removeChild(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IChildList.as:DisplayObject):DisplayObject; function getChildByName(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IChildList.as:String):DisplayObject; function removeChildAt(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IChildList.as:int):DisplayObject; function addChild(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IChildList.as:DisplayObject):DisplayObject; function contains(flash.display:DisplayObject):Boolean; } }//package mx.core
Section 77
//IConstraintClient (mx.core.IConstraintClient) package mx.core { public interface IConstraintClient { function setConstraintValue(_arg1:String, _arg2):void; function getConstraintValue(*:String); } }//package mx.core
Section 78
//IContainer (mx.core.IContainer) package mx.core { import flash.display.*; import flash.geom.*; import flash.media.*; import flash.text.*; import mx.managers.*; 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(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ISpriteInterface.as:Point):Boolean; } }//package mx.core
Section 79
//IDataRenderer (mx.core.IDataRenderer) package mx.core { public interface IDataRenderer { function get data():Object; function set data(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IDataRenderer.as:Object):void; } }//package mx.core
Section 80
//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 81
//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 82
//IFlexAsset (mx.core.IFlexAsset) package mx.core { public interface IFlexAsset { } }//package mx.core
Section 83
//IFlexDisplayObject (mx.core.IFlexDisplayObject) package mx.core { import flash.display.*; import flash.geom.*; import flash.accessibility.*; import flash.events.*; 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 84
//IFlexModule (mx.core.IFlexModule) package mx.core { public interface IFlexModule { function set moduleFactory(:IFlexModuleFactory):void; function get moduleFactory():IFlexModuleFactory; } }//package mx.core
Section 85
//IFlexModuleFactory (mx.core.IFlexModuleFactory) package mx.core { public interface IFlexModuleFactory { function create(... _args):Object; function info():Object; } }//package mx.core
Section 86
//IFontContextComponent (mx.core.IFontContextComponent) package mx.core { public interface IFontContextComponent { function get fontContext():IFlexModuleFactory; function set fontContext(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IFontContextComponent.as:IFlexModuleFactory):void; } }//package mx.core
Section 87
//IIMESupport (mx.core.IIMESupport) package mx.core { public interface IIMESupport { function set imeMode(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IIMESupport.as:String):void; function get imeMode():String; } }//package mx.core
Section 88
//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 89
//IMXMLObject (mx.core.IMXMLObject) package mx.core { public interface IMXMLObject { function initialized(_arg1:Object, _arg2:String):void; } }//package mx.core
Section 90
//IProgrammaticSkin (mx.core.IProgrammaticSkin) package mx.core { public interface IProgrammaticSkin { function validateNow():void; function validateDisplayList():void; } }//package mx.core
Section 91
//IPropertyChangeNotifier (mx.core.IPropertyChangeNotifier) package mx.core { import flash.events.*; public interface IPropertyChangeNotifier extends IEventDispatcher, IUID { } }//package mx.core
Section 92
//IRawChildrenContainer (mx.core.IRawChildrenContainer) package mx.core { public interface IRawChildrenContainer { function get rawChildren():IChildList; } }//package mx.core
Section 93
//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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IRectangularBorder.as:Rectangle):void; function layoutBackgroundImage():void; } }//package mx.core
Section 94
//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 95
//IRepeaterClient (mx.core.IRepeaterClient) package mx.core { public interface IRepeaterClient { function get instanceIndices():Array; function set instanceIndices(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void; function get isDocument():Boolean; function set repeaters(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void; function initializeRepeaterArrays(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:IRepeaterClient):void; function get repeaters():Array; function set repeaterIndices(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void; function get repeaterIndices():Array; } }//package mx.core
Section 96
//IStateClient (mx.core.IStateClient) package mx.core { public interface IStateClient { function get currentState():String; function set currentState(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IStateClient.as:String):void; } }//package mx.core
Section 97
//ITextFieldFactory (mx.core.ITextFieldFactory) package mx.core { import flash.text.*; public interface ITextFieldFactory { function createTextField(:IFlexModuleFactory):TextField; } }//package mx.core
Section 98
//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 99
//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 100
//IUID (mx.core.IUID) package mx.core { public interface IUID { function get uid():String; function set uid(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;IUID.as:String):void; } }//package mx.core
Section 101
//IUITextField (mx.core.IUITextField) package mx.core { import flash.display.*; import flash.geom.*; import flash.text.*; import mx.managers.*; 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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function get maxScrollH():int; function set nestLevel(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:int):void; function get numLines():int; function get scrollH():int; function setColor(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:int):void; function getFirstCharInParagraph(value:int):int; function get type():String; function replaceSelectedText(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void; function set borderColor(E:\dev\3.0.x\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(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:int):void; function set useRichTextClipboard(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function get selectionBeginIndex():int; function get selectable():Boolean; function set border(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function set multiline(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function set background(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function set embedFonts(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function set text(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void; function get selectionEndIndex():int; function set mouseWheelEnabled(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function appendText(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void; function get antiAliasType():String; function set styleSheet(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:StyleSheet):void; function set nonInheritingStyles(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Object):void; function set textColor(E:\dev\3.0.x\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(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void; function set alwaysShowSelection(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function getTextFormat(_arg1:int=-1, _arg2:int=-1):TextFormat; function set sharpness(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Number):void; function set type(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void; function setTextFormat(_arg1:TextFormat, _arg2:int=-1, _arg3:int=-1):void; function set gridFitType(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void; function getUITextFormat():UITextFormat; function set inheritingStyles(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Object):void; function setFocus():void; function get borderColor():uint; function set condenseWhite(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function get textWidth():Number; function getLineOffset(value:int):int; function set displayAsPassword(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function set autoSize(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:uint):void; function get embedFonts():Boolean; function set selectable(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function get multiline():Boolean; function set maxChars(E:\dev\3.0.x\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(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function get gridFitType():String; function get inheritingStyles():Object; function set ignorePadding(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function set antiAliasType(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void; function get backgroundColor():uint; function getCharIndexAtPoint(_arg1:Number, _arg2:Number):int; function set tabEnabled(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void; function get tabEnabled():Boolean; function set thickness(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Number):void; function getLineLength(value:int):int; function truncateToFit(:String=null):Boolean; function set htmlText(E:\dev\3.0.x\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void; function getLineMetrics(antiAliasType:int):TextLineMetrics; function getStyle(*:String); } }//package mx.core
Section 102
//LayoutContainer (mx.core.LayoutContainer) package mx.core { import flash.events.*; import mx.containers.*; import mx.containers.utilityClasses.*; 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.0.0.0"; 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 103
//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 104
//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.0.0.0"; 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 105
//RSLItem (mx.core.RSLItem) package mx.core { import flash.display.*; import flash.events.*; import mx.events.*; import flash.system.*; import flash.net.*; 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; protected var url:String; mx_internal static const VERSION:String = "3.0.0.0"; public function RSLItem(url:String){ super(); this.url = url; } 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(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 106
//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.0.0.0"; 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 107
//ScrollControlBase (mx.core.ScrollControlBase) package mx.core { import flash.display.*; import flash.geom.*; import mx.managers.*; import flash.events.*; import mx.events.*; import mx.styles.*; import mx.controls.*; import mx.controls.scrollClasses.*; public class ScrollControlBase extends UIComponent { private var numberOfRows:Number;// = 0 private var _scrollTipFunction:Function; private var scrollTip:ToolTip; public var showScrollTips:Boolean;// = false private var numberOfCols:Number;// = 0 protected var maskShape:Shape; private var oldTTMEnabled:Boolean; mx_internal var _maxHorizontalScrollPosition:Number; protected var border:IFlexDisplayObject; private var _viewMetrics:EdgeMetrics; mx_internal var _maxVerticalScrollPosition:Number; protected var verticalScrollBar:ScrollBar; mx_internal var _horizontalScrollPosition:Number;// = 0 private var propsInited:Boolean; protected var horizontalScrollBar:ScrollBar; mx_internal var _horizontalScrollPolicy:String;// = "off" mx_internal var _verticalScrollPosition:Number;// = 0 private var scrollThumbMidPoint:Number; mx_internal var _verticalScrollPolicy:String;// = "auto" protected var scrollAreaChanged:Boolean; private var viewableColumns:Number; public var liveScrolling:Boolean;// = true private var viewableRows:Number; private var invLayout:Boolean; mx_internal static const VERSION:String = "3.0.0.0"; public function ScrollControlBase(){ super(); _viewMetrics = EdgeMetrics.EMPTY; addEventListener(MouseEvent.MOUSE_WHEEL, mouseWheelHandler); } override public function set enabled(value:Boolean):void{ super.enabled = value; if (horizontalScrollBar){ horizontalScrollBar.enabled = value; }; if (verticalScrollBar){ verticalScrollBar.enabled = value; }; } public function get scrollTipFunction():Function{ return (_scrollTipFunction); } public function set scrollTipFunction(value:Function):void{ _scrollTipFunction = value; dispatchEvent(new Event("scrollTipFunctionChanged")); } override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{ super.updateDisplayList(unscaledWidth, unscaledHeight); layoutChrome(unscaledWidth, unscaledHeight); var w:Number = unscaledWidth; var h:Number = unscaledHeight; invLayout = false; var vm:EdgeMetrics = (_viewMetrics = viewMetrics); if (((horizontalScrollBar) && (horizontalScrollBar.visible))){ horizontalScrollBar.setActualSize(((w - vm.left) - vm.right), horizontalScrollBar.minHeight); horizontalScrollBar.move(vm.left, (h - vm.bottom)); horizontalScrollBar.enabled = enabled; }; if (((verticalScrollBar) && (verticalScrollBar.visible))){ verticalScrollBar.setActualSize(verticalScrollBar.minWidth, ((h - vm.top) - vm.bottom)); verticalScrollBar.move((w - vm.right), vm.top); verticalScrollBar.enabled = enabled; }; var mask:DisplayObject = maskShape; var wd:Number = ((w - vm.left) - vm.right); var ht:Number = ((h - vm.top) - vm.bottom); mask.width = ((wd < 0)) ? 0 : wd; mask.height = ((ht < 0)) ? 0 : ht; mask.x = vm.left; mask.y = vm.top; } protected function setScrollBarProperties(totalColumns:int, visibleColumns:int, totalRows:int, visibleRows:int):void{ var shouldBeVisible:Boolean; var horizontalScrollPolicy:String = this.horizontalScrollPolicy; var verticalScrollPolicy:String = this.verticalScrollPolicy; scrollAreaChanged = false; if ((((horizontalScrollPolicy == ScrollPolicy.ON)) || ((((((visibleColumns < totalColumns)) && ((totalColumns > 0)))) && ((horizontalScrollPolicy == ScrollPolicy.AUTO)))))){ if (!horizontalScrollBar){ createHScrollBar(false); horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, scrollHandler); horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, scrollTipHandler); horizontalScrollBar.scrollPosition = _horizontalScrollPosition; }; shouldBeVisible = roomForScrollBar(horizontalScrollBar, unscaledWidth, unscaledHeight); if (shouldBeVisible != horizontalScrollBar.visible){ horizontalScrollBar.visible = shouldBeVisible; scrollAreaChanged = true; }; if (((((horizontalScrollBar) && (horizontalScrollBar.visible))) && (((((!((numberOfCols == totalColumns))) || (!((viewableColumns == visibleColumns))))) || (scrollAreaChanged))))){ horizontalScrollBar.setScrollProperties(visibleColumns, 0, (totalColumns - visibleColumns)); if (horizontalScrollBar.scrollPosition != _horizontalScrollPosition){ horizontalScrollBar.scrollPosition = _horizontalScrollPosition; }; viewableColumns = visibleColumns; numberOfCols = totalColumns; }; } else { if ((((((((horizontalScrollPolicy == ScrollPolicy.AUTO)) || ((horizontalScrollPolicy == ScrollPolicy.OFF)))) && (horizontalScrollBar))) && (horizontalScrollBar.visible))){ horizontalScrollPosition = 0; horizontalScrollBar.setScrollProperties(visibleColumns, 0, 0); horizontalScrollBar.visible = false; viewableColumns = NaN; scrollAreaChanged = true; }; }; if ((((verticalScrollPolicy == ScrollPolicy.ON)) || ((((((visibleRows < totalRows)) && ((totalRows > 0)))) && ((verticalScrollPolicy == ScrollPolicy.AUTO)))))){ if (!verticalScrollBar){ createVScrollBar(false); verticalScrollBar.addEventListener(ScrollEvent.SCROLL, scrollHandler); verticalScrollBar.addEventListener(ScrollEvent.SCROLL, scrollTipHandler); verticalScrollBar.scrollPosition = _verticalScrollPosition; }; shouldBeVisible = roomForScrollBar(verticalScrollBar, unscaledWidth, unscaledHeight); if (shouldBeVisible != verticalScrollBar.visible){ verticalScrollBar.visible = shouldBeVisible; scrollAreaChanged = true; }; if (((((verticalScrollBar) && (verticalScrollBar.visible))) && (((((!((numberOfRows == totalRows))) || (!((viewableRows == visibleRows))))) || (scrollAreaChanged))))){ verticalScrollBar.setScrollProperties(visibleRows, 0, (totalRows - visibleRows)); if (verticalScrollBar.scrollPosition != _verticalScrollPosition){ verticalScrollBar.scrollPosition = _verticalScrollPosition; }; viewableRows = visibleRows; numberOfRows = totalRows; }; } else { if ((((((((verticalScrollPolicy == ScrollPolicy.AUTO)) || ((verticalScrollPolicy == ScrollPolicy.OFF)))) && (verticalScrollBar))) && (verticalScrollBar.visible))){ verticalScrollPosition = 0; verticalScrollBar.setScrollProperties(visibleRows, 0, 0); verticalScrollBar.visible = false; viewableRows = NaN; scrollAreaChanged = true; }; }; if (scrollAreaChanged){ updateDisplayList(unscaledWidth, unscaledHeight); }; } private function createHScrollBar(visible:Boolean):ScrollBar{ horizontalScrollBar = new HScrollBar(); horizontalScrollBar.visible = visible; horizontalScrollBar.enabled = enabled; var horizontalScrollBarStyleName:String = getStyle("horizontalScrollBarStyleName"); horizontalScrollBar.styleName = horizontalScrollBarStyleName; addChild(horizontalScrollBar); horizontalScrollBar.validateNow(); return (horizontalScrollBar); } public function get horizontalScrollPolicy():String{ return (_horizontalScrollPolicy); } public function get maxVerticalScrollPosition():Number{ if (!isNaN(_maxVerticalScrollPosition)){ return (_maxVerticalScrollPosition); }; var m:Number = (verticalScrollBar) ? verticalScrollBar.maxScrollPosition : 0; return (m); } public function set horizontalScrollPosition(value:Number):void{ _horizontalScrollPosition = value; if (horizontalScrollBar){ horizontalScrollBar.scrollPosition = value; }; dispatchEvent(new Event("viewChanged")); } protected function roomForScrollBar(bar:ScrollBar, unscaledWidth:Number, unscaledHeight:Number):Boolean{ var bm:EdgeMetrics = borderMetrics; return ((((unscaledWidth >= ((bar.minWidth + bm.left) + bm.right))) && ((unscaledHeight >= ((bar.minHeight + bm.top) + bm.bottom))))); } public function set maxHorizontalScrollPosition(value:Number):void{ _maxHorizontalScrollPosition = value; dispatchEvent(new Event("maxHorizontalScrollPositionChanged")); } public function get verticalScrollPosition():Number{ return (_verticalScrollPosition); } public function set horizontalScrollPolicy(value:String):void{ var newPolicy:String = value.toLowerCase(); if (_horizontalScrollPolicy != newPolicy){ _horizontalScrollPolicy = newPolicy; invalidateDisplayList(); dispatchEvent(new Event("horizontalScrollPolicyChanged")); }; } override protected function createChildren():void{ var g:Graphics; super.createChildren(); createBorder(); if (!maskShape){ maskShape = new FlexShape(); maskShape.name = "mask"; g = maskShape.graphics; g.beginFill(0xFFFFFF); g.drawRect(0, 0, 10, 10); g.endFill(); addChild(maskShape); }; maskShape.visible = false; } override public function styleChanged(styleProp:String):void{ var horizontalScrollBarStyleName:String; var verticalScrollBarStyleName:String; var allStyles:Boolean = (((styleProp == null)) || ((styleProp == "styleName"))); super.styleChanged(styleProp); if (((allStyles) || ((styleProp == "horizontalScrollBarStyleName")))){ if (horizontalScrollBar){ horizontalScrollBarStyleName = getStyle("horizontalScrollBarStyleName"); horizontalScrollBar.styleName = horizontalScrollBarStyleName; }; }; if (((allStyles) || ((styleProp == "verticalScrollBarStyleName")))){ if (verticalScrollBar){ verticalScrollBarStyleName = getStyle("verticalScrollBarStyleName"); verticalScrollBar.styleName = verticalScrollBarStyleName; }; }; if (((allStyles) || ((styleProp == "borderSkin")))){ if (border){ removeChild(DisplayObject(border)); border = null; createBorder(); }; }; } private function createVScrollBar(visible:Boolean):ScrollBar{ verticalScrollBar = new VScrollBar(); verticalScrollBar.visible = visible; verticalScrollBar.enabled = enabled; var verticalScrollBarStyleName:String = getStyle("verticalScrollBarStyleName"); verticalScrollBar.styleName = verticalScrollBarStyleName; addChild(verticalScrollBar); return (verticalScrollBar); } mx_internal function get scroll_verticalScrollBar():ScrollBar{ return (verticalScrollBar); } protected function createBorder():void{ var borderClass:Class; if (((!(border)) && (isBorderNeeded()))){ borderClass = getStyle("borderSkin"); if (borderClass != null){ border = new (borderClass); if ((border is IUIComponent)){ IUIComponent(border).enabled = enabled; }; if ((border is ISimpleStyleClient)){ ISimpleStyleClient(border).styleName = this; }; addChildAt(DisplayObject(border), 0); invalidateDisplayList(); }; }; } mx_internal function get scroll_horizontalScrollBar():ScrollBar{ return (horizontalScrollBar); } protected function layoutChrome(unscaledWidth:Number, unscaledHeight:Number):void{ if (border){ border.move(0, 0); border.setActualSize(unscaledWidth, unscaledHeight); }; } protected function scrollHandler(event:Event):void{ var scrollBar:ScrollBar; var pos:Number; var prop:QName; if ((event is ScrollEvent)){ scrollBar = ScrollBar(event.target); pos = scrollBar.scrollPosition; if (scrollBar == verticalScrollBar){ prop = new QName(mx_internal, "_verticalScrollPosition"); } else { if (scrollBar == horizontalScrollBar){ prop = new QName(mx_internal, "_horizontalScrollPosition"); }; }; dispatchEvent(event); if (prop){ this[prop] = pos; }; }; } protected function mouseWheelHandler(event:MouseEvent):void{ var scrollDirection:int; var scrollAmount:Number; var oldPosition:Number; var scrollEvent:ScrollEvent; if (((verticalScrollBar) && (verticalScrollBar.visible))){ event.stopPropagation(); scrollDirection = ((event.delta <= 0)) ? 1 : -1; scrollAmount = Math.max(Math.abs(event.delta), verticalScrollBar.lineScrollSize); oldPosition = verticalScrollPosition; verticalScrollPosition = (verticalScrollPosition + ((3 * scrollAmount) * scrollDirection)); scrollEvent = new ScrollEvent(ScrollEvent.SCROLL); scrollEvent.direction = ScrollEventDirection.VERTICAL; scrollEvent.position = verticalScrollPosition; scrollEvent.delta = (verticalScrollPosition - oldPosition); dispatchEvent(scrollEvent); }; } private function scrollTipHandler(event:Event):void{ var scrollBar:ScrollBar; var isVertical:Boolean; var dir:String; var pos:Number; var tip:String; var pt:Point; if ((event is ScrollEvent)){ if (!showScrollTips){ return; }; if (ScrollEvent(event).detail == ScrollEventDetail.THUMB_POSITION){ if (scrollTip){ systemManager.toolTipChildren.removeChild(scrollTip); scrollTip = null; ToolTipManager.enabled = oldTTMEnabled; }; } else { if (ScrollEvent(event).detail == ScrollEventDetail.THUMB_TRACK){ scrollBar = ScrollBar(event.target); isVertical = (scrollBar == verticalScrollBar); dir = (isVertical) ? "vertical" : "horizontal"; pos = scrollBar.scrollPosition; if (!scrollTip){ scrollTip = new ToolTip(); systemManager.toolTipChildren.addChild(scrollTip); scrollThumbMidPoint = (scrollBar.scrollThumb.height / 2); oldTTMEnabled = ToolTipManager.enabled; ToolTipManager.enabled = false; }; tip = pos.toString(); if (_scrollTipFunction != null){ tip = _scrollTipFunction(dir, pos); }; if (tip == ""){ scrollTip.visible = false; } else { scrollTip.text = tip; ToolTipManager.sizeTip(scrollTip); pt = new Point(); if (isVertical){ pt.x = (-3 - scrollTip.width); pt.y = ((scrollBar.scrollThumb.y + scrollThumbMidPoint) - (scrollTip.height / 2)); } else { pt.x = (-3 - scrollTip.height); pt.y = ((scrollBar.scrollThumb.y + scrollThumbMidPoint) - (scrollTip.width / 2)); }; pt = scrollBar.localToGlobal(pt); scrollTip.move(pt.x, pt.y); scrollTip.visible = true; }; }; }; }; } public function set verticalScrollPosition(value:Number):void{ _verticalScrollPosition = value; if (verticalScrollBar){ verticalScrollBar.scrollPosition = value; }; dispatchEvent(new Event("viewChanged")); } public function get horizontalScrollPosition():Number{ return (_horizontalScrollPosition); } private function isBorderNeeded():Boolean{ 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 get maxHorizontalScrollPosition():Number{ if (!isNaN(_maxHorizontalScrollPosition)){ return (_maxHorizontalScrollPosition); }; var m:Number = (horizontalScrollBar) ? horizontalScrollBar.maxScrollPosition : 0; return (m); } public function set maxVerticalScrollPosition(value:Number):void{ _maxVerticalScrollPosition = value; dispatchEvent(new Event("maxVerticalScrollPositionChanged")); } public function set verticalScrollPolicy(value:String):void{ var newPolicy:String = value.toLowerCase(); if (_verticalScrollPolicy != newPolicy){ _verticalScrollPolicy = newPolicy; invalidateDisplayList(); dispatchEvent(new Event("verticalScrollPolicyChanged")); }; } public function get viewMetrics():EdgeMetrics{ _viewMetrics = borderMetrics.clone(); if (((!(horizontalScrollBar)) && ((horizontalScrollPolicy == ScrollPolicy.ON)))){ createHScrollBar(true); horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, scrollHandler); horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, scrollTipHandler); horizontalScrollBar.scrollPosition = _horizontalScrollPosition; invalidateDisplayList(); }; if (((!(verticalScrollBar)) && ((verticalScrollPolicy == ScrollPolicy.ON)))){ createVScrollBar(true); verticalScrollBar.addEventListener(ScrollEvent.SCROLL, scrollHandler); verticalScrollBar.addEventListener(ScrollEvent.SCROLL, scrollTipHandler); verticalScrollBar.scrollPosition = _verticalScrollPosition; invalidateDisplayList(); }; if (((verticalScrollBar) && (verticalScrollBar.visible))){ _viewMetrics.right = (_viewMetrics.right + verticalScrollBar.minWidth); }; if (((horizontalScrollBar) && (horizontalScrollBar.visible))){ _viewMetrics.bottom = (_viewMetrics.bottom + horizontalScrollBar.minHeight); }; return (_viewMetrics); } public function get verticalScrollPolicy():String{ return (_verticalScrollPolicy); } public function get borderMetrics():EdgeMetrics{ return ((((border) && ((border is IRectangularBorder)))) ? IRectangularBorder(border).borderMetrics : EdgeMetrics.EMPTY); } } }//package mx.core
Section 108
//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.0.0.0"; public static const OFF:String = "off"; public function ScrollPolicy(){ super(); } } }//package mx.core
Section 109
//Singleton (mx.core.Singleton) package mx.core { public class Singleton { mx_internal static const VERSION:String = "3.0.0.0"; 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 110
//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.0.0.0"; 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 111
//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.0.0.0"; 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 112
//UIComponent (mx.core.UIComponent) package mx.core { import flash.display.*; import flash.geom.*; import flash.text.*; import mx.managers.*; import mx.automation.*; import flash.events.*; import mx.events.*; import mx.resources.*; import mx.styles.*; import mx.controls.*; import mx.states.*; import mx.effects.*; import mx.graphics.*; import mx.binding.*; import flash.utils.*; import mx.utils.*; import mx.validators.*; import flash.system.*; import mx.modules.*; 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.0.0.0"; 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(); }; } 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 invalidateDisplayList():void{ if (!invalidateDisplayListFlag){ invalidateDisplayListFlag = true; if (((parent) && (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); } 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 = 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 == 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))){ if (UIComponentGlobals.callLaterDispatcherCount == 0){ sm.stage.focus = this; UIComponentGlobals.nextFocusObject = null; } else { UIComponentGlobals.nextFocusObject = this; sm.stage.addEventListener(Event.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 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; }; }; 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){ if ((((methodQueue.length > 0)) && (!(listeningForRender)))){ _systemManager.stage.addEventListener(Event.RENDER, callLaterDispatcher); _systemManager.stage.addEventListener(Event.ENTER_FRAME, callLaterDispatcher); listeningForRender = true; }; _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 (((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; }; 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))) && (!(_instanceIndices)))) && (!(parent.isDocument)))){ _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{ if (event.eventPhase != EventPhase.AT_TARGET){ return; }; if ((((parent is IContainer)) && (IContainer(parent).creatingContentPane))){ event.stopImmediatePropagation(); return; }; } 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{ if (event.eventPhase != EventPhase.AT_TARGET){ return; }; if ((((parent is IContainer)) && (IContainer(parent).creatingContentPane))){ event.stopImmediatePropagation(); return; }; _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))){ if (!listeningForRender){ sm.stage.addEventListener(Event.RENDER, callLaterDispatcher); sm.stage.addEventListener(Event.ENTER_FRAME, callLaterDispatcher); listeningForRender = true; }; 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))) && (listeningForRender))){ sm.stage.removeEventListener(Event.RENDER, callLaterDispatcher); sm.stage.removeEventListener(Event.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))){ if (listeningForRender){ sm.stage.removeEventListener(Event.RENDER, callLaterDispatcher); sm.stage.removeEventListener(Event.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 113
//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.0.0.0"; public static const OFF:String = "off"; public function UIComponentCachePolicy(){ super(); } } }//package mx.core
Section 114
//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.0.0.0"; public function UIComponentDescriptor(descriptorProperties:Object){ super(descriptorProperties); } override public function toString():String{ return (("UIComponentDescriptor_" + id)); } } }//package mx.core
Section 115
//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 116
//UITextField (mx.core.UITextField) package mx.core { import flash.display.*; import flash.text.*; import mx.managers.*; import mx.automation.*; import flash.events.*; import mx.resources.*; import mx.styles.*; 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.0.0.0"; 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 117
//UITextFormat (mx.core.UITextFormat) package mx.core { import flash.text.*; import mx.managers.*; 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.0.0.0"; 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; } 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 (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 118
//AddRemoveEffectTargetFilter (mx.effects.effectClasses.AddRemoveEffectTargetFilter) package mx.effects.effectClasses { import mx.effects.*; public class AddRemoveEffectTargetFilter extends EffectTargetFilter { public var add:Boolean;// = true mx_internal static const VERSION:String = "3.0.0.0"; 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 119
//HideShowEffectTargetFilter (mx.effects.effectClasses.HideShowEffectTargetFilter) package mx.effects.effectClasses { import mx.effects.*; public class HideShowEffectTargetFilter extends EffectTargetFilter { public var show:Boolean;// = true mx_internal static const VERSION:String = "3.0.0.0"; 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 120
//PropertyChanges (mx.effects.effectClasses.PropertyChanges) package mx.effects.effectClasses { public class PropertyChanges { public var target:Object; public var start:Object; public var end:Object; mx_internal static const VERSION:String = "3.0.0.0"; public function PropertyChanges(target:Object){ end = {}; start = {}; super(); this.target = target; } } }//package mx.effects.effectClasses
Section 121
//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.0.0.0"; 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 122
//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.0.0.0"; 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.mx_internal::_width = curWidth; }; }; if (!isNaN(origPercentHeight)){ curHeight = target.height; target.percentHeight = origPercentHeight; if (((target.parent) && ((target.parent.autoLayout == false)))){ target.mx_internal::_height = curHeight; }; }; super.onTweenEnd(value); if (mx_internal::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); tween.mx_internal::needToLayout = true; EffectManager.resumeEventHandling(); } } }//package mx.effects.effectClasses
Section 123
//Effect (mx.effects.Effect) package mx.effects { import mx.core.*; import mx.managers.*; import flash.events.*; import mx.events.*; import mx.effects.effectClasses.*; import flash.utils.*; 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.0.0.0"; 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 124
//EffectInstance (mx.effects.EffectInstance) package mx.effects { import mx.core.*; import flash.events.*; import mx.events.*; import mx.effects.effectClasses.*; import flash.utils.*; 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.0.0.0"; 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 125
//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.0.0.0"; 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 126
//EffectTargetFilter (mx.effects.EffectTargetFilter) package mx.effects { 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.0.0.0"; 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 127
//IAbstractEffect (mx.effects.IAbstractEffect) package mx.effects { import flash.events.*; public interface IAbstractEffect extends IEventDispatcher { } }//package mx.effects
Section 128
//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 129
//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 130
//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 131
//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.0.0.0"; 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 132
//TweenEffect (mx.effects.TweenEffect) package mx.effects { 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.0.0.0"; 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 133
//Zoom (mx.effects.Zoom) package mx.effects { 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.0.0.0"; 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 134
//ChildExistenceChangedEvent (mx.events.ChildExistenceChangedEvent) package mx.events { import flash.display.*; 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.0.0.0"; 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 135
//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.0.0.0"; 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 136
//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.0.0.0"; 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 137
//DynamicEvent (mx.events.DynamicEvent) package mx.events { import flash.events.*; public dynamic class DynamicEvent extends Event { mx_internal static const VERSION:String = "3.0.0.0"; 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 138
//EffectEvent (mx.events.EffectEvent) package mx.events { 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.0.0.0"; 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 139
//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 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 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.0.0.0"; 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 140
//FlexMouseEvent (mx.events.FlexMouseEvent) package mx.events { import flash.display.*; 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.0.0.0"; 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 141
//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.0.0.0"; 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 142
//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.0.0.0"; 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 143
//MoveEvent (mx.events.MoveEvent) package mx.events { import flash.events.*; public class MoveEvent extends Event { public var oldX:Number; public var oldY:Number; mx_internal static const VERSION:String = "3.0.0.0"; 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 144
//PropertyChangeEvent (mx.events.PropertyChangeEvent) package mx.events { 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.0.0.0"; 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 145
//PropertyChangeEventKind (mx.events.PropertyChangeEventKind) package mx.events { public final class PropertyChangeEventKind { mx_internal static const VERSION:String = "3.0.0.0"; public static const UPDATE:String = "update"; public static const DELETE:String = "delete"; public function PropertyChangeEventKind(){ super(); } } }//package mx.events
Section 146
//ResizeEvent (mx.events.ResizeEvent) package mx.events { import flash.events.*; public class ResizeEvent extends Event { public var oldHeight:Number; public var oldWidth:Number; mx_internal static const VERSION:String = "3.0.0.0"; 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 147
//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.0.0.0"; 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 148
//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.0.0.0"; 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 149
//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.0.0.0"; 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 150
//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.0.0.0"; public function ScrollEventDetail(){ super(); } } }//package mx.events
Section 151
//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.0.0.0"; public function ScrollEventDirection(){ super(); } } }//package mx.events
Section 152
//StateChangeEvent (mx.events.StateChangeEvent) package mx.events { 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.0.0.0"; 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 153
//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.0.0.0"; 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 154
//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.0.0.0"; 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 155
//TweenEvent (mx.events.TweenEvent) package mx.events { 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.0.0.0"; 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 156
//ValidationResultEvent (mx.events.ValidationResultEvent) package mx.events { 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.0.0.0"; 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 157
//RectangularDropShadow (mx.graphics.RectangularDropShadow) package mx.graphics { import flash.display.*; import flash.geom.*; import mx.core.*; import mx.utils.*; import flash.filters.*; public class RectangularDropShadow { private var leftShadow:BitmapData; private var _tlRadius:Number;// = 0 private var _trRadius:Number;// = 0 private var _angle:Number;// = 45 private var topShadow:BitmapData; private var _distance:Number;// = 4 private var rightShadow:BitmapData; private var _alpha:Number;// = 0.4 private var shadow:BitmapData; private var _brRadius:Number;// = 0 private var _blRadius:Number;// = 0 private var _color:int;// = 0 private var bottomShadow:BitmapData; private var changed:Boolean;// = true mx_internal static const VERSION:String = "3.0.0.0"; 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 158
//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.0.0.0"; 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 159
//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.0.0.0"; 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 160
//CursorManager (mx.managers.CursorManager) package mx.managers { import mx.core.*; public class CursorManager { mx_internal static const VERSION:String = "3.0.0.0"; 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 161
//CursorManagerImpl (mx.managers.CursorManagerImpl) package mx.managers { import flash.display.*; import flash.text.*; import mx.core.*; import flash.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 _currentCursorID:int;// = 0 private var listenForContextMenu:Boolean;// = false private var showCustomCursor:Boolean;// = false 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.0.0.0"; 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; } else { this.systemManager = ApplicationGlobals.application.systemManager; }; } public function set currentCursorYOffset(value:Number):void{ _currentCursorYOffset = value; } public function get currentCursorXOffset():Number{ return (_currentCursorXOffset); } public function removeCursor(cursorID:int):void{ var i:Object; var item:CursorQueueItem; for (i in cursorList) { item = cursorList[i]; if (item.cursorID == cursorID){ cursorList.splice(i, 1); showCurrentCursor(); break; }; }; } public function get currentCursorID():int{ return (_currentCursorID); } public function set currentCursorID(value:int):void{ _currentCursorID = value; } public function removeAllCursors():void{ 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 cursorManagerStyleDeclaration:CSSStyleDeclaration = StyleManager.getStyleDeclaration("CursorManager"); var busyCursorClass:Class = cursorManagerStyleDeclaration.getStyle("busyCursor"); busyCursorList.push(setCursor(busyCursorClass, CursorManagerPriority.LOW)); } public function showCursor():void{ if (cursorHolder){ cursorHolder.visible = true; }; } 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 tempSystemManager:ISystemManager; if (cursorList.length > 0){ if (!initialized){ cursorHolder = new FlexSprite(); cursorHolder.name = "cursorHolder"; cursorHolder.mouseEnabled = false; initialized = true; }; 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; }; tempSystemManager = (item.systemManager) ? item.systemManager : ApplicationGlobals.application.systemManager; if (((systemManager) && (!((systemManager == tempSystemManager))))){ systemManager.cursorChildren.removeChild(cursorHolder); }; systemManager = tempSystemManager; if (!systemManager.cursorChildren.contains(cursorHolder)){ systemManager.cursorChildren.addChild(cursorHolder); }; 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)){ cursorHolder.x = (SystemManager(systemManager).mouseX + item.x); cursorHolder.y = (SystemManager(systemManager).mouseY + item.y); } else { if ((systemManager is DisplayObject)){ cursorHolder.x = (DisplayObject(systemManager).mouseX + item.x); cursorHolder.y = (DisplayObject(systemManager).mouseY + item.y); } else { cursorHolder.x = item.x; cursorHolder.y = item.y; }; }; systemManager.stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true, 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; systemManager.stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true); 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; systemManager.stage.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler); } public function hideCursor():void{ if (cursorHolder){ cursorHolder.visible = false; }; } public function registerToUseBusyCursor(source:Object):void{ 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 setCursor(cursorClass:Class, priority:int=2, xOffset:Number=0, yOffset:Number=0):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(); }; } public function removeBusyCursor():void{ if (busyCursorList.length > 0){ removeCursor(int(busyCursorList.pop())); }; } private function mouseMoveHandler(event:MouseEvent):void{ if ((systemManager is SystemManager)){ cursorHolder.x = (SystemManager(systemManager).mouseX + currentCursorXOffset); cursorHolder.y = (SystemManager(systemManager).mouseY + currentCursorYOffset); } else { if ((systemManager is DisplayObject)){ cursorHolder.x = (DisplayObject(systemManager).mouseX + currentCursorXOffset); cursorHolder.y = (DisplayObject(systemManager).mouseY + currentCursorYOffset); } else { cursorHolder.x = currentCursorXOffset; cursorHolder.y = currentCursorYOffset; }; }; 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; }; }; if (showSystemCursor){ showSystemCursor = false; cursorHolder.visible = false; Mouse.show(); }; if (showCustomCursor){ showCustomCursor = false; cursorHolder.visible = true; Mouse.hide(); }; } public function unRegisterToUseBusyCursor(source:Object):void{ 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{ systemManager.stage.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler); mouseMoveHandler(event); } public function set currentCursorXOffset(value:Number):void{ _currentCursorXOffset = value; } public static function getInstance():ICursorManager{ if (!instance){ instance = new (CursorManagerImpl); }; return (instance); } } }//package mx.managers 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.0.0.0"; private function CursorQueueItem(){ super(); } }
Section 162
//CursorManagerPriority (mx.managers.CursorManagerPriority) package mx.managers { public final class CursorManagerPriority { public static const HIGH:int = 1; public static const MEDIUM:int = 2; mx_internal static const VERSION:String = "3.0.0.0"; public static const LOW:int = 3; public function CursorManagerPriority(){ super(); } } }//package mx.managers
Section 163
//FocusManager (mx.managers.FocusManager) package mx.managers { import flash.display.*; import flash.text.*; import mx.core.*; import flash.events.*; import mx.events.*; import flash.ui.*; import flash.system.*; public class FocusManager implements IFocusManager { private var focusableObjects:Array; private var _showFocusIndicator:Boolean;// = false private var defButton:IButton; private var _form:IFocusManagerContainer; private var focusableCandidates:Array; private var LARGE_TAB_INDEX:int;// = 99999 private var browserFocusComponent:InteractiveObject; private var activated:Boolean;// = false private var _defaultButton:IButton; private var calculateCandidates:Boolean;// = true private var _focusPane:Sprite; private var lastFocus:IFocusManagerComponent; private var _defaultButtonEnabled:Boolean;// = true public var browserMode:Boolean; private var lastAction:String; mx_internal static const VERSION:String = "3.0.0.0"; public function FocusManager(container:IFocusManagerContainer, popup:Boolean=false){ super(); 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); } public function deactivate():void{ form.systemManager.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler); form.systemManager.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler); form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true); form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true); form.systemManager.stage.removeEventListener(Event.ACTIVATE, activateHandler); form.systemManager.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler); form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true); activated = false; } 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(findFocusManagerComponent(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); } private function mouseFocusChangeHandler(event:FocusEvent):void{ var tf:TextField; if ((event.relatedObject is TextField)){ tf = (event.relatedObject as TextField); if ((((tf.type == "input")) || (tf.selectable))){ return; }; }; event.preventDefault(); } mx_internal function set form(value:IFocusManagerContainer):void{ _form = value; } private function addFocusables(o:DisplayObject, skipTopLevel:Boolean=false):void{ var focusable:IFocusManagerComponent; var doc:DisplayObjectContainer; var i:int; var rawChildren:IChildList; var o = o; var skipTopLevel = skipTopLevel; if ((((o is IFocusManagerComponent)) && (!(skipTopLevel)))){ focusable = IFocusManagerComponent(o); if (focusable.focusEnabled){ if (((focusable.tabEnabled) && (isTabVisible(o)))){ 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 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 showHandler(event:Event):void{ form.systemManager.activate(form); } public function toString():String{ return ((Object(form).toString() + ".focusManager")); } private function mouseDownHandler(event:MouseEvent):void{ if (event.isDefaultPrevented()){ return; }; var o:DisplayObject = getTopLevelFocusTarget(InteractiveObject(event.target)); if (!o){ return; }; showFocusIndicator = false; if (((((!((o == lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((o is TextField))))){ setFocus(IFocusManagerComponent(o)); }; lastAction = "MOUSEDOWN"; } private function sortByDepth(aa:IFocusManagerComponent, bb:IFocusManagerComponent):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); } private function focusOutHandler(event:FocusEvent):void{ var target:InteractiveObject = InteractiveObject(event.target); } public function setFocus(o:IFocusManagerComponent):void{ o.setFocus(); } 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")); } public function findFocusManagerComponent(o:InteractiveObject):IFocusManagerComponent{ while (o) { if ((((o is IFocusManagerComponent)) && (IFocusManagerComponent(o).focusEnabled))){ return (IFocusManagerComponent(o)); }; o = o.parent; }; return (null); } private function sortFocusableObjectsTabIndex():void{ var c:IFocusManagerComponent; focusableCandidates = []; var n:int = focusableObjects.length; var i:int; while (i < n) { c = focusableObjects[i]; if (((c.tabIndex) && (!(isNaN(Number(c.tabIndex)))))){ focusableCandidates.push(c); }; i++; }; focusableCandidates.sort(sortByTabIndex); } 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 setFocusToNextObject(event:FocusEvent):void{ if (focusableObjects.length == 0){ return; }; var o:IFocusManagerComponent = getNextFocusManagerComponent(event.shiftKey); if (o){ if ((o is IFocusManagerComplexComponent)){ IFocusManagerComplexComponent(o).assignFocus((event.shiftKey) ? "bottom" : "top"); } else { setFocus(o); }; }; } 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); }; o = o.parent; if (o == null){ break; }; }; return (null); } 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; }; }; } 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 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); } private function deactivateHandler(event:Event):void{ var target:InteractiveObject = InteractiveObject(event.target); } private function hideHandler(event:Event):void{ form.systemManager.deactivate(form); } private function addedHandler(event:Event):void{ var target:DisplayObject = DisplayObject(event.target); if (target.stage){ addFocusables(DisplayObject(event.target)); }; } public function hideFocus():void{ if (showFocusIndicator){ showFocusIndicator = false; if (lastFocus){ lastFocus.drawFocus(false); }; }; } 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 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); } public function set focusPane(value:Sprite):void{ _focusPane = value; } private function keyFocusChangeHandler(event:FocusEvent):void{ showFocusIndicator = true; if ((((event.keyCode == Keyboard.TAB)) && (!(event.isDefaultPrevented())))){ if (browserFocusComponent){ if (browserFocusComponent.tabIndex == LARGE_TAB_INDEX){ browserFocusComponent.tabIndex = -1; }; browserFocusComponent = null; return; }; setFocusToNextObject(event); event.preventDefault(); }; } 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 isParent(p:DisplayObjectContainer, o:DisplayObject):Boolean{ if ((p is IRawChildrenContainer)){ return (IRawChildrenContainer(p).rawChildren.contains(o)); }; return (p.contains(o)); } 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); } mx_internal function get form():IFocusManagerContainer{ return (_form); } 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); } public function get nextTabIndex():int{ return ((getMaxTabIndex() + 1)); } public function get defaultButton():IButton{ return (_defaultButton); } public function showFocus():void{ if (!showFocusIndicator){ showFocusIndicator = true; if (lastFocus){ lastFocus.drawFocus(true); }; }; } private function activateHandler(event:Event):void{ var target:InteractiveObject = InteractiveObject(event.target); if (((lastFocus) && (!(browserMode)))){ lastFocus.setFocus(); }; lastAction = "ACTIVATE"; } public function getNextFocusManagerComponent(backward:Boolean=false):IFocusManagerComponent{ var tg:IFocusManagerGroup; if (focusableObjects.length == 0){ return (null); }; if (calculateCandidates){ sortFocusableObjects(); calculateCandidates = false; }; var o:DisplayObject = form.systemManager.stage.focus; o = DisplayObject(findFocusManagerComponent(InteractiveObject(o))); var g:String = ""; if ((o is IFocusManagerGroup)){ tg = IFocusManagerGroup(o); g = tg.groupName; }; var i:int = 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); return (findFocusManagerComponent(focusableCandidates[j])); } public function get focusPane():Sprite{ return (_focusPane); } public function set defaultButtonEnabled(value:Boolean):void{ _defaultButtonEnabled = value; } private function keyDownHandler(event:KeyboardEvent):void{ var o:DisplayObject; var g:String; var i:int; var j:int; var tg:IFocusManagerGroup; var sm:SystemManager = (form.systemManager as SystemManager); if (sm){ 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 = form.systemManager.stage.focus; o = DisplayObject(findFocusManagerComponent(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 = form.systemManager.stage.focus; if (browserFocusComponent.tabIndex == -1){ browserFocusComponent.tabIndex = 0; }; }; } else { if (j <= i){ browserFocusComponent = form.systemManager.stage.focus; if (browserFocusComponent.tabIndex == -1){ browserFocusComponent.tabIndex = LARGE_TAB_INDEX; }; }; }; }; }; if (((((((defaultButtonEnabled) && ((event.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){ defButton.callLater(sendDefaultButtonEvent); }; } private function focusInHandler(event:FocusEvent):void{ var x:IButton; var target:InteractiveObject = InteractiveObject(event.target); 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 set showFocusIndicator(value:Boolean):void{ _showFocusIndicator = value; } private function sortByTabIndex(a:IFocusManagerComponent, b:IFocusManagerComponent):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(a, b)); } public function activate():void{ if (activated){ return; }; form.systemManager.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true); form.systemManager.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true); form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true); form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true); form.systemManager.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true); form.systemManager.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true); form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true); activated = true; if (lastFocus){ setFocus(lastFocus); }; } public function get defaultButtonEnabled():Boolean{ return (_defaultButtonEnabled); } 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); } private function creationCompleteHandler(event:FlexEvent):void{ if (((DisplayObject(form).visible) && (!(activated)))){ form.systemManager.activate(form); }; } public function get showFocusIndicator():Boolean{ return (_showFocusIndicator); } 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)))){ focusableObjects.push(o); }; } else { if (i < n){ focusableObjects.splice(i, 1); }; }; } } }//package mx.managers
Section 164
//ICursorManager (mx.managers.ICursorManager) package mx.managers { public interface ICursorManager { function removeAllCursors():void; function set currentCursorYOffset(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ICursorManager.as:Number):void; function removeBusyCursor():void; function unRegisterToUseBusyCursor(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ICursorManager.as:Object):void; function hideCursor():void; function get currentCursorID():int; function registerToUseBusyCursor(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ICursorManager.as:Object):void; function setBusyCursor():void; function showCursor():void; function set currentCursorID(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ICursorManager.as:int):void; function get currentCursorXOffset():Number; function get currentCursorYOffset():Number; function set currentCursorXOffset(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ICursorManager.as:Number):void; } }//package mx.managers
Section 165
//IFocusManager (mx.managers.IFocusManager) package mx.managers { import flash.display.*; import mx.core.*; public interface IFocusManager { function get focusPane():Sprite; function getFocus():IFocusManagerComponent; function deactivate():void; function set defaultButton(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IFocusManager.as:IButton):void; function set focusPane(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IFocusManager.as:Sprite):void; function set showFocusIndicator(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IFocusManager.as:Boolean):void; function get defaultButtonEnabled():Boolean; function findFocusManagerComponent(value:InteractiveObject):IFocusManagerComponent; function get nextTabIndex():int; function get defaultButton():IButton; function get showFocusIndicator():Boolean; function setFocus(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IFocusManager.as:IFocusManagerComponent):void; function activate():void; function showFocus():void; function set defaultButtonEnabled(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IFocusManager.as:Boolean):void; function hideFocus():void; function getNextFocusManagerComponent(value:Boolean=false):IFocusManagerComponent; } }//package mx.managers
Section 166
//IFocusManagerComplexComponent (mx.managers.IFocusManagerComplexComponent) package mx.managers { public interface IFocusManagerComplexComponent extends IFocusManagerComponent { function assignFocus(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IFocusManagerComplexComponent.as:String):void; function get hasFocusableContent():Boolean; } }//package mx.managers
Section 167
//IFocusManagerComponent (mx.managers.IFocusManagerComponent) package mx.managers { public interface IFocusManagerComponent { function set focusEnabled(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IFocusManagerComponent.as:Boolean):void; function drawFocus(E:\dev\3.0.x\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 168
//IFocusManagerContainer (mx.managers.IFocusManagerContainer) package mx.managers { import flash.display.*; import flash.events.*; public interface IFocusManagerContainer extends IEventDispatcher { function set focusManager(E:\dev\3.0.x\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 169
//IFocusManagerGroup (mx.managers.IFocusManagerGroup) package mx.managers { public interface IFocusManagerGroup { function get groupName():String; function get selected():Boolean; function set groupName(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IFocusManagerGroup.as:String):void; function set selected(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IFocusManagerGroup.as:Boolean):void; } }//package mx.managers
Section 170
//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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:ILayoutManagerClient):void; function set usePhasedInstantiation(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:Boolean):void; function invalidateSize(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:ILayoutManagerClient):void; function get usePhasedInstantiation():Boolean; function invalidateProperties(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:ILayoutManagerClient):void; } }//package mx.managers
Section 171
//ILayoutManagerClient (mx.managers.ILayoutManagerClient) package mx.managers { import flash.events.*; public interface ILayoutManagerClient extends IEventDispatcher { function get updateCompletePendingFlag():Boolean; function set updateCompletePendingFlag(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean):void; function set initialized(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean=false):void; function set nestLevel(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:int):void; function set processedDescriptors(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean):void; } }//package mx.managers
Section 172
//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 get focusPane():Sprite; function get loaderInfo():LoaderInfo; function get toolTipChildren():IChildList; function set focusPane(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:Sprite):void; function isTopLevel():Boolean; function get popUpChildren():IChildList; function get screen():Rectangle; function isFontFaceEmbedded(mx.managers:ISystemManager/mx.managers:ISystemManager:focusPane/get:TextFormat):Boolean; function get rawChildren():IChildList; function get topLevelSystemManager():ISystemManager; function getDefinitionByName(E:\dev\3.0.x\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 removeFocusManager(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IFocusManagerContainer):void; function get document():Object; function get numModalWindows():int; function addFocusManager(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IFocusManagerContainer):void; function get stage():Stage; } }//package mx.managers
Section 173
//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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:Boolean):void; function get scrubDelay():Number; function set hideEffect(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:Number):void; function set hideDelay(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:Number):void; function get currentTarget():DisplayObject; function set showDelay(E:\dev\3.0.x\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(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:IToolTip):void; function set toolTipClass(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:Class):void; function sizeTip(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:IToolTip):void; function set currentTarget(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:DisplayObject):void; function set showEffect(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:IAbstractEffect):void; } }//package mx.managers
Section 174
//IToolTipManagerClient (mx.managers.IToolTipManagerClient) package mx.managers { import mx.core.*; public interface IToolTipManagerClient extends IFlexDisplayObject { function get toolTip():String; function set toolTip(E:\dev\3.0.x\frameworks\projects\framework\src;mx\managers;IToolTipManagerClient.as:String):void; } }//package mx.managers
Section 175
//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.0.0.0"; 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 stage:Stage; if (_usePhasedInstantiation != value){ _usePhasedInstantiation = value; stage = SystemManagerGlobals.topLevelSystemManagers[0].stage; if (value){ originalFrameRate = stage.frameRate; stage.frameRate = 1000; } else { stage.frameRate = originalFrameRate; }; }; } 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; }; }; 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 176
//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.0.0.0"; 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 (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 177
//SystemManager (mx.managers.SystemManager) 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 mx.resources.*; import flash.system.*; import mx.preloaders.*; import flash.utils.*; import mx.messaging.config.*; public class SystemManager extends MovieClip implements IChildList, IFlexDisplayObject, IFlexModuleFactory, ISystemManager { mx_internal var nestLevel:int;// = 0 private var forms:Array; private var mouseCatcher:Sprite; private var _height:Number; private var preloader:Preloader; private var _document:Object; private var _topLevelSystemManager:ISystemManager; private var _toolTipIndex:int;// = 0 private var _rawChildren:SystemRawChildrenList; private var _explicitHeight:Number; private var _toolTipChildren:SystemChildrenList; private var form:IFocusManagerContainer; 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 private var topLevel:Boolean;// = true private var _cursorIndex:int;// = 0 mx_internal var _mouseX; mx_internal var _mouseY; private var _numModalWindows:int;// = 0 private var _screen:Rectangle; mx_internal var idleCounter:int;// = 0 private var _cursorChildren:SystemChildrenList; private var initCallbackFunctions:Array; private var _noTopMostIndex:int;// = 0 private var _applicationIndex:int;// = 1 private var idleTimer:Timer; private var doneExecutingInitCallbacks:Boolean;// = false private var _explicitWidth:Number; 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.0.0.0"; mx_internal static var lastSystemManager:SystemManager; mx_internal static var allSystemManagers:Dictionary = new Dictionary(true); public function SystemManager(){ initCallbackFunctions = []; forms = []; 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); }; } mx_internal function addingChild(child:DisplayObject):void{ var obj:DisplayObjectContainer; var newNestLevel = 1; if (!topLevel){ 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 idleTimer_timerHandler(event:TimerEvent):void{ idleCounter++; if ((idleCounter * IDLE_INTERVAL) > IDLE_THRESHOLD){ dispatchEvent(new FlexEvent(FlexEvent.IDLE)); }; } public function getExplicitOrMeasuredHeight():Number{ return ((isNaN(explicitHeight)) ? measuredHeight : explicitHeight); } 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{ allSystemManagers[this] = this.loaderInfo.url; root.loaderInfo.removeEventListener(Event.INIT, initHandler); var docFrame:int = ((totalFrames)==1) ? 0 : 1; addFrameScript(docFrame, docFrameHandler); var f:int = (docFrame + 1); while (f < totalFrames) { addFrameScript(f, extraFrameHandler); f++; }; initialize(); } 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); } 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 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; } 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); } override public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{ 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); } 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); }; forms.splice(i, 1); return; }; i++; }; } private function mouseMoveHandler(event:MouseEvent):void{ idleCounter = 0; } 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 j:int; var index:int; var newIndex:int; var childList:IChildList; idleCounter = 0; if (numModalWindows == 0){ if (forms.length > 1){ n = forms.length; p = DisplayObject(event.target); isApplication = document.rawChildren.contains(p); while (p) { i = 0; while (i < n) { if (forms[i] == p){ j = 0; if (((!((p == form))) && ((p is IFocusManagerContainer)))){ activate(IFocusManagerContainer(p)); }; if (popUpChildren.contains(p)){ childList = popUpChildren; } else { childList = this; }; index = childList.getChildIndex(p); newIndex = index; n = forms.length; j = 0; while (j < n) { if (childList.contains(forms[j])){ if (childList.getChildIndex(forms[j]) > index){ newIndex = Math.max(childList.getChildIndex(forms[j]), newIndex); }; }; j++; }; if ((((newIndex > index)) && (!(isApplication)))){ childList.setChildIndex(p, newIndex); }; return; }; i++; }; p = p.parent; }; }; }; } public function get screen():Rectangle{ if (!_screen){ Stage_resizeHandler(); }; return (_screen); } 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(); } private function Stage_resizeHandler(event:Event=null):void{ var w:Number = stage.stageWidth; var h:Number = stage.stageHeight; var m:Number = loaderInfo.width; var n:Number = loaderInfo.height; var x:Number = ((m - w) / 2); var y:Number = ((n - h) / 2); var align:String = stage.align; 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(); dispatchEvent(event); }; } 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{ var newForm:IFocusManagerContainer; var n:int; var i:int; var g:IFocusManagerContainer; if (form){ if ((((form == f)) && ((forms.length > 1)))){ form.focusManager.deactivate(); n = forms.length; i = 0; while (i < n) { g = forms[i]; if (g == f){ i = (i + 1); while (i < n) { g = forms[i]; if ((((Sprite(g).visible == true)) && (IUIComponent(g).enabled))){ newForm = g; }; i++; }; form = newForm; break; } else { if (((Sprite(g).visible) && (IUIComponent(g).enabled))){ newForm = g; }; }; i++; }; if (form){ form.focusManager.activate(); }; }; }; } override public function getChildByName(name:String):DisplayObject{ return (super.getChildByName(name)); } override public function addChildAt(child:DisplayObject, index:int):DisplayObject{ noTopMostIndex++; return (rawChildren_addChildAt(child, (applicationIndex + index))); } public function get measuredWidth():Number{ return ((topLevelWindow) ? topLevelWindow.getExplicitOrMeasuredWidth() : loaderInfo.width); } 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)); } 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 set applicationIndex(value:int):void{ _applicationIndex = value; } private function executeCallbacks():void{ var initFunction:Function; if (!parent){ return; }; while (initCallbackFunctions.length > 0) { initFunction = initCallbackFunctions.shift(); initFunction(this); }; } 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); } public function set explicitHeight(value:Number):void{ _explicitHeight = value; } override public function removeChild(child:DisplayObject):DisplayObject{ noTopMostIndex--; return (rawChildren_removeChild(child)); } override public function addChild(child:DisplayObject):DisplayObject{ noTopMostIndex++; return (rawChildren_addChildAt(child, (noTopMostIndex - 1))); } 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 s:Stage = super.stage; if (s){ return (s); }; if (((!(topLevel)) && (_topLevelSystemManager))){ return (_topLevelSystemManager.stage); }; return (null); } 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); } override public function getChildIndex(child:DisplayObject):int{ return ((super.getChildIndex(child) - applicationIndex)); } private function mouseUpHandler(event:MouseEvent):void{ idleCounter = 0; } mx_internal function rawChildren_getChildIndex(child:DisplayObject):int{ return (super.getChildIndex(child)); } public function activate(f:IFocusManagerContainer):void{ var z:IFocusManagerContainer; if (form){ if (((!((form == f))) && ((forms.length > 1)))){ z = form; z.focusManager.deactivate(); }; }; form = f; if (f.focusManager){ f.focusManager.activate(); }; } 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; if (mouseCatcher){ g = mouseCatcher.graphics; g.clear(); g.beginFill(0, 0); g.drawRect(0, 0, stage.stageWidth, stage.stageHeight); g.endFill(); }; } override public function get height():Number{ return (_height); } mx_internal function rawChildren_getChildAt(index:int):DisplayObject{ return (super.getChildAt(index)); } 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); } 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))))))); } mx_internal function rawChildren_setChildIndex(child:DisplayObject, newIndex:int):void{ super.setChildIndex(child, newIndex); } mx_internal function childAdded(child:DisplayObject):void{ child.dispatchEvent(new FlexEvent(FlexEvent.ADD)); if ((child is IUIComponent)){ IUIComponent(child).initialize(); }; } override public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{ 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 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 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.localeChain = compiledLocales; }; } 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); } 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); } 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 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)); } public function get preloaderBackgroundColor():uint{ var value:* = info()["backgroundColor"]; if (value == undefined){ return (StyleManager.NOT_A_COLOR); }; return (StyleManager.getColorName(value)); } public function get topLevelSystemManager():ISystemManager{ if (topLevel){ return (this); }; return (_topLevelSystemManager); } 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"]); rslList.push(cdNode); i++; }; }; if (((!((rsls == null))) && ((rsls.length > 0)))){ n = rsls.length; i = 0; while (i < n) { node = new RSLItem(rsls[i].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); } 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; }; }; } public function get measuredHeight():Number{ return ((topLevelWindow) ? topLevelWindow.getExplicitOrMeasuredHeight() : loaderInfo.height); } mx_internal function rawChildren_addChildAt(child:DisplayObject, index:int):DisplayObject{ addingChild(child); super.addChildAt(child, index); childAdded(child); return (child); } private function nextFrameTimerHandler(event:TimerEvent):void{ if ((currentFrame + 1) <= framesLoaded){ nextFrame(); nextFrameTimer.removeEventListener(TimerEvent.TIMER, nextFrameTimerHandler); nextFrameTimer.reset(); }; } mx_internal function childRemoved(child:DisplayObject):void{ if ((child is IUIComponent)){ IUIComponent(child).parentChanged(null); }; } mx_internal function get noTopMostIndex():int{ return (_noTopMostIndex); } override public function get numChildren():int{ return ((noTopMostIndex - applicationIndex)); } private function initializeTopLevelWindow(event:Event):void{ var app:IUIComponent; var obj:DisplayObjectContainer; initialized = true; if (!parent){ return; }; if (!topLevel){ obj = parent.parent; if (!obj){ return; }; while (obj) { if ((obj is IUIComponent)){ _topLevelSystemManager = IUIComponent(obj).systemManager; break; }; obj = obj.parent; }; }; addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler, true); if (((topLevel) && (stage))){ stage.addEventListener(Event.RESIZE, Stage_resizeHandler, false, 0, true); }; app = (topLevelWindow = IUIComponent(create())); document = app; if (document){ IEventDispatcher(app).addEventListener(FlexEvent.CREATION_COMPLETE, appCreationCompleteHandler); if (((topLevel) && (stage))){ LoaderConfig._url = loaderInfo.url; LoaderConfig._parameters = loaderInfo.parameters; _width = stage.stageWidth; _height = stage.stageHeight; IFlexDisplayObject(app).setActualSize(stage.stageWidth, stage.stageHeight); } else { IFlexDisplayObject(app).setActualSize(loaderInfo.width, loaderInfo.height); }; if (preloader){ preloader.registerApplication(app); }; addingChild(DisplayObject(app)); childAdded(DisplayObject(app)); } else { document = this; }; } public function get numModalWindows():int{ return (_numModalWindows); } public function isTopLevelWindow(object:DisplayObject):Boolean{ return ((((object is IUIComponent)) && ((IUIComponent(object) == topLevelWindow)))); } override public function get width():Number{ return (_width); } public function move(x:Number, y:Number):void{ } public function set explicitWidth(value:Number):void{ _explicitWidth = value; } private function preloader_initProgressHandler(event:Event):void{ preloader.removeEventListener(FlexEvent.INIT_PROGRESS, preloader_initProgressHandler); deferredNextFrame(); } public function get explicitWidth():Number{ return (_explicitWidth); } 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); } 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); }; } } }//package mx.managers
Section 178
//SystemManagerGlobals (mx.managers.SystemManagerGlobals) package mx.managers { public class SystemManagerGlobals { public static var topLevelSystemManagers:Array = []; public static var bootstrapLoaderInfoURL:String; public function SystemManagerGlobals(){ super(); } } }//package mx.managers
Section 179
//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.0.0.0"; 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 180
//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.0.0.0"; 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 181
//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 mx_internal var isError:Boolean; 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 currentText:String; mx_internal var showTimer:Timer; private var _currentToolTip:IToolTip; mx_internal var scrubTimer:Timer; mx_internal var previousTarget:DisplayObject; private var _currentTarget:DisplayObject; private var _showEffect:IAbstractEffect; mx_internal var initialized:Boolean;// = false private var _hideDelay:Number;// = 10000 mx_internal static const VERSION:String = "3.0.0.0"; private static var instance:IToolTipManager2; public function ToolTipManagerImpl(){ _toolTipClass = ToolTip; super(); if (instance){ throw (new Error("Instance already exists.")); }; } mx_internal function systemManager_mouseDownHandler(event:MouseEvent):void{ reset(); } public function set showDelay(value:Number):void{ _showDelay = value; } 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); } 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 : ApplicationGlobals.application.systemManager; sm.toolTipChildren.addChild(toolTip); 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; sm.toolTipChildren.removeChild(DisplayObject(currentToolTip)); currentToolTip = null; scrubTimer.delay = scrubDelay; scrubTimer.reset(); if (scrubDelay > 0){ scrubTimer.delay = scrubDelay; scrubTimer.start(); }; }; } public function get toolTipClass():Class{ return (_toolTipClass); } public function set currentToolTip(value:IToolTip):void{ _currentToolTip = value; } 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 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; sm.toolTipChildren.removeChild(DisplayObject(toolTip)); } public function get scrubDelay():Number{ return (_scrubDelay); } mx_internal function checkIfTargetChanged(displayObject:DisplayObject):void{ if (!enabled){ return; }; findTarget(displayObject); if (currentTarget != previousTarget){ targetChanged(); previousTarget = currentTarget; }; } public function set toolTipClass(value:Class):void{ _toolTipClass = value; } private function getGlobalBounds(obj:DisplayObject):Rectangle{ var upperLeft:Point = new Point(0, 0); upperLeft = obj.localToGlobal(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 toolTipWidth:Number; var toolTipHeight:Number; var screenWidth:Number = currentToolTip.screen.width; var screenHeight:Number = currentToolTip.screen.height; if (isError){ targetGlobalBounds = getGlobalBounds(currentTarget); 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; pos = DisplayObject(ctt).root.globalToLocal(pos); x = pos.x; y = pos.y; } else { x = (ApplicationGlobals.application.mouseX + 11); y = (ApplicationGlobals.application.mouseY + 22); toolTipWidth = currentToolTip.width; if ((x + toolTipWidth) > screenWidth){ x = (screenWidth - toolTipWidth); }; toolTipHeight = currentToolTip.height; if ((y + toolTipHeight) > screenHeight){ y = (screenHeight - toolTipHeight); }; }; 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()); } mx_internal function showTimer_timerHandler(event:TimerEvent):void{ if (currentTarget){ createTip(); initializeTip(); positionTip(); showTip(); }; } mx_internal function hideTimer_timerHandler(event:TimerEvent):void{ hideTip(); } public function set showEffect(value:IAbstractEffect):void{ _showEffect = (value as IAbstractEffect); } public function set hideEffect(value:IAbstractEffect):void{ _hideEffect = (value as IAbstractEffect); } mx_internal function targetChanged():void{ var event:ToolTipEvent; if (!initialized){ initialize(); }; if (((previousTarget) && (currentToolTip))){ event = new ToolTipEvent(ToolTipEvent.TOOL_TIP_HIDE); event.toolTip = currentToolTip; previousTarget.dispatchEvent(event); }; 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(); }; }; } mx_internal function initializeTip():void{ if ((currentToolTip is ToolTip)){ ToolTip(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); sm.toolTipChildren.addChild(DisplayObject(currentToolTip)); } public static function getInstance():IToolTipManager2{ if (!instance){ instance = new (ToolTipManagerImpl); }; return (instance); } } }//package mx.managers
Section 182
//LoaderConfig (mx.messaging.config.LoaderConfig) package mx.messaging.config { import mx.core.*; public class LoaderConfig { mx_internal static const VERSION:String = "3.0.0.0"; 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 183
//IModuleInfo (mx.modules.IModuleInfo) package mx.modules { import mx.core.*; import flash.events.*; import flash.system.*; public interface IModuleInfo extends IEventDispatcher { function get ready():Boolean; function get loaded():Boolean; function load(_arg1:ApplicationDomain=null, _arg2:SecurityDomain=null):void; function release():void; function get error():Boolean; function get data():Object; function publish(E:\dev\3.0.x\frameworks\projects\framework\src;mx\modules;IModuleInfo.as:IFlexModuleFactory):void; function get factory():IFlexModuleFactory; function set data(E:\dev\3.0.x\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 184
//ModuleManager (mx.modules.ModuleManager) package mx.modules { import mx.core.*; public class ModuleManager { mx_internal static const VERSION:String = "3.0.0.0"; 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):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); }; }; } 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); }; //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); 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); } 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):void{ if (_loaded){ return; }; _loaded = true; limbo = null; 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 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 185
//ModuleManagerGlobals (mx.modules.ModuleManagerGlobals) package mx.modules { public class ModuleManagerGlobals { public static var managerSingleton:Object = null; public function ModuleManagerGlobals(){ super(); } } }//package mx.modules
Section 186
//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.0.0.0"; 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.parent); 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 parentContainer:DisplayObjectContainer; private function ErrorField(parent:DisplayObjectContainer){ super(); this.parentContainer = parent; } public function show(errorText:String):void{ if ((((errorText == null)) || ((errorText.length == 0)))){ return; }; var stage:Stage = parentContainer.stage; 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), (stage.stageWidth - (TEXT_MARGIN_PX * 2))); textField.width = Math.min((MAX_WIDTH_INCHES * Capabilities.screenDPI), textField.width); textField.y = Math.max(0, ((stage.stageHeight - TEXT_MARGIN_PX) - textField.height)); textField.x = ((stage.stageWidth - textField.width) / 2); parentContainer.addChild(this); this.addChild(textField); } protected function get labelFormat():TextFormat{ var tf:TextFormat = new TextFormat(); tf.color = 0; tf.font = "Verdana"; tf.size = 10; return (tf); } }
Section 187
//IPreloaderDisplay (mx.preloaders.IPreloaderDisplay) package mx.preloaders { import flash.display.*; import flash.events.*; public interface IPreloaderDisplay extends IEventDispatcher { function set backgroundAlpha(E:\dev\3.0.x\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:Number):void; function get stageHeight():Number; function get stageWidth():Number; function set backgroundColor(E:\dev\3.0.x\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:uint):void; function set preloader(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:Number):void; function get backgroundColor():uint; function set stageWidth(E:\dev\3.0.x\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:Number):void; function set backgroundImage(E:\dev\3.0.x\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:Object):void; function set backgroundSize(E:\dev\3.0.x\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:String):void; function initialize():void; } }//package mx.preloaders
Section 188
//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.0.0.0"; 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 189
//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 190
//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(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\resources;IResourceManager.as:Array):void; function getUint(_arg1:String, _arg2:String, _arg3:String=null):uint; function addResourceBundle(E:\dev\3.0.x\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 findResourceBundleWithResource(_arg1:String, _arg2:String):IResourceBundle; function getNumber(_arg1:String, _arg2:String, _arg3:String=null):Number; } }//package mx.resources
Section 191
//IResourceModule (mx.resources.IResourceModule) package mx.resources { public interface IResourceModule { function get resourceBundles():Array; } }//package mx.resources
Section 192
//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.0.0.0"; 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 193
//ResourceManager (mx.resources.ResourceManager) package mx.resources { import mx.core.*; public class ResourceManager { mx_internal static const VERSION:String = "3.0.0.0"; 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")); }; return (instance); } } }//package mx.resources
Section 194
//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.0.0.0"; 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 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 addResourceBundle(resourceBundle:IResourceBundle):void{ var locale:String = resourceBundle.locale; var bundleName:String = resourceBundle.bundleName; if (!localeMap[locale]){ localeMap[locale] = {}; }; localeMap[locale][bundleName] = resourceBundle; } private function findBundle(bundleName:String, resourceName:String, locale:String):IResourceBundle{ supportNonFrameworkApps(); return (((locale)!=null) ? getResourceBundle(locale, bundleName) : findResourceBundleWithResource(bundleName, 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 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 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 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 getBundleNamesForLocale(locale:String):Array{ var p:String; var bundleNames:Array = []; for (p in localeMap[locale]) { bundleNames.push(p); }; return (bundleNames); } public function removeResourceBundle(locale:String, bundleName:String):void{ delete localeMap[locale][bundleName]; if (getBundleNamesForLocale(locale).length == 0){ delete localeMap[locale]; }; } 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 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)); } 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 195
//IResponder (mx.rpc.IResponder) package mx.rpc { public interface IResponder { function fault(:Object):void; function result(:Object):void; } }//package mx.rpc
Section 196
//ApplicationBackground (mx.skins.halo.ApplicationBackground) package mx.skins.halo { import flash.display.*; import mx.utils.*; import mx.skins.*; public class ApplicationBackground extends ProgrammaticSkin { mx_internal static const VERSION:String = "3.0.0.0"; 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 197
//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.0.0.0"; 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 198
//ButtonSkin (mx.skins.halo.ButtonSkin) package mx.skins.halo { import flash.display.*; import mx.core.*; import mx.styles.*; import mx.utils.*; import mx.skins.*; public class ButtonSkin extends Border { mx_internal static const VERSION:String = "3.0.0.0"; 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 199
//HaloBorder (mx.skins.halo.HaloBorder) package mx.skins.halo { import flash.display.*; import mx.core.*; import mx.styles.*; import mx.graphics.*; import mx.utils.*; import mx.skins.*; 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.0.0.0"; 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 200
//HaloColors (mx.skins.halo.HaloColors) package mx.skins.halo { import mx.utils.*; public class HaloColors { mx_internal static const VERSION:String = "3.0.0.0"; 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 201
//HaloFocusRect (mx.skins.halo.HaloFocusRect) package mx.skins.halo { import flash.display.*; import mx.styles.*; import mx.utils.*; import mx.skins.*; public class HaloFocusRect extends ProgrammaticSkin implements IStyleClient { private var _focusColor:Number; mx_internal static const VERSION:String = "3.0.0.0"; 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 202
//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.0.0.0"; 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 203
//ProgressBarSkin (mx.skins.halo.ProgressBarSkin) package mx.skins.halo { import mx.styles.*; import mx.utils.*; import mx.skins.*; public class ProgressBarSkin extends Border { mx_internal static const VERSION:String = "3.0.0.0"; public function ProgressBarSkin(){ super(); } override public function get measuredWidth():Number{ return (200); } override public function get measuredHeight():Number{ return (6); } override protected function updateDisplayList(w:Number, h:Number):void{ super.updateDisplayList(w, h); var barColorStyle:* = getStyle("barColor"); var barColor:uint = (StyleManager.isValidStyleValue(barColorStyle)) ? barColorStyle : getStyle("themeColor"); var barColor0:Number = ColorUtil.adjustBrightness2(barColor, 40); var fillColors:Array = [barColor0, barColor]; graphics.clear(); drawRoundRect(0, 0, w, h, 0, fillColors, 0.5, verticalGradientMatrix(0, 0, (w - 2), (h - 2))); drawRoundRect(1, 1, (w - 2), (h - 2), 0, fillColors, 1, verticalGradientMatrix(0, 0, (w - 2), (h - 2))); } } }//package mx.skins.halo
Section 204
//ProgressIndeterminateSkin (mx.skins.halo.ProgressIndeterminateSkin) package mx.skins.halo { import flash.display.*; import mx.styles.*; import mx.utils.*; import mx.skins.*; public class ProgressIndeterminateSkin extends Border { mx_internal static const VERSION:String = "3.0.0.0"; public function ProgressIndeterminateSkin(){ super(); } override public function get measuredWidth():Number{ return (195); } override public function get measuredHeight():Number{ return (6); } override protected function updateDisplayList(w:Number, h:Number):void{ super.updateDisplayList(w, h); var barColorStyle:* = getStyle("barColor"); var barColor:uint = (StyleManager.isValidStyleValue(barColorStyle)) ? barColorStyle : getStyle("themeColor"); var barColor0:Number = ColorUtil.adjustBrightness2(barColor, 60); var hatchInterval:Number = getStyle("indeterminateMoveInterval"); if (isNaN(hatchInterval)){ hatchInterval = 28; }; var g:Graphics = graphics; g.clear(); var i:int; while (i < w) { g.beginFill(barColor0, 0.8); g.moveTo(i, 1); g.lineTo(Math.min((i + 14), w), 1); g.lineTo(Math.min((i + 10), w), (h - 1)); g.lineTo(Math.max((i - 4), 0), (h - 1)); g.lineTo(i, 1); g.endFill(); i = (i + hatchInterval); }; } } }//package mx.skins.halo
Section 205
//ProgressMaskSkin (mx.skins.halo.ProgressMaskSkin) package mx.skins.halo { import flash.display.*; import mx.skins.*; public class ProgressMaskSkin extends ProgrammaticSkin { mx_internal static const VERSION:String = "3.0.0.0"; public function ProgressMaskSkin(){ super(); } override protected function updateDisplayList(w:Number, h:Number):void{ super.updateDisplayList(w, h); var g:Graphics = graphics; g.clear(); g.beginFill(0xFFFF00); g.drawRect(1, 1, (w - 2), (h - 2)); g.endFill(); } } }//package mx.skins.halo
Section 206
//ProgressTrackSkin (mx.skins.halo.ProgressTrackSkin) package mx.skins.halo { import mx.styles.*; import mx.utils.*; import mx.skins.*; public class ProgressTrackSkin extends Border { mx_internal static const VERSION:String = "3.0.0.0"; public function ProgressTrackSkin(){ super(); } override public function get measuredWidth():Number{ return (200); } override public function get measuredHeight():Number{ return (6); } override protected function updateDisplayList(w:Number, h:Number):void{ super.updateDisplayList(w, h); var borderColor:uint = getStyle("borderColor"); var fillColors:Array = (getStyle("trackColors") as Array); StyleManager.getColorNames(fillColors); var borderColorDrk1:Number = ColorUtil.adjustBrightness2(borderColor, -30); graphics.clear(); drawRoundRect(0, 0, w, h, 0, [borderColorDrk1, borderColor], 1, verticalGradientMatrix(0, 0, w, h)); drawRoundRect(1, 1, (w - 2), (h - 2), 0, fillColors, 1, verticalGradientMatrix(1, 1, (w - 2), (h - 2))); } } }//package mx.skins.halo
Section 207
//ScrollArrowSkin (mx.skins.halo.ScrollArrowSkin) package mx.skins.halo { import flash.display.*; import mx.core.*; import mx.styles.*; import mx.controls.scrollClasses.*; import mx.utils.*; import mx.skins.*; public class ScrollArrowSkin extends Border { mx_internal static const VERSION:String = "3.0.0.0"; 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 208
//ScrollThumbSkin (mx.skins.halo.ScrollThumbSkin) package mx.skins.halo { import flash.display.*; import mx.styles.*; import mx.utils.*; import mx.skins.*; public class ScrollThumbSkin extends Border { mx_internal static const VERSION:String = "3.0.0.0"; 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 209
//ScrollTrackSkin (mx.skins.halo.ScrollTrackSkin) package mx.skins.halo { import flash.display.*; import mx.core.*; import mx.styles.*; import mx.utils.*; import mx.skins.*; public class ScrollTrackSkin extends Border { mx_internal static const VERSION:String = "3.0.0.0"; 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 210
//TitleBackground (mx.skins.halo.TitleBackground) package mx.skins.halo { import flash.display.*; import mx.styles.*; import mx.utils.*; import mx.skins.*; public class TitleBackground extends ProgrammaticSkin { mx_internal static const VERSION:String = "3.0.0.0"; 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 211
//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.0.0.0"; 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 212
//Border (mx.skins.Border) package mx.skins { import mx.core.*; public class Border extends ProgrammaticSkin implements IBorder { mx_internal static const VERSION:String = "3.0.0.0"; public function Border(){ super(); } public function get borderMetrics():EdgeMetrics{ return (EdgeMetrics.EMPTY); } } }//package mx.skins
Section 213
//ProgrammaticSkin (mx.skins.ProgrammaticSkin) package mx.skins { import flash.display.*; import flash.geom.*; import mx.core.*; 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.0.0.0"; private static var tempMatrix:Matrix = new Matrix(); public function ProgrammaticSkin(){ super(); _width = measuredWidth; _height = measuredHeight; } public function getStyle(styleProp:String){ return (_styleName.getStyle(styleProp)); } 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 214
//RectangularBorder (mx.skins.RectangularBorder) package mx.skins { import flash.display.*; import flash.geom.*; import mx.core.*; import flash.events.*; import mx.resources.*; import mx.styles.*; import flash.utils.*; import flash.system.*; import flash.net.*; public class RectangularBorder extends Border implements IRectangularBorder { private var backgroundImage:DisplayObject; private var backgroundImageHeight:Number; private var _backgroundImageBounds:Rectangle; private var backgroundImageStyle:Object; private var backgroundImageWidth:Number; private var resourceManager:IResourceManager; mx_internal static const VERSION:String = "3.0.0.0"; 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 215
//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 216
//State (mx.states.State) package mx.states { 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.0.0.0"; 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 217
//Transition (mx.states.Transition) package mx.states { 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.0.0.0"; public function Transition(){ super(); } } }//package mx.states
Section 218
//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.0.0.0"; 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 219
//ISimpleStyleClient (mx.styles.ISimpleStyleClient) package mx.styles { public interface ISimpleStyleClient { function set styleName(E:\dev\3.0.x\frameworks\projects\framework\src;mx\styles;ISimpleStyleClient.as:Object):void; function styleChanged(E:\dev\3.0.x\frameworks\projects\framework\src;mx\styles;ISimpleStyleClient.as:String):void; function get styleName():Object; } }//package mx.styles
Section 220
//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 221
//IStyleManager (mx.styles.IStyleManager) package mx.styles { import flash.events.*; public interface IStyleManager { function isColorName(value:String):Boolean; function registerParentDisplayListInvalidatingStyle(E:\dev\3.0.x\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void; function registerInheritingStyle(E:\dev\3.0.x\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void; function set stylesRoot(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\styles;IStyleManager.as:Object):void; function unloadStyleDeclarations(_arg1:String, _arg2:Boolean=true):void; function getColorNames(E:\dev\3.0.x\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(E:\dev\3.0.x\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(E:\dev\3.0.x\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void; function registerSizeInvalidatingStyle(E:\dev\3.0.x\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 222
//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 223
//IStyleModule (mx.styles.IStyleModule) package mx.styles { public interface IStyleModule { function unload():void; } }//package mx.styles
Section 224
//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.0.0.0"; 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 225
//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.0.0.0"; 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 226
//StyleProtoChain (mx.styles.StyleProtoChain) package mx.styles { import flash.display.*; import mx.core.*; public class StyleProtoChain { mx_internal static const VERSION:String = "3.0.0.0"; 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 227
//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.0.0.0"; 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 228
//ColorUtil (mx.utils.ColorUtil) package mx.utils { public class ColorUtil { mx_internal static const VERSION:String = "3.0.0.0"; 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 229
//DescribeTypeCache (mx.utils.DescribeTypeCache) package mx.utils { import mx.binding.*; import flash.utils.*; public class DescribeTypeCache { mx_internal static const VERSION:String = "3.0.0.0"; private static var cacheHandlers:Object = {}; private static var typeCache:Object = {}; public function DescribeTypeCache(){ super(); } public static function describeType(o):DescribeTypeCacheRecord{ var className:String; var typeDescription:XML; var record:DescribeTypeCacheRecord; if ((o is String)){ className = o; } else { className = getQualifiedClassName(o); }; if ((className in typeCache)){ return (typeCache[className]); }; if ((o is String)){ o = getDefinitionByName(o); }; typeDescription = describeType(o); record = new DescribeTypeCacheRecord(); record.typeDescription = typeDescription; record.typeName = className; typeCache[className] = record; return (record); } public static function registerCacheHandler(valueName:String, handler:Function):void{ cacheHandlers[valueName] = handler; } static function extractValue(valueName:String, record:DescribeTypeCacheRecord){ if ((valueName in cacheHandlers)){ return (cacheHandlers[valueName](record)); }; return (undefined); } private static function bindabilityInfoHandler(record:DescribeTypeCacheRecord){ return (new BindabilityInfo(record.typeDescription)); } registerCacheHandler("bindabilityInfo", bindabilityInfoHandler); } }//package mx.utils
Section 230
//DescribeTypeCacheRecord (mx.utils.DescribeTypeCacheRecord) package mx.utils { import flash.utils.*; public dynamic class DescribeTypeCacheRecord extends Proxy { public var typeDescription:XML; public var typeName:String; private var cache:Object; public function DescribeTypeCacheRecord(){ cache = {}; super(); } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(name){ var result:* = cache[name]; if (result === undefined){ result = DescribeTypeCache.extractValue(name, this); cache[name] = result; }; return (result); } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(name):Boolean{ if ((name in cache)){ return (true); }; var value:* = DescribeTypeCache.extractValue(name, this); if (value === undefined){ return (false); }; cache[name] = value; return (true); } } }//package mx.utils
Section 231
//GraphicsUtil (mx.utils.GraphicsUtil) package mx.utils { import flash.display.*; import mx.core.*; public class GraphicsUtil { mx_internal static const VERSION:String = "3.0.0.0"; 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 232
//NameUtil (mx.utils.NameUtil) package mx.utils { import flash.display.*; import mx.core.*; import flash.utils.*; public class NameUtil { mx_internal static const VERSION:String = "3.0.0.0"; private static var counter:int = 0; public function NameUtil(){ super(); } public static function displayObjectToString(displayObject:DisplayObject):String{ var result:String; var s:String; var indices:Array; var o:DisplayObject = 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; }; 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 233
//StringUtil (mx.utils.StringUtil) package mx.utils { import mx.core.*; public class StringUtil { mx_internal static const VERSION:String = "3.0.0.0"; 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 234
//IValidatorListener (mx.validators.IValidatorListener) package mx.validators { import mx.events.*; public interface IValidatorListener { function set errorString(E:\dev\3.0.x\frameworks\projects\framework\src;mx\validators;IValidatorListener.as:String):void; function get validationSubField():String; function validationResultHandler(E:\dev\3.0.x\frameworks\projects\framework\src;mx\validators;IValidatorListener.as:ValidationResultEvent):void; function set validationSubField(E:\dev\3.0.x\frameworks\projects\framework\src;mx\validators;IValidatorListener.as:String):void; function get errorString():String; } }//package mx.validators
Section 235
//ValidationResult (mx.validators.ValidationResult) package mx.validators { 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.0.0.0"; 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 236
//CraptuneChannel (net.kaikoga.audio.craptune.core.CraptuneChannel) package net.kaikoga.audio.craptune.core { import flash.utils.*; import net.kaikoga.audio.processor.*; import net.kaikoga.audio.craptune.mml.*; import net.kaikoga.audio.*; public class CraptuneChannel implements IRawLoopProcessor { private var _mmlChannel:CraptuneMMLChannel; private var _mmlNoteIndex:int;// = 0 public function CraptuneChannel(mmlch:CraptuneMMLChannel){ super(); this._mmlChannel = mmlch; } public function getChannels():uint{ return (RawSoundBuffer.CHANNELS_MONO); } public function reset():void{ this._mmlNoteIndex = 0; } public function getLoopSamples():int{ return ((44100 * 0)); } public function processRawBytes(bytes:ByteArray, start:int, end:int):void{ var cmd:ACraptuneMMLCommand; var notes:Array = this._mmlChannel.getNotes(); var c:int = notes.length; while (this._mmlNoteIndex < c) { cmd = notes[this._mmlNoteIndex]; if (cmd.baseTime > end){ break; }; cmd.processCommand(bytes); this._mmlNoteIndex++; }; } public function getBytes():int{ return ((44100 * 0)); } public function getRate():uint{ return (RawSoundBuffer.RATE_44100); } public function toString():String{ return ("[CTChannel]"); } public function getBits():uint{ return (RawSoundBuffer.SAMPLE_INT8); } } }//package net.kaikoga.audio.craptune.core
Section 237
//CraptuneEnvironment (net.kaikoga.audio.craptune.core.CraptuneEnvironment) package net.kaikoga.audio.craptune.core { import net.kaikoga.audio.craptune.samplets.*; import net.kaikoga.audio.craptune.effectors.*; import net.kaikoga.audio.craptune.waveforms.*; public class CraptuneEnvironment { private var _sampletPool:Object; private var _effectorPool:Object; private var _waveformFactory:CraptuneWaveformFactory; private var _effectorFactory:CraptuneEffectorFactory; private var _waveformPool:Object; private var _sampletFactory:CraptuneSampletFactory; public function CraptuneEnvironment(){ _waveformPool = {}; _sampletPool = {}; _effectorPool = {}; super(); this._waveformFactory = new CraptuneWaveformFactory(); this._sampletFactory = new CraptuneSampletFactory(); this._effectorFactory = new CraptuneEffectorFactory(); this._waveformFactory.loadDefault(); this._sampletFactory.loadDefault(); this._effectorFactory.loadDefault(); var waveform:CraptuneWaveformCache = new CraptuneWaveformCache(new SquareWaveform()); this._waveformPool._ = waveform; this._sampletPool._ = new NoiseSamplet(); this._effectorPool._ = waveform; } public function loadWaveform(params:String, instbank:CraptuneInstrumentBank):CraptuneWaveformCache{ var paramline:CraptuneParamLine; var result:CraptuneWaveformCache = this._waveformPool[params]; if (result == null){ paramline = new CraptuneParamLine(params); result = new CraptuneWaveformCache(this._waveformFactory.createWaveform(paramline.next(), instbank)); this._waveformPool[params] = result; }; return (result); } public function loadSamplet(params:String, instbank:CraptuneInstrumentBank):ICraptuneSamplet{ var paramline:CraptuneParamLine; var result:ICraptuneSamplet = this._sampletPool[params]; if (result == null){ paramline = new CraptuneParamLine(params); result = this._sampletFactory.createSamplet(paramline.next(), instbank); this._sampletPool[params] = result; }; return (result); } public function toString():String{ return ("[CTEnvironment]"); } public function loadEffector(params:String, instbank:CraptuneInstrumentBank):ICraptuneEffector{ var paramline:CraptuneParamLine; var effectors:Array; var paramlist:CraptuneParamList; var peek:String; var obj:Object; var result:ICraptuneEffector = this._effectorPool[params]; if (result == null){ paramline = new CraptuneParamLine(params); if (paramline.length() > 1){ effectors = []; while (paramline.hasNext()) { paramlist = paramline.next(); if (!paramlist.hasNext()){ break; }; peek = paramlist.toString(); obj = /^(@|@e|e:)([0-9]+)/.exec(peek); if (obj != null){ effectors.push(instbank.getEffector(int(obj[2]))); } else { obj = /^(|@w|w:)([0-9]+)/.exec(peek); if (obj != null){ effectors.push(instbank.getWaveformCache(int(obj[2]))); } else { effectors.push(this._effectorFactory.createEffector(paramlist, instbank)); }; }; }; result = new CompositeEffector(effectors); } else { result = this._effectorFactory.createEffector(paramline.next(), instbank); }; }; return (result); } } }//package net.kaikoga.audio.craptune.core
Section 238
//CraptuneInstrumentBank (net.kaikoga.audio.craptune.core.CraptuneInstrumentBank) package net.kaikoga.audio.craptune.core { import net.kaikoga.audio.craptune.samplets.*; import net.kaikoga.audio.craptune.effectors.*; public class CraptuneInstrumentBank { private var _effectors:Array; private var _waveformCaches:Array; private var _environment:CraptuneEnvironment; private var _samplets:Array; public function CraptuneInstrumentBank(env:CraptuneEnvironment){ super(); this._environment = env; this._waveformCaches = [env.loadWaveform("_", this)]; this._samplets = [env.loadSamplet("_", this)]; this._effectors = [env.loadEffector("_", this)]; } public function getSamplet(index:int):ICraptuneSamplet{ var result:ICraptuneSamplet = this._samplets[index]; return (((result)==null) ? this._samplets[0] : result); } public function putEffector(index:int, effector:ICraptuneEffector):void{ this._effectors[index] = effector; } public function toString():String{ return ("[CTInstrumentBank]"); } public function getWaveformCache(index:int):CraptuneWaveformCache{ var result:CraptuneWaveformCache = this._waveformCaches[index]; return (((result)==null) ? this._waveformCaches[0] : result); } public function getEffector(index:int):ICraptuneEffector{ var result:ICraptuneEffector = this._effectors[index]; return (((result)==null) ? this._effectors[0] : result); } public function putWaveformCache(index:int, wavecache:CraptuneWaveformCache):void{ this._waveformCaches[index] = wavecache; } public function putSamplet(index:int, samplet:ICraptuneSamplet):void{ this._samplets[index] = samplet; } } }//package net.kaikoga.audio.craptune.core
Section 239
//CraptuneParamLine (net.kaikoga.audio.craptune.core.CraptuneParamLine) package net.kaikoga.audio.craptune.core { public class CraptuneParamLine { private var _original:String; private var _paramLists:Array; private var _position:int;// = 0 public function CraptuneParamLine(params:String){ _paramLists = []; super(); this._original = params; this._paramLists = ((params.length)==0) ? [] : params.split(";"); var c:int = this._paramLists.length; var i:int; while (i < c) { this._paramLists[i] = new CraptuneParamList(this._paramLists[i]); i++; }; } public function length():int{ return (this._paramLists.length); } public function next():CraptuneParamList{ return (this._paramLists[this._position++]); } public function toString():String{ return (this._original); } public function hasNext():Boolean{ return ((this._paramLists.length > this._position)); } } }//package net.kaikoga.audio.craptune.core
Section 240
//CraptuneParamList (net.kaikoga.audio.craptune.core.CraptuneParamList) package net.kaikoga.audio.craptune.core { import net.kaikoga.utils.*; public class CraptuneParamList { private var _params:Array; private var _position:int;// = 0 private var _original:String; public function CraptuneParamList(params:String){ _params = []; super(); this._original = params; this._params = ((params.length)==0) ? [] : params.split(","); } public function length():int{ return (this._params.length); } public function toString():String{ return (this._original); } public function hasNext():Boolean{ return ((this._params.length > this._position)); } public function next():String{ return (this._params[this._position++]); } public function rest():Array{ return (this._params.slice(this._position)); } public function nextCharCode(defvalue:String):int{ var idxstr:String = this.next(); return (((idxstr)==null) ? defvalue : SS_StringUtil.trim(idxstr).charCodeAt(0)); } public function nextNumber(defvalue:Number):Number{ var idxstr:String = this.next(); return (((idxstr)==null) ? defvalue : Number(SS_StringUtil.trim(idxstr))); } } }//package net.kaikoga.audio.craptune.core
Section 241
//CraptunePitchTable (net.kaikoga.audio.craptune.core.CraptunePitchTable) package net.kaikoga.audio.craptune.core { public class CraptunePitchTable { private static var PITCH_TABLE:Array = [5381.737058, 5079.683366, 4794.582646, 4525.4834, 4271.487533, 4031.74736, 3805.462768, 3591.878555, 3390.281902, 3200, 3020.397801, 2850.875898]; public function CraptunePitchTable(){ super(); } public function toString():String{ return ("[CTPitchTable]"); } public static function noteToPitch(note:int):Number{ var i:int; var pitchtable:Array = PITCH_TABLE; if (pitchtable.length == 12){ i = 12; while (i < 128) { pitchtable[i] = (pitchtable[(i - 12)] / 2); i++; }; }; return (pitchtable[note]); } } }//package net.kaikoga.audio.craptune.core
Section 242
//CraptuneWaveformCache (net.kaikoga.audio.craptune.core.CraptuneWaveformCache) package net.kaikoga.audio.craptune.core { import flash.utils.*; import net.kaikoga.audio.craptune.mml.*; import net.kaikoga.audio.craptune.effectors.*; import net.kaikoga.audio.craptune.waveforms.*; import net.kaikoga.utils.*; public class CraptuneWaveformCache implements ICraptuneEffector { private var _alignResamples:Array; private var _waveform:ICraptuneWaveform; public function CraptuneWaveformCache(waveform:ICraptuneWaveform){ super(); this._waveform = waveform; this._alignResamples = []; } public function decorate(note:CraptuneMMLNote, bytes:ByteArray):void{ note.nowWaveform = this; } public function initLength(note:CraptuneMMLNote, bytes:ByteArray):void{ } public function addWave(bytes:ByteArray, start:int, end:int, phase:Number, pitch:Number, velocity:int):Number{ var sample:ByteArray = this.getAlignResample(pitch, velocity); var pos:int = start; var npos:Number = start; var range:int = (end - start); if (((phase * pitch) + range) < pitch){ SS_ByteArrayUtil.addBytes(bytes, pos, range, sample, (phase * pitch)); return ((phase + (range / pitch))); }; range = (pitch * (1 - phase)); SS_ByteArrayUtil.addBytes(bytes, pos, range, sample, (phase * pitch)); pos = (pos + range); npos = (npos + (pitch * (1 - phase))); while ((npos + pitch) <= end) { npos = (npos + pitch); range = (int((npos + pitch)) - int(npos)); SS_ByteArrayUtil.addBytes(bytes, pos, range, sample, 0); pos = (pos + range); }; range = (end - pos); SS_ByteArrayUtil.addBytes(bytes, pos, range, sample, 0); return ((range / pitch)); } public function getAlignResample(pitch:int, velocity:int):ByteArray{ var index = ((pitch << 8) | velocity); var result:ByteArray = this._alignResamples[index]; if (result == null){ result = this._waveform.createAlignResample(pitch, velocity); this._alignResamples[index] = result; }; return (result); } public function toString():String{ return ((("[CTWaveCache " + String(this._waveform)) + "]")); } } }//package net.kaikoga.audio.craptune.core
Section 243
//ADSREffector (net.kaikoga.audio.craptune.effectors.ADSREffector) package net.kaikoga.audio.craptune.effectors { import flash.utils.*; import net.kaikoga.audio.craptune.mml.*; import net.kaikoga.audio.craptune.core.*; public class ADSREffector implements ICraptuneEffector, ICraptuneEffectorFactory { private var _sustainVelocity:Number;// = 1 private var _decayBound:Number;// = 0 private var _attackVelocity:Number;// = 0.5 private var _releaseVelocity:Number;// = 0.5 private var _releaseBound:Number;// = 1 private var _attackBound:Number;// = 0 private var _decayVelocity:Number;// = 1 private var _sustainBound:Number;// = 1 public function ADSREffector(ab:Number, db:Number, sb:Number, rb:Number, av:Number, dv:Number, sv:Number, rv:Number){ super(); this._attackBound = ab; this._decayBound = db; this._sustainBound = sb; this._releaseBound = rb; this._attackVelocity = av; this._decayVelocity = dv; this._sustainVelocity = sv; this._releaseVelocity = rv; } public function decorate(note:CraptuneMMLNote, bytes:ByteArray):void{ var bound:int; if (this._attackBound > 0){ bound = (note.length * this._attackBound); if (note.nowOffset < bound){ if (bound < note.nowBound){ note.nowBound = bound; }; note.nowVelocity = (note.nowVelocity * this._attackVelocity); return; }; }; if (this._decayBound > 0){ bound = (note.length * this._decayBound); if (note.nowOffset < bound){ if (bound < note.nowBound){ note.nowBound = bound; }; note.nowVelocity = (note.nowVelocity * this._decayVelocity); return; }; }; if (this._sustainBound > 0){ bound = (note.length * this._sustainBound); if (note.nowOffset < bound){ if (bound < note.nowBound){ note.nowBound = bound; }; note.nowVelocity = (note.nowVelocity * this._sustainVelocity); return; }; }; if (this._releaseVelocity > 0){ bound = (note.length * this._releaseBound); if (note.nowOffset < bound){ if (bound < note.nowBound){ note.nowBound = bound; }; note.nowVelocity = (note.nowVelocity * this._releaseVelocity); return; }; }; note.nowVelocity = 0; } public function toString():String{ return ("[CTADSREffect ]"); } public function initLength(note:CraptuneMMLNote, bytes:ByteArray):void{ var len:int = (note.length * this._releaseBound); if (note.nowLength < len){ note.nowLength = len; }; } public function createEffector(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneEffector{ return (new ADSREffector(params.nextNumber(ECraptuneEffector.DEFAULT_ATTACK_BOUND), params.nextNumber(ECraptuneEffector.DEFAULT_DECAY_BOUND), params.nextNumber(ECraptuneEffector.DEFAULT_SUSTAIN_BOUND), params.nextNumber(ECraptuneEffector.DEFAULT_RELEASE_BOUND), params.nextNumber(ECraptuneEffector.DEFAULT_ATTACK_VELOCITY), params.nextNumber(ECraptuneEffector.DEFAULT_DECAY_VELOCITY), params.nextNumber(ECraptuneEffector.DEFAULT_SUSTAIN_VELOCITY), params.nextNumber(ECraptuneEffector.DEFAULT_RELEASE_VELOCITY))); } } }//package net.kaikoga.audio.craptune.effectors
Section 244
//CompositeEffector (net.kaikoga.audio.craptune.effectors.CompositeEffector) package net.kaikoga.audio.craptune.effectors { import flash.utils.*; import net.kaikoga.audio.craptune.mml.*; import net.kaikoga.audio.craptune.core.*; public class CompositeEffector implements ICraptuneEffector, ICraptuneEffectorFactory { private var _effectors:Array; public function CompositeEffector(effectors:Array){ super(); this._effectors = effectors; } public function initLength(note:CraptuneMMLNote, bytes:ByteArray):void{ var effects:Array = this._effectors; var c:int = effects.length; var i:int; while (i < c) { ICraptuneEffector(effects[i]).initLength(note, bytes); i++; }; } public function toString():String{ return ("[CTCompositeEffect ]"); } public function decorate(note:CraptuneMMLNote, bytes:ByteArray):void{ var effects:Array = this._effectors; var c:int = effects.length; var i:int; while (i < c) { ICraptuneEffector(effects[i]).decorate(note, bytes); i++; }; } public function createEffector(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneEffector{ var parama:Array = []; while (params.hasNext()) { parama.push(instbank.getEffector(params.nextNumber(0))); }; return (new CompositeEffector(parama)); } } }//package net.kaikoga.audio.craptune.effectors
Section 245
//CraptuneEffectorFactory (net.kaikoga.audio.craptune.effectors.CraptuneEffectorFactory) package net.kaikoga.audio.craptune.effectors { import net.kaikoga.audio.craptune.core.*; public class CraptuneEffectorFactory implements ICraptuneEffectorFactory, ICraptuneEffectorBranch { private var _factoryMap:Object; private var _defaultFactory:ICraptuneEffectorFactory; public function CraptuneEffectorFactory(){ super(); this._defaultFactory = new FlatEffector(); this._factoryMap = {}; } public function createEffector(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneEffector{ var factory:ICraptuneEffectorFactory = this._factoryMap[params.next()]; if (factory == null){ factory = this._defaultFactory; }; return (factory.createEffector(params, instbank)); } public function registerEffectorFactory(path:String, factory:ICraptuneEffectorFactory):void{ this._factoryMap[path] = factory; } public function toString():String{ return ("[CTEffectFactory ]"); } public function loadDefault():void{ this.registerEffectorFactory("flat", this._defaultFactory); this.registerEffectorFactory("default", new DefaultEffector()); this.registerEffectorFactory("adsr", new ADSREffector(0, 0, 0, 0, 0, 0, 0, 0)); this.registerEffectorFactory("tremolo", new TremoloEffector(0, 0, 0)); this.registerEffectorFactory("vibrato", new VibratoEffector(0, 0, 0)); this.registerEffectorFactory("composite", new CompositeEffector(null)); this.registerEffectorFactory("sampletkit", new SampletKitEffector([])); } } }//package net.kaikoga.audio.craptune.effectors
Section 246
//DefaultEffector (net.kaikoga.audio.craptune.effectors.DefaultEffector) package net.kaikoga.audio.craptune.effectors { import flash.utils.*; import net.kaikoga.audio.craptune.mml.*; import net.kaikoga.audio.craptune.core.*; public class DefaultEffector implements ICraptuneEffector, ICraptuneEffectorFactory { public function DefaultEffector(){ super(); } public function createEffector(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneEffector{ return (this); } public function initLength(note:CraptuneMMLNote, bytes:ByteArray):void{ } public function toString():String{ return ("[CTDefaultEffect ]"); } public function decorate(note:CraptuneMMLNote, bytes:ByteArray):void{ var bound:int; bound = (note.nowLength * 0.2); if (note.nowOffset < bound){ if (bound < note.nowBound){ note.nowBound = bound; }; return; }; bound = (note.nowLength * 0.7); if (note.nowOffset < bound){ if (bound < note.nowBound){ note.nowBound = bound; }; note.nowVelocity = (note.nowVelocity * 0.7); return; }; bound = note.nowLength; if (note.nowOffset < bound){ if (bound < note.nowBound){ note.nowBound = bound; }; note.nowVelocity = (note.nowVelocity * 0.25); return; }; note.nowVelocity = 0; } } }//package net.kaikoga.audio.craptune.effectors
Section 247
//ECraptuneEffector (net.kaikoga.audio.craptune.effectors.ECraptuneEffector) package net.kaikoga.audio.craptune.effectors { public class ECraptuneEffector { static const DEFAULT_DECAY_VELOCITY:Number = 1; static const DEFAULT_SUSTAIN_BOUND:Number = 1; static const DEFAULT_ATTACK_BOUND:Number = 0; static const DEFAULT_LFO_VOLUME_STRENGTH:Number = 1.35; static const DEFAULT_RELEASE_BOUND:Number = 1; static const DEFAULT_RELEASE_VELOCITY:Number = 0.5; static const DEFAULT_LFO_DELAY:Number = 10000; static const DEFAULT_LFO_PITCH_STRENGTH:Number = 1.01; static const DEFAULT_SUSTAIN_VELOCITY:Number = 1; static const DEFAULT_DECAY_BOUND:Number = 0; static const DEFAULT_ATTACK_VELOCITY:Number = 0.5; static const DEFAULT_LFO_SPEED:Number = 2000; public function ECraptuneEffector(){ super(); } } }//package net.kaikoga.audio.craptune.effectors
Section 248
//FlatEffector (net.kaikoga.audio.craptune.effectors.FlatEffector) package net.kaikoga.audio.craptune.effectors { import flash.utils.*; import net.kaikoga.audio.craptune.mml.*; import net.kaikoga.audio.craptune.core.*; public class FlatEffector implements ICraptuneEffector, ICraptuneEffectorFactory { public function FlatEffector(){ super(); } public function createEffector(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneEffector{ return (this); } public function initLength(note:CraptuneMMLNote, bytes:ByteArray):void{ } public function toString():String{ return ("[CTFlatEffect ]"); } public function decorate(note:CraptuneMMLNote, bytes:ByteArray):void{ } public function initBound(note:CraptuneMMLNote, bytes:ByteArray):void{ } } }//package net.kaikoga.audio.craptune.effectors
Section 249
//ICraptuneEffector (net.kaikoga.audio.craptune.effectors.ICraptuneEffector) package net.kaikoga.audio.craptune.effectors { import flash.utils.*; import net.kaikoga.audio.craptune.mml.*; public interface ICraptuneEffector { function decorate(_arg1:CraptuneMMLNote, _arg2:ByteArray):void; function initLength(_arg1:CraptuneMMLNote, _arg2:ByteArray):void; } }//package net.kaikoga.audio.craptune.effectors
Section 250
//ICraptuneEffectorBranch (net.kaikoga.audio.craptune.effectors.ICraptuneEffectorBranch) package net.kaikoga.audio.craptune.effectors { public interface ICraptuneEffectorBranch { function registerEffectorFactory(_arg1:String, _arg2:ICraptuneEffectorFactory):void; } }//package net.kaikoga.audio.craptune.effectors
Section 251
//ICraptuneEffectorFactory (net.kaikoga.audio.craptune.effectors.ICraptuneEffectorFactory) package net.kaikoga.audio.craptune.effectors { import net.kaikoga.audio.craptune.core.*; public interface ICraptuneEffectorFactory { function createEffector(_arg1:CraptuneParamList, _arg2:CraptuneInstrumentBank):ICraptuneEffector; } }//package net.kaikoga.audio.craptune.effectors
Section 252
//SampletKitEffector (net.kaikoga.audio.craptune.effectors.SampletKitEffector) package net.kaikoga.audio.craptune.effectors { import flash.utils.*; import net.kaikoga.audio.craptune.mml.*; import net.kaikoga.audio.craptune.core.*; import net.kaikoga.audio.craptune.samplets.*; import net.kaikoga.utils.*; public class SampletKitEffector implements ICraptuneEffector, ICraptuneEffectorFactory { private var _sampletMap:Object; public function SampletKitEffector(samplets:Array){ super(); if (samplets.length == 0){ samplets.push(null); }; this._sampletMap = {}; var c:int = samplets.length; var idx:int; var i:int; while (i < 128) { var _temp1 = idx; idx = (idx + 1); this._sampletMap[CraptunePitchTable.noteToPitch(i)] = samplets[_temp1]; if (idx == c){ idx = 0; }; i++; }; } public function createEffector(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneEffector{ var parama:Array = []; while (params.hasNext()) { parama.push(instbank.getSamplet(params.nextNumber(0))); }; return (new SampletKitEffector(parama)); } public function initLength(note:CraptuneMMLNote, bytes:ByteArray):void{ note.nowLength = 1; } public function toString():String{ return ("[CTSampletKitEffect ]"); } public function decorate(note:CraptuneMMLNote, bytes:ByteArray):void{ var samplet:ICraptuneSamplet; var sbytes:ByteArray; if (note.nowOffset == 0){ samplet = this._sampletMap[note.pitch]; if (samplet == null){ return; }; sbytes = samplet.getBytes(); SS_ByteArrayUtil.addBytes(bytes, (note.baseTime + note.nowOffset), sbytes.length, sbytes); }; } } }//package net.kaikoga.audio.craptune.effectors
Section 253
//TremoloEffector (net.kaikoga.audio.craptune.effectors.TremoloEffector) package net.kaikoga.audio.craptune.effectors { import flash.utils.*; import net.kaikoga.audio.craptune.mml.*; import net.kaikoga.audio.craptune.core.*; public class TremoloEffector implements ICraptuneEffector, ICraptuneEffectorFactory { private var _delay:int;// = 0 private var _speed:Number;// = 100 private var _strength1:Number;// = 1 private var _strength2:Number;// = 1 public function TremoloEffector(delay:int, speed:Number, strength:Number){ super(); this._delay = delay; this._speed = speed; this._strength1 = 1; this._strength2 = (2 - strength); } public function toString():String{ return ("[CTTremoloEffect ]"); } public function decorate(note:CraptuneMMLNote, bytes:ByteArray):void{ var bound:int = this._delay; if (note.nowOffset < bound){ if (bound < note.nowBound){ note.nowBound = bound; }; return; }; var nextphase:int = Math.floor(((note.nowOffset / this._speed) + 1)); note.nowVelocity = (note.nowVelocity * (((nextphase & 1))==1) ? this._strength1 : this._strength2); bound = (nextphase * this._speed); if (bound < note.nowBound){ note.nowBound = bound; }; } public function initLength(note:CraptuneMMLNote, bytes:ByteArray):void{ } public function createEffector(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneEffector{ return (new TremoloEffector(params.nextNumber(ECraptuneEffector.DEFAULT_LFO_DELAY), params.nextNumber(ECraptuneEffector.DEFAULT_LFO_SPEED), params.nextNumber(ECraptuneEffector.DEFAULT_LFO_VOLUME_STRENGTH))); } } }//package net.kaikoga.audio.craptune.effectors
Section 254
//VibratoEffector (net.kaikoga.audio.craptune.effectors.VibratoEffector) package net.kaikoga.audio.craptune.effectors { import flash.utils.*; import net.kaikoga.audio.craptune.mml.*; import net.kaikoga.audio.craptune.core.*; public class VibratoEffector implements ICraptuneEffector, ICraptuneEffectorFactory { private var _delay:int;// = 0 private var _speed:Number;// = 100 private var _strength1:Number;// = 1 private var _strength2:Number;// = 1 public function VibratoEffector(delay:int, speed:Number, strength:Number){ super(); this._delay = delay; this._speed = speed; this._strength1 = strength; this._strength2 = (2 - strength); } public function toString():String{ return ("[CTVibratoEffect ]"); } public function decorate(note:CraptuneMMLNote, bytes:ByteArray):void{ var bound:int = this._delay; if (note.nowOffset < bound){ if (bound < note.nowBound){ note.nowBound = bound; }; return; }; var nextphase:int = Math.floor(((note.nowOffset / this._speed) + 1)); note.nowPitch = (note.nowPitch * (((nextphase & 1))==1) ? this._strength1 : this._strength2); bound = (nextphase * this._speed); if (bound < note.nowBound){ note.nowBound = bound; }; } public function initLength(note:CraptuneMMLNote, bytes:ByteArray):void{ } public function createEffector(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneEffector{ return (new VibratoEffector(params.nextNumber(ECraptuneEffector.DEFAULT_LFO_DELAY), params.nextNumber(ECraptuneEffector.DEFAULT_LFO_SPEED), params.nextNumber(ECraptuneEffector.DEFAULT_LFO_PITCH_STRENGTH))); } } }//package net.kaikoga.audio.craptune.effectors
Section 255
//ACraptuneMMLCommand (net.kaikoga.audio.craptune.mml.ACraptuneMMLCommand) package net.kaikoga.audio.craptune.mml { import flash.utils.*; public class ACraptuneMMLCommand { public var baseTime:int; public function ACraptuneMMLCommand(){ super(); } public function processCommand(bytes:ByteArray):void{ throw (new Error("ACraptuneMMLCommand.processCommand not implemented")); } } }//package net.kaikoga.audio.craptune.mml
Section 256
//CraptuneMML (net.kaikoga.audio.craptune.mml.CraptuneMML) package net.kaikoga.audio.craptune.mml { public class CraptuneMML { private var _tracks:Object; private var _songs:Object; public function CraptuneMML(){ super(); this._tracks = {}; this._songs = {}; } public function toString():String{ return ("[CTMML]"); } public function addSong(name:String, song:CraptuneMMLSong):void{ this._songs[name] = song; } public function addTrack(name:String, track:CraptuneMMLTrack):void{ this._tracks[name] = track; } public function getSong(name:String):CraptuneMMLSong{ if (name == null){ name = "0"; }; var result:CraptuneMMLSong = this._songs[name]; if (result == null){ result = CraptuneMMLSong.fromTrackName(name); this._songs[name] = result; }; return (result); } public function getTrack(name:String):CraptuneMMLTrack{ return (this._tracks[name]); } } }//package net.kaikoga.audio.craptune.mml
Section 257
//CraptuneMMLChannel (net.kaikoga.audio.craptune.mml.CraptuneMMLChannel) package net.kaikoga.audio.craptune.mml { import net.kaikoga.audio.craptune.core.*; public class CraptuneMMLChannel { private var _notes:Array; public var length:Number; public function CraptuneMMLChannel(insts:CraptuneInstrumentBank){ super(); this._notes = []; } public function getNotes():Array{ return (this._notes); } public function toString():String{ return ("[CTMMLChannel]"); } } }//package net.kaikoga.audio.craptune.mml
Section 258
//CraptuneMMLChannelFactory (net.kaikoga.audio.craptune.mml.CraptuneMMLChannelFactory) package net.kaikoga.audio.craptune.mml { import flash.utils.*; import net.kaikoga.audio.craptune.core.*; public class CraptuneMMLChannelFactory { private const BEATS_MEASURE:Number = 4; private const MINUTE_LENGTH:Number = 2646000; private var _defaultVelocity:int;// = 8 private var _defaultLength:Number;// = 0.25 private var _nowMeasureLength:Number;// = 88200 private var _baseTime:int;// = 0 private var _nowOctave:int;// = 60 private var _nowEffectors:Array; private var _instrumentBank:CraptuneInstrumentBank; private var _result:CraptuneMMLChannel; private static var _pitchShift:Array = []; private static var _noteToPitchIndex:Array = []; public function CraptuneMMLChannelFactory(insts:CraptuneInstrumentBank){ super(); this._result = new CraptuneMMLChannel(insts); this._instrumentBank = insts; this._nowEffectors = [insts.getEffector(0)]; } public function parseIntOf(bytes:ByteArray):int{ var byte:int; var result:int; while (bytes.bytesAvailable > 0) { byte = bytes[bytes.position]; if ((((byte < 48)) || ((byte > 57)))){ break; }; result = ((result * 10) + (byte & 15)); bytes.position++; }; return (result); } private function processBytes(bytes:ByteArray, notes:Array, lastloop:Boolean):void{ var ntpindex:Array; var i:int; var byte:int; var _local10:CraptuneMMLNote; var _local11:int; var _local12:ByteArray; var _local13:ByteArray; var _local14:Array; var _local15:int; bytes.position = 0; ntpindex = _noteToPitchIndex; var pitchshift:Array = _pitchShift; if (ntpindex.length == 0){ ntpindex[99] = 0; ntpindex[100] = 2; ntpindex[101] = 4; ntpindex[102] = 5; ntpindex[103] = 7; ntpindex[97] = 9; ntpindex[98] = 11; ntpindex[60] = -12; ntpindex[62] = 12; pitchshift[43] = 0.943874312682; pitchshift[45] = 1.059463094359; }; var intparam:int; var lenparam:Number = 0; while (bytes.bytesAvailable > 0) { byte = bytes.readByte(); switch (byte){ case 97: case 98: case 99: case 100: case 101: case 102: case 103: _local10 = new CraptuneMMLNote(this._baseTime, CraptunePitchTable.noteToPitch((this._nowOctave + ntpindex[byte])), this._defaultVelocity, (this._nowMeasureLength * this._defaultLength), this._nowEffectors); while (bytes.bytesAvailable > 0) { byte = bytes[bytes.position]; if (pitchshift[byte] == undefined){ break; }; _local10.pitch = (_local10.pitch * pitchshift[byte]); bytes.position++; }; lenparam = this.parseNoteLenOf(bytes); if (lenparam > 0){ _local10.length = (this._nowMeasureLength * lenparam); }; notes.push(_local10); this._baseTime = (this._baseTime + _local10.length); break; case 114: lenparam = this.parseNoteLenOf(bytes); if (lenparam == 0){ lenparam = this._defaultLength; }; this._baseTime = (this._baseTime + (this._nowMeasureLength * lenparam)); break; case 60: case 62: this._nowOctave = (this._nowOctave + ntpindex[byte]); break; case 111: intparam = this.parseIntOf(bytes); if (intparam > 0){ this._nowOctave = (12 * (intparam + 1)); }; break; case 118: intparam = this.parseIntOf(bytes); if (intparam > 0){ this._defaultVelocity = intparam; }; break; case 108: lenparam = this.parseNoteLenOf(bytes); if (lenparam > 0){ this._defaultLength = lenparam; }; break; case 116: intparam = this.parseIntOf(bytes); if (intparam > 0){ this._nowMeasureLength = ((MINUTE_LENGTH * BEATS_MEASURE) / intparam); }; break; case 64: byte = bytes[bytes.position]; switch (byte){ case 64: case 105: bytes.position++; this._nowEffectors = this._nowEffectors.concat(); this._nowEffectors[0] = this._instrumentBank.getEffector(this.parseIntOf(bytes)); break; case 119: bytes.position++; this._nowEffectors = this._nowEffectors.concat(); this._nowEffectors[0] = this._instrumentBank.getWaveformCache(this.parseIntOf(bytes)); break; default: this._nowEffectors = this._nowEffectors.concat(); this._nowEffectors.push(this._instrumentBank.getEffector(this.parseIntOf(bytes))); break; }; break; case 126: this._nowEffectors = this._nowEffectors.concat(); this._nowEffectors[0] = this._instrumentBank.getWaveformCache(this.parseIntOf(bytes)); break; case 96: this._nowEffectors = this._nowEffectors.concat(); this._nowEffectors.pop(); this.parseIntOf(bytes); break; case 91: intparam = bytes.position; _local11 = 1; while (bytes.bytesAvailable > 0) { switch (bytes[_temp1]){ case 91: _local11++; break; case 93: --_local11; if (_local11 <= 0){ break; }; break; }; }; _local12 = new ByteArray(); bytes.readBytes(_local12, 0, (intparam - bytes.position)); intparam = this.parseIntOf(bytes); if (intparam < 1){ intparam = 2; }; i = 0; while (i < intparam) { this.processBytes(_local12, notes, (i == (intparam - 1))); i++; }; break; case 123: intparam = bytes.position; do { var _temp2 = intparam; intparam = (intparam + 1); } while (((!((bytes[_temp2] == 125))) && ((bytes.bytesAvailable > 0)))); _local13 = new ByteArray(); bytes.readBytes(_local13, 0, (intparam - bytes.position)); _local14 = []; lenparam = this._baseTime; this.processBytes(_local13, _local14, false); this._baseTime = lenparam; lenparam = this.parseNoteLenOf(bytes); if (lenparam == 0){ lenparam = this._defaultLength; }; _local15 = _local14.length; lenparam = ((this._nowMeasureLength * lenparam) / _local15); i = 0; while (i < _local15) { _local10 = _local14[i]; _local10.baseTime = this._baseTime; _local10.length = lenparam; this._baseTime = (this._baseTime + lenparam); notes.push(_local10); i++; }; break; case 124: if (lastloop){ return; }; break; }; }; } public function parseNoteLenOf(bytes:ByteArray):Number{ var byte:int; var len:int = this.parseIntOf(bytes); if (len == 0){ return (0); }; var result:Number = (1 / len); var dresult:Number = (result * 0.5); while (bytes.bytesAvailable > 0) { byte = bytes[bytes.position]; switch (byte){ case 46: result = (result + dresult); dresult = (dresult * 0.5); bytes.position++; break; case 94: bytes.position++; return ((result + this.parseNoteLenOf(bytes))); default: return (result); }; }; return (result); } public function splitTrack():CraptuneMMLChannel{ if (this._baseTime == 0){ return (null); }; var result:CraptuneMMLChannel = this.getResult(); this._result = new CraptuneMMLChannel(this._instrumentBank); this._baseTime = 0; return (result); } public function getResult():CraptuneMMLChannel{ this._result.length = this._baseTime; return (this._result); } public function toString():String{ return ("[CTMMLChFactory]"); } public function readBytes(bytes:ByteArray):void{ var result:CraptuneMMLChannel = this._result; this.processBytes(bytes, this._result.getNotes(), false); } } }//package net.kaikoga.audio.craptune.mml
Section 259
//CraptuneMMLFactory (net.kaikoga.audio.craptune.mml.CraptuneMMLFactory) package net.kaikoga.audio.craptune.mml { import flash.utils.*; import net.kaikoga.audio.craptune.core.*; import net.kaikoga.utils.*; public class CraptuneMMLFactory { private var _instrumentBank:CraptuneInstrumentBank; private var _channels:Object; private var _environment:CraptuneEnvironment; private var _result:CraptuneMML; private var _nowTrackName:String;// = "0" public function CraptuneMMLFactory(env:CraptuneEnvironment){ super(); this._channels = {}; this._environment = env; this._instrumentBank = new CraptuneInstrumentBank(env); } private function readLine(line:String):void{ switch (line.charAt(0)){ case "@": this.readHeaderLine(line.slice(1)); break; case ".": this.readControlLine(line.slice(1)); break; case "#": break; default: this.readBodyLine(line); break; }; } private function readBodyLine(line:String):void{ var ch:CraptuneMMLChannelFactory; var head:String = line.split(" ", 1)[0]; var tail:String = line.substr((head.length + 1)); var c:int = head.length; var bytes:ByteArray = new ByteArray(); bytes.writeUTFBytes(tail); var i:int; while (i < c) { ch = this.getChannel(head.charAt(i)); ch.readBytes(bytes); i++; }; } public function getChannel(chname:String):CraptuneMMLChannelFactory{ var result:CraptuneMMLChannelFactory = this._channels[chname]; if (result == null){ result = new CraptuneMMLChannelFactory(this._instrumentBank); this._channels[chname] = result; }; return (result); } public function toString():String{ return ("[CTMMLFactory]"); } private function readHeaderLine(line:String):void{ var index:int; var ary:Array = line.split("=", 2); if (ary.length < 2){ return; }; var indexstr:String = SS_StringUtil.trim(ary[0]); var param:String = SS_StringUtil.trim(ary[1]); var instbank:CraptuneInstrumentBank = this._instrumentBank; switch (indexstr.charAt(0)){ case "w": index = int(indexstr.slice(1)); instbank.putWaveformCache(index, this._environment.loadWaveform(param, instbank)); break; case "s": index = int(indexstr.slice(1)); instbank.putSamplet(index, this._environment.loadSamplet(param, instbank)); break; case "e": index = int(indexstr.slice(1)); instbank.putEffector(index, this._environment.loadEffector(param, instbank)); break; }; } public function createCraptuneMML(str:String):CraptuneMML{ var ch:CraptuneMMLChannelFactory; this._result = new CraptuneMML(); var track:CraptuneMMLTrack = new CraptuneMMLTrack(this._instrumentBank); var lines:Array = SS_StringUtil.lines(str); var c:int = lines.length; var i:int; while (i < c) { this.readLine(lines[i]); i++; }; for each (ch in this._channels) { track.addChannel(ch.getResult()); }; this._result.addTrack(this._nowTrackName, track); return (this._result); } private function readControlLine(line:String):void{ var ary:Array; var _local5:CraptuneMMLTrack; var _local6:CraptuneParamLine; var _local7:Array; var _local8:Array; var ch:CraptuneMMLChannelFactory; ary = line.split("=", 2); switch (ary.length){ case 1: _local5 = new CraptuneMMLTrack(this._instrumentBank); for each (ch in this._channels) { _local5.addChannel(ch.splitTrack()); }; this._result.addTrack(this._nowTrackName, _local5); this._nowTrackName = ary[0]; break; case 2: _local6 = new CraptuneParamLine(ary[1]); _local7 = (_local6.hasNext()) ? _local6.next().rest() : []; _local8 = (_local6.hasNext()) ? _local6.next().rest() : []; this._result.addSong(ary[0], new CraptuneMMLSong(_local7, _local8)); break; }; } } }//package net.kaikoga.audio.craptune.mml
Section 260
//CraptuneMMLNote (net.kaikoga.audio.craptune.mml.CraptuneMMLNote) package net.kaikoga.audio.craptune.mml { import flash.utils.*; import net.kaikoga.audio.craptune.core.*; import net.kaikoga.audio.craptune.effectors.*; public class CraptuneMMLNote extends ACraptuneMMLCommand { public var pitch:Number; public var nowVelocity:Number; public var nowPhase:Number; public var nowBound:int; public var nowOffset:int; public var length:int; public var nowPitch:Number; public var nowWaveform:CraptuneWaveformCache; public var nowLength:int; public var velocity:Number; public var effectors:Array; public function CraptuneMMLNote(basetime:int, pitch:Number, velocity:Number, length:int, effectors:Array){ super(); this.baseTime = basetime; this.pitch = pitch; this.velocity = velocity; this.length = length; this.effectors = effectors; } override public function processCommand(bytes:ByteArray):void{ var i:int; this.nowPhase = 0; this.nowOffset = 0; this.nowWaveform = null; var c:int = this.effectors.length; this.nowLength = this.length; i = 0; while (i < c) { ICraptuneEffector(this.effectors[i]).initLength(this, bytes); i++; }; if ((this.baseTime + this.nowLength) > bytes.length){ this.nowLength = (this.nowLength - ((this.baseTime + this.nowLength) - bytes.length)); }; while (this.nowOffset < this.nowLength) { this.nowPitch = this.pitch; this.nowVelocity = this.velocity; this.nowBound = this.nowLength; i = 0; while (i < c) { ICraptuneEffector(this.effectors[i]).decorate(this, bytes); i++; }; if (this.nowWaveform != null){ this.nowPhase = this.nowWaveform.addWave(bytes, (this.baseTime + this.nowOffset), (this.baseTime + this.nowBound), this.nowPhase, this.nowPitch, this.nowVelocity); }; this.nowOffset = this.nowBound; }; } public function toString():String{ return ((((("[CTMMLNote @" + this.baseTime) + "..") + this.length) + "]")); } } }//package net.kaikoga.audio.craptune.mml
Section 261
//CraptuneMMLSong (net.kaikoga.audio.craptune.mml.CraptuneMMLSong) package net.kaikoga.audio.craptune.mml { public class CraptuneMMLSong { private var _loop:Array; private var _intro:Array; public function CraptuneMMLSong(intro:Array, loop:Array){ super(); this._intro = intro; this._loop = loop; } public function iterate():CraptuneMMLSongIterator{ return (new CraptuneMMLSongIterator(this._intro, this._loop)); } public function iterateNoLoop():CraptuneMMLSongIterator{ return (new CraptuneMMLSongIterator(this._intro.concat(this._loop), [])); } public static function fromTrackName(trackname:String):CraptuneMMLSong{ return (new CraptuneMMLSong([], [trackname])); } } }//package net.kaikoga.audio.craptune.mml
Section 262
//CraptuneMMLSongIterator (net.kaikoga.audio.craptune.mml.CraptuneMMLSongIterator) package net.kaikoga.audio.craptune.mml { public class CraptuneMMLSongIterator { private var _nowArray:Array; private var _introArray:Array; private var _loopArray:Array; private var _position:int;// = 0 public function CraptuneMMLSongIterator(intro:Array, loop:Array){ super(); this._introArray = intro; this._loopArray = loop; this._nowArray = intro; } public function all():Array{ return (this._introArray.concat(this._loopArray)); } public function next():String{ if (this._position >= this._nowArray.length){ this._nowArray = this._loopArray; this._position = 0; }; return (this._nowArray[this._position++]); } public function willLoop():Boolean{ return ((((this._nowArray == this._loopArray)) && ((this._nowArray.length == 1)))); } } }//package net.kaikoga.audio.craptune.mml
Section 263
//CraptuneMMLTrack (net.kaikoga.audio.craptune.mml.CraptuneMMLTrack) package net.kaikoga.audio.craptune.mml { import net.kaikoga.audio.craptune.core.*; public class CraptuneMMLTrack { private var _instrumentBank:CraptuneInstrumentBank; private var _length:int; private var _channels:Array; public function CraptuneMMLTrack(instbank:CraptuneInstrumentBank){ super(); this._instrumentBank = instbank; this._channels = []; } public function addChannel(ch:CraptuneMMLChannel):void{ if (ch == null){ return; }; this._channels.push(ch); var chlen:int = ch.length; if (chlen > this._length){ this._length = chlen; }; } public function getChannels():Array{ return (this._channels); } public function getInstrumentBank():CraptuneInstrumentBank{ return (this._instrumentBank); } public function toString():String{ return ("[CTMMLTrack]"); } public function getLength():int{ return (this._length); } } }//package net.kaikoga.audio.craptune.mml
Section 264
//BitNoiseSamplet (net.kaikoga.audio.craptune.samplets.BitNoiseSamplet) package net.kaikoga.audio.craptune.samplets { import flash.utils.*; import net.kaikoga.audio.craptune.core.*; public class BitNoiseSamplet implements ICraptuneSamplet, ICraptuneSampletFactory { private var _length:int;// = 1000 private var _bytes:ByteArray; private var _swap:Number;// = 0.5 private var _amp:Number;// = 4 private var _dAmp:Number;// = 0 public function BitNoiseSamplet(length:int, swap:Number, amp:int, amp2:int){ super(); this._length = length; this._swap = (1 / (1 + swap)); this._amp = amp; this._dAmp = ((amp - amp2) / length); } public function createSamplet(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneSamplet{ var param1:int = params.nextNumber(ECraptuneSamplet.DEFAULT_NOISE_LENGTH); var param2:int = params.nextNumber(ECraptuneSamplet.DEFAULT_NOISE_SWAP); var param3:int = params.nextNumber(ECraptuneSamplet.DEFAULT_NOISE_AMP); var param4:int = params.nextNumber(param3); return (new BitNoiseSamplet(param1, param2, param3, param4)); } public function getBytes():ByteArray{ var amp:Number; var damp:Number; var swap:Number; var c:int; var i:int; var result:ByteArray = this._bytes; if (result == null){ result = new ByteArray(); amp = this._amp; damp = this._dAmp; swap = this._swap; c = this._length; i = 0; while (i < c) { if (Math.random() < swap){ amp = -(amp); }; result[i] = amp; if (amp < 0){ amp = (amp + damp); } else { amp = (amp - damp); }; i++; }; this._bytes = result; }; return (result); } public function toString():String{ return ("[CTNoiseSamplet]"); } } }//package net.kaikoga.audio.craptune.samplets
Section 265
//CompositeSamplet (net.kaikoga.audio.craptune.samplets.CompositeSamplet) package net.kaikoga.audio.craptune.samplets { import flash.utils.*; import net.kaikoga.audio.craptune.core.*; import net.kaikoga.utils.*; public class CompositeSamplet implements ICraptuneSamplet, ICraptuneSampletFactory { private var _samplets:Array; private var _bytes:ByteArray; public function CompositeSamplet(samplets:Array){ super(); this._samplets = samplets; } public function getBytes():ByteArray{ var samplets:Array; var c:int; var i:int; var samplet:ICraptuneSamplet; var bytes:ByteArray; var result:ByteArray = this._bytes; if (result == null){ result = new ByteArray(); samplets = this._samplets; c = samplets.length; i = 0; while (i < c) { samplet = samplets[i]; bytes = samplet.getBytes(); SS_ByteArrayUtil.addBytes(result, 0, bytes.length, bytes, 0); i++; }; this._bytes = result; }; return (result); } public function toString():String{ return ("[CTCompositeSamplet]"); } public function createSamplet(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneSamplet{ var parama:Array = []; while (params.hasNext()) { parama.push(instbank.getSamplet(params.nextNumber(0))); }; return (new CompositeSamplet(parama)); } } }//package net.kaikoga.audio.craptune.samplets
Section 266
//CraptuneSampletFactory (net.kaikoga.audio.craptune.samplets.CraptuneSampletFactory) package net.kaikoga.audio.craptune.samplets { import net.kaikoga.audio.craptune.core.*; public class CraptuneSampletFactory implements ICraptuneSampletFactory, ICraptuneSampletBranch { private var _factoryMap:Object; private var _defaultFactory:ICraptuneSampletFactory; public function CraptuneSampletFactory(){ super(); this._defaultFactory = new NoiseSamplet(); this._factoryMap = {}; } public function registerSampletFactory(path:String, factory:ICraptuneSampletFactory):void{ this._factoryMap[path] = factory; } public function toString():String{ return ("[CTSampletFactory]"); } public function loadDefault():void{ this.registerSampletFactory("noise", this._defaultFactory); this.registerSampletFactory("bitnoise", new BitNoiseSamplet(0, 0, 0, 0)); this.registerSampletFactory("composite", new CompositeSamplet([])); } public function createSamplet(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneSamplet{ var factory:ICraptuneSampletFactory = this._factoryMap[params.next()]; if (factory == null){ factory = this._defaultFactory; }; return (factory.createSamplet(params, instbank)); } } }//package net.kaikoga.audio.craptune.samplets
Section 267
//ECraptuneSamplet (net.kaikoga.audio.craptune.samplets.ECraptuneSamplet) package net.kaikoga.audio.craptune.samplets { public class ECraptuneSamplet { static const DEFAULT_NOISE_AMP:Number = 4; static const DEFAULT_NOISE_SWAP:Number = 0.5; static const DEFAULT_NOISE_LENGTH:Number = 1000; public function ECraptuneSamplet(){ super(); } } }//package net.kaikoga.audio.craptune.samplets
Section 268
//ICraptuneSamplet (net.kaikoga.audio.craptune.samplets.ICraptuneSamplet) package net.kaikoga.audio.craptune.samplets { import flash.utils.*; public interface ICraptuneSamplet { function getBytes():ByteArray; } }//package net.kaikoga.audio.craptune.samplets
Section 269
//ICraptuneSampletBranch (net.kaikoga.audio.craptune.samplets.ICraptuneSampletBranch) package net.kaikoga.audio.craptune.samplets { public interface ICraptuneSampletBranch { function registerSampletFactory(_arg1:String, _arg2:ICraptuneSampletFactory):void; } }//package net.kaikoga.audio.craptune.samplets
Section 270
//ICraptuneSampletFactory (net.kaikoga.audio.craptune.samplets.ICraptuneSampletFactory) package net.kaikoga.audio.craptune.samplets { import net.kaikoga.audio.craptune.core.*; public interface ICraptuneSampletFactory { function createSamplet(_arg1:CraptuneParamList, _arg2:CraptuneInstrumentBank):ICraptuneSamplet; } }//package net.kaikoga.audio.craptune.samplets
Section 271
//NoiseSamplet (net.kaikoga.audio.craptune.samplets.NoiseSamplet) package net.kaikoga.audio.craptune.samplets { import flash.utils.*; import net.kaikoga.audio.craptune.core.*; public class NoiseSamplet implements ICraptuneSamplet, ICraptuneSampletFactory { private var _bytes:ByteArray; public function NoiseSamplet(){ super(); } public function getBytes():ByteArray{ var i:int; var result:ByteArray = this._bytes; if (result == null){ result = new ByteArray(); i = 0; while (i < 1000) { result[i] = (((Math.random() * 2) - 1) * 16); i++; }; this._bytes = result; }; return (result); } public function toString():String{ return ("[CTNoiseSamplet]"); } public function createSamplet(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneSamplet{ return (this); } } }//package net.kaikoga.audio.craptune.samplets
Section 272
//CompositeWaveform1 (net.kaikoga.audio.craptune.waveforms.CompositeWaveform1) package net.kaikoga.audio.craptune.waveforms { import flash.utils.*; import net.kaikoga.audio.craptune.core.*; import net.kaikoga.utils.*; public class CompositeWaveform1 implements ICraptuneWaveform, ICraptuneWaveformFactory { private var _waves:Array; public function CompositeWaveform1(waves:Array){ super(); this._waves = waves; } public function createWaveform(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneWaveform{ var parama:Array = []; while (params.hasNext()) { parama.push(instbank.getWaveformCache(params.nextNumber(0))); }; return (new CompositeWaveform1(parama)); } public function toString():String{ return ("[CTCompositeWave1]"); } public function createAlignResample(pitch:int, velocity:int):ByteArray{ var w:CraptuneWaveformCache; var bytes:ByteArray; var result:ByteArray = SS_ByteArrayUtil.newByteArray((pitch + 1), 0); var waves:Array = this._waves; var c:int = waves.length; var i:int; while (i < c) { w = waves[i]; bytes = w.getAlignResample(pitch, velocity); SS_ByteArrayUtil.addBytes(result, 0, (pitch + 1), bytes, 0); i++; }; return (result); } } }//package net.kaikoga.audio.craptune.waveforms
Section 273
//CompositeWaveform2 (net.kaikoga.audio.craptune.waveforms.CompositeWaveform2) package net.kaikoga.audio.craptune.waveforms { import flash.utils.*; import net.kaikoga.audio.craptune.core.*; import net.kaikoga.utils.*; public class CompositeWaveform2 implements ICraptuneWaveform, ICraptuneWaveformFactory { private var _waves:Array; private var _waveVels:Array; public function CompositeWaveform2(waves:Array, wavevels:Array){ super(); this._waves = waves; this._waveVels = wavevels; } public function toString():String{ return ("[CTCompositeWave2]"); } public function createAlignResample(pitch:int, velocity:int):ByteArray{ var w:CraptuneWaveformCache; var bytes:ByteArray; var result:ByteArray = SS_ByteArrayUtil.newByteArray((pitch + 1), 0); var waves:Array = this._waves; var wavevels:Array = this._waveVels; var c:int = waves.length; var i:int; while (i < c) { w = waves[i]; bytes = w.getAlignResample(pitch, (velocity * wavevels[i])); SS_ByteArrayUtil.addBytes(result, 0, (pitch + 1), bytes, 0); i++; }; return (result); } public function createWaveform(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneWaveform{ var parama:Array = []; var paramb:Array = []; while (params.hasNext()) { parama.push(instbank.getWaveformCache(params.nextNumber(0))); paramb.push(params.nextNumber(ECraptuneWaveform.DEFAULT_COMP_VOLUME)); }; return (new CompositeWaveform2(parama, paramb)); } } }//package net.kaikoga.audio.craptune.waveforms
Section 274
//CompositeWaveform3 (net.kaikoga.audio.craptune.waveforms.CompositeWaveform3) package net.kaikoga.audio.craptune.waveforms { import flash.utils.*; import net.kaikoga.audio.craptune.core.*; import net.kaikoga.utils.*; public class CompositeWaveform3 implements ICraptuneWaveform, ICraptuneWaveformFactory { private var _wavePitches:Array; private var _waves:Array; private var _waveVels:Array; public function CompositeWaveform3(waves:Array, wavevels:Array, wavepitches:Array){ super(); this._waves = waves; this._waveVels = wavevels; this._wavePitches = wavevels; } public function toString():String{ return ("[CTCompositeWave3]"); } public function createAlignResample(pitch:int, velocity:int):ByteArray{ var w:CraptuneWaveformCache; var bytes:ByteArray; var result:ByteArray = SS_ByteArrayUtil.newByteArray((pitch + 1), 0); var waves:Array = this._waves; var wavevels:Array = this._waveVels; var wavepitches:Array = this._wavePitches; var c:int = waves.length; var i:int; while (i < c) { w = waves[i]; bytes = w.getAlignResample((pitch * wavepitches[i]), (velocity * wavevels[i])); SS_ByteArrayUtil.addBytes(result, 0, (pitch + 1), bytes, 0); i++; }; return (result); } public function createWaveform(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneWaveform{ var parama:Array = []; var paramb:Array = []; var paramc:Array = []; while (params.hasNext()) { parama.push(instbank.getWaveformCache(params.nextNumber(0))); paramb.push(params.nextNumber(ECraptuneWaveform.DEFAULT_COMP_VOLUME)); paramc.push(params.nextNumber(ECraptuneWaveform.DEFAULT_PITCH)); }; return (new CompositeWaveform3(parama, paramb, paramc)); } } }//package net.kaikoga.audio.craptune.waveforms
Section 275
//CraptuneWaveformFactory (net.kaikoga.audio.craptune.waveforms.CraptuneWaveformFactory) package net.kaikoga.audio.craptune.waveforms { import net.kaikoga.audio.craptune.core.*; public class CraptuneWaveformFactory implements ICraptuneWaveformFactory, ICraptuneWaveformBranch { private var _factoryMap:Object; private var _defaultFactory:ICraptuneWaveformFactory; public function CraptuneWaveformFactory(){ super(); this._defaultFactory = new SquareWaveform(); this._factoryMap = {}; } public function toString():String{ return ("[CTWaveFactory]"); } public function createWaveform(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneWaveform{ var factory:ICraptuneWaveformFactory = this._factoryMap[params.next()]; if (factory == null){ factory = this._defaultFactory; }; return (factory.createWaveform(params, instbank)); } public function registerWaveformFactory(path:String, factory:ICraptuneWaveformFactory):void{ this._factoryMap[path] = factory; } public function loadDefault():void{ this.registerWaveformFactory("square", this._defaultFactory); this.registerWaveformFactory("sine", new SineWaveform()); this.registerWaveformFactory("saw", new SawWaveform()); this.registerWaveformFactory("triangle", new TriangleWaveform()); this.registerWaveformFactory("pulse", new PulseWaveform(0)); this.registerWaveformFactory("impulse", new ImpulseWaveform()); this.registerWaveformFactory("random", new RandomWaveform()); this.registerWaveformFactory("sineadd", new SineAddWaveform([])); this.registerWaveformFactory("pcm", new PCMWaveform([])); this.registerWaveformFactory("fm", new FMWaveform(0, 0)); this.registerWaveformFactory("composite1", new CompositeWaveform1([])); this.registerWaveformFactory("composite2", new CompositeWaveform2([], [])); this.registerWaveformFactory("composite3", new CompositeWaveform3([], [], [])); } } }//package net.kaikoga.audio.craptune.waveforms
Section 276
//ECraptuneWaveform (net.kaikoga.audio.craptune.waveforms.ECraptuneWaveform) package net.kaikoga.audio.craptune.waveforms { public class ECraptuneWaveform { static const DEFAULT_FM_PARAM:Number = 1; static const DEFAULT_PITCH:Number = 1; static const DEFAULT_PULSE_LENGTH:Number = 0.25; static const DEFAULT_COMP_VOLUME:Number = 0; static const DEFAULT_SAMPLE:Number = 0; public function ECraptuneWaveform(){ super(); } } }//package net.kaikoga.audio.craptune.waveforms
Section 277
//FMWaveform (net.kaikoga.audio.craptune.waveforms.FMWaveform) package net.kaikoga.audio.craptune.waveforms { import flash.utils.*; import net.kaikoga.audio.craptune.core.*; public class FMWaveform implements ICraptuneWaveform, ICraptuneWaveformFactory { private var _modVel:Number;// = 0.25 private var _modPitch:Number;// = 1 public function FMWaveform(modpitch:int, modvel:Number){ super(); this._modPitch = modpitch; this._modVel = modvel; } public function createAlignResample(pitch:int, velocity:int):ByteArray{ var result:ByteArray = new ByteArray(); var carph:Number = 0; var dcarph:Number = ((Math.PI * 2) / pitch); var modph:Number = 0; var dmodph:Number = (dcarph * this._modPitch); var modvel:Number = ((pitch / 4) * this._modVel); var i:int; while (i <= pitch) { modph = (modph + dmodph); carph = (carph + (dcarph * (1 + (modvel * Math.sin(modph))))); result[i] = (velocity * Math.sin(carph)); i++; }; return (result); } public function createWaveform(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneWaveform{ var param1:Number = params.nextNumber(ECraptuneWaveform.DEFAULT_FM_PARAM); var param2:Number = params.nextNumber(ECraptuneWaveform.DEFAULT_FM_PARAM); return (new FMWaveform(param1, param2)); } public function toString():String{ return ("[CTFMWave]"); } } }//package net.kaikoga.audio.craptune.waveforms
Section 278
//ICraptuneWaveform (net.kaikoga.audio.craptune.waveforms.ICraptuneWaveform) package net.kaikoga.audio.craptune.waveforms { import flash.utils.*; public interface ICraptuneWaveform { function createAlignResample(_arg1:int, _arg2:int):ByteArray; } }//package net.kaikoga.audio.craptune.waveforms
Section 279
//ICraptuneWaveformBranch (net.kaikoga.audio.craptune.waveforms.ICraptuneWaveformBranch) package net.kaikoga.audio.craptune.waveforms { public interface ICraptuneWaveformBranch { function registerWaveformFactory(_arg1:String, _arg2:ICraptuneWaveformFactory):void; } }//package net.kaikoga.audio.craptune.waveforms
Section 280
//ICraptuneWaveformFactory (net.kaikoga.audio.craptune.waveforms.ICraptuneWaveformFactory) package net.kaikoga.audio.craptune.waveforms { import net.kaikoga.audio.craptune.core.*; public interface ICraptuneWaveformFactory { function createWaveform(_arg1:CraptuneParamList, _arg2:CraptuneInstrumentBank):ICraptuneWaveform; } }//package net.kaikoga.audio.craptune.waveforms
Section 281
//ImpulseWaveform (net.kaikoga.audio.craptune.waveforms.ImpulseWaveform) package net.kaikoga.audio.craptune.waveforms { import flash.utils.*; import net.kaikoga.audio.craptune.core.*; public class ImpulseWaveform implements ICraptuneWaveform, ICraptuneWaveformFactory { public function ImpulseWaveform(){ super(); } public function createWaveform(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneWaveform{ return (this); } public function toString():String{ return ("[CTImpulseWave]"); } public function createAlignResample(pitch:int, velocity:int):ByteArray{ var result:ByteArray = new ByteArray(); result[0] = -(velocity); var i = 1; while (i <= pitch) { result[i] = velocity; i++; }; return (result); } } }//package net.kaikoga.audio.craptune.waveforms
Section 282
//PCMWaveform (net.kaikoga.audio.craptune.waveforms.PCMWaveform) package net.kaikoga.audio.craptune.waveforms { import flash.utils.*; import net.kaikoga.audio.craptune.core.*; public class PCMWaveform implements ICraptuneWaveform, ICraptuneWaveformFactory { private var _pcmSampleCount:int; private var _pcmSamples:Array; public function PCMWaveform(samples:Array){ super(); this._pcmSamples = samples; this._pcmSampleCount = samples.length; samples[this._pcmSampleCount] = samples[0]; } public function createAlignResample(pitch:int, velocity:int):ByteArray{ var result:ByteArray = new ByteArray(); var samples:Array = this._pcmSamples; var sample:Number = 0; var dsample:Number = (this._pcmSampleCount / pitch); var i:int; while (i < pitch) { result[i] = (velocity * samples[int(sample)]); sample = (sample + dsample); i++; }; result[pitch] = (velocity * samples[0]); return (result); } public function createWaveform(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneWaveform{ var parama:Array = []; while (params.hasNext()) { parama.push(params.nextNumber(ECraptuneWaveform.DEFAULT_SAMPLE)); }; return (new PCMWaveform(parama)); } public function toString():String{ return ("[CTPCMWave]"); } } }//package net.kaikoga.audio.craptune.waveforms
Section 283
//PulseWaveform (net.kaikoga.audio.craptune.waveforms.PulseWaveform) package net.kaikoga.audio.craptune.waveforms { import flash.utils.*; import net.kaikoga.audio.craptune.core.*; public class PulseWaveform implements ICraptuneWaveform, ICraptuneWaveformFactory { private var _duty:Number;// = 0.25 public function PulseWaveform(duty:Number){ super(); this._duty = duty; } public function createWaveform(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneWaveform{ var param1:Number = params.nextNumber(ECraptuneWaveform.DEFAULT_PULSE_LENGTH); return (new PulseWaveform(param1)); } public function toString():String{ return ("[CTPulseWave]"); } public function createAlignResample(pitch:int, velocity:int):ByteArray{ var i:int; var result:ByteArray = new ByteArray(); var mid:int = (pitch * this._duty); var negvel:int = -(velocity); i = 0; while (i < mid) { result[i] = negvel; i++; }; while (i <= pitch) { result[i] = velocity; i++; }; return (result); } } }//package net.kaikoga.audio.craptune.waveforms
Section 284
//RandomWaveform (net.kaikoga.audio.craptune.waveforms.RandomWaveform) package net.kaikoga.audio.craptune.waveforms { import flash.utils.*; import net.kaikoga.audio.craptune.core.*; public class RandomWaveform implements ICraptuneWaveform, ICraptuneWaveformFactory { public function RandomWaveform(){ super(); } public function createWaveform(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneWaveform{ return (this); } public function toString():String{ return ("[CTRandomWave]"); } public function createAlignResample(pitch:int, velocity:int):ByteArray{ var result:ByteArray = new ByteArray(); var i:int; while (i < pitch) { result[i] = (velocity * ((Math.random() * 2) - 1)); i++; }; result[pitch] = result[0]; return (result); } } }//package net.kaikoga.audio.craptune.waveforms
Section 285
//SawWaveform (net.kaikoga.audio.craptune.waveforms.SawWaveform) package net.kaikoga.audio.craptune.waveforms { import flash.utils.*; import net.kaikoga.audio.craptune.core.*; public class SawWaveform implements ICraptuneWaveform, ICraptuneWaveformFactory { public function SawWaveform(){ super(); } public function createWaveform(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneWaveform{ return (this); } public function toString():String{ return ("[CTSawWave]"); } public function createAlignResample(pitch:int, velocity:int):ByteArray{ var result:ByteArray = new ByteArray(); var ampl:int = ((velocity << 1) + 1); var i:int; while (i <= pitch) { result[i] = (((ampl * i) / pitch) - velocity); i++; }; return (result); } } }//package net.kaikoga.audio.craptune.waveforms
Section 286
//SineAddWaveform (net.kaikoga.audio.craptune.waveforms.SineAddWaveform) package net.kaikoga.audio.craptune.waveforms { import flash.utils.*; import net.kaikoga.audio.craptune.core.*; public class SineAddWaveform implements ICraptuneWaveform, ICraptuneWaveformFactory { private var _volumes:Array; public function SineAddWaveform(vols:Array){ super(); this._volumes = vols; } public function createWaveform(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneWaveform{ var parama:Array = []; while (params.hasNext()) { parama.push(params.nextNumber(ECraptuneWaveform.DEFAULT_COMP_VOLUME)); }; return (new SineAddWaveform(parama)); } public function toString():String{ return ("[CTSineAddWave]"); } public function createAlignResample(pitch:int, velocity:int):ByteArray{ var sample:Number; var dph:Number; var ph:Number; var o:int; var vol:Number; var result:ByteArray = new ByteArray(); var phase:Number = 0; var dphase:Number = ((Math.PI * 2) / pitch); var vols:Array = this._volumes; var oc:int = vols.length; var i:int; while (i <= pitch) { sample = 0; dph = (i * dphase); ph = dph; o = 0; while (o < oc) { var _temp1 = o; o = (o + 1); vol = vols[_temp1]; sample = (sample + (vol * Math.sin(ph))); ph = (ph + dph); o++; }; result[i] = (velocity * sample); phase = (phase + dphase); i++; }; return (result); } } }//package net.kaikoga.audio.craptune.waveforms
Section 287
//SineWaveform (net.kaikoga.audio.craptune.waveforms.SineWaveform) package net.kaikoga.audio.craptune.waveforms { import flash.utils.*; import net.kaikoga.audio.craptune.core.*; public class SineWaveform implements ICraptuneWaveform, ICraptuneWaveformFactory { public function SineWaveform(){ super(); } public function createWaveform(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneWaveform{ return (this); } public function toString():String{ return ("[CTSineWave]"); } public function createAlignResample(pitch:int, velocity:int):ByteArray{ var result:ByteArray = new ByteArray(); var i:int; while (i <= pitch) { result[i] = (velocity * Math.sin((((i / pitch) * Math.PI) * 2))); i++; }; return (result); } } }//package net.kaikoga.audio.craptune.waveforms
Section 288
//SquareWaveform (net.kaikoga.audio.craptune.waveforms.SquareWaveform) package net.kaikoga.audio.craptune.waveforms { import flash.utils.*; import net.kaikoga.audio.craptune.core.*; public class SquareWaveform implements ICraptuneWaveform, ICraptuneWaveformFactory { public function SquareWaveform(){ super(); } public function createWaveform(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneWaveform{ return (this); } public function toString():String{ return ("[CTSquareWave]"); } public function createAlignResample(pitch:int, velocity:int):ByteArray{ var i:int; var result:ByteArray = new ByteArray(); var mid:int = (pitch / 2); var negvel:int = -(velocity); i = 0; while (i < mid) { result[i] = negvel; i++; }; while (i <= pitch) { result[i] = velocity; i++; }; return (result); } } }//package net.kaikoga.audio.craptune.waveforms
Section 289
//TriangleWaveform (net.kaikoga.audio.craptune.waveforms.TriangleWaveform) package net.kaikoga.audio.craptune.waveforms { import flash.utils.*; import net.kaikoga.audio.craptune.core.*; public class TriangleWaveform implements ICraptuneWaveform, ICraptuneWaveformFactory { public function TriangleWaveform(){ super(); } public function createWaveform(params:CraptuneParamList, instbank:CraptuneInstrumentBank):ICraptuneWaveform{ return (this); } public function toString():String{ return ("[CTTriangleWave]"); } public function createAlignResample(pitch:int, velocity:int):ByteArray{ var result:ByteArray = new ByteArray(); var ampl:int = ((velocity << 1) + 1); var i:int; while (i <= pitch) { result[i] = ((ampl * Math.abs((((i / pitch) * 2) - 1))) - velocity); i++; }; return (result); } } }//package net.kaikoga.audio.craptune.waveforms
Section 290
//ACraptune (net.kaikoga.audio.craptune.ACraptune) package net.kaikoga.audio.craptune { import flash.media.*; import flash.events.*; import net.kaikoga.audio.craptune.mml.*; import net.kaikoga.audio.craptune.core.*; import net.kaikoga.audio.output.*; public class ACraptune { private var _playPending:Boolean;// = false private var _loopFactory:RawLoopFactory; private var _loadQueue:Array; private var _soundCache:Object; private var _nowSong:CraptuneMMLSongIterator; private var _environment:CraptuneEnvironment; private var _nowChannel:SoundChannel;// = null private var _nowLoadTrack:String; private var _nowTrack:String; private var _nowMML:CraptuneMML; public function ACraptune(mml:String=null){ this._environment = new CraptuneEnvironment(); super(); if (mml != null){ this.loadStartMML(mml, "0"); }; } public function stop():void{ this._nowSong = null; this._nowTrack = null; this._playPending = false; if (this._nowChannel != null){ this._nowChannel.stop(); this._loopFactory = null; }; } public function loadMML(mml:String):void{ this.stop(); if (this._loopFactory){ this._loopFactory.abort(); }; this._loopFactory = null; this._nowLoadTrack = null; this._soundCache = {}; this._nowMML = new CraptuneMMLFactory(this._environment).createCraptuneMML(mml); } private function onSoundComplete(event:Event):void{ this._nowTrack = null; this.tryPlayNext(); } private function onSoundLoadComplete(snd:Sound):void{ this._soundCache[this._nowLoadTrack] = snd; this._nowLoadTrack = null; if (this._playPending){ this._playPending = false; this.tryPlayNext(); }; this.tryLoadNext(false); } public function loadStartMML(mml:String, name:String="0", noloop:Boolean=false):void{ this.loadMML(mml); this.startTrack(name, noloop); } private function tryLoadNext(playpending:Boolean):void{ this._playPending = playpending; if (this._nowLoadTrack != null){ return; }; while (true) { this._nowLoadTrack = this._loadQueue.shift(); if (this._nowLoadTrack == null){ return; }; if (this._soundCache[this._nowLoadTrack] === undefined){ break; }; }; this._loopFactory = new RawLoopFactory(); this._loopFactory.fromRawLoopProcessor(new CraptuneProcessor(this._nowMML.getTrack(this._nowLoadTrack)), this.onSoundLoadComplete); } public function startTrack(name:String="0", noloop:Boolean=false):void{ var song:CraptuneMMLSong = this._nowMML.getSong(name); if (song == null){ return; }; this._nowSong = (noloop) ? song.iterateNoLoop() : song.iterate(); this._nowTrack = null; this._loadQueue = this._nowSong.all(); this.tryPlayNext(); } private function tryPlayNext():void{ var snd:Sound; if (this._nowSong == null){ return; }; if (this._nowTrack == null){ this._nowTrack = this._nowSong.next(); }; if (this._nowTrack == null){ return; }; if (this._soundCache[this._nowTrack] === undefined){ this.tryLoadNext(true); return; }; snd = this._soundCache[this._nowTrack]; if (this._nowSong.willLoop()){ if (this._nowChannel != null){ this._nowChannel.stop(); }; this._nowChannel = snd.play(0, 2147483647); } else { if (this._nowChannel != null){ this._nowChannel.stop(); }; this._nowChannel = snd.play(0, 1); if (this._nowChannel != null){ this._nowChannel.addEventListener(Event.SOUND_COMPLETE, this.onSoundComplete); }; }; } public function getProceeding():Number{ return (((this._loopFactory)==null) ? -1 : this._loopFactory.getProceeding()); } } }//package net.kaikoga.audio.craptune
Section 291
//Craptune (net.kaikoga.audio.craptune.Craptune) package net.kaikoga.audio.craptune { import nu.mine.flashnet.sound.core.*; import net.kaikoga.audio.output.*; public class Craptune extends ACraptune { public function Craptune(mml:String=null){ RawLoopFactory.soundPublisher = new SS_SoundPublisher(); super(mml); } } }//package net.kaikoga.audio.craptune
Section 292
//CraptuneProcessor (net.kaikoga.audio.craptune.CraptuneProcessor) package net.kaikoga.audio.craptune { import flash.utils.*; import net.kaikoga.audio.processor.*; import net.kaikoga.audio.craptune.mml.*; import net.kaikoga.audio.craptune.core.*; import net.kaikoga.audio.*; public class CraptuneProcessor implements IRawLoopProcessor { private var _length:int; private var _track:CraptuneMMLTrack; private var _channels:Array; public function CraptuneProcessor(track:CraptuneMMLTrack){ super(); this._channels = []; if (track == null){ return; }; this._track = track; var trackchs:Array = track.getChannels(); var c:int = trackchs.length; var i:int; while (i < c) { this._channels.push(new CraptuneChannel(trackchs[i])); i++; }; this._length = track.getLength(); } public function getChannels():uint{ return (RawSoundBuffer.CHANNELS_MONO); } public function reset():void{ var ch:CraptuneChannel; var c:int = this._channels.length; var i:int; while (i < c) { ch = this._channels[i]; ch.reset(); i++; }; } public function getLoopSamples():int{ return (this._length); } public function processRawBytes(bytes:ByteArray, start:int, end:int):void{ var ch:CraptuneChannel; var c:int = this._channels.length; var i:int; while (i < c) { ch = this._channels[i]; ch.processRawBytes(bytes, start, end); i++; }; } public function getBytes():int{ return (this._length); } public function getBits():uint{ return (RawSoundBuffer.SAMPLE_INT8); } public function getRate():uint{ return (RawSoundBuffer.RATE_44100); } } }//package net.kaikoga.audio.craptune
Section 293
//UICraptune (net.kaikoga.audio.craptune.UICraptune) package net.kaikoga.audio.craptune { import mx.core.*; import mx.events.*; import nu.mine.flashnet.sound.core.*; import net.kaikoga.audio.output.*; public class UICraptune extends UIComponent { private var _1097519099loaded:Boolean;// = false private var _craptune:Craptune; public function UICraptune(){ super(); RawLoopFactory.soundPublisher = new SS_SoundPublisher(); this._craptune = new Craptune(); } public function set loaded(value:Boolean):void{ var oldValue:Object = this._1097519099loaded; if (oldValue !== value){ this._1097519099loaded = value; this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "loaded", oldValue, value)); }; } public function get loaded():Boolean{ return (this._1097519099loaded); } public function loadMML(mml:String):void{ this._craptune.loadMML(mml.split("\r").join("\n")); this.loaded = true; } public function startTrack(track:String="0", noloop:Boolean=false):void{ this._craptune.startTrack(track, noloop); } public function stopMML():void{ this._craptune.stop(); } public function loadStartMML(mml:String, track:String="0", noloop:Boolean=false):void{ this.loadMML(mml); this.startTrack(track, noloop); } public function get bytesLoaded():Number{ return ((this._craptune.getProceeding() * 9999)); } public function get bytesTotal():Number{ return (10000); } } }//package net.kaikoga.audio.craptune
Section 294
//DummySoundPublisher (net.kaikoga.audio.output.DummySoundPublisher) package net.kaikoga.audio.output { import flash.utils.*; public class DummySoundPublisher implements ISoundPublisher { public function DummySoundPublisher(){ super(); } public function byteArrayToSound(bytes:ByteArray, channels:int, bits:int, rate:int, oncomplete:Function):void{ oncomplete(null); } } }//package net.kaikoga.audio.output
Section 295
//ISoundPublisher (net.kaikoga.audio.output.ISoundPublisher) package net.kaikoga.audio.output { import flash.utils.*; public interface ISoundPublisher { function byteArrayToSound(_arg1:ByteArray, _arg2:int, _arg3:int, _arg4:int, _arg5:Function):void; } }//package net.kaikoga.audio.output
Section 296
//RawLoopFactory (net.kaikoga.audio.output.RawLoopFactory) package net.kaikoga.audio.output { import flash.events.*; import flash.utils.*; import net.kaikoga.audio.processor.*; import net.kaikoga.utils.*; public class RawLoopFactory { private var _bits:uint; private var _position:int; private var _bytes:ByteArray; private var _channels:uint; private var _processor:IRawLoopProcessor; private var _length:int; private var _timer:Timer; private var _onComplete:Function; private var _rate:uint; private static var _minTimerPeriod:int = 30; private static var _unitLength:int = 327680; public static var soundPublisher:ISoundPublisher = new DummySoundPublisher(); public function RawLoopFactory(){ super(); this._timer = new Timer(1, 0); this._timer.addEventListener(TimerEvent.TIMER, this.onTimer); } public function getRemainIterations():int{ return (((this._length - this._position) / _unitLength)); } public function onTimer(evt:TimerEvent):void{ var time:int = getTimer(); var end:int = (this._position + _unitLength); if (end > this._length){ end = this._length; }; this._processor.processRawBytes(this._bytes, this._position, end); this._position = end; if (end >= this._length){ this._timer.stop(); soundPublisher.byteArrayToSound(this._bytes, this._channels, this._bits, this._rate, this._onComplete); } else { time = (getTimer() - time); if (time < _minTimerPeriod){ _unitLength = (_unitLength << 1); } else { if (time > (_minTimerPeriod * 3)){ _unitLength = (_unitLength >> 1); }; }; if (_unitLength == 0){ _unitLength = 1; }; }; } public function abort():void{ this._timer.stop(); this._onComplete = null; this._processor = null; this._bytes = null; } public function getProceeding():Number{ return ((this._position / this._length)); } public function fromRawLoopProcessor(processor:IRawLoopProcessor, onComplete:Function):void{ if (this._length == 0){ this._processor = processor; this._channels = processor.getChannels(); this._bits = processor.getBits(); this._rate = processor.getRate(); this._onComplete = onComplete; this._length = this._processor.getBytes(); this._bytes = SS_ByteArrayUtil.newByteArray(this._length, 128); this._bytes.endian = Endian.LITTLE_ENDIAN; this._timer.start(); } else { throw (new Error("RawLoopFactory is busy")); }; } } }//package net.kaikoga.audio.output
Section 297
//IRawLoopProcessor (net.kaikoga.audio.processor.IRawLoopProcessor) package net.kaikoga.audio.processor { public interface IRawLoopProcessor extends IRawProcessor { function getBytes():int; } }//package net.kaikoga.audio.processor
Section 298
//IRawProcessor (net.kaikoga.audio.processor.IRawProcessor) package net.kaikoga.audio.processor { import flash.utils.*; public interface IRawProcessor { function processRawBytes(_arg1:ByteArray, _arg2:int, _arg3:int):void; function getRate():uint; function getBits():uint; function getChannels():uint; function reset():void; } }//package net.kaikoga.audio.processor
Section 299
//RawSoundBuffer (net.kaikoga.audio.RawSoundBuffer) package net.kaikoga.audio { import flash.utils.*; public class RawSoundBuffer { public var channels:int; public var samples:int; public var bytes:ByteArray; public var rate:int; public static var CHANNELS_STEREO:int = 2; public static var RATE_22050:int = 22050; public static var RATE_ANY:int = -1; public static var CHANNELS_MONO:int = 1; public static var RATE_11025:int = 11025; public static var SAMPLE_ANY:int = -1; public static var RATE_44100:int = 44100; public static var CHANNELS_ANY:int = -1; public static var SAMPLE_INT8:int = 8; public static var SAMPLE_INT16:int = 16; public function RawSoundBuffer(channels:int, samples:int, rate:int){ super(); this.bytes = new ByteArray(); this.channels = channels; this.samples = samples; this.rate = rate; } } }//package net.kaikoga.audio
Section 300
//SS_ByteArrayUtil (net.kaikoga.utils.SS_ByteArrayUtil) package net.kaikoga.utils { import flash.utils.*; public class SS_ByteArrayUtil { public function SS_ByteArrayUtil(){ super(); } public static function newByteArray(length:int, zero:int):ByteArray{ var result:ByteArray = new ByteArray(); result.length = length; var i:int; while (i < length) { result[i] = zero; i++; }; return (result); } public static function addBytes(tobytes:ByteArray, tooffset:int, length:int, frombytes:ByteArray, fromoffset:int=0):void{ var toend:int = (tooffset + length); while (tooffset < toend) { var _temp1 = tooffset; tooffset = (tooffset + 1); var _local7 = _temp1; var _temp2 = fromoffset; fromoffset = (fromoffset + 1); tobytes[_local7] = (tobytes[_local7] + frombytes[_temp2]); }; } public static function printBytes(bytes:ByteArray, start:int, end:int):String{ var result:String; if (end > bytes.length){ end = bytes.length; }; if (end <= start){ return (""); }; result = String(bytes[start]); var i:int = (start + 1); while (i < end) { result = (result + ("," + String(bytes[i]))); i++; }; return (result); } } }//package net.kaikoga.utils
Section 301
//SS_StringUtil (net.kaikoga.utils.SS_StringUtil) package net.kaikoga.utils { public class SS_StringUtil { public function SS_StringUtil(){ super(); } public static function lalign(str:String, field:int):String{ var c:int = (field - str.length); var result:String = str; var i:int; while (i < c) { result = (result + " "); i++; }; return (result); } public static function trim(str:String):String{ return (str.replace(/^[ \t]+|[ \t]+$/g, "")); } public static function ralign(str:String, field:int):String{ var c:int = (field - str.length); var result:String = ""; var i:int; while (i < c) { result = (result + " "); i++; }; return ((result + str)); } public static function trimAll(str:String):String{ return (str.replace(/^[\x00-\x20]+|[\x00-\x20]+$/g, "")); } public static function trimRow(str:String):String{ return (str.replace(/^[\x0a\x0d]+|[\x0a\x0d]+$/g, "")); } public static function lines(str:String):Array{ return (str.split(/\x0d\x0a|\x0d|\x0a/g)); } } }//package net.kaikoga.utils
Section 302
//PCMSoundFormat (nu.mine.flashnet.sound.core.PCMSoundFormat) package nu.mine.flashnet.sound.core { public class PCMSoundFormat { public var sampleSizeBits:int; public var channels:int; public var sampleRateIndex:Number; public var sampleRate:Number; public var sampleSize:int; public function PCMSoundFormat(sampleRate:Number, sampleSizeBits:int, channels:int){ super(); switch (sampleRate){ case 44100: sampleRateIndex = 3; break; case 22050: sampleRateIndex = 2; break; case 11025: sampleRateIndex = 1; break; case 5512.5: sampleRateIndex = 0; break; default: throw (new Error("bad sample rate")); }; if (!(((sampleSizeBits == 8)) || ((sampleSizeBits == 16)))){ throw (new Error("bad sampleSize. 8 or 16")); }; if (!(((channels == 1)) || ((channels == 2)))){ throw (new Error("num of channels should be 1 or 2")); }; this.channels = channels; this.sampleSize = (sampleSizeBits / 8); this.sampleRate = sampleRate; this.sampleSizeBits = sampleSizeBits; } } }//package nu.mine.flashnet.sound.core
Section 303
//SoundClassSwfByteCode (nu.mine.flashnet.sound.core.SoundClassSwfByteCode) package nu.mine.flashnet.sound.core { final class SoundClassSwfByteCode { static const soundClassSwfBytes2:Array = [120, 0, 5, 95, 0, 0, 15, 160, 0, 0, 12, 1, 0, 68, 17, 8, 0, 0, 0, 67, 2, 0xFF, 0xFF, 0xFF, 191, 21, 11, 0, 0, 0, 1, 0, 83, 99, 101, 110, 101, 32, 49, 0, 0, 191, 20, 200, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 46, 0, 0, 0, 0, 8, 10, 83, 111, 117, 110, 100, 67, 108, 97, 115, 115, 0, 11, 102, 108, 97, 115, 104, 46, 109, 101, 100, 105, 97, 5, 83, 111, 117, 110, 100, 6, 79, 98, 106, 101, 99, 116, 15, 69, 118, 101, 110, 116, 68, 105, 115, 112, 97, 116, 99, 104, 101, 114, 12, 102, 108, 97, 115, 104, 46, 101, 118, 101, 110, 116, 115, 6, 5, 1, 22, 2, 22, 3, 24, 1, 22, 7, 0, 5, 7, 2, 1, 7, 3, 4, 7, 2, 5, 7, 5, 6, 3, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 1, 1, 2, 8, 4, 0, 1, 0, 0, 0, 1, 2, 1, 1, 4, 1, 0, 3, 0, 1, 1, 5, 6, 3, 208, 48, 71, 0, 0, 1, 1, 1, 6, 7, 6, 208, 48, 208, 73, 0, 71, 0, 0, 2, 2, 1, 1, 5, 31, 208, 48, 101, 0, 93, 3, 102, 3, 48, 93, 4, 102, 4, 48, 93, 2, 102, 2, 48, 93, 2, 102, 2, 88, 0, 29, 29, 29, 104, 1, 71, 0, 0, 191, 3]; static const soundClassSwfBytes3:Array = [63, 19, 15, 0, 0, 0, 1, 0, 1, 0, 83, 111, 117, 110, 100, 67, 108, 97, 115, 115, 0, 68, 11, 15, 0, 0, 0, 64, 0, 0, 0]; static const soundClassSwfBytes1:Array = [70, 87, 83, 9]; function SoundClassSwfByteCode(){ super(); } } }//package nu.mine.flashnet.sound.core
Section 304
//SoundEvent (nu.mine.flashnet.sound.core.SoundEvent) package nu.mine.flashnet.sound.core { import flash.media.*; import flash.events.*; class SoundEvent extends Event { var sound:Sound; static const SOUND_OBJECT_CREATED:String = "soundObjectCreated"; function SoundEvent(type:String, sound:Sound, bubbles:Boolean=false, cancelable:Boolean=false){ this.sound = sound; super(type, bubbles, cancelable); } } }//package nu.mine.flashnet.sound.core
Section 305
//SoundFactory (nu.mine.flashnet.sound.core.SoundFactory) package nu.mine.flashnet.sound.core { import flash.display.*; import flash.media.*; import flash.events.*; import flash.utils.*; import nu.mine.flashnet.sound.core.*; class SoundFactory extends EventDispatcher { private var silenceSwf:ByteArray; private var bufferStart:Number; private var audioSwf:ByteArray; private var soundFormat:PCMSoundFormat; private var loader:Loader; private var busy:Boolean; function SoundFactory(soundFormat:PCMSoundFormat){ super(); this.busy = false; this.soundFormat = soundFormat; loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfCreated, false, 0, true); } public function setBufferSize(bufferSize:Number):void{ audioSwf = buildBufferSwf(bufferSize); } private function getSwfByteArray(audioData:ByteArray):ByteArray{ var numSamples:int = (audioData.length / (soundFormat.channels * soundFormat.sampleSize)); var swfData:ByteArray = new ByteArray(); swfData.endian = Endian.LITTLE_ENDIAN; writeBytes(SoundClassSwfByteCode.soundClassSwfBytes1, swfData); swfData.writeUnsignedInt((299 + ((numSamples * soundFormat.sampleSize) * soundFormat.channels))); writeBytes(SoundClassSwfByteCode.soundClassSwfBytes2, swfData); swfData.writeUnsignedInt((((numSamples * soundFormat.channels) * soundFormat.sampleSize) + 7)); swfData.writeByte(1); swfData.writeByte(0); var formatByte = 48; formatByte = (formatByte + (((soundFormat.sampleRateIndex << 2) + ((soundFormat.sampleSize - 1) << 1)) + (soundFormat.channels - 1))); swfData.writeByte(formatByte); swfData.writeUnsignedInt(numSamples); swfData.writeBytes(audioData); writeBytes(SoundClassSwfByteCode.soundClassSwfBytes3, swfData); return (swfData); } function createSoundObject(audioData:ByteArray):Boolean{ if (busy){ throw (new Error("busy")); }; busy = true; audioSwf.position = bufferStart; audioSwf.writeBytes(audioData); loader.loadBytes(audioSwf); return (true); } private function writeBytes(src:Array, dest:ByteArray):void{ var i:int; while (i < src.length) { dest.writeByte(src[i]); i++; }; } private function buildBufferSwf(numSamples:Number):ByteArray{ var swfData:ByteArray = new ByteArray(); swfData.endian = Endian.LITTLE_ENDIAN; writeBytes(SoundClassSwfByteCode.soundClassSwfBytes1, swfData); swfData.writeUnsignedInt((299 + ((numSamples * soundFormat.sampleSize) * soundFormat.channels))); writeBytes(SoundClassSwfByteCode.soundClassSwfBytes2, swfData); swfData.writeUnsignedInt((((numSamples * soundFormat.channels) * soundFormat.sampleSize) + 7)); swfData.writeByte(1); swfData.writeByte(0); var formatByte = 48; formatByte = (formatByte + (((soundFormat.sampleRateIndex << 2) + ((soundFormat.sampleSize - 1) << 1)) + (soundFormat.channels - 1))); swfData.writeByte(formatByte); swfData.writeUnsignedInt(numSamples); bufferStart = swfData.position; var i:Number = 0; while (i < ((numSamples * soundFormat.sampleSize) * soundFormat.channels)) { swfData.writeByte(0); i++; }; writeBytes(SoundClassSwfByteCode.soundClassSwfBytes3, swfData); return (swfData); } private function swfCreated(event:Event):void{ busy = false; var soundClass:Class = Class(loader.contentLoaderInfo.applicationDomain.getDefinition("SoundClass")); var sound:Sound = new (soundClass); event = new SoundEvent(SoundEvent.SOUND_OBJECT_CREATED, sound); dispatchEvent(event); } function createSilentSoundObject(samples:int):void{ var ba:ByteArray = new ByteArray(); var numOfBytes:int = ((samples * soundFormat.channels) * soundFormat.sampleSize); var val:int = ((soundFormat.sampleSize)==1) ? 128 : 0; var i:int; while (i < numOfBytes) { ba.writeByte(val); i++; }; silenceSwf = getSwfByteArray(ba); loader.loadBytes(silenceSwf); } } }//package nu.mine.flashnet.sound.core
Section 306
//SS_SoundPublisher (nu.mine.flashnet.sound.core.SS_SoundPublisher) package nu.mine.flashnet.sound.core { import flash.utils.*; import net.kaikoga.audio.output.*; public class SS_SoundPublisher implements ISoundPublisher { public function SS_SoundPublisher(){ super(); } public function byteArrayToSound(bytes:ByteArray, channels:int, bits:int, rate:int, oncomplete:Function):void{ var bytes = bytes; var channels = channels; var bits = bits; var rate = rate; var oncomplete = oncomplete; var soundfactory:SoundFactory = new SoundFactory(new PCMSoundFormat(rate, bits, channels)); soundfactory.setBufferSize(((bytes.length / bits) * 8)); soundfactory.addEventListener(SoundEvent.SOUND_OBJECT_CREATED, function (event:SoundEvent):void{ oncomplete(event.sound); }); soundfactory.createSoundObject(bytes); } } }//package nu.mine.flashnet.sound.core
Section 307
//_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 308
//_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 309
//_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 310
//_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 311
//_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 312
//_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 313
//_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 314
//_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 315
//_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_1988544867:Class = _CursorManagerStyle__embed_css_Assets_swf_mx_skins_cursor_BusyCursor_1988544867; 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_1988544867; }; }; } } }//package
Section 316
//_CursorManagerStyle__embed_css_Assets_swf_mx_skins_cursor_BusyCursor_1988544867 (_CursorManagerStyle__embed_css_Assets_swf_mx_skins_cursor_BusyCursor_1988544867) package { import mx.core.*; public class _CursorManagerStyle__embed_css_Assets_swf_mx_skins_cursor_BusyCursor_1988544867 extends SpriteAsset { } }//package
Section 317
//_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 318
//_dateFieldPopupStyle (_dateFieldPopupStyle) package { import mx.core.*; import mx.styles.*; public class _dateFieldPopupStyle { public static function init(_dateFieldPopupStyle.as$23:IFlexModuleFactory):void{ var fbs = _dateFieldPopupStyle.as$23; 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 319
//_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 320
//_FxCraptunePlayer_FlexInit (_FxCraptunePlayer_FlexInit) package { import mx.core.*; import mx.styles.*; import mx.effects.*; import mx.accessibility.*; import flash.system.*; public class _FxCraptunePlayer_FlexInit { public static function init(focusIn:IFlexModuleFactory):void{ var _local4 = EffectManager; _local4.mx_internal::registerEffectTrigger("addedEffect", "added"); _local4 = EffectManager; _local4.mx_internal::registerEffectTrigger("completeEffect", "complete"); _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"); if (Capabilities.hasAccessibility){ UIComponentAccImpl.enableAccessibility(); ButtonAccImpl.enableAccessibility(); PanelAccImpl.enableAccessibility(); }; 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", "labelWidth", "errorColor", "headerColors", "fontSharpness", "textDecoration"]; var _local3:int; while (_local3 < _local2.length) { StyleManager.registerInheritingStyle(_local2[_local3]); _local3++; }; } } }//package
Section 321
//_FxCraptunePlayer_mx_managers_SystemManager (_FxCraptunePlayer_mx_managers_SystemManager) package { import mx.core.*; import mx.managers.*; import flash.system.*; public class _FxCraptunePlayer_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)) ? "FxCraptunePlayer" : 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; }; return (_local4); } override public function info():Object{ return ({compiledLocales:["en_US"], compiledResourceBundleNames:["containers", "controls", "core", "effects", "skins", "styles"], currentDomain:ApplicationDomain.currentDomain, layout:"absolute", mainClassName:"FxCraptunePlayer", mixins:["_FxCraptunePlayer_FlexInit", "_alertButtonStyleStyle", "_ControlBarStyle", "_ScrollBarStyle", "_activeTabStyleStyle", "_textAreaHScrollBarStyleStyle", "_ToolTipStyle", "_TextAreaStyle", "_comboDropdownStyle", "_ProgressBarStyle", "_textAreaVScrollBarStyleStyle", "_ContainerStyle", "_linkButtonStyleStyle", "_globalStyle", "_windowStatusStyle", "_windowStylesStyle", "_PanelStyle", "_activeButtonStyleStyle", "_errorTipStyle", "_richTextEditorTextAreaStyleStyle", "_CursorManagerStyle", "_todayStyleStyle", "_TextInputStyle", "_dateFieldPopupStyle", "_plainStyle", "_dataGridStylesStyle", "_ApplicationStyle", "_headerDateTextStyle", "_ButtonStyle", "_popUpMenuStyle", "_swatchPanelTextFieldStyle", "_opaquePanelStyle", "_weekDayStyleStyle", "_headerDragProxyStyleStyle", "_FxCraptunePlayerWatcherSetupUtil"]}); } } }//package
Section 322
//_FxCraptunePlayerWatcherSetupUtil (_FxCraptunePlayerWatcherSetupUtil) package { import flash.display.*; import mx.core.*; import mx.binding.*; public class _FxCraptunePlayerWatcherSetupUtil extends Sprite implements IWatcherSetupUtil { public function setup(FxCraptunePlayer:Object, FxCraptunePlayer:Function, FxCraptunePlayer:Array, FxCraptunePlayer:Array):void{ FxCraptunePlayer[0] = new PropertyWatcher("craptune", {propertyChange:true}, [FxCraptunePlayer[1], FxCraptunePlayer[0]], FxCraptunePlayer); FxCraptunePlayer[1] = new PropertyWatcher("loaded", {propertyChange:true}, [FxCraptunePlayer[1], FxCraptunePlayer[0]], null); FxCraptunePlayer[0].updateParent(FxCraptunePlayer); FxCraptunePlayer[0].addChild(FxCraptunePlayer[1]); } public static function init(FxCraptunePlayer:IFlexModuleFactory):void{ FxCraptunePlayer.watcherSetupUtil = new (_FxCraptunePlayerWatcherSetupUtil); } } }//package
Section 323
//_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 324
//_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 325
//_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 326
//_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 327
//_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 328
//_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 329
//_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 330
//_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 331
//_ProgressBarStyle (_ProgressBarStyle) package { import mx.core.*; import mx.styles.*; import mx.skins.halo.*; public class _ProgressBarStyle { public static function init(ProgressTrackSkin:IFlexModuleFactory):void{ var fbs = ProgressTrackSkin; var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("ProgressBar"); if (!style){ style = new CSSStyleDeclaration(); StyleManager.setStyleDeclaration("ProgressBar", style, false); }; if (style.defaultFactory == null){ style.defaultFactory = function ():void{ this.trackColors = [0xE7E7E7, 0xFFFFFF]; this.fontWeight = "bold"; this.maskSkin = ProgressMaskSkin; this.leading = 0; this.trackSkin = ProgressTrackSkin; this.indeterminateMoveInterval = 28; this.barSkin = ProgressBarSkin; this.indeterminateSkin = ProgressIndeterminateSkin; }; }; } } }//package
Section 332
//_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 333
//_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 334
//_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 335
//_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 336
//_TextAreaStyle (_TextAreaStyle) package { import mx.core.*; import mx.styles.*; public class _TextAreaStyle { 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("TextArea"); if (!style){ style = new CSSStyleDeclaration(); StyleManager.setStyleDeclaration("TextArea", style, false); }; if (style.defaultFactory == null){ style.defaultFactory = function ():void{ this.horizontalScrollBarStyleName = "textAreaHScrollBarStyle"; this.backgroundDisabledColor = 0xDDDDDD; this.borderStyle = "solid"; this.backgroundColor = 0xFFFFFF; this.verticalScrollBarStyleName = "textAreaVScrollBarStyle"; }; }; } } }//package
Section 337
//_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 338
//_TextInputStyle (_TextInputStyle) package { import mx.core.*; import mx.styles.*; public class _TextInputStyle { public static function init(backgroundDisabledColor:IFlexModuleFactory):void{ var fbs = backgroundDisabledColor; var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("TextInput"); if (!style){ style = new CSSStyleDeclaration(); StyleManager.setStyleDeclaration("TextInput", style, false); }; if (style.defaultFactory == null){ style.defaultFactory = function ():void{ this.backgroundDisabledColor = 0xDDDDDD; this.backgroundColor = 0xFFFFFF; }; }; } } }//package
Section 339
//_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 340
//_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 341
//_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 342
//_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 343
//_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 344
//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 345
//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 346
//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 347
//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 348
//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 349
//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 350
//FxCraptunePlayer (FxCraptunePlayer) package { import flash.display.*; import flash.geom.*; import flash.media.*; import flash.text.*; import mx.core.*; import flash.events.*; import mx.events.*; import mx.styles.*; import mx.controls.*; import mx.binding.*; import net.kaikoga.audio.craptune.*; import flash.accessibility.*; import mx.containers.*; import flash.utils.*; import flash.ui.*; import flash.system.*; import flash.external.*; import flash.net.*; import flash.debugger.*; import flash.errors.*; import flash.filters.*; import flash.printing.*; import flash.profiler.*; import flash.xml.*; public class FxCraptunePlayer extends Application implements IBindingClient { private var _110621003track:TextInput; private var _100358090input:TextArea; private var _1834774060stopButton:Button; mx_internal var _watchers:Array; private var _1448695530playTrackOnceButton:Button; private var _1425638247playOnceButton:Button; private var _1097557894playButton:Button; mx_internal var _bindingsByDestination:Object; private var _701492296loadButton:Button; private var _762279049playTrackButton:Button; mx_internal var _bindingsBeginWithWord:Object; private var _1719769558craptune:UICraptune; mx_internal var _bindings:Array; private var _documentDescriptor_:UIComponentDescriptor; mx_internal static var _FxCraptunePlayer_StylesInit_done:Boolean = false; private static var _watcherSetupUtil:IWatcherSetupUtil; public function FxCraptunePlayer(){ _documentDescriptor_ = new UIComponentDescriptor({type:Application, propertiesFactory:function ():Object{ return ({childDescriptors:[new UIComponentDescriptor({type:Panel, stylesFactory:function ():void{ this.paddingTop = 10; this.paddingBottom = 10; this.paddingLeft = 10; this.paddingRight = 10; }, propertiesFactory:function ():Object{ return ({title:"Craptune", percentWidth:100, percentHeight:100, childDescriptors:[new UIComponentDescriptor({type:TextArea, id:"input", stylesFactory:function ():void{ this.fontSize = 14; }, propertiesFactory:function ():Object{ return ({percentWidth:100, percentHeight:100, text:"#kaeru no uta\n@w0=pulse,0.35\n@e0=0;default\n@w1=pulse,0.25\n@e1=1;flat\n@w2=pulse,0.125\n@e2=2;flat\n@w4=saw\n@e4=4;flat\n@w5=fm,3,0.05\n@e5=5;default\n@w6=fm,3,0.02\n@e6=6;default\n\n@s20=bitnoise,2000,50,18,2\n@e20=sampletkit,0,,0,,0,0,,0,,0,,20\n#c:-- d:-- e:-- f:-- g:-- a:-- b:bd\n\n@s30=bitnoise,2000,15,12,4\n@s31=bitnoise,2000,8,12,8\n@s32=bitnoise,2000,13,12,4\n@s35=bitnoise,2000,16,12,4\n@s36=bitnoise,2000,14,12,4\n@s37=bitnoise,2000,12,12,4\n@s39=bitnoise,2000,10,12,4\n@e30=sampletkit,30,,31,,32,35,,36,,37,,38\n#c:sd d:cl e:ed f:ft g:lt a:mt b:ht\n\n@s40=bitnoise,1000,1,8,2\n@s41=bitnoise,1000,1,10,3\n@s42=bitnoise,10000,1,5,2\n@e40=sampletkit,40,,41,,42,0,,0,,0,,0\n#c:ch d:cl e:oh f:-- g:-- a:-- b:--\n\n@s50=bitnoise,10000,1,16,1\n@e50=sampletkit,50,,0,,0,0,,0,,0,,0\n#c:cy d:-- e:-- f:-- g:-- a:-- b:--\n\nACDEFGHIJPQRS t172\nAC @@0 v16 #piano\nD @@4 v12 #brass\nE @@6 v16 #base1\nF @@5 v6 #base2\nG @@2 v6 #strings1\nH @@2 v6 #synthstrings\nIJ @@1 v6 #strings2\n\nP @@50 #cy\nQ @@40 #hh\nR @@30 #sn\nS @@20 #bd\n\n.i1\n#melody\nA o5 l8 f2e2 d2c+4.e fd<a>fec<g>e d<b-f>d c+<a>{c+ea>c+}4 \nA o6 l16 d<af>d<af>d<a> c<ge>c<ge>c<g b-fdb-fdb-d aec+<a>ec+<a>c+\nC o4 l8 d2c2 <b-2a4.>c+ d<af>dc<ge>c <b-fdb-ae{a>c+ea}4 \nC o4 l16 afdafdaf gecgecge fd<b->fd<b->fd ec+<ae>c+<aea\n#bass\nE o2 l8 d2c2<b-2a2> d4d4c4c4<b-4b-4a4a4> drdrcrcr <b-rb-rarar\n#harmony\nH o6 l4 f2e2d2c+2 <a>f<g>e<f>d<e>c+ r1r1\nI o3 l2 r1r1 r1r1 dc<b-a\n#drums\nP l8 c2 c2 c2 c2 r1r1r1r1\n\nQ l8 r1\nR l8 r1\nS l8 b2 b2\n\nQ l8 r4 rc rr cc\nR l8 r1\nS l8 br rr br rb\n\nQ l16 crcr rrcc rrcr rrcr\nR l16 e4 e4 e4 e4\nS l16 b4 b4 b4 b4\n\nQ l16 crcr rrcc rrcr rrcc\nR l16 e4 e4 e4 e8{eeee}8\nS l16 b4 b4 b4 b4\n\nQ l16 cccc cccc cccc cccc\nR l16 rrer rrer rrer rrer\nS l16 b4 b4 b4 b4\n\nQ l16 cccc cccc cccc cccc\nR l16 rrer rrer rrer {eeee}8ee\nS l16 b4 b4 b4 b4\n\n.i2\n#melody\nA o6 l16 fd<a>fd<a>fd d<af>d<af>d<a> ec<g>ec<g>ec c+<ae>c+<aea>c+\nA o6 l16 fd<a>fd<a>fd d<af>d<af>d<a> ec<g>ec<g>ec c+<ae>c+ {<f+a>c+efg}4\nC o5 l16 d<af>d<af>d<a afdafdaf >c<ge>c<ge>c<g aec+aec+ea\nC o5 l16 d<af>d<af>d<a afdafdaf >c<ge>c<ge>c<g aec+a {f+a>c+efg}4\n#bass\nE o2 l8 [drdr<b-rb-r>crcr<arar>]2\n#harmony\nI o3 l2 [d<b->c<a>]2\n#drums\nP l16 r1r1r1c1\n\nQ l16 [cccc cccc cccc cccc]3\nR l16 [rrer rrer rrer rrer]3\nS l16 [b4 b4 b4 b4 ]3\n\nQ l16 cccr cccr cccr cccr\nR l16 eeee eeee eeee {eeeeeeee}4\nS l16 b4 b4 b4 b4 \n\n.a1\n#melody\nA o5 l8 a4.>cd4^16.e32f e8.c8.d8<a8.r16fg a4.>c<f32g8^32e8.c8 d2.<a>c\nC o4 l8 f4.ab-4^16.>c32d c8.<g8.a8f8.r16de f4.ad32e8^32c8.<a8 b-2.fa\nD o5 l16 r1r1 r1r4.a>cfec<gf4\n#bass\nE o2 l2 d<b->cf<gab-b-\nF o3 l16 r8ar8ar8 r8fr8fr8 r8er8er8 r8cr8cr8\nF o3 l16 r8dr8dr8 r8er8er8 r8fr8fr8 r8fr8fr8\n#harmony\nG o4 l2 a>de<a b->cd2.<a4\nI o3 l2 d<b->c{fr}4e4 <gab-1\n#drums\nP l16 c1r1r1r1\nQ l16 [ccce8 dcc ccce8 dcc]4\nS l16 [b4 b4 brrb rbrr]4\n\nR l16 r8er r8er r8er r8er\nR l16 r8er r8er err8 r8er\nR l16 erer r8er erer r8er\nR l16 erer {reee}8er erer eree\n\n.a2\n#melody\nA o5 l8 d4.{cd}f8.e8.c8 c+8.<b-8.a8g8.f8.e8 d4a4g8.a8.>c8 d<a>e<a>f8.r16fg\nC o3 l8 b-4.{ab-}>d8.c+8.<a8 a8.g8.f8e8.d8.c8 <b-4>f4e8.f8.a8 af>c<f>d8.r16de\n#bass\nE o1 l2 b->c<aab->cdd\nF o3 l16 r8fr8fr8 r8fr8fr8 r8er8er8 r8er8er8\nF o3 l16 r8dr8dr8 r8er8er8 r8ar8ar8 r8ar8ar8\n#harmony\nG o4 l2 b->c<a2.g4 fga1\nI o2 l2 b->c<aab->cd1\n#drums\nQ l16 [ccce8 dcc ccce8 dcc]4\nS l16 [b4 b4 brrb rbrr]4\n\nR l16 [r8er r8er r8er r8er]2\nR l16 errr er{reee}8 erre rrer\nR l16 erer rree eeer rree\n\n.a3\n#melody\nA o5 l8 d4.{cd}f8.e8.c8 c+8.<b-8.a8g8.f8.e8 d4a4g8.a8.>c8 l16 d<af>d<af>d<af>d<af>d<af>d\nC o3 l8 b-4.{ab-}>d8.c+8.<a8 a8.g8.f8e8.d8.c8 <b-4>f4e8.f8.a8 l16 afdafdafdafdafda\n#bass\nE o1 l2 b->c<aab->cdd\nF o3 l16 r8fr8fr8 r8fr8fr8 r8er8er8 r8er8er8\nF o3 l16 r8dr8dr8 r8er8er8 r8ar8ar8 r8ar8ar8\n#harmony\nG o4 l2 b->c<a2.g4 fga1\nI o2 l2 b->c<aab->cd1\n#drums\nP l16 r1r1 c4c4c8.c8.c8 c1\n\nQ l16 [ccce8 dcc ccce8 dcc]4\nS l16 [b4 b4 brrb rbrr]4\n\nR l16 [r8er r8er r8er r8er]2\nR l16 errr er{reee}8 erre rrer\nR l16 erer rree ee{eeee}8 eeee\n\n.b1\n#melody\nA o5 l16 afdafdaf gecgecge fd<b->fd<b->fd ec+<a>ec+<a>e>c+\nA o6 l16 d<af>d<af>d<a >c<ge>c<ge>c<g b-fdb-fdb-f aec+aec+a>c+\nC o4 l16 fd<a>fd<a>fd ec<g>ec<g>ec d<b-f>d<b-f>d<b-> c+<ae>c+<ae>c+e\nC o4 l16 afdafdaf gecgecge fd<b->fd<b->fd ec+<ae>c+<a>ea\n#bass\nE o2 l4 [ddcc<b-b-aa>]2\n#harmony\n#drums\nP l8 c1 r1r1r1\n\nQ l16 crcr rrcc rrcr rrcr\nR l16 e4 e4 e4 e4\nS l16 b4 b4 b4 b4\n\nQ l16 crcr rrcc rrcr rr{cccc}8\nR l16 e4 e4 e4 e8ee\nS l16 b4 b4 b4 b4\n\nQ l16 cccc cccc cccc cccc\nR l16 rrer rrer rrer rrer\nS l16 b4 b4 b4 b4\n\nQ l16 cccc cccc cccc cccc\nR l16 rrer rrer rrer {eeee}8ee\nS l16 b4 b4 b4 b4\n\n.a4\n#melody\nA o5 l8 d4.{cd}f8.e8.c8 c+8.<b-8.a8g8.f8.e8 d4a4g8.a8.>c8 d1\nC o3 l8 b-4.{ab-}>d8.c+8.<a8 a8.g8.f8e8.d8.c8 <b-4>f4e8.f8.a8 a1\n#bass\nE o1 l2 b->c<aab->cd1\nF o3 l16 r8fr8fr8 r8fr8fr8 r8er8er8 r8er8er8\nF o3 l16 r8dr8dr8 r8er8er8 r8ar8ar8 r8ar8ar8\n#harmony\nG o4 l2 b->c<a2.g4 fga1\nI o2 l2 b->c<aab->cd1\n#drums\nP l16 r1r1 c4c4c8.c8.c8 c1\n\nQ l16 [ccce8 dcc ccce8 dcc]3\nQ l16 crcc ccrc r2\n\nS l16 [b4 b4 brrb rbrr]3\nS l16 b2 b4 {rbbb}8\n\nR l16 [r8er r8er r8er r8er]2\nR l16 errr er{reee}8 erre rrer\nR l16 e2 e2\n\n.c1\n#melody\nA o5 l16 d8.e8.f+8f+2 c+8.f8.a8g+8.f+8.c+8 d8.e8.f+8e8.f+8.g+8 a4.>c+8 c+<af+>c+<af+>c+<a\nC o3 l4 a>d<b>e <g+>c+df+ l8 <a8.>f+8.<ab8.>g+8.<b >f+g+a>c+<ag+f+e\n#bass\nE o2 l4 drerc+rdrdrerf+rf+r\nF o3 l16 r4f+a>d<r r4g+b>e<r r4fg+>c+<r r4f+a>d<r\nF o3 l16 r4f+a>d<r r4g+b>e<r r4a>c+f+<r r4a>c+f+<r\n#harmony\n#drums\nP l8 crrr crrr crrr crrr\nQ l8 r1 rrrc rrcc\nR l8 r1 r1\nS l8 brrb brrr brrb brb{bbbb}\n\nP l8 crrr crrr crrr r2\nQ l8 r1 rrrc rcc{cc}\nR l8 r2 b8.a8.g8\nS l8 brbr b8.b8.b8 brbrbrbr\n\n.c2\n#melody\nA o6 l16 c+<af+ag+ec+<ab4bf+ab >c+8.f8.a8g+f+e<bag+f+8 \nA o4 l16 f+d<a>f+d<a>f+d g+e<b>g+e<b>g+e a+f+d+a+f+d+a+f+d+a+f+d+a+f+d+a+\nC o3 l4 a>d<b>e <g+>c+d{f+d} l8 <a8.>f+8.ae8.g+8.b a+f+a+f+ l16 >a+g+f+d+<a+g+f+d+\n#bass\nE o2 l4 drerc+rdr drerf+rf+r\nF o3 l16 r4f+a>d<r r4g+b>e<r r4fg+>c+<r r4f+a>d<r\nF o3 l16 r4f+a>d<r r4g+b>e<r r4ga+>d+<r r4ga+>d+<r\n#harmony\n#drums\nP l16 c2c2c2c2c2c2c1\nR l16 [r8dr r8dr r8dr r8dr r8dr r8dr r8dr r8dd]2\nS l16 [b4]16\n\nQ l16 rrcr cccr erdr crcc\nQ l16 rrcr erdr rrcr crcc\nQ l16 rrcr cccr erdr crcc\nQ l16 rrcr erdr rr{cccc}8 cccr\n\n.c3\n#melody\nA o5 l16 b8.>c+8.e-8e-2 <b-8.>d8.g-8f8.e-8.<b-8 b8.>d-8.e-8d-8.e-8.f8 g-4.b-8 b-g-e-b-g-e-b-g-\nC o3 l16 g-b>d-e-g-b>d-e- fe-d-<a-fe-d-<a- b->dfb->dfb-g- e-d-<bg-e-d-<bg-\nC o3 l16 g-b>d-e-g-b>d-e- <<a->d-e-fa->d-e-f <<b->e-fg-b->e-fg-b-g-fe->b-g-fe-\n#bass\nE o1 l4 br>c+r<arbr br>c+rd+rd+r\nF o3 l16 r4e-g-br r4fa->d-<r r4dfb-r r4e-g-br\nF o3 l16 r4e-g-br r4fa-d-r r4gb->e-< r4gb->e-<\n#harmony\n#drums\nP l16 c2c2c2c2c2c2c1\nQ l16 [ccce8 dcc ccce8 dcc]4\nS l16 [b4 b4 brrb rbrr]4\n\nR l16 [r8er r8er r8er r8er]3\nR l16 r8er r8er r8er cccc\n\n.c4\n#melody\nA o6 l16 b-g-e-g-fd-<b-g- a-4a-fg-a- b-8.>d8.g-8fe-d-<b-a-g-f8\nA o5 l16 e-<bg->e-<bg->e-<b> fd-<a->fd-<a->fd- ge-cge-cge- c>e-c<g>e-c<g>e-\nC o3 l16 g-b>d-e-g-b>d-e- fe-d-<a-fe-d-<a- b->dfb->dfb-g- e-d-<bg-e-d-<bg-\nC o3 l16 g-8e-8>g-8b8 <a-8>d-8a-8<a-8 >c<ge->c<ge->c<ge->c<ge->c<ge->c\n#bass\nE o1 l4 br>c+r<arbr br>c+rcrcr\nF o3 l16 r4e-g-br r4fa->d-<r r4dfb-r r4e-g-br\nF o3 l16 r4e-g-br r4fa-d-r r4e-g>c< r4e-g>c<\n#harmony\n#drums\nP l16 c2c2c2c2c2c2c1\nQ l16 [ccce8 dcc ccce8 dcc]4\nS l16 [b4 b4 brrb rbrr]4\n\nR l16 [r8er r8er r8er r8er]2\nR l16 r8er r8er r8er r8cc\nR l16 cccc cccc {cccccccccccccccc}2\n\n\n.c5\n#melody\nA o5 l16 e-c<g>e-c<g>e-c c<ge->c<ge->c<g> d<b-f>d<b-f>d<b- b-ge-b-ge-b-g\nA o4 l16 a-fca-fca-f b-gdb-gdb-g >c<a-e->c<a-e->c<a-e->c<a-e->c<a-e->c\nC o4 l16 c<ge->c<ge->c<g ge-cge-cge- b-fdb-fdb-f ge-<b->ge-<b->ge-\nC o3 l16 fc<a->fc<a->fc gd<b->gd<b->gd a-e-ca-e-ca-e-ca-e-ca-e-ca-\n#bass\nE o2 l2 c<a-b-e- fga-a-\n#harmony\n#drums\nP l16 c1r1r1r1\nQ l16 [ccce8 dcc ccce8 dcc]4\nS l16 [b4 b4 brrb rbrr]4\n\nR l16 [r8er r8er r8er r8er]2\nR l16 erer rrer erer rrer\nR l16 erer {reee}8er erer eree\n\n.c6\n#melody\nA o5 l16 c<a-e->c<a-e->c<a-> d<b-f>d<b-f>d<b- bgdbgdbg >d<bg>d<bg>d<b\nA o5 l16 c<a-e->c<a-e->c<a-> d<b-f>d<b-f>d<b-> e-c<g>e-c<g>e-ce->c<g>e-c<g>e-c\nC o3 l16 a-e-ca-e-ca-e- b-fdb-fdb-f gd<b->gd<b->gd bgdbgdbg\nC o3 l16 a-e-ca-e-ca-e- b-fdb-fdb-f >c<ge->c<ge->c<g >cge-cge-cg\n#bass\nE o1 l2 a-b-g>g <a-b->cg\n#harmony\n#drums\nQ l16 [ccce8 dcc ccce8 dcc]4\nS l16 [b4 b4 brrb rbrr]4\n\nR l16 [r8er r8er r8er r8er]2\nR l16 errr er{reee}8 erre rrer\nR l16 erer rree eeer rree\n\n.c7\n#melody\nA o6 l16 e-c<g>e-c<g>e-c c<ge->c<ge->c<g> d<b-f>d<b-f>d<b- b-ge-b-ge-b-g\nA o5 l16 a-fca-fca-f b-gdb-gdb-g >c<a-e->c<a-e->c<a-e->c<a-e->c<a-e->c\nC o5 l16 c<ge->c<ge->c<g ge-cge-cge- b-fdb-fdb-f ge-<b->ge-<b->ge-\nC o4 l16 fc<a->fc<a->fc gd<b->gd<b->gd a-e-ca-e-ca-e-ca-e-ca-e-ca-\nD o5 l16 r1r1 r1r4.gb->e-d<b-fg4\n#bass\nE o2 l2 c<a-b- e-fga-1\n#harmony\nG o5 l2 g>cd<g a-b->c1\n#drums\nP l8 crrr crrr crrr crrr\nQ l8 r1 rrrc rrcc\nR l8 r1 r1\nS l8 brrr brrr brrb brb{bbbb}\n\nP l16 c2c2c1\n\nQ l16 crcr rrcc crcr rrcr\nR l16 r8dr r8dr r8dr r8dr\nS l16 brr8 brr8 brr8 brr8\n\nQ l16 crcr rrcc crcr r{rccc}8c\nR l16 r8dr r8dr r8dr r{reee}8e\nS l16 brr8 brr8 brr8 brr8\n\n.c8\n#melody\nA o6 l16 c<a-e->c<a-e->c<a-> d<b-f>d<b-f>d<b- bgdbgdbg >d<bg>d<bg>d<b\nA o6 l16 c<a-e->c<a-e->c<a-> d<b-f>d<b-f>d<b- afca+f+c+bgdb+g+d+>c+<ae>c+ r2\nC o4 l16 a-e-ca-e-ca-e- b-fdb-fdb-f gd<b->gd<b->gd bgdbgdbg\nC o4 l16 a-e-ca-e-ca-e- b-fdb-fdb-f >c<af>c+<a+f+>d<bg>d+<b+g+>ec+<a>e r2\n#bass\nE o1 l2 a-b-g>g <a-b->f8.g-8.g8.g+8.a8.r16 r2\n#harmony\nG o6 l8. r1r1r1 cc+dd+e4 r2\n#drums\nP l8 crrr crrr crrr crrr\nQ l8 r1 rrrc rrcc\nR l8 r1 r1\nS l8 brrr brrr brrb brb{bbbb}\n\nP l16 c2c2\n\nQ l16 crcr rrcc crcr rrcr\nR l16 r8dr r8dr r8dr r8dr\nS l16 brr8 brr8 brr8 brr8\n\nP l16 c8. c8. c8. c8. c4 c2\nQ l16 r1.\nR l16 {eeeeee}8. {eeee}8. {eee}8. {eeee}8. {eeeeeeee}4 br8ar8gr\nS l16 b8. b8. b8. b8. b4 r2\n\n.d1\n#melody\nA o5 l8 b-4.>d-e-4^16.f32g- f8.d-8.e-<b-8.r16g-a- b-4.>d-<g32a-8^32f8.d-8 e-2.<b->d-\nC o4 l8 g-4.b-b4^16.>d32e- d-8.<a-8.b-g-8.r16e-f g-4.b-e32f8^32d-8.<b-8 b2.g-b-\n#bass\nE o2 l2 e-<b>d-g- <a-b-bb\nF o3 l16 r8b-r8b-r8 r8g-r8g-r8 r8fr8fr8 r8d-r8d-r8 \nF o3 l16 r8e-r8e-r8 r8fr8fr8 r8g-r8g-r8 r8g-r8g-r8\n#harmony\nH o6 l8 b-4.>d-e-4.g- f8.d-8.e-<b-8.r16g-a- b-4.>d-<a-8.f8.d-8 e-2.<b->d-\nI o4 l2 b-g-a-b-4r4 b>d-e-2.<b4\nJ o4 l2 e-<b>d-g-4r4 a-2b-2b2.a-4\n#drums\nP l16 c1r1r1r1\nQ l16 [ccce8 dcc ccce8 dcc]4\nS l16 [b4 b4 brrb rbrr]4\n\nR l16 r8er r8er r8er r8er\nR l16 r8er r8er err8 r8er\nR l16 erer r8er erer r8er\nR l16 erer {reee}8er erer eree\n\n.d2\n#melody\nA o5 l8 e-4.{d-e-}g-8.f8.d- d8.<b8.b-8 a-8.g-8.f e-4b-4a-8.b-8.>d- e-<b->f<b->g-8.r16g-a-\nC o3 l8 b4.{b-b}>e-8.d8.<b-8 b-8.a-8.g-8f8.e-8.d-8 <b4>g-4f8.g-8.b-8 b-g->d-<g->e-8.r16e-f\n#bass\nE o1 l2 b>d-<b-b- b>d-e-e-\nF o3 l16 r8g-r8g-r8 r8g-r8g-r8 r8fr8fr8 r8fr8fr8\nF o3 l16 r8e-r8e-r8 r8fr8fr8 r8b-r8b-r8 r8b-r8b-r8\n#harmony\nH o6 l8 e-4.{d-e-}g-8.f8.d- d8.<b8.b-8 a-8.g-8.f e-4b-4a-8.b-8.>d- e-<b->f<b->g-8.r16g-a-\nI o4 l2 b>d-<b-a- g-a-b-1\nJ o4 l2 a-b-ff <b>d-e-1\n#drums\nQ l16 [ccce8 dcc ccce8 dcc]4\nS l16 [b4 b4 brrb rbrr]4\n\nR l16 [r8er r8er r8er r8er]2\nR l16 errr er{reee}8 erre rrer\nR l16 erer rree eeer rree\n\n.d3\n#melody\nA o5 l8 e-4.{d-e-}g-8.f8.d- d8.<b8.b-8 a-8.g-8.f e-4b-4a-8.b-8.>d- e-1\nC o3 l8 b4.{b-b}>e-8.d8.<b-8 b-8.a-8.g-8f8.e-8.d-8 <b4>g-4f8.g-8.b-8 b-1\n#bass\nE o1 l2 bd-<b-b- b>d-e-e-\nF o3 l16 r8g-r8g-r8 r8g-r8g-r8 r8fr8fr8 r8fr8fr8\nF o3 l16 r8e-r8e-r8 r8fr8fr8 r8b-r8b-r8 r8b-r8b-r8\n#harmony\nH o6 l8 e-4.{d-e-}g-8.f8.d- d8.<b8.b-8 a-8.g-8.f e-4b-4a-8.b-8.>d- e-1\nI o4 l2 b>d-<b-a- g-a-b-1\nJ o4 l2 a-b-ff <b>d-e-1\n#drums\nP l16 r1r1 c4c4c8.c8.c8 c1\n\nQ l16 [ccce8 dcc ccce8 dcc]4\nS l16 [b4 b4 brrb rbrr]4\n\nR l16 [r8er r8er r8er r8er]2\nR l16 errr er{reee}8 erre rrer\nR l16 erer rree ee{eeee}8 eeee\n\n.d4\n#melody\nA o5 l8 e-4.{d-e-}g-8.f8.d- d8.<b8.b-8 a-8.g-8.f e-4b-4a-8.b-8.>d- l16 e-<b-g->e-<b-g->e-<b-g->e-<b-g->e-<b-g->e-\nC o3 l8 b4.{b-b}>e-8.d8.<b-8 b-8.a-8.g-8f8.e-8.d-8 <b4>g-4f8.g-8.b-8 l16 b-g-e-b-g-e-b-g-e-b-g-e-b-g-e-b-\n#bass\nE o1 l2 bd-<b-b- b>d-e-e-\nF o3 l16 r8g-r8g-r8 r8g-r8g-r8 r8fr8fr8 r8fr8fr8\nF o3 l16 r8e-r8e-r8 r8fr8fr8 r8b-r8b-r8 r8b-r8b-r8\n#harmony\nH o6 l8 e-4.{d-e-}g-8.f8.d- d8.<b8.b-8 a-8.g-8.f e-4b-4a-8.b-8.>d- l16 e-<b-g->e-<b-g->e-<b-g->e-<b-g->e-<b-g->e-\nI o4 l2 b>d-<b-a- g-a-b-1\nJ o4 l2 a-b-ff <b>d-e-1\n#drums\nP l16 r1r1 c4c4c8.c8.c8 c1\n\nQ l16 [ccce8 dcc ccce8 dcc]4\nS l16 [b4 b4 brrb rbrr]4\n\nR l16 [r8er r8er r8er r8er]2\nR l16 errr er{reee}8 erre rrer\nR l16 erer rree ee{eeee}8 eeee\n\n\n\n.0=;i1,i2,a1,a2,a1,a3,b1,i2,a1,a2,a1,a4,c1,c2,c3,c4,c5,c6,c7,c8,d1,d2,d1,d3,d1,d2,d1,d4\n"}); }}), new UIComponentDescriptor({type:HBox, propertiesFactory:function ():Object{ return ({percentWidth:100, childDescriptors:[new UIComponentDescriptor({type:Button, id:"loadButton", events:{click:"__loadButton_click"}, propertiesFactory:function ():Object{ return ({label:"Load"}); }}), new UIComponentDescriptor({type:Button, id:"playButton", events:{click:"__playButton_click"}, propertiesFactory:function ():Object{ return ({label:"Play"}); }}), new UIComponentDescriptor({type:Button, id:"playOnceButton", events:{click:"__playOnceButton_click"}, propertiesFactory:function ():Object{ return ({label:"Play Once"}); }}), new UIComponentDescriptor({type:Button, id:"stopButton", events:{click:"__stopButton_click"}, propertiesFactory:function ():Object{ return ({label:"Stop"}); }}), new UIComponentDescriptor({type:ProgressBar, propertiesFactory:function ():Object{ return ({conversion:1, direction:"right", indeterminate:false, label:"Progress", labelPlacement:"left", width:240, maximum:10000, minimum:0, mode:"polled", source:"craptune"}); }})]}); }}), new UIComponentDescriptor({type:HBox, propertiesFactory:function ():Object{ return ({percentWidth:100, childDescriptors:[new UIComponentDescriptor({type:Button, id:"playTrackButton", events:{click:"__playTrackButton_click"}, propertiesFactory:function ():Object{ return ({label:"Play Track"}); }}), new UIComponentDescriptor({type:Button, id:"playTrackOnceButton", events:{click:"__playTrackOnceButton_click"}, propertiesFactory:function ():Object{ return ({label:"Play Track Once"}); }}), new UIComponentDescriptor({type:Label, propertiesFactory:function ():Object{ return ({text:"Track Name:"}); }}), new UIComponentDescriptor({type:TextInput, id:"track", propertiesFactory:function ():Object{ return ({percentWidth:100, percentHeight:100, text:"0"}); }})]}); }}), new UIComponentDescriptor({type:UICraptune, id:"craptune"})]}); }})]}); }}); _bindings = []; _watchers = []; _bindingsByDestination = {}; _bindingsBeginWithWord = {}; super(); mx_internal::_document = this; mx_internal::_FxCraptunePlayer_StylesInit(); this.layout = "absolute"; } public function get stopButton():Button{ return (this._1834774060stopButton); } public function get playButton():Button{ return (this._1097557894playButton); } mx_internal function _FxCraptunePlayer_StylesInit():void{ var _local1:CSSStyleDeclaration; var _local2:Array; if (mx_internal::_FxCraptunePlayer_StylesInit_done){ return; }; mx_internal::_FxCraptunePlayer_StylesInit_done = true; var _local3 = StyleManager; _local3.mx_internal::initProtoChainRoots(); } public function set playButton(_FxCraptunePlayer_StylesInit_done:Button):void{ var _local2:Object = this._1097557894playButton; if (_local2 !== _FxCraptunePlayer_StylesInit_done){ this._1097557894playButton = _FxCraptunePlayer_StylesInit_done; this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "playButton", _local2, _FxCraptunePlayer_StylesInit_done)); }; } override public function initialize():void{ var target:FxCraptunePlayer; var watcherSetupUtilClass:Object; mx_internal::setDocumentDescriptor(_documentDescriptor_); var bindings:Array = _FxCraptunePlayer_bindingsSetup(); var watchers:Array = []; target = this; if (_watcherSetupUtil == null){ watcherSetupUtilClass = getDefinitionByName("_FxCraptunePlayerWatcherSetupUtil"); var _local2 = watcherSetupUtilClass; _local2["init"](null); }; _watcherSetupUtil.setup(this, function (*:String){ return (target[*]); }, bindings, watchers); var i:uint; while (i < bindings.length) { Binding(bindings[i]).execute(); i = (i + 1); }; mx_internal::_bindings = mx_internal::_bindings.concat(bindings); mx_internal::_watchers = mx_internal::_watchers.concat(watchers); super.initialize(); } public function set playTrackButton(_FxCraptunePlayer_StylesInit_done:Button):void{ var _local2:Object = this._762279049playTrackButton; if (_local2 !== _FxCraptunePlayer_StylesInit_done){ this._762279049playTrackButton = _FxCraptunePlayer_StylesInit_done; this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "playTrackButton", _local2, _FxCraptunePlayer_StylesInit_done)); }; } public function __playTrackOnceButton_click(event:MouseEvent):void{ craptune.startTrack(track.text, true); } public function set input(_FxCraptunePlayer_StylesInit_done:TextArea):void{ var _local2:Object = this._100358090input; if (_local2 !== _FxCraptunePlayer_StylesInit_done){ this._100358090input = _FxCraptunePlayer_StylesInit_done; this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "input", _local2, _FxCraptunePlayer_StylesInit_done)); }; } public function set track(_FxCraptunePlayer_StylesInit_done:TextInput):void{ var _local2:Object = this._110621003track; if (_local2 !== _FxCraptunePlayer_StylesInit_done){ this._110621003track = _FxCraptunePlayer_StylesInit_done; this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "track", _local2, _FxCraptunePlayer_StylesInit_done)); }; } public function __playOnceButton_click(event:MouseEvent):void{ craptune.loadStartMML(input.text, "0", true); } public function get playTrackButton():Button{ return (this._762279049playTrackButton); } public function set craptune(_FxCraptunePlayer_StylesInit_done:UICraptune):void{ var _local2:Object = this._1719769558craptune; if (_local2 !== _FxCraptunePlayer_StylesInit_done){ this._1719769558craptune = _FxCraptunePlayer_StylesInit_done; this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "craptune", _local2, _FxCraptunePlayer_StylesInit_done)); }; } public function set stopButton(_FxCraptunePlayer_StylesInit_done:Button):void{ var _local2:Object = this._1834774060stopButton; if (_local2 !== _FxCraptunePlayer_StylesInit_done){ this._1834774060stopButton = _FxCraptunePlayer_StylesInit_done; this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "stopButton", _local2, _FxCraptunePlayer_StylesInit_done)); }; } public function __loadButton_click(event:MouseEvent):void{ craptune.loadMML(input.text); } private function _FxCraptunePlayer_bindingExprs():void{ var _local1:*; _local1 = craptune.loaded; _local1 = craptune.loaded; } public function get loadButton():Button{ return (this._701492296loadButton); } public function __stopButton_click(event:MouseEvent):void{ craptune.stopMML(); } public function get track():TextInput{ return (this._110621003track); } public function set playOnceButton(_FxCraptunePlayer_StylesInit_done:Button):void{ var _local2:Object = this._1425638247playOnceButton; if (_local2 !== _FxCraptunePlayer_StylesInit_done){ this._1425638247playOnceButton = _FxCraptunePlayer_StylesInit_done; this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "playOnceButton", _local2, _FxCraptunePlayer_StylesInit_done)); }; } public function get input():TextArea{ return (this._100358090input); } public function get craptune():UICraptune{ return (this._1719769558craptune); } private function _FxCraptunePlayer_bindingsSetup():Array{ var binding:Binding; var result:Array = []; binding = new Binding(this, function ():Boolean{ return (craptune.loaded); }, function (_FxCraptunePlayer_StylesInit_done:Boolean):void{ playTrackButton.enabled = _FxCraptunePlayer_StylesInit_done; }, "playTrackButton.enabled"); result[0] = binding; binding = new Binding(this, function ():Boolean{ return (craptune.loaded); }, function (_FxCraptunePlayer_StylesInit_done:Boolean):void{ playTrackOnceButton.enabled = _FxCraptunePlayer_StylesInit_done; }, "playTrackOnceButton.enabled"); result[1] = binding; return (result); } public function set playTrackOnceButton(_FxCraptunePlayer_StylesInit_done:Button):void{ var _local2:Object = this._1448695530playTrackOnceButton; if (_local2 !== _FxCraptunePlayer_StylesInit_done){ this._1448695530playTrackOnceButton = _FxCraptunePlayer_StylesInit_done; this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "playTrackOnceButton", _local2, _FxCraptunePlayer_StylesInit_done)); }; } public function get playOnceButton():Button{ return (this._1425638247playOnceButton); } public function get playTrackOnceButton():Button{ return (this._1448695530playTrackOnceButton); } public function __playButton_click(event:MouseEvent):void{ craptune.loadStartMML(input.text); } public function set loadButton(_FxCraptunePlayer_StylesInit_done:Button):void{ var _local2:Object = this._701492296loadButton; if (_local2 !== _FxCraptunePlayer_StylesInit_done){ this._701492296loadButton = _FxCraptunePlayer_StylesInit_done; this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "loadButton", _local2, _FxCraptunePlayer_StylesInit_done)); }; } public function __playTrackButton_click(event:MouseEvent):void{ craptune.startTrack(track.text); } public static function set watcherSetupUtil(_FxCraptunePlayer_StylesInit_done:IWatcherSetupUtil):void{ _slot1._watcherSetupUtil = _FxCraptunePlayer_StylesInit_done; } } }//package

Library Items

Symbol 1 GraphicUsed by:2
Symbol 2 MovieClip {_CursorManagerStyle__embed_css_Assets_swf_mx_skins_cursor_BusyCursor_1988544867} [mx.skins.cursor.BusyCursor]Uses:1

Special Tags

FileAttributes (69)Timeline Frame 1Access local files only, Metadata present, AS3.
SWFMetaData (77)Timeline Frame 1483 bytes "<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'><rdf:Description rdf:about='' xmlns ..."
ScriptLimits (65)Timeline Frame 1MaxRecursionDepth: 65535, ScriptTimeout: 4 seconds
ExportAssets (56)Timeline Frame 2Symbol 2 as "mx.skins.cursor.BusyCursor"
EnableDebugger2 (64)Timeline Frame 131 bytes "u.$1$xV$Ptb/fXQ7LjmmjSSV2VrNV.."
DebugMX1 (63)Timeline Frame 1
SerialNumber (41)Timeline Frame 1

Labels

"_FxCraptunePlayer_mx_managers_SystemManager"Frame 1
"FxCraptunePlayer"Frame 2




http://swfchan.com/33/161199/info.shtml
Created: 21/10 -2018 08:25:57 Last modified: 21/10 -2018 08:25:57 Server time: 14/11 -2024 22:51:21