Packagecom.gestureworks.cml.elements
Classpublic class MP3
InheritanceMP3 Inheritance TouchContainer Inheritance com.gestureworks.core.TouchSprite

The MP3 element loads an .MP3 file and plays it, with the options to pause, stop, seek, and resume play. The Mp3 element will automatically load any id3 data if it is present. The MP3 element also provides the option of a displaying graphical waveform by setting the display property to "waveform", otherwise "none". The waveform's color can also be set.
     
        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.autoplay = true;
        addChild(mp3Element);        
        mp3Element.init();
     
     



Public Properties
 PropertyDefined By
  autoplay : Boolean
Indicates whether the mp3 file plays upon load
MP3
 InheritedautoShuffle : Boolean
autoshuffles
TouchContainer
  backgroundAlpha : Number
Sets the background alpha
MP3
  backgroundColor : uint
Sets the background color
MP3
 InheritedchildList : ChildList
Returns the object's childList.
TouchContainer
 InheritedclassName : String
sets the class name of displayobject
TouchContainer
 InheritedcloneExclusions : Vector.<String>
[read-only] Returns a list of properties to exclude when cloning this object
TouchContainer
 InheritedcmlIndex : int
Returns the index created by the CML parser.
TouchContainer
 InheriteddimensionsTo : Object
Sets the dimensions of TouchContainer to given object
TouchContainer
  display : String
Visualization display type, can be set to "waveform", "none", or an image URL.
MP3
 InheriteddropShadow : Boolean
Sets the drop shadow effect
TouchContainer
 Inheritedgroup : String
TouchContainer
 Inheritedheight : Number
[override] sets the height of the container
TouchContainer
 InheritedheightPercent : Number
sets the height of the container
TouchContainer
 Inheritedid : String
Returns the object's id.
TouchContainer
  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
  isPlaying : Boolean
[read-only]
MP3
 Inheritedlayout : *
specifies the type of layout
TouchContainer
 InheritedlayoutList : Dictionary
TouchContainer
  loop : Boolean
Mp3 loop play
MP3
 InheritedmouseChildren : Boolean
[override] sets the mousechildren value to true or false.
TouchContainer
  mp3 : MP3Factory
[read-only] Exposes read-only access for the mp3 factory element.
MP3
 InheritedpaddingBottom : Number
Sets the number of pixels between the container's bottom border and the bottom of its content area.
TouchContainer
 InheritedpaddingLeft : Number
Sets the number of pixels between the component's left border and the left edge of its content area.
TouchContainer
 InheritedpaddingRight : Number
Sets the number of pixels between the component's right border and the right edge of its content area.
TouchContainer
 InheritedpaddingTop : Number
Sets the number of pixels between the container's top border and the top of its content area.
TouchContainer
  pan : Number
Sets the pan
MP3
 Inheritedposition : *
Sets the position
TouchContainer
 InheritedrelativeX : Boolean
When set true this containers children's x position will be laid out relatively to each other.
TouchContainer
 InheritedrelativeY : Boolean
When set true this containers children's y position will be laid out relatively to each other.
TouchContainer
 Inheritedsound : String
TouchContainer
  src : String
Sets the source of the mp3.
MP3
 Inheritedstate : Dictionary
TouchContainer
 InheritedstateId : *
Returns the current state id.
TouchContainer
  time : String
[read-only]
MP3
  TIME : String = Time
[static]
MP3
  timer : Timer
MP3
 InheritedtoBitmap : Boolean
TouchContainer
  volume : Number
Sets the volume
MP3
  waveColor : uint
Sets the color of the waveform
MP3
 Inheritedwidth : Number
[override] sets the width of the container
TouchContainer
 InheritedwidthPercent : Number
sets the width of the container
TouchContainer
Protected Properties
 PropertyDefined By
 InheritedcmlGestureList : Object
TouchContainer
Public Methods
 MethodDefined By
  
MP3()
Constructor
MP3
 Inherited
TouchContainer
 Inherited
method searches the child and adds to the list
TouchContainer
 Inherited
addChild(child:DisplayObject):DisplayObject
[override] Adds child to display list and, if not already added, the child list
TouchContainer
 Inherited
addChildAt(child:DisplayObject, index:int):DisplayObject
[override] Adds child to display list and, if not already added, the child list
TouchContainer
 Inherited
applyLayout(value:* = null):void
Apply the containers layout
TouchContainer
 Inherited
childToList(id:String, child:*):void
child appended to the childlist
TouchContainer
 Inherited
clone():*
Clone method
TouchContainer
  
close():void
Closes mp3
MP3
  
dispose():void
[override] Destructor
MP3
 Inherited
getElementById(id:String):*
Searches CML childList by id.
TouchContainer
 Inherited
getElementsByClassName(className:String):Array
Searches the CML childList by className.
TouchContainer
 Inherited
getElementsByTagName(tagName:Class):Array
Searches the CML childList by tagName as Class.
TouchContainer
  
init():void
[override] Initialisation method
MP3
 Inherited
loadState(sId:* = null, recursion:Boolean = false):void
Loads state by index number.
TouchContainer
 Inherited
makeGestureList(value:XMLList):Object
Creates gestureList object from XML
TouchContainer
  
open(file:String = null):void
Closes mp3
MP3
 Inherited
