패키지 | org.osmf.elements |
클래스 | public class ProxyElement |
상속 | ProxyElement MediaElement EventDispatcher Object |
하위 클래스 | DurationElement, LoadFromDocumentElement |
언어 버전: | ActionScript 3.0 |
제품 버전: | OSMF 1.0 |
런타임 버전: | 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.
관련 API 요소
속성 | 정의 주체 | ||
---|---|---|---|
constructor : Object
지정된 객체 인스턴스의 클래스 객체 또는 생성자 함수에 대한 참조입니다. | Object | ||
container : IMediaContainer [읽기 전용]
The media container that this element uses. | MediaElement | ||
metadataNamespaceURLs : Vector.<String> [읽기 전용]
A Vector containing the namespace URLs for all Metadata
objects stored within this MediaElement. | MediaElement | ||
proxiedElement : MediaElement
The MediaElement for which this ProxyElement serves as a proxy,
or wrapper. | ProxyElement | ||
resource : MediaResourceBase
The media resource that this media element operates on. | MediaElement | ||
traitTypes : Vector.<String> [읽기 전용]
A Vector of MediaTraitType values representing the trait types on this
media element. | MediaElement |
속성 | 정의 주체 | ||
---|---|---|---|
blockedTraits : Vector.<String>
The set of MediaTraitTypes that this ProxyElement will block. | ProxyElement |
메서드 | 정의 주체 | ||
---|---|---|---|
ProxyElement(proxiedElement:MediaElement = null)
Constructor. | ProxyElement | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
리스너에서 이벤트 알림을 받을 수 있도록 EventDispatcher 객체에 이벤트 리스너 객체를 등록합니다. | EventDispatcher | ||
Adds a Metadata object to this MediaElement under the specified namespace URL. | MediaElement | ||
이벤트를 이벤트 흐름으로 전달합니다. | EventDispatcher | ||
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 | ||
EventDispatcher 객체에 특정 유형의 이벤트에 대한 리스너가 등록되어 있는지 여부를 확인합니다. | EventDispatcher | ||
지정된 속성이 객체에 정의되어 있는지 여부를 나타냅니다. | Object | ||
Determines whether this media element has a media trait of the
specified type. | MediaElement | ||
Object 클래스의 인스턴스가 매개 변수로 지정된 객체의 프로토타입 체인에 있는지 여부를 나타냅니다. | Object | ||
지정된 속성이 존재하고 열거 가능한지 여부를 나타냅니다. | Object | ||
EventDispatcher 객체에서 리스너를 제거합니다. | EventDispatcher | ||
Removes the Metadata object that was stored under this MediaElement with
the specified namespace URL. | MediaElement | ||
루프 작업에서 동적 속성을 사용할 수 있는지 여부를 설정합니다. | Object | ||
로캘별 규칙에 따라 서식이 지정된 이 객체의 문자열 표현을 반환합니다. | Object | ||
지정된 객체의 문자열 표현을 반환합니다. | Object | ||
지정된 객체의 프리미티브 값을 반환합니다. | Object | ||
이 EventDispatcher 객체 또는 조상 객체에 지정한 이벤트 유형에 대한 이벤트 리스너가 등록되어 있는지 여부를 확인합니다. | EventDispatcher |
blockedTraits | 속성 |
blockedTraits:Vector.<String>
언어 버전: | ActionScript 3.0 |
제품 버전: | OSMF 1.0 |
런타임 버전: | Flash Player 10, AIR 1.5 |
The set of MediaTraitTypes that this ProxyElement will block. When a trait is blocked, the ProxyElement will prevent that trait from being exposed when the proxied element contains the trait and the proxy does not. Subclasses can call this to selectively block access to the traits of the proxied element on a per-type basis.
구현
protected function get blockedTraits():Vector.<String>
protected function set blockedTraits(value:Vector.<String>):void
proxiedElement | 속성 |
proxiedElement:MediaElement
언어 버전: | ActionScript 3.0 |
제품 버전: | OSMF 1.0 |
런타임 버전: | Flash Player 10, AIR 1.5 |
The MediaElement for which this ProxyElement serves as a proxy, or wrapper.
구현
public function get proxiedElement():MediaElement
public function set proxiedElement(value:MediaElement):void
ProxyElement | () | 생성자 |
public function ProxyElement(proxiedElement:MediaElement = null)
언어 버전: | ActionScript 3.0 |
제품 버전: | OSMF 1.0 |
런타임 버전: | Flash Player 10, AIR 1.5 |
Constructor.
매개 변수proxiedElement:MediaElement (default = null ) — MediaElement to proxy. Changes to the proxied
element are reflected in the proxy element's properties and events,
with the exception of those changes for which an override takes
precedence. If the param is null, then it must be set (via the
proxiedElement setter) immediately after this constructor call, and
before any other methods on this ProxyElement are called, or an
IllegalOperationError will be thrown.
|
Tue Jun 12 2018, 03:17 PM Z