Hi Hans,

The way I used to fix it, was indeed by using some sort of interval
solution. Only to break up the loop in more parts so the animations
won't get bothered with it. I have an example online at
http://www.bensmeets.com/2007/04/09/using-threads-inside-flash/
(download the zip, it contains an animated example and source also).

HTH,

Ben

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Hans
Wichman
Sent: vrijdag 6 juli 2007 14:10
To: Flashcoders mailing list
Subject: [Flashcoders] breaking up long actions

Hi list,

I'm running a process on a tree of objects that require lots of objects
to be created.
This takes somewhere around 300ms on my pc, and will usually be run as
the swf starts or as all classes have been loaded.

300ms is enough for a stutter let alone when its run on slower pc's so I
want to break down the task in subtasks to have it more processor
friendly.

I know this has been discussed a few times but cant seem to find any
resources on it.

At the moment I'm thinking of using a stack of nodes to process, and
using the stack and an alloted time, to complete the whole process, eg
in pseudo:

onInterval() {
   if (process.isDone()) {
       clearInterval and send done event
   } else {
       process.continue();
   }
}

The problem is old but I was wondering if anyone has come up with good
solution to this. Usually by the time we find out a process is slow, the
way we built it doesnt really allow us to break it up in chunks easily,
especially with recursive structures etc.

regards,
JC
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training http://www.figleaf.com
http://training.figleaf.com


This e-mail and any attachment is for authorised use by the intended 
recipient(s) only. It may contain proprietary material, confidential 
information and/or be subject to legal privilege. It should not be copied, 
disclosed to, retained or used by, any other party. If you are not an intended 
recipient then please promptly delete this e-mail and any attachment and all 
copies and inform the sender. Thank you.
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to