Hi everyone,
I am having a hard time trying to get this to work.
On my main timeline, I create a new array called aEventData:
aEventData = new Array();
On the next frame, I loop through data pulled from ColdFusion. I am trying to put the data into an array so that I can reference it later based on it’s position. My function to do this looks like so:
function eventDataQuery_Result ( result ){
// for each record in the recordset…
for (a=0;a<result.getLength();a++){
// Use the record variable to refer to the current row of the recordset
var record = result.getItemAt(a);
//Fill our array with data from the event
_root[aEventData[record.eventDate]] = record.eventDesc;
};
}
This doesn’t work. I don’t know how to properly reference the array on the timeline. I also tried:
_root[(aEventData[record.eventDate])] = record.eventDesc;
and
_root.aEventData[record.eventDate] = record.eventDesc;
(I knew this one wouldn’t work but I had to try.)
If I use aEventData[record.eventDate] = record.eventDesc;
and then trace the value from within my function, it works okay, but it doesn’t set the value in the array on my main timeline. Can anyone explain how I can reference and set values in my array from within the function?
Thanks.