A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: help with for ( )

  1. #1
    Member
    Join Date
    Dec 2003
    Posts
    45

    help with for ( )

    I have 7 movieclips that I called command1, command2, command3, ...

    for each of them, I want to set their alpha value to 0

    so, I use the command for()

    for(i=1; i<8; i++){
    ???._alpha = 0;

    but I don't know how to write the statement, I need help please

    thanks

    MaX_BoY

  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    Hi,

    If the for loop is in the same timeline as the movie clips you can use,

    code:

    for (var i = 1; i < 8; ++i) {
    this["command" + i]._alpha = 0;
    }



    if the clips are in a different timeline you just need to replace "this" with the path to the timeline that contains them so for example if the clips were in a movie clip named myClip which was on the same timeline as the code for the for loop you could use,

    code:

    for (var i = 1; i < 8; ++i) {
    this.myClip["command" + i]._alpha = 0; // this version looks inside the clip myClip to find the command clips
    }


  3. #3
    Member
    Join Date
    Dec 2003
    Posts
    45
    thank you

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