Groups | Blog | Home
all groups > flash actionscript > may 2004 >

flash actionscript : LoadVars Problem in external class. HELP!


drtnbmwflash
5/18/2004 10:10:06 PM
Hi

Hope someone can help.

I have a class file named SMTPmail that sends an email. It exposes a bunch of
properties and a Send method.

I call the class from the onClick of a button like this:

var mailer:SMTPMail = new SMTPMail();
mailer.To = this._parent.txtTo.text;
mailer.From = this._parent.txtFrom.text;
mailer.Subject = this._parent.txtSubject.text;
mailer.Message = this._parent.txtBody.text;
mailer.Password = "webservicestest";
var RC:String = "blah";
RC = mailer.Send();

trace("Loaded = " + mailer.myVars.loaded); // <-- this is always false
trace("Returned from Send()");
trace("RC = " + mailer.ReturnValue); // <-- always undefined

The problem is, the ReturnValue property is always undefined. Using trace I
found that the my Send method returns immediately. It does not wait for my
onLoad function to fire inside the class file. The mail sends ok, but I never
get the return code, coz the method call returns too fast.

Any ideas. This is quite urgent.

Please email me if you post a response.

Thanks in adavnce

Regards

Mark Nash
mark.nash@datareturn.com


S1n0Byt3}:
5/18/2004 10:12:32 PM
AddThis Social Bookmark Button