# Why wont this work?

**URL:** <https://forum.kirupa.com/t/why-wont-this-work/208755>\
**Category:** Uncategorized\
**Created:** [December 2, 2006, 1:16am UTC](https://forum.kirupa.com/t/why-wont-this-work/208755 "2006-12-02T01:16:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spartanblade](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@Spartanblade](https://forum.kirupa.com/u/Spartanblade)\
**Post date:** [December 2, 2006, 1:16am UTC](https://forum.kirupa.com/t/why-wont-this-work/208755/1 "2006-12-02T01:16:28Z")

</div>

I am making a game and i want it so that when you hittest a guy you go to another frame where you have the things you can buy. but when i click the buy button the item dose not appear.I have this code in the buy button=on (release) {  
if (\_root.currentslotnum\<=3) {  
eval(“itemSlot”+currentslotnum).gotoAndPlay(“sword1”);  
}  
}  
on (release) {  
if (\_root.currentslotnum\<=2) {  
currentslotnum++;  
}  
}  
I have 3 slots in my inventory. when the buy button was in the same frame as the inventory it worked but when i moved the button to a diffrent frame it stoped working!  
Dose some one know how to make it work?
