Options
Menu

Class LightBase

Hierarchy

Implements

Index

Constructors

Events

Properties

Accessors

Methods

Constructors

constructor

Events

addChild

  • 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.

    throws

    ArgumentError Throws if the child is the same as the parent. Also throws if the caller is a child(or grandchild etc.) of the child being added.

    Parameters

    • child: DisplayObject

      The DisplayObject instance to add as a child of this DisplayObjectContainer instance.

    Returns DisplayObject

    The DisplayObject instance that you pass in the child parameter.

addChildAt

  • 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.

    throws

    ArgumentError Throws if the child is the same as the parent. Also throws if the caller is a child(or grandchild etc.) of the child being added.

    throws

    RangeError Throws if the index position does not exist in the child list.

    Parameters

    • child: DisplayObject

      The DisplayObject instance to add as a child of this DisplayObjectContainer instance.

    • index: number

      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.

    Returns DisplayObject

    The DisplayObject instance that you pass in the child parameter.

Properties

_adapter

_adapter: IAssetAdapter

_boundsType

_boundsType: string

Protected _boxBoundsInvalid

_boxBoundsInvalid: boolean

_children

_children: Array<DisplayObject>

_concatenatedMatrix3D

_concatenatedMatrix3D: Matrix3D

_depth

_depth: number

_depthID

_depthID: number

_explicitMasks

_explicitMasks: Array<DisplayObject>

_height

_height: number

_hierarchicalPropsDirty

_hierarchicalPropsDirty: number

_iAmbientB

_iAmbientB: number

_iAmbientG

_iAmbientG: number

_iAmbientR

_iAmbientR: number

_iController

_iController: ControllerBase
internal

_iDiffuseB

_iDiffuseB: number

_iDiffuseG

_iDiffuseG: number

_iDiffuseR

_iDiffuseR: number

_iIsPartition

_iIsPartition: boolean

_iIsRoot

_iIsRoot: boolean

_iSourcePrefab

_iSourcePrefab: PrefabBase

_iSpecularB

_iSpecularB: number

_iSpecularG

_iSpecularG: number

_iSpecularR

_iSpecularR: number

_material

_material: IMaterial

_pBoxBounds

_pBoxBounds: Box

_pImplicitColorTransform

_pImplicitColorTransform: ColorTransform

_pImplicitMaskId

_pImplicitMaskId: number

_pImplicitMaskIds

_pImplicitMaskIds: Array<Array<number>>

_pImplicitMasks

_pImplicitMasks: Array<Array<IEntity>>

_pImplicitMouseEnabled

_pImplicitMouseEnabled: boolean

_pImplicitVisibility

_pImplicitVisibility: boolean

_pIsContainer

_pIsContainer: boolean

_pIsEntity

_pIsEntity: boolean

_pName

_pName: string

_pParent

_pPartition

_pPartition: DisplayObject

_pScene

_pScene: Scene

_pSphereBounds

_pSphereBounds: Sphere

_registrationMatrix3D

_registrationMatrix3D: Matrix3D

_sessionID

_sessionID: number

_style

_style: Style

Protected _tempPoint

_tempPoint: Point

_tempTransform

_tempTransform: Matrix3D

Protected _transform

_transform: Transform

_width

_width: number

adaptee

adaptee: AssetBase

adapter

adapter: IAssetAdapter

adapter is used to provide MovieClip to scripts taken from different platforms setter typically managed by factory. getter defaults to AwayJS class

alignmentMode

alignmentMode: string

assetFullPath

assetFullPath: Array<string>

assetNamespace

assetNamespace: string

blendMode

blendMode: BlendMode

A value from the BlendMode class that specifies which blend mode to use. A bitmap can be drawn internally in two ways. If you have a blend mode enabled or an external clipping mask, the bitmap is drawn by adding a bitmap-filled square shape to the vector render. If you attempt to set this property to an invalid value, Flash runtimes set the value to BlendMode.NORMAL.

The blendMode property affects each pixel of the display object. Each pixel is composed of three constituent colors(red, green, and blue), and each constituent color has a value between 0x00 and 0xFF. Flash Player or Adobe AIR compares each constituent color of one pixel in the movie clip with the corresponding color of the pixel in the background. For example, if blendMode is set to BlendMode.LIGHTEN, Flash Player or Adobe AIR compares the red value of the display object with the red value of the background, and uses the lighter of the two as the value for the red component of the displayed color.

The following table describes the blendMode settings. The BlendMode class defines string values you can use. The illustrations in the table show blendMode values applied to a circular display object(2) superimposed on another display object(1).

cacheAsBitmap

cacheAsBitmap: boolean

If set to true, NME will use the software renderer to cache an internal bitmap representation of the display object. For native targets, this is often much slower than the default hardware renderer. When you are using the Flash target, this caching may increase performance for display objects that contain complex vector content.

All vector data for a display object that has a cached bitmap is drawn to the bitmap instead of the main display. If cacheAsBitmapMatrix is null or unsupported, the bitmap is then copied to the main display as unstretched, unrotated pixels snapped to the nearest pixel boundaries. Pixels are mapped 1 to 1 with the parent object. If the bounds of the bitmap change, the bitmap is recreated instead of being stretched.

