//////////////////////////////////////////////////////////////////////////////// // // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. // The ASF licenses this file to You under the Apache License, Version 2.0 // (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // //////////////////////////////////////////////////////////////////////////////// package mx.core { import flash.accessibility.Accessibility; import flash.accessibility.AccessibilityProperties; import flash.display.BlendMode; import flash.display.DisplayObject; import flash.display.DisplayObjectContainer; import flash.display.GradientType; import flash.display.Graphics; import flash.display.InteractiveObject; import flash.display.Loader; import flash.display.Shader; import flash.display.Sprite; import flash.display.Stage; import flash.events.Event; import flash.events.EventPhase; import flash.events.FocusEvent; import flash.events.IEventDispatcher; import flash.events.KeyboardEvent; import flash.geom.ColorTransform; import flash.geom.Matrix; import flash.geom.Matrix3D; import flash.geom.PerspectiveProjection; import flash.geom.Point; import flash.geom.Rectangle; import flash.geom.Transform; import flash.geom.Vector3D; import flash.system.ApplicationDomain; import flash.system.Capabilities; import flash.text.TextFormatAlign; import flash.text.TextLineMetrics; import flash.ui.Keyboard; import flash.utils.Dictionary; import flash.utils.getQualifiedClassName; import mx.automation.IAutomationObject; import mx.binding.BindingManager; import mx.controls.IFlexContextMenu; import mx.core.LayoutDirection; import mx.effects.EffectManager; import mx.effects.IEffect; import mx.effects.IEffectInstance; import mx.events.ChildExistenceChangedEvent; import mx.events.DynamicEvent; import mx.events.EffectEvent; import mx.events.FlexEvent; import mx.events.MoveEvent; import mx.events.PropertyChangeEvent; import mx.events.ResizeEvent; import mx.events.StateChangeEvent; import mx.events.ValidationResultEvent; import mx.filters.BaseFilter; import mx.filters.IBitmapFilter; import mx.geom.RoundedRectangle; import mx.geom.Transform; import mx.geom.TransformOffsets; import mx.graphics.shaderClasses.ColorBurnShader; import mx.graphics.shaderClasses.ColorDodgeShader; import mx.graphics.shaderClasses.ColorShader; import mx.graphics.shaderClasses.ExclusionShader; import mx.graphics.shaderClasses.HueShader; import mx.graphics.shaderClasses.LuminosityShader; import mx.graphics.shaderClasses.SaturationShader; import mx.graphics.shaderClasses.SoftLightShader; import mx.managers.CursorManager; import mx.managers.ICursorManager; import mx.managers.IFocusManager; import mx.managers.IFocusManagerComponent; import mx.managers.IFocusManagerContainer; import mx.managers.ILayoutManagerClient; import mx.managers.ISystemManager; import mx.managers.IToolTipManagerClient; import mx.managers.SystemManager; import mx.managers.SystemManagerGlobals; import mx.managers.ToolTipManager; import mx.resources.IResourceManager; import mx.resources.ResourceManager; import mx.states.State; import mx.states.Transition; import mx.styles.CSSStyleDeclaration; import mx.styles.IAdvancedStyleClient; import mx.styles.ISimpleStyleClient; import mx.styles.IStyleClient; import mx.styles.IStyleManager2; import mx.styles.StyleManager; import mx.styles.StyleProtoChain; import mx.utils.ColorUtil; import mx.utils.GraphicsUtil; import mx.utils.MatrixUtil; import mx.utils.NameUtil; import mx.utils.StringUtil; import mx.utils.TransformUtil; import mx.validators.IValidatorListener; import mx.validators.ValidationResult; use namespace mx_internal; // Excluding the property to enable code hinting for the layoutDirection style [Exclude(name="layoutDirection", kind="property")] //-------------------------------------- // Lifecycle events //-------------------------------------- /** * Dispatched when the component is added to a container as a content child * by using the addChild(), addChildAt(), * addElement(), or addElementAt() method. * If the component is added to the container as a noncontent child by * using the rawChildren.addChild() or * rawChildren.addChildAt() method, the event is not dispatched. * *

This event is only dispatched when there are one or more relevant listeners * attached to the dispatching object.

* * @eventType mx.events.FlexEvent.ADD * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="add", type="mx.events.FlexEvent")] /** * Dispatched when the component has finished its construction, * property processing, measuring, layout, and drawing. * *

At this point, depending on its visible property, * the component is not visible even though it has been drawn.

* * @eventType mx.events.FlexEvent.CREATION_COMPLETE * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="creationComplete", type="mx.events.FlexEvent")] /** * Dispatched when an object has had its commitProperties(), * measure(), and * updateDisplayList() methods called (if needed). * *

This is the last opportunity to alter the component before it is * displayed. All properties have been committed and the component has * been measured and layed out.

* *

This event is only dispatched when there are one or more * relevant listeners attached to the dispatching object.

* * @eventType mx.events.FlexEvent.UPDATE_COMPLETE * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="updateComplete", type="mx.events.FlexEvent")] /** * Dispatched when an object's state changes from visible to invisible. * *

This event is only dispatched when there are one or more relevant listeners * attached to the dispatching object.

* * @eventType mx.events.FlexEvent.HIDE * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="hide", type="mx.events.FlexEvent")] /** * Dispatched when the component has finished its construction * and has all initialization properties set. * *

After the initialization phase, properties are processed, the component * is measured, laid out, and drawn, after which the * creationComplete event is dispatched.

* * @eventType mx.events.FlexEvent.INITIALIZE * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="initialize", type="mx.events.FlexEvent")] /** * Dispatched when the object has moved. * *

You can move the component by setting the x * or y properties, by calling the move() * method, by setting one * of the following properties either on the component or on other * components such that the LayoutManager needs to change the * x or y properties of the component:

* * * *

When you call the move() method, the move * event is dispatched before the method returns. * In all other situations, the move event is not dispatched * until after the property changes.

* *

This event only dispatched when there are one or more * relevant listeners attached to the dispatching object.

* * @eventType mx.events.MoveEvent.MOVE * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="move", type="mx.events.MoveEvent")] /** * Dispatched at the beginning of the component initialization sequence. * The component is in a very raw state when this event is dispatched. * Many components, such as the Button control, create internal child * components to implement functionality; for example, the Button control * creates an internal UITextField component to represent its label text. * When Flex dispatches the preinitialize event, * the children, including the internal children, of a component * have not yet been created. * * @eventType mx.events.FlexEvent.PREINITIALIZE * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="preinitialize", type="mx.events.FlexEvent")] /** * Dispatched when the component is removed from a container as a content child * by using the removeChild(), removeChildAt(), * removeElement(), or removeElementAt() method. * If the component is removed from the container as a noncontent child by * using the rawChildren.removeChild() or * rawChildren.removeChildAt() method, the event is not dispatched. * *

This event only dispatched when there are one or more relevant listeners * attached to the dispatching object.

* * @eventType mx.events.FlexEvent.REMOVE * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="remove", type="mx.events.FlexEvent")] /** * Dispatched when the component is resized. * *

You can resize the component by setting the width or * height property, by calling the setActualSize() * method, or by setting one of * the following properties either on the component or on other components * such that the LayoutManager needs to change the width or * height properties of the component:

* * * *

The resize event is not * dispatched until after the property changes.

* *

This event only dispatched when there are one or more * relevant listeners attached to the dispatching object.

* * @eventType mx.events.ResizeEvent.RESIZE * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="resize", type="mx.events.ResizeEvent")] /** * Dispatched when an object's state changes from invisible to visible. * *

This event is only dispatched when there are one or more relevant listeners * attached to the dispatching object.

* * @eventType mx.events.FlexEvent.SHOW * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="show", type="mx.events.FlexEvent")] //-------------------------------------- // Mouse events //-------------------------------------- /** * Dispatched from a component opened using the PopUpManager * when the user clicks outside it. * * @eventType mx.events.FlexMouseEvent.MOUSE_DOWN_OUTSIDE * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="mouseDownOutside", type="mx.events.FlexMouseEvent")] /** * Dispatched from a component opened using the PopUpManager * when the user scrolls the mouse wheel outside it. * * @eventType mx.events.FlexMouseEvent.MOUSE_WHEEL_OUTSIDE * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="mouseWheelOutside", type="mx.events.FlexMouseEvent")] //-------------------------------------- // Validation events //-------------------------------------- /** * Dispatched when values are changed programmatically * or by user interaction. * *

Because a programmatic change triggers this event, make sure * that any valueCommit event handler does not change * a value that causes another valueCommit event. * For example, do not change a control's dataProvider * property in a valueCommit event handler.

* * @eventType mx.events.FlexEvent.VALUE_COMMIT * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="valueCommit", type="mx.events.FlexEvent")] /** * Dispatched when a component is monitored by a Validator * and the validation failed. * * @eventType mx.events.FlexEvent.INVALID * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="invalid", type="mx.events.FlexEvent")] /** * Dispatched when a component is monitored by a Validator * and the validation succeeded. * * @eventType mx.events.FlexEvent.VALID * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="valid", type="mx.events.FlexEvent")] //-------------------------------------- // Drag-and-drop events //-------------------------------------- /** * Dispatched by a component when the user moves the mouse over the component * during a drag operation. * In an application running in Flash Player, * the event is dispatched many times when you move the mouse over any component. * In an application running in AIR, the event is dispatched only once. * *

In order to be a valid drop target, you must define a handler * for this event. * In the handler, you can change the appearance of the drop target * to provide visual feedback to the user that the component can accept * the drag. * For example, you could draw a border around the drop target, * or give focus to the drop target.

* *

If you want to accept the drag, you must call the * DragManager.acceptDragDrop() method. If you don't * call acceptDragDrop(), you do not get any of the * other drag events.

* *

In Flash Player, the value of the action property is always * DragManager.MOVE, even if you are doing a copy. * This is because the dragEnter event occurs before * the control recognizes that the Control key is pressed to signal a copy. * The action property of the event object for the * dragOver event does contain a value that signifies the type of * drag operation. You can change the type of drag action by calling the * DragManager.showFeedback() method.

* *

In AIR, the default value of the action property is * DragManager.COPY.

* *

Because of the way data to a Tree control is structured, * the Tree control handles drag and drop differently from the other list-based controls. * For the Tree control, the event handler for the dragDrop event * only performs an action when you move or copy data in the same Tree control, * or copy data to another Tree control. * If you drag data from one Tree control and drop it onto another Tree control * to move the data, the event handler for the dragComplete event * actually performs the work to add the data to the destination Tree control, * rather than the event handler for the dragDrop event, * and also removes the data from the source Tree control. * This is necessary because to reparent the data being moved, * Flex must remove it first from the source Tree control.

* * @see mx.managers.DragManager * * @eventType mx.events.DragEvent.DRAG_ENTER * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="dragEnter", type="mx.events.DragEvent")] /** * Dispatched by a component when the user moves the mouse while over the component * during a drag operation. * In Flash Player, the event is dispatched * when you drag an item over a valid drop target. * In AIR, the event is dispatched when you drag an item over * any component, even if the component is not a valid drop target. * *

In the handler, you can change the appearance of the drop target * to provide visual feedback to the user that the component can accept * the drag. * For example, you could draw a border around the drop target, * or give focus to the drop target.

* *

Handle this event to perform additional logic * before allowing the drop, such as dropping data to various locations * in the drop target, reading keyboard input to determine if the * drag-and-drop action is a move or copy of the drag data, or providing * different types of visual feedback based on the type of drag-and-drop * action.

* *

You can also change the type of drag action by changing the * DragManager.showFeedback() method. * The default value of the action property is * DragManager.MOVE.

* * @see mx.managers.DragManager * * @eventType mx.events.DragEvent.DRAG_OVER * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="dragOver", type="mx.events.DragEvent")] /** * Dispatched by the component when the user drags outside the component, * but does not drop the data onto the target. * *

You use this event to restore the drop target to its normal appearance * if you modified its appearance as part of handling the * dragEnter or dragOver event.

* * @eventType mx.events.DragEvent.DRAG_EXIT * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="dragExit", type="mx.events.DragEvent")] /** * Dispatched by the drop target when the user releases the mouse over it. * *

You use this event handler to add the drag data to the drop target.

* *

If you call Event.preventDefault() in the event handler * for the dragDrop event for * a Tree control when dragging data from one Tree control to another, * it prevents the drop.

* * @eventType mx.events.DragEvent.DRAG_DROP * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="dragDrop", type="mx.events.DragEvent")] /** * Dispatched by the drag initiator (the component that is the source * of the data being dragged) when the drag operation completes, * either when you drop the dragged data onto a drop target or when you end * the drag-and-drop operation without performing a drop. * *

You can use this event to perform any final cleanup * of the drag-and-drop operation. * For example, if you drag a List control item from one list to another, * you can delete the List control item from the source if you no longer * need it.

* *

If you call Event.preventDefault() in the event handler * for the dragComplete event for * a Tree control when dragging data from one Tree control to another, * it prevents the drop.

* * @eventType mx.events.DragEvent.DRAG_COMPLETE * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="dragComplete", type="mx.events.DragEvent")] /** * Dispatched by the drag initiator when starting a drag operation. * This event is used internally by the list-based controls; * you do not handle it when implementing drag and drop. * If you want to control the start of a drag-and-drop operation, * use the mouseDown or mouseMove event. * * @eventType mx.events.DragEvent.DRAG_START * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="dragStart", type="mx.events.DragEvent")] //-------------------------------------- // Effect events //-------------------------------------- /** * Dispatched just before an effect starts. * *

The effect does not start changing any visuals * until after this event is fired.

* * @eventType mx.events.EffectEvent.EFFECT_START * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="effectStart", type="mx.events.EffectEvent")] /** * Dispatched after an effect is stopped, which happens * only by a call to stop() on the effect. * *

The effect then dispatches the EFFECT_END event * as the effect finishes. The purpose of the EFFECT_STOP * event is to let listeners know that the effect came to * a premature end, rather than ending naturally or as a * result of a call to end().

* * @eventType mx.events.EffectEvent.EFFECT_STOP * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="effectStop", type="mx.events.EffectEvent")] /** * Dispatched after an effect ends. * *

The effect makes the last set of visual changes * before this event is fired, but those changes are not * rendered on the screen. * Thus, you might have to use the callLater() method * to delay any other changes that you want to make until after the * changes have been rendered onscreen.

* * @eventType mx.events.EffectEvent.EFFECT_END * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="effectEnd", type="mx.events.EffectEvent")] //-------------------------------------- // State events //-------------------------------------- /** * Dispatched after the currentState property changes, * but before the view state changes. * *

This event is only dispatched when there are one or more * relevant listeners attached to the dispatching object.

* * @eventType mx.events.StateChangeEvent.CURRENT_STATE_CHANGING * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="currentStateChanging", type="mx.events.StateChangeEvent")] /** * Dispatched after the view state has changed. * *

This event is only dispatched when there are one or more * relevant listeners attached to the dispatching object.

* * @eventType mx.events.StateChangeEvent.CURRENT_STATE_CHANGE * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="currentStateChange", type="mx.events.StateChangeEvent")] /** * Dispatched after the component has entered a view state. * *

This event is only dispatched when there are one or more * relevant listeners attached to the dispatching object.

* * @eventType mx.events.FlexEvent.ENTER_STATE * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="enterState", type="mx.events.FlexEvent")] /** * Dispatched just before the component exits a view state. * *

This event is only dispatched when there are one or more * relevant listeners attached to the dispatching object.

* * @eventType mx.events.FlexEvent.EXIT_STATE * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="exitState", type="mx.events.FlexEvent")] /** * Dispatched after the component has entered a new state and * any state transition animation to that state has finished playing. * * The event is dispatched immediately if there's no transition playing * between the states. * * If the component switches to a different state while the transition is * underway, this event will be dispatched after the component completes the * transition to that new state. * *

This event is only dispatched when there are one or more * relevant listeners attached to the dispatching object.

* * @eventType mx.events.FlexEvent.STATE_CHANGE_COMPLETE * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 2.5 * @productversion Flex 4.5 */ [Event(name="stateChangeComplete", type="mx.events.FlexEvent")] /** * Dispatched when a component interrupts a transition to its current * state in order to switch to a new state. * *

This event is only dispatched when there are one or more * relevant listeners attached to the dispatching object.

* * @eventType mx.events.FlexEvent.STATE_CHANGE_INTERRUPTED * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 2.5 * @productversion Flex 4.5 */ [Event(name="stateChangeInterrupted", type="mx.events.FlexEvent")] //-------------------------------------- // TouchInteraction events //-------------------------------------- /** * A cancellable event, dispatched by a component in an attempt to * respond to a touch interaction user gesture. * *

