Valuable points from Lesson 8 Adobe Flash CS5 Professional Classroom in a Book You are expected to understand and know how to use/do each of these tasks in Flash CS5, unless otherwise noted below. If you run out of time during lab, then complete the lesson on your own. If you find any of the tasks to be confusing or unclear, please ask about them either during lab or during my office hours. Lesson 8: Sound and Video Please read pages 278 281 and look at the completed file from the CD. The sound buttons do not work in the FLA on the CD, but we don t care. Then skip to page 295. We are not using the part of this lesson about sound; we are doing a separate set of exercises for controlling sound in Flash. (Those exercises are in a separate handout.) Reason: For journalism stories, the stuff about sound in this lesson is pretty much useless. Bad Label Usage Please note that once again (as in Lesson 6: Buttons), the author is using labels in a bad way that will cause you a lot of problems in many Flash projects. Labels should always be in a layer alone, with nothing else in the layer except the labels. These instructions override his bad label usage. Parts of the FLA That Are Already Done Don t stress about having the file set up for you. You have already done what s done here (in Lesson 6: Buttons). Basically you will use buttons, exactly like those you already understand, to load and play video. Yay! Too cool! You should be able to see at a glance that the lower five layers in the FLA Timeline have the same stuff in them from beginning to end. There is only one keyframe in each of these five layers. That is the keyframe in frame 1. As there are no other keyframes after frame 1, that means nothing in the layer changes. Bad Button Instance Names Our badly behaved author named all the video buttons in a very bad way (video_button1, video_button2, etc.). Any properly trained Flash developer would name them video1_btn, video2_btn, etc. But for the sake of simplicity, don t change them. When you create your own Flash files, please name buttons the normal way, as described (correctly) on page 208 in the book. By the way, when you import sound files into the FLA as shown on the pages we are skipping, your SWF file size can become very large. Not a good thing. 1
Note that on page 286, the lesson has you add a bunch of frames near the start of the Timeline. You should do this now so that your Timeline matches the author s instructions later. Now go to page 295 and read. 1. What do the file extensions.flv and.f4v mean? Note: Not only can Flash play.mov files; it can also play.mp4 files. This is important because.mp4 video files can also be played in lots of other, non- Flash players. 2. What is a codec? 3. What does the Adobe Media Encoder do? 4. If the Adobe Media Encoder window is not empty (p. 296), then you should select and remove any videos that appear there. 5. Note that for particular conditions, particular videos, etc., you would likely choose a different Preset option. Video is very variable, and these compression options have vastly different effects on different video files. Please do follow the author s instructions for encoding these videos, because then they will fit into the package he has laid out for us. 6. Page 299: Note that the Adobe Media Encoder can be used to do all these things to a video even if you are not going to use the video with Flash. You can make simple edits to a video without having access to a video editing program. So if you have Flash, you have a handy video editor in the Adobe Media Encoder. 7. Page 304: Note that you ll need to follow the instructions on this page to make the Penguins video fit in the project. Make sure you click the Constrain box (shown by the cursor arrow at left) before you change the width! 8. Page 305, bottom: This is very, very cool the ability to feed external videos into Flash movies makes it possible to build big projects that give users access to dozens of videos, but the Flash movie loads very fast because the 2
videos are not embedded inside it. (Note that your working copy of the FLA is probably already open. There is nothing wrong with having the FLA open at the same time you are using the Adobe Media Encoder.) 9. Page 306: Just to be clear, you are not adding the video file to Flash. You are adding a video player component that will load the external video file. Note that Flash will be looking for the video file in a location relative to this FLA you are working on now. If you select the file as instructed, you must maintain the relationship you have now for example, is the FLA you are editing in the same folder with Penguins.f4v? You can check this when you get to the screen referred to in step 9 at the bottom of page 307. 10. Page 309, step 12: You won t have a musical introduction because we skipped that. 11. NOW THIS IS VERY IMPORTANT. Once again, the book s author has given us instructions that don t work so well. Stop before step 13 on page 309. Undo until your video player disappears. Then follow THESE INSTRUCTIONS: a. Change the name of the layer videos to labels. b. Make a new layer below that one, and name it video player. c. In your new video player layer, make ONE and ONLY one keyframe, directly below the penguins label. It does not matter which frame your penguins label is in. What matters is that the label and the new blank keyframe are perfectly aligned, as shown above. Why? Because the button for penguins has an EventListener and a function that go to that frame label! (The ActionScript is already there.) With that new blank keyframe selected, as shown above, repeat steps 2 12 (pp. 306 309). 3
The key is that the layer named video player now has no keyframes after the black one under the label penguins. That means the same instance of the video player will be used for what we do next, and you will not have to position the player each time. Also, you won t have to click through all those screens for the player every time. Hooray! After the player is in place, and fully set up, and working, THEN and ONLY then will you add subsequent keyframes (NOT BLANK ONES) in the same layer. Each new keyframe for a video will be precisely under its own frame label (mandrill, etc.). Because of the buttons! 12. In the video player layer, add one keyframe each under the labels mandrill, tiger, and lion. Make sure you select Insert Keyframe (NOT a blank one!). 13. Now select the keyframe on the video player layer that goes with mandrill. 14. Click once on the video player on the Stage. That will make the Properties panel show the properties of the player so that you can make a new video load into it. 4
15. In the Properties panel, find Component Parameters (you might need to click the name to open it). Look for source you ll see the source is Penguins.f4v. Click the tiny pencil to the right of the filename. This is how you will replace the penguins video with the mandrill video. The Flash video player component is awesome! 16. Click the folder icon on the right side to open a window and find the video file named Mandrill.flv. 17. Click OK after you have located the correct video file. 18. Save and test your movie. Test the four video buttons repeatedly. Everything should be bulletproof! 5
Review: Putting Video into a Flash Movie We could stop right here, because you now have the key knowledge for building Flash story packages that contain multiple videos: 1. Build a Flash movie with a Stage sized to accommodate your videos, buttons and text. 2. Create buttons, layers and frame labels as you already know how to do. Each video will be lined up under its own frame label. 3. Edit and export the videos to be the same width and height (or resize them in the Adobe Media Encoder). 4. Use the Adobe Media Encoder as needed to export as f4v (this will make the smallest video file size and still maintain high quality). 5. File > Import Video to create a player on the Stage with a video file designated to play. 6. Create new keyframes in the same layer to switch other videos into the same player instance. Note that on frame 1, where the button functions are, the author has included this line of ActionScript in each function: SoundMixer.stopAll(); This is not necessary if you have only video such as what you have done so far in this lesson. That line IS necessary for the things that will be added in the following pages. Putting the Package on a Web Server Something the author doesn t tell you: When you upload a package like this, you need to ensure that you upload all the pieces, and keep them in the same relationship. So if your FLA and SWF are in a folder, and inside that you have another folder named videos containing all the video files, then that structure has to be exactly the same on the Web server. Notice that a SWF named MinimaFlatCustomColorPlayBackSeekCounterVolMute.swf is in the folder with your lesson SWF. That file appeared there when you went through the File > Import Video process and added the player to the Stage. It contains the player you selected. (If you selected a different player, then a different SWF would be there.) When you upload, that SWF must be in the folder with your main SWF! Otherwise, there will be no player in your movie. Continue with the rest of Lesson 8 and complete it. 6