user5870211
user5870211

Reputation: 103

draw lines between 2 points with AS3 code

I'd like to join multiple points with a line by clicking on them with AS3 code. Each time you click on a button it creates a line with a number.

I've created an animation in order to explain what I'd like to do. Here : Video link

What's your advice on the matter ?

I don't know the best method to do that. graphics.lineStyle ?

And which method can I use to count the number (first line created = 1, second line = 2 ..etc)

Upvotes: 0

Views: 1389

Answers (1)

Aktash
Aktash

Reputation: 56

Create shape first and draw it inside. Use graphics.moveTo(x, y) for setting the first point, and graphics.lineTo(x, y) for setting the second point. But use graphics.lineStyle(thickness, color) before it. Look for example here.

Upvotes: 1

Related Questions