Package | org.osmf.elements |
Class | public class ProxyElement |
Inheritance | ProxyElement ![]() ![]() ![]() |
Subclasses | DurationElement, LoadFromDocumentElement |
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
ProxyElement is not instantiated directly but rather used as the base class for creating wrappers for specific purposes. ProxyElement can be subclassed for any trait type or set of trait types. The subclass controls access to the proxied element either by overriding one or more of the proxied element's traits or by blocking them.
To override any of the proxied element's traits, the subclass creates its own trait instances, which it substitutes for the proxied element's traits that it wishes to override.
To block traits, the subclass prevents the traits of
the proxied element from being exposed by setting the ProxyElement's
blockedTraits
property for the trait
types that it wants to block.
This causes the proxied element's hasTrait()
method to return false
and its
getTrait()
method to return null
for the blocked trait types.
A ProxyElement normally dispatches the proxied element's events, unless the trait's type is among those that are blocked by the ProxyElement.
ProxyElement subclasses are useful for modifying the behavior of a MediaElement in a non-invasive way. An example would be adding temporal capabilities to a set of ImageElements to present them in a slide show in which the images are displayed for a specified duration. The ProxyElement subclass would proxy the non-temporal ImageElements and override the proxied element's TimeTrait to return a custom instance of that trait. A similar approach can be applied to other traits, either to provide an alternate implementation of some of the proxied element's underlying traits, to provide an implementation when a needed underlying trait does not exist, or to prevent an underlying trait from being exposed at all.
Related API Elements
Property | Defined By | ||
---|---|---|---|
![]() | metadataNamespaceURLs : Vector.<String> [read-only]
A Vector containing the namespace URLs for all Metadata
objects stored within this MediaElement. | MediaElement |
Property | Defined By |
---|
Wed Nov 21 2018, 06:34 AM -08:00