No problem.
One more thing to note is that the variable (property) hasInitialized could be a Boolean datatype instead of a String.
So, instead of setting a string value:
this.hasInitialized = “yes”;
You can set a boolean value:
this.hasInitialized = true;
I decided that instead of hosting the file, I would post it here so others can see what we’re talking about… In order to use this updated class in the JukeBox, you’ll need to update all those function calls to match the names of the getter and setter functions.
Here’s the updated initializeDisplay class:
initializeDisplay.as:
class initializeDisplay
{
//properties
private var songList:Array = new Array();
private var hasInitialized:Boolean;
private var nBgColor:Number;
private var nButtonBGColor:Number;
private var buttonBuffer:Number;
private var currentSongButton:String;
private var nButtonBGColor_over:Number;
private var nButtonTextColor:Number;
private var buttonTextSize:Number;
private var nMenuButtonBGColor:Number;
private var nMenuButtonBGColor_over:Number;
private var nMenuButtonTextColor:Number;
private var menuButtonTextSize:Number;
//constructor
function initializeDisplay(songsForList:Array)
{
//this will be the color of the movie’s background.
//change this to change the background color.
this.nBgColor = 0×660000;
//this will be the color of all the buttons’ background.
//change this to change their background colors.
this.nButtonBGColor = 0×330000;
//this will be the color of all the buttons’ background
//when the button is hovered over with the mouse.
//change this to change the color
this.nButtonBGColor_over = 0xFF0000;
//this will be the color of all the buttons’ text color
//change this to change their text colors.
this.nButtonTextColor = 0xFFFAFA;
//this will be the sizer of all the buttons’ text
//change this to change the size of their text.
this.buttonTextSize = 20;
//the buffer will increase the space between buttons
this.buttonBuffer = 10;
//this just signals that a new object has been created
this.hasInitialized = true;
//copying the passed array into the class’ array
this.songList = songsForList;
//changing this hex value will change the background color of the menu buttons
this.nMenuButtonBGColor = 0×330000;
//changing this hex value will change the hover background color of the menu buttons
this.nMenuButtonBGColor_over = 0xFF0000;
//changing this hex value will change the text color of the menu buttons
this.nMenuButtonTextColor = 0xFFFAFA;
//changing this value will change the text size of the menu buttons
this.menuButtonTextSize = 20;
}
//function to get the background color to be used for the buttons
public function get buttonBGColor():Number
{
return nButtonBGColor;
}
//function to get the background color to be used for the stage’s background
public function get BGColor():Number
{
return nBgColor;
}
//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.
public function get getInitializedStatus():Boolean
{
return hasInitialized;
}
//return the button buffer number
public function get getButtonBuffer():Number
{
return this.buttonBuffer;
}
//function for setting current song button
function setCurrentSongButton(theCurrentSongButton:String):Void
{
this.currentSongButton = theCurrentSongButton;
}
//function for getting current song button
function getCurrentSongButton():String
{
return this.currentSongButton;
}
//function for getting the button’s background color when hovered over
public function get buttonBGColor_over():Number
{
return nButtonBGColor_over;
}
//function for getting the button’s text color
public function get buttonTextColor():Number
{
return nButtonTextColor;
}
//function for getting the button’s text size
function getButtonTextSize():Number
{
return this.buttonTextSize;
}
//function for getting the menu button’s background color
public function get menuButtonBGColor():Number
{
return nMenuButtonBGColor;
}
//function for getting the menu button’s background color when hovered over
public function get menuButtonBGColor_over():Number
{
return nMenuButtonBGColor_over;
}
//function for getting the menu button’s text size
function getMenuButtonTextSize():Number
{
return this.menuButtonTextSize;
}
//function for getting the menu button’s text color
public function get menuButtonTextColor():Number
{
return nMenuButtonTextColor;
}
}
DISCLAIMER: I only updated the properties and getter functions for those variables that were mistyped… the rest is the same, so it should be updated also.