tailieunhanh - Flash CS4 All-in-One For Dummies- P17

Flash CS4 All-in-One For Dummies- P17: Welcome to Flash CS4 All-in-One For Dummies. Our goal when writing this book was to share our enthusiasm for Flash and, at the same time, demystify the application. You can do so many things with Flash that it becomes mind boggling. The minibooks in this reference are designed to take the boggle out of your mind and show you how to use Flash to create Web banners, animations, and other delights. We also delve into the topics of ActionScript and Flash video. | Putting on a Show with ActionScript Cue Points 457 package import import import import public class CueThis extends Sprite private var flv String private var loader Loader private var url URLRequest public function CueThis flv onCue loader new Loader private function onCue cp MetadataEvent url new URLRequest .swf url addChild loader 350 3 About the only thing new about that program is the line onCue which is an event listener for ActionScript cue points. It s the preferred event handling procedure with ActionScript rather than onCuePoint as is the case with NetStream objects and cue points embedded in the video. The cue point triggers the onCue method which passes the name value of the cue point name property. All that s left to do is invoke the loader. Presto change-o Up jumps the SWF file showing the number of the current cue point. Rather than have simple numbers reflect the number spoken and shown in the video you can have any Flash CS4 movie clip you want appear. Figure 4-7 shows an example of what you may see. We start with a tag you may know from HTML the p tag. As you may remember p is for paragraph and everything between the opening p and the closing p is formatted with the paragraph s formatting attributes. You don t have to worry about formatting for this example however because it doesn t use any. Think of it as you would a PowerPoint presentation a person talks and illustrates the presentation using graphics and even animation. Using this technique you can make presentations anywhere in the world over the Web. Book VI Chapter 4 Getting Fancy with Video 458 Captioning a Video Figure 4-7 An SWF file loading in response to a cue point. Captioning a Video Adding captions to a video can be