# (cs3 - as3) reloading a text field

**URL:** https://forum.kirupa.com/t/cs3-as3-reloading-a-text-field/275351
**Category:** flash
**Created:** [November 12, 2008, 8:27pm UTC](https://forum.kirupa.com/t/cs3-as3-reloading-a-text-field/275351 "2008-11-12T20:27:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![newwave](https://avatars.discourse-cdn.com/v4/letter/n/34f0e0/32.png) [@newwave](https://forum.kirupa.com/u/newwave)
#### Post date: [November 12, 2008, 8:27pm UTC](https://forum.kirupa.com/t/cs3-as3-reloading-a-text-field/275351/1 "2008-11-12T20:27:54Z")

</div>

I’m extremely new to coding, I feel I’m doing decent. It took me a couple of hours a day for a week to learn how to write this code. and get it to load text into a text field.  
the code is on 1st frame 2nd layer named actions  
and on the 1st frame 1st layer I have 5 buttons with the istance names btn1,btn2,btn3,btn4,btn5  
I am having a problem finding resources to learn from about reloading the text field with my buttons though, maybe I’m not using the right search words. I was wondering if anyone knows how to do this and can show me an example code, knows of a tutorial to help me out, or atleast the correct temanology for a google search. your help and time will be greatly apreciated. sincerly newwave

```auto
 
var a = "myText.txt";
var b = "myText2.txt";
var c = "myText3.txt";
var d = "myText4.txt";
var e = "myText5.txt";
var defaultText = a;
var myTextLoader:URLLoader = new URLLoader();
var myTextField_txt:TextField = new TextField();
myTextField_txt.wordWrap=true;
myTextField_txt.autoSize=TextFieldAutoSize.LEFT;
myTextLoader.addEventListener(Event.COMPLETE, onLoaded);
function onLoaded(e:Event):void {
myTextField_txt.text = e.target.data;
addChild(myTextField_txt);
}
myTextLoader.load(new URLRequest(defaultText));

```
