flex java整合小试身手
flex mxml代码如下: <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="657" height="278" minWidth="955" minHeight="600"> <fx:Script> <![CDATA[ import mx.rpc.events.ResultEvent; protected function button1_clickHandler(event:MouseEvent):void { obj.sayHello(text.text); } protected function method1_resultHandler(event:ResultEvent):void { result.text=event.result as String; } ]]> </fx:Script> <fx:Declarations> <s:RemoteObject id="obj" destination="product" endpoint="/helloWorld/messagebroker/amf"> <s:method name="sayHello" result="method1_resultHandler(event)"> </s:method> </s:RemoteObject> </fx:Declarations> <fx:Style> #result{ fontSize:22; fontWeight:bold; fontFamily:"宋体"; color:#00e3e3; } </fx:Style> <s:Button x="140" y="135" label="获取结果" click="button1_clickHandler(event)"/> <s:Label id="result" x="285" y="68" width="235" height="36" backgroundAlpha="0.73"/> <s:TextInput id="text" x="122" y="73"/> <s:Label x="34" y="73" height="21" text="请输入您的姓名"/> </s:Application>
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |