# Applying new leading value to textfield

**URL:** <https://forum.kirupa.com/t/applying-new-leading-value-to-textfield/205190>\
**Category:** flash\
**Created:** [October 26, 2006, 10:42pm UTC](https://forum.kirupa.com/t/applying-new-leading-value-to-textfield/205190 "2006-10-26T22:42:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pherank](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Pherank](https://forum.kirupa.com/u/Pherank)\
**Post date:** [October 26, 2006, 10:42pm UTC](https://forum.kirupa.com/t/applying-new-leading-value-to-textfield/205190/1 "2006-10-26T22:42:35Z")

</div>

I have a textfield that I’m using for both plain text (loadVariables) and XML. I need to be able to adjust the leading (space between lines of text) for the XML. Does anyone know of a way to change this value on the fly? Otherwise, I’m stuck using separate textfields and turning visibility on and off. That sucks. So far, I can’t find a way to even apply leading changes to XML. It only seems to work on embedded text. Btw, I’m using Flash MX 2004.

```auto
var myFormatter:TextFormat = new TextFormat();
myFormatter.leading = 10;
this.createTextField("message_txt", 1, 100, 100, 380, 130);
message_txt.multiline = true;
message_txt.wordWrap = true;
message_txt.border = true;
message_txt.html = true;
message_txt.text = "This is my first textfield object test - leading is set to 10. This is my first textfield object test - leading is set to 10.";
//loadNewsXML(2006); // Leading doesn't apply to XML
message_txt.setTextFormat(myFormatter);

```
