In my previous post AS3 Classes Roundup Part 1 you see a lot of AS3 Classes and this post collects 14 useful as3 classes
1.Actionscript 3 FrameRater Class
In my previous post you may have noticed the little frame rate meter in the top left corner.
Somebody just asked me to post this simple but very useful class.
2.Actionscript 3 - PixelMorphing class first test (morphing with particles)
I am back after some pause with this interesting effect. This class takes every pixel from two pictures, sort them by averaged luminosity e reconstruct the second picture animating pixels from the first one.
The effect is a very nice pixel morphing (particles morphing) and the final result resambles some color ramp recolor tecnique.
This is the second algorythm I wrote. The first one was build to do the calculation about moving pixels and then draw the full picture parsing the full array of pixels. The bigger problem in the first one was speed of execution.
The setPixel method of the BitmapData class is far too slow for this kind of effect and even slower was the parsing every frame of the full array containing all the pixel of the first image.
3.Actionscript particles - Fountain equalizer
Here’s a new experiment.
It uses the computeSpectrum method together with a simple particles class i wrote.
I think the effect is graphically very satisfing and personally cannot stop to look at it.
The song is “Aria regina della notte” from Mozart’s “Flauto Magico”.
Tomorrow I’ll post code and sources of this.
Hope you’ll be hypnothized from this as I am.
4.Asciify - Actionscript 3 (as3) Ascii Art class
There are trends on the web (as in real world) that last days or weeks and there are things that became a classic form of expression of the geek culture and are still interesting to explore after 20+ years.
Ascii Art is one of these things. If you don’t know what ascii art is you’re probably reading the wrong blog, however for the one or two that doesn’t know about it, here you can learn more about it: Ascii art on wikipedia.
I always had in mind the idea to create an actionscript class to render ascii art from pictures and now with as3 this is going to be possible at decent speed.
5.Actionscript 3 - Fun with isometrics
Hi there,
back again with some funny isoStuff.
Here’s an optimized and enhanced version of the previous post, and with source code explained.
It now has dynamic colors and you can choose colors and size (for hi and low values).
6.New ImageProcessing Library Version
There is a new release of the ImageProcessing Library out for you people. I do not have that much time to spend but I hope that this is a helpful library and will even grow a lot.
Here is a small changelog:
- Publish class util to send images in an easy way to sockets or websites
- Format exporter (PNG, JPEG)
- New core class for multiple layers
- ToneMapping filter
- Noise filters (GaussianNoise, UniformNoise, PerlinNoise)
- Drawing util
7.AS3 - URL Class
I could not find it in the net so I hacked something together quickly. A simple URL class that parses an url string.
8.Easy to use XML Feed Class
This tip will help you create an easy to use, re-usable class that will set up an external XML feed to use E4X, datagrids, etc. I didn’t change any variable names from my working code, so feel free to change them as needed as the variable names don’t relate to any particular thing…
10.AS3: Learn how to create a re-usable class
One thing that I found hard, being a designer turn developer turn pseudo programmer, was understanding how packages, classes, and overall re-usable code is handled. Once it clicked with me then I was off and running, but every example that I found was so complex or a small part of a larger project. What I am presenting below is a simple walk through of how to create a very simple package, and use it passing arguments.
You will need 3 files, newBox.fla, newBox.as, and setNewBox.as. Feel free to use any name for this, but it will be easier to follow along if you name them as I have. To start off, set your document class in the newBox.fla file. I have named my document class newBox.as. That is all you need to do in the .fla, no “frame coding” going on here…
Our constructor function, or the function that gets called in when you assign a document class…is then created as follows:
11.Alternate row colors on dynamic movieclips
Below is an example of how to dynamically change the row color of generated movieclips. I find this helpfu when making grid based layouts, buttons, etc. You can have an unlimited amount of row colors by adding to the two if/then statements. Also, you can make this class re-usable by simply adding variables in the public function, passing them into the constructor method from your main fla movieclip instantiation. I try to keep all variables outside the main constructor, or at least in a single area, to help maintain the code and keep it cleaner.
12.Homegrown particles
First off, I will say that without Matthew Tretter’s garbage collection classes this demo would not be possible…While generating this many “particles” on ENTER_FRAME, the Flash Player can not keep up (or wouldn’t in my case), with the 3 tweens on X, Y, and alpha.
After saying that…here is a demo that I came up with tonight playing around in Flash and practicing some rapid development prototyping. It is a “particle” generator (that’s what I am calling it) using the display class, randomly positioning X and Y, as well as tweening the alpha channel.
13.Make your own reusable classes using Flash and AS3
Let’s suppose that in your programming experience, you know how to make a Movie Clip draggable with the mouse, and you also know how to write a routine to make a MovieClip respond to the arrow keys and move around the stage. Let’s further suppose that you’ve done both of those tasks many times, and you get to thinking “Wouldn’t it be great if I could just write one routine for each task, and then just apply it to future Movie Clips at will?” Enter reusable Classes!
14.Create a Quiz Application Using AS3 Classes
This article will demonstrate how to build a simple Flash quiz application using Classes. Each step, from concept to finished product, will be explained in detail. The finished application will run the user through a series of multiple choice questions. It will provide forward and back buttons to navigate to the previous or next question. When all of the questions have been answered, the application will compute the user’s score.

Recent Comments