A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: AS2 question requires probably a simple answer.

  1. #1
    Senior Member
    Join Date
    Feb 2003
    Posts
    129

    AS2 question requires probably a simple answer.

    Hi, I'm trying to position a movieclip in the same place as another one called "slot#", with the # being a number. There are several of these, e.g. slot1, slot2, slot3, etc.

    My problem is that the code below is only to define a "slot#" that's in the root of the file. My "slot#" movie clips are based inside a movie clip called "navbar", so to get to the slot#, the definition is "_root.navbar.slot#".

    What is the correct way to add the "_root.navbar." to the code below?

    Thanks in advance.

    Code:
    item._x = eval ("slot" + currentslotnum)._x;
    item._y = eval ("slot" + currentslotnum)._y;

  2. #2
    AS3 Mod
    Join Date
    Sep 2007
    Location
    O-H-I-O
    Posts
    2,385
    PHP Code:
    item._x _root.navbar["slot" currentslotnum]._x;
    item._y _root.navbar["slot" currentslotnum]._y

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center