1. Home
  2. Computing & Technology
  3. Animation

Deconstructing the Paint Application X: Color Palettes

By , About.com Guide

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

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. 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.