Ellipse Documentation
Author: Alex Uhlmann
Last Modified: 09/23/05 19:46:01
Summary
Ellipse class:
Ellipse Properties:
Ellipse Methods:
version: Documentation not provided.
description:
Ellipse is a class for creating circles and ellipses. If you specify a movieclip as first parameter, the shape will be drawn inside this movieclip. If you omit the mc parameter, the class will create a new movieclip in _root.apContainer_mc.
Example 1: draw an ellipse with default parameters. Results in a circle with a radius of 50.
Example 2: (Example .swf) draw an ellipse with custom parameters.var myEllipse:Ellipse = new Ellipse(); myEllipse.draw();
Example 3. (Example .swf) A circle.var myEllipse:Ellipse = new Ellipse(275,200,50,100); myEllipse.lineStyle(3,0xff0000,100); myEllipse.fillStyle(0x000000,100); myEllipse.draw();
var myEllipse:Ellipse = new Ellipse(275,200,100,100); myEllipse.lineStyle(2,0xff0000,100); myEllipse.fillStyle(0x000000,100); myEllipse.draw();
usage:
var myEllipse:Ellipse = new Ellipse();
var myEllipse:Ellipse = new Ellipse(x, y, xradius, yradius);
var myEllipse:Ellipse = new Ellipse(mc, x, y, xradius, yradius);
parameters:
(Number)(static) default property. X radius of ellipse. Defaults to 50.
(Number)(static) default property. Y radius of ellipse. Defaults to 50.
(MovieClip)(read only) Movieclip that contains the drawing.
(Number) Outline thickness.
(Number) Outline color of the drawing as hex number.
(Number) Outline transparency (alpha).
(Number) Fill color of the drawing.
(Number) Fill transparency.
description: Draws ellipses.
usage:
myEllipse.draw();
returns: Void.
description: Draws the shape without clearing the movieclip.
usage:
myInstance.drawBy();
returns: Void.
description: Returns the dimensions of the ellipse.
usage:
myEllipse.getSize();
returns: Object that contains w for with and h for height properties that define the dimension of the drawing in pixels.
description: Sets the dimensions of the ellipse.
usage:
myEllipse.setSize(width, height);
parameters:
returns: Void.
description: define outline.
usage:
myEllipse.lineStyle();
myEllipse.lineStyle(lineThickness, lineRGB, lineAlpha);
parameters:
returns: Void.
description: define fill.
usage:
myEllipse.fillStyle();
myEllipse.fillStyle(fillRGB, fillAlpha);
parameters:
returns: Void.
description: Same interface as MovieClip.beginGradientFill(). See manual.
usage:
myShapeComposite.gradientStyle(fillType, colors, alphas, ratios, matrix);
parameters:
returns: Void.
description: Sets the registration point of the shape. Defaults to center. Top left is 0,0. The parameter object accepts either a position property with the value of "CENTER" or x and y properties of with coordinates as values of the registration point.
Example 1: Set the registration point of an ellipse to the upper left corner (0,0) instead of center.
var myEllipse:Ellipse = new Ellipse(275,200,100,50);
myEllipse.setRegistrationPoint( {x:0,y:0} );
myEllipse.draw();
internally AnimationPackage centers all shapes with
myInstance.setRegistrationPoint( {position:"CENTER"} );
usage:
myInstance.setRegistrationPoint(registrationObj);
parameters:
returns: Void.
description: removes all drawings. Identical to myInstance.movieclip.clear();
usage:
myInstance.clear();
returns: Void.
description: returns a unique ID of the instance. Usefull for associative arrays.
usage: myInstance.getID();
returns: Number
description: returns the name of the class.
usage: myInstance.toString();
returns: String