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

HTMLMediaContainer  - AS3 OSMF

Packageorg.osmf.containers
Classpublic class HTMLMediaContainer
InheritanceHTMLMediaContainer Inheritance Object
Implements IMediaContainer

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

HTMLMediaContainer is an IMediaContainer-implementing class that uses ExternalInterface to expose the container's child media elements to JavaScript.

View the examples



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
Public Methods
 MethodDefined By
  
HTMLMediaContainer(containerIdentifier:String = null)
Constructor.
HTMLMediaContainer
 Inherited
Indicates whether an object has a specified property defined.
Object
 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
 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
Constructor Detail

HTMLMediaContainer

()Constructor
public function HTMLMediaContainer(containerIdentifier:String = null)

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

Constructor.

Parameters
containerIdentifier:String (default = null) — The identifier that will be used for this container in JavaScript. If no identifier is specified, a random one will be generated.
HTMLMediaContainerExample.as

package
{
    import flash.display.Sprite;
    
    import org.osmf.elements.HTMLElement;
    import org.osmf.media.URLResource;

    public class HTMLMediaContainerExample extends Sprite
    {
        public function HTMLMediaContainerExample()
        {
            super();
            
            // This will invoke a JavaScript callback (onHTMLMediaContainerConstructed(container))
            // that may be used to add listeners to new elements being added or removed to the 
            // container.
            var container:HTMLMediaContainer = new HTMLMediaContainer();
            
            var element:HTMLElement = new HTMLElement();
            element.resource = new URLResource("http://example.com/an/asset/JS/will/handle.pgn");
            
            // This will invoke a JavaScript callback (container.onElementAdd(element)) that
            // allows JavaScript to process the passed URL, and to communicate back to the 
            // framework what traits the element will support:
            container.addMediaElement(element);
        }
        
    }
}