So basically I have a component with my event dispatched:
<components:MyComp id="Id" myDispatchedEvent(event)/>
In script tags I have that function:
private function myDispatchedEvent(event:Event):void
{
//Here I have my static function with title and handler function showConfirmation
Calculate.showConfirmation("String Title", function(event:Close):void
{
if(bla bla bla)
//lots of code etc. ...
});
//myDispatchEvent function continues here..
}
So problem is with my static function’s showConfirmation handler, if I go through debug, it just skips that function and continues doing myDispatchedEvent. Why doesn’t anonymous function inside showConfirmation function execute?
Thanks
Functions are executing upon call. In your case you have just declaration of it. Call this function somewhere inside
Calculate.showConfirmationand it will be executed.Something like the following: