dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [Problem]:Dynamic Movieclip Calling

  1. #1
    Junior Member
    Join Date
    Nov 2007
    Posts
    3

    [Problem]:Dynamic Movieclip Calling

    I think the title is accurate, but the name for what I am trying to do might be different entirely.

    Anyways, I am trying to call an attached movieclip dynamically.
    My code is:
    Code:
    npuX = "npc" + npuID;
    game.clip.attachMovie("char", npuX, npu.depth);
    Lets say npuID = 1. I want to be able to call _root.npuX, and it will be equal to _root.npc1.
    Is this possible?

    Thanks for any help!

  2. #2
    Style Through Simplicity alillm's Avatar
    Join Date
    Mar 2004
    Location
    Wales
    Posts
    1,988
    You can call it like this:

    _root["npc"+npuID]

    or of couse

    _root[npuX]

    would work too if you have already defined it.

    Ali

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