使用jsp生成xml格式文件然后用flashvars向swf里面传参

关键字 :flashvars swf 参数传递

特别关键的点:
链接中的&符号不能用,要用%26代替,否则flash会将其分开来解析

数据是var1=’company&id=1‘
但是flash认成了var1=’company‘&id=‘1’

示意代码:

<%
String userid = request.getParameter(“user”);
String fid = request.getParameter(“fid”);
String userbasicUrl =null ;
if(UtilTool.isNotBlank(userid)){
String shopUrl = “genXML/shop_xml.jsp?car_type=206 %26 fid=”+fid;
%>

<object classid=”clsid:d27cdb6e-ae6d-11cf-96b8-444553540000” codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width=”808” height=”544” id=”play” align=”middle” VIEWASTEXT>

<param name=”allowScriptAccess” value=”sameDomain” />

<param name=”allowFullScreen” value=”false”/>

<param name=”flashvars” value=”shopxml=<%=shopUrl%>”/>

<param name=”movie” value=”play.swf” /><param name=”quality” value=”high” /><param name=”bgcolor” value=”#000000” />

<embed src=”play.swf” quality=”high” flashvars=”friendxml=<%=friendsUrl%>&shopxml=<%=shopUrl%>” bgcolor=”#000000” width=”808” height=”566” name=”play” align=”middle” allowScriptAccess=”sameDomain” allowFullScreen=”false” type=”application/x-shockwave-flash” pluginspage=”http://www.macromedia.com/go/getflashplayer" />
</object>