Flex+FluorineFx与.net基础(四)

修改WEB-INF/flex文件下的services-config.xml配置

<?xml version="1.0" encoding="utf-8" ?> 
<services-config>
    <services>
		<service-include file-path="remoting-config.xml" />
        <!-- <service-include file-path="messaging-config.xml" /> -->
        <!-- <service-include file-path="data-management-config.xml" /> -->
    </services>
    
    <!-- Custom authentication -->
    <security>
		<!-- A security constraint requires that a user is authorized before accessing a destination.
		Here you can declare security constraints globally. When several destinations 
		use the same security settings, you should define one security constraint in the 
		security section of the services configuration file and refer to it in each destination. 				
		-->
		<!-- 
		<security-constraint id="privileged-users">
			<auth-method>Custom</auth-method>
			<roles>
				<role>admin</role>
				<role>privilegeduser</role>
			</roles>
		</security-constraint>    
		 -->

		<!--    
		Custom login command, to check a user's credentials and log a principal into the application server
		A login command must implement the com.TheSilentGroup.Fluorine.Messaging.Security.ILoginCommand interface
		or inherit from com.TheSilentGroup.Fluorine.Messaging.Security.GenericLoginCommand.
		
		You can use a login command without security constraints defined.
		-->
		<!-- 
		<login-command class="FluorineFx.Security.GenericLoginCommand" server="asp.net"/>
		 -->
    </security>
    
    <channels>
        <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="http://localhost/Found/Gateway.aspx" class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
				<!-- <legacy-collection>true</legacy-collection> -->
            </properties>
        </channel-definition>
        <!--
        <channel-definition id="my-rtmp" class="mx.messaging.channels.RTMPChannel">
            <endpoint uri="rtmp://{server.name}:2037" class="flex.messaging.endpoints.RTMPEndpoint"/>
            <properties>
                <idle-timeout-minutes>20</idle-timeout-minutes>
            </properties>
        </channel-definition>
        -->
    </channels>
</services-config>

Flex中的Found.mxml代码

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="init()"
				color="#000000" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#202020, #DFDFDF]" verticalAlign="middle">
	<mx:Script>
		<![CDATA[
			import mx.rpc.events.ResultEvent;
			import mx.collections.ArrayCollection;
			import mx.controls.Alert;
			[Bindable]
			private var Sends:ArrayCollection;
			internal function onClick():void
			{
				service.Echo(txtInput.text);   
			}
			internal function onResult(evt:ResultEvent):void
			{	
				if(txtInput.text.length>1 && txtInput.text.length <6)
				{
					txtResult.text = evt.result.toString();
					txtResult0.text= SendCombo.selectedItem.toString();
				}
			}
			internal function init():void
			{
				service.SendMod();
			}
			private function onSelectSendModHandler(evt:ResultEvent):void
			{
				Sends = evt.result as ArrayCollection;
			}			///ICOWEISIM3 
			private function imgMoOut():void
			{
				ICOWEISIM3.alpha=0.75;
			}
			private function imgMoOver():void
			{
				ICOWEISIM3.alpha=1;
			}
			private function imgClick():void
			{
				navigateToURL(new URLRequest("http://blog.csdn.net/fengziyun"), "_blank"); 
			}
		]]>
	</mx:Script>
	<mx:Style>
		Application{
			backgroundGradientColors:#000000,#c0c0c0;
		}
		Alert {
			/*backgroundAlpha: 0.3;*/
			backgroundColor: #666666;
			orderAlpha: 0.1;
			borderColor: #333333;
			dropShadowEnabled: false;
		}
		.AlertTitle
		{
			font-size: 12pt;
			font-weight: normal;
			font-style: normal;
		} 
		.AlertMessage
		{
			font-size: 12pt;
			font-weight: normal;
			font-style: normal;
		}
		.windowStyles 
		{
			/*font-style:italic;*/
			font-size:12;
		}
	</mx:Style>
	<mx:Panel width="502" height="265" layout="absolute" title="籍贯提交 - http://blog.csdn.net/fengziyun" fontSize="12" verticalAlign="middle" x="71" horizontalAlign="center">
	 <mx:Form width="380" x="14" y="1">
	  
	  <mx:FormItem label="用户名(只能中文):">
	    		<mx:TextInput x="35" y="10" id="txtInput" restrict="{'\u4e00-\u9fa5'}" />
	   <!--restrict="{'\u4e00-\u9fa5'}"中文-->
	  </mx:FormItem>
	  <mx:FormItem label="籍贯:">
	  	<mx:ComboBox editable="true" dataProvider="{Sends}" id="SendCombo" x="35" y="45" width="144"/>
	  </mx:FormItem>
	        <mx:FormItem>
	        	<mx:Button x="35" y="79" label="确 定" id="myButton" fontWeight="normal" click="onClick()"/>
	        </mx:FormItem>
	  <mx:FormItem label="用户名:">
	   <mx:Label text="" id="txtResult" color="#FF6C00" fontSize="16" width="192" x="52" y="125"/>
	  </mx:FormItem>
	        <mx:FormItem label="籍贯:">
	        <mx:Label text="" id="txtResult0" color="#FF6C00" fontSize="16" width="193" x="53" y="152"/>
	        </mx:FormItem>
	    </mx:Form>	
	</mx:Panel>
	<mx:RemoteObject id="service" destination="fluorine" source="FxClass">
             <mx:method name="Echo" result="onResult(event)"/>
			 <mx:method name="SendMod" result="onSelectSendModHandler(event)" />
     </mx:RemoteObject>
     <!--Footer-->
	<mx:StringValidator source="{txtInput}" property="text" 
						tooShortError="用户名输入2至6个字. " 
						tooLongError="用户名输入2至6个字. " 
						minLength="2" maxLength="6"  
						trigger="{myButton}" triggerEvent="click" 
						valid="Alert.show('提交成功!');"/><!---->
	<mx:Grid width="258">
		<mx:GridRow width="100%" height="100%"  horizontalAlign="center">
			
			<mx:GridItem width="217" height="100%" verticalAlign="middle"  horizontalAlign="center">
				<mx:Label text="(" width="15" color="#8E9596" fontSize="18" alpha="0.7"/>
				<mx:Label text="(" width="15" color="#8E9596" fontSize="28" alpha="0.7"/>
				<mx:Image id="ICOWEISIM3" source="assets/128020080630.png" click="imgClick()"
						  width="65" height="64" alpha="0.7" mouseOut="imgMoOut()" mouseOver="imgMoOver()"/>
				<mx:Label text=")" width="15" fontSize="28" color="#8E9596" alpha="0.7"/>
				<mx:Label text=")" width="15" fontSize="18" color="#8E9596" alpha="0.7"/>
			</mx:GridItem>
			
		</mx:GridRow>
	</mx:Grid>
</mx:Application>

最后的结果



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值