The event is a bubbling event dispatched on the * DisplayObject that the touch interaction * started (where the mouseDown/touchBegin occurred).

* *

Components responding to touch interactions should listen for * touch interaction events to coordinate with other components around * what type of touch interaction the user intended to make and which component * is responding to that touch interaction.

* *

A Scroller component will dispatch a touchInteractionStarting event * to alert other components that may be responding to the same user's * touch interaction that it would like to take control of this touch interaction. * This is an opportunity for other components to cancel the Scroller's * action and to maintain control over this touch interaction.

* * @eventType mx.events.TouchInteractionEvent.TOUCH_INTERACTION_STARTING * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 2.5 * @productversion Flex 4.5 */ [Event(name="touchInteractionStarting", type="mx.events.TouchInteractionEvent")] /** * A non-cancellable event, dispatched by a component when it starts * responding to a touch interaction user gesture. * *

The event is a bubbling event dispatched on the * DisplayObject that the touch interaction * started (where the mouseDown/touchBegin occurred).

* *

Components responding to touch interactions should listen for * touch interaction events to coordinate with other components around * what type of touch interaction the user intended to make and which component * is responding to that touch interaction.

* *

A Scroller component will dispatch a touchInteractionStart event * to alert other components that may be responding to the same user's * touch interaction that it is taking control of this touch interaction. * When they see this event, other components should stop responding * to the touch interaction, remove any visual indications that it is * responding to the touch interaction, and perform other clean up.

* * @eventType mx.events.TouchInteractionEvent.TOUCH_INTERACTION_START * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 2.5 * @productversion Flex 4.5 */ [Event(name="touchInteractionStart", type="mx.events.TouchInteractionEvent")] /** * A non-cancellable event, dispatched by a component when it is done * responding to a touch interaction user gesture. * *

The event is a bubbling event dispatched on the * DisplayObject that the touch interaction * started (where the mouseDown/touchBegin occurred).

* *

Components responding to touch interactions should listen for * touch interaction events to coordinate with other components around * what type of touch interaction the user intended to make and which component * is responding to that touch interaction.

* *

A Scroller component will dispatch a touchInteractionEnd event * to alert other components that it is done responding to the user's * touch interaction.

* * @eventType mx.events.TouchInteractionEvent.TOUCH_INTERACTION_END * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 2.5 * @productversion Flex 4.5 */ [Event(name="touchInteractionEnd", type="mx.events.TouchInteractionEvent")] //-------------------------------------- // Tooltip events //-------------------------------------- /** * Dispatched by the component when it is time to create a ToolTip. * *

If you create your own IToolTip object and place a reference * to it in the toolTip property of the event object * that is passed to your toolTipCreate handler, * the ToolTipManager displays your custom ToolTip. * Otherwise, the ToolTipManager creates an instance of * ToolTipManager.toolTipClass to display.

* *

The sequence of ToolTip events is toolTipStart, * toolTipCreate, toolTipShow, * toolTipShown, toolTipHide, * and toolTipEnd.

