1. Home
  2. Computing & Technology
  3. Animation

Deconstructing the Paint Application VI: The Gradient Rectangle Tool

By , About.com Guide

7 of 8

Understanding Arrays Used in beginGradientFill

Let’s break down the arrays that we used:

_root.layer.colors = [color1,color2];
_root.layer.alphas = [tsalpha1,tsalpha2];
_root.layer.ratios = [25,225];

This part is actually quite simple, if you look at the glossary definition of what an array is: just a list of values. We’ve already created variables to hold numeric values for the two gradient colors and alpha values; creating arrays in this format just makes containers for those lists of values. My arrays are named colors, alphas, and ratios, and are used in the beginGradientFill() function shown in the previous step. This is just an easy way to give the function the values it needs to draw the gradient rectangle, in the correct order and format.

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 VI: The Gradient Rectangle Tool

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

All rights reserved.