I am trying to change the color of a button to the rollover color to act as a current state in the navigation menu. The action script below works if I am using a Dynamic text field in the movieclip with the instance name of “btnLabel”. However I will not be using a text field in my button movieclip, I have imported the button labels from Illustrator as shapes for better appearance and letterspacing. Can anyone tell me another way to change the color of my movie clip “btnLabel” without using “textColor”.
Or if someone has a better way that will work also.
//----------< Define Nav Rollover Colors >----------//
var overColor:Number = 0xFF0000;
var outColor:Number = 0x666666;
function changeOptionColor(myOption:MovieClip, myColor:Number) {
myOption.btnLabel.textColor = myColor;
}
//----------< Re-enable Btns >----------//
function reActivateBtns() {
btn1.enabled = true;
btn2.enabled = true;
changeOptionColor(btn1, outColor);
changeOptionColor(btn1, outColor);
};
//----------< Btn 1 >----------//
btn1.onRollOver = function() {
changeOptionColor(this, overColor);
};
btn1.onRollOut = function() {
changeOptionColor(this, outColor);
};
btn1.onRelease = function() {
reActivateBtns();
changeOptionColor(this, overColor);
this.enabled = false;
};
//----------< Btn 2 >----------//
btn2.onRollOver = function() {
changeOptionColor(this, overColor);
};
btn2.onRollOut = function() {
changeOptionColor(this, outColor);
};
btn2.onRelease = function() {
reActivateBtns();
changeOptionColor(this, overColor);
this.enabled = false;
};