* * @eventType mx.events.ToolTipEvent.TOOL_TIP_CREATE * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="toolTipCreate", type="mx.events.ToolTipEvent")] /** * Dispatched by the component when its ToolTip has been hidden * and is to be discarded soon. * *

If you specify an effect using the * ToolTipManager.hideEffect property, * this event is dispatched after the effect stops playing.

* *

The sequence of ToolTip events is toolTipStart, * toolTipCreate, toolTipShow, * toolTipShown, toolTipHide, * and toolTipEnd.

* * @eventType mx.events.ToolTipEvent.TOOL_TIP_END * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="toolTipEnd", type="mx.events.ToolTipEvent")] /** * Dispatched by the component when its ToolTip is about to be hidden. * *

If you specify an effect using the * ToolTipManager.hideEffect property, * this event is dispatched before the effect starts playing.

* *

The sequence of ToolTip events is toolTipStart, * toolTipCreate, toolTipShow, * toolTipShown, toolTipHide, * and toolTipEnd.

* * @eventType mx.events.ToolTipEvent.TOOL_TIP_HIDE * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="toolTipHide", type="mx.events.ToolTipEvent")] /** * Dispatched by the component when its ToolTip is about to be shown. * *

If you specify an effect using the * ToolTipManager.showEffect property, * this event is dispatched before the effect starts playing. * You can use this event to modify the ToolTip before it appears.

* *

The sequence of ToolTip events is toolTipStart, * toolTipCreate, toolTipShow, * toolTipShown, toolTipHide, * and toolTipEnd.

* * @eventType mx.events.ToolTipEvent.TOOL_TIP_SHOW * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="toolTipShow", type="mx.events.ToolTipEvent")] /** * Dispatched by the component when its ToolTip has been shown. * *

If you specify an effect using the * ToolTipManager.showEffect property, * this event is dispatched after the effect stops playing.

* *

The sequence of ToolTip events is toolTipStart, * toolTipCreate, toolTipShow, * toolTipShown, toolTipHide, * and toolTipEnd.

* * @eventType mx.events.ToolTipEvent.TOOL_TIP_SHOWN * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="toolTipShown", type="mx.events.ToolTipEvent")] /** * Dispatched by a component whose toolTip property is set, * as soon as the user moves the mouse over it. * *

The sequence of ToolTip events is toolTipStart, * toolTipCreate, toolTipShow, * toolTipShown, toolTipHide, * and toolTipEnd.

* * @eventType mx.events.ToolTipEvent.TOOL_TIP_START * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="toolTipStart", type="mx.events.ToolTipEvent")] //-------------------------------------- // Styles //-------------------------------------- include "../styles/metadata/AnchorStyles.as"; /** * The main color for a component. * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 1.5 * @productversion Flex 4 */ [Style(name="chromeColor", type="uint", format="Color", inherit="yes", theme="spark")] /** * Color of the component highlight when validation fails. * Flex also sets the borderColor style of the component to this * errorColor on a validation failure. * * The default value for the Halo theme is 0xFF0000. * The default value for the Spark theme is 0xFE0000. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Style(name="errorColor", type="uint", format="Color", inherit="yes")] /** * The primary interaction mode for this component. The acceptable values are: * mouse and touch. * * The default value for the Halo theme is mouse. * The default value for the Spark theme is mouse. * The default value for the Mobile theme is touch. * * @see mx.core.InteractionMode#MOUSE * @see mx.core.InteractionMode#TOUCH * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 2.5 * @productversion Flex 4.5 */ [Style(name="interactionMode", type="String", enumeration="mouse,touch", inherit="yes")] /** * Blend mode used by the focus rectangle. * For more information, see the blendMode property * of the flash.display.DisplayObject class. * * @default "normal" * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Style(name="focusBlendMode", type="String", inherit="no")] /** * Skin used to draw the focus rectangle. * * The default value for Halo components is mx.skins.halo.HaloFocusRect. * The default value for Spark components is spark.skins.spark.FocusSkin. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Style(name="focusSkin", type="Class", inherit="no")] /** * Thickness, in pixels, of the focus rectangle outline. * * @default 2 * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Style(name="focusThickness", type="Number", format="Length", inherit="no", minValue="0.0")] /** * Specifies the desired layout direction of a component. The allowed values * are "ltr" for left-to-right layout, used for * components using Latin-style scripts, and "rtl" for * right-to-left layout, used for components using scripts such * as Arabic and Hebrew. * *

In ActionScript you can set the layoutDirection using the values * mx.core.LayoutDirection.LTR, * mx.core.LayoutDirection.RTL or * undefined, to inherit the layoutDirection from the parent.

* *

The layoutDirection should typically be set on the * Application rather than on individual components. If the * layoutDirection is "rtl", most visual elements, except text * and images, will be mirrored. The directionality of text is determined * by the direction style.

* *

Components which handle Keyboard.LEFT and Keyboard.RIGHT events * typically swap the key’s meaning when layoutDirection is * “rtl”. In other words, left always means move left and * right always means move right, regardless of the * layoutDirection

* *

Note: This style applies to all Spark components and MX components that * specify UIFTETextField as their textFieldClass.

* * @default "ltr" * * @see MXFTEText.css * @see mx.core.ILayoutDirectionElement * @see mx.core.LayoutDirection * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 1.5 * @productversion Flex 4.1 */ [Style(name="layoutDirection", type="String", enumeration="ltr,rtl", inherit="yes")] /** * Show the error border or skin when this component is invalid * * @default true * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 1.5 * @productversion Flex 4.5 */ [Style(name="showErrorSkin", type="Boolean", inherit="yes")] /** * Show the error tip when this component is invalid and the user * rolls over it * * @default true * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 1.5 * @productversion Flex 4.5 */ [Style(name="showErrorTip", type="Boolean", inherit="yes")] /** * Theme color of a component. This property controls the appearance of highlights, * appearance when a component is selected, and other similar visual cues, but it * does not have any effect on the regular borders or background colors of the component. * The preferred values are haloGreen, haloBlue, * haloOrange, and haloSilver, although any valid color * value can be used. * *

The default values of the rollOverColor and * selectionColor styles are based on the * themeColor value.

* * @default "haloBlue" * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Style(name="themeColor", type="uint", format="Color", inherit="yes", theme="halo")] //-------------------------------------- // Effects //-------------------------------------- /** * Played when the component is created. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Effect(name="creationCompleteEffect", event="creationComplete")] /** * Played when the component is moved. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Effect(name="moveEffect", event="move")] /** * Played when the component is resized. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Effect(name="resizeEffect", event="resize")] /** * Played when the component becomes visible. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Effect(name="showEffect", event="show")] /** * Played when the component becomes invisible. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Effect(name="hideEffect", event="hide")] /** * Played when the user presses the mouse button while over the component. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Effect(name="mouseDownEffect", event="mouseDown")] /** * Played when the user releases the mouse button while over the component. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Effect(name="mouseUpEffect", event="mouseUp")] /** * Played when the user rolls the mouse over the component. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Effect(name="rollOverEffect", event="rollOver")] /** * Played when the user rolls the mouse so it is no longer over the component. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Effect(name="rollOutEffect", event="rollOut")] /** * Played when the component gains keyboard focus. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Effect(name="focusInEffect", event="focusIn")] /** * Played when the component loses keyboard focus. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Effect(name="focusOutEffect", event="focusOut")] /** * Played when the component is added as a child to a Container. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Effect(name="addedEffect", event="added")] /** * Played when the component is removed from a Container. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Effect(name="removedEffect", event="removed")] //-------------------------------------- // Other metadata //-------------------------------------- [AccessibilityClass(implementation="mx.accessibility.UIComponentAccProps")] [ResourceBundle("core")] // skins resources aren't found because CSS visited by the compiler [ResourceBundle("skins")] /** * The UIComponent class is the base class for all visual components, * both interactive and noninteractive. * *

An interactive component can participate in tabbing and other kinds of * keyboard focus manipulation, accept low-level events like keyboard and * mouse input, and be disabled so that it does not receive keyboard and * mouse input. * This is in contrast to noninteractive components, like Label and * ProgressBar, which simply display contents and are not manipulated by * the user.

*

The UIComponent class is not used as an MXML tag, but is used as a base * class for other classes.

* * @mxml * *

All user interface components in Flex extend the UIComponent class. * Flex components inherit the following properties from the UIComponent * class:

* *
 *  <mx:tagname
 *   Properties 
 *    accessibilityDescription="null"
 *    accessibilityName="null"
 *    accessibilityShortcut="null"
 *    accessibilitySilent="true|false"
 *    automationName="null"
 *    cachePolicy="auto|on|off"
 *    currentState="null"
 *    doubleClickEnabled="false|true"
 *    enabled="true|false"
 *    explicitHeight="NaN"
 *    explicitMaxHeight="NaN"
 *    explicitMaxWidth="NaN"
 *    explicitMinHeight="NaN"
 *    explicitMinWidth="NaN"
 *    explicitWidth="NaN"
 *    focusEnabled="true|false"
 *    hasFocusableChildren="false|true"
 *    height="0"
 *    id=""
 *    includeInLayout="true|false"
 *    maxHeight="10000"
 *    maxWidth="10000"
 *    measuredHeight=
 *    measuredMinHeight=
 *    measuredMinWidth=
 *    measuredWidth=
 *    minHeight="0"
 *    minWidth="0"
 *    mouseFocusEnabled="true|false"
 *    percentHeight="NaN"
 *    percentWidth="NaN"
 *    scaleX="1.0"
 *    scaleY="1.0"
 *    states="null"
 *    styleName="undefined"
 *    toolTip="null"
 *    transitions=""
 *    validationSubField
 *    width="0"
 *    x="0"
 *    y="0"
 *
 *  Styles
 *    bottom="undefined"
 *    errorColor="0xFF0000"
 *    focusBlendMode="normal"
 *    focusSkin="HaloFocusRect""
 *    focusThickness="2"
 *    horizontalCenter="undefined"
 *    layoutDirection="ltr"
 *    left="undefined"
 *    right="undefined"
 *    themeColor="haloGreen"
 *    top="undefined"
 *    verticalCenter="undefined"
 *
 *  Effects
 *    addedEffect="No default"
 *    creationCompleteEffect="No default"
  *   focusInEffect="No default"
 *    focusOutEffect="No default"
 *    hideEffect="No default"
 *    mouseDownEffect="No default"
 *    mouseUpEffect="No default"
 *    moveEffect="No default"
 *    removedEffect="No default"
 *    resizeEffect="No default"
 *    rollOutEffect="No default"
 *    rollOverEffect="No default"
 *    showEffect="No default"
 *
 *  Events
 *    add="No default"
 *    creationComplete="No default"
 *    currentStateChange="No default"
 *    currentStateChanging="No default"
 *    dragComplete="No default"
 *    dragDrop="No default"
 *    dragEnter="No default"
 *    dragExit="No default"
 *    dragOver="No default"
 *    effectEnd="No default"
 *    effectStart="No default"
 *    enterState="No default"
 *    exitState="No default"
 *    hide="No default"
 *    initialize="No default"
 *    invalid="No default"
 *    mouseDownOutside="No default"
 *    mouseWheelOutside="No default"
 *    move="No default"
 *    preinitialize="No default"
 *    remove="No default"
 *    resize="No default"
 *    show="No default"
 *    toolTipCreate="No default"
 *    toolTipEnd="No default"
 *    toolTipHide="No default"
 *    toolTipShow="No default"
 *    toolTipShown="No default"
 *    toolTipStart="No default"
 *    updateComplete="No default"
 *    valid="No default"
 *    valueCommit="No default"
 *  >
 *  
* * @see mx.core.UIComponent * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public class UIComponent extends FlexSprite implements IAutomationObject, IChildList, IConstraintClient, IDeferredInstantiationUIComponent, IFlexDisplayObject, IFlexModule, IInvalidating, ILayoutManagerClient, IPropertyChangeNotifier, IRepeaterClient, IStateClient, IAdvancedStyleClient, IToolTipManagerClient, IUIComponent, IValidatorListener, IVisualElement { include "../core/Version.as"; //-------------------------------------------------------------------------- // // Class constants // //-------------------------------------------------------------------------- /** * The default value for the measuredWidth property. * Most components calculate a measuredWidth but some are flow-based and * have to pick a number that looks reasonable. * * @default 160 * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public static const DEFAULT_MEASURED_WIDTH:Number = 160; /** * The default value for the measuredMinWidth property. * Most components calculate a measuredMinWidth but some are flow-based and * have to pick a number that looks reasonable. * * @default 40 * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public static const DEFAULT_MEASURED_MIN_WIDTH:Number = 40; /** * The default value for the measuredHeight property. * Most components calculate a measuredHeight but some are flow-based and * have to pick a number that looks reasonable. * * @default 22 * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public static const DEFAULT_MEASURED_HEIGHT:Number = 22; /** * The default value for the measuredMinHeight property. * Most components calculate a measuredMinHeight but some are flow-based and * have to pick a number that looks reasonable. * * @default 22 * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public static const DEFAULT_MEASURED_MIN_HEIGHT:Number = 22; /** * The default value for the maxWidth property. * * @default 10000 * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public static const DEFAULT_MAX_WIDTH:Number = 10000; // When changing this constant, make sure you change // the constant with the same name in LayoutElementUIComponentUtils /** * The default value for the maxHeight property. * * @default 10000 * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public static const DEFAULT_MAX_HEIGHT:Number = 10000; // When changing this constant, make sure you change // the constant with the same name in LayoutElementUIComponentUtils /** * @private * Static constant representing no cached layout direction style value. */ private static const LAYOUT_DIRECTION_CACHE_UNSET:String = "layoutDirectionCacheUnset"; //-------------------------------------------------------------------------- // // Class mixins // //-------------------------------------------------------------------------- /** * @private * Placeholder for mixin by UIComponentAccProps. */ mx_internal static var createAccessibilityImplementation:Function; //-------------------------------------------------------------------------- // // Class properties // //-------------------------------------------------------------------------- //---------------------------------- // embeddedFontRegistry //---------------------------------- private static var noEmbeddedFonts:Boolean; /** * @private * Storage for the _embeddedFontRegistry property. * Note: This gets initialized on first access, * not when this class is initialized, in order to ensure * that the Singleton registry has already been initialized. */ private static var _embeddedFontRegistry:IEmbeddedFontRegistry; /** * @private * A reference to the embedded font registry. * Single registry in the system. * Used to look up the moduleFactory of a font. */ mx_internal static function get embeddedFontRegistry():IEmbeddedFontRegistry { if (!_embeddedFontRegistry && !noEmbeddedFonts) { try { _embeddedFontRegistry = IEmbeddedFontRegistry( Singleton.getInstance("mx.core::IEmbeddedFontRegistry")); } catch (e:Error) { noEmbeddedFonts = true; } } return _embeddedFontRegistry; } //-------------------------------------------------------------------------- // // Class methods // //-------------------------------------------------------------------------- /** * Blocks the background processing of methods * queued by callLater(), * until resumeBackgroundProcessing() is called. * *

