dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: duplicate movie with a twist

  1. #1
    Member
    Join Date
    Oct 2000
    Posts
    78
    have some code to duplicate a movieclip
    Code:
        newY = 10;
        for (i=0; i<menuMax; i++) {
            duplicateMovieClip (_root.mainMenu.subMenuItem, "select"+i, i);
            setProperty ("select"+i, _y, newY);
            newY = newY+20;
        }
    i am playing around with trying to get every other movieclip to be white, as they are currently grey, but to no avail. can anyone point me in the right direction? even if you could tell me how to at least get every other movieclip to have an alpha of 0, it would help me out.

    i am trying to achieve this
    Code:
     ________
    |  GREY  |
    |________| <---1st dupliacted movieclip    
    | WHITE  |
    |________| <---2nd dupliacted movieclip    
    |  GREY  |
    |________| <---3rd dupliacted movieclip    
    | WHITE  |
    |________| <---4th dupliacted movieclip    
    
    .....and so on
    [Edited by tapo on 10-05-2001 at 03:49 PM]

  2. #2
    Senior Member
    Join Date
    Apr 2001
    Posts
    433
    counter = 0
    newY = 10;
    for (i=0; i<menuMax; i++) {
    duplicateMovieClip (_root.mainMenu.subMenuItem, "select"+i, i);
    _root["select" + i]._y = newY
    if (counter == 1) {
    _root["color" +i] = new Color(_root["select" + i])
    _root["color" +i].setRGB(0xFFFFFF)
    counter = 0
    } else {
    counter++
    }
    newY += 20;
    }

    Note that this will make the entire movieclip totally white. If this ISN'T what you want, you'll need to make a frame in the movieclip that has a white version of what you want and label it something like "myWhiteVersion" (be sure to put a stop() action on frame 1, then!) and use

    if (counter == 1) {
    _root["select" +i].gotoAndStop("myWhiteVersion")
    counter = 0
    } else {
    counter++
    }

  3. #3
    Forgive me for asking, but what kind of code is that?

    I took a C programming course in school, but the syntax looks a little different....

    Thanks.

  4. #4
    Member
    Join Date
    Oct 2000
    Posts
    78
    thanks artic, ill give that a go

    12volt, were you confused about which forum you were in when you posted this? it's actionscript which was derived from javascript 1.2, which got its foundation from c or c+.

  5. #5
    Hey tapo, do I sense a bit of sarcasm?

    I was just asking a simple question. I must say that I'm not a script kiddy like you.

    Have a great day!

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