Showing posts with label fix. Show all posts
Showing posts with label fix. Show all posts

Wednesday, April 16, 2008

PopUpButton sometimes have to be clicked twice to open .

Hi guys ,
Sometimes you will encounter a situation when you will have to click your popupButton twice .
So to overcome this behaviour

replace the following code in the sdk's PopUpButton code

private function removeFromStageHandler(event:Event):void
{
if(_popUp)
{
PopUpManager.removePopUp(_popUp);
_popUp = null
}
}


with
private function removeFromStageHandler(event:Event):void
{
if(_popUp)
{
PopUpManager.removePopUp(_popUp);
if(showingPopUp)
_popUp = null
}
}

All i have done is check if the Popup is showing up before setting to null .
If the popup is not showing up then dont set the _popUp to null ;