well, im not goig to GIVE you the actionscript, that wouldnt be fun, now wouldnt it?
Ok, make your inventory box, now, make slots in it, simply by seperating it with lines, then make the 'slots' all MC's With instance names of Invslot1 InvSlot2 InvSlot3 and so on and so forth.
Now, put the item on the floor. Now make a hittest, make a code on the item, make it n if statement(which most hittests are like) telling it to put the item over InvSlot1. This isnt teh only way, but it sure makes itr easier, then you can put in some if statements to get poitns for the number of items in your inv, etc.
There are easier wyas, im sure, but this is how I do it :)