Referência do ActionScript® 3.0 para Adobe® Flash® Platform
Início  |  Ocultar listas de Pacotes e Classes |  Pacotes  |  Classes  |  Novidades  |  Índice  |  Apêndices  |  Por que inglês?
Filtros: Recuperando dados do servidor...
Recuperando dados do servidor...
org.osmf.traits 

TraitEventDispatcher  - AS3 OSMF

Pacoteorg.osmf.traits
Classepublic class TraitEventDispatcher
HerançaTraitEventDispatcher Inheritance EventDispatcher Inheritance Object
Subclasses MediaPlayer

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.0
Versões de runtime: Flash Player 10, AIR 1.5

TraitEventDispatcher is a utility class that exposes a uniform interface for receiving trait events from a MediaElement. This class monitors the MediaElement for traits being added and removed, and dispatches any events that the MediaElement's traits dispatch, and for which the client has registered listeners.

Veja os exemplos



Propriedades públicas
 PropriedadeDefinido por
 Inheritedconstructor : Object
Uma referência ao objeto de classe ou à função de construtor de uma determinada ocorrência de objeto.
Object
  media : MediaElement
The MediaElement which will be monitored, and whose trait events will be redispatched.
TraitEventDispatcher
Métodos públicos
 MétodoDefinido por
  
Constructor.
TraitEventDispatcher
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registra um objeto de ouvinte de evento em um objeto EventDispatcher, de forma que o ouvinte receba a notificação de um evento.
EventDispatcher
 Inherited
Envia um evento para o fluxo de eventos.
EventDispatcher
 Inherited
Verifica se o objeto EventDispatcher tem ouvintes registrados para um tipo específico de evento.
EventDispatcher
 Inherited
Indica se um objeto tem uma propriedade especificada definida.
Object
 Inherited
Indica se uma ocorrência da classe Object está na cadeia de protótipos do objeto especificado como o parâmetro.
Object
 Inherited
Indica se a propriedade especificada existe e é enumerável.
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Remove um ouvinte do objeto EventDispatcher.
EventDispatcher
 Inherited
Define a disponibilidade de uma propriedade dinâmica para operações de repetição.
Object
 Inherited
Retorna a representação da string deste objeto, formatado segundo as convenções específicas para a localidade.
Object
 Inherited
Retorna a representação de string do objeto especificado.
Object
 Inherited
Retorna o valor primitivo do objeto especificado.
Object
 Inherited
Verifica se um ouvinte de evento está registrado nesse objeto EventDispatcher ou em qualquer um de seus ancestrais para o tipo de evento especificado.
EventDispatcher
Eventos
 Evento Resumo Definido por
 Inherited[transmissão de evento] Despachado quando o Flash Player ou o aplicativo do AIR ganha o foco do sistema operacional e está se tornando inativo.EventDispatcher
  Dispatched when an alternative audio stream switch is requested, completed, or has failed.TraitEventDispatcher
  Dispatched when the autoSwitch property has changed.TraitEventDispatcher
  Dispatched when the buffering property has changed.TraitEventDispatcher
  Dispatched when the bufferTime property has changed.TraitEventDispatcher
  Dispatched when the bytesTotal property has changed.TraitEventDispatcher
  Dispatched when the canPause property has changed.TraitEventDispatcher
  Dispatched when the media has completed playback.TraitEventDispatcher
 Inherited[transmissão de evento] Despachado quando o Flash Player ou o aplicativo do AIR perde o foco do sistema operacional e está se tornando inativo.EventDispatcher
  Dispatched when the displayObject property of the media has changed.TraitEventDispatcher
  Dispatched when the state of the DRMTrait has changed.TraitEventDispatcher
  Dispatched when the duration property of the media has changed.TraitEventDispatcher
  Dispatched when the isRecording property has changed.TraitEventDispatcher
  Dispatched when the state of the LoadTrait has changed.TraitEventDispatcher
  Dispatched when the mediaWidth and/or mediaHeight property of the media has changed.TraitEventDispatcher
  Dispatched when the muted property of the media has changed.TraitEventDispatcher
  Dispatched when the number of alternative audio streams has changed.TraitEventDispatcher
  Dispatched when the number of dynamic streams has changed.TraitEventDispatcher
  Dispatched when the pan property of the media has changed.TraitEventDispatcher
  Dispatched when the playing or paused property of the media has changed.TraitEventDispatcher
  Dispatched when the seeking property of the media has changed.TraitEventDispatcher
  Dispatched when a dynamic stream switch change occurs.TraitEventDispatcher
  Dispatched when the volume property of the media has changed.TraitEventDispatcher
