ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Show Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes
org.osmf.elements 

CompositeElement  - AS3 OSMF

Packageorg.osmf.elements
Classpublic class CompositeElement
InheritanceCompositeElement Inheritance MediaElement Inheritance EventDispatcher Inheritance Object
Subclasses ParallelElement, SerialElement

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

CompositeElement is a media element which encapsulates a collection of other more granular media elements. It is generally referred to as a media composition.

The media elements that make up a media composition are treated as a single, unified media element. For example, if a media composition encapsulates a sequence of videos, the CompositeElement will behave as if it's a single VideoElement, but one which plays several videos in sequence.

Because a CompositeElement maintains a list of MediaElement children, any of which may be CompositeElements themselves, a media composition can be expressed as a tree structure.

Typically a CompositeElement is not instantiated directly but instead is used as the base class for creating specific types of media compositions.



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 Inheritedcontainer : IMediaContainer
[read-only] The media container that this element uses.
MediaElement
 InheritedmetadataNamespaceURLs : Vector.<String>
[read-only] A Vector containing the namespace URLs for all Metadata objects stored within this MediaElement.
MediaElement
  numChildren : int
[read-only] The number of child MediaElements in this media composition.
CompositeElement
 Inheritedresource : MediaResourceBase
The media resource that this media element operates on.
MediaElement
 InheritedtraitTypes : Vector.<String>
[read-only] A Vector of MediaTraitType values representing the trait types on this media element.
MediaElement
Public Methods
 MethodDefined By
  
Constructor.
CompositeElement
  
Adds the specified child to the end of the list.
CompositeElement
  
Adds the child to the list at the specified index.
CompositeElement
 Inherited
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.
EventDispatcher
 Inherited
addMetadata(namespaceURL:String, metadata:Metadata):void
Adds a Metadata object to this MediaElement under the specified namespace URL.
MediaElement
 Inherited
Dispatches an event into the event flow.
EventDispatcher
  
Gets the child at the specified index.
CompositeElement
  
Returns the index of the child if it is in the list such that getChildAt(index) == child.
CompositeElement
 Inherited
Returns the Metadata object that is stored under this MediaElement with the specified namespace URL.
MediaElement
 Inherited
Returns the media trait of the specified type.
MediaElement
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Determines whether this media element has a media trait of the specified type.
MediaElement
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
  
Removes the specified child and returns it.
CompositeElement
  
Removes the child at the specified index and returns it.
CompositeElement
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
 Inherited
Removes the Metadata object that was stored under this MediaElement with the specified namespace URL.
MediaElement
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Protected Methods
 MethodDefined By
 Inherited
Adds a new media trait to this media element.
MediaElement
 Inherited
Removes a media trait from this media element.
MediaElement
 Inherited
Sets up the traits for this media element.
MediaElement
Events
 Event Summary Defined By
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.EventDispatcher
 InheritedDispatched when the element's container property changed.MediaElement
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive.EventDispatcher
 InheritedDispatched when an error which impacts the operation of the media element occurs.MediaElement
 InheritedDispatched when a info which impacts the operation of the media element is available.MediaElement
 InheritedDispatched when a Metadata object has been added to this media element.MediaElement
 InheritedDispatched when a Metadata object has been removed from this media element.MediaElement
 InheritedDispatched when a trait is added to the media element.MediaElement
 InheritedDispatched when a trait is removed from the media element.MediaElement
Property Detail

numChildren

property
numChildren:int  [read-only]

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

The number of child MediaElements in this media composition.



Implementation
    public function get numChildren():int
Constructor Detail

CompositeElement

()Constructor
public function CompositeElement()

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Constructor.

Method Detail

addChild

()method
public function addChild(child:MediaElement):MediaElement

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Adds the specified child to the end of the list. Equivalent to addChildAt(child,numChildren).

Parameters

child:MediaElement — The child to add.

Returns
MediaElement — The MediaElement that you pass in the child parameter.

Throws
ArgumentError — If child is null.
 
RangeError — If the specified index is less than zero or greater than the length of the list.
 
Error — If the child is already a child.

addChildAt

()method 
public function addChildAt(child:MediaElement, index:Number):MediaElement

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Adds the child to the list at the specified index. If a child already exists at this index, it and all subsequent children will have their index positions increased by one.

Parameters

child:MediaElement — The child to add.
 
index:Number — The index position at which to add the child.

Returns
MediaElement — The MediaElement that you pass in the child parameter.

Throws
ArgumentError — If child is null.
 
RangeError — If the specified index is less than zero or greater than the length of the list.
 
Error — If the child is already a child.

getChildAt

()method 
public function getChildAt(index:int):MediaElement

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Gets the child at the specified index.

Parameters

index:int — The index in the list from which to retrieve the child.

Returns
MediaElement — The child at that index or null if there is none.

getChildIndex

()method 
public function getChildIndex(child:MediaElement):int

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Returns the index of the child if it is in the list such that getChildAt(index) == child.

Parameters

child:MediaElement — The child to find.

Returns
int — The index of the child or -1 if the child is not in the list.

removeChild

()method 
public function removeChild(child:MediaElement):MediaElement

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Removes the specified child and returns it. Equivalent to removeChildAt(child,getChildIndex(child)).

Parameters

child:MediaElement — The child MediaElement to remove.

Returns
MediaElement — The MediaElement that you pass in the child parameter.

Throws
ArgumentError — If the child is not a child of this composition.

removeChildAt

()method 
public function removeChildAt(index:int):MediaElement

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Removes the child at the specified index and returns it. Any children with index positions greater than this index have their index positions decreased by one.

Parameters

index:int — The index from which to remove the child.

Returns
MediaElement — The child at that index.

Throws
RangeError — If the specified index is less than zero or greater than the length of the list.