delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

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


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:
  1. currentslotnum = 1;
  2. stop ();
  3. function addToslot (item) {
  4. if (!item.found) {
  5. item._x = eval ("itemSlot" + currentslotnum)._x;
  6. item._y = eval ("itemSlot" + currentslotnum)._y;
  7. item.found = true;
  8. currentslotnum++;
  9. }
  10. }
Copy Code
And items are movieclips smaller than the slots with instance "item" + number with this code:
Code:
  1. onClipEvent (enterFrame) {
  2. if (_root.player.hitTest (this)) {
  3. _root.addToslot (this);
  4. }
  5. }
Copy Code
("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

TOP

try
    _root["itemSlot" + currentslotnum];
or if the itemSlot mc is in a differnt container the reference that instead of _root



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

TOP

Back Forum