Pacchetto | org.osmf.elements |
Classe | public class SWFElement |
Ereditarietà | SWFElement ![]() ![]() ![]() ![]() |
Versione linguaggio: | ActionScript 3.0 |
Versione prodotto: | OSMF 1.0 |
Versioni runtime: | Flash Player 10, AIR 1.5 |
The basic steps for creating and using a SWFElement are:
- Create a new URLResource pointing to the URL of the SWF to be loaded.
- Create the new SWFElement, passing the URLResource as a parameter.
- Create a new MediaPlayer.
- Assign the SWFElement to the MediaPlayer's
media
property. - Get the DisplayObject from the MediaPlayer's
displayObject
property, and add it to the display list. Note that thedisplayObject
property may not be immediately available, in which case you can listen for the MediaPlayer'sdisplayObjectChange
event. - When done with the SWFElement, set the MediaPlayer's
media
property to null, and remove the DisplayObject from the display list.
Elementi API correlati
org.osmf.elements.SWFLoader
org.osmf.media.MediaElement
org.osmf.media.MediaPlayer
org.osmf.media.URLResource
org.osmf.media.MediaElement
org.osmf.media.MediaPlayer
org.osmf.media.URLResource
Proprietà pubbliche
Proprietà protette
Metodi pubblici
Metodo | Definito da | ||
---|---|---|---|
![]() | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registra un oggetto listener di eventi con un oggetto EventDispatcher, in modo che il listener riceva la notifica di un evento. | EventDispatcher | |
![]() |
Invia un evento nel flusso di eventi. | EventDispatcher | |
![]() |
Verifica se per l'oggetto EventDispatcher sono presenti listener registrati per un tipo specifico di evento. | EventDispatcher | |
![]() |
Indica se per un oggetto è definita una proprietà specifica. | Object | |
![]() |
Indica se un'istanza della classe Object si trova nella catena di prototipi dell'oggetto specificato come parametro. | Object | |
![]() |
Indica se la proprietà specificata esiste ed è enumerabile. | Object | |
![]() |
Rimuove un listener dall'oggetto EventDispatcher. | EventDispatcher | |
![]() |
Imposta la disponibilità di una proprietà dinamica per le operazioni cicliche. | Object | |
![]() |
Restituisce la rappresentazione in formato stringa di questo oggetto, formattato in base alle convenzioni specifiche per le versioni localizzate. | Object | |
![]() |
Restituisce la rappresentazione in formato stringa dell'oggetto specificato. | Object | |
![]() |
Restituisce il valore di base dell'oggetto specificato. | Object | |
![]() |
Verifica se un listener di eventi è registrato con questo oggetto EventDispatcher o qualsiasi suo antenato per il tipo di evento specificato. | EventDispatcher |
Metodi protetti
Eventi
Descrizione della funzione di costruzione
SWFElementExample.as
package { import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import org.osmf.elements.SWFElement; import org.osmf.media.MediaPlayerSprite; import org.osmf.media.URLResource; public class SWFElementExample extends Sprite { private var mediaPlayerSprite:MediaPlayerSprite; public function SWFElementExample() { super(); stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; mediaPlayerSprite = new MediaPlayerSprite(); var swfElement:SWFElement = new SWFElement(); swfElement.resource = new URLResource("http://mediapm.edgesuite.net/osmf/content/test/ten.swf"); addChild(mediaPlayerSprite); mediaPlayerSprite.media = swfElement; } } }
Tue Jun 12 2018, 02:44 PM Z