Hi, folks
i am newbie in flash and action script devlopment, i am stuck at some point don’t know what to do, this look like stupid but i need help
solution with the comment will be a lot of help…
Problem explanation
i have a registration form in which all the text value from “TextInput” is turned to string values
then these string values has to send to a webservice so that these values will be stored in the data base.
This is the url i am using for webservice
http://mywebserviceurl?method=register&uname=test1&mail=test1@test1.com&password1=password&password2=password&age=27&country=IN
i have written sql query for this in server db, you just have to send values to below parameters, rest of the thing will be done in server
This what so far i have gone
import alducente.services.WebService;
import flash.events.*;
import flash.net.URLLoader
import flash.net.URLRequest
function tiListener(evt_obj:Event){
if (tpassword2.text != tpassword1.text || tpassword2.length < 4) {
trace("Password is incorrect. Please re-enter it.");
}
else {
var password2:String = tpassword2.text;
var password1:String = tpassword1.text;
var uname:String = tuname.text;
var mail:String = tmail.text;
var age:String = tage.text;
var country:String = tcountry.text;
//trace(uname);
//trace(mail);
//trace(password1);
//trace(password2);
//trace(age);
//trace(country);
}
}
Submit.addEventListener(MouseEvent.CLICK, callWS)
function callWS(e:MouseEvent){
passDataToWs('uname', 'mail', 'password1', 'password2', 'age', 'country')
}
function passDataToWs(uname, mail, password1, password2, age, country){
var ws:WebService = new WebService();
ws.addEventListener(Event.CONNECT, connected);
ws.connect("http://provideWebserviceUrlHere?WSDL");
ws.cacheResults = true;
var initTime:Number;
function connected(evt:Event):void{
initTime = getTimer();
ws.METHOD_NAME(done, uname, mail, password1, password2, age, country);
ws.METHOD_NAME(done2)
//what is "done", "done2" refers for
}
function done(serviceRespone:XML):void{
trace("
Web Service Result: ");
var time:Number = getTimer();
trace("Call duration: "+(time - initTime)+" milliseconds");
initTime = time;
}
function done2(serviceRes:XML):void {
ws.clearCache();
trace("
Cache was cleared");
}
}
if this post belongs to some other place please move it
eagerly waiting for the solution
Thanks