Reputation: 41
Doing something wrong with this:
I have four arrays holding data:
id_array:Array;
last_name_array:Array;
first_name_array:Array;
condition_array:Array;
I have a for loop with counter set to the number of items in the arrays, with the idea of inserting data from each array into the fields of the following DiffArray. I am getting Error #1009: Cannot access a property or method of a null object reference and I cant see why.
for(var i:Number=0; i<Student_counter; i++){
DiffArray.push({id:id_array[i],first_name:first_name_array[i],last_name:last_name_array[i],condition:condition_array[i]});
}
Help with this greatly appreciated.
Upvotes: 0
Views: 50
Reputation: 457
I assume you're making sure your 4 arrays are all the same length, or at least (Student_counter) long ?
Upvotes: 0
Reputation: 10658
You have to declare your array first : DiffArray:Array = new Array();
Upvotes: 1