PDA

View Full Version : Why wont this work??



Spartanblade
December 1st, 2006, 08:16 PM
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?

SacrificialLamb
December 1st, 2006, 08:38 PM
it might be coz when the inventory is in another frame currentslotnum or the eval("itemSlot"+ code can not link to them. Why do you think that a code that works until you move it would have enough information for people that have little to know idea of your layout to fix it? you might want to post the .fla file for help other than speculation