Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Flex > Flex 2, 3 & 4

Reply
 
Thread Tools Rate Thread Display Modes
Old 05-12-2009, 02:32 PM   #1
chandler124
Registered User
 
Join Date: May 2009
Posts: 3
Default Script to modify a database with user variables

Hello,

I develop an application in Flex 3.0. This application deals with a database which appears on the application. Actually, the database appears on the Web page and under it there's a form which recover the datas. For example




Now I made a form like this



Well, when i click on the "OK" button, I would like to put the new datas in the database thanks to the flex app. I don't know how to make the script. Can you help me please ?

Thanks
chandler124 is offline   Reply With Quote
Old 05-12-2009, 03:01 PM   #2
endergrl
Senior Member
 
Join Date: Jan 2009
Location: Raleigh, NC
Posts: 212
Default

I've always had to do this on the backend. Meaning I use externalInterfae.call to pass variables to javascript which then handles the data and committing it to the db.
endergrl is offline   Reply With Quote
Old 05-12-2009, 03:33 PM   #3
tadster
tadster
 
tadster's Avatar
 
Join Date: Feb 2009
Location: Texas
Posts: 2,111
Default

endergrls idea isn't bad if your used to using ajax, or the like, to talk to your server, but you can talk to the server directly from AS3 and mxml.

You'll need to use the flash.net package.. here is an example of sending data to the server:
ActionScript Code:
private function submiter(inp1:String, inp2:String, inp3:String, inp4:String):void { var holdresponse:URLLoader =  new URLLoader(); //the responsecompute function can be set up to do whatever with the server response holdresponse.addEventListener(Event.COMPLETE, responsecompute); //this event for if there is an error holdresponse.addEventListener(IOErrorEvent.IO_ERROR, errorsay); var therequest:URLRequest = new URLRequest("serverpage.aspx"); var varstosend:URLVariables = new URLVariables(); varstosend.oner = inp1; varstosend.twoer = inp2; varstosend.threeer = inp3; varstosend.fourer = inp4; therequest.data = varstosend; therequest.method = URLRequestMethod.POST; holdresponse.load(therequest); }

this is just a general example of sending data to a server within AS3
hope it helps a bit

in your mxml it can be included within <mx:Script> tags
tadster is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[AS3] Trouble Capturing User Selected RadioButton's Labels in Variables JMAndr Components 0 01-23-2009 11:51 AM
Modify htmlText in action script actionScriptorz ActionScript 3.0 3 07-03-2008 08:18 AM
total beginner: pass get variable to code? Terikan Server-Side Scripting 12 06-20-2006 08:47 PM
Sending variables to a mail script geak ActionScript 1.0 (and below) 4 08-14-2001 05:29 PM


All times are GMT. The time now is 03:44 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.