AudioDisplay

Kind of class: public class
Package:
Inherits from:
Version: 12 Jul 2010 Added autoPlay parameter.
16 Apr 2010 Improved error handling
30 Mar 2010 AudioPlayers now use TextFormat objects for TextFields
27 Mar 2010 Added LightboxContentInfo and LightboxEvent classes
7 Mar 2010
Author: John Polacek, john@johnpolacek.com
Classpath: com.johnpolacek.display.AudioDisplay
File last modified: Friday, 18 February 2011, 00:30:48
The AudioDisplay class creates audio players that load and play mp3 files with optional title and subtitle text fields. Includes a SoundSpectrum class that animates during playback.
Example
  • import com.johnpolacek.display.AudioDisplay;
    var filepaths:Array = ["example1.mp3","example2.mp3","example3.mp3"];
    var songs:Array = ["Song Title 1","Song Title 2","Song Title 3"];
    var artists:Array = ["Artist Name 1","Artist Name 2","Artist Name 3"];
    var mp3player:AudioDisplay = new AudioDisplay();
    mp3player.loadAudio(filepaths, songs, artists);
    addChild(mp3player);
    

Summary

Constructor
Instance properties
Instance methods
  • loadAudio (urls:Array, titles:Array = null, subtitles:Array = null) : void
  • destroy () : void
    • Remove event listeners and clear children
Instance methods inherited from ContentDisplay

Constructor

AudioDisplay

function AudioDisplay()

Instance properties

autoPlay

autoPlay:Boolean = false(read,write)

If true, top player in menu starts playback on load complete. Default is false

backgroundColor

backgroundColor:uint = 0x000000(read,write)

Color of player background. Default is 0x000000

buttonColor

buttonColor:uint = 0xFFFFFF(read,write)

Color of player buttons. Default is 0xFFFFFF

playerHeight

playerHeight:Number = 50(read,write)

Height (in pixels) of player (not inluding progress bar). Default is 50

playerWidth

playerWidth:Number = 400(read,write)

Width (in pixels) of player. Default is 400

subtitleTextFormat

subtitleTextFormat:TextFormat(read,write)

The TextFormat for the subtitle TextField.

titleTextFormat

titleTextFormat:TextFormat(read,write)

The TextFormat for the title TextField.

trackAlpha

trackAlpha:Number = 1(read,write)

Player track alpha. Default is 1

trackColor

trackColor:uint = 0x666666(read,write)

Player track color. Default is 0x666666

Instance methods

destroy

override function destroy() : void

Remove event listeners and clear children

loadAudio

function loadAudio(urls:Array, titles:Array = null, subtitles:Array = null) : void