# Recursion in AS? hmmmM..thoughts

**URL:** <https://forum.kirupa.com/t/recursion-in-as-hmmmm-thoughts/207112>\
**Category:** Uncategorized\
**Created:** [November 14, 2006, 8:41pm UTC](https://forum.kirupa.com/t/recursion-in-as-hmmmm-thoughts/207112 "2006-11-14T20:41:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fuzzyfluid](https://avatars.discourse-cdn.com/v4/letter/f/fbc32d/32.png) [@fuzzyfluid](https://forum.kirupa.com/u/fuzzyfluid)\
**Post date:** [November 14, 2006, 8:41pm UTC](https://forum.kirupa.com/t/recursion-in-as-hmmmm-thoughts/207112/1 "2006-11-14T20:41:58Z")

</div>

Hi guys, lately i find myself going thru a recursion phase and im assuming recursion has it good points and bad points at it does in o-o programming.

i try to keep my recursion functions small but i dont know if i should go back and rewrite them bottom-up style.

im used to writing recursive functions just for small things but lately i just been seeing how far i can go with this lol.

for example, i’ll write a recursive function along these lines:

j=totalCalculatedSomewhere;

function attachBoxes(j){  
if(j \>=0){  
mymc.onEnterFrame=NULL;  
depth=mymc.getNextHighestDepth();  
holder= mymc.attachMovieClip(“box”,“box”+j,depth);

```
mymc.onEnterFrame=function(){
    atween = new mx.transitions.etc.etc.
}
 attachBoxes(j-1);

```

}  
}

so, any comments on the good and bad of recursion in AS?
