tags:

views:

26

answers:

1

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
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
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
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