PDA

View Full Version : How to change button label color in runtime


Freedrick
02-06-2008, 05:20 AM
i want to change Label color to button which are placed in one movieclip.

MaxMedia_co_uk
02-07-2008, 12:15 PM
Under the parameters of the label, set html=true. Then with actionscript you can include HTML in your label text, e.g. :
myLabel.text="<font color="#FF0000">Error !</font>";

MaxMedia_co_uk
02-07-2008, 12:18 PM
Sorry, that's for standard labels, I just noticed you asked about button labels. You can always leave the button label blank though, and put a standard label on top!

dr_zeus
02-07-2008, 05:27 PM
If you mean the fl.controls.Button component, you can set the "textFormat" style with

myButton.setStyle("textFormat", new TextFormat(/*whatever you need here*/));