The drum is a very complicated instrument, in many occasions to use this instrument, now, we can use the flash production of their own drum, only need to slide the mouse can easily play together beautiful music, the final effect as shown in Figure 1.
Figure 1 Rack Drum
The drums seem very complicated, in fact, the production is still relatively simple, the application of the button in this section can be said to play to the extreme, the basis of the production process, only a few simple scripts, such as "Stop ()" And so on, mainly make buttons to the mouse-slip out of the sound, At the same time in accordance with the specified number of keys will also emit a corresponding sound, in order to facilitate operation in the production process, we first for the various parts of the diagram as shown in Figure 2, to achieve this effect, the specific steps are as follows:
Fig. 2 The parts of the rack drum
1. Create a new movie, set its size to 600xpx580px (in pixels), set its background color to #ffffff, and of course the user can set it according to the needs. Press "Ctrl+r", the shortcut key opens the Import dialog box, imports the corresponding sound file of each part, and a picture of the rack drum. As shown in Figure 2 (of course there is no callout)
2. Create a new graphic element "Smallcrash", insert a key frame at the frame, and, when selected, draw a pattern in the workspace that corresponds to the "Cfash1" in the section, as shown in Figure 3:
Figure 3 Making a graphical component "Smallcrash"
Make the other 8 graphic elements, as shown in Figure 4, in the same way:
Figure 4 Making 8 other graphic components
3. Create a New button element "Smcrashbutton", select the bounce frame to insert a keyframe, insert a keyframe at the pointer pass frame, drag the crash1 sound file "Crash1" from the library into the workspace, and insert a keyframe at the click Frame. Drag and drop the corresponding graphic symbol "Smallcrash" to the workspace to complete the design of the button symbol "Smcrashbutton", as shown in Figure 5:
Fig. 5 Design of "Smcrashbutton" button elements
Follow the same method to design the button elements "Bassbutton", "Hihatbutton", "Lgcrashbutton", "Ridebutton", "Smarebut", "Tomabutton", "Tombbutton" and " Tomcbutton ".
4. Create a new movie clip "Crash1movie", insert a keyframe at the 1th post of the default layer, select the frame, and add the following script:
Stop ();
Indicates that the movie clip stops when there is no external trigger.
Inserts a keyframe at frame 2nd, insert the graphic symbol "Smallcrash" into the workspace, select the graphic symbol, usually set its transparency value to "50%", inserts a keyframe at frame 5th, selects the 2nd keyframe, clicks the right mouse button, and selects Create motion tween. To create an animated gradient animation.
Creates a new layer, inserts a keyframe at frame 1th, inserts a keyframe at frame 2nd, and inserts the corresponding sound file "Crash1" into the workspace to create a sound instance. This film clip "Crash1movie" is made.
Design the other 8 film clips in the same way "Bassmovie", "Crash2movie", "Hihatmovie", "Ridemovie", "Snamremovie", "Tombmovie", "Tommamovie" and " Tommcmovie ".
5. Return to the main scene, in order to make it easier to understand the default layer renamed "Pic", the imported to the library of the drum child picture dragged into the workspace,
Create a new layer of "Crashamovie", drag and drop the 9 movie clips that you made into the workspace by creating 9 instances with the same instance name as the callout shown in Figure 2.
Create a new layer "BUTTONS", select frame 1th to insert a key frame, the production of 9 key components drag and drop to the corresponding position in the work area, that is, with the devices coincide, as shown in Figure 6:
Figure 6 Creating an instance of each button
6. Select each button, and add another script to it as follows:
"Smcrashbutton" button:
On (keyPress "7") {
Telltarget ("/crash1") {
Play ();
}
}
That starts playing the instance "Crash1" when the keyboard number key 7 is pressed
"Bassbutton" button:
On (keyPress "0") {
Telltarget ("/bass") {
Play ();
}
}
"Hihatbutton" button:
On (keyPress "1") {
Telltarget ("/hihat") {
Play ();
}
}
"Lgcrashbutton" button:
On (keyPress "8") {
Telltarget ("/crash2") {
Play ();
}
}
"Ridebutton" button:
On (keyPress "9") {
Telltarget ("/ride") {
Play ();
}
}
"Smarebut" button:
On (keyPress "2") {
Telltarget ("/snare") {
Play ();
}
}
"Tomabutton" button:
On (keyPress "4") {
Telltarget ("/toma") {
Play ();
}
}
"Tombbutton" button:
On (keyPress "5") {
Telltarget ("/tomb") {
Play ();
}
}
"Tomcbutton" button:
On (keyPress "6") {
Telltarget ("/tomc") {
Play ();
}
}
These scripts are simple, but when the user presses their numeric keys on the keyboard, the corresponding instance in the movie is fired, and the instance will certainly emit a corresponding sound when inserting the example.
7. Save the work, press "Ctrl+enter" to preview the final effect.