A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: multiple instance names!?

  1. #1
    The next Squaresoft
    Join Date
    Sep 2004
    Location
    Zanarkand
    Posts
    215

    multiple instance names!?

    umm ive been experimenting on scripts that call out to instances with different names, but uses only one call script.

    so ive done it like this, box1, box2, and box3 and so on and so forth

    but what i cant do is to use, lets say box++?

    is it possible to use a script that represents instance names with
    accumilating numbers?

    example:

    box1, box2, box3, box4, box5...

    _root.box++.do whatver


    umm oh yeah....is this still a noob question?
    haha tnx dudes!
    "Are those gummy worms? Can I have some?"

    "Nevermind, I just saw one move by itself..."

  2. #2
    Registered User Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Depends on what you want to use it for. A for loop will do something like that.
    Attached Files Attached Files

  3. #3
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    You can use a loop to perform some action with each of the clips,

    Code:
    for (var i = 1; i < howManyBoxes + 1; ++i) {
        _root["box" + i].doSomething();
    }

  4. #4
    The next Squaresoft
    Join Date
    Sep 2004
    Location
    Zanarkand
    Posts
    215
    ohh thanks dudes! thx also for the sample file! Iv'e got a headstart one what to do,

    oh yeah about your script catbert, i believe i saw the exact same thing in javascript, but i forgot the explanation on that...

    can you ummm, enlighten me on this one?

    thanks again dudes!!
    "Are those gummy worms? Can I have some?"

    "Nevermind, I just saw one move by itself..."

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