Packagecom.adobe.portfolio.previews
Classpublic class AudioPreview
InheritanceAudioPreview Inheritance NavSkinnableComponent Inheritance spark.components.supportClasses.SkinnableComponent

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The AudioPreview class extends NavSkinnableComponent to play audio content.



Public Properties
 PropertyDefined By
  duration : Number
AudioPreview
  model : IPreviewModel
The current preview model.
AudioPreview
  playing : Boolean
[read-only] Whether the audio is playing or not.
AudioPreview
 InheritedskinState : String
The current skin state
NavSkinnableComponent
  source : Object
The source data of an audio preview.
AudioPreview
  STATE_MEDIA_ERROR : String = mediaError
[static] The "mediaError" state for AudioPreview and its skin
AudioPreview
  STATE_PAUSED : String = paused
[static] The "paused" state for AudioPreview and its skin
AudioPreview
  STATE_PAUSED_HOVER : String = pausedHover
[static] The "pausedHover" state for AudioPreview and its skin
AudioPreview
  STATE_PLAYING : String = playing
[static] The "playing" state for AudioPreview and its skin
AudioPreview
  STATE_PLAYING_HOVER : String = playingHover
[static] The "playingHover" state for AudioPreview and its skin
AudioPreview
  STATE_STOPPED : String = stopped
[static] The "stopped" state for AudioPreview and its skin
AudioPreview
  STATE_STOPPED_HOVER : String = stoppedHover
[static] The "stoppedHover" state for AudioPreview and its skin
AudioPreview
  visible : Boolean
[override] [write-only]
AudioPreview
  volume : Number
The volume of the audio playback.
AudioPreview
Protected Properties
 PropertyDefined By
 InheritedautoListen : AutoListen
NavSkinnableComponent
 InheritedautoWatch : AutoWatch
NavSkinnableComponent
  doubleClickHandler : DoubleClickHandler
AudioPreview
  fromHover : Object
[static]
AudioPreview
  lastStreamTime : Number
AudioPreview
  position : Number
AudioPreview
  scrubBarChanging : Boolean
AudioPreview
  scrubBarMouseCaptured : Boolean
AudioPreview
  sound : Sound
AudioPreview
  soundChannel : SoundChannel
AudioPreview
  stream : NetStream
AudioPreview
  toHover : Object
[static]
AudioPreview
  updateTimer : Timer
AudioPreview
  wasPlayingBeforeSeeking : Boolean
AudioPreview
Public Methods
 MethodDefined By
  
Constructor
AudioPreview
 Inherited
Creates autoListen and autoWatch for automatically tracking listeners and watchers.
NavSkinnableComponent
  
pause():void
Pause the playback of audio.
AudioPreview
  
play():void
Start the playback of audio.
AudioPreview
 Inherited
Uses autoListen and autoWatch to remove all listeners and watchers.
NavSkinnableComponent
  
setCurrentState(stateName:String, playTransition:Boolean = true):void
[override] Sets the current state of AudioPreview and its skin
AudioPreview
Protected Methods
 MethodDefined By
 Inherited
addListener(listener:IEventDispatcher, type:String, handler:Function, useCapture:Boolean = false, priority:int = 0):void
NavSkinnableComponent
 Inherited
addWatcher(watcher:ChangeWatcher):void
NavSkinnableComponent
  
attachSkin():void
[override]
AudioPreview
  
detachSkin():void
[override]
AudioPreview
  
formatTimeValue(value:Number):String
Formats a time value, specified in seconds, into a String that gets used for currentTime and the duration.
AudioPreview
 Inherited
[override]
NavSkinnableComponent
  
handleUpdateTimer(e:Event):void
AudioPreview
  
inHoverState():Boolean
AudioPreview
  
AudioPreview
  
initStates():void
[override]
AudioPreview
  
keyboardHandler(event:KeyboardEvent):void
AudioPreview
  
loadSound(mediaModel:IPreviewMediaModel):void
AudioPreview
  
mouseClickHandler(event:MouseEvent):void
AudioPreview
  
muteButton_changeHandler(event:Event):void
AudioPreview
  
netStatusHandler(event:NetStatusEvent):void
AudioPreview
  
onIOError(event:Error):void
AudioPreview
  
onTunePlaybackComplete(event:Event = null):void
AudioPreview
  
partAdded(partName:String, instance:Object):void
[override]
AudioPreview
 Inherited
partRemoved(partName:String, instance:Object):void
[override]
NavSkinnableComponent
  
playerControlsMouseClickHandler(event:MouseEvent):void
AudioPreview
  
