if (_root.isactive=="gradientrec"){Broken down like this, it looks almost exactly like [link url=http://animation.about.com/od/flashanimationtutorials/ss/paintapp5_3.htm]the code to draw the solid rectangle - only instead of using beginFill, it uses beginGradientFill and many more parameters.
_root.layer.lineStyle(0,_root.currentcolor,0);
_root.layer.moveTo(_root.linex,_root.liney);
_root.layer.beginGradientFill("linear", _root.layer.colors, _root.layer.alphas, _root.layer.ratios,_root.layer.matrix);
_root.layer.lineTo(_root.linex,_root._ymouse);
_root.layer.lineTo(_root.linex,_root.liney);
_root.layer.lineTo(_root._xmouse,_root.liney);
_root.layer.lineTo(_root._xmouse,_root._ymouse);
_root.layer.lineTo(_root.linex,_root._ymouse);
_root.layer.endFill();
_root.rectracker.clear();
}
beginGradientFill takes the following format:
myMovieClip.beginGradientFill (fillType, colors, alphas, ratios, matrix)
fillType can only be one of two: linear, or radial. Colors, alphas, and ratios are all arrays, containing the values for the gradient colors (usually in hexadecimal format), the values for the opacities (usually numeric), and the ratios (values defining the color distribution and where each color is at 100%, usually numeric). Youll notice each addendum says usually. In ours, we use variables, the reason that we had to parse our strings into numeric values in the previous steps.
The last part, the matrix, is a transformation matrix that defines the properties of the rectangle drawn.


