# Changing Fonts

**URL:** <https://forum.kirupa.com/t/changing-fonts/323707>\
**Category:** flash\
**Created:** [July 13, 2011, 10:39am UTC](https://forum.kirupa.com/t/changing-fonts/323707 "2011-07-13T10:39:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nuwa](https://avatars.discourse-cdn.com/v4/letter/n/e36b37/32.png) [@Nuwa](https://forum.kirupa.com/u/Nuwa)\
**Post date:** [July 13, 2011, 10:39am UTC](https://forum.kirupa.com/t/changing-fonts/323707/1 "2011-07-13T10:39:46Z")

</div>

I have a textbox and a button on the stage and what i want is, when the user clicks on the button the font in the textbox to be changed.

This is the code I have, but nothing is happening when I click the button.  
SinFont is the embedded font.  
Please help!!

```auto
btnChange.addEventListener(MouseEvent.CLICK, changefont);
function changefont(event:MouseEvent):void
{
	var getFont = new SinFont();
	var txtForm:TextFormat = new TextFormat();
	txtForm.font = getFont.fontName;
	txt1.embedFonts = true;
	txt1.antiAliasType = AntiAliasType.ADVANCED;
}

```
