EasyManua.ls Logo

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH - Page 607

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
830 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
About using FLV video 607
For information on preloading FLV files, see “Preloading FLV files” on page 507. For
information on dynamically loading FLV video into components, see “Creating an
application with the FLVPlayback component” on page 491. For information on FLV files
and the server, and FLV files and playing FLV files locally on the Macintosh, see About
configuring FLV files for hosting on a server” on page 623.
Creating a video banner
Video content within banners and other Flash advertisements is often used for advertising,
such as showing Flash movie previews or television advertisements. The following example
shows how you might create a video instance and add ActionScript in a FLA file to create a
banner advertisement that contains video.
To create a video banner:
1. Create a new Flash document called vidBanner.fla.
2. Select Modify > Document.
3. Change the dimensions of your FLA file, type 468 in the width text box and 60 in the
height text box.
4. In the Library panel (Window > Library), select New Video from the Library options.
5. In the Video Properties dialog box, name the video symbol and select Video (ActionScript
controlled).
6. Click OK to create a video object.
7. Drag the video object from the Library panel to the Stage to create a video instance.
8. With the video object selected on the Stage, type my_video in the Instance Name text box
in the Property inspector (Window > Properties > Properties).
9. With the video instance still selected, type 105 in the width text box and 60 in the height
text box in the Property inspector.
10. Drag the video instance to a position on the Stage, or use the Property inspector to set its
x and y coordinates.
11. Select Frame 1 in the Timeline, and open the Actions panel (Window > Actions).
12. Add the following code to the Actions panel:
var my_nc:NetConnection = new NetConnection();
my_nc.connect(null);
var my_ns:NetStream = new NetStream(my_nc);
my_video.attachVideo(my_ns);
my_ns.setBufferTime(5);
my_ns.play("http://www.helpexamples.com/flash/video/vbanner.flv");

Table of Contents

Related product manuals