Ok Im making a RPG game: (Here it is in development) (arrow keys to move)
http://www.imgupload.co.uk/uploads/b1c3ea3656903e3f9ccd75915d6d483f1cbd0ade23def698be9c36d95764a4ef.swfIn the frame I have:
currentslotnum = 1;
stop ();
function addToslot (item) {
if (!item.found) {
item._x = eval (“itemSlot” + currentslotnum)._x;
item._y = eval (“itemSlot” + currentslotnum)._y;
item.found = true;
currentslotnum++;
}
Among other stuff - and on items which can be picked up I have:
onClipEvent (enterFrame) {
if (_root.character.hitTest (this)) {
_root.addToslot (this);
}
}
- Yay that works fine. But now when I try to Have it so you click a “Inventory” button the inventory pops up - I get this:
Code on the Items:
onClipEvent (enterFrame) {
if (_root.character.hitTest (this)) {
_root.inventory.addToslot (this);
}
}
Code on the two frames of the inventory MC:
currentslotnum = 1;
stop ();
function addToslot (item) {
if (!item.found) {
item._x = eval (“itemSlot” + currentslotnum)._x;
item._y = eval (“itemSlot” + currentslotnum)._y;
item.found = true;
currentslotnum++;
}
}
I now longer have that script on the main page. And the two Items are inside the inventory MC
What should happen?
Upon touching the two items - they should both go into inventory whenever its popped up or closed. (and you can turn the inventory off and on without it messing up)
What Happens:
Touching the two items with the invent closed does nothing - if you turn it on then and touch them - nothing happens.
But if you touch the items for the first time with the inventory open - they go into the invent - but they dont close when the inventory closes.
I think part of it is to do with the mc inventory having two frames - with the script on both frames - presumably I could use attachMC which Im new at.
Making the items disspear with the inventory when closed could be solve (i think_ with just _root.item = false; or something.
Help please?