EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Page 839

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
MovieClip 839
focalPointRatio:Number [optional] - Added in Flash Player 8. A number that controls the
location of the focal point of the gradient. The value 0 means the focal point is in the center.
The value 1 means the focal point is at one border of the gradient circle. The value -1 means
the focal point is at the other border of the gradient circle. A value less than -1 or greater than
1 is rounded to -1 or 1. For example, the following image shows a
focalPointRatio set to
0.75:
Example
The following code creates a spherical shade effect:
import flash.geom.*
this.createEmptyMovieClip("gradient_mc", this.getNextHighestDepth());
with (gradient_mc)
{
fillType = "radial"
colors = [0x000000, 0xFFFFFF];
alphas = [50, 90];
ratios = [0, 0xFF];
spreadMethod = "pad";
interpolationMethod = "RGB";
focalPointRatio = 0.3;
matrix = new Matrix();
matrix.createGradientBox(100, 100, 0, 0, 0);
beginGradientFill(fillType, colors, alphas, ratios, matrix,
spreadMethod, interpolationMethod, focalPointRatio);
moveTo(0, 0);
lineTo(0, 100);
lineTo(100, 100);
lineTo(100, 0);
lineTo(0, 0);
endFill();
}

Table of Contents

Related product manuals