所以基本上我有我的事件组件分派:如何在flex中更改/区分函数执行的优先级?
<components:MyComp id="Id" myDispatchedEvent(event)/>
在脚本标记我有一个功能:
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..
}
所以,问题是我的静态函数的showConfirmation处理程序,如果我经过调试,它只是跳过该功能,并继续执行myDispatchedEvent。为什么showConfirmation函数中的匿名函数不能执行?
谢谢
您可以显示匿名函数被调用的代码吗?无法独自从这个代码中知道它为什么没有执行。 – RIAstar
Calculate.showConfirmation(“String Title”,function(event:Close):void { if(bla bla bla) // lot of code etc. ... });这是它被执行的地方。我可以轻松地编写单独的函数,如:Calculate.showConfirmation(“String Title”,myNewSeparateFunction),没关系,它仍然不会被调用。 – randomUser56789