Вы находитесь на странице: 1из 6

B.

Sc Degree / Diploma in Information Technology


Year 2/Semester2 -2011 Computer Graphics & Multimedia Lab Sheet-9/ Flash Sound Script, Effects

Objectives Be familiar with Flash Buttons. Using the Action Script and Adjusting the effects & frames according to the scene. Work with Sound.

Exercise
Create the sound movie clip 1. Choose Insert > New Symbol and choose Movie Clip as the symbol's behavior. Name the movie clip Sound. 2. Choose File > Import and browse to the folder containing the sound file you want to play and import it into the movie's Library. 3. In the first frame of the movie clip, insert add a Stop action. 4. Select frame 2 and choose Insert > Blank Keyframe. Then drag the imported sound symbol from the Library (Window > Library) to the stage of the movie clip. 5. Add the frame label start where the sound begins in frame 2.

6. With frame 2 still selected, open the Sound panel and choose Stream from the Sync pop-up menu. Note: Event sounds don't work with this method. 7. Insert frames into the movie clip's timeline until the waveform for the sound disappears, as shown below.

8. At the frame where the waveform ends, insert a keyframe and add the following action to the frame: gotoAndPlay ("start"); This action causes the playhead to return to the beginning of the sound when it's complete. If you'd prefer the sound to not loop, insert a Stop action on this frame rather than the gotoAndPlay action. 9. Return to Edit Movie mode (Edit > Edit Movie) and drag an instance of this clip from the Library to the stage. Give the clip an instance name of "mc" in the Instance panel (Window > Panels> Instance). Add buttons to control the sound clip 1. Add two buttons to the stage to rounded grey stop and rounded green play the sound. (Window > Common Libraries > Buttons>playback rounded) 2. Select the button you want to cause the sound to play and open the Actions panel (Window > Actions). Add the following ActionScript to the button: on (release) { with (mc) { play(); } }

3. This step causes the movie clip containing the sound to start playing, which starts the sound. 4. Select the button you want to cause the sound to stop. Open the Actions panel (Window > Actions). Add the following ActionScript to the button: on (release) { with (mc) { stop(); } } 5. This button causes the movie clip containing the sound to stop playing, which stops the sound.

6. Test the movie by choosing Control > Test Movie. If the sound doesn't start or stop on command, make sure that the instance name you've assigned to the sound clip is "mc." Also make sure that the sound's Sync property in the Sound panel is set to Stream and not Event.

Import the Background Image 1. Open a new file. Go to File >New.

2. Go to Modify > Document to give a file size of 180px by 400px. This is the same size as the Bitmap picture we have. 3. Select the Bitmap pictures which you want to put as background and bring it to the Flash Library by clicking on File> Import > Import to Library from the Menu Bar. 4. Go to Window > Library, You can see the picture in the Library panel. Drag the picture named Bitmap to the Stage. Select the picture by clicking on it. This will be your first layer, name it background. Create a Rotating Star Movie Clip (1/6 ) 1. Create a new layer. Name it sparkle. Go to Insert > New Symbol. The 'Create New symbol' screen will appear. Name this movie clip ' star_mc'. Click OK. You will be directed inside the movie clip. 2. Now select Rectangle Tool and change properties (-56) so you can have a Star .

3. Now draw the Star (without a stroke color). On frame 1 you will see your star. 4. Select the frame1 then go to Properties>Tween. Select Motion from the drop down Menu. Name it as star_in_mc. 5. Go to frame 10. Press F6 to insert a new keyframe. Then select the star and go to Modify > Transform > Rotate CW. 6. Repeat the above three times. 7. Your rotating Star movie Clip is ready. You will see it in the Library Window also. This movie clip star_mc will not be there in the sparkle layer but stored in the Library, we will use it later. Create a movie clip with a small opaque circle that increases in size and becomes almost transparent. (2&3/6) 1. Draw a circle with Oval Tool, choose the fill color as white and make it 2px by 2px. Select it.

2. Go to Modify>Convert to Symbol from the Menu Bar. A dialog Box named Create New Symbol will appear. Give the name as shade_mc. 3. Select Movie Clip. Click on OK. double click on it. You will be inside the Movie clip and in your first frame you will see the dot. Select it. 4. Go to Modify>Convert to Symbol from the Menu Bar. A dialog Box named Create New Symbol will appear. Give the name as shade_in_mc. 5. Go to Frame5. Press F6 to insert keyframe. 6. Go to Properties>Tween. Select Motion from the drop down Menu. 7. Go to Frame 10. Press F6 to insert keyframe. 8. Now go to Frame 5. Select your movie clip. Increase the size to 14.3px by 14.3px. 9. Go to Frame 1. Select the dot. Go to Properties. Select Color as Alpha in the drop down menu and give 100%. 10. Go to Frame 5. Select the dot. Go to Properties. Select Color as Alpha in the drop down menu and give 10%. 11. Go to Frame 10. Select the dot. Go to Properties. Select Color as Alpha in the drop down menu and give 5%. 12. This movie clip shade_mc will not be there in the sparkle layer but stored in the Library, we will use it later. Create another movie clip with a star which becomes smaller at a slower rate than our 1st star movie clip. (4&5/6) 1. Go to Main Scene. Go to Insert > New Symbol. The Create New symbol screen will appear. We will name your first movie clip as star_mc. 2. Now draw the Star. Give the size to 23px by 23px. Select the edge and delete them. 3. Choose the star and make it a Movie Clip. Name it star_s_mc. Now double click on it. On frame 1 you will see your star. 4. Go to frame 10. Press F6 to insert a new keyframe. 5. Go to Properties>Tween. Select Motion from the drop down Menu. 6. Go to Frame20. Press F6 to insert keyframe. 7. Go to Properties>Tween. Select Motion from the drop down Menu. Now go to frame 10. Select your movie clip.

8. Go to Properties. Give the size to 9px by 9px. This movie clip star_s_mc will not be there in the sparkle layer but stored in the Library, we will use it later. Create the sparkle movie clip by combining the movie clips created above and place it where required. You have already created 6 movie clips. Now we will create the last main movie clip. Go to Insert>New Symbol. The Create New symbol screen will appear. We will name your main movie clip as sparkle_mc. You will be directed inside the movie clip. Drag in here these 3 movie clips : star_mc, shade_mc , star_s_mc because when they are combined they will give the sparkle effect, and adjust them properly in the middle. Now go to your main scene. Go to layer sparkle. Drag the Main movie Clip sparkle_mc wherever you want the Sparkling Glass Effect to be seen. You can use it on a diamond ring, a golden jewelry or on sparkling text also. Save your file as sparkle.fla. Press on Ctrl+Enter to see the Sparkling Glass Effect. This will create automatically sparkle.swf file.

Вам также может понравиться