whenever i insert an object to this datagrid it show this error
TypeError: Error #1009: Cannot access a property or method of a null object reference. at Forms::LessonPlan/addLesson_clickHandler()
this is my code for inserting an object
var obj:Object = new Object();
var temp:Object = new Object();
obj.activityid = arrayNames.selectedItem.activityid;
obj.lessonid = getLessonIDResult.lastResult ;
obj.time = durationCombo.selectedItem;
obj.status = "active";
obj.activityname = arrayNames.selectedItem.activityname;
temp = ({activityname:obj.activityname,time:obj.time});
studentLessonPlanArray.addItem(temp);
please help me
Make sure the the reference(studentLessonPlanArray) is instantiated before it is called. Also check this link.