Answered
Why lVars.sendAndLoad does not work!!!
Hello,
I am trying to get a response from a php script, but lVars.onLoad is never fired. I checked the url using my browser and it works fine, but can't get it work from Flash.
I will appreciate any help.
---- The code -------
AS:
stop();
var lVars:LoadVars = new LoadVars();
var int_id:Numeric;
lVars.onLoad = function(ok:Boolean) {
trace("OnLoad");
this.displayMessage = function(success) {
trace("DisplayMessge");
if (success) {
lblMessage.text = this.message;
} else {
lblMessage.text = "Failed";
}
trace("Message: "+lblMessage.text);
}
this.displayMessage(ok);
};
this.runScript = function() {
trace("Run Script");
//lVars.message = "";
lVars.sendAndLoad(" http://223.0.0.60/Flawless/medallionAlerts.php", lVars, "POST");
trace("PHP Sent. Message: " + lVars.message);
};
int_id = setInterval(this, "runScript", 1000*10);
trace("Interval set");
PHP:
<?
error_reporting(0);
session_start();
include_once("includes/incDb.php");
include_once("includes/functions.php");
$link=db_connect();
$id = 10;
$message = getMedPrivLink($id);
echo ("&message=" . $message);
?>
What am I missing?
Thank you,
Carlos
I am trying to get a response from a php script, but lVars.onLoad is never fired. I checked the url using my browser and it works fine, but can't get it work from Flash.
I will appreciate any help.
---- The code -------
AS:
stop();
var lVars:LoadVars = new LoadVars();
var int_id:Numeric;
lVars.onLoad = function(ok:Boolean) {
trace("OnLoad");
this.displayMessage = function(success) {
trace("DisplayMessge");
if (success) {
lblMessage.text = this.message;
} else {
lblMessage.text = "Failed";
}
trace("Message: "+lblMessage.text);
}
this.displayMessage(ok);
};
this.runScript = function() {
trace("Run Script");
//lVars.message = "";
lVars.sendAndLoad(" http://223.0.0.60/Flawless/medallionAlerts.php", lVars, "POST");
trace("PHP Sent. Message: " + lVars.message);
};
int_id = setInterval(this, "runScript", 1000*10);
trace("Interval set");
PHP:
<?
error_reporting(0);
session_start();
include_once("includes/incDb.php");
include_once("includes/functions.php");
$link=db_connect();
$id = 10;
$message = getMedPrivLink($id);
echo ("&message=" . $message);
?>
What am I missing?
Thank you,
Carlos
