views:

15

answers:

1

In a new Flash CS5 Adobe Air 2 file, I add a DataGrid with the name datagrid and put in this code:

datagrid.columns = ["foo", "bar"]
datagrid.addItem( {foo:"the", bar:"text"} );
datagrid.editable = true;

If I click a cell, open another program such as notepad, then minimize that program so that the Air 2 app has the focus, I get this error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at fl.controls::TextInput/setFocus()
    at fl.managers::FocusManager/activateHandler()

Is this a bug in Adobe Air 2, and how can I handle this error?

A: 

Hey, not much help, but I've got the same issue, I think. I too have an air app, which when the user switches focus back to get the type error 1009. UNCAUGHT ERROR: 1009, TypeError, Error #1009: Cannot access a property or method of a null object reference., Stack Trace: TypeError: Error #1009: Cannot access a property or method of a null object reference. at mx.core::FlexHTMLLoader/setFocus()[C:\autobuild\3.5.0\frameworks\projects\airframework\src\mx\core\FlexHTMLLoader.as:175] at mx.managers::FocusManager/setFocus()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\FocusManager.as:553] at mx.managers::FocusManager/activate()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\FocusManager.as:729] at mx.managers::SystemManager/deactivateForm()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2542] at mx.managers::SystemManager/deactivate()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2510] at mx.managers::SystemManager/removeFocusManager()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2777] at mx.managers::PopUpManagerImpl/popupRemovedHandler()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\PopUpManagerImpl.as:1366] at flash.display::DisplayObjectContainer/removeChild() at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::rawChildren_removeChild()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2192] at mx.managers::SystemManager/removeChild()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:1736] at mx.managers::PopUpManagerImpl/removePopUp()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\PopUpManagerImpl.as:559] at mx.managers::PopUpManager$/removePopUp()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\PopUpManager.as:196]

Richard