beautypg.com

Shape.getcubicsegmentpoints() – Adobe Extending Flash Professional CS5 User Manual

Page 405

background image

383

EXTENDING FLASH PROFESSIONAL

Shape object

Last updated 5/2/2011

Parameters
None.

Returns
Nothing.

Description
Method; defines the end of an edit session for the shape. All changes made to the Shape object or any of its subordinate
parts will be applied to the shape. You must use this method after issuing any commands that change the Shape object
or any of its subordinate parts.

Example
The following example takes the currently selected shape and removes the first edge in the edge array from it:

var shape = fl.getDocumentDOM().selection[0];

shape.beginEdit();

shape.deleteEdge(0);

shape.endEdit();

shape.getCubicSegmentPoints()

Availability
Flash CS4 Professional.

Usage

shape.getCubicSegmentPoints(cubicSegmentIndex)

Parameters

cubicSegmentIndex

An integer that specifies the cubic segment for which points are returned.

Returns
An array of points that define a cubic curve for the Edge object that corresponds to the specified cubicSegmentIndex
(see

edge.cubicSegmentIndex

).

Description
Method; returns an array of points that define a cubic curve.

Example
The following example displays the x and y values for each point on the cubic curve of the first edge of the selection:

var elem = fl.getDocumentDOM().selection[0];
var index = elem.edges[0].cubicSegmentIndex;
var cubicPoints = elem.getCubicSegmentPoints(index);
for (i=0; i

fl.trace("index " + i +" x: " + cubicPoints[i].x + " y: " + cubicPoints[i].y);

}

This manual is related to the following products: