parent
c6acc925a0
commit
8a0608152e
@ -1,9 +1,47 @@
|
||||
<mx:Application name=""
|
||||
xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
|
||||
<mx:Label x="54" y="25" text="Zip Code"/>
|
||||
<mx:Label x="65" y="51" text="Weight"/>
|
||||
<mx:TextInput x="128" y="23" id="zipcode"/>
|
||||
<mx:TextInput x="128" y="49" id="weight_lb"/>
|
||||
<mx:Button x="128" y="79" label="Get Shipping Options"/>
|
||||
<mx:TextArea x="339" y="24" width="198" height="77" id="shippingOptions"/>
|
||||
xmlns:mx="http://www.adobe.com/2006/mxml"
|
||||
layout="absolute"
|
||||
backgroundColor="#FFFFFF"
|
||||
backgroundImage="">
|
||||
|
||||
<mx:Script>
|
||||
<![CDATA[
|
||||
|
||||
import mx.rpc.events.ResultEvent;
|
||||
import mx.rpc.events.FaultEvent;
|
||||
import mx.controls.Alert;
|
||||
|
||||
|
||||
private function handlePlain(event:ResultEvent):void
|
||||
{
|
||||
shippingOptions.htmlText = event.result.toString();
|
||||
}
|
||||
|
||||
|
||||
private function handleFault(event:FaultEvent):void
|
||||
{
|
||||
Alert.show(event.fault.faultString, "Error");
|
||||
}
|
||||
|
||||
]]>
|
||||
</mx:Script>
|
||||
|
||||
<mx:HTTPService id="plainRPC" url="http://localhost:18080/text"
|
||||
result="handlePlain(event)"
|
||||
fault="handleFault(event)"
|
||||
resultFormat="text">
|
||||
<mx:request xmlns="">
|
||||
<zipcode>{zipcode.text}</zipcode>
|
||||
<pounds>{weight_lb.text}</pounds>
|
||||
</mx:request>
|
||||
</mx:HTTPService>
|
||||
|
||||
<mx:Label x="54" y="25" text="Zip Code"/>
|
||||
<mx:Label x="65" y="51" text="Weight"/>
|
||||
<mx:TextInput x="128" y="23" id="zipcode"/>
|
||||
<mx:TextInput x="128" y="49" id="weight_lb"/>
|
||||
<mx:Button x="128" y="79" label="Get Shipping Options"
|
||||
click="plainRPC.send();" />
|
||||
<mx:TextArea x="339" y="24" width="198" height="77" id="shippingOptions"/>
|
||||
|
||||
</mx:Application>
|
||||
|
Loading…
Reference in new issue