Flash Remoting and using the Record sets

Hello everyone. I am new to the forums, but have been browsing Kirupa for a long time. I finally got to the point where I needed to ask a question since I could not locate a well formed answer to my dilemma.

Currently I am returning some data from Coldfusion using Flash Remoting.

var proLines:Object = new Object;
var proColumnNames:Array = new Array();
var proNumbers:Number;

proLines = result.serverInfo.initialData;
proColumnNames = result.serverInfo.columnNames;
proNumbers = result.serverInfo.totalCount;

The idea is pretty simple. It is a Flash banner that dynamically pulls up promotional events for our company. All the data is being retrieved fine and I am working with it without a problem.

However I am calling the data in the format of proLines[currentPro][0]; where currentPro is used in a function as we cycle through the promotional entries. The [0] however is in reference to the data I have retrieved. It references the location of the promotional title.

The problem is that actually specifying the actual array location makes it so that if we end up changing the amount of records we return (perhaps we want to start displaying dates for certain promotions) these numbers change and will require the Flash to be re-edited to reflect the index changes.

I am wondering if there is a way I can take the result.serverInfo.columnNames and use it with the initialData that is also returned from AMF so that I can reference my columns with their names like “proTitle” or “proDescription” rather than hard-coding the array location.

Any help would be appreciated in any form. If you happen to have links to good examples or any insight into my problem it would wonderful.

-Dan