If cacheAsBitmapMatrix is non-null and supported, the object is drawn to the off-screen bitmap using that matrix and the stretched and/or rotated results of that rendering are used to draw the object to the main display.

No internal bitmap is created unless the cacheAsBitmap property is set to true.

After you set the cacheAsBitmap property to true, the rendering does not change, however the display object performs pixel snapping automatically. The animation speed can be significantly faster depending on the complexity of the vector content.

The cacheAsBitmap property is automatically set to true whenever you apply a filter to a display object(when its filter array is not empty), and if a display object has a filter applied to it, cacheAsBitmap is reported as true for that display object, even if you set the property to false. If you clear all filters for a display object, the cacheAsBitmap setting changes to what it was last set to.

A display object does not use a bitmap even if the cacheAsBitmap property is set to true and instead renders from vector data in the following cases:

  • The bitmap is too large. In AIR 1.5 and Flash Player 10, the maximum size for a bitmap image is 8,191 pixels in width or height, and the total number of pixels cannot exceed 16,777,215 pixels.(So, if a bitmap image is 8,191 pixels wide, it can only be 2,048 pixels high.) In Flash Player 9 and earlier, the limitation is is 2880 pixels in height and 2,880 pixels in width.
  • The bitmap fails to allocate(out of memory error).

The cacheAsBitmap property is best used with movie clips that have mostly static content and that do not scale and rotate frequently. With such movie clips, cacheAsBitmap can lead to performance increases when the movie clip is translated(when its x and y position is changed).

castsShadows

castsShadows: boolean

extra

extra: Object

An object that can contain any extra data.

id

id: number

A unique id for the asset, used to identify assets in an associative array

isSlice9ScaledMC

isSlice9ScaledMC: boolean

isSlice9ScaledSprite

isSlice9ScaledSprite: boolean

mask

The calling display object is masked by the specified mask object. To ensure that masking works when the Stage is scaled, the mask display object must be in an active part of the display list. The mask object itself is not drawn. Set mask to null to remove the mask.

To be able to scale a mask object, it must be on the display list. To be able to drag a mask Sprite object(by calling its startDrag() method), it must be on the display list. To call the startDrag() method for a mask sprite based on a mouseDown event being dispatched by the sprite, set the sprite's buttonMode property to true.

When display objects are cached by setting the cacheAsBitmap property to true an the cacheAsBitmapMatrix property to a Matrix object, both the mask and the display object being masked must be part of the same cached bitmap. Thus, if the display object is cached, then the mask must be a child of the display object. If an ancestor of the display object on the display list is cached, then the mask must be a child of that ancestor or one of its descendents. If more than one ancestor of the masked object is cached, then the mask must be a descendent of the cached container closest to the masked object in the display list.

Note: A single mask object cannot be used to mask more than one calling display object. When the mask is assigned to a second display object, it is removed as the mask of the first object, and that object's mask property becomes null.

orientationMode

orientationMode: string

originalName

originalName: string

The original name used for this asset in the resource (e.g. file) in which it was found. This may not be the same as name, which may have changed due to of a name conflict.

rotation

rotation: number

Indicates the rotation of the DisplayObject instance, in degrees, from its original orientation. 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. For example, the statement my_video.rotation = 450 is the same as my_video.rotation = 90.

scale9Grid

scale9Grid: Rectangle

The current scaling grid that is in effect. If set to null, the entire display object is scaled normally when any scale transformation is applied.

When you define the scale9Grid property, the display object is divided into a grid with nine regions based on the scale9Grid rectangle, which defines the center region of the grid. The eight other regions of the grid are the following areas:

  • The upper-left corner outside of the rectangle
  • The area above the rectangle
  • The upper-right corner outside of the rectangle
  • The area to the left of the rectangle
  • The area to the right of the rectangle
  • The lower-left corner outside of the rectangle
  • The area below the rectangle
  • The lower-right corner outside of the rectangle

You can think of the eight regions outside of the center(defined by the rectangle) as being like a picture frame that has special rules applied to it when scaled.

When the scale9Grid property is set and a display object is scaled, all text and gradients are scaled normally; however, for other types of objects the following rules apply:

  • Content in the center region is scaled normally.
  • Content in the corners is not scaled.
  • Content in the top and bottom regions is scaled horizontally only. Content in the left and right regions is scaled vertically only.
  • All fills(including bitmaps, video, and gradients) are stretched to fit their shapes.

If a display object is rotated, all subsequent scaling is normal(and the scale9Grid property is ignored).

For example, consider the following display object and a rectangle that is applied as the display object's scale9Grid:

A common use for setting scale9Grid is to set up a display object to be used as a component, in which edge regions retain the same width when the component is scaled.

throws

ArgumentError If you pass an invalid argument to the method.

scrollRect

scrollRect: Rectangle

The scroll rectangle bounds of the display object. The display object is cropped to the size defined by the rectangle, and it scrolls within the rectangle when you change the x and y properties of the scrollRect object.

The properties of the scrollRect Rectangle object use the display object's coordinate space and are scaled just like the overall display object. The corner bounds of the cropped window on the scrolling display object are the origin of the display object(0,0) and the point defined by the width and height of the rectangle. They are not centered around the origin, but use the origin to define the upper-left corner of the area. A scrolled display object always scrolls in whole pixel increments.

