# Changing text size via actionScript

**URL:** https://forum.kirupa.com/t/changing-text-size-via-actionscript/40014
**Category:** flash
**Created:** [January 13, 2004, 8:44pm UTC](https://forum.kirupa.com/t/changing-text-size-via-actionscript/40014 "2004-01-13T20:44:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![lomelino](https://avatars.discourse-cdn.com/v4/letter/l/a9a28c/32.png) [@lomelino](https://forum.kirupa.com/u/lomelino)
#### Post date: [January 13, 2004, 8:44pm UTC](https://forum.kirupa.com/t/changing-text-size-via-actionscript/40014/1 "2004-01-13T20:44:31Z")

</div>

Could someone please direct me in how to change text size with actionScript.

I have gone through the help and am able to change other properties, such as bold using actionScript, but I haven’t been able to do so with text size.

The scene will have 2 buttons – a plus and minus button. Upon clicking the plus button the text gets bigger, and smaller with the minus button.

I have figured from the help that to access the text properties you must create a new text object construct by doing this:

myTextFormat = new TextFormat();  
myTextFormat.bold = true;  
myTextField.setTextFormat (myTextFormat);

now a property of the text box is .size – I thought you would be able to simply say myText.text.size = 12; or myText.size = 12;

Does anyone have a solution?

Thanks

Joshua
