Why would LoadVar .send work but sendAndLoad does NOT?

  • dkardell
  • Newbie
  • Newbie
  • dkardell
  • Posts: 11

Post 3+ Months Ago

Anyone know why

my_lv.send("http://www.yourdomail.com/email.php", "_blank", "GET");

would work but

my_lv.sendAndLoad("http://www.yourdomail.com/email.php", result_lv, "GET");

doesn't call email.php?


I also have coded in my flash:

result_lv.onLoad = function(success:Boolean) {
if (success) {
status_txt.text = result_lv.welcomeMessage;
} else {
status_txt.text = "Error connecting to server.";
}

And it says Error connecting to server every time where as the .send works just fine but I don't want the browser window to open.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

hmm ... from some obscure and unknown reason, sendAndLoad works here.
BTW, you can use "_self" instead of "_blank" in the .send method.

This is my code for sendAndLoad:
Code: [ Select ]
var my_lv:LoadVars = new LoadVars();
var result_lv:LoadVars = new LoadVars();

my_lv.sendAndLoad("savedata.asp", result_lv, "GET");
result_lv.onLoad = function(success:Boolean)
{
    if (success)
    {
        status_txt.text = result_lv.welcomeMessage;
    }
    else
    {
        status_txt.text = "Error connecting to server.";
    }
}
stop();
  1. var my_lv:LoadVars = new LoadVars();
  2. var result_lv:LoadVars = new LoadVars();
  3. my_lv.sendAndLoad("savedata.asp", result_lv, "GET");
  4. result_lv.onLoad = function(success:Boolean)
  5. {
  6.     if (success)
  7.     {
  8.         status_txt.text = result_lv.welcomeMessage;
  9.     }
  10.     else
  11.     {
  12.         status_txt.text = "Error connecting to server.";
  13.     }
  14. }
  15. stop();


and in savedata.asp, i have only
<%
Response.Write("welcomeMessage=hello world")
%>

And to test it, i used local host, (i have IIS enabled).
For php is the same thing .... so it should work
  • dkardell
  • Newbie
  • Newbie
  • dkardell
  • Posts: 11

Post 3+ Months Ago

Any idea what the PHP equivalent of

Response.Write("welcomeMessage=hello world") is.

I'm still not sure once this works what result_lv is looking for in order to populate.

I tried what you did above sending to my php and what I get back is \

"undefined" in my status msg (which I guess is from the following because the PHP is not getting called). Note: I put in a file write that will tell me if the PHP is called and it is not (but I can invoke it if I try going directly to the PHP from my browser).

(thanks on the _self in place of _blank - I was trying to see if I could just use send and not get a window to come up at all but can't stop the window opening so that's why I'm trying the sendAndLoad.

Any other idea's?

Thanks!@
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

in your php you have to do ... this:
[code]
<? echo "welcomeMessage=if you can see this then it's working";
?>
  • dkardell
  • Newbie
  • Newbie
  • dkardell
  • Posts: 11

Post 3+ Months Ago

yep, tried, that .. still same thing. Is there something that PHP might not be allowing Flash to call it with sendAndLoad where it does with just send?

Dan
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

no, there aint such thing. Mail me your fla and php file to see what u did wrong. See my mail in my profile (yahoo id + @yahoo.com :P)

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 9 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.