You can scroll an object left and right by setting the x property of the scrollRect Rectangle object. You can scroll an object up and down by setting the y property of the scrollRect Rectangle object. If the display object is rotated 90° and you scroll it left and right, the display object actually scrolls up and down.

tabChildren

tabChildren: boolean

Determines whether the children of the object are tab enabled. Enables or disables tabbing for the children of the object. The default is true.

Note: Do not use the tabChildren property with Flex. Instead, use the mx.core.UIComponent.hasFocusableChildren property.

throws

IllegalOperationError Calling this property of the Stage object throws an exception. The Stage object does not implement this property.

zOffset

zOffset: number

Static DEFAULT_NAMESPACE

DEFAULT_NAMESPACE: string

Static ID_COUNT

ID_COUNT: number

Static assetType

assetType: string

Static traverseName

traverseName: string

Accessors

_iPickingCollision

  • get (): PickingCollision

alpha

  • get (): number
  • set (value: number): void
  • Indicates the alpha transparency value of the object specified. Valid values are 0(fully transparent) to 1(fully opaque). The default value is

    1. Display objects with alpha set to 0 are active, even though they are invisible.

    Returns number

  • Indicates the alpha transparency value of the object specified. Valid values are 0(fully transparent) to 1(fully opaque). The default value is

    1. Display objects with alpha set to 0 are active, even though they are invisible.

    Parameters

    • value: number

    Returns void

ambient

  • get (): number
  • set (value: number): void
  • Returns number

  • Parameters

    • value: number

    Returns void

ambientColor

  • get (): number
  • set (value: number): void
  • Returns number

  • Parameters

    • value: number

    Returns void

animator

  • get (): IAnimator
  • set (value: IAnimator): void
  • Defines the animator of the display object. Default value is null.

    Returns IAnimator

  • Defines the animator of the display object. Default value is null.

    Parameters

    • value: IAnimator

    Returns void

assetType

  • get (): string

boundsType

  • get (): string
  • set (value: string): void

color

  • get (): number
  • set (value: number): void
  • Returns number

  • Parameters

    • value: number

    Returns void

debugVisible

  • get (): boolean
  • set (value: boolean): void

depth

  • get (): number
  • set (val: number): void
  • Indicates the depth of the display object, in pixels. The depth is calculated based on the bounds of the content of the display object. When you set the depth property, the scaleZ property is adjusted accordingly, as shown in the following code:

    Except for TextField and Video objects, a display object with no content (such as an empty sprite) has a depth of 0, even if you try to set depth to a different value.

    Returns number

  • Indicates the depth of the display object, in pixels. The depth is calculated based on the bounds of the content of the display object. When you set the depth property, the scaleZ property is adjusted accordingly, as shown in the following code:

    Except for TextField and Video objects, a display object with no content (such as an empty sprite) has a depth of 0, even if you try to set depth to a different value.

    Parameters

    • val: number

    Returns void

diffuse

  • get (): number
  • set (value: number): void
  • Returns number

  • Parameters

    • value: number

    Returns void

eulers

  • get (): Vector3D
  • set (value: Vector3D): void
  • Defines the rotation of the 3d object as a Vector3D object containing euler angles for rotation around x, y and z axis.

    Returns Vector3D

  • Defines the rotation of the 3d object as a Vector3D object containing euler angles for rotation around x, y and z axis.

    Parameters

    • value: Vector3D

    Returns void

height

  • get (): number
  • set (val: number): void
  • Indicates the height of the display object, in pixels. The height is calculated based on the bounds of the content of the display object. When you set the height property, the scaleY property is adjusted accordingly, as shown in the following code:

    Except for TextField and Video objects, a display object with no content (such as an empty sprite) has a height of 0, even if you try to set height to a different value.

    Returns number

  • Indicates the height of the display object, in pixels. The height is calculated based on the bounds of the content of the display object. When you set the height property, the scaleY property is adjusted accordingly, as shown in the following code:

    Except for TextField and Video objects, a display object with no content (such as an empty sprite) has a height of 0, even if you try to set height to a different value.

    Parameters

    • val: number

    Returns void

index

  • get (): number
  • Indicates the instance container index of the DisplayObject. The object can be identified in the child list of its parent display object container by calling the getChildByIndex() method of the display object container.

    If the DisplayObject has no parent container, index defaults to 0.

    Returns number

inheritColorTransform

  • get (): boolean
  • set (value: boolean): void

isContainer

  • get (): boolean

isEntity

  • get (): boolean

isPartition

  • get (): boolean
  • set (value: boolean): void

loaderInfo

  • get (): LoaderInfo
  • Returns a LoaderInfo object containing information about loading the file to which this display object belongs. The loaderInfo property is defined only for the root display object of a SWF file or for a loaded Bitmap(not for a Bitmap that is drawn with ActionScript). To find the loaderInfo object associated with the SWF file that contains a display object named myDisplayObject, use myDisplayObject.root.loaderInfo.

    A large SWF file can monitor its download by calling this.root.loaderInfo.addEventListener(Event.COMPLETE, func).

    Returns LoaderInfo

