Skip to main content
Participant
July 26, 2007
Question

Dynamic colour preview?

  • July 26, 2007
  • 1 reply
  • 194 views
Hey guys,

I'm trying to create a small app that allows you to change the colour of several movie clips. So far I've got several swatches that change each movie clip using the setRGB() function and that works fine.

My client has asked for a preview of the colour change though. The idea is when you roll over a swatch it will change the movie clip color. If you roll out without clicking and applying the color it will revert back to the color before you rolled over the swatch. If you did click while hovering and set the color it will keep that color.

My first thought was to use getrgb on the current color and use it in the setrgb function of the temporary color to change back but it seems you can only use rgb values, not strings or variables?

Any suggestions on this would be greatly appreciated!

Thanks in advance,
Adam Owen

p.s. This is the sort of thing we're going for - http://store.etnies.com/Custom/ - click a shoe then start hovering and clicking swatches.
This topic has been closed for replies.

1 reply

Inspiring
July 26, 2007
Why would you think you can't use a variable? As long as the variable is a
number with an appropriate color value it will work fine. However, you
should be using the ColorTransform class, Color is deprecated.

--
Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/


Participant
July 26, 2007
Ah, thanks for letting me know about ColorTransform.

All the research I did only came up with people writing the actual color values into setRGB, and my few attempts to get a variable in there failed.

Many thanks for your help Dave, I'll give it a try now!