1. Home
  2. Computing & Technology
  3. Animation

Deconstructing the Paint Application X: Color Palettes

By Adrien-Luc Sanders, About.com

5 of 7

Now comes setting up the palette so that it assigns a value to hexcolor when a color is clicked, just like the basic palette. It should also hide the palette again after the color is selected.

Each of those little color swatches is a tiny movie clip with the following code assigned to it, adjusted for each to reflect the hex code for the movie clip’s fill color:

on (release) {
_Root.base.hexcolor=”000033”;
_root.base.palette._visible=!_root.base.palette._visible;
}

The sad news is, to create a palette like this you’ll have to make and script each little block manually. There are ways to script it so that Flash dynamically generates a grid through ActionScripting, fills it, and assigns hex codes to each clickable area, but the problem with that is that it’s pretty heavy on the processor load and can lag Flash or lock the browser.

Explore Animation
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Animation
  4. Flash Animation Tutorials
  5. Deconstructing the Paint Application X: Color Palettes

©2009 About.com, a part of The New York Times Company.

All rights reserved.