Flex与后台交互的4种方法
一、HTTPService
程序代码:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="initializeHandler(event)">
<mx:Script>
<!--[CDATA[
private function initializeHandler(event:Event):void {
countriesService.send();
}
private function changeHandler(event:Event):void {
statesService.send();
}
]]>
</mx:Script>
<!-- 载入纯静态的xml数据 -->
<mx:HTTPService id="countriesService" url="http://www.rightactionscript.com/states/xml/countries.xml" />
<!-- 载入由php生成的xml数据 -->
<mx:HTTPService id="statesService" url="http://www.rightactionscript.com/states/xml/states.php">
<!-- 以下标签就是要发送到服务端的数据了,可以这样理解:有一个名为country的变量,它的值为花括号{}里的内容 -->
<mx:request>
<country>{country.value}</country>
</mx:request>
</mx:HTTPService>
<mx:VBox>
<!-- 此控件的数据由第一个<mx:HTTPService/>控件接收的内容提供,并且由这个ComboBox控制着第二个ComboBox所要显示的内容 -->
<mx:ComboBox id="country" dataProvider="{countriesService.lastResult.countries.country}"
change="changeHandler(event)" />
<!-- 下面的ComboBox已经绑定了{statesService.lastResult.states.state},随它的数据改变而改变 -->
<mx:ComboBox dataProvider="{statesService.lastResult.states.state}" />
</mx:VBox>
</mx:Application>
二、URLLoader
程序代码:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="initializeHandler(event)">
<mx:Script>
<!--[CDATA[
private var _countriesService:URLLoader;
private var _statesService:URLLoader;
private function initializeHandler(event:Event):void {
_countriesService = new URLLoader();
_countriesService.addEventListener(Event.COMPLETE, countriesCompleteHandler);
_countriesService.load(new URLRequest("http://www.rightactionsc
相关文档:
http://www.belgacomtv.be/
http://www.xsteel.net/
http://veryhw.com/
http://www.redlei.com/test/redlei/
[url]http://www.cssflex.com/[/url]
[url]http://www.millionclouds.com/[/url]
[url]http://www.anywhere.fm/player/[/url]
[url]http://youyee.org/viewpoint/[/url]
[url]http://flexbox.mrinalwadhw ......
10 个FLex MVC框架
AdobeFlex及相关技术正成为RIA领域的主流。虽然Flex社区的规模还远比不上Java或Microsoft平台,但它正在FlexRIA开发者们的栽培下稳健地成长。许多开源开发框架也因此被创造出来:
Cairngorm(下载)
Cairngorm是最老也最成熟的Flex框架。它现在由Adobe拥有并开源,而且被Adobe的RIA顾问服 ......
(转)java与flex通信
一、准备:
服务端:JDK1.5 (这个不用介绍了吧?)
服务端IDE:eclipse (它的主页)
客户端:FLEX 3 (Adobe® Flex® 3 是用于构建和维护在所有主要浏览器、桌面和操作系统一致地部署的极具表现力的 Web 应用程序的高效率的开放源码框架。)
客户端IDE:Flex Builder 3 ......
用的是MySQL数据库。
1,建一个userdb库,再建userinfo表,字段:id(int),username(varchar),password(varchar)。
create database userdb;
use userdb;
create table userinfo(
id int(10) not null auto_increment,
username varchar(20),
password varchar(20),
primary key(id));
2,DBConnection.jav ......