Groups | Blog | Home
all groups > flash actionscript > may 2006 >

flash actionscript : Making a color changer in Flash?


tralfaz
5/12/2006 3:59:38 PM

[quoted text, click to view]

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

tralfaz
5/12/2006 7:46:06 PM
[quoted text, click to view]

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

cre8ive1974
5/12/2006 8:53:56 PM
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?
Mr_Interweb
5/12/2006 9:33:48 PM
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/

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. It is a good trick to do this. 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:


http://www.awssoft.com/products.php?p=colorpickerpro&s=overview&PHPSESSID=d57879
a6fe4cdbaa10d5c2a7330ceba3

Good luck :)
Mr_Interweb
5/12/2006 11:26:35 PM
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.
Mr_Interweb
5/12/2006 11:42:09 PM
I think I have my loader fixed. Please inform me if this is not the case.

Mr_Interweb
5/13/2006 12:00:00 AM
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.
Mr_Interweb
5/13/2006 12:00:00 AM
tralfaz
5/13/2006 12:15:36 AM
[quoted text, click to view]

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





cre8ive1974
5/15/2006 4:00:07 PM
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
Mr_Interweb
5/15/2006 4:19:52 PM
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.
AddThis Social Bookmark Button