Skip to main content
January 27, 2013
Question

This focus issue is a tough one

  • January 27, 2013
  • 2 replies
  • 2239 views

Gidday guys

This one has been bugging me all day.

If I select a row in my datagrid, then click out of my AIR desktop app to another program, desktop etc, then click back into the AIR app, I get the 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()

I set up the following to deselect the row, but the error still occurs:

data_grid.addEventListener(Event.DEACTIVATE, deselectRow, false, 0, true);

           

private function deselectRow(event:Event):void

{           

      data_grid.selectedIndex = null;

}

Anyone had this happen before and know of a fix?

Cheers

This topic has been closed for replies.

2 replies

kglad
Community Expert
Community Expert
January 27, 2013

what line of code is triggering the null error?  (click file>publish settings>swf and tick "permit debugging")

January 27, 2013

That's strange - it's not happening anymore. I'll try and re-create the erro.

kGlad - I'm yet to set up debugging for CS6 - since I upgraded, the debugger doesn't work.

Thanks guys

kglad
Community Expert
Community Expert
January 27, 2013

can you click file>publish settings>swf and tick "permit debugging"?

Ned Murphy
Legend
January 27, 2013

Normally a non-selection for a list is assigned -1, not null.  I don't know if that is part of your problem or not.