# Loading text from a .txt file using URLLoader

**URL:** <https://forum.kirupa.com/t/loading-text-from-a-txt-file-using-urlloader/249595>\
**Category:** Uncategorized\
**Created:** [January 20, 2008, 5:33pm UTC](https://forum.kirupa.com/t/loading-text-from-a-txt-file-using-urlloader/249595 "2008-01-20T17:33:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dom\_1](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@Dom\_1](https://forum.kirupa.com/u/Dom_1)\
**Post date:** [January 20, 2008, 5:33pm UTC](https://forum.kirupa.com/t/loading-text-from-a-txt-file-using-urlloader/249595/1 "2008-01-20T17:33:59Z")

</div>

So, I’m trying to load just a simple bloc of text from a text file using the URLLoader class, and the text loads and displays properly in the text field, only all return chars and all appear as is in the text.  
I have a  
in the text bloc, and instead of returning the text to a new line, the text field just displays the  
as if it were text.  
Is there any special operation or something i’m missing here ?

```
ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#0000FF]private[/COLOR] [COLOR=#000000] **function** [/COLOR] loadPresentationText [COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR]:[COLOR=#0000FF]void[/COLOR] [COLOR=#000000]{[/COLOR]
        _$textLoader = [COLOR=#000000] **new** [/COLOR] URLLoader [COLOR=#000000]([/COLOR][COLOR=#000000] **new** [/COLOR] URLRequest [COLOR=#000000]([/COLOR][COLOR=#FF0000]"text.txt"[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR];
        _$textLoader.[COLOR=#000080]dataFormat[/COLOR] = URLLoaderDataFormat.[COLOR=#000080]VARIABLES[/COLOR];
        _$textLoader.[COLOR=#000080]addEventListener[/COLOR] [COLOR=#000000]([/COLOR]Event.[COLOR=#000080]COMPLETE[/COLOR], textLoaded[COLOR=#000000])[/COLOR];
    [COLOR=#000000]}[/COLOR]
    
    [COLOR=#0000FF]private[/COLOR] [COLOR=#000000] **function** [/COLOR] textLoaded [COLOR=#000000]([/COLOR][COLOR=#0000FF]e[/COLOR]:Event[COLOR=#000000])[/COLOR]:[COLOR=#0000FF]void[/COLOR] [COLOR=#000000]{[/COLOR]
        testStr = [COLOR=#0000FF]e[/COLOR].[COLOR=#0000FF]target[/COLOR].[COLOR=#0000FF]data[/COLOR].[COLOR=#000080]presText[/COLOR];
    [COLOR=#000000]}[/COLOR]

```

[/LEFT]  
[/FONT]

thx
