MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference page 922

Actionscript 2.0 language reference
Table of Contents

Advertisement

Example
The following creates a movie clip that contains a 20-pixel line (which forms a border) and a
gradient fill. The movie clip scales based on the mouse position, and because of the
set for the movie clip, the thickness of the 20-pixel line does not vary when the
scale9Grid
movie clip scales (although the gradient in the movie clip does scale):
import flash.geom.Rectangle;
import flash.geom.Matrix;
this.createEmptyMovieClip("my_mc", this.getNextHighestDepth());
var grid:Rectangle = new Rectangle(20, 20, 260, 260);
my_mc.scale9Grid = grid ;
my_mc._x = 50;
my_mc._y = 50;
function onMouseMove()
{
my_mc._width = _xmouse;
my_mc._height = _ymouse;
}
my_mc.lineStyle(20, 0xff3333, 100);
var gradient_matrix:Matrix = new Matrix();
gradient_matrix.createGradientBox(15, 15, Math.PI, 10, 10);
my_mc.beginGradientFill("radial", [0xffff00, 0x0000ff],
[100, 100], [0, 0xFF], gradient_matrix,
"reflect", "RGB", 0.9);
my_mc.moveTo(0, 0);
my_mc.lineTo(0, 300);
my_mc.lineTo(300, 300);
my_mc.lineTo(300, 0);
my_mc.lineTo(0, 0);
my_mc.endFill();
See also
Rectangle (flash.geom.Rectangle)
922
ActionScript classes

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF