Jay Roy
asked on
closing PopUp when clicked outside of it
hi guys
I have a scenario where i am using
PopUpManager.addPopUp(data Grid, this, false);
If user clicks on the screen anywhere outside of the popup, the popup should close.
any idea if that is possible?
thanks
I have a scenario where i am using
PopUpManager.addPopUp(data
If user clicks on the screen anywhere outside of the popup, the popup should close.
any idea if that is possible?
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Is it must to impliment the removeEventListener() everytime when we do addEventListener ?
thanks
thanks
It's recommended or include useWeakReference flag
http://gingerbinger.com/2010/07/actionscript-3-0-events-the-myth-of-useweakreference/
http://gingerbinger.com/2010/07/actionscript-3-0-events-the-myth-of-useweakreference/
ASKER
just curious
If i have VBox insteaad of Popup , should i say
public class DetailsGrid extends VBox
public function DetailsGrid (){
this.addEventListener(Flex MouseEvent .MOUSE_DOW N_OUTSIDE, closeDetailGridopup);
}
private function closeDetailGridopup(event: FlexMouseE vent):void {
event.currentTarget.remove EventListe ner(FlexMo useEvent.M OUSE_DOWN_ OUTSIDE, closeDetailGridopup);
removeChild(this); -- if i want to remove the Vbox , will this work?
}
}
If i have VBox insteaad of Popup , should i say
public class DetailsGrid extends VBox
public function DetailsGrid (){
this.addEventListener(Flex
}
private function closeDetailGridopup(event:
event.currentTarget.remove
removeChild(this); -- if i want to remove the Vbox , will this work?
}
}
You cannot remove the reference to your own object.
1) "this" is not children of "this" it's not make sense "this.removeChild(this);" - your father has child himself
2) When you are destroying the popup all references will be gone you don't need to remove any children
1) "this" is not children of "this" it's not make sense "this.removeChild(this);" - your father has child himself
2) When you are destroying the popup all references will be gone you don't need to remove any children
dataGridPopup.addEventList
private function closePopup(event:FlexMouse
PopUpManager.removePopUp(d
}