Since Flash is event-driven, how about setting it up in such a way that
whatever part of your script adds the command to the queue dispatches an
event to a listener that then executes that command?  That way you avoid
recursion, and you also avoid a for() loop that's outside the internal Flash
event loop.

Unfortunately, my ActionScript is not proficient enough to know which
classes/methods you need to use to interact with Flash's native event queue,
but I'm sure someone else on the list could chime in with the right info.

HTH,

-Chris

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of John Mark
Hawley
Sent: Tuesday, December 13, 2005 1:54 PM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] The Amazing infinite call stack, part 2

A for loop wouldn't give we any way to pause for input, or to wait and let
the UI animate to reflect the last command's doings, though.

I need a way to avoid recursion, not use it. Ideally:

1. advance to next command.
2. execute command.
3. Wait for command to finish.
4. repeat 1-3

in some way that lets step 1 pop off the call stack while waiting for step
3.  There has to be an example floating around somewhere.

-Mark

--
John Mark Hawley
The Nilbog Group
773.968.4980 (cell)

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to