Advanced & Experimental - AS3
Perlin Lines - A Generative Art Effect in AS3 Flash
We present two versions of Flash art which is based on a simple principle: allowing lines to be traced out
on a Bitmap with changing directions determined by an invisible Perlin noise BitmapData. The examples include
grayscale and a colorized version. The results are highly aesthetic. The images can be saved due to our custom
and easy to reuse BitmapSaver class.
AS3 MarbleTexture Class - Apply
Marble Texture to Any Display Object
Another example of a texture created completely from code. Our custom MarbleTexture AS3 class creates
a marble-textured Sprite with the same shape and mouse interactivity as any source Sprite that you pass to
the constructor. The texture is created with BitmapData methods perlinNoise and copyChannel, along with
DisplacementMapFilter and ColorMatrixFilter. Choose pink, blue or white marble.
Browser Version of PeekAMaze Game in AS3 Flash
We present a desktop version of our free PeekAMaze app that is currently available for Android
phones on the Android Market. The version given here runs in a standard browser window.
The complete source code for the game is provided, including custom AS3 classes that randomly create
perfect mazes and their graphical representation.
Custom AS3 WoodTexture Class - Apply Wood
Texture to Any Display Object
We present a custom AS3 WoodTexture class for creating wood-textured display objects completely from code.
The class creates a Sprite with the same shape and mouse interactivity as any source Sprite that you pass
to the constructor. The very realistic texture is created with a combination of BitmapData methods: perlinNoise,
paletteMap, and copyChannel. Download all Flash and AS3 source code files.
Traffic Lights Game in AS3 Flash
A very challenging game which is a variation and extension of the classic "Lights Out"
puzzle. The goal of the game is to click on the lights until you can get them all to be green.
Clicking on a light will change its color, but also the color of all of the neighbor
lights attached to it. The light colors cycle through green, yellow, and red,
just like a traffic light. The puzzles are made from a grid of lights
(of varying sizes depending on the settings) which are connected in randomized configurations.
Rolling Cubes 3D Puzzle in AS3 Flash - Browser Version
Recently, we published at the Andorid Market an app which is a 3D rendition
in AIR of the Rolling Cubes puzzle. Here, we present a web-based version of the
puzzle so you can play this very challenging and interesting game on your
computer. We provide and discuss complete AS3 source code.
RGB Sinks and Springs - Interactive Particle
Effect in AS3 Flash
A new fun particle effect: RGB sinks and springs. Motion of bitmap particles is determined by their RGB components
and their proximity to color 'sinks'. Each red, green and blue sink flies by itself or can be dragged by hand. It attracts
and repels particles based on their color components. Invisible 'springs' pull the particles back to their original
positions. You can experiment with 'sinks' and 'springs' settings and create a multitude of dynamic particle effects.
Tweening Tile Image Gallery in AS3 Flash
We present an original photo gallery with a bounce. The fun feature of this gallery lies in
the way the thumbnails transition to a larger image: the image is loaded into pieces onto the thumbnail rectangles,
which then 'snap' together with a tween to form the larger image. The gallery is easily customizable via an XML file.
We include several custom AS3 classes that make bulding XML-driven 2D and 3D galleries easy.
Perfect Maze Puzzle in AS3 Flash, Random Maze Generator
Maze puzzles are easy to create. We provide custom AS3 classes that randomly generate
and render the so called perfect mazes; that is, mazes that have exactly one solution. At a click of
a button you can switch from simple examples to very complex ones. We use an implementation
of the classic maze-generating algorithm called recursive backtracker.
Sketching Derivatives Applet in AS3 Flash - The Code
We present a math applet for sketching derivatives with complete AS3 source code.
The applet uses a large collection of custom AS3 classes developed by the Flash and Math team
over the past few years. The newest of the classes are related to an interesting drawing
and smoothing techinique. The user draws by dragging and shaping a curve.
Mandelbrot Plotter - Generate and Export
Beautiful Fractal Images in Flash
We present a major Flash project for your enjoyment! This Flash-based Mandelbrot Plotter
allows you to create and save beautiful fractal images. The application is full of zooming
and coloring features which give you a great amount of control over your images. The images
can be large and can be saved in JPEG or PNG formats.
AS3 Flash: Stanford Bunny and New
Collection of 3D Particle Surfaces
We’ve been having a lot of fun here at flashandmath with surfaces made of particles.
So we present the Stanford Bunny and other new beautiful surfaces with modification
of earlier effects, a significant optimization of the code, and a simple z-sorting
method. The optimized code allows for revolving in 3D over 200,000 particles.
100,000 Glowing 3D Particles
Run Smoothly in Flash Player 10.1
More examples of our popular 'particles made of light'. New
surfaces, more particles, new effects, and a custom performance
monitor. We discovered great performance improvement in FP 10.1 v. FP 10. Awesome!
AS3 Flash CS4: Create and Save Beautiful
Images of Math Curves
In this effect, we use families of planar curves to create and save interesting images.
We show how to draw a DisplayObject to a BitmapData via BitmapData.draw
and how to save an image from SWF via FileReference.save method.
The latter method is new to Flash Player 10.
3D Particles Made of Light - AS3 Dynamic Flash Effect
Thousands of particles which appear to be made of light form beautiful
revolving surfaces in 3D space. We use an additive luminescent effect
which creates brighter spots where particles are more concentrated.
We present four examples with variations in color and filter effects.
Astronaut - 3D Particle Effect in AS3 Flash CS4
We present a new 3D particle effect: Astronaut. We animate
15,000 particles and the principles that govern motion of particles
are different from those in Kepler's Supernova and our other popular
3D Display Cube with a
Versatile Custom AS3 Class in Flash CS4
Each instance of the DisplayCube class accepts any DisplayObjects
as sides, it revolves in 3D, its sides respond to clicks. Moreover, the cube
drops shadow in 3D! We show an application with three Bitmap cube menus
that drop dynamic shadows on the floor beneath as they rotate. We use
simple FP10 3D methods.
Perlin Particle Storm - A Turbulent Display of Thousands
of Particles in AS3 Flash
Enjoy a spectacular particle storm! In this experiment we use a bitmap filled with Perlin noise to create
an acceleration field. The field controls the motion of thousands of particles creating a turbulent,
dramatic effect. We use filters and color transforms to obtain the effect
of fading trails behind the churning particles, which change color over time.
A Smooth and Responsive Drawing Application in AS3 Flash
We present a drawing application which allows you to create smooth and dynamic lines with
a very responsive feel. The lines change thickness and color depending on how fast you move your mouse.
The overall effect is somewhat like drawing with thick markers or paint.
A Retro TV Effect for Video and Other
Dynamic Objects in AS3 and Flash CS4
We present a custom AS3 class, RetroTV, that easily converts any DisplayObject,
(possibly combined of Sprites, Video, Shapes, TextFields), to a retro television
display. The display is complete with lines, noise, and distortion. The television
image is updated continuously in real time to reflect changes of the object
on the TV display.
RGB Cube to HSV Cone - Flash AS3 Interactive 3D Demonstration
We present an interactive 3D particle animation which demonstrates the relationship between the red, green, blue (RGB)
color model and the hue, saturation, value (HSV) model. The former is best visualized on a cube, the latter on a cone.
Rotate and move the RGB cube in 3D, have it morph into the HSV cone and back.
A Dramatic 3D Photo Gallery in AS3 Flash CS4
XML-customizable, versatile gallery on a rotating 3D cylinder viewed from the
outside. The tutorial includes many useful custom AS3 classes: multiple image
loader, a preloader and more.
Realistic 3D Snowfall Effect in ActionScript 3 and Flash
We present a custom AS3 SnowDisplay class which can be used to create a variety of
realistic 3D snow animations that include turbulence and wind effects.
You can superimpose the animated snow over your image. You can create two instances of the class
with small flakes and larger flakes, and place your graphics in between the instances creating an incredibly
real-looking effect. We use Perlin noise, the parallax effect, particle techniques, and physical
3D Cylindrical Photo Gallery in AS3 Flash - Revolves Around You
The most spectacular of our 3D galleries yet! A cylindrical
3D gallery that can be fully customized via editing of a simple XML file.
Sit in the center of the cylinder and watch the images revolve around you.
The application uses native 3D methods of Flash Player 10.
Multicolored Version of 3D Spotlight and Shadow Flash Effect
In our recent tutorial (Intermediate Section) we showed how to create a 3D moving spotlight
and shadow effect. Our technique of 2D masking and filtering allowed
for illuminatig monochrome objects. Here we show how, via additional
masking and blend mode tricks, the method can be extended to multicolored
Waterfall Flash Effect - A Custom AS3 Waterfall Class
We present a particle effect of a spectacular, dynamic waterfall.
By manipulating parameters, you can easily customize the look and the feel
of your waterfall. You can choose a transparent background and place a
waterfall over any image you want.
Create Great Paper Cutting Patterns on the Fly - a Flash CS4 Effect
We present an effect meant to recreate the childhood experience of cutting and unfolding paper.
Cut out polygons from a folded paper triangle like you would with a scissors
and see the beautiful snowflake-like patterns emerge as the paper unfolds.
The effect is based on custom AS3 classes that use methods new to Flash Player 10.
Nova - Cosmic Interactive Particle Effect in Flash
This exploding star particle effect will blow you away!
Watch the mesmerizing colors of particles and their shadowy trails
as they billow away from the core. As always, complete AS3 source
code comes with the tutorial.
Bursting and Twirling Ribbons - AS3 Flash Particle Effect
We continue our popular series of particle animations with a whimsical new example.
This time, the particles consist of line segments which rotate as they move.
Small rectangles are drawn between the previous segment location to the new segment,
producing the effect of twirling ribbons being swept out in the trajectories.
ColorTransform is continuously applied to produce smooth gradient coloring.
A Dynamic, Interactive Fountain - Flash CS4 AS3 Effect
Don't miss this spectacular 'fountain made of particles effect'. The effect
uses our custom AS3 classes that, with some variations of parameters,
produced our recent, very popular examples of Splashing Rain and Lorenz Attractor
in Bubble Form. This new effect in the series shows the versatility of the custom AS3 classes.
Simple and Sleek Solution to Blurring of 3D Objects in Flash Player 10
Everyone who works with 3D methods in FP10 is familiar with the blurring
issue: the moment an object becomes a 3D object, it blurrs.
We present a simple and elegant solution to this issue by Matteo Sisti Sette.
His solution consists of a clever 'scaling correction'.
Lorenz Attractor in Bubble Form - AS3 Flash CS4 Visual Effect
Don't miss this very interesting visual effect. The Lorenz Attractor, a choatic dynamical system,
is drawn in the form of bubbles which become loose and float away. The bubbles shrink, dissolve,
and seem to follow ever-changing pattern.
Rain Animation with Splashing Raindrops - AS3 Flash CS4 Effect
We present a versatile custom AS3 class, RainDisplay.
With easy parameter manipulation, you can create a variety of spectacular visual effects:
rain with splashing raindrops, dripping paint, and much more.
XML-Driven 3D Billboard - Flash CS4 and AS3 Effect
We use the native 3D methods available in Flash Player 10
as well as several custom ActionScript 3 classes to construct an
advertising billboard with a 3D twist. The billboard is fully
customizable by editing a simple XML file.
3D Card Flips with Tweens in Flash CS4 and Flash CS3
It's the ultimate image flip tutorial. We present two custom
AS3 classes, TweenFlipCS4 and TweenFlipCS3 prepared
for FP10 and FP9, respectively. Flip vertically, horizontally,
customize tweens and speed of rotation. In the CS4 version, we use
native AS3 3D methods, and provide a way to solve the well-known problem of blurring
3D objects. In CS3 version we use a custom BitmapTransformer class.
Contour Map Plotter and 3D Function Grapher in Flash Combined
We use our custom AS3 classes
to build an applet which combines a contour diagram plotter
and a 3D function grapher. The user's can input formulas for functions and variables ranges. The applet uses our custom classes: MathParser,
GraphingBoard, GraphingBoard3D, and many helper classes. We provide complete, well-commented source code and a pdf guide of custom classes.
- Earth and Other Celestial Bodies in 3D in Flash CS3 and AS3, The ActionScript 3 GlowFilter
In this experiment we build a gallery of 3D textured planets, including Earth,
Mars, Venus and others. The planets auto rotate or can be rotated in 3D by the user.
We present a new, easier to customize version of our popular BitmapSphere AS3 class.
Since our planets glow, we discuss the AS3 GlowFilter class.
- Billboard Transition Effects in ActionScript 3 and Flash CS3
Clever transition effects reminisent of billboards. Images (or display objects) are divided into slices that
rotate in 3D to change the image. You choose the number of slices and the horizontal or vertical flip.
The code is encapsulated in an AS3 Billboard class that makes it easy to create your custom billboards.
- 3D Particles Experiments in AS3 and Flash CS3
Four stunning 3D particle experiments by Dan Gries. A sphere separates into several spheres based on the particles
color; particles revolve and tend to a gravity center; particles transition throughout a cube, and more. You can rotate
and manipulate the particles in 3D. Don't miss this one!
- Texture Mapping in ActionScript 3 and Flash CS3: Bitmap Spheres
In this tutorial, we deal with the important subject of texture mapping in AS3.
We use custom AS3 classes to paste a bitmap image around
a sphere and to create a textured sphere. Spheres that we create can be rotated in 3D with the mouse.
We give two examples: a wood-textured sphere and a sphere with a beautiful image pasted over it.
The examples are easily customizable.
- Coiling Up Bitmaps in ActionScript 3
In this tutorial, we present two custom AS3 classes: BitmapRoll and BitmapCylinder. The former
takes a bitmap image and coils it into a 3D coil that can be rotated in 3D by the user. The latter,
wraps a bitmap around a cylinder. Both the coil and the cylinder respond to clicks.
- AS3 Widgets Flipping in 3D, Taking Snapshots of Display Objects in ActionScript 3
A tutorial by Bri Lance that shows how to create useful AS3 widgets. The widgets flip in 3D. One side of a widget contains user controls
that control the other side. The effect is accomplished by taking a 'snapshot' of a Sprite
via methods of the AS3 BitmapData class. Such snapshots are combined with 3D rotation techniques.
- AS3 Experiment: A Bitmap Rotating in 3D Explodes into Particles
Don't miss this stunning visual effect created by Dan Gries.
An image revolving in 3D dissolves into a changing cloud of thousands of particles.
The cloud can be rotated with the mouse before the particles come together again.
- Simple 3D Drawing in Flash CS3
A step-by-step tutorial that walks you through the basic techniques of 3D rendering.
We begin with a revolving cube and end with a parametric surface.
- Cube in Bloom: Distorting Images in AS3, 3D menu on a Cube
We construct a vibrant gallery of flowers on a cube. We provide custom AS3 classes: BitmapTransformer,
CubeMenu, and ImageLoader. These classes make it easy to customize and to create 3D menus, galleries
and other applications that require image loading and distortion.
- Rotating 3D Objects with the Tween Class in ActionScript 3
We use the AS3 Tween class and the AS3 collection of easing functions to create interesting
rotation effects for a hexagonal cylinder drawn at runtime. The Tween class can
tween any numerical property of any object! And it has many events to play with.
- Parametric Art Gallery - A Visual Experiment in ActionScript 3
Create your own gallery of visually stunning interactive
images made up of parametric curves. We provide a sample gallery and everything
you need to experiment on your own and build your own collection. Don't miss this one!
- Rotating Bitmaps in 3D in Flash CS3, a 3D Menu on a Cube in ActionScript 3
We show how to rotate bitmaps in 3D in Flash CS3. We build a 3D menu on a cube whose sides are bitmaps and which can be
rotated by the user. We discuss the transform.matrix property of display objects in AS3 and the Matrix class.
- 3D Menus on Dodecahedron, Bitmaps of Arbitrary Shapes in 3D in Flash CS3
In this tutorial, we show how to build two 3D menus on a dodecahedron whose 12 faces are pentagons. In the first example,
the faces are pentagonal bitmaps, in the second example, we have circular bitmaps placed inside pentagons. We use masking
and the transform.matrix property of the ActionScript 3 Sprite class.
- Flipping a Playing Card Effect in AS3, Distorting Bitmaps for Perspective in Flash CS3
In this tutorial, we create a simple, easily customizable applet in which a playing card is flipped around when the user clicks on it. The flip
takes place in 3D and the corresponding bitmaps are distorted for perspective. Such distortion requires
some interesting techniques, including slicing of bitmaps.
- A Gallery of Customizable 3D Surfaces in Flash CS3, A Custom 3D Surface Class in AS3
We build a collection of spectacular 3D surfaces that can be rotated by the user. Then we create a custom ActionScript 3 class
that makes it easy to use the collection for creating a variety of visually engaging Flash apps. Don't miss this one!
- 3D Menu, Bitmap Fills, and Loading External Images in Flash CS3
We build a 3D menu on a tetrahedron. When the user clicks on a face of the tetrahedron, an
external jpeg loads. We discuss in detail bitmap fills, loading external files, and the Loader
class in ActionScript 3 as well as the BitmapData and Bitmap classes.
- Drawing and Rotating 3D Curves in Flash CS3, 3D Motion
We build an applet in which the user
can enter parametric equations for a curve in the xyz-space. The applet then plots
the curve and displays the velocity and the acceleration vectors as the user traces the curve.
We use our custom MathParser class. The tutorial contains an extensive pdf guide on using the parser and
other custom classes.
- Proof Scrambler with Drag and Drop
Interface Drag and drop techniques, hit test, and depth
management in Flash CS3. Shows how to create a simple class.
- Using an external XML file in Flash CS3
In this tutorial, we show how to use an external XML file to load
data into a Flash movie at runtime. The advantage of this approach is that
an XML file can be easily edited without recompiling the swf file.
As an example, we built a gallery of polar curves by combining
the XML technique with our parametric curves grapher.
- Flash Forum Custom Classes:
We use a function grapher template and the custom classes from
our Flash Forum article, "Flash Tools For Developers (AS3): Graphing
Curves in the Plane", to build a grapher that graphs a
user-defined function as well as its derivative.
- Clip Loading for a Dynamic Presentation The applet animates a proof of the Pythagorean Theorem. It shows how to load and unload clips at runtime to create a dynamic presentation in Flash CS3.