I'm a noob...but this is how I send data to my rails server...
<mx:HTTPService id="editCustomerUpdate" contentType="application/xml"
url="http://nycopt:3000/customers/edit" method="POST">
<mx:request xmlns="">
<customer>
<firm>{firm.text}</firm>
<acct>{account.text}</acct>
<subacct>{subacct.text}</subacct>
<cmta>{cmta.text}</cmta>
<address1>{address1.text}</address1>
<address2>{address2.text}</address2>
<city>{city.text}</city>
<state>{state.text}</state>
<zip>{zip.text}</zip>
<trader>{trader.text}</trader>
<trader_phone>{trader_phone.text}</trader_phone>
<acct_pay_contact>{acct_pay_contact.text}</acct_pay_contact>
<acct_pay_phone>{acct_pay_phone.text}</acct_pay_phone>
</customer>
</mx:request>
</mx:HTTPService>
....cut above...
mx:FormItem label="AP Phone">
<mx:TextInput id="acct_pay_phone" width="100%"
text="{acct_pay_phone}" />
</mx:FormItem>
</mx:Form>
<mx:HBox horizontalAlign="center" width="100%">
<mx:Button
click="editCustomerUpdate.send();PopUpManager.removePopUp(this)"
label="Update"/>
...cut below...
--- In [email protected], grimmwerks <[EMAIL PROTECTED]> wrote:
>
> Trying to simplify this:
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
> layout="absolute" >
> <mx:HTTPService id="temp" url="http://localhost:3000/signup/
> register" result="resBack(event)" resultFormat="e4x" method="POST" />
> <mx:TextArea id="txt" width="771" height="251"/>
> <mx:Button click="sendIt()" label="Click" x="335" y="259"/>
> <mx:Script>
> <![CDATA[
> public function sendIt():void{
> temp.send({first_name: "first name"});
> }
>
> private function resBack(event:Event):void{
> txt.text = String(temp.lastResult);
> }
> ]]>
> </mx:Script>
> </mx:Application>
>
>
>
> But when I click the button, I get:
>
> TypeError: Error #1009: Cannot access a property or method of a null
> object reference.
> at test/sendIt()
> at test/___Button1_click()
> at [mouseEvent]
>