Tutorials Books Videos Forums

-- online Change the theme! Search!
Rambo ftw!

Customize Theme


Color

Background


Done

Drawing using Code

by kirupa   | filed under Flash and ActionScript

This is an archived tutorial from the kirupa.com legacy collection. It covers software that may no longer be available, but it is kept online because the ideas still hold up.

Flash has always provided a graphical way of drawing shapes and lines. But, did you know that you can re-create much of the drawing functions using code itself? In this short article I will explain more about how to use the drawing classes to easily draw circles and rectangles easily.

Note

This tutorial is meant to be a revised version of the tutorial created by Ilyas for Flash MX.

First, let's start really simple and re-create the commonly used Rectangle and Circle shapes.

Drawing a Rectangle

The code for drawing a rectangle is provided below:

Just a final word before we wrap up. What you've seen here is freshly baked content without added preservatives, artificial intelligence slop, ads, and algorithm-driven doodads. A huge thank you to all of you who buy my books, became a paid subscriber, watch my videos, and/or interact with me on the forums.

Your support keeps this site going! 😇

Kirupa's signature!

The KIRUPA Newsletter

Thought provoking content that lives at the intersection of design 🎨, development 🤖, and business 💰 - delivered weekly to over a bazillion subscribers!

SUBSCRIBE NOW

Creating engaging and entertaining content for designers and developers since 1998.

Follow:

Popular

Loose Ends

:: Copyright KIRUPA 2026 //--