Dynamic clips, loops & crazy tweens!

I’m experimenting with attaching clips dynamically(vertically) and then, when you click on one of them, it expands vertically and the clips above and below it tween accordingly. (to gracefully make room for the expanding clip)

my initial idea was to build 2 arrays for each dynamic clip one array to hold the dynamic names of every dynamic clip above the selected clip and another array for every clip below it.

Then, when the user clicks on one, i would use a loop to use the tween class to move all the clips above our clip up simultaneously and all the clips below down… you get the point.

the roadblock i’m running into is the for loop constructor. Can you use any number other than 0 (zero) in this? :

fo(i=0; i<someVar; i++);

???

If I can figure out some way to do this, then i can determine the index position of my clip. Then, if my clip has an index of 10 out of 20 clips, i can build an array out of clips with index 11-20.

check out my code where i attempt to do this. it seems that the for loop contstructor only accepts “0” when you initialize it. grrr!!! any other way to do this?

stop();

//load Tween class
import mx.transitions.Tween;
import mx.transitions.easing.*;

mXML=new XML();
mXML.ignoreWhite=true;
mXML.onLoad=function(success){
	if(success){
		itemz=this.firstChild.childNodes;
		for(i=0; i<itemz.length; i++){
		item=holder.attachMovie("dynClip", "dynClip"+i, i);
		item._y=i*32;
		item.yPos=item._y;
		item.index=i;
		item.dText=itemz*.attributes.text;
		//build arrays for clips above and clips below
		item.above=new Array();
		item.below=new Array();
		for(j=0; j<item.index; j++){
			item.above.push("dynClip"+j);
		}
		item.aboveVar=item.index+1;
	
		for(k=item.aboveVar; k<itemz.length; k++){
			item.below.push("dynClip"+k);
		}
		
		item.hitButton.onRollOver=function(){
			gotoAndPlay("over");
		}
		item.hitButton.onRelease=function(){
			trace("index: "+item.index);
			trace("aboveVAr: "+item.aboveVar);
			trace("above: "+item.above);
			trace("below: "+item.below);
			
			
		}
		
		
		}
		
	}
}

mXML.load("vsk.xml"); 

the problem is in this block of code:

item.aboveVar=item.index+1;
	
		for(k=item.aboveVar; k<itemz.length; k++){
			item.below.push("dynClip"+k);
		}

any guidance is greatly appreciated!