Dynamic inventory

im trying to make a dynamic inventory so the player can remove items and place new ones in the old slot and you can get more slots, and astuff like that i have a code but it just sends the item to the first slot how would i make it so that i can send the item to the first slot save it and the next item would be sent to the second slot, im gonna make an array of items and slots later so it would be easier just practicing with this atm plz help, thanks.

bslot1 = true;
bslot2 = true;
bslot3 = true;
bslot4 = true;
this.item1.onRelease = function() {
 if (_root.bslot1) {
  this._x = slot1._x;
  this._y = slot1._y;
 } else if (_root.bslot2) {
  this._x = slot2._x;
  this._y = slot2._y;
 } else if (_root.bslot3) {
  this._x = slot3._x;
  this._y = slot3._y;
 } else if (_root.bslot4) {
  this._x = slot4._x;
  this._y = slot4._y;
 }
};