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
相关文档:
这里面有许多特效很酷,希望对大家有帮助。 1.旋转 效果:http://www.alex-uhlmann.de/flash/adobe/blog/distortionEffects/effectCube/ 代码:http://weblogs.macromedia.com/auhlmann/archives/DistortionEffects.zip
2.画布按钮 http://dougmccune.com/blog/2007/06/01/new-component-canvasbutton-added-to-flexlib/ ......
一共花了9天时间写出来,其中也停滞过
主要原因是效率问题,而重新构建,进行从新优化就用了2天,也总结了很多经验吧。
基本实现了 左边一颗表格树,当展开时候甘特图也展开,关闭时甘特图也关闭,而且横向进度可以左右移动,扩大缩小,连接线
也根据位置自动变换连接 当子进度移动或扩大时,父进度也跟着放大缩小移动, ......
开始日期 与 结束日期的范围选择
两者都不能大于今天,开始日期不能大于结束日期
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" backgroundGradientColors="[#ffffff, #ffffff]">
<mx:Script>
......
本系列文章主要介绍了关于Flex与.NET结合开发中的一些互操作性,包括网络通信、数据加载、数据传输、文件传输、以及应用于Flex与.NET协作开发的通信网关开源项目FluorineFx的相关知识点。
开源项目FluorineFx就是专门针对.NET平台与Flex通信提供的AMF协议通信网关,我们可以通过FluorineFx很方便 ......
此例展示了如何在 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 ......