How can I send data to database via Flash using XML?

Hello Experts,

I would like to have a form within my flash file to pass the field data to a database table. Form has on two fields:

First Name
Last Name

Submit Button

How can I pass this information on to the database table. I am able to read the data via XML but have no clue how to write it DB. Any help would highly be appreciated.

Thanks a lot.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RobOwner (Aidellio)Commented:
You will need to use a server side script or flash remoting.  Are you currently using PHP, coldfusion, etc?
RobOwner (Aidellio)Commented:
When using a server side script you would use the following code.  You would be able to acccess the two variables in your server side script (first_name and last_name), connect to your backend database and upload the values

var submitListener:Object = new Object(); = function(evt:Object) {
	var result_lv:LoadVars = new LoadVars();
	result_lv.onLoad = function(success:Boolean) {
		if (success) {
			result_ta.text = result_lv.welcomeMessage;
		} else {
			result_ta.text = "Error connecting to server.";
	var send_lv:LoadVars = new LoadVars();
	send_lv.first_name = name_first.text;
	send_lv.last_name = name_last.text;
	send_lv.sendAndLoad("",result_lv, "POST");

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
combustion007Author Commented:
Thank you so much for you help. I would like to use MS ACCESS to set up the testing environment and for production, will be using MS SQL. I don't want to use loadvar because security is very important that is why I exploring XML for the task.

Appreciate all the help.
RobOwner (Aidellio)Commented:
There shouldn't be any security risks using loadVars and the POST method... no more than XML.  LoadVars would be a lot easier to use initially anyway.

sounds like you will be using windows / iis so your server side script will probably ASP which will integrate nicely with MS ACCESS or MS SQL.

Let me know if there is anything else I can help you with
what would the server side script look like? do you have an example to send updated variables?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.