maskMode

  • get (): boolean
  • set (value: boolean): void
  • Returns boolean

  • Parameters

    • value: boolean

    Returns void

masks

material

  • get (): IMaterial
  • set (value: IMaterial): void
  • Returns IMaterial

  • Parameters

    • value: IMaterial

    Returns void

mouseChildren

  • get (): boolean
  • set (value: boolean): void
  • 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.

    Returns boolean

  • 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.

    Parameters

    • value: boolean

    Returns void

mouseEnabled

  • get (): boolean
  • set (value: boolean): void
  • 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.

    Returns boolean

  • 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.

    Parameters

    • value: boolean

    Returns void

mouseX

  • get (): number
  • Indicates the x coordinate of the mouse or user input device position, in pixels.

    Note: For a DisplayObject that has been rotated, the returned x coordinate will reflect the non-rotated object.

    Returns number

mouseY

  • get (): number
  • Indicates the y coordinate of the mouse or user input device position, in pixels.

    Note: For a DisplayObject that has been rotated, the returned y coordinate will reflect the non-rotated object.

    Returns number

name

  • get (): string
  • set (value: string): void
  • Indicates the instance name of the DisplayObject. The object can be identified in the child list of its parent display object container by calling the getChildByName() method of the display object container.

    throws

    IllegalOperationError If you are attempting to set this property on an object that was placed on the timeline in the Flash authoring tool.

    Returns string

  • Indicates the instance name of the DisplayObject. The object can be identified in the child list of its parent display object container by calling the getChildByName() method of the display object container.

    Parameters

    • value: string

    Returns void

numChildren

  • get (): number

parent

  • Indicates the DisplayObjectContainer object that contains this display object. Use the parent property to specify a relative path to display objects that are above the current display object in the display list hierarchy.

    You can use parent to move up multiple levels in the display list as in the following:

    throws

    SecurityError The parent display object belongs to a security sandbox to which you do not have access. You can avoid this situation by having the parent movie call the Security.allowDomain() method.

    Returns DisplayObjectContainer

partition

  • get (): IEntity

registrationPoint

  • get (): Vector3D
  • set (value: Vector3D): void
  • Defines the local point around which the object rotates.

    Returns Vector3D

  • Defines the local point around which the object rotates.

    Parameters

    • value: Vector3D

    Returns void

registrationScale

  • get (): Vector3D
  • set (value: Vector3D): void

root

  • 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. For a Bitmap object representing a loaded image file, the root property is the Bitmap object itself. For the instance of the main class of the first SWF file loaded, the root property is the display object itself. The root property of the Scene object is the Scene object itself. The root property is set to null for any display object that has not been added to the display list, unless it has been added to a display object container that is off the display list but that is a child of the top-most display object in a loaded SWF file.

    For example, if you create a new Sprite object by calling the Sprite() constructor method, its root property is null until you add it to the display list(or to a display object container that is off the display list but that is a child of the top-most display object in a SWF file).

    For a loaded SWF file, even though the Loader object used to load the file may not be on the display list, the top-most display object in the SWF file has its root property set to itself. The Loader object does not have its root property set until it is added as a child of a display object for which the root property is set.

    Returns DisplayObjectContainer

rotationX

  • get (): number
  • set (val: number): void
  • 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.

    Returns number

  • 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.

    Parameters

    • val: number

    Returns void

rotationY

  • get (): number
  • set (val: number): void
  • 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.

    Returns number

  • 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.

    Parameters

    • val: number

    Returns void

rotationZ

  • get (): number
  • set (val: number): void
  • Indicates the z-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.

    Returns number

  • Indicates the z-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.

    Parameters

    • val: number

    Returns void

scaleX

  • get (): number
  • set (val: number): void
  • Indicates the horizontal scale(percentage) of the object as applied from the registration point. The default registration point is(0,0). 1.0 equals 100% scale.

    Scaling the local coordinate system changes the x and y property values, which are defined in whole pixels.

    Returns number

  • Indicates the horizontal scale(percentage) of the object as applied from the registration point. The default registration point is(0,0). 1.0 equals 100% scale.

    Scaling the local coordinate system changes the x and y property values, which are defined in whole pixels.

    Parameters

    • val: number

    Returns void

scaleY

  • get (): number
  • set (val: number): void
  • Indicates the vertical scale(percentage) of an object as applied from the registration point of the object. The default registration point is(0,0). 1.0 is 100% scale.

    Scaling the local coordinate system changes the x and y property values, which are defined in whole pixels.

    Returns number

  • Indicates the vertical scale(percentage) of an object as applied from the registration point of the object. The default registration point is(0,0). 1.0 is 100% scale.

    Scaling the local coordinate system changes the x and y property values, which are defined in whole pixels.

    Parameters

    • val: number

    Returns void

scaleZ

  • get (): number
  • set (val: number): void
  • Indicates the depth scale(percentage) of an object as applied from the registration point of the object. The default registration point is(0,0). 1.0 is 100% scale.

    Scaling the local coordinate system changes the x, y and z property values, which are defined in whole pixels.

    Returns number

  • Indicates the depth scale(percentage) of an object as applied from the registration point of the object. The default registration point is(0,0). 1.0 is 100% scale.

    Scaling the local coordinate system changes the x, y and z property values, which are defined in whole pixels.

    Parameters

    • val: number

    Returns void

