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/ ......
http://www.zhuoqun.net/html/y2008/1042.html加载图片
http://www.millionclouds.com/浏览图片
http://www.scion.com/#home卖车
http://labs.newmediateam.com/pizzastore/customerview/卖披萨
http://www.sumo.fi/flash/sumopaint/线图片编辑器
http://www.prettyloaded.com/各种预加载效果
http://www.adobecards. ......
开始日期 与 结束日期的范围选择
两者都不能大于今天,开始日期不能大于结束日期
<?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 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 ......