Detalhes da propriedade

media

propriedade
media:MediaElement

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.0
Versões de runtime: Flash Player 10, AIR 1.5

The MediaElement which will be monitored, and whose trait events will be redispatched.



Implementação
    public function get media():MediaElement
    public function set media(value:MediaElement):void
Detalhes do construtor

TraitEventDispatcher

()Construtor
public function TraitEventDispatcher()

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.0
Versões de runtime: Flash Player 10, AIR 1.5

Constructor.

Detalhe do evento

audioSwitchingChange

Evento
Tipo do objeto de evento: org.osmf.events.AlternativeAudioEvent
propriedade AlternativeAudioEvent.type = org.osmf.events.AlternativeAudioEvent.AUDIO_SWITCHING_CHANGE

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.6
Versões de runtime: Flash Player 10, AIR 1.5

Dispatched when an alternative audio stream switch is requested, completed, or has failed.

Dispatched when the switching state of the alternative audio stream has changed. Usually for any successful switching operation, two AUDIO_SWITCHING_CHANGE events will be triggered. One when the switch operation starts ( the switching property will be set to true ) and one when the operation ends ( the switching property will be set to false ).

autoSwitchChange

Evento  
Tipo do objeto de evento: org.osmf.events.DynamicStreamEvent
propriedade DynamicStreamEvent.type = org.osmf.events.DynamicStreamEvent.AUTO_SWITCH_CHANGE

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.0
Versões de runtime: Flash Player 10, AIR 1.5

Dispatched when the autoSwitch property has changed.

The DynamicStreamEvent.AUTO_SWITCH_CHANGE constant defines the value of the type property of the event object for an autoSwitchChange event.

bufferingChange

Evento  
Tipo do objeto de evento: org.osmf.events.BufferEvent
propriedade BufferEvent.type = org.osmf.events.BufferEvent.BUFFERING_CHANGE

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.0
Versões de runtime: Flash Player 10, AIR 1.5

Dispatched when the buffering property has changed.

The BufferEvent.BUFFERING_CHANGE constant defines the value of the type property of the event object for a bufferingChange event.

bufferTimeChange

Evento  
Tipo do objeto de evento: org.osmf.events.BufferEvent
propriedade BufferEvent.type = org.osmf.events.BufferEvent.BUFFER_TIME_CHANGE

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.0
Versões de runtime: Flash Player 10, AIR 1.5

Dispatched when the bufferTime property has changed.

The BufferEvent.BUFFER_TIME_CHANGE constant defines the value of the type property of the event object for a bufferTimeChange event.

bytesTotalChange

Evento  
Tipo do objeto de evento: org.osmf.events.LoadEvent
propriedade LoadEvent.type = org.osmf.events.LoadEvent

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.0
Versões de runtime: Flash Player 10, AIR 1.5

Dispatched when the bytesTotal property has changed.

canPauseChange

Evento  
Tipo do objeto de evento: org.osmf.events.PlayEvent
propriedade PlayEvent.type = org.osmf.events.PlayEvent.CAN_PAUSE_CHANGE

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.0
Versões de runtime: Flash Player 10, AIR 1.5

Dispatched when the canPause property has changed.

The PlayEvent.CAN_PAUSE_CHANGE constant defines the value of the type property of the event object for a canPauseChange event.

complete

Evento  
Tipo do objeto de evento: org.osmf.events.TimeEvent
propriedade TimeEvent.type = org.osmf.events.TimeEvent.COMPLETE

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.0
Versões de runtime: Flash Player 10, AIR 1.5

Dispatched when the media has completed playback.

The TimeEvent.COMPLETE constant defines the value of the type property of the event object for a complete event.

displayObjectChange

Evento  
Tipo do objeto de evento: org.osmf.events.DisplayObjectEvent
propriedade DisplayObjectEvent.type = org.osmf.events.DisplayObjectEvent.DISPLAY_OBJECT_CHANGE

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.0
Versões de runtime: Flash Player 10, AIR 1.5

