This user is yet to take control of their account and provide a biography. If you are the author of this article, please contact us via support AT actionscript DOT org. This is not really for the programming technique but to help users of Flash MX to understand the meaning of matrix that goes in the movieclip method function, "beginGradientFill" as an argument.
It is the affine transformation matrix which deals with the transformations of 2D geometrical shapes. Macromedia never mentioned this fact although it is hinted in the help manual.
I do not understand why Macromedia deliberately avoided mentioning the name of the matrix. Actually the affine transformation is a household terminology in the computer graphics world. For example Java 2 included in their AWT package, a class named "Affine" to deal with the 2D transformations such as translation, scaling, shearing and rotation.
I created two movie clips. One shows the affine transformation matrix that can be used to transform the 2D shapes and the other is to show how the outcome look like if we use the same transformation matrix in the beginGradientFill method.
The second movie can be used to determine which numbers to use for the matrix argument of beginGradientFill. If you found the right rendering of the gradient, simply copy the numbers for the matrix and paste them in your codes.
There are 4 sets of buttons that transform the shapes, which are initially a square and a circle. Try click buttons yourself and see how these shapes change.
It is said one peek is better than a thousand words and one doing(experiment) is better than a hundred pictures! The second phrase is from an old oriental saying.
I could give a ten page lecture on the mathematics behind this matrix but what is the use since Macromedia people so deliberately avoided.
In the zip file two *.fla files for the drivers of the movies and 3 external files which are used to simplify codes. The affine class is defined in the external file called " rotMatrix3D.as" since the class is defined as a subclass of RotMatrix3D, which is also included in the same file.