PDA

View Full Version : Is there some way to create custom color variable?


iblokh
02-21-2008, 03:50 PM
I'm creating a fairly complex animation frame-by-frame, but I would like to be able to change the color of certain parts of it dynamically. The only approach I can think of is changing each section into a movieclip, putting them all into an array and then looping through the array and assigning a color. However, the animation is long and since the colored shapes constantly change, I would end up with more than a hundred MCs.

A better option, if possible, would be to create a custom variable that I assign as a color in the color picker. So, instead of choosing a value like "#CCCCCC", I would be able to assign a name like "customColor", then I would dynamically change the value of "customColor" in AS3. Is that at all possible? Do you know of any extensions that add that functionallity?

xwielder
02-21-2008, 03:55 PM
Would I be correct to assume that what you're wanting to do is use the Color Picker component and add a space for a dynamically changeable color block within the component? Or am I totally not getting it? :confused:

iblokh
02-21-2008, 04:16 PM
Would I be correct to assume that what you're wanting to do is use the Color Picker component and add a space for a dynamically changeable color block within the component? Or am I totally not getting it? :confused:

Exactly! I'm searching now for an extension that has that functionality, but no luck so far. Seems like it would be a very useful feature - the color could be the changed either dynamically with AS or by changing the value of the custom color from the panel.

xwielder
02-21-2008, 04:31 PM
Okay. I've done it on a project before, but as I'm searching my archives I'm not seeing it. I'll have to check on some network drives to see if I stuck my .fla file there. Once I find it, I'll send it to you so you can see how I did it.

iblokh
02-21-2008, 04:45 PM
Okay. I've done it on a project before, but as I'm searching my archives I'm not seeing it. I'll have to check on some network drives to see if I stuck my .fla file there. Once I find it, I'll send it to you so you can see how I did it.

Cheers, thanks! Do you remember at all if it was a custom panel/extension or something already available in Flash? I was actually thinking of using this as a way to learn how to write custom panels, but I'm probably not motivated enough.