These methods can be useful when you have time-critical code * which needs to execute without interruption. * For example, when you set the suspendBackgroundProcessing * property of an Effect to true, * suspendBackgroundProcessing() is automatically called * when it starts playing, and resumeBackgroundProcessing * is called when it stops, in order to ensure that the animation * is smooth.

* *

Since the LayoutManager uses callLater(), * this means that commitProperties(), * measure(), and updateDisplayList() * is not called in between calls to * suspendBackgroundProcessing() and * resumeBackgroundProcessing().

* *

It is safe for both an outer method and an inner method * (i.e., one that the outer methods calls) to call * suspendBackgroundProcessing() * and resumeBackgroundProcessing(), because these * methods actually increment and decrement a counter * which determines whether background processing occurs.

* * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public static function suspendBackgroundProcessing():void { UIComponentGlobals.callLaterSuspendCount++; } /** * Resumes the background processing of methods * queued by callLater(), after a call to * suspendBackgroundProcessing(). * *

Refer to the description of * suspendBackgroundProcessing() for more information.

* * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public static function resumeBackgroundProcessing():void { if (UIComponentGlobals.callLaterSuspendCount > 0) { UIComponentGlobals.callLaterSuspendCount--; // Once the suspend count gets back to 0, we need to // force a render event to happen if (UIComponentGlobals.callLaterSuspendCount == 0) { var sm:ISystemManager = SystemManagerGlobals.topLevelSystemManagers[0]; if (sm && sm.stage) sm.stage.invalidate(); } } } //-------------------------------------------------------------------------- // // Constructor // //-------------------------------------------------------------------------- /** * Constructor. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function UIComponent() { super(); // Override variables in superclasses. focusRect = false; // We do our own focus drawing. // We are tab enabled by default if IFocusManagerComponent tabEnabled = (this is IFocusManagerComponent); tabFocusEnabled = (this is IFocusManagerComponent); // Whether the component can accept user interaction. // The default is true. If you set enabled to false for a container, // Flex dims the color of the container and of all of its children, // and blocks user input to the container and to all of its children. // We set enabled to true here because some components keep their // own _enabled flag and may not initialize it to true. enabled = true; // Make the component invisible until the initialization sequence // is complete. // It will be set visible when the 'initialized' flag is set. $visible = false; addEventListener(Event.ADDED, addedHandler); addEventListener(Event.REMOVED, removedHandler); addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler); // Register for focus and keyboard events. 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(); // Register as a weak listener for "change" events from ResourceManager. // If UIComponents registered as a strong listener, // they wouldn't get garbage collected. resourceManager.addEventListener( Event.CHANGE, resourceManager_changeHandler, false, 0, true); _width = super.width; _height = super.height; } //-------------------------------------------------------------------------- // // Variables // //-------------------------------------------------------------------------- /** * @private * Temporarily stores the values of styles specified with setStyle() until * moduleFactory is set. */ private var deferredSetStyles:Object; /** * @private * There is a bug (139381) where we occasionally get callLaterDispatcher() * even though we didn't expect it. * That causes us to do a removeEventListener() twice, * which messes up some internal thing in the player so that * the next addEventListener() doesn't actually get us the render event. */ private var listeningForRender:Boolean = false; /** * @private * List of methods used by callLater(). */ private var methodQueue:Array /* of MethodQueueElement */ = []; /** * @private * Whether or not we "own" the focus graphic */ private var hasFocusRect:Boolean = false; /** * @private * These variables cache the transition state from/to information for * the transition currently running. This information is used when * determining what to do with a new transition that interrupts the * running transition. */ private var transitionFromState:String; private var transitionToState:String; /** * @private */ private var parentChangedFlag:Boolean = false; /** * @private * Cached layout direction style */ private var layoutDirectionCachedValue:String = LAYOUT_DIRECTION_CACHE_UNSET; //-------------------------------------------------------------------------- // // Variables: Creation // //-------------------------------------------------------------------------- //---------------------------------- // initialized //---------------------------------- /** * @private * Storage for the initialized property. */ private var _initialized:Boolean = false; [Inspectable(environment="none")] /** * A flag that determines if an object has been through all three phases * of layout: commitment, measurement, and layout (provided that any were required). * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function get initialized():Boolean { return _initialized; } /** * @private */ public function set initialized(value:Boolean):void { _initialized = value; if (value) { setVisible(_visible, true); dispatchEvent(new FlexEvent(FlexEvent.CREATION_COMPLETE)); } } //---------------------------------- // processedDescriptors //---------------------------------- /** * @private * Storage for the processedDescriptors property. */ private var _processedDescriptors:Boolean = false; [Inspectable(environment="none")] /** * Set to true after immediate or deferred child creation, * depending on which one happens. For a Container object, it is set * to true at the end of * the createComponentsFromDescriptors() method, * meaning after the Container object creates its children from its child descriptors. * *

For example, if an Accordion container uses deferred instantiation, * the processedDescriptors property for the second pane of * the Accordion container does not become true until after * the user navigates to that pane and the pane creates its children. * But, if the Accordion had set the creationPolicy property * to "all", the processedDescriptors property * for its second pane is set to true during application startup.

* *

For classes that are not containers, which do not have descriptors, * it is set to true after the createChildren() * method creates any internal component children.

* * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function get processedDescriptors():Boolean { return _processedDescriptors; } /** * @private */ public function set processedDescriptors(value:Boolean):void { _processedDescriptors = value; if (value) dispatchEvent(new FlexEvent(FlexEvent.INITIALIZE)); } //---------------------------------- // updateCompletePendingFlag //---------------------------------- /** * @private * Storage for the updateCompletePendingFlag property. */ private var _updateCompletePendingFlag:Boolean = false; [Inspectable(environment="none")] /** * A flag that determines if an object has been through all three phases * of layout validation (provided that any were required). * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function get updateCompletePendingFlag():Boolean { return _updateCompletePendingFlag; } /** * @private */ public function set updateCompletePendingFlag(value:Boolean):void { _updateCompletePendingFlag = value; } //------------------------------------------------------------------------ // // Properties: Accessibility // //------------------------------------------------------------------------ /** * A convenience accessor for the silent property * in this UIComponent's accessibilityProperties object. * *

Note that accessibilityEnabled has the opposite sense from silent; * accessibilityEnabled is true * when silent is false.

* *

The getter simply returns accessibilityProperties.silent, * or true if accessibilityProperties is null. * The setter first checks whether accessibilityProperties is null, * and if it is, sets it to a new AccessibilityProperties instance. * Then it sets accessibilityProperties.silent.

* * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function get accessibilityEnabled():Boolean { return accessibilityProperties ? !accessibilityProperties.silent : true; } public function set accessibilityEnabled(value:Boolean):void { if (!Capabilities.hasAccessibility) return; if (!accessibilityProperties) accessibilityProperties = new AccessibilityProperties(); accessibilityProperties.silent = !value; Accessibility.updateProperties(); } /** * A convenience accessor for the name property * in this UIComponent's accessibilityProperties object. * *

The getter simply returns accessibilityProperties.name, * or "" if accessibilityProperties is null. * The setter first checks whether accessibilityProperties is null, * and if it is, sets it to a new AccessibilityProperties instance. * Then it sets accessibilityProperties.name.

* * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function get accessibilityName():String { return accessibilityProperties ? accessibilityProperties.name : ""; } public function set accessibilityName(value:String):void { if (!Capabilities.hasAccessibility) return; if (!accessibilityProperties) accessibilityProperties = new AccessibilityProperties(); accessibilityProperties.name = value; Accessibility.updateProperties(); } /** * A convenience accessor for the description property * in this UIComponent's accessibilityProperties object. * *

The getter simply returns accessibilityProperties.description, * or "" if accessibilityProperties is null. * The setter first checks whether accessibilityProperties is null, * and if it is, sets it to a new AccessibilityProperties instance. * Then it sets accessibilityProperties.description.

* * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function get accessibilityDescription():String { return accessibilityProperties ? accessibilityProperties.description : ""; } public function set accessibilityDescription(value:String):void { if (!Capabilities.hasAccessibility) return; if (!accessibilityProperties) accessibilityProperties = new AccessibilityProperties(); accessibilityProperties.description = value; Accessibility.updateProperties(); } /** * A convenience accessor for the shortcut property * in this UIComponent's accessibilityProperties object. * *

The getter simply returns accessibilityProperties.shortcut, * or "" if accessibilityProperties is null. * The setter first checks whether accessibilityProperties is null, * and if it is, sets it to a new AccessibilityProperties instance. * Then it sets accessibilityProperties.shortcut.

* * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function get accessibilityShortcut():String { return accessibilityProperties ? accessibilityProperties.shortcut : ""; } public function set accessibilityShortcut(value:String):void { if (!Capabilities.hasAccessibility) return; if (!accessibilityProperties) accessibilityProperties = new AccessibilityProperties(); accessibilityProperties.shortcut = value; Accessibility.updateProperties(); } //-------------------------------------------------------------------------- // // Variables: Invalidation // //-------------------------------------------------------------------------- /** * @private * Whether this component needs to have its * commitProperties() method called. */ mx_internal var invalidatePropertiesFlag:Boolean = false; /** * @private * Whether this component needs to have its * measure() method called. */ mx_internal var invalidateSizeFlag:Boolean = false; /** * @private * Whether this component needs to be have its * updateDisplayList() method called. */ mx_internal var invalidateDisplayListFlag:Boolean = false; /** * @private * Whether setActualSize() has been called on this component * at least once. This is used in validateBaselinePosition() * to resize the component to explicit or measured * size if baselinePosition getter is called before the * component has been resized by the layout. */ mx_internal var setActualSizeCalled:Boolean = false; //-------------------------------------------------------------------------- // // Variables: Measurement // //-------------------------------------------------------------------------- /** * @private * Holds the last recorded value of the x property. * Used in dispatching a MoveEvent. */ private var oldX:Number = 0; /** * @private * Holds the last recorded value of the y property. * Used in dispatching a MoveEvent. */ private var oldY:Number = 0; /** * @private * Holds the last recorded value of the width property. * Used in dispatching a ResizeEvent. */ private var oldWidth:Number = 0; /** * @private * Holds the last recorded value of the height property. * Used in dispatching a ResizeEvent. */ private var oldHeight:Number = 0; /** * @private * Holds the last recorded value of the minWidth property. */ private var oldMinWidth:Number; /** * @private * Holds the last recorded value of the minHeight property. */ private var oldMinHeight:Number; /** * @private * Holds the last recorded value of the explicitWidth property. */ private var oldExplicitWidth:Number; /** * @private * Holds the last recorded value of the explicitHeight property. */ private var oldExplicitHeight:Number; /** * @private * Holds the last recorded value of the scaleX property. */ private var oldScaleX:Number = 1.0; /** * @private * Holds the last recorded value of the scaleY property. */ private var oldScaleY:Number = 1.0; /** * @private * True if createInFontContext has been called. */ private var hasFontContextBeenSaved:Boolean = false; /** * @private * Holds the last recorded value of the module factory used to create the font. */ private var oldEmbeddedFontContext:IFlexModuleFactory = null; /** * @private * * storage for advanced layout and transform properties. */ mx_internal var _layoutFeatures:AdvancedLayoutFeatures; /** * @private * * storage for the modified Transform object that can dispatch change events correctly. */ private var _transform:flash.geom.Transform; //-------------------------------------------------------------------------- // // Variables: Styles // //-------------------------------------------------------------------------- /** * @private */ private var cachedTextFormat:UITextFormat; //-------------------------------------------------------------------------- // // Variables: Effects // //-------------------------------------------------------------------------- /** * @private * Sprite used to display an overlay. */ mx_internal var effectOverlay:UIComponent; /** * @private * Color used for overlay. */ mx_internal var effectOverlayColor:uint; /** * @private * Counter to keep track of the number of current users * of the overlay. */ mx_internal var effectOverlayReferenceCount:int = 0; //-------------------------------------------------------------------------- // // Variables: Validation // //-------------------------------------------------------------------------- /** * @private */ mx_internal var saveBorderColor:Boolean = true; /** * @private */ mx_internal var origBorderColor:Number; //-------------------------------------------------------------------------- // // Variables: Other // //-------------------------------------------------------------------------- /** * @private * Storage for automatically-created RadioButtonGroups. * If a RadioButton's groupName isn't the id of a RadioButtonGroup tag, * we automatically create a RadioButtonGroup and store it here as * document.automaticRadioButtonGroups[groupName] = theRadioButtonGroup; */ mx_internal var automaticRadioButtonGroups:Object; private var _usingBridge:int = -1; /** * @private */ private function get usingBridge():Boolean { if (_usingBridge == 0) return false; if (_usingBridge == 1) return true; if (!_systemManager) return false; // no types so no dependencies var mp:Object = _systemManager.getImplementation("mx.managers::IMarshalSystemManager"); if (!mp) { _usingBridge = 0; return false; } if (mp.useSWFBridge()) { _usingBridge = 1; return true; } _usingBridge = 0; return false; } //-------------------------------------------------------------------------- // // Overridden properties // //-------------------------------------------------------------------------- //---------------------------------- // owner //---------------------------------- /** * @private */ mx_internal var _owner:DisplayObjectContainer; /** * @copy mx.core.IVisualElement#owner * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function get owner():DisplayObjectContainer { return _owner ? _owner : parent; } public function set owner(value:DisplayObjectContainer):void { _owner = value; } //---------------------------------- // parent //---------------------------------- /** * @private * Reference to this component's virtual parent container. * "Virtual" means that this parent may not be the same * as the one that the Player returns as the 'parent' * property of a DisplayObject. * For example, if a Container has created a contentPane * to improve scrolling performance, * then its "children" are really its grandchildren * and their "parent" is actually their grandparent, * because we don't want developers to be concerned with * whether a contentPane exists or not. */ mx_internal var _parent:DisplayObjectContainer; /** * @copy mx.core.IVisualElement#parent * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ override public function get parent():DisplayObjectContainer { // Flash PlaceObject tags can have super.parent set // before we get to setting the _parent property. try { return _parent ? _parent : super.parent; } catch (e:SecurityError) { // trace("UIComponent.get parent(): " + e); } return null; } //---------------------------------- // x //---------------------------------- [Bindable("xChanged")] [Inspectable(category="General")] /** * Number that specifies the component's horizontal position, * in pixels, within its parent container. * *

Setting this property directly or calling move() * has no effect -- or only a temporary effect -- if the * component is parented by a layout container such as HBox, Grid, * or Form, because the layout calculations of those containers * set the x position to the results of the calculation. * However, the x property must almost always be set * when the parent is a Canvas or other absolute-positioning * container because the default value is 0.

