# Loading streaming flvs

**URL:** <https://forum.kirupa.com/t/loading-streaming-flvs/330808>\
**Category:** Uncategorized\
**Created:** [March 19, 2013, 3:09pm UTC](https://forum.kirupa.com/t/loading-streaming-flvs/330808 "2013-03-19T15:09:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nhubbell](https://avatars.discourse-cdn.com/v4/letter/n/ecae2f/32.png) [@nhubbell](https://forum.kirupa.com/u/nhubbell)\
**Post date:** [March 19, 2013, 3:09pm UTC](https://forum.kirupa.com/t/loading-streaming-flvs/330808/1 "2013-03-19T15:09:27Z")

</div>

I have an flv loading into a player. I need a script that will tell flash to play as soon as the flv starts to play. I have this code for when it stops:

videoFileName=“video/3-12adv\_LAURA.flv”//assumes the video is in the same folder as the swf  
frameLabelToJumpToWhenDone=“videoDone1” //assumes the the root timeline  
bufferTimeInSeconds=2//amount of video it preloads before playback sarts

var netConn:NetConnection = new NetConnection();  
netConn.connect(null);  
var netStream:NetStream = new NetStream(netConn);  
netStream.onStatus = function(infoObject) {  
if (infoObject.code==“NetStream.Play.Stop”) {  
gotoAndPlay(frameLabelToJumpToWhenDone);  
}  
};  
my\_video.attachVideo(netStream);  
netStream.setBufferTime(bufferTimeInSeconds);  
netStream.play(videoFileName);
