| Package | com.gestureworks.cml.element |
| Class | public class MP3 |
| Inheritance | MP3 ElementFactory flash.display.Sprite |
| Subclasses | MP3Element |
var mp3Element:MP3 = new MP3();
mp3Element.src = "RuthCalledShot_vbr.mp3";
mp3Element.display = "waveform";
mp3Element.backgroundAlpha = 0.5;
mp3Element.backgroundColor = 0x333333;
mp3Element.waveColor = 0x558855;
mp3Element.volume = 1.0;
mp3Element.pan = 0;
mp3Element.loop = true;
mp3Element.preload = true;
mp3Element.autoplay = true;
addChild(mp3Element);
mp3Element.init();
| Property | Defined By | ||
|---|---|---|---|
![]() | alpha : Number [override] [write-only]
sets the alpha for display objects
| ElementFactory | |
| autoLoad : Boolean Deprecated: Please Use preload | MP3 | ||
| autoplay : Boolean
Indicates whether the mp3 file plays upon load
| MP3 | ||
| backgroundAlpha : Number
Sets the background alpha
| MP3 | ||
| backgroundColor : uint
Sets the background color
| MP3 | ||
![]() | blur : Boolean
Sets the drop shadow effect
| ElementFactory | |
![]() | bottom : Number
sets the bottom value
| ElementFactory | |
![]() | class_ : String
Object's css class;
| ElementFactory | |
![]() | className : String
sets the class name of displayobject
| ElementFactory | |
![]() | cmlIndex : int
sets the cml index
| ElementFactory | |
![]() | debugStyle : *
sets the debug style
| ElementFactory | |
| display : String
Visualization display type, can be set to "waveform", "none", or an image URL. | MP3 | ||
![]() | displayEvents : String
Use for dispatch completes. | ElementFactory | |
![]() | dropShadow : Boolean
Sets the drop shadow effect
| ElementFactory | |
| duration : Number [read-only]
Total duration
| MP3 | ||
![]() | height : Number [override]
Sets width of the display object in pixels
| ElementFactory | |
![]() | heightPercent : String
sets the height percent of display object
| ElementFactory | |
![]() | horizontalCenter : Number
sets the horizontal center of display object
| ElementFactory | |
![]() | id : String
sets the id of child
| ElementFactory | |
| id3 : ID3Info [read-only]
ID3 info object
| MP3 | ||
| id3Album : String [read-only]
ID3 album
| MP3 | ||
| id3Author : String [read-only]
ID3 author
| MP3 | ||
| id3Comment : String [read-only]
ID3 Comment
| MP3 | ||
| id3Copyright : String [read-only]
ID3 Copyright
| MP3 | ||
| id3Title : String [read-only]
ID3 title
| MP3 | ||
| id3Year : String [read-only]
ID3 Year
| MP3 | ||
![]() | index : int
sets the index of display object
| ElementFactory | |
| isPlaying : Boolean [read-only]
Sets video playing status
| MP3 | ||
![]() | left : Number
sets left value
| ElementFactory | |
| loop : Boolean
Specifies wether the mp3 file will to loop to the beginning and continue playing upon completion
| MP3 | ||
| pan : Number
Sets the audio pannning ( -1 = left, 0 = center, 1 = right )
| MP3 | ||
| percentLoaded : Number [read-only]
Percent of file loaded
| MP3 | ||
| position : Number [read-only]
Playhead position in ms
| MP3 | ||
| preload : Boolean
Indicates whether the mp3 file is preloaded by the cml parser
| MP3 | ||
![]() | propertyStates : Array Deprecated: Please Use state | ElementFactory | |
![]() | right : Number
sets the right value
| ElementFactory | |
![]() | scale : Number
Sets both the x and y scale values
| ElementFactory | |
![]() | scaleX : Number [override]
Sets width of the display object in pixels
| ElementFactory | |
![]() | scaleY : Number [override]
Sets width of the display object in pixels
| ElementFactory | |
| src : String
Sets the mp3 file path
| MP3 | ||
![]() | state : Array
property states array
| ElementFactory | |
| time : String [read-only] | MP3 | ||
| TIME : String = Time [static] | MP3 | ||
| timer : Timer | MP3 | ||
![]() | top : Number
sets top value
| ElementFactory | |
![]() | verticalCenter : Number
sets the vertical center of display object
| ElementFactory | |
| volume : Number
Sets the volume
| MP3 | ||
| waveColor : uint
Sets the color of the waveform
| MP3 | ||
![]() | width : Number [override]
Sets width of the display object in pixels
| ElementFactory | |
![]() | widthPercent : String
sets the percent of width of display object
| ElementFactory | |
| Method | Defined By | ||
|---|---|---|---|
MP3()
Constructor
| MP3 | ||
![]() | clone():*
Returns clone of self
| ElementFactory | |
close():void
Closes mp3
| MP3 | ||
displayComplete():void [override]
CML initialization callback
| MP3 | ||
dispose():void [override]
Disposal method
| MP3 | ||
init():void [override]
Initialisation method
| MP3 | ||
open(file:String):void
Sets the src property from the argument and loads the mp3 file
| MP3 | ||
![]() | parseCML(cml:XMLList):XMLList
parses cml file
| ElementFactory | |
pause():void
Pauses playback
| MP3 | ||
play():void
Plays from the beginning
| MP3 | ||
![]() | postparseCML(cml:XMLList):void
post parses the cml file
| ElementFactory | |
resume():void
Resumes playback from paused position
| MP3 | ||
seek(pos:Number):void
Sets the mp3 playhead position in milliseconds
| MP3 | ||
stop():void
Pauses playback and returns to the beginning
| MP3 | ||
![]() | updateProperties(state:Number = 0):void
this method updates the properties
| ElementFactory | |
| autoLoad | property |
autoLoad:Boolean public function get autoLoad():Boolean public function set autoLoad(value:Boolean):void| autoplay | property |
autoplay:BooleanIndicates whether the mp3 file plays upon load
The default value is true.
public function get autoplay():Boolean public function set autoplay(value:Boolean):void| backgroundAlpha | property |
backgroundAlpha:NumberSets the background alpha
The default value is 1.0.
public function get backgroundAlpha():Number public function set backgroundAlpha(value:Number):void| backgroundColor | property |
backgroundColor:uintSets the background color
The default value is 0x333333.
public function get backgroundColor():uint public function set backgroundColor(value:uint):void| display | property |
display:StringVisualization display type, can be set to "waveform", "none", or an image URL.
The default value is waveform.
public function get display():String public function set display(value:String):void| duration | property |
duration:Number [read-only] Total duration
public function get duration():Number| id3 | property |
id3:ID3Info [read-only] ID3 info object
public function get id3():ID3Info| id3Album | property |
id3Album:String [read-only] ID3 album
public function get id3Album():String| id3Author | property |
id3Author:String [read-only] ID3 author
public function get id3Author():String| id3Comment | property |
id3Comment:String [read-only] ID3 Comment
public function get id3Comment():String| id3Copyright | property |
id3Copyright:String [read-only] ID3 Copyright
public function get id3Copyright():String| id3Title | property |
id3Title:String [read-only] ID3 title
public function get id3Title():String| id3Year | property |
id3Year:String [read-only] ID3 Year
public function get id3Year():String| isPlaying | property |
isPlaying:Boolean [read-only] Sets video playing status
public function get isPlaying():Boolean| loop | property |
loop:BooleanSpecifies wether the mp3 file will to loop to the beginning and continue playing upon completion
The default value is false.
public function get loop():Boolean public function set loop(value:Boolean):void| pan | property |
pan:NumberSets the audio pannning ( -1 = left, 0 = center, 1 = right )
The default value is 0.
public function get pan():Number public function set pan(value:Number):void| percentLoaded | property |
percentLoaded:Number [read-only] Percent of file loaded
public function get percentLoaded():Number| position | property |
position:Number [read-only] Playhead position in ms
public function get position():Number| preload | property |
preload:BooleanIndicates whether the mp3 file is preloaded by the cml parser
The default value is true.
public function get preload():Boolean public function set preload(value:Boolean):void| src | property |
src:StringSets the mp3 file path
The default value is .
public function get src():String public function set src(value:String):void| time | property |
time:String [read-only] public function get time():String| TIME | property |
public static var TIME:String = Time| timer | property |
public var timer:Timer| volume | property |
volume:NumberSets the volume
The default value is 1.
public function get volume():Number public function set volume(value:Number):void| waveColor | property |
waveColor:uintSets the color of the waveform
The default value is 0xFFFFFF.
public function get waveColor():uint public function set waveColor(value:uint):void| MP3 | () | Constructor |
public function MP3()Constructor
| close | () | method |
public function close():voidCloses mp3
| displayComplete | () | method |
override public function displayComplete():voidCML initialization callback
| dispose | () | method |
override public function dispose():voidDisposal method
| init | () | method |
override public function init():voidInitialisation method
| open | () | method |
public function open(file:String):voidSets the src property from the argument and loads the mp3 file
Parameters
file:String — Full path and file name of mp3 file
|
| pause | () | method |
public function pause():voidPauses playback
| play | () | method |
public function play():voidPlays from the beginning
| resume | () | method |
public function resume():voidResumes playback from paused position
| seek | () | method |
public function seek(pos:Number):voidSets the mp3 playhead position in milliseconds
Parameters
pos:Number — Number in ms
|
| stop | () | method |
public function stop():voidPauses playback and returns to the beginning