SoundtrackController Class
Class org.rapo.games.SoundtrackController
Inheritance
>
AudioController
>
SoundtrackController
Extends the AudioController class to provide a general purpose way to incorporate
mp3 soundtrack playback into games.
| Constructor Summary |
|---|
| | Creates a SoundtrackController instance with a new MovieClip to contain all
GameSound instances. |
| Property Summary |
|---|
| Object | A property list (keyed by game phase names) containing Arrays, each holding references to the
soundtrack files appropriate for that game phase. |
| SoundtrackXML | The XML (SoundtrackXML) object containing the soundtrack info |
| String | The filename of the soundtrack info XML file |
| Properties inherited from org.rapo.games.AudioController |
|---|
|
| Method Summary |
|---|
| | Loads the soundtrack info XML file. |
| | Determines the game phases specified in the soundtrack info XML file. |
| | Determines the tracks specified in the soundtrack info XML file. |
| | Parses the soundtrack info XML file. |
| | Randomly selects and plays an appopriate track for the specified game phase. |
| Methods inherited from org.rapo.games.AudioController |
|---|
|
SoundtrackController
public function SoundtrackController(container:MovieClip, xml_file:String)
Creates a SoundtrackController instance with a new MovieClip to contain all
GameSound instances.
Parameters:
container- The MovieClip (timeline) on which the AudioController's soundClip is created.
xml_file- The name of the XML file containing the soundtrack info.
phases
public var phases:Object;
A property list (keyed by game phase names) containing Arrays, each holding references to the
soundtrack files appropriate for that game phase.
xmlDoc
The XML (SoundtrackXML) object containing the soundtrack info
xmlFile
public var xmlFile:String;
The filename of the soundtrack info XML file
loadXML
public function loadXML()
Loads the soundtrack info XML file.
Parameters:
parsePhase
public function parsePhase(node:XMLNode)
Determines the game phases specified in the soundtrack info XML file.
Parameters:
node- An XML node containing game phase info.
parseTrack
public function parseTrack(node:XMLNode, phase:String)
Determines the tracks specified in the soundtrack info XML file.
Parameters:
node- An XML node containing track info.
phase- The id of the phase to which this track belongs.
parseXML
public function parseXML()
Parses the soundtrack info XML file. Calles when the XML file loads successfully.
Parameters:
playTrack
public function playTrack(phase:String, loop:Boolean)
Randomly selects and plays an appopriate track for the specified game phase.
Parameters:
phase- The specified game phase.
loop- Indicates whether or not the track should loop.
Documentation generated by BLDoc Community Edition from B-Line Express.