# Help with adding to an array

**URL:** <https://forum.kirupa.com/t/help-with-adding-to-an-array/223635>\
**Category:** flash\
**Created:** [April 24, 2007, 3:30pm UTC](https://forum.kirupa.com/t/help-with-adding-to-an-array/223635 "2007-04-24T15:30:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![badmonur](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@badmonur](https://forum.kirupa.com/u/badmonur)\
**Post date:** [April 24, 2007, 3:30pm UTC](https://forum.kirupa.com/t/help-with-adding-to-an-array/223635/1 "2007-04-24T15:30:46Z")

</div>

Agian im asing for help but this is what we all are here for right? Anyway, I have an array

inventory = [];

I add to the array by clicing on the item and changing the ID to what the item is.

\_root.ID=“Axe”;

Then I enter an amount in which to buy

\_root.amount=\_root.amount\_mc.new\_amount\_txt.text;

How to I add my ID into the array as many times as I have in the amount.
