flex webserver .net
<?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/mx" minWidth="955" minHeight="600">
<fx:Script>
<!--[CDATA[
import mx.rpc.events.ResultEvent;
/* import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
internal function onRequest():void
{
websevercalc.Calu.send();
}
internal function onSuccess(evt:ResultEvent):void
{
this.result.text =evt.result.toString();
}
internal function onFualt(evt:FaultEvent):void
{
} */
private function fnText(event:ResultEvent):void
{
this.result.text = event.result.toString();
}
]]-->
</fx:Script>
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
<s:WebService id="websevercalc" wsdl="http://localhost:1524/WebService1.asmx?wsdl" useProxy="false" >
<s:operation name="Calu" result="fnText(event)" >
<s:request >
<r>
{this.txt.text}
</r>
</s:request>
</s:operation>
</s:WebService>
</fx:Declarations>
<s:Label x="287" y="111" id="result" />
<s:Button x="209" y="111" label="圆周长" click="websevercalc.Calu.send() "/>
<s:TextInput x="73" y="111" id="txt"/>
</s:Application>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
namespace HzBsTest
{
/// <summary>
/// WebService1 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。
// [System.Web.Script.Services.ScriptService]
public class WebServ
相关文档:
新手入门参考:
Adobe Flex 3 - adobe.com
Adobe Flex Sample Applications - adobe.com
Video Training (Learn Flex in a Week) - adobe.com
RSS Feeds (Get regular updates about Flex) - adobe.com
Learn about Flex Open Source - adobe.com
Get Flex 3 SDK - adobe.com
Get Flex Builder 3 - adobe.com ......
Flex是开发Ria的利器,Flash在动画 游戏等方面较强大,可以制作出更生动 形象,富有乐趣性的交互产品来。
在多数情况下需要2者结合。
两者之间的通讯是依靠事件机制完成的。
以下的例子是:Flash提交数据给Flex,Flex改变Flash的数据。
1:Flash CS4工具打开
按如下 属性 制作界面
2:按 F9 ,输入以下代码:
......
这一次的Flex 实践将要实现以下功能:
1、自定义一个简单的 Flex 组件
2、创建一个Index. mxml 来调用该组件
1)用 as 调用组件
&nbs ......
方法一:
<?xml version="1.0"?>
<!-- events/MultipleEventHandlersInline.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script><![CDATA[
private function submitForm(e:Event):void {
// Handle event here.
......
最简单的方法是本地化编译,即编译不同的语言版本
,然后使用
Application Server
来判定客户使用的是哪种语言,并自动指向对应的
swf
文件。
具体做法如下:
在项目上点击右键,选择
Properties
。
然后选择
Flex Compiler
,在
Additional Compiler arguments
下面已经配置好语言包了,默认为
-locale en_ ......