class initializeMusic { //var definitions private var musicPlaying:Boolean; private var hasInitialized:String; private var songList = new Array(); private var currentSong:String; private var isRandom:Boolean; private var randomSong:String; private var songButtonPlaying:Number; private var numberOfLoops:Number; //constructor function initializeMusic() { this.musicPlaying = false; this.hasInitialized = "yes"; this.isRandom = false; this.randomSong = ""; this.songButtonPlaying = 0; this.numberOfLoops = 1; //put all songs into an array //this is where you put the names of your songs. //make sure the name matches exactly the linkage name in //your .fla songList[0] = "song1"; songList[1] = "song2"; songList[2] = "song3"; songList[3] = "song4"; songList[4] = "song5"; songList[5] = "song6"; songList[6] = "song7"; songList[7] = "song8"; //add more songs to the array if you want to add songs //to the jukebox. NOTE: if you are going to add more than //ten songs then you will have to modify some of the code //in the .fla to handle it. //songList[8] = ""; //songList[9] = ""; } //function for turning the music off function musicOff(Void):Void { this.musicPlaying = false; } //function for turning the music on function musicOn(Void):Void { this.musicPlaying = true; } //function for checking to see if the music is currently playing function getMusicStatus(Void):Boolean { return this.musicPlaying; } //function for checking to see what current random song is playing function getRandomSong(Void):String { return this.randomSong; } //function for setting current random song that is playing function setRandomSong(currRand:String):Void { this.randomSong = currRand; } //function for getting number of song loops to use function getNumberOfLoops(Void):Number { return this.numberOfLoops; } //function for setting number of song loops to use function setNumberOfLoops(loops:Number):Void { this.numberOfLoops = loops; } //function for checking to see if the initializeMusic Object has been created //this is set as a string since it will automatically return "undefined" if it //has not yet been created. function getInitializedStatus(Void):String { return this.hasInitialized; } //function for getting the songs function getSongs(Void):Array { return this.songList; } //function for setting current song function setCurrentSong(theCurrentSong:String):Void { this.currentSong = theCurrentSong; } //function for getting current song function getCurrentSong(Void):String { return this.currentSong; } //function for checking if random is selected function getIsRandom(Void):Boolean { return this.isRandom; } //function setting what song button is playing function setSongButtonPlaying(theButton:Number):Void { this.songButtonPlaying = theButton; } //function setting what song button is playing function getSongButtonPlaying(Void):Number { return this.songButtonPlaying; } //function for setting random boolean function setIsRandom(Void):Void { if(this.isRandom == false) { this.isRandom = true; } else { this.isRandom = false; } } }