Hi guys.
I am using an XML connector and a datagrid to display some data on the stage.
I have added a listener to the dataGrid to allow the user to click on cell.
When the user clicks a cell the data in the cells of that row will be stored in global variable.
Here is my code below. When I try to trace the global variable i get an undefined. Can anyone explain why please and offer some help
this.msgConn.trigger();
// Create listener object.
var dgListener:Object = new Object();
dgListener.cellPress = function(evt_obj:Object) {
var contactCol = 0;
var textCol = 1;
var rowIndex = evt_obj.itemIndex;
_global.contactName = evt_obj.target.selectedItem.contactCol;
_global.msgContent = evt_obj.target.selectedItem.textCol;
trace(_global.contactName);
trace(_global.msgContent);
};
// Add listener.
inbox_dg.addEventListener(“cellPress”, dgListener);
Any help is much appreciated.
Thanks
Stew