Dispatched when the displayObject property of the media has changed.

The DisplayObjectEvent.DISPLAY_OBJECT_CHANGE constant defines the value of the type property of the event object for a displayObjectChange event.

drmStateChange

Evento  
Tipo do objeto de evento: org.osmf.events.DRMEvent
propriedade DRMEvent.type = org.osmf.events.DRMEvent.DRM_STATE_CHANGE

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.0
Versões de runtime: Flash Player 10.1, AIR 1.5

Dispatched when the state of the DRMTrait has changed.

The DRMEvent.DRM_STATE_CHANGE constant defines the value of the type property of the event object for a change to the drmState of a DRMTrait.

durationChange

Evento  
Tipo do objeto de evento: org.osmf.events.TimeEvent
propriedade TimeEvent.type = org.osmf.events.TimeEvent.DURATION_CHANGE

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.0
Versões de runtime: Flash Player 10, AIR 1.5

Dispatched when the duration property of the media has changed.

The TimeEvent.DURATION_CHANGE constant defines the value of the type property of the event object for a durationChange event.

isRecordingChange

Evento  
Tipo do objeto de evento: org.osmf.events.DVREvent
propriedade DVREvent.type = org.osmf.events.DVREvent.IS_RECORDING_CHANGE

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.0
Versões de runtime: Flash Player 10.1, AIR 1.5

Dispatched when the isRecording property has changed.

The DVREvent.IS_RECORDING_CHANGE constant defines the value of the type property of the event object for an isRecordingChange event.

loadStateChange

Evento  
Tipo do objeto de evento: org.osmf.events.LoadEvent
propriedade LoadEvent.type = org.osmf.events.LoadEvent.LOAD_STATE_CHANGE

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.0
Versões de runtime: Flash Player 10, AIR 1.5

Dispatched when the state of the LoadTrait has changed.

The LoadEvent.LOAD_STATE_CHANGE constant defines the value of the type property of the event object for a loadStateChange event.

mediaSizeChange

Evento  
Tipo do objeto de evento: org.osmf.events.DisplayObjectEvent
propriedade DisplayObjectEvent.type = org.osmf.events.DisplayObjectEvent.MEDIA_SIZE_CHANGE

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.0
Versões de runtime: Flash Player 10, AIR 1.5

Dispatched when the mediaWidth and/or mediaHeight property of the media has changed.

The DisplayObjectEvent.MEDIA_SIZE_CHANGE constant defines the value of the type property of the event object for a mediaSizeChange event.

mutedChange

Evento  
Tipo do objeto de evento: org.osmf.events.AudioEvent
propriedade AudioEvent.type = org.osmf.events.AudioEvent.MUTED_CHANGE

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.0
Versões de runtime: Flash Player 10, AIR 1.5

Dispatched when the muted property of the media has changed.

The AudioEvent.MUTED_CHANGE constant defines the value of the type property of the event object for a mutedChange event.

numAlternativeAudioStreamsChange

Evento  
Tipo do objeto de evento: org.osmf.events.AlternativeAudioEvent
propriedade AlternativeAudioEvent.type = org.osmf.events.AlternativeAudioEvent.NUM_ALTERNATIVE_AUDIO_STREAMS_CHANGE

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.6
Versões de runtime: Flash Player 10, AIR 1.5

Dispatched when the number of alternative audio streams has changed.

Dispatched when the number of available alternative audio streams has changed..

numDynamicStreamsChange

Evento  
Tipo do objeto de evento: org.osmf.events.DynamicStreamEvent
propriedade DynamicStreamEvent.type = org.osmf.events.DynamicStreamEvent.NUM_DYNAMIC_STREAMS_CHANGE

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.0
Versões de runtime: Flash Player 10, AIR 1.5

Dispatched when the number of dynamic streams has changed.

The DynamicStreamEvent.NUM_DYNAMIC_STREAMS_CHANGE constant defines the value of the type property of the event object for a numDynamicStreamsChange event.

panChange

Evento  
Tipo do objeto de evento: org.osmf.events.AudioEvent
propriedade AudioEvent.type = org.osmf.events.AudioEvent.PAN_CHANGE

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.0
Versões de runtime: Flash Player 10, AIR 1.5

