So far, in this series, you have essentially been operating on autopilot and letting FMS 3.5 automatically feed a video stream from the vod folder into the FLVPlayback component or a video object on the Stage. There will come a time when the vod folder is more of a hindrance than an asset, however. Also, the vod folder is a feature of Flash Media Streaming Server. If you are using Flash Media Interactive Server, you will need to know how to create an application that plays from this server.
Actually, it is not terribly mysterious to use, but if you are new to FMS 3.5 it can be a bit confusing. To start with, your publishing point is not a vod folder; it is your applications folder. This folder is placed in the applications folder of FMS 3.5 but it is named by you.
The next big difference is the use of an instance. This has nothing to do with ActionScript. An instance is a specific folder named _definst_ that you must create and into which you place the video or audio files.
In addition, there is usually an .as file in the application folder that contains some relatively simple server-side code. Take a look at what I am talking about:
Open this folder and you will see a folder named streams and a file named main.asc (see Figure 3). This file must be named main.asc; it contains the server-side code that makes stuff work.
Note: I would like to thank my colleague Lisa Larson-Kelley for the use of this particular main.asc file.

Figure 3. Basic folder structure for an FMS application
An .asc file is created by selecting ActionScript Communication File from the Flash Start Panel in Flash CS4 Professional (see Figure 4) or by selecting File > New and selecting ActionScript Communication File in the New Document dialog box.

Figure 4. Creating an ActionScript communication file in the Flash CS4 start screen
Open the main.asc file and you will see how simple this server-side code really is:
application.onConnect = function(p_client)
{
this.acceptConnection(p_client);
}
All that this code says is that when the movie start playing, the FMS 3.5 server is ready to accept the connection. This is an extremely simple example of a main.asc file. As you start moving into the realm of shared objects and even the use of custom components, this code can become very complex and run hundreds of lines.
Now that you know how these things are structured, it's time to put your new knowledge to good use and stream the video:
When the Actions panel opens, click once in the Script pane and enter the following code:
var nc:NetConnection = new NetConnection();
nc.connect("rtmp://localhost/BabyVultures");
var ns:NetStream = new NetStream(nc);
The big difference from the previous example is in the NetConnection string in line 2. The publishing point has changed from the vod folder, which you
have used in all examples in this series, to BabyVultures, which is the
application.
Note: If you want to add a degree of security or digital
rights management (DRM) to this file, change rtmp to rtmpe and you will automatically encrypt the stream.
Press the Return/Enter key twice and enter the remaining code:
nc.onStatus = function(ncObj:Object) {
trace(ncObj.code);
if (ncObj.code == "NetConnection.Connect.Success") {
ns.setBufferTime(2);
myVideo.attachVideo(ns);
ns.play("mp4:Vultures");
}
};
If you test the movie in Flash at this point (see Figure 5),
the video will play. The great thing about the Flash Media Server is that it is "smart."
When the connection is made, it automatically looks for a streams folder. When
it finds the folder it then thinks, "Ha! The video found in the ns.play() method is in the _definst_ folder!" It immediately scoots into that
folder, finds the video, and tosses it onto the stream.

Figure 5. The code and the application it runs
Now that you know how to play video through an application you create on the FMS server, you might want to expand your knowledge. The best place to start is right here by checking out these articles (currently still focused on FMS 3):
The next article in this series shows you how to encrypt your web video streams and set up SWF verification in Flash Media Server 3.5.