Can anyone suggest me how to create an inventory system for a flash game? Ya know, those stuff that like lets say there’s a box on the screen, you click on it and it is added to your inventory, then you can select it from your inventory screen and use it for stuff.
I assume you are trying to create some game like diablo?
so, you’ll need healthpotions
to use an item you could use this code, where healthpotion is the name of the button:
health = 50;
healthpotion.onPress = function()
{
currentItem = “healthpotion”;
useItem(currentItem);
}
function useItem(itemName)
{
health += 50;
_root.healthindicator.healthbar._xscale = (health/100 * 100);
}
to display the items in an inventory list, you’ll need the inventory array, for every item in that array you have to create a button in the inventory movieclip