Path Script Reference

Main Page  |  Script DemosTest Page

Path Methods
slideTo(left,top,speed,"action",resolution adjust)

This method is used to move a layer in a straight line or at an angle.

left and top set where the slide should end.
speed sets the speed of the sliding action.
action specifies the action to be taken.
    If "run" (the default) is used,new Arrays are created and the path is run automatically.
    If "defer" is used,new Arrays are created but the path is not run.
    If "add" is used,the coordinates are added to existing Arrays.
resolution adjust is a boolean value,if set to "true",the speed to be automatically adjusted according to the user's screen resolution.
Returns the calling layer.

makePath("x","y","action")

This method is a manual way to make or add to a path.

x and y are strings of corresponding coordinates.
Each of this coordinates need to be separated by a comma.
action specifies the action to be taken.
The arguments are the same as for the slideTo() method.
Returns the calling layer.

runPath()
Moves the layer along the path.
Returns the calling layer.
reversePath("defer") Reverses the path*.

defer prevents the path from being run automatically.
Returns the calling layer.

stopPath(next function) Stops the layer from proceeding along the path.
next function is a boolean value,if true,calls the layer's onpathend event handler.
Returns the calling layer.
pathPoint(point,"coord") Returns and/or moves the layer to a point along a path.

point is a point along the path of a layer.
If this is an integer or percentage,the layer is moved to that point if the second parameter is not used.
coord can be either "x","y" or "defer".
When used,a coordinate(x or y) of the point specified in the first parameter is returned and no other action is taken.
If this is "defer",the point is returned,no action is taken.
The layer's current path point is returned if no parameters are used.

pathSegment(segment,"moveto") Returns and/or moves a layer to the start of a path segment.

segment is an integer specifying a segment.
moveto can be used to move the layer to the starting point of this segment.
If not used,this point is only returned.

Path Properties
layerObject.onpathend.....event handler which fires when a layer completes a path.
layerObject.pathEndPoint.....sets/returns the last point of a layer's path.
layerObject.pathStopPoint.....sets/returns the stopping point of a layer's path.
layerObject.pathReversed.....returns true if a layer's path is reversed.
layerObject.hasPath.....returns true if a layer has a path assigned to it.
layerObject.pathRunning.....returns true if a layer is moving along its path.
layerObject.pathIntervalSpeed.....sets/returns the interval speed of a layer's path.
lastRunPathLayer.....varible set to the last layer that has run it's path.
* Note: When a path is reversed,the start becomes the end and the end becomes the start.
So if a segment is added,it would be added to the current end of the path.
This would also apply to other modifications to the path.