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:
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();