scene

scenePosition

  • get (): Vector3D

shaderPickingDetails

  • get (): boolean

shadowMapper

shadowsEnabled

  • get (): boolean
  • set (value: boolean): void
  • Returns boolean

  • Parameters

    • value: boolean

    Returns void

skewX

  • get (): number
  • set (val: number): void
  • Indicates the horizontal skew(angle) of the object as applied from the registration point. The default registration point is(0,0).

    Returns number

  • Indicates the horizontal skew(angle) of the object as applied from the registration point. The default registration point is(0,0).

    Parameters

    • val: number

    Returns void

skewY

  • get (): number
  • set (val: number): void
  • Indicates the vertical skew(angle) of an object as applied from the registration point of the object. The default registration point is(0,0).

    Returns number

  • Indicates the vertical skew(angle) of an object as applied from the registration point of the object. The default registration point is(0,0).

    Parameters

    • val: number

    Returns void

skewZ

  • get (): number
  • set (val: number): void
  • Indicates the depth skew(angle) of an object as applied from the registration point of the object. The default registration point is(0,0).

    Returns number

  • Indicates the depth skew(angle) of an object as applied from the registration point of the object. The default registration point is(0,0).

    Parameters

    • val: number

    Returns void

specular

  • get (): number
  • set (value: number): void
  • Returns number

  • Parameters

    • value: number

    Returns void

style

  • get (): Style
  • set (value: Style): void
  • Returns Style

  • Parameters

    • value: Style

    Returns void

transform

  • get (): Transform
  • An object with properties pertaining to a display object's matrix, color transform, and pixel bounds. The specific properties - matrix, colorTransform, and three read-only properties (concatenatedMatrix, concatenatedColorTransform, and pixelBounds) - are described in the entry for the Transform class.

    Each of the transform object's properties is itself an object. This concept is important because the only way to set new values for the matrix or colorTransform objects is to create a new object and copy that object into the transform.matrix or transform.colorTransform property.

    For example, to increase the tx value of a display object's matrix, you must make a copy of the entire matrix object, then copy the new object into the matrix property of the transform object:

     public myMatrix:Matrix =
    myDisplayObject.transform.matrix; myMatrix.tx += 10;
    myDisplayObject.transform.matrix = myMatrix; 

    You cannot directly set the tx property. The following code has no effect on myDisplayObject:

     myDisplayObject.transform.matrix.tx +=
    10; 

    You can also copy an entire transform object and assign it to another display object's transform property. For example, the following code copies the entire transform object from myOldDisplayObj to myNewDisplayObj:

    myNewDisplayObj.transform = myOldDisplayObj.transform;

    The resulting display object, myNewDisplayObj, now has the same values for its matrix, color transform, and pixel bounds as the old display object, myOldDisplayObj.

    Note that AIR for TV devices use hardware acceleration, if it is available, for color transforms.

    Returns Transform

traverseName

  • get (): string

visible

  • get (): boolean
  • set (value: boolean): void
  • 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.

    Returns boolean

  • 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.

    Parameters

    • value: boolean

    Returns void

width

  • get (): number
  • set (val: number): void
  • Indicates the width of the display object, in pixels. The width is calculated based on the bounds of the content of the display object. When you set the width property, the scaleX property is adjusted accordingly, as shown in the following code:

    Except for TextField and Video objects, a display object with no content(such as an empty sprite) has a width of 0, even if you try to set width to a different value.

    Returns number

  • Indicates the width of the display object, in pixels. The width is calculated based on the bounds of the content of the display object. When you set the width property, the scaleX property is adjusted accordingly, as shown in the following code:

    Except for TextField and Video objects, a display object with no content(such as an empty sprite) has a width of 0, even if you try to set width to a different value.

    Parameters

    • val: number

    Returns void

x

  • get (): number
  • set (val: number): void
  • Indicates the x coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer. If the object is inside a DisplayObjectContainer that has transformations, it is in the local coordinate system of the enclosing DisplayObjectContainer. Thus, for a DisplayObjectContainer rotated 90° counterclockwise, the DisplayObjectContainer's children inherit a coordinate system that is rotated 90° counterclockwise. The object's coordinates refer to the registration point position.

    Returns number

  • Indicates the x coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer. If the object is inside a DisplayObjectContainer that has transformations, it is in the local coordinate system of the enclosing DisplayObjectContainer. Thus, for a DisplayObjectContainer rotated 90° counterclockwise, the DisplayObjectContainer's children inherit a coordinate system that is rotated 90° counterclockwise. The object's coordinates refer to the registration point position.

    Parameters

    • val: number

    Returns void

y

  • get (): number
  • set (val: number): void
  • Indicates the y coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer. If the object is inside a DisplayObjectContainer that has transformations, it is in the local coordinate system of the enclosing DisplayObjectContainer. Thus, for a DisplayObjectContainer rotated 90° counterclockwise, the DisplayObjectContainer's children inherit a coordinate system that is rotated 90° counterclockwise. The object's coordinates refer to the registration point position.

    Returns number

  • Indicates the y coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer. If the object is inside a DisplayObjectContainer that has transformations, it is in the local coordinate system of the enclosing DisplayObjectContainer. Thus, for a DisplayObjectContainer rotated 90° counterclockwise, the DisplayObjectContainer's children inherit a coordinate system that is rotated 90° counterclockwise. The object's coordinates refer to the registration point position.

    Parameters

    • val: number

    Returns void

