10 Replies Latest reply on May 15, 2006 9:19 AM by Mr_Interweb

    Making a color changer in Flash?

    cre8ive1974 Level 1
      If anyone can help me. I'm trying to do something similar to this color selector.

      http://www.chevrolet.com/silverado/colors/

      Using simple code I can make the colors change, I just don't know how they made the "wipe" or any other transition for that matter when changing color.

      any ideas?
        • 1. Making a color changer in Flash?
          Mr_Interweb
          You don't want to know the answer to this question. I just made an app that does this.

          Check it out

          The key to doing this is to use a 3D program to render out what you are trying to color. Render the model with multiple layers (reflection, diffusion, shadow, etc). Use Flash 8' s filters on the layers till you have it right. I used the screen and multiply a lot. Apply the color to one of your blending layers. Or you could go the easy way, and use pre-rendered images with the colors applied.

          If you want a good open source flash color picker component, you might want to consider this one:

          Color picker component

          Good luck
          • 2. Re: Making a color changer in Flash?
            Level 7

            "Mr_Interweb" <webforumsuser@macromedia.com> wrote in message news:e42uvs$ojc$1@forums.macromedia.com...
            > You don't want to know the answer to this question. I just made an app that
            > does this.
            >
            > http://www.ultimatewindowtinting.com/tinting-tool/

            Interesting, but it doesn't seem to work/load. If I click on the car or the link I get a loader screen that never ends. If I hold
            down the ctrl key when I click to override the pop-up killer it pops up an empty white screen with hour glass, never ends. Maybe
            something with the preloader is wrong?
            IE 6,
            PC,
            Flash player 8
            tralfaz


            • 3. Re: Making a color changer in Flash?
              Mr_Interweb Level 1
              Sorry. Thought I had that fixed. Something is up with IE and the flash loader. Firefox works better, but you should be able to have the loader work if you hit F5 a couple times if it looks like it is hanging.

              I am working on fixing my loader now.
              • 4. Re: Making a color changer in Flash?
                Mr_Interweb Level 1
                I think I have my loader fixed. Please inform me if this is not the case.

                Car color changer link
                • 5. Re: Making a color changer in Flash?
                  Level 7
                  "Mr_Interweb" <webforumsuser@macromedia.com> wrote in message news:e436gh$3fn$1@forums.macromedia.com...
                  >I think I have my loader fixed. Please inform me if this is not the case.
                  >
                  > http://www.ultimatewindowtinting.com/tinting-tool/app.php

                  Sorry, still not working but this time it starts with the loader screen. The loader bar is full length blue and unchanging.
                  tralfaz


                  • 6. Re: Making a color changer in Flash?
                    Mr_Interweb Level 1
                    I have no idea what's up with that loader. I tried it out on 6 different computers today on windows and mac. It was working this afternoon. The only thing I can find is that my loader is getting cached in IE when I cleared out the cache things worked fine. If things are still fishy after a cache clear or trying in out in Firefox, try skipping the preloader:

                    skip the screwy preloader

                    The app will scale weird in the browser without the loader, but you can at least see it.

                    By the way, thank you for telling me about the errors you found with that loader. It is the most bizarre issue I have ever seen.
                    • 7. Re: Making a color changer in Flash?
                      Level 7
                      "Mr_Interweb" <webforumsuser@macromedia.com> wrote in message news:e43qn9$obc$1@forums.macromedia.com...
                      >I have no idea what's up with that loader. I tried it out on 6 different
                      > computers today on windows and mac. It was working this afternoon. The only
                      > thing I can find is that my loader is getting cached in IE when I cleared out
                      > the cache things worked fine. If things are still fishy after a cache clear or
                      > trying in out in Firefox, try skipping the preloader:
                      >
                      > http://ultimatewindowtinting.com/tinting-tool/tinter.swf
                      >
                      > The app will scale weird in the browser without the loader, but you can at
                      > least see it.
                      >
                      > By the way, thank you for telling me about the errors you found with that
                      > loader. It is the most bizarre issue I have ever seen.

                      That's very interesting how you got that color selector to work. good one!
                      I took a look at the code in your preloader. One thing that is not right is that you are looping back to frame 2 where the
                      onEnterFrame is created. That means that you are creating another onEnterFrame with every loop, (or wrecking the original one).

                      I found that if I put your file tinter.swf in my cache, then the preloader ended and the main file ran. If tinter.swf wasn't in the
                      cache then the preloader just gets stuck.
                      Seems like the loadMovieNum is failing.
                      Anyway, instead of that you might want to do something like this to make sure that you don't initialize onEnterFrame more than one
                      time..

                      if(!initialized)
                      {
                      initialized = true; // block this init code next time
                      loadMovieNum("tinter.swf", 2);
                      this.onEnterFrame = function () // add 'this' here
                      {
                      ... etc

                      }

                      tralfaz






                      • 8. Re: Making a color changer in Flash?
                        Mr_Interweb Level 1
                        Thanks for the tips on the loader. That makes sense. Unfortunately, I won't be able to get to my code untill Monday. So I'll have to try it then.
                        • 9. Re: Making a color changer in Flash?
                          cre8ive1974 Level 1
                          Your color selector is pretty cool.

                          What I am looking for is the ability for the user to select pre selected colors, just like you would for an automobile site. Red, blue, green white etc.. I can make the colors change in the program, what I don't know is how to make the colors wipe or transition to each other. Like this sites does

                          http://www.chevrolet.com/silverado/colors/

                          any ideas?
                          Thanks!
                          D
                          • 10. Re: Making a color changer in Flash?
                            Mr_Interweb Level 1
                            Depending on what object you are changing a color for you may or may not be able to get away with a simple:
                            var myColor:Color = new Color(targetMC);
                            myColor.setRGB(0xFFCC00);

                            but complex images like cars are a little more tricky to accurately change the color for.

                            If you do pre-rendered colors for the objects (aka images with different colors) that might be a solution as well.

                            The wipe effect should be pretty easy. I would just set a dynamic mask with actionscript and set a movie clip that wipes across the mask the way you want.

                            Another approach you could take is, I know Flash 8 has some predefined effects such as wipes, fades, and other transition effects. You might want to look into those if you do not want to program your own from the ground up.