Why would LoadVar .send work but sendAndLoad does NOT?

  • dkardell
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jan 23, 2007
  • Posts: 11
  • Status: Offline

Post January 23rd, 2007, 10:35 am

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
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post January 23rd, 2007, 10:35 am

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Joined: Nov 05, 2004
  • Posts: 1254
  • Loc: Ro
  • Status: Offline

Post January 23rd, 2007, 10:46 pm

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
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”
  • dkardell
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jan 23, 2007
  • Posts: 11
  • Status: Offline

Post January 24th, 2007, 8:21 am

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
  • Joined: Nov 05, 2004
  • Posts: 1254
  • Loc: Ro
  • Status: Offline

Post January 24th, 2007, 2:26 pm

in your php you have to do ... this:
[code]
<? echo "welcomeMessage=if you can see this then it's working";
?>
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”
  • dkardell
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jan 23, 2007
  • Posts: 11
  • Status: Offline

Post January 24th, 2007, 10:20 pm

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
  • Joined: Nov 05, 2004
  • Posts: 1254
  • Loc: Ro
  • Status: Offline

Post January 25th, 2007, 1:14 am

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)
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 36 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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.