• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 27. Video > Skipping the Component

Skipping the Component

If you want to forgo the component (which, in this case, doesn't save you anything on file size), you can do it with a chunk of extra code. Here's how to do it.

1.
Open a new Flash movie.

2.
In the Library, select New Video from the Library options menu (Figure 27.3). This creates a video object in the library (Figure 27.4).

Figure 27.3. Library Options Menu


Figure 27.4. One Video Object in Library


3.
Drag this video object to the stage and call it muppet_video. This video object is now ready to connect to and play a video.

4.
Drag a TextArea component to the Stage and call it status. We'll be displaying information about the video in it.

5.
Enter the following in the first frame:

    // Create a NetConnection object:
    var netConn:NetConnection = new NetConnection();

// Create a local streaming connection:
netConn.connect(null);

// Create a NetStream object and define an onStatus()
// function:
var netStream:NetStream = new NetStream(netConn);
netStream.onStatus = function(infoObject)
{
    status.text += "Status (NetStream)";
    status.text += "Level: "+infoObject.level;
    status.text += "Code: "+infoObject.code;
};

// Attach the NetStream video feed to the
// Video object:
muppet_video.attachVideo(netStream);

// Set the buffer time:
netStream.setBufferTime(5);

// Being playing the FLV file:
netStream.play("muppet.flv");


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint