String to object

I have an object called clientData.


clientID : 2
email : ronnieswietek[at]gmail[dot]com
organization : digital OutPost Client
username : rondogs12
userLevel : 1
phone : 7608555555
password : 1234
clientName : Ronnie Swietek Client

Say I need to update the ‘username’ part of the object.

I would go:

clientData.username = value;

The problem is I need to update with ‘username’ coming in as a string.

This is my function to update the object:

public function setClientData(field:String,value:String):void
	clientData.field = value;
	for (var value:String in clientData)
		trace(value + " : " + clientData[value]);


if I do that, it just adds a new item in the object called field. I need field to be username. Any ideas???