This content has been marked as final. Show 5 replies
Flex is single threaded so you cannot move heavy tasks into a background thread
like you can in Java. In reality Flex is for the presentation tier not for the server tier. It sounds like you are doing a bit of server processing on the client.
There may be more options if using the Air runtime. In particular you could check out artemis ( http://artemis.effectiveui.com/) which is supposed to give you access to Java from Flex (via the air runtime). Of course all of this is still beta or alpha.
We were brainstorming on that one. I don't know for sure if our theory would even work.
If you need to keep the task on the client, you can help things by breaking the task up using calllater. this will at least let the UI update, while the precess is running.
Also, be aware that there is a 60 second limit on how long a script can run before a continue dialog is displayed. It can be made shorter, but not longer.
I didn't know about callLater, sounds interesting. I'll try that, thanks.
For the LocalConnection, it seems a bit complicated but interesting. The idea is to create an AS2 swf to do the calculations and get the result via LocalConnection. I have two questions about it:
- I'm creating an AIR app, would I still be able to use it ? The goal is to use the multi-threading capabilities, so it shouldn't work in AIR, right ?
- I thought that AS2 was something like 10 times slower than AS3, so I find it weird to use it to do heavy calculations. I've probably misunderstood something :)
AIR might give you other options, I haven't thought about that yet.
Yes, AS2 is slower than AS3 (I found 30%-40% in heavy, non-ui rendering calculations), but the goal is to find a way to offload the calculation from the main thread, so the speed difference is irrelevant.
AIR might let you do the same thing somenow with as3 code.