Paket | org.osmf.traits |
Klass | public class DisplayObjectTrait |
Arv | DisplayObjectTrait MediaTraitBase EventDispatcher Object |
Språkversion: | ActionScript 3.0 |
Produktversion: | OSMF 1.0 |
Körningsmiljöversioner: | Flash Player 10, AIR 1.5 |
For an image, for example, the intrinsic dimensions are the height and width of the image as it is stored.
Use the MediaElement.hasTrait(MediaTraitType.DISPLAY_OBJECT)
method to query
whether a media element has a trait of this type.
If hasTrait(MediaTraitType.DISPLAY_OBJECT)
returns true
,
use the MediaElement.getTrait(MediaTraitType.DISPLAY_OBJECT)
method
to get an object that is of this type.
Relaterade API-element
Egenskap | Definieras med | ||
---|---|---|---|
constructor : Object
En referens till klassobjektet eller konstruktorfunktionen för en given objektinstans. | Object | ||
displayObject : DisplayObject [skrivskyddad]
The media's display object. | DisplayObjectTrait | ||
mediaHeight : Number [skrivskyddad]
The intrinsic height of the media. | DisplayObjectTrait | ||
mediaWidth : Number [skrivskyddad]
The intrinsic width of the media. | DisplayObjectTrait | ||
traitType : String [skrivskyddad]
The MediaTraitType for this trait. | MediaTraitBase |
Metod | Definieras med | ||
---|---|---|---|
Constructor. | DisplayObjectTrait | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registrerar ett händelseavlyssnarobjekt för ett EventDispatcher-objekt så att avlyssnaren får meddelanden om händelser. | EventDispatcher | ||
Skickar en händelse till händelseflödet. | EventDispatcher | ||
Disposes of any resources used by this trait. | MediaTraitBase | ||
Kontrollerar om EventDispatcher-objektet har några avlyssnare registrerade för en viss typ av händelse. | EventDispatcher | ||
Anger om det finns en egenskap angiven för ett objekt. | Object | ||
Anger om en instans av klassen Object finns i prototypkedjan för objektet som anges som parameter. | Object | ||
Anger om den angivna egenskapen finns och är uppräkningsbar. | Object | ||
Tar bort en avlyssnare från EventDispatcher-objektet. | EventDispatcher | ||
Anger tillgänglighet för en dynamisk egenskap för slingåtgärder. | Object | ||
Returnerar det här objektets strängrepresentation, formaterad i enlighet med språkspecifika konventioner. | Object | ||
Returnerar det angivna objektets strängbeteckning. | Object | ||
Returnerar det angivna objektets primitiva värde. | Object | ||
Kontrollerar om en händelseavlyssnare är registrerad för det här EventDispatcher-objektet eller något av dess överordnade objekt för den angivna händelsetypen. | EventDispatcher |
Metod | Definieras med | ||
---|---|---|---|
Called just after the displayObject property has changed. | DisplayObjectTrait | ||
Called immediately before the displayObject property is changed. | DisplayObjectTrait | ||
Called just after setMediaSize() has applied new mediaWidth
and/or mediaHeight values. | DisplayObjectTrait | ||
Called just before a call to setMediaSize(). | DisplayObjectTrait | ||
Defines the trait's displayObject. | DisplayObjectTrait | ||
Sets the trait's width and height. | DisplayObjectTrait |
Händelse | Sammanfattning | Definieras med | ||
---|---|---|---|---|
[utsändningshändelse] Skickas när Flash Player eller AIR får operativsystemfokus och blir aktivt. | EventDispatcher | |||
[utsändningshändelse] Skickas när Flash Player eller AIR förlorar operativsystemfokus och blir inaktivt. | EventDispatcher | |||
Dispatched when the trait's displayObject property has changed. | DisplayObjectTrait | |||
Dispatched when the trait's mediaWidth and/or mediaHeight property has changed. | DisplayObjectTrait |
displayObject | egenskap |
displayObject:DisplayObject
[skrivskyddad] Språkversion: | ActionScript 3.0 |
Produktversion: | OSMF 1.0 |
Körningsmiljöversioner: | Flash Player 10, AIR 1.5 |
The media's display object.
Implementering
public function get displayObject():DisplayObject
mediaHeight | egenskap |
mediaWidth | egenskap |
DisplayObjectTrait | () | Konstruktor |
public function DisplayObjectTrait(displayObject:DisplayObject, mediaWidth:Number = 0, mediaHeight:Number = 0)
Språkversion: | ActionScript 3.0 |
Produktversion: | OSMF 1.0 |
Körningsmiljöversioner: | Flash Player 10, AIR 1.5 |
Constructor.
ParametrardisplayObject:DisplayObject | |
mediaWidth:Number (default = 0 )
| |
mediaHeight:Number (default = 0 )
|
displayObjectChangeEnd | () | metod |
protected function displayObjectChangeEnd(oldDisplayObject:DisplayObject):void
Språkversion: | ActionScript 3.0 |
Produktversion: | OSMF 1.0 |
Körningsmiljöversioner: | Flash Player 10, AIR 1.5 |
Called just after the displayObject
property has changed.
Dispatches the change event.
Subclasses that override should call this method to dispatch the displayObjectChange event.
Parametrar
oldDisplayObject:DisplayObject — Previous displayObject value.
|
displayObjectChangeStart | () | metod |
protected function displayObjectChangeStart(newView:DisplayObject):void
Språkversion: | ActionScript 3.0 |
Produktversion: | OSMF 1.0 |
Körningsmiljöversioner: | Flash Player 10, AIR 1.5 |
Called immediately before the displayObject
property is changed.
Subclasses can override this method to communicate the change to the media.
Parametrar
newView:DisplayObject — New displayObject value.
|
mediaSizeChangeEnd | () | metod |
protected function mediaSizeChangeEnd(oldMediaWidth:Number, oldMediaHeight:Number):void
Språkversion: | ActionScript 3.0 |
Produktversion: | OSMF 1.0 |
Körningsmiljöversioner: | Flash Player 10, AIR 1.5 |
Called just after setMediaSize()
has applied new mediaWidth
and/or mediaHeight values. Dispatches the change event.
Subclasses that override should call this method to dispatch the mediaSizeChange event.
Parametrar
oldMediaWidth:Number — Previous mediaWidth value.
| |
oldMediaHeight:Number — Previous mediaHeight value.
|
mediaSizeChangeStart | () | metod |
protected function mediaSizeChangeStart(newMediaWidth:Number, newMediaHeight:Number):void
Språkversion: | ActionScript 3.0 |
Produktversion: | OSMF 1.0 |
Körningsmiljöversioner: | Flash Player 10, AIR 1.5 |
Called just before a call to setMediaSize()
.
Subclasses can override this method to communicate the change to the media.
Parametrar
newMediaWidth:Number — New mediaWidth value.
| |
newMediaHeight:Number — New mediaHeight value.
|
setDisplayObject | () | metod |
protected final function setDisplayObject(value:DisplayObject):void
Språkversion: | ActionScript 3.0 |
Produktversion: | OSMF 1.0 |
Körningsmiljöversioner: | Flash Player 10, AIR 1.5 |
Defines the trait's displayObject. If the displayObject is different from the one that is currently set, a displayObjectChange event will be dispatched.
Parametrar
value:DisplayObject |
setMediaSize | () | metod |
protected final function setMediaSize(mediaWidth:Number, mediaHeight:Number):void
Språkversion: | ActionScript 3.0 |
Produktversion: | OSMF 1.0 |
Körningsmiljöversioner: | Flash Player 10, AIR 1.5 |
Sets the trait's width and height.
Forces non numerical and negative values to zero.
If the either the width or the height differs from the previous width or height, dispatches a mediaSizeChange event.
Parametrar
mediaWidth:Number — The new width.
| |
mediaHeight:Number — The new height.
|
displayObjectChange | Händelse |
org.osmf.events.DisplayObjectEvent
egenskap DisplayObjectEvent.type =
org.osmf.events.DisplayObjectEvent.DISPLAY_OBJECT_CHANGE
Språkversion: | ActionScript 3.0 |
Produktversion: | OSMF 1.0 |
Körningsmiljöversioner: | Flash Player 10, AIR 1.5 |
Dispatched when the trait's displayObject
property has changed.
This occurs when a different DisplayObject is assigned to represent the media.
mediaSizeChange | Händelse |
org.osmf.events.DisplayObjectEvent
egenskap DisplayObjectEvent.type =
org.osmf.events.DisplayObjectEvent.MEDIA_SIZE_CHANGE
Språkversion: | ActionScript 3.0 |
Produktversion: | OSMF 1.0 |
Körningsmiljöversioner: | Flash Player 10, AIR 1.5 |
Dispatched when the trait's mediaWidth and/or mediaHeight property has changed.
The DisplayObjectEvent.MEDIA_SIZE_CHANGE constant defines the value of the type property of the event object for a mediaSizeChange event.Tue Jun 12 2018, 01:40 PM Z