# Help with dynamic list

**URL:** <https://forum.kirupa.com/t/help-with-dynamic-list/183421>\
**Category:** Uncategorized\
**Created:** [March 26, 2006, 10:53pm UTC](https://forum.kirupa.com/t/help-with-dynamic-list/183421 "2006-03-26T22:53:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vicious30](https://avatars.discourse-cdn.com/v4/letter/v/ecae2f/32.png) [@Vicious30](https://forum.kirupa.com/u/Vicious30)\
**Post date:** [March 26, 2006, 10:53pm UTC](https://forum.kirupa.com/t/help-with-dynamic-list/183421/1 "2006-03-26T22:53:17Z")

</div>

ok I am making a game and need a little help with making a item list.  
Here is the code

> 

function itembagup() {  
for (var j:Number = 0; j\<=\_root.itembag.length-1; j++) {  
curr\_item = game.clip.createEmptyMovieClip(“itemhold”+j, 100001+j);  
//trace(curr\_item);  
obj = curr\_item.attachMovie(“itemuse”, “itemuse”+j, 100001+j);  
obj.\_y = obj.\_height\*j;  
curr\_item.trackAsMenu = true;  
//trace(obj);  
object = itembag[j];  
objvar = itembagvarp[j];  
}  
obj.onPress = function() {  
curr\_item.removeMovieClip();  
\_root.game.hp += objvar;  
\_root.hp += objvar;  
};  
}

The list works as far as the creating and attaching but only the last mc attached holds the info from the two arrays. I need a way to when a mc is attached it hold the info from the arrays until it is removed. also is there a way to remove in item from any position in an array I know about pop and shift but what if you want to remove an item in the third slot of a five item array? anyway any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![bombsledder](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@bombsledder](https://forum.kirupa.com/u/bombsledder)\
**Post date:** [March 27, 2006, 12:01am UTC](https://forum.kirupa.com/t/help-with-dynamic-list/183421/2 "2006-03-27T00:01:34Z")

</div>

well to answer one question really quick, and i’ll look at the other code later you can use, delete myarray[3], to get rid of that item
