Hi,

Recursive functions will block execution - they are not Asynchronous, so when they have finished your program code will continue to execute, so if your code after the function is not executing, you are probably stuck in the recursive function...

Best to have a limit that you keep track of in your recursive function - this can also be a property of the thing you are recursing.

   param = 1;
   limit = 100;

   function recursive(param):Boolean {

      if(param == limit) {
         return false;
      }
     param++;
     return recursive(param);
   }

   HTH

   Glen


ACE Flash wrote:
Hi there,
Is there a way to check if my recursive function is finished and exited? so
I could call another function once it finished. As an example below, it
could be any number instead of "5" in my program,

I am wondering there is a "listener" can be use for monitoring a Recursive
Function.  Is that possible?

Thank You

function traceMe(n) { if (n<=5) { trace("This is the "+n+"th time that the
function is run."); traceMe(n+1); trace("End of the "+n+"th function."); } }
traceMe(1);
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



--

Glen Pike
01326 218440
www.glenpike.co.uk <http://www.glenpike.co.uk>

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

Reply via email to