Groups | Blog | Home
all groups > flash data integration > october 2005 >

flash data integration : sendAndLoad silent failure


vectorclient
10/12/2005 1:08:52 PM
I have used sendAndLoad with the XML object before to update data inside a
movie clip, using Flash 2004. In my very first data related project using
Flash 8, I've gotten stumped.

I'm communicating with mysql through php, a small app that allows updating
recordsets. When submitting a change back to the server, I can get send to
work fine, but I dont want the popup window, so I need to use sendAndLoad.

But when I change my method to sendAndLoad("scriptpath.php", results_mc,
"POST") It just does nothing. As if I didnt even click the button. If changed
back to just a send, it immediately works, bringing the servers response up in
a popup.

I am sure my syntax is correct, and I've tried it from a button, a movieclip,
and from _root, with and without onData or onLoad handlers, and from the IDE
and the browser, with the exact same results. Is this a Bug, or am I missing
something vital?
JayCharles
10/13/2005 6:41:13 PM
vectorclient
10/14/2005 12:00:00 AM
I switched to using loadVariables from a movie clip just to get it working.
I'm sure youre right that its not version 8 though, because I just recompiled
an older fla that uses sendAndLoad and it works fine.

Any way here is what I have setup. After datafields have been edited, the
user clicks a button to submit changes, which brings up a "are you sure" dialog
box. At that point the dialog box gets all the var to be changed and gets a
loadVars ready.
If the user clicks yes the dialog box sets the variables and performs the
following operation:

myLoadVars.sendAndLoad("http://myurl.com/update.php", results_mc, "POST");

I've also tried with event handlers like so:

var myVars:LoadVars = new LoadVars();
myVars.onLoad = function(success:Boolean) {
if (success) {
results.text = Update Successful;
} else {
results.text = "Error";
};

myVars.sendAndLoad("http://www.myurl/update.php", results_mc, "POST");

Now from there i can simply change the method to send and change the target
parameter appropriately, and it will hit the script. Its as if I'm missing a
vital peice of code...do you see where? Thanks for your reply.
AddThis Social Bookmark Button