Packagecom.boostworthy.geom
Classpublic class Path
ImplementsIDisposable

The 'Path' class stores a collection of path segments, thus forming a path.



Public Properties
 PropertyDefined by
  end : Point
[read-only] Gets the end point of the path.
Path
  start : Point
[read-only] Gets the starting point of the path.
Path
Protected Properties
 PropertyDefined by
  m_aSegments : Array
An array for storing path segments that form this path.
Path
  m_objLocation : Point
Stores a coordinate of the current location inside this path.
Path
Public Methods
 MethodDefined by
  
Path()
Constructor.
Path
  
clear():void
Clears the data being stored by this object.
Path
  
curveTo(nControlX:Number, nControlY:Number, nX:Number, nY:Number):void
Creates a curve from the current location to the specified coordinate.
Path
  
dispose():void
Performs any appropriate clean-up tasks for garbage collection such as removing event listeners, setting object references to 'null', etc.
Path
  
draw(objGraphics:Graphics):void
Uses the data stored by this object to draw a path into the specified graphics object.
Path
  
getAngleAt(nPosition:Number):Number
Gets the angle of a position along this path using a float value of '0.0' to '1.0' where '0.0' is the start of the path and '1.0' is the end of the path.
Path
  
getPointAt(nPosition:Number):Point
Gets the coordinate of a position along this path using a float value of '0.0' to '1.0' where '0.0' is the start of the path and '1.0' is the end of the path.
Path
  
lineTo(nX:Number, nY:Number):void
Creates a line from the current location to the specified coordinate.
Path
  
moveTo(nX:Number, nY:Number):void
Moves the current location to the specified coordinate.
Path
  
reset():void
Resets and clears this object back to new.
Path
Protected Methods
 MethodDefined by
  
addSegment(objSegment:IPathSegment):void
Adds a new segment to this path.
Path
  
init():void
Initializes this object.
Path
Property detail
endproperty
end:Point  [read-only]

Gets the end point of the path.

Implementation
    public function get end():Point
m_aSegmentsproperty 
protected var m_aSegments:Array

An array for storing path segments that form this path.

m_objLocationproperty 
protected var m_objLocation:Point

Stores a coordinate of the current location inside this path.

startproperty 
start:Point  [read-only]

Gets the starting point of the path.

Implementation
    public function get start():Point
Constructor detail
Path()constructor
public function Path()

Constructor.

Method detail
addSegment()method
protected function addSegment(objSegment:IPathSegment):void

Adds a new segment to this path.

Parameters
objSegment:IPathSegment — The segment to add to this path.
clear()method 
public function clear():void

Clears the data being stored by this object.

curveTo()method 
public function curveTo(nControlX:Number, nControlY:Number, nX:Number, nY:Number):void

Creates a curve from the current location to the specified coordinate. The current location picks up from wherever the last segment ended or can be set manually using the 'MoveTo' method.

Parameters
nControlX:Number — The 'x' position for the control point.
 
nControlY:Number — The 'y' position for the control point.
 
nX:Number — The 'x' position for the curve to end at.
 
nY:Number — The 'y' position for the curve to end at.

See also

dispose()method 
public function dispose():void

Performs any appropriate clean-up tasks for garbage collection such as removing event listeners, setting object references to 'null', etc.

draw()method 
public function draw(objGraphics:Graphics):void

Uses the data stored by this object to draw a path into the specified graphics object.

Parameters
objGraphics:Graphics — The graphics object to draw the path into.
getAngleAt()method 
public function getAngleAt(nPosition:Number):Number

Gets the angle of a position along this path using a float value of '0.0' to '1.0' where '0.0' is the start of the path and '1.0' is the end of the path.

Parameters
nPosition:Number — The position along this path (0.0 to 1.0) to get the angle from.

Returns
Number — The angle of the path at the specified position.
getPointAt()method 
public function getPointAt(nPosition:Number):Point

Gets the coordinate of a position along this path using a float value of '0.0' to '1.0' where '0.0' is the start of the path and '1.0' is the end of the path.

Parameters
nPosition:Number — The position along this path (0.0 to 1.0) to get a coordinate from.

Returns
Point — The coordinate at the specified position.
init()method 
protected function init():void

Initializes this object.

lineTo()method 
public function lineTo(nX:Number, nY:Number):void

Creates a line from the current location to the specified coordinate. The current location picks up from wherever the last segment ended or can be set manually using the 'MoveTo' method.

Parameters
nX:Number — The 'x' position for the line to end at.
 
nY:Number — The 'y' position for the line to end at.

See also

moveTo()method 
public function moveTo(nX:Number, nY:Number):void

Moves the current location to the specified coordinate. This location represents the starting point segments and gets updated each time a new segment is added.

Parameters
nX:Number — The 'x' position to move to.
 
nY:Number — The 'y' position to move to.
reset()method 
public function reset():void

Resets and clears this object back to new.