
August 3rd, 2006, 11:53 AM
|
 |
Contributing User
|
|
Join Date: Jun 2006
Location: Cancún. México
Posts: 141
Time spent in forums: 1 Day 6 h 32 m 51 sec
Reputation Power: 2
|
|
Why won't inventory work inside a mc?
Hi, I made an inventory and it works, the problem is that I need it to be inside a movieclip (menu) but it won't work. Here's how I made it:
I made movieclips that are squares with no fill and gave the instance "itemSlot" + number (I made 16). Then I added this code to the main actions frame:
Code:
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++;
}
}
And items are movieclips smaller than the slots with instance "item" + number with this code:
Code:
onClipEvent (enterFrame) {
if (_root.player.hitTest (this)) {
_root.addToslot (this);
}
}
("player" is the user)
It works, I've tested it, but only when it is out of the movieclip. Can anyone tell me how to make this work inside the movieclip?
Thanks in advance
|