# Read Text File Line by Line

**URL:** <https://forum.kirupa.com/t/read-text-file-line-by-line/272782>\
**Category:** flash\
**Created:** [October 8, 2008, 1:00pm UTC](https://forum.kirupa.com/t/read-text-file-line-by-line/272782 "2008-10-08T13:00:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![oliiix](https://avatars.discourse-cdn.com/v4/letter/o/58f4c7/32.png) [@oliiix](https://forum.kirupa.com/u/oliiix)\
**Post date:** [October 8, 2008, 1:00pm UTC](https://forum.kirupa.com/t/read-text-file-line-by-line/272782/1 "2008-10-08T13:00:44Z")

</div>

Hy all

Got the following code:

```auto

var strContent:String;
function fillContent(folder:String):void
{
	var arrayMenuItems:Array = new Array();
	var arrayContent:Array = new Array();
	var arrayNews:Array = new Array();
	var myContent:URLLoader = new URLLoader();
	myContent.dataFormat = URLLoaderDataFormat.TEXT;
	myContent.addEventListener(Event.COMPLETE, getString);
	myContent.load(new URLRequest("content/" + folder + "/_content.php"));
	contentText.multiline = true;
	trace("./content/" + folder + "/_content.php");
	trace("MY DATA: " + myContent.data);
	contentText.htmlText = strContent;
	contentText.setTextFormat(format_ContentRegularText);
	contentTitle.setTextFormat(format_Titles);
	menuItemFont.setTextFormat(format_MenuItems);
}

function getString(e:Event):void
{
	strContent = e.target.data;
}

```

What I actually need is to be able to read the \_content.php file line by line. I’d like to store each line of the text file in an array (arrayContent). But I haven’t found ANY solutions yet for this problem.

Best thanks for trying to help 🙂

Regards
