chapter 11 adding sound and video. chapter 11 lessons 1.work with sound 2.specify synchronization...

36
Chapter 11 Adding Sound and Video

Upload: austin-spencer

Post on 29-Dec-2015

224 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

Chapter 11

Adding Sound and Video

Page 2: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

Chapter 11 Lessons

1. Work with sound2. Specify synchronization options3. Modify sounds4. Use ActionScript with sound5. Work with video

Page 3: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• Introduction– Sound and video are important tools you can use

to express a message, engage users, and make your site or application appealing to visitors

– Sound and video can add significantly to the size of movies that you publish

Add Sound and Video

Page 4: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• Introduction– You should only apply sound and video where it

will have the most impact– Flash provides a number of compression options

that can help you achieve a balance between quality and file size

Add Sound and Video

Page 5: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• You can add sound to an object or the Timeline in Flash by importing sound files to the Library panel.

• Flash also provides you with dozens of sound effects found in the Common Libraries panel on the Window menu.

• You can use ActionScript to add sound during runtime.

Work with Sound

Page 6: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• When you want a sound to play in the background, rather than tie it to a specific object on the Stage, you can add an instance of the sound to a frame on the Timeline.

• It is recommended that you use the Properties panel to add instances.

Work with Sound

Page 7: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• The approximate duration of the sound is indicated by the number of frames the lines occupy.

• If the sound is longer in duration than the movie in seconds, the sound may continue playing after the playhead has reached the last frame.

Work with Sound

Page 8: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

A sound on the Timeline

This layer contains the sound Sound file on Timeline

• Sounds are represented on the Timeline by either a straight or waveform line.

Work with Sound

Page 9: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• You can play multiple sounds at once by placing the sounds on different layers.

• Sounds you add in Flash are considered event sounds.

• The sound starts in the keyframe to which you add it, but it can continue playing even after the last frame in the main Timeline is played.

Work with Sound

Page 10: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

Sounds in Timeline extend to end of movie

Work with Sound

Page 11: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• You can have event sounds play at a faster or slower rate than indicated by the frames on the Timeline.

• You can use event sounds as many times as you like in a movie, with no increase in the file size.

Work with Sound

Page 12: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• Stream sounds are similar to animated graphic symbols because they are closely tied to the main Timeline.

• Stream files will begin playing right away without the user having to wait for the entire sound file to download.

Work with Sound

Page 13: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

Synchronization options:• Event• Start• Stop• Stream

The Sync sound options in the Properties panel

Specify Synchronization Options

Page 14: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• Stream sounds are tied to the Timeline and the number of frames on the Timeline.

• When you add a sound and set it to be stream, Flash breaks the sound into individual sound clips and then associates each clip with a specific frame on the Timeline.

Specify Synchronization Options

Page 15: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• If the sound is longer than the number of frames on the Timeline, the sound still stops at the end of the movie.

• An important use of stream sounds is for you to be able to synchronize animation and audio.

Specify Synchronization Options

Page 16: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• A Start sound is similar to an event sound, but it will not play again if an instance of that sound is already playing.

• You can use the Start option with sounds associated with buttons or with movies that loop back to the beginning, in order to avoid overlapping sounds.

Specify Synchronization Options

Page 17: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• The Stop option lets you end an event sound at a specific keyframe.

• You can insert a keyframe in the frame where you want to apply a Stop option, then you specify the name of the sound you want to stop in the Properties panel.

Specify Synchronization Options

Page 18: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

A Stop option on the Timeline and in the Properties panel

The block rectangle indicates the end of the span of frames with the same content

The filled-in blue square above the keyframe indicates a stop action

Specify Synchronization Options

Page 19: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• In most cases, you will want to edit and enhance sounds in a sound-editing program before you import them into Flash.

• However, Flash does include some basic editing features you can use on sounds you have already imported.

Specify Synchronization Options

Page 20: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

Envelope handle for left channel

Sound line for left channel

Envelope handle for right channel

Sound line for right channel

Time In control

Time Out control

Units in frames

Display units in frames

Display units in seconds

Zoom out

Zoom in

Play sound

Stop sound

Modify Sounds

Page 21: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• You can trim the length of a sound file using the Edit Envelope dialog box.

• You can preview the edits you make to a sound by clicking the Play button at the bottom-left corner of the Edit Envelope dialog box.

Modify Sounds

Page 22: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• Flash includes the following effects you can apply to sounds:– Left Channel plays the sound only in the left

channel or speaker– Right Channel plays the sound only in the right

channel or speaker– Fade Left or Right gradually shifts the sound from

the left channel to the right channel over the duration of the sound

Modify Sounds

Page 23: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• Effects Continued…– Fade Right to Left gradually shifts the sound

from the right channel to the left channel over the duration of the sound

– Fade in increases the volume of the sound as it begins to play

– Fade out decreases the volume of the sound as it ends

Modify Sounds

Page 24: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• You can set these options either in the Properties panel of the frame to which you have added the sound or in the Edit Envelope dialog box for the sound.

• Custom lets you create your own volume variations over the duration of a sound.

Modify Sounds

Page 25: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

A custom volume envelope

Sound increases in volume here

Sound decreases in volume here

Modify Sounds

Page 26: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• You can use actions to set how and when sounds play in a movie, and to start or stop sounds in response to user interactions.

• To reference a sound from the Library panel in ActionScript, you must enable the Export for ActionScript option.

Modify Sounds

Page 27: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

Click check box to allow sound file to be used in ActionScript

Class name used for linkage

Modify Sounds

Page 28: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• A sound object is a way for ActionScript to recognize and control a sound.

• When you create a sound object it is similar to creating an instance of a sound on the Stage, except it happens entirely in ActionScript.

Use ActionScript with Sound

Page 29: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• The Sound.play method starts a sound playing.• Sound.play includes optional parameters that

let you specify a sound offset and also the number of times to repeat the sound.

• The stopAll method of the SoundMixer class stops all sounds currently playing.

Use ActionScript with Sound

Page 30: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

A variable (named snd)with a sound data type;the sound data type isidentified by using theclass name (myMusic)that was specified in theLinkage area of the SoundProperties dialog box

Assign an instance of thesound class to the variable

Use ActionScript with Sound

Page 31: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• Progressive downloading uses a video Component and ActionScript to load an external FLV file into a SWF file, allowing the video to play when the SWF file is played.

• This keeps the SWF file smaller than when the video is embedded.

Work with Video

Page 32: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• The process to load an external video:– Start a Flash ActionScript 3.0 document and select the

layer and frame where the video will be displayed– Import the video using the Import Video option from the

Import command on the File menu– Use the Browse button in the Import Video dialog box to

navigate to the folder where the video is located and choose video

Work with Video

Page 33: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• Process Continued…– Check the Load External video with playback

component option, and then click the Next button– The Skinning screen appears. The video’s skin

determines the appearance and position of the video controls

– The Finish Video Import screen appears, indicating the file and its location as well as information on the video component and its skin

Work with Video

Page 34: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

The Skinning screen in the Import Video dialog box

Preview of the selected skin

Click to view Skin options

Click to view color palette of available control bar colors

Work with Video

Page 35: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

• Cue points are indicators on the video Timeline that you specify.

• To create a cue point, you scrub the seek bar to locate the desired position for the cue points, then you use the CUE POINTS area of the Properties panel to add a cue point and give it a name.

Work with Video

Page 36: Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound

Seek bar scrubbed to the 13 secondpoint on the video timeline

Cue point named lion is created at the 13 second point

Work with Video