/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// Most of the time when you have a checkbox with a label and link in that label, you just want to change the color of that link on rollOver or rollOut. Here is how: // In your button class private function overState():void { var correctIndex:int = _label.text.toLowerCase( ).indexOf( "text i want to change color to" ); var tF:TextFormat = Fonts.getFormat( Fonts.AVANTGARDE ); tF.color = 0xFFCC00; _label.setTextFormat( tF , correctIndex , _label.text.length ); } private function outState():void { var tF:TextFormat = Fonts.getFormat( Fonts.AVANTGARDE ); tF.color = 0xCCFF00; _label.setTextFormat( tF ); }