parseCML(cml:XMLList):XMLList
Parse cml for local layouts.
TouchContainer
  
pause():void
Pauses playback
MP3
  
play():void
Plays from the beginning
MP3
 Inherited
postparseCML(cml:XMLList):void
Abstract method allows the setting of a postparse CML routine.
TouchContainer
 Inherited
querySelector(selector:String):*
Searches the CML childList by selector.
TouchContainer
 Inherited
querySelectorAll(selector:*):Array
Search the CML childList by selector.
TouchContainer
 Inherited
removeChild(child:DisplayObject):DisplayObject
[override] Removes child from display list and, if not already removed, the child list
TouchContainer
 Inherited
removeChildAt(index:int):DisplayObject
[override] Removes child from display list and, if not already removed, the child list
TouchContainer
 Inherited
removeChildren(beginIndex:int = 0, endIndex:int = 2147483647):void
[override] Removes children from display list and, if not already removed, the child list
TouchContainer
  
resume():void
Resumes playback from paused position
MP3
 Inherited
saveState(sId:* = null, recursion:Boolean = false):void
Save state by index number.
TouchContainer
 Inherited
searchChildren(value:*, returnType:Class = null):*
This method does a depth first search of childLists.
TouchContainer
  
seek(pos:Number):void
MP3
 Inherited
method sets the dimensions of each child
TouchContainer
  
stop():void
Pauses playback and returns to the beginning
MP3
 Inherited
tweenState(sId:* = null, tweenTime:Number = 1):void
Tween state by stateIndex from current to given state index.
TouchContainer
 Inherited
Updates child padding within this container
TouchContainer
 Inherited
Updates child percent dimensions within this container
TouchContainer
 Inherited
updateProperties(state:* = 0):void
Updates properties from state.
TouchContainer
 Inherited
Updates child relative positions within this container
TouchContainer
Protected Methods
 MethodDefined By
  
load():void
MP3
Property Detail
autoplayproperty
autoplay:Boolean

Indicates whether the mp3 file plays upon load


Implementation
    public function get autoplay():Boolean
    public function set autoplay(value:Boolean):void
backgroundAlphaproperty 
backgroundAlpha:Number

Sets the background alpha

The default value is 1.0.


Implementation
    public function get backgroundAlpha():Number
    public function set backgroundAlpha(value:Number):void
backgroundColorproperty 
backgroundColor:uint

Sets the background color

The default value is 0x333333.


Implementation
    public function get backgroundColor():uint
    public function set backgroundColor(value:uint):void
displayproperty 
display:String

Visualization display type, can be set to "waveform", "none", or an image URL.

The default value is waveform.


Implementation
    public function get display():String
    public function set display(value:String):void
id3property 
id3:ID3Info  [read-only]

ID3 info object


Implementation
    public function get id3():ID3Info
id3Albumproperty 
id3Album:String  [read-only]

ID3 album


Implementation
    public function get id3Album():String
id3Authorproperty 
id3Author:String  [read-only]

ID3 author


Implementation
    public function get id3Author():String
id3Commentproperty 
id3Comment:String  [read-only]

ID3 Comment


Implementation
    public function get id3Comment():String
id3Copyrightproperty 
id3Copyright:String  [read-only]

ID3 Copyright


Implementation
    public function get id3Copyright():String
id3Titleproperty 
id3Title:String  [read-only]

ID3 title


Implementation
    public function get id3Title():String
id3Yearproperty 
id3Year:String  [read-only]

ID3 Year


Implementation
    public function get id3Year():String
isPlayingproperty 
isPlaying:Boolean  [read-only]


Implementation
    public function get isPlaying():Boolean
loopproperty 
loop:Boolean

Mp3 loop play


Implementation
    public function get loop():Boolean
    public function set loop(value:Boolean):void
mp3property 
mp3:MP3Factory  [read-only]

Exposes read-only access for the mp3 factory element.


Implementation
    public function get mp3():MP3Factory
panproperty 
pan:Number

Sets the pan


Implementation
    public function get pan():Number
    public function set pan(value:Number):void
srcproperty 
src:String

Sets the source of the mp3.


Implementation
    public function get src():String
    public function set src(value:String):void
timeproperty 
time:String  [read-only]


Implementation
    public function get time():String
TIMEproperty 
public static var TIME:String = Time

timerproperty 
public var timer:Timer

volumeproperty 
volume:Number

Sets the volume


Implementation
    public function get volume():Number
    public function set volume(value:Number):void
waveColorproperty 
waveColor:uint

Sets the color of the waveform

The default value is 0xFFFFFF.


Implementation
    public function get waveColor():uint
    public function set waveColor(value:uint):void
Constructor Detail
MP3()Constructor
public function MP3()

Constructor

Method Detail
close()method
public function close():void

Closes mp3

dispose()method 
override public function dispose():void

Destructor

init()method 
override public function init():void

Initialisation method

load()method 
protected function load():void

open()method 
public function open(file:String = null):void

Closes mp3

Parameters

file:String (default = null)

pause()method 
public function pause():void

Pauses playback

play()method 
public function play():void

Plays from the beginning

resume()method 
public function resume():void

Resumes playback from paused position

seek()method 
public function seek(pos:Number):void

Parameters

pos:Number

stop()method 
public function stop():void

Pauses playback and returns to the beginning