# Preloading flv without playing

**URL:** <https://forum.kirupa.com/t/preloading-flv-without-playing/250446>\
**Category:** Uncategorized\
**Created:** [January 29, 2008, 6:06pm UTC](https://forum.kirupa.com/t/preloading-flv-without-playing/250446 "2008-01-29T18:06:20Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![VirgoAnima](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@VirgoAnima](https://forum.kirupa.com/u/VirgoAnima)\
**Post date:** [January 29, 2008, 6:06pm UTC](https://forum.kirupa.com/t/preloading-flv-without-playing/250446/1 "2008-01-29T18:06:20Z")

</div>

Yeah so I’ve been looking for about 4 hours how to make a video preload without playing. I’m looking to make a video preload, move some things around with script, and then play the video flawlessly. I’ve managed to preload the video and halt it from playing by setting the bufferTime to the duration, but this still makes the video play once it has preloaded. I need to preload, then move something, then play. Can anyone help?

Here’s the code I’m using:

```auto

var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
var theduration:Number;

tlm.linevideo.attachVideo(stream_ns);
stream_ns.play("some video url");   
   
stream_ns["onMetaData"]=function(obj){
    theduration = Math.round(obj.duration);
    stream_ns.setBufferTime(theduration);
}
checkBytesLoaded(stream_ns);   

function checkBytesLoaded(my_ns:NetStream) {
    tlm.onEnterFrame=function(){
        var vidper:Number = my_ns.bytesLoaded/my_ns.bytesTotal;
        var pctLoaded:Number = Math.round(vidper* 100);     
        _root.thefeather.thetext.htmlText=pctLoaded;
        if (pctLoaded >= 100) {
            delete this.onEnterFrame;
            //some function would go here
        }   
    }
}

```

---

_[View the full topic](https://forum.kirupa.com/t/preloading-flv-without-playing/250446)._
