Hello all,
I have tried repeatedly to sendAndLoad variables from/to flash and php.
The problem actually comes when passing the variables from php to flash, here is the flash code:
var dataOut:LoadVars = new LoadVars();
var dataIn:LoadVars = new LoadVars();
dataOut.username = _level0.usuario.ss.s1; //passing the value of textbox
dataOut.pass = _level0.contrasena.ss10.s10; //passing the value of textbox
dataOut.sendAndLoad("http://www.itnmexico.com/Pag%20Pstventa/newlogin.php", dataIn, "POST");
_level0.estatus=“Por favor espere…”; //displaying info to the user
dataIn.onLoad = function() {
if (this.valid==“1”) {
_level0.estatus = ‘Bienvenido’ + this.Name;
import com.greensock.*;
TweenMax.to(_level0.usuario, 1, {_x:1000, _alpha:0});
TweenMax.to(_level0.contrasena, 1, {_x:1000, _alpha:0});
TweenMax.to(_level0.ww, 1, {_x:1000, _alpha:0});
}
else {
_level0.estatus = this.retro;
}
}
the php code is the following:
<?php
$usuario=$_POST[‘username’];
$contrasena=$_POST[‘pass’];
$num=1;
if($num==2){
echo 'valid=1&Name= '.$Nombre;
}
else {
echo ‘valid=0&retro=Usuario o contraseña inválidos.’;
}
?>
I have ommited some mysql code, but it would still work this way.
Which is most odd is that when I test the movie in my computer it works perfectly, but when I upload it to the server it doesn’t work anymore.
Please help!!!
Thanks.