日期:2014-05-16  浏览次数:20366 次

我动态输出flash代码,但是变量无法赋值
下面这段代码动态输出flash,其中的ggg变量无法赋到flash的参数value里面

function   writeflash()
{
var   fstr= " <object   classid= 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 '   codebase= 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0 '   width= '510 '   height= '270 '   id= 'ti '   align= 'middle '> ";
fstr=fstr+ " <param   name= 'allowScriptAccess '   value= 'sameDomain '   /> ";
fstr=fstr+ " <param   name= 'movie '   value= 'ti.swf '   /> ";
fstr=fstr+ " <param   name= 'quality '   value= 'high '/> ";
fstr=fstr+ " <param   name= 'wmode '   value= 'transparent '> ";

var   ggg= "&photo=70 ";

fstr=fstr+ " <PARAM   NAME=FlashVars   VALUE= 'uploadPage=Upload.axd?a=1 '+ggg> ";//这里如果直接把ggg的内容写到a=1的后面则可以,这样加上去flash根本就检测不到有ggg变量里的东西
fstr=fstr+ " <embed   src= 'ti.swf '   FlashVars= 'uploadPage=Upload.axd?a=1 '+ggg   quality= 'high '   wmode= 'transparent '   width= '510 '   height= '270 '   name= 'ti '   align= 'middle '   allowScriptAccess= 'sameDomain '   type= 'application/x-shockwave-flash '   pluginspage= 'http://www.macromedia.com/go/getflashplayer '   /> ";
fstr=fstr+ " </object> ";
document.getElementById( "flash ").innerHTML=fstr;
}

------解决方案--------------------
fstr=fstr+ " <PARAM NAME=FlashVars VALUE= 'uploadPage=Upload.axd?a=1 ' "+ggg+ "> ";