How to specify action to button to submit a form in adobe adobe flex?
+1
A:
You can use the URLRequest and the Loader object.
Your function would look like this: submitForm():void { var req:URLRequest = new URLRequest(yourURL); req.method = URLRequestMethod.POST; var vars:URLVariables = new URLVariables(); vars.yourVar = 'yourValue'; req.data = vars; var ldr:Loader = new Loader(); ldr.load(req); }
and your button would look something like this:
<mx:Button label="Submit" click="submitForm();"/>
See this page for more information.
Gabriel McAdams
2010-10-22 19:59:43
i am getting error in this way ....("Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an unknown type") what i have to do in order to come out of this?
satheesh
2010-10-23 02:32:59
i want to load php file form a page by posting a set of inputs from a form that was developed in adobe flex.by giving the above code it is telling loader file has unknown type.how to load php file?
satheesh
2010-10-23 02:45:52
If the error says that Loader is an invalid type, then you need to add these lines: import flash.events.*; import flash.net.*;
Gabriel McAdams
2010-10-23 04:50:11