playPauseHandler(event:Event):void
AudioPreview
  
rollOutHandler(e:Event):void
AudioPreview
  
rollOverHandler(e:Event):void
AudioPreview
  
scrubBar_changeEndHandler(event:Event):void
AudioPreview
  
scrubBar_changeStartHandler(event:Event):void
AudioPreview
  
scrubBar_mouseDownHandler(event:Event):void
AudioPreview
  
scrubBar_thumbPressHandler(event:TrackBaseEvent):void
AudioPreview
  
scrubBar_thumbReleaseHandler(event:TrackBaseEvent):void
AudioPreview
  
seek(value:Number):void
AudioPreview
  
togglePlay():void
AudioPreview
  
AudioPreview
Skin Parts

This component uses skins made up of skin parts. Do not set the skin parts directly. The component's skin sets the skin parts.


 Skin Part Description Defined By
  
currentTimeDisplay:spark.components.Label
Required: false Part Type: Static
An optional skin part to display the current time
AudioPreview
  
durationDisplay:spark.components.Label
Required: false Part Type: Static
An optional skin part to display the duration
AudioPreview
  
hoverPlay:spark.components.Button
Required: false Part Type: Static
An optional skin part to display the hover play button.
AudioPreview
  
muteButton:spark.components.mediaClasses.MuteButton
Required: false Part Type: Static
An optional skin part to display the mute button.
AudioPreview
  
playerControls:spark.components.Group
Required: false Part Type: Static
An optional skin part to display the player controls.
AudioPreview
  
playPauseButton:spark.components.ToggleButton
Required: false Part Type: Static
An optional skin part to display the play/pause button.
AudioPreview
  
scrubBar:spark.components.mediaClasses.ScrubBar
Required: false Part Type: Static
An optional skin part to display the scrubBar.
AudioPreview
Public Constants
 ConstantDefined By
 InheritedSTATE_DISABLED : String = disabled
[static]
NavSkinnableComponent
 InheritedSTATE_NORMAL : String = normal
[static]
NavSkinnableComponent
Protected Constants
 ConstantDefined By
  DELTA_TO_END : Number = 100
[static]
AudioPreview
  DONE_DELTA : int = 50
[static]
AudioPreview
  MP4_MIMETYPE : String = audio/mp4
[static]
AudioPreview
Property Detail
doubleClickHandlerproperty
protected var doubleClickHandler:DoubleClickHandler

durationproperty 
duration:Number


Implementation
    public function get duration():Number
    public function set duration(value:Number):void
fromHoverproperty 
protected static var fromHover:Object

lastStreamTimeproperty 
protected var lastStreamTime:Number

modelproperty 
model:IPreviewModel

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The current preview model.

This property can be used as the source for data binding.


Implementation
    public function get model():IPreviewModel
    public function set model(value:IPreviewModel):void

See also

playingproperty 
playing:Boolean  [read-only]

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Whether the audio is playing or not.


Implementation
    public function get playing():Boolean
positionproperty 
position:Number


Implementation
    protected function get position():Number
    protected function set position(value:Number):void
scrubBarChangingproperty 
protected var scrubBarChanging:Boolean

scrubBarMouseCapturedproperty 
protected var scrubBarMouseCaptured:Boolean

soundproperty 
protected var sound:Sound

soundChannelproperty 
protected var soundChannel:SoundChannel

sourceproperty 
source:Object

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The source data of an audio preview.

This property can be used as the source for data binding.


Implementation
    public function get source():Object
    public function set source(value:Object):void
STATE_MEDIA_ERRORproperty 
public static var STATE_MEDIA_ERROR:String = mediaError

Language Version : ActionScript 3.0
Product Version : Portfolio 10.1
Runtime Versions : Flash Player 10, AIR 1.5

The "mediaError" state for AudioPreview and its skin

STATE_PAUSEDproperty 
public static var STATE_PAUSED:String = paused

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10, AIR 1.5

The "paused" state for AudioPreview and its skin

STATE_PAUSED_HOVERproperty 
public static var STATE_PAUSED_HOVER:String = pausedHover

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10, AIR 1.5

The "pausedHover" state for AudioPreview and its skin

STATE_PLAYINGproperty 
public static var STATE_PLAYING:String = playing

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10, AIR 1.5

The "playing" state for AudioPreview and its skin

STATE_PLAYING_HOVERproperty 
public static var STATE_PLAYING_HOVER:String = playingHover

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10, AIR 1.5

The "playingHover" state for AudioPreview and its skin

STATE_STOPPEDproperty 
public static var STATE_STOPPED:String = stopped

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10, AIR 1.5

