I'm somehow creating a stack overflow in Flex 3...I'm trying to get data out of a modal dialogue window as such:
Main application:
var myPopup:MyPopup;
function buttonClick( event:MouseEvent ):void
{
myPopup = MyPopup( PopUpManager.createPopUp( this, MyPopUp, true ) );
myPopup.addEventListener( CloseEvent.CLOSE, handler, false, 0, true );
}
function handler():void
{
//get data
}
MyPopup:
function buttonHandler( MouseEvent:event ):void
{
PopUpManager.remove( this );
this.dispatchEvent( new CloseEvent( CloseEvent.CLOSE ) );
}
If this is improper, what is the correct way to handle closing of the popup in a manner that allows me to use and retrieve data on the object?