cheers for your quick response Greg. Seems to be a scoping problem as
it's working now:
function sendData() {
trace("sendData");
var tmp = this
result_lv = new LoadVars();
result_lv.onLoad = Delegate.create(tmp, onXmlLoaded);
On 22 May 2008, at 13:27, Glen Pike wrote:
Hi,
Have you tried renaming the function and swapping the order of
trace
/ function call?
Glen
Ali Drongo wrote:
Hiya, I have a custom class with a loadvars object to post to a php
script. For some reason my failed method won't fire.
Can anyone suggest why?
Thanks :)
Ali
//code from inside my class
//this is not firing
function failed(){
trace("failure fired")
}
function onXmlLoaded(success:Boolean) {
trace("onXmlLoaded:"+success);
if (success) {
trace("success");
sent();
} else {
//this traces
trace("failure");
//but this method wont fire :(
failed();
}
}
function sendData() {
trace("sendData");
result_lv = new LoadVars();
result_lv.onLoad = Delegate.create(this, onXmlLoaded);
send_lv = new LoadVars();
send_lv.ToAddress = email_txt.text;
send_lv.Language = _root.lang;
trace("vars sending:"+send_lv.ToAddress
+":"+send_lv.Language);
send_lv.sendAndLoad("card_sender.php", result_lv, "POST");
}
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
--
Glen Pike
01326 218440
www.glenpike.co.uk <http://www.glenpike.co.uk>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
--------------------------------------------------------------------------
Alistair Colling
Interactive Developer
FPP Brand Communications (Newcastle upon Tyne)
The Courtyard
Dinsdale Place
Sandyford
Newcastle upon Tyne NE2 1BD
Telephone: +44 (0)191 261 6662
Fax: +44 (0)191 233 2511
This transmission is confidential and intended solely for the person or
organisation to whom it is addressed.
It may contain privileged and confidential information. If you are not the
intended recipient, you should not
copy, distribute or take any action in reliance on it. If you have received
this transmission in error, please
notify the sender at the e-mail address above.
FPP Design Limited. Reg. Office: The Courtyard, Dinsdale Place, Sandyford, Newcastle upon Tyne NE2 1BD.
Registered Number 3775564. Registered in England and Wales. Visit our website at http://www.fpp.net/
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders