9 Replies Latest reply on Dec 13, 2006 5:36 PM by shikozel

    color fade

    ponch
      hi,

      here's what i'm trying to do:

      i have a menu with several buttons. there is movie clip in the middle of the page. i want the movie clip to fade to a new colour when the user rolls over the button - and it should fade back to it's original colour when the user roll's out of the button. each button should cause it to fade to a different color.

      my question is, how hard! is there any built in functionality in flash which helps with this? i downloaded a colour fade extension but can't get it to work.

      any help / advice would be appreciated, and if anyone has a sample .fla so i can see how it's done that would be fantastic.

      cheers,

      ray
        • 1. Re: color fade
          shikozel Level 1
          are you trying to do it in actionscript or can you do it with Tween?
          actionscript=hard
          Tween=easy
          • 2. Re: color fade
            ponch Level 1
            i think i need to use actionscript (or, i was hoping, an extension or something). with tweening i presume i would create the tween in the movie clip, then have the buttons tell the movie clip to go to the starting point of the tween?

            you reply, i thank you
            • 3. Re: color fade
              kglad Adobe Community Professional & MVP
              the code below the dotted line adds a new method to movieclips, colorFadeF(). it requires 6 parameters: start rgb, start alpha, end rgb, end alpha, duration in seconds and steps (an integer to specify the number of intermediate colors you want to display when going from start to end).

              the code above the dotted line is an example of how to apply this method:

              • 4. Re: color fade
                ponch Level 1
                Thanks kglad. i think it may be a little beyond me right now but i'll see.

                appreciate it, cheers
                • 5. Re: color fade
                  shikozel Level 1
                  if this is beyond you, your best bet would be tweening it and tell your MC to play on roll over and roll out
                  • 6. Re: color fade
                    ponch Level 1
                    yeh, that is beyond me, it's tweening or bust for now. thanks all.
                    • 7. Re: color fade
                      kglad Adobe Community Professional & MVP
                      there's nothing you need to do to use the code i gave except copy and paste the code below the dotted line into your fla.

                      then apply the colorFadeF() method to any movieclip you like.

                      using the tweening class for color fading is more complex to apply than the above method.
                      • 8. Re: color fade
                        ponch Level 1
                        i feel slightly sheepish for saying this after getting everyone involved, but even with your instructions i am slightly confused. my knowledge of actionscript is pretty much zero - i got into flash when we were on about flash 5, and have had a few years haitus since then. so until i figure out a bit more about how actionscript works i'll have to skip this and keep it simple for now - need to finish this thing!

                        cheers
                        • 9. Re: color fade
                          shikozel Level 1
                          when I said Tweening I meant to say use the timeline to change the color by changing the Tint.
                          kglad, ponch is really beginner. People that dont understand actionscript won't be able to apply the code. even though it is simple (for us) as you said