Har lite problem med sendAndLoad i loadVars klassen.
Får undefined när jag vill testa en variabel som jag får från en phpfil.
Variabelsn jag vill ha är sent som skrivs ut med echo i php,
if ($write){
echo 'sent=OK';
}else{
echo 'sent=failed';
}
//actionscript
lv = new LoadVars();
new_lv = new LoadVars();
new_lv.onLoad = function() {
if (this.sent == "OK") {
statusmsg.text = this.sent;
play();
} else {
statusmsg.text = this.sent;
play();
}
};
function sendMessage() {
lv.text1 = t1.text;
lv.sendAndLoad("textfiles/movie1writer.php", new_lv, "POST");
statusmsg.text = "checking...";
}
<?
$fd = fopen("movie1.txt", "w");
$write = fwrite($fd, "text1=$text1");
if ($write){
echo 'sent=OK';
}else{
echo 'sent=failed';
}
fclose($fd);
?>