# Help with font color

**URL:** <https://forum.kirupa.com/t/help-with-font-color/243148>\
**Category:** flash\
**Created:** [November 3, 2007, 12:38pm UTC](https://forum.kirupa.com/t/help-with-font-color/243148 "2007-11-03T12:38:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![davelaruedrum](https://avatars.discourse-cdn.com/v4/letter/d/4da419/32.png) [@davelaruedrum](https://forum.kirupa.com/u/davelaruedrum)\
**Post date:** [November 3, 2007, 12:38pm UTC](https://forum.kirupa.com/t/help-with-font-color/243148/1 "2007-11-03T12:38:16Z")

</div>

Hi,  
I’m loading in a menu dynamically, using XML and css, just like Kirupas tutorial.  
I want each nav text to change color when i do a mouse rollover, and then change back at mouse roll out.  
How can i do this when the color is specified in the CSS file? Is there a way to do this just in the function?  
Here is my code (same as Kirupas):

```auto
mclListener.onLoadInit = function(target_mc:MovieClip) {

	// add link property
	target_mc.linkURL = astrLinks[nCounter];
	target_mc.navText = astrText[nCounter];
	// add events
	target_mc.onPress = buttonClick;
	
	//declare variables
	var buttonImgHeight:Number = target_mc._height;
	var buttonImgWidth:Number = target_mc._width;
	//set distance between buttons
	target_mc._y = Math.round( yPosition );
	yPosition += buttonImgHeight+1;
	
	// place the text on the button and center the text
	target_mc.createTextField( "buttonText", nCounter, 0, 0, buttonImgWidth, buttonImgHeight );

	// set properties of textField
	target_mc.buttonText.border = false;
	target_mc.buttonText.selectable = false;
	target_mc.buttonText.wordWrap = true;
	
	//set button text
	target_mc.buttonText.styleSheet = my_css;
	target_mc.buttonText.htmlText = "<.buttonStyle>"+ astrText[nCounter] +"</.buttonStyle>"; 
	
	//set filters (disabled)
	//target_mc.buttonText.filters = filterArray;
	
	// center the text vertically in the button
	target_mc.buttonText.autoSize = true;
	var nMiddle:Number = ( buttonImgHeight/2 );
	target_mc.buttonText._y = nMiddle - ( target_mc.buttonText._height/2 );
	
	nCounter += 1;
	//new Tween(target_mc, "_alpha", Strong.easeOut, 0, 100, 1, true );
};

```
