# Need help on Text Formating

**URL:** <https://forum.kirupa.com/t/need-help-on-text-formating/26395>\
**Category:** flash\
**Created:** [July 22, 2003, 5:51pm UTC](https://forum.kirupa.com/t/need-help-on-text-formating/26395 "2003-07-22T17:51:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![emeX](https://avatars.discourse-cdn.com/v4/letter/e/a4c791/32.png) [@emeX](https://forum.kirupa.com/u/emeX)\
**Post date:** [July 22, 2003, 5:51pm UTC](https://forum.kirupa.com/t/need-help-on-text-formating/26395/1 "2003-07-22T17:51:37Z")

</div>

## How do i get the font to change when the user types encode in the Input box then presses enter and then it changes the font in the Output box (which is dynamic) and also embed the font in the output box. So when they type inteh input box the font changes in the Output box. What am i doing wrong???

On (keyPress (“Enter”) {

## if (\_parent.Input.text == “encode”) { tf = new TextFormat(); tf.font = “Beam”; Output.setTextFormat(tf); Output.embedFonts = true; } }

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 22, 2003, 6:02pm UTC](https://forum.kirupa.com/t/need-help-on-text-formating/26395/2 "2003-07-22T18:02:15Z")

</div>

i don’t know…thats something i have been trying to do for sometime now also

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 22, 2003, 6:20pm UTC](https://forum.kirupa.com/t/need-help-on-text-formating/26395/3 "2003-07-22T18:20:12Z")

</div>

Hmm im not sure if this is what you want…[AS]dynamicText.embedFonts;  
inputText.onKeyDown = function() {  
if (Key.isDown(Key.ENTER) && this.text==“encode”) {  
dynamicText.text = this.text;  
}  
};  
Key.addListener(inputText);[/AS]Select the font type you want in the dynamic textfield.
