Junior: On AS mapping function and a few simple examples
Movie clip object mapping methods are mainly in the following four:
MoveTo (x, y); decided to start painting the location;
LineTo (x, y); Dra;
CurveTo (x1, y1, x2, y2); drawing curves, x1, y1 control, x2, y2 the end;
Clear (); under way to remove all the graphics graphics;
Lines and set up the four color image:
LineStyle (a, b, c); definition color and thickness of the lines, a line for the thickness, b for the RGB color values in hexadecimal, c transparency (1-100);
BeginFill (a, b) definition of the beginning of color and fill the position as a color RGB hexadecimal value, b transparency (1-100);
BeginGradientFill (fillType, colors, alphas, ratios, matrix); definition graded colors and the beginning of filling positions, five parameters, fillType filled type, color array of colors, from left to right [a, b], a, b, respectively 16 hex RGB color, transparency alphas color array, the array of ratios of color, gradual control of the direction of matrix;
EndFill (); by the end of beginFill () or beginGradientFill () began filling.
1, a new line drawing files, settings, the background is black, 24, in the first frame F9 opened by the action panel, enter the following code:
LineStyle (2,0 xff6600, 100);
MoveTo (0,0);
LineTo (0300); 2, drawing curves to enter the following code:
LineStyle (2,0 xff6600, 100);
MoveTo (150,120);
CurveTo (240,300,400,250);
3, filled with the realization of color
BeginFill (0xffcc00, 100);
LineStyle (2,0 xff6600, 100);
MoveTo (0,0);
LineTo (0,300);
LineTo (400,300);
LineTo (400,0);
LineTo (0,0);
EndFill (); 4, filled with color graded
_root.createEmptyMovieClip ( "Sq," 1);
With (_root.sq) (
Colors = [0xFF0000, 0xFFFF00];
Alphas = [100, 100];
Ratios = [0, 0xFF];
Matrix = (matrixType: "box", x: 400, y: 400, w: 500, h: 500, r: (-45/180) * Math.PI);
BeginGradientFill ( "linear" colors, alphas, ratios, matrix);
MoveTo (31, 51);
LineTo (31, 331);
LineTo (331, 331);
LineTo (331, 31);
LineTo (31, 31);
EndFill ();
)
Tags: layout examples






Leave a Reply