易截截图软件、单文件、免安装、纯绿色、仅160KB

Flex通过HTTPService与servlet通信

flex代码:
<?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/halo" minWidth="1024" minHeight="768">
<fx:Script>
<!--[CDATA[
import mx.controls.*;
import mx.rpc.events.ResultEvent;
import mx.rpc.http.mxml.HTTPService;

protected function button1_clickHandler(event:MouseEvent):void
{
var addNew:HTTPService = new HTTPService();
addNew.resultFormat = "text" ;
addNew.method = "POST";
addNew.url = "http://localhost:8084/Flex_web/flex";
addNew.addEventListener(ResultEvent.RESULT,result_Handler);

var param:Object = new Object();
param.user = user.text;
param.pwd = pwd.text;

addNew.send(param);
}

public function result_Handler(event:ResultEvent):void
{
var mes:String = event.message.body.toString();
Alert.show("成功!" + mes,"信息");
}
]]-->
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:Panel x="200" y="110" width="224" height="157" title="登录系统">
<s:Button x="24" y="92" label="登录" click="button1_clickHandler(event)" width="171" focusEnabled="true"/>
<s:TextInput x="67" y="10" id="user"/>
<s:TextInput x="67" y="49" id="pwd"/>
<s:Label x="20" y="15" text="用户名:"/>
<s:Label x="20" y="55" text="密码:"/>
</s:Panel>
</s:Application>
servlet代码:
package advang;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class flexServlet extends HttpServlet {

protected void processRequest(HttpServletRequest request, Htt


相关文档:

flex时序图示例

<?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the DateTimeAxis class. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>

import mx.collections.ArrayCollection;
......

flex 嵌入简单的html

<mx:TextArea
width=
"200"
height=
"100"
>
<mx:htmlText>
This is an example of setting a <B>
TextArea</B>
control's <I>
htmlText<I>
property.
</mx:htmlText>
</mx:TextArea>
支持的样式标记
< ......

了解一下Flex 4里的fx、mx以及s命名空间【转帖】

Flex 4带给我们的,是全新的命名空间。了解这些命名空间必定是一件好事情。Flex 4有三个非常重要的命名空间,分别是:
xmlns:fx=”http://ns.adobe.com/mxml/2009″
xmlns:mx=”library://ns.adobe.com/flex/halo”
xmlns:s=”library://ns.adobe.com/flex/spark”
1、xmlns:fx=&rdqu ......

Flex 4 :使用 Halo 主题

此例展示了如何在 Flex 4 中为 Halo 控件设置旧的 Halo 皮肤,而不是新的 Spark 皮肤。
<?xml version="1.0" encoding="utf-8"?>
<!-- http://www.slsay.com/archives/131 -->
<s:Application name="Spark_Halo_theme_test"
       xmlns:fx="http://ns.adobe.com/mxml/2009"
&nbs ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号