I get this error when trying to close a title window.
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.managers::FocusManager/childHideHandler()[E:\dev\4.0.0\frameworks\ projects\framework\src\mx\managers\FocusManager.as:1744]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\4.0.0\frameworks\projects \framework\src\mx\core\UIComponent.as:12269]
at mx.core::UIComponent/setVisible()[E:\dev\4.0.0\frameworks\projects\fr amework\src\mx\core\UIComponent.as:3038]
at mx.core::UIComponent/set visible()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UICo mponent.as:2997]
at mx.controls::Button/http://www.adobe.com/2006/flex/mx/internal::viewSkinForPhase()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\controls\Button.a s:1953]
at mx.controls::PopUpButton/http://www.adobe.com/2006/flex/mx/internal::viewSkin()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\controls\PopUpBut ton.as:712]
at mx.controls::Button/updateDisplayList()[E:\dev\4.0.0\frameworks\proje cts\framework\src\mx\controls\Button.as:1754]
at mx.core::UIComponent/validateDisplayList()[E:\dev\4.0.0\frameworks\pr ojects\framework\src\mx\core\UIComponent.as:8531]
at mx.managers::LayoutManager/validateDisplayList()[E:\dev\4.0.0\framewo rks\projects\framework\src\mx\managers\LayoutManager.as:663]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.0.0\frame works\projects\framework\src\mx\managers\LayoutManager.as:736]
at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.0 .0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1072 ]
The line this is breaking on is
DisplayObject(form).stage.focus = null;
in the FocusManager, the stage is null
the window is opened by the following
window= PopUpManager.createPopUp(this,ProductSearch,true) as ProductSearch;
window.addEventListener("loaded" , onWindowLoad );
window.addEventListener("close" , closeWindow );
window.title = "Add Product - [ESC to close]"
window.closeButton.visible = false;
window.width = stage.width * 0.75;
window.height = stage.height * 0.65;
var pt:Point = new Point(0, 0);
pt = stage.localToGlobal(pt);
pt = window.globalToLocal(pt);
window.move(Math.round((stage.width - window.width) / 2) + pt.x, Math.round((stage.height - window.height) / 2) + pt.y);
CursorManager.setBusyCursor();
and cloesed by
PopUpManager.removePopUp(window);
it is on the remove pop up call that it errors, if i comment it out then the window doesn't close and i don't get an error
Help please
ps i have other title window that close using this method just fine
iv put this
closeButton.visible = false
in the creationComplete handler, and still causes a error.
I could not put it in the root tag
<s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:cc="com.ordering.view.customComps.*"
implements="mx.managers.IFocusManagerComponent"
closeButton.visible = "false"
>
without getting a compile error
I got the same exception. I have a TitleWindow that contains a list with a custom itemRenderer; each item had a dropdownlist component which when opened along with removal of the popup threw this exception. After long furstrating investigation I came to a simple solution of setting the dropdownlist focuseEnabled property to false. That put it out of the game.
I believe that this is an Adobe Bug.
Hope it helps
I have got the same exception. I have a Title Window that contains a tabNavigator that contains a list with a custom itemRenderer. Each Item have a graph and a legend that describes the graph. In the legend I have put a certain number of checkbox. If I select a checkbox and then I close the Title Window i have the exception. If I don't checked the any checkbox I don't have the exception.
I put for every checkbox the property focusEnabled=false and I don't get any error.
North America
Europe, Middle East and Africa
Asia Pacific