* * @default 0 * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ override public function get x():Number { return (_layoutFeatures == null) ? super.x : _layoutFeatures.layoutX; } /** * @private */ override public function set x(value:Number):void { if (x == value) return; if (_layoutFeatures == null) { super.x = value; } else { _layoutFeatures.layoutX = value; invalidateTransform(); } invalidateProperties(); if (parent && parent is UIComponent) UIComponent(parent).childXYChanged(); if (hasEventListener("xChanged")) dispatchEvent(new Event("xChanged")); } [Bindable("zChanged")] [Inspectable(category="General")] /** * @inheritDoc * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 1.5 * @productversion Flex 3 */ override public function get z():Number { return (_layoutFeatures == null) ? super.z : _layoutFeatures.layoutZ; } /** * @private */ override public function set z(value:Number):void { if (z == value) return; // validateMatrix when switching between 2D/3D, works around player bug // see sdk-23421 var was3D:Boolean = is3D; if (_layoutFeatures == null) initAdvancedLayoutFeatures(); _layoutFeatures.layoutZ = value; invalidateTransform(); invalidateProperties(); if (was3D != is3D) validateMatrix(); if (hasEventListener("zChanged")) dispatchEvent(new Event("zChanged")); } /** * Sets the x coordinate for the transform center of the component. * *

When this component is the target of a Spark transform effect, * you can override this property by setting * the AnimateTransform.autoCenterTransform property. * If autoCenterTransform is false, the transform * center is determined by the transformX, * transformY, and transformZ properties * of the effect target. * If autoCenterTransform is true, * the effect occurs around the center of the target, * (width/2, height/2).

* *

Setting this property on the Spark effect class * overrides the setting on the target component.

* * @see spark.effects.AnimateTransform#autoCenterTransform * @see spark.effects.AnimateTransform#transformX * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function get transformX():Number { return (_layoutFeatures == null) ? 0 : _layoutFeatures.transformX; } /** * @private */ public function set transformX(value:Number):void { if (transformX == value) return; if (_layoutFeatures == null) initAdvancedLayoutFeatures(); _layoutFeatures.transformX = value; invalidateTransform(); invalidateProperties(); invalidateParentSizeAndDisplayList(); } /** * Sets the y coordinate for the transform center of the component. * *

When this component is the target of a Spark transform effect, * you can override this property by setting * the AnimateTransform.autoCenterTransform property. * If autoCenterTransform is false, the transform * center is determined by the transformX, * transformY, and transformZ properties * of the effect target. * If autoCenterTransform is true, * the effect occurs around the center of the target, * (width/2, height/2).

* *

Seeting this property on the Spark effect class * overrides the setting on the target component.

* * @see spark.effects.AnimateTransform#autoCenterTransform * @see spark.effects.AnimateTransform#transformY * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function get transformY():Number { return (_layoutFeatures == null) ? 0 : _layoutFeatures.transformY; } /** * @private */ public function set transformY(value:Number):void { if (transformY == value) return; if (_layoutFeatures == null) initAdvancedLayoutFeatures(); _layoutFeatures.transformY = value; invalidateTransform(); invalidateProperties(); invalidateParentSizeAndDisplayList(); } /** * Sets the z coordinate for the transform center of the component. * *

When this component is the target of a Spark transform effect, * you can override this property by setting * the AnimateTransform.autoCenterTransform property. * If autoCenterTransform is false, the transform * center is determined by the transformX, * transformY, and transformZ properties * of the effect target. * If autoCenterTransform is true, * the effect occurs around the center of the target, * (width/2, height/2).

* *

Seeting this property on the Spark effect class * overrides the setting on the target component.

* * @see spark.effects.AnimateTransform#autoCenterTransform * @see spark.effects.AnimateTransform#transformZ * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function get transformZ():Number { return (_layoutFeatures == null) ? 0 : _layoutFeatures.transformZ; } /** * @private */ public function set transformZ(value:Number):void { if (transformZ == value) return; if (_layoutFeatures == null) initAdvancedLayoutFeatures(); _layoutFeatures.transformZ = value; invalidateTransform(); invalidateProperties(); invalidateParentSizeAndDisplayList(); } /** * @copy mx.core.IFlexDisplayObject#rotation * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ override public function get rotation():Number { if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0) return super.rotation; return (_layoutFeatures == null) ? super.rotation : _layoutFeatures.layoutRotationZ; } /** * @private */ override public function set rotation(value:Number):void { if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0) { super.rotation = value; return; } if (rotation == value) return; _hasComplexLayoutMatrix = true; if (_layoutFeatures == null) { // clamp the rotation value between -180 and 180. This is what // the Flash player does and what we mimic in CompoundTransform; // however, the Flash player doesn't handle values larger than // 2^15 - 1 (FP-749), so we need to clamp even when we're // just setting super.rotation. super.rotation = MatrixUtil.clampRotation(value); } else { _layoutFeatures.layoutRotationZ = value; } invalidateTransform(); invalidateProperties(); invalidateParentSizeAndDisplayList(); } /** * @inheritDoc * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ override public function get rotationZ():Number { return rotation; } /** * @private */ override public function set rotationZ(value:Number):void { rotation = value; } /** * Indicates the x-axis rotation of the DisplayObject instance, in degrees, from its original orientation * relative to the 3D parent container. Values from 0 to 180 represent clockwise rotation; values * from 0 to -180 represent counterclockwise rotation. Values outside this range are added to or subtracted from * 360 to obtain a value within the range. * * This property is ignored during calculation by any of Flex's 2D layouts. * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 1.5 * @productversion Flex 3 */ override public function get rotationX():Number { return (_layoutFeatures == null) ? super.rotationX : _layoutFeatures.layoutRotationX; } /** * @private */ override public function set rotationX(value:Number):void { if (rotationX == value) return; // validateMatrix when switching between 2D/3D, works around player bug // see sdk-23421 var was3D:Boolean = is3D; if (_layoutFeatures == null) initAdvancedLayoutFeatures(); _layoutFeatures.layoutRotationX = value; invalidateTransform(); invalidateProperties(); invalidateParentSizeAndDisplayList(); if (was3D != is3D) validateMatrix(); } /** * Indicates the y-axis rotation of the DisplayObject instance, in degrees, from its original orientation * relative to the 3D parent container. Values from 0 to 180 represent clockwise rotation; values * from 0 to -180 represent counterclockwise rotation. Values outside this range are added to or subtracted from * 360 to obtain a value within the range. * * This property is ignored during calculation by any of Flex's 2D layouts. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ override public function get rotationY():Number { return (_layoutFeatures == null) ? super.rotationY : _layoutFeatures.layoutRotationY; } /** * @private */ override public function set rotationY(value:Number):void { if (rotationY == value) return; // validateMatrix when switching between 2D/3D, works around player bug // see sdk-23421 var was3D:Boolean = is3D; if (_layoutFeatures == null) initAdvancedLayoutFeatures(); _layoutFeatures.layoutRotationY = value; invalidateTransform(); invalidateProperties(); invalidateParentSizeAndDisplayList(); if (was3D != is3D) validateMatrix(); } //---------------------------------- // y //---------------------------------- [Bindable("yChanged")] [Inspectable(category="General")] /** * Number that specifies the component's vertical position, * in pixels, within its parent container. * *

Setting this property directly or calling move() * has no effect -- or only a temporary effect -- if the * component is parented by a layout container such as HBox, Grid, * or Form, because the layout calculations of those containers * set the x position to the results of the calculation. * However, the x property must almost always be set * when the parent is a Canvas or other absolute-positioning * container because the default value is 0.

* * @default 0 * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ override public function get y():Number { return (_layoutFeatures == null) ? super.y : _layoutFeatures.layoutY; } /** * @private */ override public function set y(value:Number):void { if (y == value) return; if (_layoutFeatures == null) { super.y = value; } else { _layoutFeatures.layoutY = value; invalidateTransform(); } invalidateProperties(); if (parent && parent is UIComponent) UIComponent(parent).childXYChanged(); if (hasEventListener("yChanged")) dispatchEvent(new Event("yChanged")); } //---------------------------------- // width //---------------------------------- /** * @private * Storage for the width property. This should not be used to set the * width because it bypasses the mirroring transform in the setter. */ mx_internal var _width:Number; [Bindable("widthChanged")] [Inspectable(category="General")] [PercentProxy("percentWidth")] /** * Number that specifies the width of the component, in pixels, * in the parent's coordinates. * The default value is 0, but this property contains the actual component * width after Flex completes sizing the components in your application. * *

Note: You can specify a percentage value in the MXML * width attribute, such as width="100%", * but you cannot use a percentage value in the width * property in ActionScript. * Use the percentWidth property instead.

* *

Setting this property causes a resize event to * be dispatched. * See the resize event for details on when * this event is dispatched.

* * @see #percentWidth * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ override public function get width():Number { return _width; } /** * @private */ override public function set width(value:Number):void { if (explicitWidth != value) { explicitWidth = value; // We invalidate size because locking in width // may change the measured height in flow-based components. invalidateSize(); } if (_width != value) { invalidateProperties(); invalidateDisplayList(); invalidateParentSizeAndDisplayList(); _width = value; // The width is needed for the _layoutFeatures' mirror transform. if (_layoutFeatures) { _layoutFeatures.layoutWidth = _width; invalidateTransform(); } if (hasEventListener("widthChanged")) dispatchEvent(new Event("widthChanged")); } } //---------------------------------- // height //---------------------------------- /** * @private * Storage for the height property. */ mx_internal var _height:Number; [Bindable("heightChanged")] [Inspectable(category="General")] [PercentProxy("percentHeight")] /** * Number that specifies the height of the component, in pixels, * in the parent's coordinates. * The default value is 0, but this property contains the actual component * height after Flex completes sizing the components in your application. * *

Note: You can specify a percentage value in the MXML * height attribute, such as height="100%", * but you cannot use a percentage value for the height * property in ActionScript; * use the percentHeight property instead.

* *

Setting this property causes a resize event to be dispatched. * See the resize event for details on when * this event is dispatched.

* * @see #percentHeight * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ override public function get height():Number { return _height; } /** * @private */ override public function set height(value:Number):void { if (explicitHeight != value) { explicitHeight = value; // We invalidate size because locking in width // may change the measured height in flow-based components. invalidateSize(); } if (_height != value) { invalidateProperties(); invalidateDisplayList(); invalidateParentSizeAndDisplayList(); _height = value; if (hasEventListener("heightChanged")) dispatchEvent(new Event("heightChanged")); } } //---------------------------------- // scaleX //--------------------------------- [Bindable("scaleXChanged")] [Inspectable(category="Size", defaultValue="1.0")] /** * Number that specifies the horizontal scaling factor. * *

The default value is 1.0, which means that the object * is not scaled. * A scaleX of 2.0 means the object has been * magnified by a factor of 2, and a scaleX of 0.5 * means the object has been reduced by a factor of 2.

* *

A value of 0.0 is an invalid value. * Rather than setting it to 0.0, set it to a small value, or set * the visible property to false to hide the component.

* * @default 1.0 * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ override public function get scaleX():Number { if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0) return _scaleX; else return (_layoutFeatures == null) ? super.scaleX : _layoutFeatures.layoutScaleX; } /** * @private * Storage for the scaleX property. */ private var _scaleX:Number = 1.0; override public function set scaleX(value:Number):void { if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0) { if (_scaleX == value) return; _scaleX = value; invalidateProperties(); invalidateSize(); } else { var prevValue:Number = (_layoutFeatures == null) ? scaleX : _layoutFeatures.layoutScaleX; if (prevValue == value) return; _hasComplexLayoutMatrix = true; // trace("set scaleX:" + this + "value = " + value); if (_layoutFeatures == null) super.scaleX = value; else { _layoutFeatures.layoutScaleX = value; } invalidateTransform(); invalidateProperties(); // If we're not compatible with Flex3 (measuredWidth is pre-scale always) // and scaleX is changing we need to invalidate parent size and display list // since we are not going to detect a change in measured sizes during measure. invalidateParentSizeAndDisplayList(); } dispatchEvent(new Event("scaleXChanged")); } //---------------------------------- // scaleY //---------------------------------- [Bindable("scaleYChanged")] [Inspectable(category="Size", defaultValue="1.0")] /** * Number that specifies the vertical scaling factor. * *

The default value is 1.0, which means that the object * is not scaled. * A scaleY of 2.0 means the object has been * magnified by a factor of 2, and a scaleY of 0.5 * means the object has been reduced by a factor of 2.

* *

A value of 0.0 is an invalid value. * Rather than setting it to 0.0, set it to a small value, or set * the visible property to false to hide the component.

* * @default 1.0 * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ override public function get scaleY():Number { if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0) { return _scaleY; } else return (_layoutFeatures == null) ? super.scaleY : _layoutFeatures.layoutScaleY; } /** * @private * Storage for the scaleY property. */ private var _scaleY:Number = 1.0; override public function set scaleY(value:Number):void { if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0) { if (_scaleY == value) return; _scaleY = value; invalidateProperties(); invalidateSize(); } else { var prevValue:Number = (_layoutFeatures == null) ? scaleY : _layoutFeatures.layoutScaleY; if (prevValue == value) return; _hasComplexLayoutMatrix = true; if (_layoutFeatures == null) super.scaleY = value; else { _layoutFeatures.layoutScaleY = value; } invalidateTransform(); invalidateProperties(); // If we're not compatible with Flex3 (measuredWidth is pre-scale always) // and scaleX is changing we need to invalidate parent size and display list // since we are not going to detect a change in measured sizes during measure. invalidateParentSizeAndDisplayList(); } dispatchEvent(new Event("scaleYChanged")); } //---------------------------------- // scaleZ //---------------------------------- [Bindable("scaleZChanged")] [Inspectable(category="Size", defaultValue="1.0")] /** * Number that specifies the scaling factor along the z axis. * *

A scaling along the z axis does not affect a typical component, which lies flat * in the z=0 plane. components with children that have 3D transforms applied, or * components with a non-zero transformZ, is affected.

* *

The default value is 1.0, which means that the object * is not scaled.

* *

This property is ignored during calculation by any of Flex's 2D layouts.

* * @default 1.0 * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ override public function get scaleZ():Number { return (_layoutFeatures == null) ? super.scaleZ : _layoutFeatures.layoutScaleZ; } /** * @private */ override public function set scaleZ(value:Number):void { if (scaleZ == value) return; // validateMatrix when switching between 2D/3D, works around player bug // see sdk-23421 var was3D:Boolean = is3D; if (_layoutFeatures == null) initAdvancedLayoutFeatures(); _hasComplexLayoutMatrix = true; _layoutFeatures.layoutScaleZ = value; invalidateTransform(); invalidateProperties(); invalidateParentSizeAndDisplayList(); if (was3D != is3D) validateMatrix(); dispatchEvent(new Event("scaleZChanged")); } /** * This property allows access to the Player's native implementation * of the scaleX property, which can be useful since components * can override scaleX and thereby hide the native implementation. * Note that this "base property" is final and cannot be overridden, * so you can count on it to reflect what is happening at the player level. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ mx_internal final function get $scaleX():Number { return super.scaleX; } mx_internal final function set $scaleX(value:Number):void { super.scaleX = value; } /** * This property allows access to the Player's native implementation * of the scaleY property, which can be useful since components * can override scaleY and thereby hide the native implementation. * Note that this "base property" is final and cannot be overridden, * so you can count on it to reflect what is happening at the player level. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ mx_internal final function get $scaleY():Number { return super.scaleY; } mx_internal final function set $scaleY(value:Number):void { super.scaleY = value; } //---------------------------------- // visible //---------------------------------- /** * @private * Storage for the visible property. */ private var _visible:Boolean = true; [Bindable("hide")] [Bindable("show")] [Inspectable(category="General", defaultValue="true")] /** * Whether or not the display object is visible. * Display objects that are not visible are disabled. * For example, if visible=false for an InteractiveObject instance, * it cannot be clicked. * *

When setting to true, the object dispatches * a show event. * When setting to false, the object dispatches * a hide event. * In either case the children of the object does not emit a * show or hide event unless the object * has specifically written an implementation to do so.

* * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ override public function get visible():Boolean { return _visible; } /** * @private */ override public function set visible(value:Boolean):void { setVisible(value); } /** * Called when the visible property changes. * Set the visible property to show or hide * a component instead of calling this method directly. * * @param value The new value of the visible property. * Specify true to show the component, and false to hide it. * * @param noEvent If true, do not dispatch an event. * If false, dispatch a show event when * the component becomes visible, and a hide event when * the component becomes invisible. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function setVisible(value:Boolean, noEvent:Boolean = false):void { _visible = value; if (!initialized) return; if (designLayer && !designLayer.effectiveVisibility) value = false; if ($visible == value) return; $visible = value; if (!noEvent) { var eventType:String = value ? FlexEvent.SHOW :FlexEvent.HIDE; if (hasEventListener(eventType)) dispatchEvent(new FlexEvent(eventType)); } } //---------------------------------- // alpha //---------------------------------- /** * @private * Storage for the alpha property. */ private var _alpha:Number = 1.0; [Bindable("alphaChanged")] [Inspectable(defaultValue="1.0", category="General", verbose="1", minValue="0.0", maxValue="1.0")] /** * @private */ override public function get alpha():Number { // Here we roundtrip alpha in the same manner as the // player (purposely introducing a rounding error). return int(_alpha * 256.0) / 256.0; } /** * @private */ override public function set alpha(value:Number):void { if (_alpha != value) { _alpha = value; if (designLayer) value = value * designLayer.effectiveAlpha; $alpha = value; dispatchEvent(new Event("alphaChanged")); } } //---------------------------------- // blendMode //---------------------------------- /** * @private * Storage for the blendMode property. */ private var _blendMode:String = BlendMode.NORMAL; private var blendShaderChanged:Boolean; private var blendModeChanged:Boolean; [Inspectable(category="General", enumeration="add,alpha,darken,difference,erase,hardlight,invert,layer,lighten,multiply,normal,subtract,screen,overlay,colordodge,colorburn,exclusion,softlight,hue,saturation,color,luminosity", defaultValue="normal")] /** * @private */ override public function get blendMode():String { return _blendMode; } /** * @private */ override public function set blendMode(value:String):void { if (_blendMode != value) { _blendMode = value; blendModeChanged = true; // If one of the non-native Flash blendModes is set, // record the new value and set the appropriate // blendShader on the display object. if (value == "colordodge" || value =="colorburn" || value =="exclusion" || value =="softlight" || value =="hue" || value =="saturation" || value =="color" || value =="luminosity") { blendShaderChanged = true; } invalidateProperties(); } } //---------------------------------- // doubleClickEnabled //---------------------------------- [Inspectable(enumeration="true,false", defaultValue="true")] /** * Specifies whether the UIComponent object receives doubleClick events. * The default value is false, which means that the UIComponent object * does not receive doubleClick events. * *

The mouseEnabled property must also be set to true, * its default value, for the object to receive doubleClick events.

* * @default false * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ override public function get doubleClickEnabled():Boolean { return super.doubleClickEnabled; } /** * @private * Propagate to children. */ override public function set doubleClickEnabled(value:Boolean):void { super.doubleClickEnabled = value; var childList:IChildList; if (this is IRawChildrenContainer) childList = IRawChildrenContainer(this).rawChildren; else childList = IChildList(this); for (var i:int = 0; i < childList.numChildren; i++) { var child:InteractiveObject = childList.getChildAt(i) as InteractiveObject; if (child) child.doubleClickEnabled = value; } } //---------------------------------- // enabled //---------------------------------- /** * @private */ private var _enabled:Boolean = false; [Inspectable(category="General", enumeration="true,false", defaultValue="true")] [Bindable("enabledChanged")] /** * @copy mx.core.IUIComponent#enabled * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function get enabled():Boolean { return _enabled; } /** * @private */ public function set enabled(value:Boolean):void { _enabled = value; // Need to flush the cached TextFormat // so it recalcs with the disabled color, cachedTextFormat = null; invalidateDisplayList(); dispatchEvent(new Event("enabledChanged")); } //---------------------------------- // cacheAsBitmap //---------------------------------- /** * @private */ override public function set cacheAsBitmap(value:Boolean):void { super.cacheAsBitmap = value; // If cacheAsBitmap is set directly, // reset the value of cacheAsBitmapCount. cacheAsBitmapCount = value ? 1 : 0; } //---------------------------------- // filters //---------------------------------- /** * @private * Storage for the filters property. */ private var _filters:Array; /** * @private */ override public function get filters():Array { return _filters ? _filters : super.filters; } /** * @private */ override public function set filters(value:Array):void { var n:int; var i:int; var e:IEventDispatcher; if (_filters) { n = _filters.length; for (i = 0; i < n; i++) { e = _filters[i] as IEventDispatcher; if (e) e.removeEventListener(BaseFilter.CHANGE, filterChangeHandler); } } _filters = value; var clonedFilters:Array = []; if (_filters) { n = _filters.length; for (i = 0; i < n; i++) { if (_filters[i] is IBitmapFilter) { e = _filters[i] as IEventDispatcher; if (e) e.addEventListener(BaseFilter.CHANGE, filterChangeHandler); clonedFilters.push(IBitmapFilter(_filters[i]).clone()); } else { clonedFilters.push(_filters[i]); } } } super.filters = clonedFilters; } //---------------------------------- // layer //---------------------------------- /** * @private * Storage for the layer property. */ private var _designLayer:DesignLayer; [Inspectable (environment='none')] /** * @copy mx.core.IVisualElement#designLayer * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 1.5 * @productversion Flex 4 */ public function get designLayer():DesignLayer { return _designLayer; } /** * @private */ public function set designLayer(value:DesignLayer):void { if (_designLayer) _designLayer.removeEventListener("layerPropertyChange", layer_PropertyChange, false); _designLayer = value; if (_designLayer) _designLayer.addEventListener("layerPropertyChange", layer_PropertyChange, false, 0, true); $alpha = _designLayer ? _alpha * _designLayer.effectiveAlpha : _alpha; $visible = designLayer ? _visible && _designLayer.effectiveVisibility : _visible; } //-------------------------------------------------------------------------- // // Properties: Display // //-------------------------------------------------------------------------- //---------------------------------- // $alpha //---------------------------------- /** * @private * This property allows access to the Player's native implementation * of the 'alpha' property, which can be useful since components * can override 'alpha' and thereby hide the native implementation. * Note that this "base property" is final and cannot be overridden, * so you can count on it to reflect what is happening at the player level. */ mx_internal final function get $alpha():Number { return super.alpha; } /** * @private */ mx_internal final function set $alpha(value:Number):void { super.alpha = value; } //---------------------------------- // $blendMode //---------------------------------- /** * @private * This property allows access to the Player's native implementation * of the 'blendMode' property, which can be useful since components * can override 'alpha' and thereby hide the native implementation. * Note that this "base property" is final and cannot be overridden, * so you can count on it to reflect what is happening at the player level. */ mx_internal final function get $blendMode():String { return super.blendMode; } /** * @private */ mx_internal final function set $blendMode(value:String):void { super.blendMode = value; } //---------------------------------- // $blendShader //---------------------------------- /** * @private */ mx_internal final function set $blendShader(value:Shader):void { super.blendShader = value; } //---------------------------------- // $parent //---------------------------------- /** * @private * This property allows access to the Player's native implementation * of the 'parent' property, which can be useful since components * can override 'parent' and thereby hide the native implementation. * Note that this "base property" is final and cannot be overridden, * so you can count on it to reflect what is happening at the player level. */ mx_internal final function get $parent():DisplayObjectContainer { return super.parent; } //---------------------------------- // $x //---------------------------------- /** * @private * This property allows access to the Player's native implementation * of the 'x' property, which can be useful since components * can override 'x' and thereby hide the native implementation. * Note that this "base property" is final and cannot be overridden, * so you can count on it to reflect what is happening at the player level. */ mx_internal final function get $x():Number { return super.x; } /** * @private */ mx_internal final function set $x(value:Number):void { super.x = value; } //---------------------------------- // $y //---------------------------------- /** * @private * This property allows access to the Player's native implementation * of the 'y' property, which can be useful since components * can override 'y' and thereby hide the native implementation. * Note that this "base property" is final and cannot be overridden, * so you can count on it to reflect what is happening at the player level. */ mx_internal final function get $y():Number { return super.y; } /** * @private */ mx_internal final function set $y(value:Number):void { super.y = value; } //---------------------------------- // $width //---------------------------------- /** * @private * This property allows access to the Player's native implementation * of the 'width' property, which can be useful since components * can override 'width' and thereby hide the native implementation. * Note that this "base property" is final and cannot be overridden, * so you can count on it to reflect what is happening at the player level. */ mx_internal final function get $width():Number { return super.width; } /** * @private */ mx_internal final function set $width(value:Number):void { super.width = value; } //---------------------------------- // $height //---------------------------------- /** * @private * This property allows access to the Player's native implementation * of the 'height' property, which can be useful since components * can override 'height' and thereby hide the native implementation. * Note that this "base property" is final and cannot be overridden, * so you can count on it to reflect what is happening at the player level. */ mx_internal final function get $height():Number { return super.height; } /** * @private */ mx_internal final function set $height(value:Number):void { super.height = value; } //---------------------------------- // $visible //---------------------------------- /** * @private * This property allows access to the Player's native implementation * of the 'visible' property, which can be useful since components * can override 'visible' and thereby hide the native implementation. * Note that this "base property" is final and cannot be overridden, * so you can count on it to reflect what is happening at the player level. */ mx_internal final function get $visible():Boolean { return super.visible; } /** * @private */ mx_internal final function set $visible(value:Boolean):void { super.visible = value; } //---------------------------------- // contentMouseX //---------------------------------- /** * Returns the x position of the mouse, in the content coordinate system. * Content coordinates specify a pixel position relative to the upper left * corner of the component's content, and include all of the component's * content area, including any regions that are currently clipped and must * be accessed by scrolling the component. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function get contentMouseX():Number { return mouseX; } //---------------------------------- // contentMouseY //---------------------------------- /** * Returns the y position of the mouse, in the content coordinate system. * Content coordinates specify a pixel position relative to the upper left * corner of the component's content, and include all of the component's * content area, including any regions that are currently clipped and must * be accessed by scrolling the component. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function get contentMouseY():Number { return mouseY; } //---------------------------------- // tweeningProperties //---------------------------------- /** * @private */ private var _tweeningProperties:Array; [Inspectable(environment="none")] /** * Array of properties that are currently being tweened on this object. * *

Used to alert the EffectManager that certain properties of this object * are being tweened, so that the EffectManger doesn't attempt to animate * the same properties.

* * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function get tweeningProperties():Array { return _tweeningProperties; } /** * @private */ public function set tweeningProperties(value:Array):void { _tweeningProperties = value; } //-------------------------------------------------------------------------- // // Properties: Manager access // //-------------------------------------------------------------------------- //---------------------------------- // cursorManager //---------------------------------- /** * Gets the CursorManager that controls the cursor for this component * and its peers. * Each top-level window has its own instance of a CursorManager; * To make sure you're talking to the right one, use this method. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function get cursorManager():ICursorManager { var o:DisplayObject = parent; while (o) { if (o is IUIComponent && "cursorManager" in o) { var cm:ICursorManager = o["cursorManager"]; return cm; } o = o.parent; } return CursorManager.getInstance(); } //---------------------------------- // focusManager //---------------------------------- /** * @private * Storage for the focusManager property. */ private var _focusManager:IFocusManager; [Inspectable(environment="none")] /** * Gets the FocusManager that controls focus for this component * and its peers. * Each popup has its own focus loop and therefore its own instance * of a FocusManager. * To make sure you're talking to the right one, use this method. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ 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; } /** * @private * IFocusManagerContainers have this property assigned by the framework */ public function set focusManager(value:IFocusManager):void { _focusManager = value; dispatchEvent(new FlexEvent(FlexEvent.ADD_FOCUS_MANAGER)); } //---------------------------------- // resourceManager //---------------------------------- /** * @private * Storage for the resourceManager property. */ private var _resourceManager:IResourceManager = ResourceManager.getInstance(); /** * @private * This metadata suppresses a trace() in PropertyWatcher: * "warning: unable to bind to property 'resourceManager' ..." */ [Bindable("unused")] /** * A reference to the object which manages * all of the application's localized resources. * This is a singleton instance which implements * the IResourceManager interface. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ protected function get resourceManager():IResourceManager { return _resourceManager; } //---------------------------------- // styleManager //---------------------------------- /** * @private */ private var _styleManager:IStyleManager2; /** * Returns the StyleManager instance used by this component. * * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 1.5 * @productversion Flex 4 */ public function get styleManager():IStyleManager2 { if (!_styleManager) _styleManager = StyleManager.getStyleManager(moduleFactory); return _styleManager; } //---------------------------------- // systemManager //---------------------------------- /** * @private * Storage for the systemManager property. * Set by the SystemManager so that each UIComponent * has a references to its SystemManager */ private var _systemManager:ISystemManager; /** * @private * if component has been reparented, we need to potentially * reassign systemManager, cause we could be in a new Window. */ private var _systemManagerDirty:Boolean = false; [Inspectable(environment="none")] /** * Returns the SystemManager object used by this component. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function get systemManager():ISystemManager { if (!_systemManager || _systemManagerDirty) { var r:DisplayObject = root; if (_systemManager && _systemManager.isProxy) { // keep the existing proxy } else if (r && !(r is Stage)) { // If this object is attached to the display list, then // the root property holds its SystemManager. _systemManager = (r as ISystemManager); } else if (r) { // if the root is the Stage, then we are in a second AIR window _systemManager = Stage(r).getChildAt(0) as ISystemManager; } else { // If this object isn't attached to the display list, then // we need to walk up the parent chain ourselves. var o:DisplayObjectContainer = parent; while (o) { var ui:IUIComponent = o as IUIComponent; if (ui) { _systemManager = ui.systemManager; break; } else if (o is ISystemManager) { _systemManager = o as ISystemManager; break; } o = o.parent; } } _systemManagerDirty = false; } return _systemManager; } /** * @private */ public function set systemManager(value:ISystemManager):void { _systemManager = value; _systemManagerDirty = false; } /** * @private * Returns the current system manager, systemManager, * unless it is null. * If the current system manager is null, * then search to find the correct system manager. * * @return A system manager. This value is never null. */ mx_internal function getNonNullSystemManager():ISystemManager { var sm:ISystemManager = systemManager; if (!sm) sm = ISystemManager(SystemManager.getSWFRoot(this)); if (!sm) return SystemManagerGlobals.topLevelSystemManagers[0]; return sm; } /** * @private */ protected function invalidateSystemManager():void { var childList:IChildList = (this is IRawChildrenContainer) ? IRawChildrenContainer(this).rawChildren : IChildList(this); var n:int = childList.numChildren; for (var i:int = 0; i < n; i++) { var child:UIComponent = childList.getChildAt(i) as UIComponent; if (child) child.invalidateSystemManager(); } _systemManagerDirty = true; } //---------------------------------- // nestLevel //---------------------------------- /** * @private * Storage for the nestLevel property. */ private var _nestLevel:int = 0; [Inspectable(environment="none")] /** * Depth of this object in the containment hierarchy. * This number is used by the measurement and layout code. * The value is 0 if this component is not on the DisplayList. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function get nestLevel():int { return _nestLevel; } /** * @private */ public function set nestLevel(value:int):void { // If my parent hasn't been attached to the display list, then its nestLevel // will be zero. If it tries to set my nestLevel to 1, ignore it. We'll // update nest levels again after the parent is added to the display list. if (value == 1) return; // Also punt if the new value for nestLevel is the same as my current value. // TODO: (aharui) add early exit if nestLevel isn't changing if (value > 1 && _nestLevel != value) { _nestLevel = value; updateCallbacks(); value ++; } else if (value == 0) _nestLevel = value = 0; else value ++; var childList:IChildList = (this is IRawChildrenContainer) ? IRawChildrenContainer(this).rawChildren : IChildList(this); var n:int = childList.numChildren; for (var i:int = 0; i < n; i++) { var ui:ILayoutManagerClient = childList.getChildAt(i) as ILayoutManagerClient; if (ui) { ui.nestLevel = value; } else { var textField:IUITextField = childList.getChildAt(i) as IUITextField; if (textField) textField.nestLevel = value; } } } //-------------------------------------------------------------------------- // // Properties: MXML // //-------------------------------------------------------------------------- //---------------------------------- // descriptor //---------------------------------- /** * @private * Storage for the descriptor property. * This variable is initialized in the construct() method * using the _descriptor in the initObj, which is set in * createComponentFromDescriptor(). * If this UIComponent was not created by createComponentFromDescriptor(), * its 'descriptor' property is null. */ mx_internal var _descriptor:UIComponentDescriptor; [Inspectable(environment="none")] /** * Reference to the UIComponentDescriptor, if any, that was used * by the createComponentFromDescriptor() method to create this * UIComponent instance. If this UIComponent instance * was not created from a descriptor, this property is null. * * @see mx.core.UIComponentDescriptor * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function get descriptor():UIComponentDescriptor { return _descriptor; } /** * @private */ public function set descriptor(value:UIComponentDescriptor):void { _descriptor = value; } //---------------------------------- // document //---------------------------------- /** * @private * Storage for the document property. * This variable is initialized in the init() method. * A document object (i.e., an Object at the top of the hierarchy * of a Flex application, MXML component, or AS component) has an * autogenerated override of initalize() which sets its _document to * 'this', so that its 'document' property is a reference to itself. * Other UIComponents set their _document to their parent's _document, * so that their 'document' property refers to the document object * that they are inside. */ mx_internal var _document:Object; [Inspectable(environment="none")] /** * A reference to the document object associated with this UIComponent. * A document object is an Object at the top of the hierarchy of a * Flex application, MXML component, or AS component. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function get document():Object { return _document; } /** * A reference to the document object associated with this UIComponent. * A document object is an Object at the top of the hierarchy of a * Flex application, MXML component, or AS component. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function set document(value:Object):void { var n:int = numChildren; for (var i:int = 0; i < n; i++) { var child:IUIComponent = getChildAt(i) as IUIComponent; if (!child) continue; if (child.document == _document || child.document == FlexGlobals.topLevelApplication) { child.document = value; } } _document = value; } //---------------------------------- // documentDescriptor //---------------------------------- /** * @private * Storage for the documentDescriptor property. * A document object (i.e., a UIComponent at the top of the * hierarchy of a Flex application, MXML component, * or AS component) has an autogenerated override of init() * which sets its _documentDescriptor to the descriptor * at the top of the autogenerated descriptor tree for that * document. For other UIComponents, _documentDescriptor is * never defined. */ mx_internal var _documentDescriptor:UIComponentDescriptor; /** * @private * For a document object, which is an instance of a UIComponent * at the top of the hierarchy of a Flex application, MXML * component, or ActionScript component, the * documentDescriptor property is a reference * to the UIComponentDescriptor at the top of the autogenerated * descriptor tree for that document, which describes the * set of children and their attributes for that document. * For other UIComponents, it is null. */ mx_internal function get documentDescriptor():UIComponentDescriptor { return _documentDescriptor; } //---------------------------------- // id //---------------------------------- /** * @private */ private var _id:String; /** * ID of the component. This value becomes the instance name of the object * and should not contain any white space or special characters. Each component * throughout an application should have a unique id. * *

If your application is going to be tested by third party tools, give each component * a meaningful id. Testing tools use ids to represent the control in their scripts and * having a meaningful name can make scripts more readable. For example, set the * value of a button to submit_button rather than b1 or button1.

* * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function get id():String { return _id; } /** * @private */ public function set id(value:String):void { _id = value; } //---------------------------------- // isDocument //---------------------------------- /** * Contains true if this UIComponent instance is a document object. * That means it is at the top of the hierarchy of a Flex * application, MXML component, or ActionScript component. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public function get isDocument():Boolean { return document == this; } //---------------------------------- // parentApplication //---------------------------------- [Bindable("initialize")] /* * Note: * There are two reasons that 'parentApplication' is typed as Object * rather than as Application. The first is that typing it as Application * would make UIComponent dependent on Application, slowing down compile * times not only for SWCs for also for MXML and AS components. The * second is that authors would not be able to access properties and * methods in the