Thread: Swapping colors

    #1
  1. No Profile Picture
    Dev
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2001
    Posts
    1,436
    Rep Power
    41

    Swapping colors


    What is the best way to swap colors in a Flash movie? The swatch/mixer system seems to be very limited and I'm having trouble getting anything doen using that system. If there are, say, 100 symbols using the same 10 colors and I want to swap out those colors to create a different color scheme, without having to edit each symbol one by one, how would I do that?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jul 2000
    Posts
    669
    Rep Power
    15
    Are you using Flash MX? If so its as easy as:

    Code:
    myColor = new Color(targetMC);
    myColor.setRGB(0xFF0000);
    So if you knew all the MC names you wnated to change ahead of time. Let's say they were clip1, clip2, etc.....

    Code:
    for(var i=0;i<10;i++) {
      var myColor = new Color(this["clip"+i]); 
      myColor.setRGB(0xFF0000);
    }
  4. #3
  5. No Profile Picture
    Dev
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2001
    Posts
    1,436
    Rep Power
    41
    I'm using Flash 5. You can do the same thing in Flash 5 but I know that it makes the entire mc one solid color, which won't work.. There are hundreds of separate symbols, so I don't think that method will work for me.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jul 2000
    Posts
    669
    Rep Power
    15
    Why can't you apply the color transformation to the individual symbols? Or are they not actually movie clips?
  8. #5
  9. No Profile Picture
    Dev
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2001
    Posts
    1,436
    Rep Power
    41
    The code will change the entire mc or symbol to one solid color, which won't work. There are hundreds of separate symbols and MCs, it would actually be easier to change the colors one by one in Flash than to write code to change each one...
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jul 2000
    Posts
    669
    Rep Power
    15
    Yes I understand that. But what you are saying is that one MC holds hundreds of separate MCs, right? SO use actionscript to change the separate MCs. I mean you did name them something that can be looped through right like sub1, sub2, sub3, sub4, etc.....

IMN logo majestic logo threadwatch logo seochat tools logo