A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Getting multiple videos to play (easy question...)

  1. #1
    Member
    Join Date
    Aug 2001
    Posts
    67

    Getting multiple videos to play (easy question...)

    So I have like 13 movie clips. Movie clips in one layer and buttons on another that are above the clips. Each clip is labeled as varr1, varr2, varr3 and so on.

    When a user click on a button, I would like for all but one movie clip to play it's animation. So for instance, the button for varr10 is clicked, I want all movie clips except varr10 to play it's animation.

    I could do it the hard way, which is varr1.gotoAndPlay("yada"), and continue on... but I wanted something more efficient.

    Could anybody assist me please?
    "As long as I'm around, QUIT has no meaning"

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    use a for loop. It's an efficient method to target multiple serial named instances.

    gparis

  3. #3
    Member
    Join Date
    Aug 2001
    Posts
    67
    Quote Originally Posted by gparis
    use a for loop. It's an efficient method to target multiple serial named instances.

    gparis
    Ok, makes sense...so how would I create the code to send the play commands to each movie clip?
    "As long as I'm around, QUIT has no meaning"

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    click on the link. you'll find examples of the for loop syntax in the livedocs.
    something in these lines:

    for (i = 0; i < clipNum; i++) {
    this["mc"+i].play();
    }

    gparis

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