[Air ANE Java]How use FREObject in Thread?

108 views Asked by At

i want new thread load file.when complete i will call dispatchStatusEventAsync and push the FREByteArray.but will trigger FREWrongThreadException.

only a single thread?

1

There are 1 answers

0
Michael On BEST ANSWER

You can only use the FRE* functions on the main thread except for the dispatch status event function. The normal process to do background operations is something like the following:

  • trigger working thread from a FREFunction
  • store your data in native types
  • dispatch a status event when your working thread is complete
  • call another FREFunction to retrieve the native data as FREObjects

Any conversions between native and FREObjects will have to be done on the main thread so try to keep that to a minimum.

Michael