基于flex4技术从零开发flex博客系统 : 2 与servlet服务端交互
2009-05-05 12:04:27 来源:WEB开发网<?xml version="1.0" encoding="utf-8"?>
<FxApplication xmlns="http://ns.adobe.com/mxml/2009">
<Script>
<![CDATA[
import mx.controls.Alert;
import flash.net.URLLoader;
import flash.net.URLRequest;
private function greet() : void
{
new URLLoader( new URLRequest("http://localhost:8080/gapp_flexblog/hello?name=" + vNameTxt.text) )
.addEventListener(Event.COMPLETE,
function(event : Event) : void
{
Alert.show(event.currentTarget.data);
vSendBtn.enabled = true;
}
);
vSendBtn.enabled = false;
}
]]>
</Script>
<HGroup>
<FxTextInput id="vNameTxt" text="sban" />
<FxButton id="vSendBtn" label="greet" click="greet()" />
</HGroup>
</FxApplication>
更多精彩
赞助商链接