The creation of this
requires the acquisition of an audio spectrum, the audio spectrum into the data, this dongdong needs a software called Flashamp this software is very small, and do not need to install, direct use, and later put the software below, to give enthusiasts (its use is very simple, by the way also said its use)
———— Get the music data, use the data as an element in the array, then call it by creating a function, and assign the values to the scale or height of the y-coordinate of the MC.
First, use Flashamp to obtain the audio data, the obtained data in the form of txt text, stored in the folder named Data flow. Note Change the beginning of data in txt text to mytext=12,13,15 ... 。 The TXT text name is renamed to Mytxt. Please refer to the original program for details.
Two, open flash, start making the
first music import, put in the first frame, and will be extended to enough length
1, artificial 7 MC Components, 7 MC Registration points are below, adjust the color of the
2, the 7 MC respectively dragged to the scene, The life case names are A1 A2 A3 A4 A5 A6 A7
3, the first frame is selected and the following as
is written.
//Part I: Load an external data stream as an element in an array
var myload = new Loadvars ();
var myarray: Array = new Array ();
Myload.onload = function (success) {
if (success) {
MyArray = Myload.mytext.split (",");
}
shows = MyArray;
Trace (myarray.length);
};
Myload.load ("Mytxt.txt");
//Part Two: Use the elements in the array to control the properties of the MC's height
var i = 0;
function Go () {
_root.a1._height = sndnow*0.8;
_root.a2._height = sndnow*0.5;
_root.a3._height = sndnow*0.7;
_root.a4._height = sndnow*0.2;
_root.a5._height = sndnow*0.5;
_root.a6._height = sndnow*0.7;
_root.a7._height = sndnow*0.2;
i++;
}
Onenterframe = function () {
Sndnow = myarray
;
Go ();
};