解决FaustCplus的两个bug

1、解决因flash版本升级而导致FaustCplus生成不了预览图片的问题

FaustCplus插件内置的函数的读取版本低于本地flash版本(查看本地flash版本),去该插件的github网址看了下相关的as源码,发现该文件只检查flash从9到12的版本,这之外的都是按break处理,因此添加的图片预览不成功,代码如下(文件为FaustCplus-master\view\browse\BrowseComp.as)

private function onFileSelected(event:Event) : void  
{  
    this._fileRef.removeEventListener(Event.SELECT, this.onFileSelected);  
    this._fileRef.removeEventListener(Event.CANCEL, this.onCancel);  
    switch(this.Version)  
    {  
        case "12":  
        case "11":  
        case "10":  
            this._fileRef.load();  
            this._fileRef.addEventListener(Event.COMPLETE, this.refPicOK);  
            break;  
        case "9":  
            this._parent.localPicArea.loaddingUI.visible = true;  
            this._parent.localPicArea.loaddingUI.play();  
            if (this._parent.localPicArea.tip != null)  
            {  
                this._parent.localPicArea.tip.visible = false;  
            }  
            this.uploadFile();  
            break;  
              
        default:  
            break;  
    }  
    return;  


由于本地版本是14,以后版本有可能升级为15甚至更高,因此需要把switch语句改为if判断来兼容以后不断升级的版本


private function onFileSelected(event:Event) : void  
{  
    this._fileRef.removeEventListener(Event.SELECT, this.onFileSelected);  
    this._fileRef.removeEventListener(Event.CANCEL, this.onCancel);  
    if (this.Version == 9) {  
        this._parent.localPicArea.loaddingUI.visible = true;  
        this._parent.localPicArea.loaddingUI.play();  
        if (this._parent.localPicArea.tip != null)  
        {  
            this._parent.localPicArea.tip.visible = false;  
        }  
        this.uploadFile();  
    } else if (this.Version > 9) {  
        this._fileRef.load();  
        this._fileRef.addEventListener(Event.COMPLETE, this.refPicOK);  
    }  

2、FaustCplus头像上传成后不执行uploadevent函数

var returnData = JSON.decode(_json);
这句话无法执行,获取returnData的值,输出为“undefinded”

用flash cs6调试了,说decode 不是函数,顶部调用:import com.adobe.serialization.json.*;


因为cs6内置json了。

JSON.decode换成JSON.parse,然后去掉顶部的json引用,就这样解决了


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值