answersLogoWhite

0

How do you draw a circle in Action Script 2.0?

Updated: 12/11/2022
User Avatar

Sannsoft

Lvl 1
13y ago

Best Answer

Dear student

  1. Create a new Flash document and save as circle2.fla.
  2. Add the following ActionScript code to Frame 1 of the Timeline: this.createEmptyMovieClip("circle_mc", 10);

    circle_mc._x = 100;

    circle_mc._y = 100;

    drawCircle(circle_mc, 100, 0x99FF00, 100);

    function drawCircle(target_mc:MovieClip, radius:Number, fillColor:Number, fillAlpha:Number):Void {

    var x:Number = radius;

    var y:Number = radius;

    with (target_mc) {

    beginFill(fillColor, fillAlpha);

    moveTo(x + radius, y);

    curveTo(radius + x, Math.tan(Math.PI / 8) * radius + y, Math.sin(Math.PI / 4) * radius + x, Math.sin(Math.PI / 4) * radius + y);

    curveTo(Math.tan(Math.PI / 8) * radius + x, radius + y, x, radius + y);

    curveTo(-Math.tan(Math.PI / 8) * radius + x, radius+ y, -Math.sin(Math.PI / 4) * radius + x, Math.sin(Math.PI / 4) * radius + y);

    curveTo(-radius + x, Math.tan(Math.PI / 8) * radius + y, -radius + x, y);

    curveTo(-radius + x, -Math.tan(Math.PI / 8) * radius + y, -Math.sin(Math.PI / 4) * radius + x, -Math.sin(Math.PI / 4) * radius + y);

    curveTo(-Math.tan(Math.PI / 8) * radius + x, -radius + y, x, -radius + y);

    curveTo(Math.tan(Math.PI / 8) * radius + x, -radius + y, Math.sin(Math.PI / 4) * radius + x, -Math.sin(Math.PI / 4) * radius + y);

    curveTo(radius + x, -Math.tan(Math.PI / 8) * radius + y, radius + x, y);

    endFill();

    }

    }

Santosh Kumar Jha

9868012495

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you draw a circle in Action Script 2.0?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can you draw a circle with an area of 20?

Yes


How do you draw and cut a 20 foot x 12 foot circle on wood for commercial ceiling?

use a compash


Is it possible to draw a triangle with 150 20 and 20?

is it possible to draw a triangle with angles 150 20 and 20°


What is the fraction of 20 degrees?

20 degrees is 20/360 = 1/18 of a circle.20 degrees is 20/360 = 1/18 of a circle.20 degrees is 20/360 = 1/18 of a circle.20 degrees is 20/360 = 1/18 of a circle.


What is the circumference of a circle with a 20' diameter?

Circumference of the circle is: pi*20'


Are two 10 inch pizzas the same as 20 inch?

No Draw a circle that is 20 inches across - yes two 10 inch would fit side by side - But there would be a gap above and below


What is the square foot of a circle that is 20 foot?

If the circle is 20 ft radius, the area is π·20² = 1256.637 ft² If the circle is 20 ft diameter, the area is π·(20/2)² = 314.1593 ft² If the circle is 20 ft circumference, the are is π·(20/2π)² = 63.66198 ft²


What fraction of a circle is 20 degrees?

A circle has 360 degrees. Hence 20 degrees is 20/360 = 2/36 = 1/18 part of a circle.


When was For the First Time - The Script song - created?

For the First Time - The Script song - was created on 2010-08-20.


What is the area of circle with a circumference of 20?

The area of circle with a circumference of 20 is: 31.83 units squared.


What is the diameter of a circle whose radius is 10?

20; the diameter of a circle is twice its radius.


How do you graph a circle with these numbers 10 20 30 and 40?

without coordinates, like (10,2), (20,7) ETC there would be an infinite number of circles you can draw. Pick any radius greater than or equal to 15, (40-10)/2 and go to any point on the vertical line x = 25, (40 + 10) /2 then draw the circle.