# Help in stream video

**URL:** <https://forum.kirupa.com/t/help-in-stream-video/153406>\
**Category:** programming\
**Created:** [July 1, 2005, 6:26am UTC](https://forum.kirupa.com/t/help-in-stream-video/153406 "2005-07-01T06:26:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![milkbottle](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@milkbottle](https://forum.kirupa.com/u/milkbottle)\
**Post date:** [July 1, 2005, 6:26am UTC](https://forum.kirupa.com/t/help-in-stream-video/153406/1 "2005-07-01T06:26:15Z")

</div>

hi… i have problems again… Does anyone noe how to use NetStream() method?? i have use it in my action script as i need to stream a recorded FLV. However, i dun noe y when i set the BufferTime the user have to wait very long for the video to finish buffering b4 it play. Is there any way to preload it first b4 it play?? Below is my script:

=========================================  
//create a new instance of the netConnection object  
myConnection\_nc = new NetConnection();  
//handle any status changes and responses from the server  
myConnection\_nc.onStatus = function(info)  
{  
trace(“LEVEL:” +info.level+ "CODE: " +info.code);  
startStreamSubscribe();  
};  
startStreamSubscribe = function () {

//streamName =“Scene10\_760”;  
//start a new NetStream channel in the myConnection\_nc  
play\_ns = new NetStream(myConnection\_nc);  
//define an onStatus() function for the netstream  
play\_ns.onStatus = function(info){  
trace(“NETSTREAM LEVEL” + info.level + "CODE: "+ info.code);  
}  
//attach the video stream to the embedded video object  
my\_video.attachVideo(play\_ns);  
play\_ns.setBufferTime(30);  
play\_ns.play(“Scene10\_760”);

//play\_ns.play(streamName);

};  
stopPlay = function() {  
//change the button label, and the click handler  
play\_pb.setLabel("Start Playing ");  
play\_pb.setClickHandler(“startPlay”);

//close the NetStream to stop the play  
play\_ns.close();

};  
startPlay = function () {  
//change the button label, and the click handler  
play\_pb.setLabel(“Stop Playing”);  
play\_pb.setClickHandler(“stopPlay”);

# //attach the NetStream as the video source my\_video.attachVideo(play\_ns); play\_ns.play(“Scene10\_760”,-2,-1); }; //make the connection to the server myConnection\_nc.connect(“rtmp://172.16.218.16/media\_presentation1/video”); stop();

thanks:puzzle:
