[AS3]Flash与后台数据交换方法整理1-URLLoader(URLStream)篇

Submitted by kinglong on 2008-8-29 18:12:30
[AS3]Flash与后台数据交换方法整理1-URLLoader(URLStream)篇
PS.
随着Flash Player 9的普及,AS3编程也越来越多了,所以这次重新整理AS3下几种与后台数据交换方法。
1.URLLoader(URLStream)
2.FlashRemoting
3.XMLSocket(Socket)
4.FMS/FCS

一、URLLoader(URLStream)篇
URLStream和URLLoader中URLLoaderDataFormat.BINARY类似,它提供对下载 URL 的低级访问方式,我在此不再重复了,有兴趣的,可以看Flash帮助中URLStream类。
Flash端


服务端(jsp)


优点:
1、flash代码实现起来简单,方便。
2、服务端接收页面和接收一个表单过来的数据一样处理,不需要专门的技术,所有服务端程序都可以实现!
3、可以发送字符串变量,也可以发送文件流([AS3]URLLoader+URLRequest+JPGEncoder实现BitmapData图片数据保存)。
4、可以结合AMF3接收更为丰富的数据类型([AS3]AMF3+JAVA的调用范例)。
缺点:
1、传递的变量不宜过多。
2、变量传递的值不宜过长。
注意:
如果接收数据类型设置成URLLoaderDataFormat.VARIABLES后,第一个字符不能以&开头,结尾部分建议以&_为结束比较好。

Trackback:

TrackBack URL for this entry:
http://www.klstudio.com/cmd.asp?act=tb&id=169


Comments:

#5189 On 2008-8-30 8:36:26 fansin (e) said,

受教了,谢谢.
as2时代就看过你的那几种交互方式,让我很受收获.
3qs :)

#6746 On 2008-11-16 14:14:37 bioRex21 (e) said,

i don't understand!! haha

Did you communicate Flash with JSP?? I'm trying to do that

greetings from Mexico!

#6764 On 2008-11-17 9:28:28 kinglong (e) said,


Thanks!
I am JSP use as a server using the flash, but Flash and the exchange of data services in addition to the background of java (jsp), there are C #, php, asp, and other web server program!



Post a comment:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。