flash.display

# GraphicsPath - AS3

Package | flash.display
Class | public final class GraphicsPath
Inheritance | GraphicsPath Object
Implements | IGraphicsPath, IGraphicsData

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

A collection of drawing commands and the coordinate parameters for those commands.

Use a GraphicsPath object with the `Graphics.drawGraphicsData()` method. Drawing a GraphicsPath object is the equivalent of calling the `Graphics.drawPath()` method.

The GraphicsPath class also has its own set of methods (`curveTo()`, `lineTo()`, `moveTo()` `wideLineTo()` and `wideMoveTo()`) similar to those in the Graphics class for making adjustments to the `GraphicsPath.commands` and `GraphicsPath.data` vector arrays.

Related API Elements

flash.display.Graphics.drawGraphicsData()
flash.display.Graphics.drawPath()

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | commands : Vector.<int> The Vector of drawing commands as integers representing the path. | GraphicsPath
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object
|  | data : Vector.<Number> The Vector of Numbers containing the parameters used with the drawing commands. | GraphicsPath
|  | winding : String Specifies the winding rule using a value defined in the GraphicsPathWinding class. | GraphicsPath

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | GraphicsPath(commands:Vector.<int> = null, data:Vector.<Number> = null, winding:String = "evenOdd") Creates a new GraphicsPath object. | GraphicsPath
|  | cubicCurveTo(controlX1:Number, controlY1:Number, controlX2:Number, controlY2:Number, anchorX:Number, anchorY:Number):void Adds a new "cubicCurveTo" command to the commands vector and new coordinates to the data vector. | GraphicsPath
|  | curveTo(controlX:Number, controlY:Number, anchorX:Number, anchorY:Number):void Adds a new "curveTo" command to the commands vector and new coordinates to the data vector. | GraphicsPath
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | lineTo(x:Number, y:Number):void Adds a new "lineTo" command to the commands vector and new coordinates to the data vector. | GraphicsPath
|  | moveTo(x:Number, y:Number):void Adds a new "moveTo" command to the commands vector and new coordinates to the data vector. | GraphicsPath
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object Returns the primitive value of the specified object. | Object
|  | wideLineTo(x:Number, y:Number):void Adds a new "wideLineTo" command to the commands vector and new coordinates to the data vector. | GraphicsPath
|  | wideMoveTo(x:Number, y:Number):void Adds a new "wideMoveTo" command to the commands vector and new coordinates to the data vector. | GraphicsPath

Property Detail

### commands

property

`public var commands:Vector.<int>`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

The Vector of drawing commands as integers representing the path. Each command can be one of the values defined by the GraphicsPathCommand class.

Related API Elements

flash.display.GraphicsPathCommand

### data

property

`public var data:Vector.<Number>`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

The Vector of Numbers containing the parameters used with the drawing commands.

### winding

property

`winding:String`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Specifies the winding rule using a value defined in the GraphicsPathWinding class.

Implementation
`public function get winding():String`
`public function set winding(value:String):void`

Related API Elements

flash.display.GraphicsPathWinding
Constructor Detail

### GraphicsPath

()
Constructor

`public function GraphicsPath(commands:Vector.<int> = null, data:Vector.<Number> = null, winding:String = "evenOdd")`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Creates a new GraphicsPath object.

Parameters

| `commands:Vector.<int>` (default = `null`)`` — A Vector of integers representing commands defined by the GraphicsPathCommand class.
| `data:Vector.<Number>` (default = `null`)`` — A Vector of Numbers where each pair of numbers is treated as a point (an x, y pair).
| `winding:String` (default = "`evenOdd`")`` — Specifies the winding rule using a value defined in the GraphicsPathWinding class.

Related API Elements

flash.display.GraphicsPathCommand
flash.display.GraphicsPathWinding
Method Detail

### cubicCurveTo

()
method

`public function cubicCurveTo(controlX1:Number, controlY1:Number, controlX2:Number, controlY2:Number, anchorX:Number, anchorY:Number):void`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 12, AIR 3.0

Adds a new "cubicCurveTo" command to the `commands` vector and new coordinates to the `data` vector.

Parameters

| `controlX1:Number` — A number that specifies the horizontal position of the first control point relative to the registration point of the parent display object.
| `controlY1:Number` — A number that specifies the vertical position of the first control point relative to the registration point of the parent display object.
| `controlX2:Number` — A number that specifies the horizontal position of the second control point relative to the registration point of the parent display object.
| `controlY2:Number` — A number that specifies the vertical position of the second control point relative to the registration point of the parent display object.
| `anchorX:Number` — A number that specifies the horizontal position of the next anchor point relative to the registration point of the parent display object.
| `anchorY:Number` — A number that specifies the vertical position of the next anchor point relative to the registration point of the parent display object.

Related API Elements

flash.display.GraphicsPathCommand.CUBIC_CURVE_TO
flash.display.Graphics.curveTo()

### curveTo

()
method

`public function curveTo(controlX:Number, controlY:Number, anchorX:Number, anchorY:Number):void`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Adds a new "curveTo" command to the `commands` vector and new coordinates to the `data` vector.

Parameters

| `controlX:Number` — A number that specifies the horizontal position of the control point relative to the registration point of the parent display object.
| `controlY:Number` — A number that specifies the vertical position of the control point relative to the registration point of the parent display object.
| `anchorX:Number` — A number that specifies the horizontal position of the next anchor point relative to the registration point of the parent display object.
| `anchorY:Number` — A number that specifies the vertical position of the next anchor point relative to the registration point of the parent display object.

Related API Elements

flash.display.GraphicsPathCommand.CURVE_TO
flash.display.Graphics.curveTo()

### lineTo

()
method

`public function lineTo(x:Number, y:Number):void`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Adds a new "lineTo" command to the `commands` vector and new coordinates to the `data` vector.

Parameters

| `x:Number` — The x coordinate of the destination point for the line.
| `y:Number` — The y coordinate of the destination point for the line.

Related API Elements

flash.display.GraphicsPathCommand.LINE_TO
flash.display.Graphics.lineTo()

### moveTo

()
method

`public function moveTo(x:Number, y:Number):void`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Adds a new "moveTo" command to the `commands` vector and new coordinates to the `data` vector.

Parameters

| `x:Number` — The x coordinate of the destination point.
| `y:Number` — The y coordinate of the destination point.

Related API Elements

flash.display.GraphicsPathCommand.MOVE_TO
flash.display.Graphics.moveTo()

### wideLineTo

()
method

`public function wideLineTo(x:Number, y:Number):void`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Adds a new "wideLineTo" command to the `commands` vector and new coordinates to the `data` vector.

Parameters

| `x:Number` — The x-coordinate of the destination point for the line.
| `y:Number` — The y-coordinate of the destination point for the line.

Related API Elements

flash.display.GraphicsPathCommand.WIDE_LINE_TO

### wideMoveTo

()
method

`public function wideMoveTo(x:Number, y:Number):void`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Adds a new "wideMoveTo" command to the `commands` vector and new coordinates to the `data` vector.

Parameters

| `x:Number` — The x-coordinate of the destination point.
| `y:Number` — The y-coordinate of the destination point.

Related API Elements

flash.display.GraphicsPathCommand.WIDE_MOVE_TO

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00