0

I am developing in flexbuilder 3. I am compiling with Flex 3.5.

Something is hijacking my backspace key and I can't find the culprit. In a text field when I type some characters and then try to type backspace, some event fires that tries to change a tabnavigator elsewhere on the screen. This forces a "show event", in the show code, I throw a stack trace which shows

Error: StackTrace
at OrderInq/populate_Addresses()[I:\AmeriLawyerNew\src\OrderInq.as:669]
at OrderInq/__tab_address_show()[I:\AmeriLawyerNew\src\OrderInq.mxml:83]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9440]
at mx.core::UIComponent/setVisible()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\UIComponent.as:1913]
at mx.core::UIComponent/set visible()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\UIComponent.as:1881]
at mx.containers::ViewStack/updateDisplayList()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\containers\ViewStack.as:864]
at mx.containers::TabNavigator/updateDisplayList()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\containers\TabNavigator.as:626]
at mx.core::UIComponent/validateDisplayList()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\UIComponent.as:6362]
at mx.core::Container/validateDisplayList()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\Container.as:2720]
at mx.managers::LayoutManager/validateDisplayList()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:622]
at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:695]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8744]
at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8684]

My next attempt was to create a keystroke eventlistener like;

    this.addEventListener(KeyboardEvent.KEY_DOWN, interceptKey, true);
private function interceptKey(evt:KeyboardEvent):void
{  
    if(evt.keyCode == 8) // Backspace key
    {
        trace("Main Backspace key detected");
    }
    trace('Main evt.keyCode=' + evt.keyCode);
}

This displays every keystroke properly except a backspace. Nothing shows up when I type the backspace in the trace. The backspace does not delete the character in the textbox, but it does seem to be firing some event.

Is there a way to trace events as they happen?

Is there a way to see what event listeners are listening?

How can I go about debugging this issue?

Paul

ketan
  • 19,129
  • 42
  • 60
  • 98
Paul Stearns
  • 856
  • 9
  • 30
  • Found that if I click out of the web browser/flash window, and then back in, backspace works as it should. – Paul Stearns Jun 26 '15 at 21:18
  • Very odd. So i understand you have your TextField in a TabNavigator ? Just a wild guess, but try to set the historyManagementEnabled property on the TabNavigator to false. Do you test in the flash player or a browser ? If it's the browser, have you tried it with a different browser ? – Philarmon Jun 30 '15 at 14:05
  • Philarmon Please change your comment to an answer, cause that seemed to fix the issue. – Paul Stearns Jul 01 '15 at 15:17
  • Funny. I remember i've had some issues with TabNavigator and keyboard years ago, had to look up the property names to remember what is was – Philarmon Jul 02 '15 at 00:14

1 Answers1

1

So i understand you have your TextField in a TabNavigator ? Just a wild guess, but try to set the historyManagementEnabled property on the TabNavigator to false. The TabNavigator is catching up some key events.

Philarmon
  • 1,796
  • 1
  • 10
  • 14