| Package | org.osmf.elements | 
| Class | public class CompositeElement | 
| Inheritance | CompositeElement    MediaElement   EventDispatcher   Object | 
| Subclasses | ParallelElement, SerialElement | 
| Language Version: | ActionScript 3.0 | 
| Product Version: | OSMF 1.0 | 
| Runtime Versions: | Flash Player 10, AIR 1.5 | 
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.
| Property | Defined By | ||
|---|---|---|---|
![]()  | constructor : Object 
	 A reference to the class object or constructor function for a given object instance.  | Object | |
![]()  | container : IMediaContainer [read-only] 
		 The media container that this element uses.  | MediaElement | |
![]()  | metadataNamespaceURLs : 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 | ||
![]()  | resource : MediaResourceBase 
		 The media resource that this media element operates on.  | MediaElement | |
![]()  | traitTypes : Vector.<String> [read-only] 
		 A Vector of MediaTraitType values representing the trait types on this
		 media element.  | MediaElement | |
| Method | Defined 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 | ||
![]()  | 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 | |
![]()  |  
		 Adds a Metadata object to this MediaElement under the specified namespace URL.  | MediaElement | |
![]()  | 
	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 | ||
![]()  |  
		 Returns the Metadata object that is stored under this MediaElement with
		 the specified namespace URL.  | MediaElement | |
![]()  | 
		 Returns the media trait of the specified type.  | MediaElement | |
![]()  | 
	Checks whether the EventDispatcher object has any listeners registered for a specific type 
	of event.  | EventDispatcher | |
![]()  | 
	 Indicates whether an object has a specified property defined.  | Object | |
![]()  | 
		 Determines whether this media element has a media trait of the
		 specified type.  | MediaElement | |
![]()  | 
	 Indicates whether an instance of the Object class is in the prototype chain of the object specified 
	 as the parameter.  | Object | |
![]()  | 
	 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 | ||
![]()  | 
	Removes a listener from the EventDispatcher object.  | EventDispatcher | |
![]()  | 
		 Removes the Metadata object that was stored under this MediaElement with
		 the specified namespace URL.  | MediaElement | |
![]()  | 
     Sets the availability of a dynamic property for loop operations.  | Object | |
![]()  | 
	 Returns the string representation of this object, formatted according to locale-specific conventions.  | Object | |
![]()  | 
	 Returns the string representation of the specified object.  | Object | |
![]()  | 
	 Returns the primitive value of the specified object.  | Object | |
![]()  | 
	Checks whether an event listener is registered with this EventDispatcher object or any of 
	its ancestors for the specified event type.  | EventDispatcher | |
| Method | Defined By | ||
|---|---|---|---|
![]()  | 
		 Adds a new media trait to this media element.  | MediaElement | |
![]()  | 
		 Removes a media trait from this media element.  | MediaElement | |
![]()  | 
		 Sets up the traits for this media element.  | MediaElement | |
| Event | Summary | Defined By | ||
|---|---|---|---|---|
![]()  | [broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active. | EventDispatcher | ||
![]()  | Dispatched when the element's container property changed. | MediaElement | ||
![]()  | [broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive. | EventDispatcher | ||
![]()  | Dispatched when an error which impacts the operation of the media element occurs. | MediaElement | ||
![]()  | Dispatched when a info which impacts the operation of the media element is available. | MediaElement | ||
![]()  | Dispatched when a Metadata object has been added to this media element. | MediaElement | ||
![]()  | Dispatched when a Metadata object has been removed from this media element. | MediaElement | ||
![]()  | Dispatched when a trait is added to the media element. | MediaElement | ||
![]()  | Dispatched when a trait is removed from the media element. | MediaElement | ||
numChildren | property | 
CompositeElement | () | Constructor | 
public function CompositeElement()| Language Version: | ActionScript 3.0 | 
| Product Version: | OSMF 1.0 | 
| Runtime Versions: | Flash Player 10, AIR 1.5 | 
Constructor.
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.
		 
		  | 
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.
		 
		  | 
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.
		 
		  | 
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.
		 
		  | 
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.
		 
		  | 
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.
		 
		  | 
MediaElement — The child at that index.
		 
		  | 
Throws
RangeError  — If the specified index is less than zero or
		 greater than the length of the list.
		  
		   | 
Thu Dec 4 2014, 05:50 PM -08:00
 