Shape Documentation

Author: Alex Uhlmann
Last Modified: 09/23/05 19:46:30


Summary

Shape class:

- description

Shape Properties:

- lineThickness_def
- lineRGB_def
- lineAlpha_def
- fillRGB_def
- fillAlpha_def
- gradientFillType_def
- gradientColors_def
- gradientAlphas_def
- gradientRatios_def
- gradientMatrix_def


Shape class

version: Documentation not provided.

description:

All drawing classes inside de.alex_uhlmann.animationpackage.drawing inherit their lineStyle and fillStyle properties from Shape. If you don't specify the lineStyle or fillStyle properties either with lineStyle() and fillStyle() methods or directly via the properties, the default lineStyle and fillStyle properties are used. Shape gives you the opportunity to set and retrieve default properties for lineStyle and fillStyle properties. Here is how those default properties are defined by default:

Shape.lineThickness_def = null; Shape.lineRGB_def = 0x000000; Shape.lineAlpha_def = 100; Shape.fillRGB_def = 0x000000; Shape.fillAlpha_def = 100; Shape.gradientFillType_def = null; Shape.gradientColors_def = null; Shape.gradientAlphas_def = null; Shape.gradientRatios_def = null; Shape.gradientMatrix_def = null;
Note that all default properties have the same name as their instance properties but the suffix "_def".

Example 1: (Example .swf) Declare 6 variables to store the three points that define the curve for easy access. To visualize the points and the curve draw it with the classes of the de.alex_uhlmann.animationpackage.drawing package. Then, move the movieclip along the specified curve in 4 seconds using Bounce easing.

var x1:Number = 100; var y1:Number = 100; var x2:Number = 400; var y2:Number = 200; var x3:Number = 500; var y3:Number = 400; var myQuadCurve:QuadCurve = new QuadCurve(x1,y1,x2,y2,x3,y3); myQuadCurve.lineStyle(6); myQuadCurve.draw(); //Since we want to draw three circles with the same style, which is not the default style, it makes sense to define default properties. Shape.lineRGB_def = 0xff0000; Shape.fillRGB_def = 0xff0000; new Ellipse(x1,y1,5,5).draw(); new Ellipse(x2,y2,5,5).draw(); new Ellipse(x3,y3,5,5).draw(); var myMOC:MoveOnQuadCurve = new MoveOnQuadCurve(mc); myMOC.animationStyle(4000,Bounce.easeOut); myMOC.run(x1,y1,x2,y2,x3,y3);

Some classes have similarities to their equivalent in java.awt.geom.

usage:

private class constructor

Shape Properties:

lineThickness_def

(Number)(static) default property. Outline thickness.

lineRGB_def

(Number)(static) default property. Outline color of the drawing as hex number.

lineAlpha_def

(Number)(static) default property. Outline transparency (alpha).

fillRGB_def

(Number)(static) default property. Fill color of the drawing.

fillAlpha_def

(Number)(static) default property. Fill transparency.

gradientFillType_def

(String)(static) Gradient property. See MovieClip.beginGradientFill().

gradientColors_def

(Array)(static) Gradient property. See MovieClip.beginGradientFill().

gradientAlphas_def

(Array)(static) Gradient property. See MovieClip.beginGradientFill().

gradientRatios_def

(Array)(static) Gradient property. See MovieClip.beginGradientFill().

gradientMatrix_def

(Object)(static) Gradient property. See MovieClip.beginGradientFill().




generated with AS2docGenerator beta 0.5.3