js与flash交互操作1
来源:互联网 发布:c语言怎么求素数的和 编辑:程序博客网 时间:2024/05/17 22:16
//flash里传送值
'<param name="flashvars" value="' + this.getFlashVars() + '" />'
//flash里获取值
this.uploadURL=root.loaderinfo.parameters.uploadURL
SWFUpload.prototype.getFlashVars = function () {
// Build a string from the post param object
var paramString = this.buildParamString();
var httpSuccessString = this.settings.http_success.join(",");
// Build the parameter string
return ["movieName=", encodeURIComponent(this.movieName),
"&uploadURL=", encodeURIComponent(this.settings.upload_url),
"&useQueryString=", encodeURIComponent
(this.settings.use_query_string),
"&requeueOnError=", encodeURIComponent
(this.settings.requeue_on_error),
"&httpSuccess=", encodeURIComponent(httpSuccessString),
"&assumeSuccessTimeout=", encodeURIComponent
(this.settings.assume_success_timeout),
"&params=", encodeURIComponent(paramString),
"&filePostName=", encodeURIComponent
(this.settings.file_post_name),
"&fileTypes=", encodeURIComponent(this.settings.file_types),
"&fileTypesDescription=", encodeURIComponent
(this.settings.file_types_description),
"&fileSizeLimit=", encodeURIComponent
(this.settings.file_size_limit),
"&fileUploadLimit=", encodeURIComponent
(this.settings.file_upload_limit),
"&fileQueueLimit=", encodeURIComponent
(this.settings.file_queue_limit),
"&debugEnabled=", encodeURIComponent
(this.settings.debug_enabled),
"&buttonImageURL=", encodeURIComponent
(this.settings.button_image_url),
"&buttonWidth=", encodeURIComponent(this.settings.button_width),
"&buttonHeight=", encodeURIComponent
(this.settings.button_height),
"&buttonText=", encodeURIComponent(this.settings.button_text),
"&buttonTextTopPadding=", encodeURIComponent
(this.settings.button_text_top_padding),
"&buttonTextLeftPadding=", encodeURIComponent
(this.settings.button_text_left_padding),
"&buttonTextStyle=", encodeURIComponent
(this.settings.button_text_style),
"&buttonAction=", encodeURIComponent
(this.settings.button_action),
"&buttonDisabled=", encodeURIComponent
(this.settings.button_disabled),
"&buttonCursor=", encodeURIComponent
(this.settings.button_cursor)
].join("");
};
//js调用flash中的方法
SWFUpload.prototype.callFlash = function (functionName, argumentArray) {
argumentArray = argumentArray || [];
var movieElement = this.getMovieElement();
var returnValue, returnString;
// Flash's method if calling ExternalInterface methods (code adapted from MooTools).
try {
returnString = movieElement.CallFunction('<invoke name="' + functionName +
'" returntype="javascript">' + __flash__argumentsToXML(argumentArray, 0) + '</invoke>');
returnValue = eval(returnString);
} catch (ex) {
throw "Call to " + functionName + " failed";
}
// Unescape file post param values
if (returnValue != undefined && typeof returnValue.post === "object") {
returnValue = this.unescapeFilePostParams(returnValue);
}
return returnValue;
};
//调用
SWFUpload.prototype.getStats = function () {
return this.callFlash("GetStats");
};
SWFUpload.prototype.getFile = function (fileID) {
if (typeof(fileID) === "number") {
return this.callFlash("GetFileByIndex", [fileID]);
} else {
return this.callFlash("GetFile", [fileID]);
}
};
SWFUpload.prototype.addFileParam = function (fileID, name, value) {
return this.callFlash("AddFileParam", [fileID, name, value]);
};
SWFUpload.prototype.getMovieElement = function () {
if (this.movieElement == undefined) {//this.movieName就是flash object的id
this.movieElement = document.getElementById(this.movieName);
}
if (this.movieElement === null) {
throw "Could not find Flash element";
}
return this.movieElement;
};
- js与flash交互操作1
- Flash与JS交互
- Flash与JS交互
- flash与js交互
- js与flash交互
- flash与js交互方法
- flash与js交互方法
- flash与js交互方法
- Flash与js通过什么交互
- 解决flash与js交互、flash跨域交互、flash跨域提交
- Js与flash交互:在html页面中用js与MyReport插件交互
- Js与flash交互:在html页面中用js与MyReport插件交互
- flash 与交互:左右交互
- flash 与交互:交互排斥
- FLASH与JS交互需注意的新问题
- JS与flash交互通信控制的方法
- flash与js交互ie跟ff通用的方法
- JS与flash交互通信控制的方法
- flash 上传文件的actionscript 上传的各方法都有,仅供参考
- 11111 - Generalized Matrioshkas
- 定时器1的设置 s5pc100
- 给定一个函数rand5(),使函数rand7()可以随机等概率的生成1-7的整数
- cf 320B
- js与flash交互操作1
- Linux信号丢失问题分析
- jQuery.extend 函数详解
- ORACLE GOLDENGATE DML 双向同步
- Netjava Lesson8 多线程——让小球动起来
- 5个iOS应用开发者海外学习资源站推荐
- Android_自动化测试工具_Calabash(1)
- discuz/uchome等康盛产品formhash()浅析
- Java 用Look And Feel打造绚丽的界面外观!