⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 exchangedata_xml.mxml

📁 php for flash 之應用試試看
💻 MXML
字号:
<?xml version="1.0" encoding="utf-8"?>
<!--
////////////////////////////////////////////////////////////////////////////////
// ADOBE SYSTEMS INCORPORATED
// Copyright 2007 Adobe Systems Incorporated
// All Rights Reserved.
//
// NOTICE:  Adobe permits you to use, modify, and distribute this file in accordance with the 
// terms of the Adobe license agreement accompanying it.  If you have received this file from a 
// source other than Adobe, then your use, modification, or distribution of it requires the prior 
// written permission of Adobe.
////////////////////////////////////////////////////////////////////////////////
-->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
	layout="absolute"
	backgroundColor="#FFFFFF"
	backgroundAlpha="0">

	<mx:Script>
		<![CDATA[
			import mx.rpc.events.ResultEvent;
			import mx.rpc.events.FaultEvent;
			import mx.controls.Alert;
			
	        public function handleXml(event:ResultEvent):void
            {
				shippingOptionsGrid.dataProvider = event.result.option;
            }

	        public function handleFault(event:FaultEvent):void
	        {
	           Alert.show(event.fault.faultString, "Error");               
	        } 
		]]>
	</mx:Script> 
	
	<!-- PHP URL:
        http://examples.stage.adobe.com/flex3/exchangingdata/xml/xmlHttpService.php  
   -->
   <!-- JSP URL:
        http://examples-s-1.ntbe.adobe.com:8500/flex3samples/exchangingdata/xml/xmlHttpService.jsp
   -->

    <mx:HTTPService id="xmlRpc" 
    	url="http://examples.stage.adobe.com/flex3/exchangingdata/xml/xmlHttpService.php"
    	result="handleXml(event)" 
    	fault="handleFault(event)" 
    	resultFormat="e4x"> 
	    <mx:request>
	        <zipcode>{zipcode.text}</zipcode>
	        <pounds>{weight_lb.text}</pounds>
	    </mx:request>
	</mx:HTTPService>

	<mx:Label x="56" y="32" 
		text="Zip Code" 
		width="55" height="18" 
		textAlign="right" 
		fontWeight="bold" />
	<mx:Label x="56" y="58" 
		text="Weight" 
		width="55" height="18" 
		textAlign="right" 
		fontWeight="bold" />
	<mx:TextInput id="zipcode" 
		x="130" y="32" 
		width="160" height="22" />
	<mx:TextInput id="weight_lb" 
		x="130" y="58" 
		width="160" height="22" />
	<mx:Button x="130" y="95" 
		label="Get Shipping Options" 
		click="xmlRpc.send()" 
		width="160" height="22" />
	<mx:DataGrid id="shippingOptionsGrid"
		x="80" y="141" 
		width="262" height="92" 
		editable="false" 
		enabled="true">
	    <mx:columns>
	        <mx:DataGridColumn headerText="Service" dataField="service" />
	        <mx:DataGridColumn headerText="Price" dataField="price" />
	    </mx:columns>
	</mx:DataGrid>
	
</mx:Application>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -