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

Metadata  - AS3 OSMF

Packageorg.osmf.metadata
Classpublic class Metadata
InheritanceMetadata Inheritance EventDispatcher Inheritance Object
Subclasses LayoutMetadata, TimelineMetadata

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

The Metadata class encapsulates a related collection of metadata.

Metadata consists of key-value pairs, where keys are Strings and values are arbitrary Objects. The Metadata class provides a strongly-typed API for working with these key-value pairs, as well as events for detecting changes to the metadata.



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  keys : Vector.<String>
[read-only] The keys stored in this Metadata object.
Metadata
Public Methods
 MethodDefined By
  
Constructor.
Metadata
 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
  
Stores the specified value in this Metadata object, using the specified key.
Metadata
 Inherited
Dispatches an event into the event flow.
EventDispatcher
  
Returns the value associate with the specified key.
Metadata
 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
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
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
  
Removes the value associated with the specified key from this Metadata object.
Metadata
 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
Events
 Event Summary Defined By
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.EventDispatcher
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive.EventDispatcher
  Dispatched when a new value is added to the Metadata object.Metadata
  Dispatched when a value within the Metadata object changes.Metadata
  Dispatched when a value is removed from the Metadata object.Metadata
Property Detail

keys

property
keys:Vector.<String>  [read-only]

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

The keys stored in this Metadata object.



Implementation
    public function get keys():Vector.<String>
Constructor Detail

Metadata

()Constructor
public function Metadata()

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

Constructor.

Method Detail

addValue

()method
public function addValue(key:String, value:Object):void

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

Stores the specified value in this Metadata object, using the specified key. The key can subsequently be used to retrieve the value. If the key is equal to the key of another object already in the Metadata object this will overwrite the association with the new value.

Parameters

key:String — The key to associate the value with.
 
value:Object — The value to add to the Metadata object.

Throws
ArgumentError — If key is null or somehow invalid.

getValue

()method 
public function getValue(key:String):*

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

Returns the value associate with the specified key. Returns 'undefined' if the Metadata object fails to resolve the key.

Parameters

key:String

Returns
*

Throws
ArgumentError — If key is null.

removeValue

()method 
public function removeValue(key:String):*

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

Removes the value associated with the specified key from this Metadata object. Returns undefined if there is no value associated with the key in this Metadata object.

Parameters

key:String — The key associated with the value to be removed.

Returns
*

Throws
ArgumentError — If key is null.
Event Detail

valueAdd

Event
Event Object Type: org.osmf.events.MetadataEvent
property MetadataEvent.type = org.osmf.events.MetadataEvent.VALUE_ADD

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

Dispatched when a new value is added to the Metadata object.

The MetadataEvent.VALUE_ADD constant defines the value of the type property of the event object for a valueAdd event.

valueChange

Event  
Event Object Type: org.osmf.events.MetadataEvent
property MetadataEvent.type = org.osmf.events.MetadataEvent.VALUE_CHANGE

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

Dispatched when a value within the Metadata object changes.

The MetadataEvent.VALUE_CHANGE constant defines the value of the type property of the event object for a valueChange event.

valueRemove

Event  
Event Object Type: org.osmf.events.MetadataEvent
property MetadataEvent.type = org.osmf.events.MetadataEvent.VALUE_REMOVE

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

Dispatched when a value is removed from the Metadata object.

The MetadataEvent.VALUE_REMOVE constant defines the value of the type property of the event object for a valueRemove event.