The "stopped" state for AudioPreview and its skin

STATE_STOPPED_HOVERproperty 
public static var STATE_STOPPED_HOVER:String = stoppedHover

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10, AIR 1.5

The "stoppedHover" state for AudioPreview and its skin

streamproperty 
protected var stream:NetStream

toHoverproperty 
protected static var toHover:Object

updateTimerproperty 
protected var updateTimer:Timer

visibleproperty 
visible:Boolean  [write-only] [override]


Implementation
    public function set visible(value:Boolean):void
volumeproperty 
volume:Number

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The volume of the audio playback.


Implementation
    public function get volume():Number
    public function set volume(value:Number):void
wasPlayingBeforeSeekingproperty 
protected var wasPlayingBeforeSeeking:Boolean

Constructor Detail
AudioPreview()Constructor
public function AudioPreview()

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10, AIR 1.5

Constructor

Method Detail
attachSkin()method
override protected function attachSkin():void

detachSkin()method 
override protected function detachSkin():void

formatTimeValue()method 
protected function formatTimeValue(value:Number):String

Formats a time value, specified in seconds, into a String that gets used for currentTime and the duration.

Parameters

value:Number — Value in seconds of the time to format

Returns
String — Formatted time value
handleUpdateTimer()method 
protected function handleUpdateTimer(e:Event):void

Parameters

e:Event

inHoverState()method 
protected function inHoverState():Boolean

Returns
Boolean
initLookups()method 
protected function initLookups():void

initStates()method 
override protected function initStates():void

keyboardHandler()method 
protected function keyboardHandler(event:KeyboardEvent):void

Parameters

event:KeyboardEvent

loadSound()method 
protected function loadSound(mediaModel:IPreviewMediaModel):void

Parameters

mediaModel:IPreviewMediaModel

mouseClickHandler()method 
protected function mouseClickHandler(event:MouseEvent):void

Parameters

event:MouseEvent

muteButton_changeHandler()method 
protected function muteButton_changeHandler(event:Event):void

Parameters

event:Event

netStatusHandler()method 
protected function netStatusHandler(event:NetStatusEvent):void

Parameters

event:NetStatusEvent

onIOError()method 
protected function onIOError(event:Error):void

Parameters

event:Error

onTunePlaybackComplete()method 
protected function onTunePlaybackComplete(event:Event = null):void

Parameters

event:Event (default = null)

partAdded()method 
override protected function partAdded(partName:String, instance:Object):void

Parameters

partName:String
 
instance:Object

pause()method 
public function pause():void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10, AIR 1.5

Pause the playback of audio.

play()method 
public function play():void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10, AIR 1.5

Start the playback of audio.

playerControlsMouseClickHandler()method 
protected function playerControlsMouseClickHandler(event:MouseEvent):void

Parameters

event:MouseEvent

playPauseHandler()method 
protected function playPauseHandler(event:Event):void

Parameters

event:Event

rollOutHandler()method 
protected function rollOutHandler(e:Event):void

Parameters

e:Event

rollOverHandler()method 
protected function rollOverHandler(e:Event):void

Parameters

e:Event

scrubBar_changeEndHandler()method 
protected function scrubBar_changeEndHandler(event:Event):void

Parameters

event:Event

scrubBar_changeStartHandler()method 
protected function scrubBar_changeStartHandler(event:Event):void

Parameters

event:Event

scrubBar_mouseDownHandler()method 
protected function scrubBar_mouseDownHandler(event:Event):void

Parameters

event:Event

scrubBar_thumbPressHandler()method 
protected function scrubBar_thumbPressHandler(event:TrackBaseEvent):void

Parameters

event:TrackBaseEvent

scrubBar_thumbReleaseHandler()method 
protected function scrubBar_thumbReleaseHandler(event:TrackBaseEvent):void

Parameters

event:TrackBaseEvent

seek()method 
protected function seek(value:Number):void

Parameters

value:Number

setCurrentState()method 
override public function setCurrentState(stateName:String, playTransition:Boolean = true):void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Sets the current state of AudioPreview and its skin

Parameters

stateName:String
 
playTransition:Boolean (default = true)

togglePlay()method 
protected function togglePlay():void

updateDuration()method 
protected function updateDuration():void

Constant Detail
DELTA_TO_ENDConstant
protected static const DELTA_TO_END:Number = 100

DONE_DELTAConstant 
protected static const DONE_DELTA:int = 50

MP4_MIMETYPEConstant 
protected static const MP4_MIMETYPE:String = audio/mp4