_root.layer.matrix = {matrixType:"box",x:_root.linex,y:_root.liney,w:_root.xwidth,h:_root.yheight,r:_root.rad};
For a single line of text, that probably looks extremely confusing. To clarify a few things first: _root.linex and _root.liney are the universal variables Ive been using through the entire application to capture the starting x and y coordinates of the mouse when the button is first depressed. _root.xwidth and _root.yheight are variables that I created in the main code sample in order to determine the number of pixels between the starting and ending x and y coordinates of the mouse when the mouse button is released, and the check to see if the value calculated is positive or negative. If its negative, it converts it to positive, so we wont have a negative width or height. _root.rad is another variable that I created to capture the angle (in degrees) of the gradient, entered by the user in an input text box, and then convert it to rotation in radians.
Now that my individual variables are explained, lets look at the actual basic matrix format. There are two different ways to do this - either as a basic matrix, or as a matrixType. I prefer matrixType because its easier to break the code:
matrix = {matrixType, x:###, y:###, w:###, h:###, r:### };
matrixType is a string that defines the shape whose properties are being listed in the matrix, in this case a box type. x and y are the starting points where the drawing begins on the stages coordinate plane; w and h are the width and height of the box being drawn, and r is the angle in radians of the gradient. These values can be numbers or variables.
And that pretty much covers this one.


