Random Music Bars

Download Source



In this tutorial you will learn how to dynamically perform the following:

FOR Loop
using Math.random
Scaling objects randomly
Positioning objects randomly

The example below demonstrates two different random techniques. The first one is the duplication of four circles in random positions. The second is a music bar player to give the impression the height of the bars jumps to the music.

A very easy technique that adds a little extra theme to a flash based music player.

Here is the final result:

ActionScript 2 Source Explained

Complete Source Code

onEnterFrame function

FOR Loop for Circles and Math.Random

FOR Loop for Circles and Math.Random cont.

FOR Loop for Music Bars and Slider Bar control