Skip to main content
August 2, 2006
Question

Flash Media Server 2

  • August 2, 2006
  • 2 replies
  • 341 views
We have just installed Flash Media Server 2 on a server here at ISU. I have access to the Macromedia/Flash directory and can place .asc files with in the applications folder with in this directory. I can access the management console as well. I tried to create a sample application provided in the book Flash Professional 8 Lesson 10. It deals with creating a video streaming application that calls an FLV file from the FMS2 and is supposed to load or attach the FLV to the SWF that makes the call. Guess what (probably to no ones surprise) it doesn't work I am going to include the .asc script and the script for the player.

.asc Script:
load("components.asc");
application.onConnect = function( newClient, newUserName, test){
gFrameworkFC.getClientGlobals(newClient).username = newUserName;
// set the user name for any UI component we may have
application.acceptConnection(newClient);
//unconditionally accept our connection
trace("Hello: " + newUserName);
}

Action Script with in the Fla file:

var myVideo:Video;
var playButton:Button;
var pauseButton:Button;

var myNetConnection:NetConnection = new NetConnection();
//establishes the connection
myNetConnection.connect("rtmp:/129.186.168.116/LawnChairLarry/_definst_");

var myNetStream:NetStream = new NetStream(myNetConnection);
myVideo.attachVideo(myNetStream);
myNetStream.play("LawnChairLarry");

playButton.onPress = function(){
myNetStream.pause(false);
}
pauseButton.onPress = function(){
myNetStream.pause(true);
}

There are several things but two that I need help with.

One: How do I need to connect? FMS2 is on a dedicated server and the Fla and SWF files are on my local computer. I would think that I should be able to connect from my local computer through our network.

Two: How can I shut off those annoying security pop ups with in the SWF. Why in the heck (!?@#$!@) do we have to deal with that now? They cause nothing but misery when trying to test something out.

Can someone please help or steer me toward a good solid resource that can give me concrete examples as to how to make this work.

Carroll Altman
    This topic is closed to new replies. Start a new post to keep the conversation going.

    2 replies

    August 2, 2006
    About the security warning... you get that with all .swf's run locally. To get rid of it, follow the link to add the location in the security manager. The link will take you to a page on the adobe site. Just add the path to the .swf, and you won't get that warning anymore.

    About connecting from a local .swf... it will work just fine. It's the flash client that makes the connection, so it doesn't matter where it's served or run from.

    In your main.asc, the code looks good but you don't need to load the component libraries unless you're using components (Communication components, not UI components). Loading them doesn't harm the operation of the application, it just uses memory where you not might need to.

    In your client side AS, try changing the rtmp string to match the following:

    myNetConnection.connect("rtmp://129.186.168.116/LawnChairLarry");

    Note the addition of a second slash after the rtmp, and the absence of the _definst_ instance name. If you want to use the default instance, you don't need to identify it.

    Next, you'll want to make sure the path to your video file looks like this:

    FMS Install Dir/applications/LawnChairLarry/streams/_definst_/LawnChairLarry.flv



    August 4, 2006
    Thanks Jay for your input. I have since been able to make things work. Enjoy your weekend.