z

  • get (): number
  • set (val: number): void
  • Indicates the z coordinate position along the z-axis of the DisplayObject instance relative to the 3D parent container. The z property is used for 3D coordinates, not screen or pixel coordinates.

    When you set a z property for a display object to something other than the default value of 0, a corresponding Matrix3D object is automatically created. for adjusting a display object's position and orientation in three dimensions. When working with the z-axis, the existing behavior of x and y properties changes from screen or pixel coordinates to positions relative to the 3D parent container.

    For example, a child of the _root at position x = 100, y = 100, z = 200 is not drawn at pixel location(100,100). The child is drawn wherever the 3D projection calculation puts it. The calculation is:

    (xcameraFocalLength/cameraRelativeZPosition, ycameraFocalLength/cameraRelativeZPosition)

    Returns number

  • Indicates the z coordinate position along the z-axis of the DisplayObject instance relative to the 3D parent container. The z property is used for 3D coordinates, not screen or pixel coordinates.

    When you set a z property for a display object to something other than the default value of 0, a corresponding Matrix3D object is automatically created. for adjusting a display object's position and orientation in three dimensions. When working with the z-axis, the existing behavior of x and y properties changes from screen or pixel coordinates to positions relative to the 3D parent container.

    For example, a child of the _root at position x = 100, y = 100, z = 200 is not drawn at pixel location(100,100). The child is drawn wherever the 3D projection calculation puts it. The calculation is:

    (xcameraFocalLength/cameraRelativeZPosition, ycameraFocalLength/cameraRelativeZPosition)

    Parameters

    • val: number

    Returns void

Methods

_acceptTraverser

  • _acceptTraverser(traverser: TraverserBase): void

_hitTestPointInternal

  • _hitTestPointInternal(x: number, y: number, shapeFlag: boolean, masksFlag: boolean): boolean

_iAssignedColorTransform

  • _iAssignedColorTransform(): ColorTransform

_iAssignedMaskId

  • _iAssignedMaskId(): number

_iAssignedMasks

  • _iAssignedMasks(): Array<Array<IEntity>>

_iInternalUpdate

  • _iInternalUpdate(): void

_iIsMouseEnabled

  • _iIsMouseEnabled(): boolean

_iIsVisible

  • _iIsVisible(): boolean

_iMasksConfig

  • _iMasksConfig(): Array<Array<number>>

_iSetScene

Protected _invalidateChildren

  • _invalidateChildren(): void

Protected _isEntityInternal

  • _isEntityInternal(): boolean

_onInvalidateProperties

  • _onInvalidateProperties(event?: StyleEvent): void

Protected _onUpdateConcatenatedMatrix3D

  • _onUpdateConcatenatedMatrix3D(event: TransformEvent): void

_pInvalidateBounds

  • _pInvalidateBounds(): void

Protected _pUpdateBoxBounds

  • _pUpdateBoxBounds(): void

_pUpdateSphereBounds

  • _pUpdateSphereBounds(): void

Protected _setScaleX

  • _setScaleX(val: number): void
  • Parameters

    • val: number

    Returns void

Protected _setScaleY

  • _setScaleY(val: number): void
  • Parameters

    • val: number

    Returns void

Protected _setScaleZ

  • _setScaleZ(val: number): void
  • Parameters

    • val: number

    Returns void

_updateMaskMode

  • _updateMaskMode(): void

_updateMouseEnabled

  • _updateMouseEnabled(): void

addChildAtDepth

addChildren

addEventListener

  • addEventListener(type: string, listener: function): void
  • Parameters

    • type: string
    • listener: function
        • (event: EventBase): void
        • Parameters

          • event: EventBase

          Returns void

    Returns void

assetPathEquals

  • assetPathEquals(name: string, ns: string): boolean
  • Parameters

    • name: string
    • ns: string

    Returns boolean

clear

  • clear(): void
  • Returns void

clone

contains

  • 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

    Returns boolean

    true if the child object is a child of the DisplayObjectContainer or the container itself; otherwise false.

copyTo

dispatchEvent

  • dispatchEvent(event: EventBase): void
  • Dispatch an event

    method

    dispatchEvent

    Parameters

    • event: EventBase

    Returns void

dispose

  • dispose(): void
  • Returns void

disposeValues

  • disposeValues(): void

getBounds

  • Returns a rectangle that defines the area of the display object relative to the coordinate system of the targetCoordinateSpace object. Consider the following code, which shows how the rectangle returned can vary depending on the targetCoordinateSpace parameter that you pass to the method:

    Note: Use the localToGlobal() and globalToLocal() methods to convert the display object's local coordinates to display coordinates, or display coordinates to local coordinates, respectively.

    The getBounds() method is similar to the getRect() method; however, the Rectangle returned by the getBounds() method includes any strokes on shapes, whereas the Rectangle returned by the getRect() method does not. For an example, see the description of the getRect() method.

    Parameters

    • targetCoordinateSpace: DisplayObject

      The display object that defines the coordinate system to use.

    Returns Rectangle

    The rectangle that defines the area of the display object relative to the targetCoordinateSpace object's coordinate system.

