# FLVPlayback load 50% then play

**URL:** <https://forum.kirupa.com/t/flvplayback-load-50-then-play/255523>\
**Category:** flash\
**Created:** [March 24, 2008, 12:47pm UTC](https://forum.kirupa.com/t/flvplayback-load-50-then-play/255523 "2008-03-24T12:47:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anthonws](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@anthonws](https://forum.kirupa.com/u/anthonws)\
**Post date:** [March 24, 2008, 12:47pm UTC](https://forum.kirupa.com/t/flvplayback-load-50-then-play/255523/1 "2008-03-24T12:47:07Z")

</div>

Hello guys,

My 1st post here 🙂

I’m trying to publish a video in a way that it would only play after 50% is loaded.

I’m using CS3 with AS 2.0.

Here is the code that I found online and adapted:

```auto

import mx.video.*;
var listenerObject:Object = new Object();

listenerObject.ready = function(eventObject:Object):Void {
    my_FLVPlybk.pause();
    trace("State is " + eventObject.state);
    // display the no. of bytes loaded at this point
    trace("Bytes loaded: " + my_FLVPlybk.bytesLoaded + " Bytes Total / 2: " + (my_FLVPlybk.bytesTotal / 2));
    while(my_FLVPlybk.bytesLoaded < (my_FLVPlybk.bytesTotal / 2)){
    }
    trace("Loaded!");
    my_FLVPlybk.play();
};
my_FLVPlybk.contentPath = "teste.flv";
my_FLVPlybk.addEventListener("ready", listenerObject);

```

There is no output error when I test locally but with the online test my browser tells me that the script is taking to long to bla bla bla…

I’m new to AS so be gentle 😛

Thank you all!

Anthon.
