首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 开源软件 >

as3压缩解压缩的第三方包及兑现DEMO

2013-01-26 
as3压缩解压缩的第三方包及实现DEMO用到as3 解压缩zip文件.上网找了都是只能解压缩生成bytearray,而不是直

as3压缩解压缩的第三方包及实现DEMO
用到as3 解压缩zip文件.上网找了都是只能解压缩生成bytearray,而不是直接生成文件或目录结构.所以只能自己根据bytearray手动实现..




[转]
在现在开发的游戏中,由于战斗数据比较大,所以尝试对战斗数据进行压缩,然后输出到客户端flash端再解压。

Google到一篇文章,对照翻译工具翻译一下

在我的一些项目中,经常需要对数据做一些转换操作,所以积累一些很有意思的用于数据压缩/解压缩的第三方类库。

当然ByteArray类本身就带了数据压缩和解压缩的方法,可以用在flash player使用zlib算法和AIR程序使用多种算法。在FLASH跟PHP作为后台的编程中,我后来选择了ByteArray的compress方法来做zlib算法的压缩,用这个方法用的比较顺手,而且很快。

下面是一些第三方的类库地址以及介绍:

    AS3 Zip: AS 3 下用来读取和写入zip文件的类库
    FZip: FZip 是一个用于AS 3 下读取、创建、修改zip压缩包的类库
    ASZip: AS 3 用于创建zip文件的类库
    LZMA Encoder: AS3下使用LZMA算法压缩数据的类库.
    LZMA Decoder: 跟上面类库对应的用于LZMA算法解压缩数据.
    AsCompress: AS3下 GZIP压缩和解压缩类库,好像需要SDK版本在4.x以上,flash cs3下不可用。
    Gzip for HTTPService/URLLoader: 给你的 Flex/AIR HTTPService/URLLoader增加gzip支持
    airxzip: AIR的zip类库

如果你还知道更多的类库或者其他好东东,欢迎告知!



翻译自:http://blog.yoz.sk/2011/01/quick-tip-compression-in-flash/

While working on one of my projects where I needed compression for transfered data, I hit some very interesting compression libraries. Also the ByteArray class contains compress method, using zlib algorithm in flash player or multiple algorithms in AIR. At the end I decided to useByteArray.compress() method for encoding vs. PHP gzuncompress for decoding, what works correctly, fast and smooth.

Here is a list of 3rd party compression libraries and other good stuff:

    AS3 Zip: ActionScript 3 based library for reading and writing zip files
    FZip: FZip is an Actionscript 3 class library to load, modify and create standard ZIP archives.
    ASZip: ActionScript 3 library to generate ZIP files
    LZMA Encoder: AS3 class to compress data using LZMA algorithm.
    LZMA Decoder: A part of the apparat framework.
    GZIP: ActionScript GZIP compression library
    Gzip for HTTPService/URLLoader: Adding Gzip support for Flex/AIR HTTPService/URLLoader
    airxzip: Zip library for ActionScript3 on AIR

If you know some more, please let me know.

from: http://www.cnblogs.com/rob0121/articles/2300556.html

热点排行