getBox

  • Parameters

    Returns Box

getChildAt

  • Returns the child display object instance that exists at the specified index.

    throws

    RangeError Throws if the index does not exist in the child list.

    Parameters

    • index: number

      The index position of the child object.

    Returns DisplayObject

    The child display object at the specified index position.

getChildAtDepth

getChildByName

  • 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.

    Returns DisplayObject

    The child display object with the specified name.

getChildIndex

  • Returns the index position of a child DisplayObject instance.

    throws

    ArgumentError Throws if the child parameter is not a child of this object.

    Parameters

    Returns number

    The index position of the child display object to identify.

getDepthIndexInternal

  • getDepthIndexInternal(depth: number): number

getNextHighestDepth

  • getNextHighestDepth(): number

getObjectsUnderPoint

  • 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.

    Returns Array<DisplayObject>

    An array of objects that lie under the specified point and are children(or grandchildren, and so on) of this DisplayObjectContainer instance.

getRect

  • 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. The values that the getRect() method returns are the same or smaller than those returned by the getBounds() method.

    Note: Use localToGlobal() and globalToLocal() methods to convert the display object's local coordinates to Scene coordinates, or Scene coordinates to local coordinates, respectively.

    Parameters

    • Default value targetCoordinateSpace: DisplayObject = null

      The display object that defines the coordinate system to use.

    Returns Rectangle

    The rectangle that defines the area of the display object relative to the targetCoordinateSpace object's coordinate system.

getRenderSceneTransform

  • getRenderSceneTransform(cameraTransform: Matrix3D): Matrix3D

getSphere

globalToLocal

  • globalToLocal(point: Point, target?: Point): Point
  • Converts the point object from the Scene(global) coordinates to the display object's(local) coordinates.

    To use this method, first create an instance of the Point class. The x and y values that you assign represent global coordinates because they relate to the origin(0,0) of the main display area. Then pass the Point instance as the parameter to the globalToLocal() method. The method returns a new Point object with x and y values that relate to the origin of the display object instead of the origin of the Scene.

    Parameters

    • point: Point

      An object created with the Point class. The Point object specifies the x and y coordinates as properties.

    • Default value target: Point = null

    Returns Point

    A Point object with coordinates relative to the display object.

globalToLocal3D

  • globalToLocal3D(position: Vector3D): Vector3D
  • Converts a two-dimensional point from the Scene(global) coordinates to a three-dimensional display object's(local) coordinates.

    To use this method, first create an instance of the Vector3D class. The x, y and z values that you assign to the Vector3D object represent global coordinates because they are relative to the origin(0,0,0) of the scene. Then pass the Vector3D object to the globalToLocal3D() method as the position parameter. The method returns three-dimensional coordinates as a Vector3D object containing x, y, and z values that are relative to the origin of the three-dimensional display object.

    Parameters

    • position: Vector3D

    Returns Vector3D

    A Vector3D object with coordinates relative to the three-dimensional display object.

hasEventListener

  • hasEventListener(type: string, listener?: function): boolean
  • check if an object has an event listener assigned to it

    method

    hasListener

    Parameters

    • type: string
    • Optional listener: function
        • (event: EventBase): void
        • Parameters

          • event: EventBase

          Returns void

    Returns boolean

hitTestObject

  • Evaluates the bounding box of the display object to see if it overlaps or intersects with the bounding box of the obj display object.

    Parameters

    Returns boolean

    true if the bounding boxes of the display objects intersect; false if not.

hitTestPoint

  • hitTestPoint(x: number, y: number, shapeFlag?: boolean, masksFlag?: boolean): boolean
  • Evaluates the display object to see if it overlaps or intersects with the point specified by the x and y parameters. The x and y parameters specify a point in the coordinate space of the Scene, not the display object container that contains the display object(unless that display object container is the Scene).

    Parameters

    • x: number

      The x coordinate to test against this object.

    • y: number

      The y coordinate to test against this object.

    • Default value shapeFlag: boolean = false

      Whether to check against the actual pixels of the object (true) or the bounding box (false).

    • Default value masksFlag: boolean = false

    Returns boolean

    true if the display object overlaps or intersects with the specified point; false otherwise.

iGetObjectProjectionMatrix

  • iGetObjectProjectionMatrix(entity: IEntity, cameraTransform: Matrix3D, target?: Matrix3D): Matrix3D
  • Parameters

    • entity: IEntity
    • cameraTransform: Matrix3D
    • Default value target: Matrix3D = null

    Returns Matrix3D

iSetParent

invalidate

  • invalidate(): void
  • Returns void

invalidateElements

  • invalidateElements(): void

invalidateMaterial

  • invalidateMaterial(): void

invalidatePartitionBounds

  • invalidatePartitionBounds(): void

isAsset

  • isAsset(assetClass: IAssetClass): boolean
  • Parameters

    • assetClass: IAssetClass

    Returns boolean

