ActionScript Reference

SoundPlayer's Events:

  Control Button Events
  onTimeDrag
  onVolumeDrag
  onPanDrag
  onSoundStart
  onSoundStop
  onPercentage
  onXMLLoad

SoundPlayer's Methods:

  doPlay
  doPause
  doStop
  doNext
  doPrev
  setPosition
  setVolume
  setPan
  addXML
  addFile
  removeFile
  moveFile
  fadeSound
  panSound
  getCurrent
  getPlayList
  toggleTimeDisplay
  randomizeList
  moveOn
  moveOff

 

SoundPlayer.on...

Availability

Flash Player 6.

Description

All SoundPlayer buttons trigger events. The following events are supported:

onNextRelease

onStopRelease

onPauseRelease

onPlayRelease

onPrevRelease

onNextOver

onStopOver

onPauseOver

onPlayOver

onPrevOver

onNextOut

onStopOut

onPauseOut

onPlayOut

onPrevOut

onNextPress

onStopPress

onPausePress

onPlayPress

onPrevPress

onNextReleaseOutside

onStopReleaseOutside

onPauseReleaseOutside

onPlayReleaseOutside

onPrevReleaseOutside

SoundPlayer.onTimeDrag

Availability

Flash Player 6.

Usage

my_spl.onTimeDrag() {};

Parameters

None

Returns

Current position of the song in seconds

Description

Event handler; invoked while the position slider is dragged.
You must define a function that executes when the event is invoked.


SoundPlayer.onVolumeDrag

Availability

Flash Player 6.

Usage

my_spl.onVolumeDrag();

Parameters

None

Returns

Current volume

Description

Event handler; invoked while volume slider is dragged.
You must define a function that executes when the event is invoked.


SoundPlayer.onPanDrag

Availability

Flash Player 6.

Usage

my_spl.onPanDrag();

Parameters

None

Returns

Current Panorama

Description

Event handler; invoked while panorama slider is dragged.
You must define a function that executes when the event is invoked.


SoundPlayer.onSoundStart

Availability

Flash Player 6.

Usage

my_spl.onSoundStart();

Parameters

None

Returns

Nothing.

Description

Event handler; invoked when Soundplayer starts playing.
You must define a function that executes when the event is invoked.

SoundPlayer.onSoundStop

Availability

Flash Player 6.

Usage

my_spl.onSoundStop();

Parameters

None

Returns

Nothing.

Description

Event handler; invoked when Soundplayer stops playing.
You must define a function that executes when the event is invoked.

SoundPlayer.onPercentage

Availability

Flash Player 6.

Usage

my_spl.onPercentage();

Parameters

None

Returns

Percentage being loaded

Description

Event handler; invoked while sound is loading.
You must define a function that executes when the event is invoked.

 

SoundPlayer.onXMLLoad

Availability

Flash Player 6.

Usage

my_spl.onXMLLoad();

Parameters

None

Returns

Nothing

Description

Event handler; invoked after external XML file is successfully loaded and parsed.
You must define a function that executes when this event is invoked.

 

SoundPlayer.doPlay

Availability

Flash Player 6.

Usage

my_spl.doPlay();

Parameters

None

Returns

Nothing

Description

Method; Triggers Play button

 

SoundPlayer.doPause

Availability

Flash Player 6.

Usage

my_spl.doPause();

Parameters

None

Returns

Nothing

Description

Method; Triggers Pause button

 

SoundPlayer.doStop

Availability

Flash Player 6.

Usage

my_spl.doStop();

Parameters

None

Returns

Nothing

Description

Method; Triggers Stop button

 

SoundPlayer.doNext

Availability

Flash Player 6.

Usage

my_spl.doNext();

Parameters

None

Returns

Nothing

Description

Method; Triggers Next button

 

SoundPlayer.doPrev

Availability

Flash Player 6.

Usage

my_spl.doPrev();

Parameters

None

Returns

Nothing

Description

Method; Triggers Previous button

 

SoundPlayer.setPosition

Availability

Flash Player 6.

Usage

my_spl.setPosition(seconds);

Parameters

