flex swfobject 加载远程swf


代码

<span style="white-space:pre">				</span>var playerPath = "http://192.168.168.107:8080/voicePlay/voicePlay-client/VoicePlayModule.swf?a="+Math.random();//播放器地址
					//var playerPath = "http://10.3.3.165:8080/voicePlay/voicePlay-client/VoicePlayModule.swf?a="+Math.random();//播放器地址
					var fo =  new SWFObject(playerPath, "mymovie", 450,213, "10.0.0.0", "#444444");
					//fo.addVariable("storePath",param.storePath);
					//fo.addVariable("userUploadStorePath",param.userUploadStorePath);
					//fo.addVariable("userid",param.userid);
					//fo.addVariable("fileName",param.fileName);
					
					fo.addParam("wmode", "window");
					fo.addParam("quality", "high");
				 	fo.addParam("menu","false");
					fo.addParam("allowFullScreen", "true");
					fo.addParam("allowScriptAccess","always");//允许flex 与 script交互
					fo.addParam("allownetworking","all");
					fo.write(myFlash);

flex 端 

1. applicationComplete 使用应用加载完成才可调用js的函数接收参数

2.远程通信记得安全沙箱 flash.system.Security.allowDomain("*");  虽然在tomcat已经添加crossdomain.xml文件了,但是我还是无法再js回调flex函数,加这个才调用了

3.swfobject方式使用flex上传功能,在上传过程中不能把div none 会导致js 无法接受flex 上传的后回调js函数



猜你喜欢

转载自blog.csdn.net/onnwll/article/details/41478707