localToGlobal

  • localToGlobal(point: Point, target?: Point): Point
  • Converts the point object from the display object's(local) coordinates to the Scene(global) coordinates.

    This method allows you to convert any given x and y coordinates from values that are relative to the origin(0,0) of a specific display object(local coordinates) to values that are relative to the origin of the Scene(global coordinates).

    To use this method, first create an instance of the Point class. The x and y values that you assign represent local coordinates because they relate to the origin of the display object.

    You then pass the Point instance that you created as the parameter to the localToGlobal() method. The method returns a new Point object with x and y values that relate to the origin of the Scene instead of the origin of the display object.

    Parameters

    • point: Point

      The name or identifier of a point created with the Point class, specifying the x and y coordinates as properties.

    • Default value target: Point = null

    Returns Point

    A Point object with coordinates relative to the Scene.

localToGlobal3D

  • localToGlobal3D(position: Vector3D): Vector3D
  • Converts a three-dimensional point of the three-dimensional display object's(local) coordinates to a three-dimensional point in the Scene (global) coordinates.

    This method allows you to convert any given x, y and z coordinates from values that are relative to the origin(0,0,0) of a specific display object(local coordinates) to values that are relative to the origin of the Scene(global coordinates).

    To use this method, first create an instance of the Point class. The x and y values that you assign represent local coordinates because they relate to the origin of the display object.

    You then pass the Vector3D instance that you created as the parameter to the localToGlobal3D() method. The method returns a new Vector3D object with x, y and z values that relate to the origin of the Scene instead of the origin of the display object.

    Parameters

    • position: Vector3D

      A Vector3D object containing either a three-dimensional position or the coordinates of the three-dimensional display object.

    Returns Vector3D

    A Vector3D object representing a three-dimensional position in the Scene.

lookAt

  • lookAt(scenePosition: Vector3D, upAxis?: Vector3D): void
  • Rotates the 3d object around to face a point defined relative to the local coordinates of the parent ObjectContainer3D.

    Parameters

    • scenePosition: Vector3D
    • Default value upAxis: Vector3D = null

      An optional vector used to define the desired up orientation of the 3d object after rotation has occurred

    Returns void

movePivot

  • movePivot(dx: number, dy: number, dz: number): void
  • Moves the local point around which the object rotates.

    Parameters

    • dx: number

      The amount of movement along the local x axis.

    • dy: number

      The amount of movement along the local y axis.

    • dz: number

      The amount of movement along the local z axis.

    Returns void

pCreateShadowMapper

Protected pInvalidateHierarchicalProperties

  • pInvalidateHierarchicalProperties(propDirty: number): boolean

removeChild

  • 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.

    throws

    ArgumentError Throws if the child parameter is not a child of this object.

    Parameters

    Returns DisplayObject

    The DisplayObject instance that you pass in the child parameter.

removeChildAt

  • 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.

    throws

    RangeError Throws if the index does not exist in the child list.

    throws

    SecurityError This child display object belongs to a sandbox to which the calling object does not have access. You can avoid this situation by having the child movie call the Security.allowDomain() method.

    Parameters

    • index: number

      The child index of the DisplayObject to remove.

    Returns DisplayObject

    The DisplayObject instance that was removed.

removeChildAtDepth

Private removeChildAtInternal

removeChildren

  • removeChildren(beginIndex?: number, endIndex?: number): void
  • Removes all child DisplayObject instances from the child list of the DisplayObjectContainer instance. The parent property of the removed children is set to null, and the objects are garbage collected if no other references to the children exist.

    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.

    throws

    RangeError Throws if the beginIndex or endIndex positions do not exist in the child list.

    Parameters

    • Default value beginIndex: number = 0

      The beginning position. A value smaller than 0 throws a RangeError.

    • Default value endIndex: number = 2147483647

      The ending position. A value smaller than 0 throws a RangeError.

    Returns void

removeEventListener

  • removeEventListener(type: string, listener: function): void
  • Parameters

    • type: string
    • listener: function
        • (event: EventBase): void
        • Parameters

          • event: EventBase

          Returns void

    Returns void

reset

  • reset(): void
  • Returns void

resetAssetPath

  • resetAssetPath(name: string, ns?: string, overrideOriginal?: boolean): void
  • Parameters

    • name: string
    • Optional ns: string
    • Optional overrideOriginal: boolean

    Returns void

setChildIndex

  • 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:

    This code results in the following arrangement of objects:

    throws

    ArgumentError Throws if the child parameter is not a child of this object.

    throws

    RangeError Throws if the index does not exist in the child list.

    Parameters

    • child: DisplayObject

      The child DisplayObject instance for which you want to change the index number.

    • index: number

      The resulting index number for the child display object.

    Returns void

swapChildren

  • 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.

    throws

    ArgumentError Throws if either child parameter is not a child of this object.

    Parameters

    Returns void

swapChildrenAt

  • swapChildrenAt(index1: number, index2: number): void
  • 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.

    throws

    RangeError If either index does not exist in the child list.

    Parameters

    • index1: number

      The index position of the first child object.

    • index2: number

      The index position of the second child object.

    Returns void

updateFullPath

  • updateFullPath(): void
  • Returns void

Generated using TypeDoc