# LoadVars sendandload only works first time!

**URL:** <https://forum.kirupa.com/t/loadvars-sendandload-only-works-first-time/317109>\
**Category:** flash\
**Created:** [December 10, 2010, 5:58pm UTC](https://forum.kirupa.com/t/loadvars-sendandload-only-works-first-time/317109 "2010-12-10T17:58:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kungfuafrican](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@kungfuafrican](https://forum.kirupa.com/u/kungfuafrican)\
**Post date:** [December 10, 2010, 5:58pm UTC](https://forum.kirupa.com/t/loadvars-sendandload-only-works-first-time/317109/1 "2010-12-10T17:58:40Z")

</div>

I just need this flash file to continually poll a php script which will return the size of a file for a progress indicator. It returns the initial size of the file, but never refreshes. If I run the movie over and over it shows the current size correctly, but sendandload refuses to work twice in a row from the same playthrough. I’m using unique indentifiers, i’ve tried get and post, I’ve tried using setinterval as opposed to just using the timeline to loop back to frame 1 after a few seconds. I’ve tried no-cache headers on the php file. Nothing works. Does anyone know what is going on here?

Here is my actionscript:

```auto
var result_lv:LoadVars = new LoadVars;
result_lv.onLoad = function(success){
   if (success) {
      filesize = result_lv.filesize;
         if (filesize != "" && filesize != undefined) {
            size_display.text = filesize;
            delete result_lv; 
            delete send_lv;
            gotoAndPlay(2);
         }
      } else {
         size_display.text = "";
         delete result_lv; 
         delete send_lv;
         gotoAndPlay(2);
      }
}

var send_lv:LoadVars = new LoadVars;
orig_album = "81";
orig_filename = "300-tlr1_h480p.flv";
send_lv.albumID = orig_album;
send_lv.filename = orig_filename;

send_lv.sendAndLoad("size_check.php?ck=" + new Date().getTime(), result_lv, "POST");

stop();         

```
