Package | mx.core |
Interface | public interface IContainer extends IUIComponent , IFlexDisplayObject , IBitmapDrawable , IEventDispatcher |
Implementors | Container, Legend |
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Related API Elements
Property | Defined By | ||
---|---|---|---|
accessibilityProperties : AccessibilityProperties
The current accessibility options for this display object. | IFlexDisplayObject | ||
alpha : Number
Indicates the alpha transparency value of the object specified. | IFlexDisplayObject | ||
baselinePosition : Number [read-only]
The y-coordinate of the baseline
of the first line of text of the component. | IUIComponent | ||
blendMode : String
A value from the BlendMode class that specifies which blend mode to use. | IFlexDisplayObject | ||
buttonMode : Boolean
Specifies the button mode of this sprite. | IContainer | ||
cacheAsBitmap : Boolean
If set to true, Flash runtimes cache an internal bitmap representation of the
display object. | IFlexDisplayObject | ||
creatingContentPane : Boolean
Containers use an internal content pane to control scrolling. | IContainer | ||
defaultButton : IFlexDisplayObject
The Button control designated as the default button
for the container. | IContainer | ||
document : Object
A reference to the document object associated with this component. | IUIComponent | ||
doubleClickEnabled : Boolean
Specifies whether the object receives doubleClick events. | IContainer | ||
dropTarget : DisplayObject [read-only]
Specifies the display object over which the sprite is being dragged, or on
which the sprite was dropped. | IContainer | ||
enabled : Boolean
Whether the component can accept user interaction. | IUIComponent | ||
explicitHeight : Number
The explicitly specified height for the component,
in pixels, as the component's coordinates. | IUIComponent | ||
explicitMaxHeight : Number [read-only]
Number that specifies the maximum height of the component,
in pixels, as the component's coordinates. | IUIComponent | ||
explicitMaxWidth : Number [read-only]
Number that specifies the maximum width of the component,
in pixels, as the component's coordinates. | IUIComponent | ||
explicitMinHeight : Number [read-only]
Number that specifies the minimum height of the component,
in pixels, as the component's coordinates. | IUIComponent | ||
explicitMinWidth : Number [read-only]
Number that specifies the minimum width of the component,
in pixels, as the component's coordinates. | IUIComponent | ||
explicitWidth : Number
The explicitly specified width for the component,
in pixels, as the component's coordinates. | IUIComponent | ||
filters : Array
An indexed array that contains each filter object currently associated with the display object. | IFlexDisplayObject | ||
focusManager : IFocusManager [read-only]
Gets the FocusManager that controls focus for this component
and its peers. | IContainer | ||
focusPane : Sprite
A single Sprite object that is shared among components
and used as an overlay for drawing the focus indicator. | IUIComponent | ||
focusRect : Object
Specifies whether this object displays a focus rectangle. | IContainer | ||
graphics : Graphics [read-only]
Specifies the Graphics object that belongs to this sprite where vector
drawing commands can occur. | IContainer | ||
height : Number
Indicates the height of the display object, in pixels. | IFlexDisplayObject | ||
hitArea : Sprite
Designates another sprite to serve as the hit area for a sprite. | IContainer | ||
horizontalScrollPosition : Number
The current position of the horizontal scroll bar. | IContainer | ||
includeInLayout : Boolean
Specifies whether this component is included in the layout of the
parent container. | IUIComponent | ||
isPopUp : Boolean
Set to true by the PopUpManager to indicate
that component has been popped up. | IUIComponent | ||
loaderInfo : LoaderInfo [read-only]
Returns a LoaderInfo object containing information about loading the file
to which this display object belongs. | IFlexDisplayObject | ||
mask : DisplayObject
The calling display object is masked by the specified mask object. | IFlexDisplayObject | ||
maxHeight : Number [read-only]
Number that specifies the maximum height of the component,
in pixels, as the component's coordinates. | IUIComponent | ||
maxWidth : Number [read-only]
Number that specifies the maximum width of the component,
in pixels, as the component's coordinates. | IUIComponent | ||
measuredHeight : Number [read-only]
The measured height of this object. | IFlexDisplayObject | ||
measuredMinHeight : Number
The default minimum height of the component, in pixels. | IUIComponent | ||
measuredMinWidth : Number
The default minimum width of the component, in pixels. | IUIComponent | ||
measuredWidth : Number [read-only]
The measured width of this object. | IFlexDisplayObject | ||
minHeight : Number [read-only]
Number that specifies the minimum height of the component,
in pixels, as the component's coordinates. | IUIComponent | ||
minWidth : Number [read-only]
Number that specifies the minimum width of the component,
in pixels, as the component's coordinates. | IUIComponent | ||
mouseChildren : Boolean
Determines whether or not the children of the object are mouse, or user input device, enabled. | IContainer | ||
mouseEnabled : Boolean
Specifies whether this object receives mouse, or other user input, messages. | IContainer | ||
mouseX : Number [read-only]
Indicates the x coordinate of the mouse or user input device position, in pixels. | IFlexDisplayObject | ||
mouseY : Number [read-only]
Indicates the y coordinate of the mouse or user input device position, in pixels. | IFlexDisplayObject | ||
name : String
Indicates the instance name of the DisplayObject. | IFlexDisplayObject | ||
numChildren : int [read-only]
Returns the number of children of this object. | IContainer | ||
opaqueBackground : Object
Specifies whether the display object is opaque with a certain background color. | IFlexDisplayObject | ||
owner : DisplayObjectContainer
The owner of this IVisualElement object. | IUIComponent | ||
parent : DisplayObjectContainer [read-only]
Indicates the DisplayObjectContainer object that contains this display object. | IFlexDisplayObject | ||
percentHeight : Number
Number that specifies the height of a component as a
percentage of its parent's size. | IUIComponent | ||
percentWidth : Number
Number that specifies the width of a component as a
percentage of its parent's size. | IUIComponent | ||
root : DisplayObject [read-only]
For a display object in a loaded SWF file, the root property is the
top-most display object in the portion of the display list's tree structure represented by that SWF file. | IFlexDisplayObject | ||
rotation : Number
Indicates the rotation of the DisplayObject instance, in degrees, from its original orientation. | IFlexDisplayObject | ||
scale9Grid : Rectangle
The current scaling grid that is in effect. | IFlexDisplayObject | ||
scaleX : Number
Indicates the horizontal scale (percentage) of the object as applied from the registration point. | IFlexDisplayObject | ||
scaleY : Number
Indicates the vertical scale (percentage) of an object as applied from the registration point of the object. | IFlexDisplayObject | ||
scrollRect : Rectangle
The scroll rectangle bounds of the display object. | IFlexDisplayObject | ||
soundTransform : flash.media:SoundTransform
Controls sound within this sprite. | IContainer | ||
stage : Stage [read-only]
The Stage of the display object. | IFlexDisplayObject | ||
systemManager : ISystemManager
A reference to the SystemManager object for this component. | IUIComponent | ||
tabChildren : Boolean
Determines whether the children of the object are tab enabled. | IContainer | ||
tabEnabled : Boolean
Specifies whether this object is in the tab order. | IContainer | ||
tabIndex : int
Specifies the tab ordering of objects in a SWF file. | IContainer | ||
textSnapshot : flash.text:TextSnapshot [read-only]
Returns a TextSnapshot object for this DisplayObjectContainer instance. | IContainer | ||
transform : flash.geom:Transform
An object with properties pertaining to a display object's matrix, color transform, and pixel bounds. | IFlexDisplayObject | ||
tweeningProperties : Array
Used by EffectManager. | IUIComponent | ||
useHandCursor : Boolean
A Boolean value that indicates whether the pointing hand (hand cursor) appears when the pointer rolls
over a sprite in which the buttonMode property is set to true. | IContainer | ||
verticalScrollPosition : Number
The current position of the vertical scroll bar. | IContainer | ||
viewMetrics : EdgeMetrics [read-only]
Returns an object that has four properties: left,
top, right, and bottom. | IContainer | ||
visible : Boolean
Whether or not the display object is visible. | IFlexDisplayObject | ||
width : Number
Indicates the width of the display object, in pixels. | IFlexDisplayObject | ||
x : Number
Indicates the x coordinate of the DisplayObject instance relative to the local coordinates of
the parent DisplayObjectContainer. | IFlexDisplayObject | ||
y : Number
Indicates the y coordinate of the DisplayObject instance relative to the local coordinates of
the parent DisplayObjectContainer. | IFlexDisplayObject |
Method | Defined By | ||
---|---|---|---|
Adds a child DisplayObject instance to this DisplayObjectContainer instance. | IContainer | ||
Adds a child DisplayObject instance to this DisplayObjectContainer
instance. | IContainer | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener
receives notification of an event. | IEventDispatcher | ||
Indicates whether the security restrictions
would cause any display objects to be omitted from the list returned by calling
the DisplayObjectContainer.getObjectsUnderPoint() method
with the specified point point. | IContainer | ||
Determines whether the specified display object is a child of the DisplayObjectContainer instance or
the instance itself. | IContainer | ||
Dispatches an event into the event flow. | IEventDispatcher | ||
Returns a rectangle that defines the area of the display object relative to the coordinate system
of the targetCoordinateSpace object. | IFlexDisplayObject | ||
Returns the child display object instance that exists at the specified index. | IContainer | ||
Returns the child display object that exists with the specified name. | IContainer | ||
Returns the index position of a child DisplayObject instance. | IContainer | ||
A convenience method for determining whether to use the
explicit or measured height
| IUIComponent | ||
A convenience method for determining whether to use the
explicit or measured width
| IUIComponent | ||
Returns an array of objects that lie under the specified point and are children
(or grandchildren, and so on) of this DisplayObjectContainer instance. | IContainer | ||
Returns a rectangle that defines the boundary of the display object,
based on the coordinate system defined by the targetCoordinateSpace
parameter, excluding any strokes on shapes. | IFlexDisplayObject | ||
Converts the point object from the Stage (global) coordinates
to the display object's (local) coordinates. | IFlexDisplayObject | ||
Checks whether the EventDispatcher object has any listeners registered for a specific type
of event. | IEventDispatcher | ||
Evaluates the bounding box of the display object to see if it overlaps or intersects with the
bounding box of the obj display object. | IFlexDisplayObject | ||
Evaluates the display object to see if it overlaps or intersects with the
point specified by the x and y parameters. | IFlexDisplayObject | ||
Initialize the object. | IUIComponent | ||
Converts the point object from the display object's (local) coordinates to the
Stage (global) coordinates. | IFlexDisplayObject | ||
Moves this object to the specified x and y coordinates. | IFlexDisplayObject | ||
Returns true if the chain of owner properties
points from child to this UIComponent. | IUIComponent | ||
Called by Flex when a UIComponent object is added to or removed from a parent. | IUIComponent | ||
Removes the specified child DisplayObject instance from the child list of the DisplayObjectContainer instance. | IContainer | ||
Removes a child DisplayObject from the specified index position in the child list of
the DisplayObjectContainer. | IContainer | ||
Removes a listener from the EventDispatcher object. | IEventDispatcher | ||
Sets the actual size of this object. | IFlexDisplayObject | ||
Changes the position of an existing child in the display object container. | IContainer | ||
Called when the visible property changes. | IUIComponent | ||
Lets the user drag the specified sprite. | IContainer | ||
Ends the startDrag() method. | IContainer | ||
Swaps the z-order (front-to-back order) of the two specified child objects. | IContainer | ||
Swaps the z-order (front-to-back order) of the child objects at the two specified index positions in the
child list. | IContainer | ||
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type. | IEventDispatcher |
buttonMode | property |
buttonMode:Boolean
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Specifies the button mode of this sprite. If true
, this
sprite behaves as a button, which means that it triggers the display
of the hand cursor when the pointer passes over the sprite and can
receive a click
event if the enter or space keys are pressed
when the sprite has focus. You can suppress the display of the hand cursor
by setting the useHandCursor
property to false
,
in which case the pointer is displayed.
Although it is better to use the SimpleButton class to create buttons,
you can use the buttonMode
property to give a sprite
some button-like functionality. To include a sprite in the tab order,
set the tabEnabled
property (inherited from the
InteractiveObject class and false
by default) to
true
. Additionally, consider whether you want
the children of your sprite to be user input enabled. Most buttons
do not enable user input interactivity for their child objects because
it confuses the event flow. To disable user input interactivity for all child
objects, you must set the mouseChildren
property (inherited
from the DisplayObjectContainer class) to false
.
If you use the buttonMode
property with the MovieClip class (which is a
subclass of the Sprite class), your button might have some added
functionality. If you include frames labeled _up, _over, and _down,
Flash Player provides automatic state changes (functionality
similar to that provided in previous versions of ActionScript for movie
clips used as buttons). These automatic state changes are
not available for sprites, which have no timeline, and thus no frames
to label.
Implementation
public function get buttonMode():Boolean
public function set buttonMode(value:Boolean):void
creatingContentPane | property |
creatingContentPane:Boolean
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Containers use an internal content pane to control scrolling.
The creatingContentPane
is true
while the container is creating
the content pane so that some events can be ignored or blocked.
Implementation
public function get creatingContentPane():Boolean
public function set creatingContentPane(value:Boolean):void
defaultButton | property |
defaultButton:IFlexDisplayObject
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
The Button control designated as the default button for the container. When controls in the container have focus, pressing the Enter key is the same as clicking this Button control.
Implementation
public function get defaultButton():IFlexDisplayObject
public function set defaultButton(value:IFlexDisplayObject):void
doubleClickEnabled | property |
doubleClickEnabled:Boolean
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Specifies whether the object receives doubleClick
events. The default value
is false
, which means that by default an InteractiveObject instance does not receive
doubleClick
events. If the doubleClickEnabled
property is set to
true
, the instance receives doubleClick
events within its bounds.
The mouseEnabled
property of the InteractiveObject instance must also be
set to true
for the object to receive doubleClick
events.
No event is dispatched by setting this property. You must use the
addEventListener()
method to add an event listener
for the doubleClick
event.
Implementation
public function get doubleClickEnabled():Boolean
public function set doubleClickEnabled(value:Boolean):void
dropTarget | property |
dropTarget:DisplayObject
[read-only] Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Specifies the display object over which the sprite is being dragged, or on which the sprite was dropped.
Implementation
public function get dropTarget():DisplayObject
focusManager | property |
focusManager:IFocusManager
[read-only] Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
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.
Implementation
public function get focusManager():IFocusManager
focusRect | property |
focusRect:Object
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Specifies whether this object displays a focus rectangle. It can take one of three
values: true
, false
, or null
. Values of true
and false
work as expected, specifying whether or not the focus rectangle
appears. A value of null
indicates that this object obeys the
stageFocusRect
property of the Stage.
Implementation
public function get focusRect():Object
public function set focusRect(value:Object):void
graphics | property |
hitArea | property |
hitArea:Sprite
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Designates another sprite to serve as the hit area for a sprite. If the hitArea
property does not exist or the value is null
or undefined
, the
sprite itself is used as the hit area. The value of the hitArea
property can
be a reference to a Sprite object.
You can change the hitArea
property at any time; the modified sprite immediately
uses the new hit area behavior. The sprite designated as the hit area does not need to be
visible; its graphical shape, although not visible, is still detected as the hit area.
Note: You must set to false
the mouseEnabled
property of the sprite designated as the hit area. Otherwise, your sprite button might
not work because the sprite designated as the hit area receives the user input events instead
of your sprite button.
Implementation
public function get hitArea():Sprite
public function set hitArea(value:Sprite):void
horizontalScrollPosition | property |
horizontalScrollPosition:Number
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
The current position of the horizontal scroll bar. This is equal to the distance in pixels between the left edge of the scrollable surface and the leftmost piece of the surface that is currently visible.
Implementation
public function get horizontalScrollPosition():Number
public function set horizontalScrollPosition(value:Number):void
mouseChildren | property |
mouseChildren:Boolean
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Determines whether or not the children of the object are mouse, or user input device, enabled.
If an object is enabled, a user can interact with it by using a mouse or user input device. The default is true
.
This property is useful when you create a button with an instance of the Sprite class
(instead of using the SimpleButton class). When you use a Sprite instance to create a button,
you can choose to decorate the button by using the addChild()
method to add additional
Sprite instances. This process can cause unexpected behavior with mouse events because
the Sprite instances you add as children can become the target object of a mouse event
when you expect the parent instance to be the target object. To ensure that the parent
instance serves as the target objects for mouse events, you can set the
mouseChildren
property of the parent instance to false
.
No event is dispatched by setting this property. You must use the
addEventListener()
method to create interactive functionality.
Implementation
public function get mouseChildren():Boolean
public function set mouseChildren(value:Boolean):void
mouseEnabled | property |
mouseEnabled:Boolean
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Specifies whether this object receives mouse, or other user input, messages. The default value is true
,
which means that by default any InteractiveObject instance that is on the display list
receives mouse events or other user input events.
If mouseEnabled
is set to false
, the instance does not receive any
mouse events (or other user input events like keyboard events). Any children of this instance on the display list are not affected. To change
the mouseEnabled
behavior for all children of an object on the display list, use
flash.display.DisplayObjectContainer.mouseChildren
.
No event is dispatched by setting this property. You must use the
addEventListener()
method to create interactive functionality.
Implementation
public function get mouseEnabled():Boolean
public function set mouseEnabled(value:Boolean):void
numChildren | property |
soundTransform | property |
soundTransform:flash.media:SoundTransform
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Controls sound within this sprite.
Note: This property does not affect HTML content in an HTMLControl object (in Adobe AIR).
Implementation
public function get soundTransform():flash.media:SoundTransform
public function set soundTransform(value:flash.media:SoundTransform):void
tabChildren | property |
tabChildren:Boolean
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Determines whether the children of the object are tab enabled.
Note: Do not use this property with Flex.
Instead, use the UIComponent.hasFocusableChildren
property.
Implementation
public function get tabChildren():Boolean
public function set tabChildren(value:Boolean):void
Related API Elements
tabEnabled | property |
tabEnabled:Boolean
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Specifies whether this object is in the tab order. If this object is in the tab order,
the value is true
; otherwise, the value is false
. By default,
the value is false
, except for the following:
- For a SimpleButton object, the value is
true
. - For a TextField object with
type = "input"
, the value istrue
. - For a Sprite object or MovieClip object with
buttonMode = true
, the value istrue
.
Implementation
public function get tabEnabled():Boolean
public function set tabEnabled(value:Boolean):void
tabIndex | property |
tabIndex:int
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Specifies the tab ordering of objects in a SWF file. The tabIndex
property is -1 by default, meaning no tab index is set for the object.
If any currently displayed object in the SWF file contains a tabIndex
property, automatic
tab ordering is disabled, and the tab ordering is calculated from the tabIndex
properties of
objects in the SWF file. The custom tab ordering includes only objects that have tabIndex
properties.
The tabIndex
property can be a non-negative integer. The objects are ordered according to
their tabIndex
properties, in ascending order. An object with a tabIndex
value of 1 precedes an object with a tabIndex
value of 2. Do not use the same tabIndex
value for multiple objects.
The custom tab ordering that the tabIndex
property defines is flat.
This means that no attention is paid to the hierarchical relationships of objects in the SWF file.
All objects in the SWF file with tabIndex
properties are placed in the tab order, and the
tab order is determined by the order of the tabIndex
values.
Note: To set the tab order for TLFTextField instances, cast the display object child
of the TLFTextField as an InteractiveObject, then set the tabIndex
property. For example:
InteractiveObject(tlfInstance.getChildAt(1)).tabIndex = 3;To reverse the tab order from the default setting for three instances of a TLFTextField object (
tlfInstance1
, tlfInstance2
and tlfInstance3
), use:
InteractiveObject(tlfInstance1.getChildAt(1)).tabIndex = 3; InteractiveObject(tlfInstance2.getChildAt(1)).tabIndex = 2; InteractiveObject(tlfInstance3.getChildAt(1)).tabIndex = 1;
Implementation
public function get tabIndex():int
public function set tabIndex(value:int):void
textSnapshot | property |
textSnapshot:flash.text:TextSnapshot
[read-only] Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Returns a TextSnapshot object for this DisplayObjectContainer instance.
Implementation
public function get textSnapshot():flash.text:TextSnapshot
useHandCursor | property |
useHandCursor:Boolean
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
A Boolean value that indicates whether the pointing hand (hand cursor) appears when the pointer rolls
over a sprite in which the buttonMode
property is set to true
.
The default value of the useHandCursor
property is true
.
If useHandCursor
is set to true
, the pointing hand used for buttons
appears when the pointer rolls over a button sprite. If useHandCursor
is
false
, the arrow pointer is used instead.
You can change the useHandCursor
property at any time; the modified sprite
immediately takes on the new cursor appearance.
Note: In Flex or Flash Builder, if your sprite has child sprites, you might want to
set the mouseChildren
property to false
. For example, if you want a hand
cursor to appear over a Flex <mx:Label> control, set the useHandCursor
and
buttonMode
properties to true
, and the mouseChildren
property
to false
.
Implementation
public function get useHandCursor():Boolean
public function set useHandCursor(value:Boolean):void
verticalScrollPosition | property |
verticalScrollPosition:Number
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
The current position of the vertical scroll bar. This is equal to the distance in pixels between the top edge of the scrollable surface and the topmost piece of the surface that is currently visible.
Implementation
public function get verticalScrollPosition():Number
public function set verticalScrollPosition(value:Number):void
viewMetrics | property |
viewMetrics:EdgeMetrics
[read-only] Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Returns an object that has four properties: left
,
top
, right
, and bottom
.
The value of each property equals the thickness of the chrome
(visual elements) around the edge of the container.
The chrome includes the border thickness.
If the horizontalScrollPolicy
or verticalScrollPolicy
property value is ScrollPolicy.ON
, the
chrome also includes the thickness of the corresponding
scroll bar. If a scroll policy is ScrollPolicy.AUTO
,
the chrome measurement does not include the scroll bar thickness,
even if a scroll bar is displayed.
Subclasses of Container should override this method, so that
they include other chrome to be taken into account when positioning
the Container's children.
For example, the viewMetrics
property for the
Panel class should return an object whose top
property
includes the thickness of the Panel container's title bar.
Implementation
public function get viewMetrics():EdgeMetrics
addChild | () | method |
public function addChild(child:DisplayObject):DisplayObject
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Adds a child DisplayObject instance to this DisplayObjectContainer instance. The child is added
to the front (top) of all other children in this DisplayObjectContainer instance. (To add a child to a
specific index position, use the addChildAt()
method.)
If you add a child object that already has a different display object container as a parent, the object is removed from the child list of the other display object container.
Note: The command stage.addChild()
can cause problems with a published SWF file,
including security problems and conflicts with other loaded SWF files. There is only one Stage within a Flash runtime instance,
no matter how many SWF files you load into the runtime. So, generally, objects
should not be added to the Stage, directly, at all. The only object the Stage should
contain is the root object. Create a DisplayObjectContainer to contain all of the items on the
display list. Then, if necessary, add that DisplayObjectContainer instance to the Stage.
Parameters
child:DisplayObject — The DisplayObject instance to add as a child of this DisplayObjectContainer instance.
|
DisplayObject — The DisplayObject instance that you pass in the
child parameter.
|
addChildAt | () | method |
public function addChildAt(child:DisplayObject, index:int):DisplayObject
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Adds a child DisplayObject instance to this DisplayObjectContainer instance. The child is added at the index position specified. An index of 0 represents the back (bottom) of the display list for this DisplayObjectContainer object.
For example, the following example shows three display objects, labeled a, b, and c, at index positions 0, 2, and 1, respectively:
If you add a child object that already has a different display object container as a parent, the object is removed from the child list of the other display object container.
Parameters
child:DisplayObject — The DisplayObject instance to add as a child of this
DisplayObjectContainer instance.
| |
index:int — The index position to which the child is added. If you specify a
currently occupied index position, the child object that exists at that position and all
higher positions are moved up one position in the child list.
|
DisplayObject — The DisplayObject instance that you pass in the
child parameter.
|
areInaccessibleObjectsUnderPoint | () | method |
public function areInaccessibleObjectsUnderPoint(point:Point):Boolean
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Indicates whether the security restrictions
would cause any display objects to be omitted from the list returned by calling
the DisplayObjectContainer.getObjectsUnderPoint()
method
with the specified point
point. By default, content from one domain cannot
access objects from another domain unless they are permitted to do so with a call to the
Security.allowDomain()
method. For more information, related to security,
see the Flash Player Developer Center Topic:
Security.
The point
parameter is in the coordinate space of the Stage,
which may differ from the coordinate space of the display object container (unless the
display object container is the Stage). You can use the globalToLocal()
and
the localToGlobal()
methods to convert points between these coordinate
spaces.
Parameters
point:Point — The point under which to look.
|
Boolean — true if the point contains child display objects with security restrictions.
|
contains | () | method |
public function contains(child:DisplayObject):Boolean
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Determines whether the specified display object is a child of the DisplayObjectContainer instance or
the instance itself.
The search includes the entire display list including this DisplayObjectContainer instance. Grandchildren,
great-grandchildren, and so on each return true
.
Parameters
child:DisplayObject — The child object to test.
|
Boolean — true if the child object is a child of the DisplayObjectContainer
or the container itself; otherwise false .
|
getChildAt | () | method |
public function getChildAt(index:int):DisplayObject
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Returns the child display object instance that exists at the specified index.
Parameters
index:int — The index position of the child object.
|
DisplayObject — The child display object at the specified index position.
|
getChildByName | () | method |
public function getChildByName(name:String):DisplayObject
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Returns the child display object that exists with the specified name. If more that one child display object has the specified name, the method returns the first object in the child list.
The getChildAt()
method is faster than the
getChildByName()
method. The getChildAt()
method accesses
a child from a cached array, whereas the getChildByName()
method
has to traverse a linked list to access a child.
Parameters
name:String — The name of the child to return.
|
DisplayObject — The child display object with the specified name.
|
getChildIndex | () | method |
public function getChildIndex(child:DisplayObject):int
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Returns the index position of a child
DisplayObject instance.
Parameters
child:DisplayObject — The DisplayObject instance to identify.
|
int — The index position of the child display object to identify.
|
getObjectsUnderPoint | () | method |
public function getObjectsUnderPoint(point:Point):Array
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Returns an array of objects that lie under the specified point and are children
(or grandchildren, and so on) of this DisplayObjectContainer instance. Any child objects that
are inaccessible for security reasons are omitted from the returned array. To determine whether
this security restriction affects the returned array, call the
areInaccessibleObjectsUnderPoint()
method.
The point
parameter is in the coordinate space of the Stage,
which may differ from the coordinate space of the display object container (unless the
display object container is the Stage). You can use the globalToLocal()
and
the localToGlobal()
methods to convert points between these coordinate
spaces.
Parameters
point:Point — The point under which to look.
|
Array — An array of objects that lie under the specified point and are children
(or grandchildren, and so on) of this DisplayObjectContainer instance.
|
removeChild | () | method |
public function removeChild(child:DisplayObject):DisplayObject
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Removes the specified child
DisplayObject instance from the child list of the DisplayObjectContainer instance.
The parent
property of the removed child is set to null
, and the object is garbage collected if no other
references to the child exist. The index positions of any display objects above the child in the
DisplayObjectContainer are decreased by 1.
The garbage collector reallocates unused memory space. When a variable or object is no longer actively referenced or stored somewhere, the garbage collector sweeps through and wipes out the memory space it used to occupy if no other references to it exist.
Parameters
child:DisplayObject — The DisplayObject instance to remove.
|
DisplayObject — The DisplayObject instance that you pass in the
child parameter.
|
removeChildAt | () | method |
public function removeChildAt(index:int):DisplayObject
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Removes a child DisplayObject from the specified index
position in the child list of
the DisplayObjectContainer. The parent
property of the removed child is set to
null
, and the object is garbage collected if no other references to the child exist. The index
positions of any display objects above the child in the DisplayObjectContainer are decreased by 1.
The garbage collector reallocates unused memory space. When a variable or object is no longer actively referenced or stored somewhere, the garbage collector sweeps through and wipes out the memory space it used to occupy if no other references to it exist.
Parameters
index:int — The child index of the DisplayObject to remove.
|
DisplayObject — The DisplayObject instance that was removed.
|
setChildIndex | () | method |
public function setChildIndex(child:DisplayObject, index:int):void
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Changes the position of an existing child in the display object container. This affects the layering of child objects. For example, the following example shows three display objects, labeled a, b, and c, at index positions 0, 1, and 2, respectively:
When you use the setChildIndex()
method and specify an index position
that is already occupied, the only positions that change are those in between the display object's former and new position.
All others will stay the same.
If a child is moved to an index LOWER than its current index, all children in between will INCREASE by 1 for their index reference.
If a child is moved to an index HIGHER than its current index, all children in between will DECREASE by 1 for their index reference.
For example, if the display object container
in the previous example is named container
, you can swap the position
of the display objects labeled a and b by calling the following code:
container.setChildIndex(container.getChildAt(1), 0);
This code results in the following arrangement of objects:
Parameters
child:DisplayObject — The child DisplayObject instance for which you want to change
the index number.
| |
index:int — The resulting index number for the child display object.
|
startDrag | () | method |
public function startDrag(lockCenter:Boolean = false, bounds:Rectangle = null):void
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Lets the user drag the specified sprite. The sprite remains draggable until explicitly
stopped through a call to the Sprite.stopDrag()
method, or until
another sprite is made draggable. Only one sprite is draggable at a time.
Three-dimensional display objects follow the pointer and
Sprite.startDrag()
moves the object within
the three-dimensional plane defined by the display object. Or, if the display object is a two-dimensional object
and the child of a three-dimensional object, the two-dimensional object
moves within the three dimensional plane defined by the three-dimensional parent object.
Parameters
lockCenter:Boolean (default = false ) — Specifies whether the draggable sprite is locked to the center of
the pointer position (true ), or locked to the point where the user first clicked the
sprite (false ).
| |
bounds:Rectangle (default = null ) — Value relative to the coordinates of the Sprite's parent that specify a constraint
rectangle for the Sprite.
|
stopDrag | () | method |
public function stopDrag():void
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Ends the startDrag()
method. A sprite that was made draggable with the
startDrag()
method remains draggable until a
stopDrag()
method is added, or until another
sprite becomes draggable. Only one sprite is draggable at a time.
swapChildren | () | method |
public function swapChildren(child1:DisplayObject, child2:DisplayObject):void
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Swaps the z-order (front-to-back order) of the two specified child objects. All other child objects in the display object container remain in the same index positions.
Parameters
child1:DisplayObject — The first child object.
| |
child2:DisplayObject — The second child object.
|
swapChildrenAt | () | method |
public function swapChildrenAt(index1:int, index2:int):void
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Swaps the z-order (front-to-back order) of the child objects at the two specified index positions in the child list. All other child objects in the display object container remain in the same index positions.
Parameters
index1:int — The index position of the first child object.
| |
index2:int — The index position of the second child object.
|
Wed Nov 21 2018, 06:34 AM -08:00