tags:

views:

176

answers:

1

How to create a polygon in Adobe flex 3.0

+1  A: 

You draw a bunch of lines connecting the points of the polygon.

As a quick example:

function drawPolygon(first, ... rest) {
    graphics.moveTo(first.x, first.y);
    for(var i = 0; i < rest.length; i++) {
        graphics.lineTo(rest[i].x, rest[i].y);
    }
    graphics.lineTo(first.x, first.y);
}

May be some minor syntax errors, but you get the idea. You'd call it by passing a bunch of Point objects indicating the points of the polygon.

Anon.