seconds - number of seconds where playhead should jump t

Returns

Nothing

Description

Method; Sets position of the playhead

 

SoundPlayer.setVolume

Availability

Flash Player 6.

Usage

my_spl.setVolume(value);

Parameters

value - Volume value (0 - 100)

Returns

Nothing

Description

Method; Sets the sound volume.

 

SoundPlayer.setPan

Availability

Flash Player 6.

Usage

my_spl.setPan(value);

Parameters

value - Panorama value (-100 - 100)

Returns

Nothing

Description

Method; Sets the panorama.

 

SoundPlayer.addXML

Availability

Flash Player 6.

Usage

my_spl.addXML(url);

Parameters

url - path to the xml file

Returns

Nothing

Description

Method; Loads xml file and adds its data to the playlist.

 

SoundPlayer.addFile

Availability

Flash Player 6.

Usage

my_spl.addFile(path, display_txt, streaming, soundbuffer);

Parameters

path - path to the mp3 file
display_txt - Text that will be displayed while the song is playing
streaming - Boolean; If the file will be streamed or not
soundbuffer - Number of seconds that flash will buffer before sound starts playing

Returns

Nothing

Description

Method; Adds file to the playlist. If there is no file extension, component will look in the library for the item with that identifier name.

 

SoundPlayer.removeFile

Availability

Flash Player 6.

Usage

my_spl.removeFile(id);

Parameters

id - id of the file to be removed in the playlist

Returns

Nothing

Description

Method; Removes the file from the playlist.

 

SoundPlayer.moveFile

Availability

Flash Player 6.

Usage

my_spl.moveFile(id, old_id);

Parameters

id - id of the file to be removed
old_id - new id of the file

Returns

Nothing

Description

Method; Changes the position of the file in the playlist

 

SoundPlayer.fadeSound

Availability

Flash Player 6.

Usage

my_spl.fadeSound(final_value, duration, object, method);

Parameters

final_value - value of the volume after fade (0-100)
duration - duration of fade in miliseconds; volume changes are applied in increments of 100 miliseconds
object - object that contains the method
method - method to execute after fade is finished

Returns

Nothing

Description

Method; Changes the volume of currently played sound over the time

 

SoundPlayer.panSound

Availability

Flash Player 6.

Usage

my_spl.panSound(final_value, duration, object, method);

Parameters

final_value - value of the pan after change (-100 - 100)
duration - duration of change in miliseconds; pan changes are applyed in steps of 100 miliseconds
object - object that contains the method
method - method to execute after pan change is finished

Returns

Nothing

Description

Method; Changes the pan of currently played sound over the specified time

 

SoundPlayer.getCurrent

Availability

Flash Player 6.

Usage

my_spl.getCurrent();

Parameters

None

Returns

Nothing

Description

Method; Returns id of the currently played file from the playlist

 

SoundPlayer.getPlayList

Availability

Flash Player 6.

Usage

my_spl.getPlayList();

Parameters

None

Returns

Array

Description

Method; Returns an array of objects with following properties: path, display_txt, streaming, buffer

 

SoundPlayer.toggleTimeDisplay

Availability

Flash Player 6.

Usage

my_spl.toggleTimeDisplay();

Parameters

visibility - Optional; If visibility should be toggled pass "visibility"

Returns

Nothing

Description

Method; Toggles if time display will show time elapsed or time remaining. Optionaly it can toggle visibility of time display

 

SoundPlayer.randomizeList

Availability

Flash Player 6.

Usage

my_spl.randomizeList();

Parameters

None

Returns

Nothing

Description

Method; Randomizes the playlist.

 

SoundPlayer.moveOn

Availability

Flash Player 6.

Usage

my_spl.moveOn(interval, period);

Parameters

interval - interval between playhead changing its position (milliseconds)
period - movement of the playhead in milliseconds

Returns

Nothing

Description

Method; Moves the playhead. Use it to FastForward and Rewind the song

 

SoundPlayer.moveOff

Availability

Flash Player 6.

Usage

my_spl.moveOff();

Parameters

None

Returns

Nothing

Description

Method; Stops moveOn method from working