Flash Gets the music data stream, makes the MC that changes with the music

Source: Internet
Author: User

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 ();
};

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.