1119: Access of possibly undefined property grid through a reference with static type mx.core:Container
The Actual error for me was 1119: Access of possibly undefined property grid through a reference with static type mx.core:Container. And was actually a pretty simple one to solve. Like always, I hacked at it for an hour and then when I finally got it, I smacked my self in the forehead….duh! I’m not really sure why this happens, but it appears to be something with a custom component. In my case I had a VBox that I was extending and it was called Subject. In the VBox and Advanced Datagrid existed which I was trying to get the columns for so that I could use actionscript to add a column. so to get the columns I was doing.
var cols:Array = this.TabNavigator.selectedChild.grid.columns as Array; //where grid is my ADG<br />
This gave me the error, so to work around it, I chopped the object (i.e the datagrid off) Made the changes, and then put it back together. Here is my code line for line. As always comments or other work arounds are welcome.
var obj:Object = this.stn.selectedChild; var cols:Array = obj.grid.columns; var col:AdvancedDataGridColumn = newAdvancedDataGridColumn(); col.headerText = "My Column"; col.dataField = "mycol"; cols.push(col); obj.grid.columns = cols; this.stn.selectedChild = obj as Subject;


