0

Flash Class | 6 AS3 Classes part 4

Flash Classes, Flash Source, Tutorials

1.ActionScript 3 Arc Drawing Class

seems nowadays that there has been a resurgence of experimentation happening with Flash. Seeing Natzke’s generative art at Flash Forward and checking out Keith’s new book site has gotten me inspired to do more artistic experimentation.

One of the things that I have always wanted to do is to draw perfect arcs using the drawing API. After much research, I happened across this old tutorial on the Adobe site by Ric Ewing. It has a bunch of code samples in ActionScript 1.0 for doing a wide variety of drawing effects. I ported this code into an ActionScript 3.0 class named Arc. It contains a single static method called draw().

I have create a Google Code repository for any classes that write. At the moment it is pretty bare but I will be adding more soon. Check out the code and let me know if you have any questions.

9-1-2008 9-35-33 PM

Read more

2.Animated Bitmap Class

The AnimatedBitmap class provides functionality for Bitmap objects that are animated by using a series of still images. When creating a new AnimatedBitmap you provide a BitmapData object that contains an image that consists of the ’single-frame’ images for the animation.

9-1-2008 9-42-37 PM

Read more

3.ActionScript3 Dice Class

In game development randomness is often necessary for certain tasks, be it the random distribution of graphic tiles, a random factor in NPC AI or random stats in a roleplaying game. Especially for the latter purpose the static Dice class provides a set of methods to roll dice as it is common in a Role-playing game, to be exact four-, six-, eight-, ten-, twelve-, twenty-sided and percentile dice.

9-1-2008 9-44-49 PM

Read more

4.A.S. 3.0 Draw Circle Class — V2

With version 2 of my draw.Circle class, I’ve included gradient control as well as more control on the stroke by adding parameters for pixelHinting, and scaleMode. With these parameters set I can now call my class as follows:

Read more

5.ActionScript 3 MultiMap Class

Recently I needed a HashMap for a project to map key/value pairs but in that particular case the Map required to map not just one but several values to a key. I could have used an array or object to store the values in and map that one but in practice it turned out that accessing the map looked rather messy. It would be much more elegant to have a map to that multiple values can be mapped directly. After some investigation (strangely even Java seems not to have a MultiMap included) I came up with writing my own MultiMap class, so here it is!

Read more

6.AS3 Perlin Noise Ripples

Using the same logic from my wave machine, I reworked the code to make an AS3 version. What I learned is that there isn’t really any difference with the perlinNoise method from AS2 to AS3. The perlinNoise Method is constructed as follows:

9-1-2008 9-49-56 PM

Read more

  • Share/Bookmark
 

Story by admin

Tags: , , , , , , , ,

Leave a Comment

Banner Banner