# \[CS3/AS2\]Button to change fonts in a dynamic box

**URL:** <https://forum.kirupa.com/t/cs3-as2-button-to-change-fonts-in-a-dynamic-box/270189>\
**Category:** Uncategorized\
**Created:** [September 6, 2008, 4:16am UTC](https://forum.kirupa.com/t/cs3-as2-button-to-change-fonts-in-a-dynamic-box/270189 "2008-09-06T04:16:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tivaelydoc](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@tivaelydoc](https://forum.kirupa.com/u/tivaelydoc)\
**Post date:** [September 6, 2008, 4:16am UTC](https://forum.kirupa.com/t/cs3-as2-button-to-change-fonts-in-a-dynamic-box/270189/1 "2008-09-06T04:16:24Z")

</div>

I have a couple buttons that generate text but I want each of them to use a different font. I tried putting this code on the frame:

```auto
onEnterFrame = function () {
	var Format:TextFormat = new TextFormat();
	Format.font = (_root.box.getValue());
	YourTextBox.setTextFormat(Format);
};

```

And this on the buttons:

```auto
on (release)
{
	var box = new Array(Arial);
//whatever
}

```

But it didn’t work. The only problem I know I’m going to run into is that the fonts I want are ones I added like GoreFont or something. So how would I get those to work too?
