Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating Dynamic Text color in ActionScript

Status
Not open for further replies.

Rieekan

Programmer
Apr 2, 2001
737
US
Hello,

I have a small app that has a Dynamic Text field inside of a repeated button that needs to change color when the app is on the item this button corresponds to due to a change in the background image from a light to dark color. I've tried using the following code, but to no avail.

Code:
//currentAd is the ad being played
_onShowAds(_currentAd);

function _onShowAds($i)
{
	if (_carousel[$i].button)
	{
		var _previousButton = _carousel[__get__previousAd()].button;
		var _button = _carousel[$i].button;
		var _buttonFormat = new TextFormat();
		_previousButton.label_str._color = 0x000000;
		_buttonFormat.color = 0xFFFFFF;
		_previousButton.gotoAndStop("IDLE");
		_button.label_txt.setTextFormat(_buttonFormat);
		_button.gotoAndPlay("SELECTED");
	}
}

I don't want to have to create the button dynamically in ActionScript as we are using a font that is not free or installed on many machines (Myriad Pro).

Any help is appreciated!

- George
 
Found out what I had done wrong... Missed a level in the button.

Thanks!

- George
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top