Dispatched when the pan property of the media has changed.

The AudioEvent.PAN_CHANGE constant defines the value of the type property of the event object for a panChange event.

playStateChange

Evento  
Tipo do objeto de evento: org.osmf.events.PlayEvent
propriedade PlayEvent.type = org.osmf.events.PlayEvent.PLAY_STATE_CHANGE

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.0
Versões de runtime: Flash Player 10, AIR 1.5

Dispatched when the playing or paused property of the media has changed.

The PlayEvent.PLAY_STATE_CHANGE constant defines the value of the type property of the event object for a playStateChange event.

seekingChange

Evento  
Tipo do objeto de evento: org.osmf.events.SeekEvent
propriedade SeekEvent.type = org.osmf.events.SeekEvent.SEEKING_CHANGE

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.0
Versões de runtime: Flash Player 10, AIR 1.5

Dispatched when the seeking property of the media has changed.

The SeekEvent.SEEKING_CHANGE constant defines the value of the type property of the event object for a seekingChange event.

switchingChange

Evento  
Tipo do objeto de evento: org.osmf.events.DynamicStreamEvent
propriedade DynamicStreamEvent.type = org.osmf.events.DynamicStreamEvent.SWITCHING_CHANGE

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.0
Versões de runtime: Flash Player 10, AIR 1.5

Dispatched when a dynamic stream switch change occurs.

The DynamicStreamEvent.SWITCHING_CHANGE constant defines the value of the type property of the event object for a switchingChange event.

volumeChange

Evento  
Tipo do objeto de evento: org.osmf.events.AudioEvent
propriedade AudioEvent.type = org.osmf.events.AudioEvent.VOLUME_CHANGE

Versão da linguagem: ActionScript 3.0
Versão de produto: OSMF 1.0
Versões de runtime: Flash Player 10, AIR 1.5

Dispatched when the volume property of the media has changed.

The AudioEvent.VOLUME_CHANGE constant defines the value of the type property of the event object for a volumeChange event.
TraitEventDispatcherExample.as

package
{
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    
    import org.osmf.elements.VideoElement;
    import org.osmf.events.AudioEvent;
    import org.osmf.events.PlayEvent;
    import org.osmf.media.MediaPlayerSprite;
    import org.osmf.media.URLResource;
    import org.osmf.traits.TraitEventDispatcher;
    
    public class TraitEventDispatcherExample extends Sprite
    {
        public function TraitEventDispatcherExample()
        {
            super();
            
            stage.scaleMode = StageScaleMode.NO_SCALE;
            stage.align = StageAlign.TOP_LEFT;
            
            var mediaPlayerSprite:MediaPlayerSprite = new MediaPlayerSprite();
            var urlResource:URLResource = new URLResource("rtmp://cp67126.edgefcs.net/ondemand/mediapm/strobe/content/test/SpaceAloneHD_sounas_640_500_short");
            var videoElement:VideoElement = new VideoElement();
            videoElement.resource = urlResource;

            var dispatcher:TraitEventDispatcher = new TraitEventDispatcher();
            dispatcher.media = videoElement;
                        
            dispatcher.addEventListener(AudioEvent.VOLUME_CHANGE, onVolumeChange); 
            dispatcher.addEventListener(PlayEvent.PLAY_STATE_CHANGE, onPlayStateChange);             

            addChild(mediaPlayerSprite);
            mediaPlayerSprite.media = videoElement;    
        }

        private function onVolumeChange(event:AudioEvent):void
        {
            trace("onVolumeChange");
        }

        private function onPlayStateChange(event:PlayEvent):void
        {
            trace("onPlayStateChange");
        }
    }
}




[ X ]Por que inglês?
O conteúdo na Referência do ActionScript 3.0 aparece em inglês

Nem todas as partes da Referência do ActionScript 3.0 estão traduzidas em todos os idiomas. Quando um elemento de um idioma não está traduzido, ele é exibido em inglês. Por exemplo, a classe ga.controls.HelpBox não está traduzida em nenhum idioma. Por isso, na versão da referência em português do Brasil, a classe ga.controls.HelpBox é exibida em inglês.