You might look into using a Finite State Machine. They are a great way to
do command sequencing, and are incredibly useful in game programming for
lots of things, from updating the UI to building enemy AI behaviors.
There's some good Flash-based FSM info at http://www.flashsim.com .
--
andy make
quot;'Flashcoders mailing list'"
Sent: Tuesday, December 13, 2005 2:05 PM
Subject: RE: [Flashcoders] The Amazing infinite call stack, part 2
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 a
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
even
You're looking for "infinite recursion".
Generally speaking, your application might be better served with a for()
loop to iterate through the command queue within a single function call.
There are times when recursive functions (i.e., functions that call
themselves) are more elegant, though.
-Chr
4 matches
Mail list logo