hi glen,
I just found out that the problem is that 1) you r right, I should use the
object instead of the frame name. and 2) the line that attibutes the onLoad
method to a outside function wasn't working. Once I put together the onLoad
mehtod inside the same function that i was calling the sendandload it
worked. I guess it was a scope problem, but still, I already used loadvars
associating the onLoad to an outside function just like the first example
and it worked. anyway thanks for the valuable help and this is the final
code:
lvEmailSnd = new LoadVars();
lvEmailSnd.email = txtEmail.text;
lvEmailSnd.dataRecup = myDateStr;
lvEmailSnd.onLoad = _root.retornoBuscaEmail; <- wasn't working, changed
to:
lvEmailSnd.onLoad = function() {
code,
code,
code.
}
lvEmailSnd.sendAndLoad("usuarios/procuraemail.asp",lvEmailSnd,"POST");
----- Original Message -----
From: "Glen Pike" <[EMAIL PROTECTED]>
To: <flashcoders@chattyfig.figleaf.com>
Sent: Wednesday, May 23, 2007 8:05 PM
Subject: Re: [Flashcoders] sendandload method fails inside a frameset.
Hi,
With LoadVars.sendAndLoad() the second parameter is the name of an object
not a frame that will receive data, e.g.
mSendVars = new LoadVars();
mLoadVars = new LoadVars();
mSendVars.sendAndLoad(mPostURL, mLoadVars, "POST");
The onload event should be fired for the target, so.
mLoadVars.onLoad = function(success:Boolean) {
trace(stMail);
};
You don't have to use 2 LoadVars objects, you can use them both to send
and receive data if you like:
mLoadVars.sendAndLoad(mPostURL, mLoadVars, "POST");
Hope this helps...
Glen
Rodrigo Augusto Guerra wrote:
hi all,
I'm having some problems using sendandload method within a html frame.
I have an asp page that is a frameset with 2 rows, header and content.
the content frame name is "principal".
Took me some time to discover first of all that I need pass the frame
name in the sendandload method, as a return object otherwise the values
*are not* received correctly by the asp page (at least I wasn't able to
do it).
In the principal frame, I have a swf that calls a asp page that do some
DB check and return a variable/value to flash( eg: stMail=0) . Testing
with *send* method it works and I can see the result displayed inside the
frame by the asp response.write. But when I try to use sendAndLoad looks
like that it doesn't execute the onLoad method.
I believe that this is due to the fact that I specify the *frame name* in
the LoadVars return object,but if i don't the asp page will not receive
the values from flash and continue the processing in the asp page. I also
tried specify a function for the onLoad without success.
How the object knows what it should execute when loads if in the object
parameter i specify the frame name?
my code:
lvEmailSnd = new LoadVars();
lvEmailSnd.email = txtEmail.text;
lvEmailSnd.dataRecup = myDateStr;
lvEmailSnd.onLoad = _root.retornoBuscaEmail;
lvEmailSnd.sendAndLoad("usuarios/procuraemail.asp","principal","POST");
here dosen't work
// lvEmailSnd.send("usuarios/procuraemail.asp","principal","POST");
// here works
and my onload function (never ever called back) :
function retornoBuscaEmail(success){
mytext.text = success
}
any help will be *very* welcome.
thanks
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com