Using Actionscript 3 Dawing API to create a circular band (not a basic circle)

Explorer ,
Apr 04, 2021 Apr 04, 2021

Copy link to clipboard

Copied

Can someone show me the script (or method) for producing circular bands in AS3?

Views

38

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 05, 2021 Apr 05, 2021

Copy link to clipboard

Copied

Hi.

 

You can create a shape instance, draw 3 strokes in sequence, and then add the shape to the display list. Like this:

import flash.display.Shape;

var strokeColor:uint = 0x000000;
var strokeColor1:uint = 0xA6A6A6;
var shape:Shape = new Shape();

// inner stroke
shape.graphics.lineStyle(2, strokeColor);
shape.graphics.drawCircle(0, 0, 120);
shape.graphics.endFill();

// middle stroke
shape.graphics.lineStyle(34, strokeColor1);
shape.graphics.drawCircle(0, 0, 138);
shape.graphics.endFill();

// outer stroke
shape.graphics.lineStyle(2, strokeColor);
shape.graphics.drawCircle(0, 0, 156);
shape.graphics.endFill();

shape.x = stage.stageWidth * 0.5;
shape.y = stage.stageHeight * 0.5;

addChild(shape);

 

I hope it helps.

 

Regards,

JC

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines