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
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.