Chapter 9. Sound, Transitions, and Streaming Video

We already have a lot of skills under our belt, allowing us to accomplish some pretty exciting stuff. This chapter builds on that experience to create a television set complete with streaming video and visual transitions. Along the way, we’ll expand our repertoire to include masking and sound editing.

In Chapter 5, we imported a video into Flash and ended up with an 80 KB .swffile that streamed a 2 MB .flv file. In this chapter, we’ll turn a box into a television set, add some buttons to it, and stream three separate videos into a .swf file that is less than 1 KB. To do this, we’ll manipulate line art, use a mask to define the area in which video is displayed, add a video object to the Flash document, and use ActionScript to open a streaming connection for the video.

Using ActionScript to stream video is just one of several ways to load external files into the Flash Player and display them. In later chapters, we’ll load external images into a Flash movie. We’ll also load other movies, text, and even a Cascading Style Sheet (CSS) file to format the text. Using external files helps cut down the time it takes to load and start Flash content, either online or on CD-ROM, improving the experience for the user.

True, you still have to load the external assets, but at least this way, you can show something to the user while that’s happening. Also, if an asset is set up to be loaded only upon user request, such as via a button click, and the ...

Get Flash Out of the Box now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.