all groups > macromedia flash flash remoting > june 2004 >
You're in the

macromedia flash flash remoting

group:

LoadVars.send()...please help! Gotta B a way!


LoadVars.send()...please help! Gotta B a way! Sharkmenace
6/19/2004 4:00:29 AM
macromedia flash flash remoting:
Wow, the posts in this forum looks reeal skimpy.

I've finally gotten to the .send() method to work and it brings frustration to
know tha macromedia has still not built a solid programming model. >>taking
deep breaths<<

I'm new to remoting & PHP and my server doesn't allow sockets :( WTF!

Well, enough wining! Here's the problem. I keep getting a window for my .php
script when a send is made...sounds familiar?

Is there anyway to get around this?
The send doesn't seem to work if I don't supply a target and send ("POST")
method
Re: LoadVars.send()...please help! Gotta B a way! nerkette
6/23/2004 2:01:34 PM
Hi,

Could you post an example of your code call? That would help a bit. And what
version are you running?

But this might be a solution. I've had similar issues before and had to try a
few things out. It might be related to the target you are specifying. If you
put '0' it loads the variables to the root file. If you put '_self', it pops up
a new window. But I tried just leaving the target blank with only the quotes
like this ('') and for some reason, that worked. Script processed and no window
opened. Hope this helps.
Re: LoadVars.send()...please help! Gotta B a way! Sharkmenace
6/23/2004 3:20:01 PM
I tried that but it doesn't seem to work. What happens is that once the file on
the server has changed then the variables will seem to have the right values,
but in fact the variables haven't been updated.
the code is simple, because it's really just a test of the keywords
functionallity. I set some variables to a value. Send it to the PHP script.
change the variables then download them again to see if I get the original
values.


Vars = new LoadVars();
Vars.onLoad = function(success) {
if (success) {
portTxt.text = "x = "+Vars.x+", y = "+Vars.y;
}
};
Vars.x=50
Vars.y=165
Vars.send("Vars.php", "", "POST");
Vars.x=0
Vars.y=0
Re: LoadVars.send()...please help! Gotta B a way! nerkette
6/23/2004 8:05:30 PM
With the LoadVars.send method, If the target parameter is specified, the
server's response is displayed in the browser frame window named target. If the
target parameter is omitted, the server's response is discarded.
Since you are only using send, your response is being omitted.

You may want to try this code instead

Vars.sendAndLoad("Vars.php", "", "POST");

It is supposed to send your variables, and then load the updated variables
back into the specified object so you can retrieve them again.

AddThis Social Bookmark Button