解决FaustCplus的两个bug
2015-08-06 11:17
686 查看
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引用,就这样解决了
相关文章推荐
- HTTP状态 301、404、200、304、500 等等
- TCP协议的那些事(总结篇)
- Android训练课程(Android Training) - 使用Volley传输网络数据(Transmitting Network Data Using Volley)
- HTTP 1.1 与HTTP 1.0 的比较
- TCP协议详解(五)
- Android http 下载图片
- 通过 http 协议上传文件
- Android 判断用户2G/3G/4G移动数据网络
- TCP/IP网络知识点总结
- 南邮 OJ 1628 销售网络问题
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- 通过/proc/sys/net/ipv4/优化Linux下网络性能
- 三大WEB服务器对比分析(apache ,lighttpd,nginx)
- 服务器-TCP 在 EPOLL 模型中的注意细节
- 浅谈HTTP中Get与Post的区别
- Java / Android 基于Http的多线程下载的实现
- tmux(cp:https://wiki.freebsdchina.org/software/t/tmux)
- tmux(终端方便使用cp:http://wowubuntu.com/tmux.html)
- 发红包也要上税了?!传网络红包税收新规将出炉
- set specital termimal(https://wiki.archlinux.org/index.php/Color_Bash_Prompt#List_of_colors_for_pro)