Edge.id, Edge.isline – Adobe Extending Flash Professional CS5 User Manual

Page 204

Advertising
background image

182

EXTENDING FLASH PROFESSIONAL

Edge object

Last updated 5/2/2011

Description
Method; returns a

HalfEdge object

.

Example
The following example stores the half edges of the specified edge in the

hEdge0

and

hEdge1

variables:

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

var edge = shape.edges[0];

var hEdge0 = edge.getHalfEdge(0);

var hEdge1 = edge.getHalfEdge(1);

edge.id

Availability
Flash MX 2004.

Usage

edge.id

Description
Read-only property; an integer that represents a unique identifier for the edge.

Example
The following example stores a unique identifier for the specified edge in the

my_shape_id

variable:

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

var my_shape_id = shape.edges[0].id;

edge.isLine

Availability
Flash MX 2004.

Usage

edge.isLine

Description
Read-only property; an integer with a value of 0 or 1. A value of 1 indicates that the edge is a straight line. In that case,
the middle control point bisects the line joining the two end points.

Example
The following example determines whether the specified edge is a straight line and shows a value of 1 (it is a straight
line) or 0 (it isn’t a straight line) in the Output panel:

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

fl.trace(shape.edges[0].isLine);

Advertising
This manual is related to the following products: