Flex 与 servlet 通信
servlet 端:
String userId = request.getParameter("userId");
System.out.println(userId);
response.setCharacterEncoding("UTF-8");
response.getWriter().println("hello world -- 我爱你。。。");
Flex 前台端
<fx:Script>
<![CDATA[
import flash.trace.Trace;
private var loader:URLLoader = new URLLoader();
private function asCallHandler():void{
// URL
var url:String = "http://localhost/app01/getUser";
// 参数
var args:URLVariables = new URLVariables();
args.userId = 1;
// Request请求
var request:URLRequest = new URLRequest(url);
request.data = args;// 绑定参数
//请求加载器
loader.addEventListener(Event.COMPLETE,handleServerResponse);
loader.load(request);//发送请求
}
private function handleServerResponse(e:Event):void{
trace("User data is loaded");
// 获取servlet中println()的内容
debugText.text = loader.data;
}
protected function button1_clickHandler(event:MouseEvent):void
{
// 发送请求
asCallHandler();
}
]]>
相关文档:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="initApp()">
<mx:states>
<mx:State name="index">
<mx:RemoveChild target="{loginPanel}"/>
......
Flex Builder 3.0 For Eclipse 3.3 安装方法
Flex Builder 3.0 For Eclipse 3.3 安装方法
这两天准备学习Flex,于是下载了Flex Builder 3.0 For Eclipse plugin准备安装.
但是安装后启动Eclipse,找了半天也没找到Flex.而且Flex Builder会把JRE也安装.觉得这样很不爽.
所以我想到能不能来个Flex Builder绿色安装方 ......
Adobe Flash Builder 4 简体中文正式版 下载:
http://subject.csdn.net/adobedownload/index.html
使用相关的域,利用Adobe Livecycle Designer创建一个PDF模组,以XML节的名称(与PDF模组中的域的名称匹配)向PDF远程对象发送XML数据,然后您的Flex应用程序就会打开PDF, 或将PDF文件放入您的webserv ......
/*Copyright (c) 2006 Adobe Systems Incorporated
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, m ......