July 16, 2002
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.


Posted by: Chris Dunn on February 12, 2003 06:29 PM

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,

Posted by: Deepa Gopal on June 9, 2004 08:53 AM

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.

Posted by: Mario Klingemann on June 9, 2004 09:59 AM

The multi-threading class link above doesn't work. I'd like to see the component mentioned on swfnews.com...can you help?

Posted by: Vidal on July 17, 2004 01:45 AM

Yes, it looks like the article is gone. Maybe if you contact swfnews directly they are able to retrieve it somehow.

Posted by: Mario Klingemann on July 17, 2004 10:08 AM

Could anyone please point me to a location where this class an be downloaded?

Posted by: Billy on May 16, 2005 07:35 PM
Post a comment

Email Address:



Remember info?

Thank you!

Most Visited Entries
Sketches, Works & Source Code
In Love with
Powered by
Movable Type 2.661

© Copyright Mario Klingemann

Syndicate this site:
RSS 1.0 - RSS 2.0

Quasimondo @ flickr
Quasimondo @ LinkedIn
Quasimondo @ Twitter
Quasimondo @ Facebook
Quasimondo @ MySpace
Quasimondo is a Bright
Citizen of the TRansnational Republic
My other blog in german

My family name is written Klingemann,
not Klingelmann, Klingeman, Klingaman, Kingemann,
Kindermann, Killingaman, Klingman, Klingmann, Klingonman
Klingemman, Cleangerman, Klingerman or Kleangerman

profile for Quasimondo at Stack Overflow, Q&A for professional and enthusiast programmers