Articles Tagged "Draw"

Drawing a Closed Arc Shape

This tutorial provides the ActionScript needed to draw a “Closed Arc” which is my way of describing the solid shape created by connecting a pair of concentric arcs with 2 straight lines. Here’s an illustration to explain:

(If you’re new to drawing arcs I suggest reading my previous circle and arc tutorials for an introduction to trigonometry in Flash.)

In my standard arc drawing tutorial I explained the following ActionScript code
Read More

Flash Scripted Conic Angle Gradient

One of the quirkier aspects of Flash is its lack of a 'conic' gradient fill. The conic gradient has been a mainstay of drawing apps like CorelDraw and Photoshop (where it's called an "Angle Gradient") for ages but Flash still hasn't implemented this basic feature. Go ahead and check... it's not there.

NOTE: This tutorial uses some of the code and concepts from my previous Color Gradient and Circle Drawing tutorials so I highly recommend checking them out for a more in-depth explanation of the following code ...
Read More

Animated Arc Drawing

A recent comment on my Oval Drawing Tutorial asks how to “give the appearance that an oval is being drawn slowly”. Hmmm… this sounds like a job for my handy Arc Drawing Function.

Slowly drawing (or revealing) a circle can be achieved by drawing arcs of an ever-increasing size until the arc is so big that it comes back to the beginning and makes a full circle. The same is true with ovals. First let’s take a look at the basic code for drawing an arc of a circle
Read More

Elegant Ellipses

While researching how to draw rotated ovals I learned some interesting facts about ellipses and thought I’d share them with you:

  • Ellipse Definition: There are many ways to say it, but essentially an ellipse is just a circle stretched along one axis. Think, “smushed penny on a train track” or if you want to get technical about it you could say, “an ellipse is formed by a locus of points in a plane such that the sum of the distances to two fixed points is a constant.” Which means…
  • One way to draw an ellipse is to:
    Read More

Rotated Oval Tutorial

rotated oval

Making the transition from drawing circles to drawing ovals is pretty simple but when you need to go from drawing ovals to drawing rotated ovals, you might run into a few problems. This article documents some of the pitfalls I encountered and presents them as a learning experience. If you just want some solid code to draw rotated ovals or twisted ellipses, skip ahead to the end of the article and copy the last block of code. If you think you might gain from my experience then by all means… read on.
Read More

How to Draw an Oval

Drawing an oval or ellipse is about as easy as drawing a circle with ActionScript. When drawing a circle you only need one measurement for the circle’s radius but when drawing an oval you need to provide 2. One for the Width of the oval and one for its Height. But before I get too far ahead, let’s take a look at the basic circle drawing code used to draw a simple circle
Read More

Hexadecimal Color Fading Array

A while ago I wrote a Hexadecimal Color Fading Tutorial explaining how to select a single color at any point on a gradient between two specified colors. In that tutorial there was a function which efficiently broke each of the 2 specified colors into their Red, Green and Blue components and then calculated a single new color at a specified point between them.

Here's what the code looks like: ...
Read More

© Sean O'Shell 2007-2024