Flash Multi-Threading Revisited
After Matt Rice and Jeremy Larkin swfnews.com have released the alpha of their multi-threading class, there has been some discussion about the usefulness of such a class or some nasty remarks about its "novelty factor" ("huuuh?!?! this is simply an emulation using setInterval, *LOL*" [Guy Watson on jdb cyberspace]).
I think the approach is great: to have everything handy packaged and to avoid the ugly "Actionscript is running slow" nag-screen in long loops.
Still the basic idea of real multi-threading has caught me - it is definitely not possible within one flash file, but what, if you split a task among several flash files? At least under Windows (perhaps OS X, too) it should theoretically be possible to utilize the OS's multi-threading abilities. The flash files can share data via localConnection. There might be some use for that.
Here is a little experiment where I have a simple calculation counter (internally it calculates Math.sqrt) that runs either in only one thread or in three separate flash files at the same time. If multi-threading would NOT work it should take 3 times as long to calculate all three at the same time than only one. But as you can see yourself the time difference is only a little higher (probably due to the localConnection calls).
Posted at July 16, 2002 01:54 PM | Further reading
Yeah, I am also quite interested in multithreading aspects of flash. Here is the question I have for you? Would those multiple flash files also be applicable using loadMovie with many swf files. What I mean is say I were to have a root movie. Then attached those three movies via loadMovie would I still experience the multithreading capabilities? Ok, back to doing research on multithreading in flash.
Chris
Hi,
I have a flash program which receives data from a VC++ progrm through the XML socket.The speed of the animation in flash becomes very low when the data transfer takes place.Would multi-threading be a solution to it and if so, how can I go about it?
Thanking you for your time,
Deepa.
Do those XML packages that you receive contain a lot of data? Maybe its the parsing process that slows the animation. In that case it would peobably help to use smaller data packets.
To see if multitasking would help is to open a second swf file whilst you current application is running and to check if it gets slowed down, too. If yes than multitasking will not work.
The multi-threading class link above doesn't work. I'd like to see the component mentioned on swfnews.com...can you help?
Yes, it looks like the article is gone. Maybe if you contact swfnews directly they are able to retrieve it somehow.
Could anyone please point me to a location where this class an be downloaded?