# Font Size Slider

**URL:** https://forum.kirupa.com/t/font-size-slider/295044
**Category:** flash
**Created:** [August 24, 2009, 6:18pm UTC](https://forum.kirupa.com/t/font-size-slider/295044 "2009-08-24T18:18:04Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jeancnicolas](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@jeancnicolas](https://forum.kirupa.com/u/jeancnicolas)
#### Post date: [August 24, 2009, 6:18pm UTC](https://forum.kirupa.com/t/font-size-slider/295044/1 "2009-08-24T18:18:04Z")

</div>

hey there … I keep getting an error, which I dont understand…  
I have a text box, which I feed in some text into. I have added a slider componant, and basically want to change the font size, by using this slider … it does not work - i dont know why, so is there any help!?

```auto
import fl.events.*

text_box.text = "test";
var tf:TextFormat = new TextFormat("Helvetica",6);

mySlider.addEventListener(SliderEvent.THUMB_DRAG,fontSize);

function fontSize(e:SliderEvent):void
{
    tf.size = mySlider.value;
    text_box.setStyle("textFormat",tf); // This is what causes the error .. am I blind today?
}

```

Thanks!
