# AS3 - Parse JSON Object into dynamic text fields

**URL:** <https://forum.kirupa.com/t/as3-parse-json-object-into-dynamic-text-fields/330814>\
**Category:** flash\
**Created:** [March 20, 2013, 1:01pm UTC](https://forum.kirupa.com/t/as3-parse-json-object-into-dynamic-text-fields/330814 "2013-03-20T13:01:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Audax](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@Audax](https://forum.kirupa.com/u/Audax)\
**Post date:** [March 20, 2013, 1:01pm UTC](https://forum.kirupa.com/t/as3-parse-json-object-into-dynamic-text-fields/330814/1 "2013-03-20T13:01:00Z")

</div>

Greetings,  
i’m trying to figure out a way to read strings from a JSON formatted txt and put them into text fields.  
So far this is what i’ve come up with:

```auto
var loader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest();
request.url = "demo.txt";
loader.load(request);
loader.addEventListener(Event.COMPLETE, decodeJSON);
function decodeJSON(event:Event):void{
    var loader:URLLoader = URLLoader(event.target);
    var People:Object = JSON.parse(loader.data);
    //text boxes
    qfname01.text = People[0].playerName;
    qfscore01.text = People[0].playerScore;

    }

```

Basicly i’m using Object instead of Array because the object is a collection of items where each is assigned to a specific string.  
This is the JSON txt file:

```auto

{"playerName":"Jonny", "playerScore":"32" ,
"playerName":"Jimbo", "playerScore":"12" ,
"playerName":"Mark", "playerScore":"14" ,
}

```

When i export it i get no error. However, i get the 1132 saying the input parser is not valid when i launch it.  
Any ideas? =)
