Skip to main content
Participant
October 17, 2006
Question

Playing a recorded flv in flash 8

  • October 17, 2006
  • 1 reply
  • 202 views
Can anyone help me?
I have developed a web application, in which I have developed actionscript to record a voice message from Mic and flv is stored in Local Communication Server MX. Flv is stored but when I want it to play again. I can not. What would be the problem? I am using Flash 8, AS 2.
Actionscritpt is:
function doPlay ()
{
if (Play_btn.getLabel() == "Play")
{
// Create input stream
in_ns = new NetStream(_root.client_nc);
//in_ns.play(numb);
in_ns.play(randomtxt.text);
in_ns.onStatus = function(info)
{
// Handle errors and stream stopping
if ( info.level == "error" || info.code == "NetStream.Play.Stop" )
{

while (in_ns.bufferLength > 0 ) {
Status_msg.text += "Waiting to clear buffer..."
}
Play_btn.setLabel("Play");
}
}

} else if (Play_btn.getLabel() == "Stop")
{
in_ns.onStatus = null;
// Close the stream
in_ns.close();
Play_btn.setLabel("Play");
}

}
    This topic has been closed for replies.

    1 reply

    October 19, 2006
    Your client-side looks okay - are you sure you're connecting to the server? In main.asc in your directory, place a trace call to make sure you're connected and give it a try.

    I see you connecting to a NetConnection instance of _root.client_nc, but I don't see it defined here. That could be your trouble if it isn't defined (i.e. var nc:NetConnection = new NetConnection; nc.connect("rtmp://whatever.com/path/to/application/")), but if it is, then you may be having problems connecting.

    I'm pretty new to FMS so I could be totally wrong, but I'd look at that first.