0

I have a Flex problem. I have a Java app and a Flex app that calls to a Java app method to get some data.

So in my Flex class I have a method that calls the Java app method, something like this:

ObjectThatInvokesJavaMethod.getDataFromJavaApp(param1, setData);

setData is where the Java app method returns the array with the info, the callback.

The problem is that this method (setData) goes to a stack or something like that and the rest of code is executed, but in 'the rest of the code I need the data requested from the Java app but the setData method is not executed until the rest finish... so Im operating with old and deprecated data. Any idea how to solve this?

Thanks in advance.

4

1 回答 1

0

您的回调处理程序, setData() 应该从服务器端分配值并调用“其余代码”或其他任何内容。或者,从 setData 抛出一个事件以表明数据已准备好并且“其余代码”可以使用它。

于 2013-01-23T23:03:13.333 回答