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 |
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
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.
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.
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.
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.
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.
Availability
Flash Player 6.
Usage
my_spl.doPlay();
Parameters
None
Returns
Nothing
Description
Method; Triggers Play button
Availability
Flash Player 6.
Usage
my_spl.doPause();
Parameters
None
Returns
Nothing
Description
Method; Triggers Pause button
Availability
Flash Player 6.
Usage
my_spl.doStop();
Parameters
None
Returns
Nothing
Description
Method; Triggers Stop button
Availability
Flash Player 6.
Usage
my_spl.doNext();
Parameters
None
Returns
Nothing
Description
Method; Triggers Next button
Availability
Flash Player 6.
Usage
my_spl.doPrev();
Parameters
None
Returns
Nothing
Description
Method; Triggers Previous button
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
Availability
Flash Player 6.
Usage
my_spl.setVolume(value);
Parameters
value - Volume value (0 - 100)
Returns
Nothing
Description
Method; Sets the sound volume.
Availability
Flash Player 6.
Usage
my_spl.setPan(value);
Parameters
value - Panorama value (-100 - 100)
Returns
Nothing
Description
Method; Sets the panorama.
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.
Availability
Flash Player 6.
Usage
my_spl.addFile(path, display_txt, streaming, soundbuffer);
Parameters
path - path to the mp3 fileReturns
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.
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.
Availability
Flash Player 6.
Usage
my_spl.moveFile(id, old_id);
Parameters
id - id of the file to be removedReturns
Nothing
Description
Method; Changes the position of the file in the playlist
Availability
Flash Player 6.
Usage
my_spl.fadeSound(final_value, duration, object, method);
Parameters
final_value - value of the volume after fade (0-100)Returns
Nothing
Description
Method; Changes the volume of currently played sound over the time
Availability
Flash Player 6.
Usage
my_spl.panSound(final_value, duration, object, method);
Parameters
final_value - value of the pan after change (-100 - 100)Returns
Nothing
Description
Method; Changes the pan of currently played sound over the specified time
Availability
Flash Player 6.
Usage
my_spl.getCurrent();
Parameters
None
Returns
Nothing
Description
Method; Returns id of the currently played file from the playlist
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
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
Availability
Flash Player 6.
Usage
my_spl.randomizeList();
Parameters
None
Returns
Nothing
Description
Method; Randomizes the playlist.
Availability
Flash Player 6.
Usage
my_spl.moveOn(interval, period);
Parameters
interval - interval between playhead changing its position (milliseconds)Returns
Nothing
Description
Method; Moves the playhead. Use it to FastForward and Rewind the song
Availability
Flash Player 6.
Usage
my_spl.moveOff();
Parameters
None
Returns
Nothing
Description
Method; Stops moveOn method from working