惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tailwind CSS Blog
The GitHub Blog
The GitHub Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog
Microsoft Security Blog
Microsoft Security Blog
Stack Overflow Blog
Stack Overflow Blog
量子位
Martin Fowler
Martin Fowler
月光博客
月光博客
P
Proofpoint News Feed
博客园_首页
Y
Y Combinator Blog
I
InfoQ
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Visual Studio Blog
H
Help Net Security
U
Unit 42
GbyAI
GbyAI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 司徒正美
MongoDB | Blog
MongoDB | Blog
F
Fortinet All Blogs
罗磊的独立博客
酷 壳 – CoolShell
酷 壳 – CoolShell

博客园 - trace

flash8与javascript集成 ASP.NET 2.0母版页(MasterPage) “核弹”击中晚期直肠癌 驳图王:轻轻一招,获取上万IP SEO技巧一 很实用的缓动函数 [原创]flash动态改变注册点解决方案 flash+webservice 乱码问题解决一例(原创) 为flash构建asp.net Webservice flash 与 webservice 通信的两种方式 Flash 与 Web Service 技术的完美结 Flash 与 Web Service 技术的完美结合 Flash常用代码的介绍 flash to js flash 与 后台语言通讯 flash与js通讯(2) flash to js 使用工具包 用Javascript实现鼠标拖拽网页表单 (二) 用Javascript实现鼠标拖拽网页表单(一)
FLASH与WebService
trace · 2007-08-16 · via 博客园 - trace

我简单的说一下在FLASH RIA开发中FLASH结合WebService的用法。
WebService对于一种远程服务,可是说任何一个FLASH RIA开发人员都要掌握的。
FLASH部分:
在场景上建立一个输入框实例名为shuru(传入参数用) 建立一个按钮实例名为bt ,AS部分:

import mx.services.*;//引入命名空间
function getWeather(len:Number) {
 //构建WebService类,传入服务的自述地址
 var weatherservice:WebService =
 new WebService("http://localhost:1784/webfuwu/Service.asmx?WSDL");
 //接收服务的返回结果
 ResultObj = weatherservice.HelloWorld(len);
 //判断返回结果并执行操作,onResult监测返回成功事件
 ResultObj.onResult = function(result:Object) {
  //返回的是一个数组(由web服务返回类型决定)
  for (i=0; i<result.length; i++) {
   trace(result[i]);
  }
 };
}
bt.onRelease = function() {
 //传入数组长度
 getWeather(shuru.text);
};

.net部分:

using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
    public Service () {

//如果使用设计的组件,请取消注释以下行 
        //InitializeComponent(); 
    }

[WebMethod]
    public string[] HelloWorld(int le)
    {
        string[] array1 = new string[le];
        for (int i = 0; i < array1.Length; i++)
        {
            array1[i] = i + "a";
        }
            return array1;
    }
    
}

很简单的一个实例,如果想了解这方面的看看吧,原理确实很简单