# Storing items in an inventory

**URL:** https://forum.kirupa.com/t/storing-items-in-an-inventory/247912
**Category:** flash
**Created:** [January 1, 2008, 3:41pm UTC](https://forum.kirupa.com/t/storing-items-in-an-inventory/247912 "2008-01-01T15:41:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![yahoom](https://avatars.discourse-cdn.com/v4/letter/y/a587f6/32.png) [@yahoom](https://forum.kirupa.com/u/yahoom)
#### Post date: [January 1, 2008, 3:41pm UTC](https://forum.kirupa.com/t/storing-items-in-an-inventory/247912/1 "2008-01-01T15:41:37Z")

</div>

Hi and happy new year, I’m trying to create an inventory for a point and click style game. I want to click and drag an object into a inventory box to be stored until it’s required (however the object is also bigger than the box and so I think it needs to be re-scaled).  
I’ve sort of nearly got it working but it’s still not right.

here’s the code I’m currently using:

mc1.onPress = function(){  
this.startDrag();  
};  
mc1.onRelease = function(){  
if (this.hitTest(box1) == true){  
this.\_xscale = 40;  
this.\_yscale = 40;  
this.stopDrag();  
}else{  
if (this.hitTest(box1) == false){  
this.\_xscale = 100;  
this.\_yscale = 100;  
this.stopDrag();

I’ve also tried replacing the lines with \_xscale/\_yscale with:  
this.\_x = box1.\_x;  
this.\_y = box1.\_y;

Any help would be appreciated
