jsp要嵌入的代码
<object id="presentation" width="100%" height="100%"
classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="volumeMenujsp1.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="allowFullScreen" value="true" />
<param name="wmode" value="transparent" />
<embed src="volumeMenujsp1.swf" quality="high" bgcolor="#ffffff" width="100%"
height="100%" name="presentation" align="middle"
allowScriptAccess="never" allowNetworking="internal" autostart="0" type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer"
allowFullScreen="true" wmode="transparent" />
</object>
把volumeMenujsp1 换成要嵌入的swf就可以
如果flex要调用js方法:
flex中代码
volumeMenujsp1中调用js方法
ExternalInterface.addCallback("alertValue", alertValue); //设置调用js返回方法
ExternalInterface.call("returnValeu"); //调用js方法
private function alertValue( flag :String):int
Alert.show(flag);
return 0;
}
jsp、html中script代码
<script>
function returnValeu(){
var userID = <%=request.getAttribute("userID")%>;
var vm=document.getElementByIdx_x("presentation"); //presentation 为object id
return vm.alertValue("返回");//回调flex前插后插函数 在这里可以把serlvet返回的userID传到Flex中
}
</script>
我实现的是两个项目对接, jsp调用另一个项目的servlet弹出jsp把值传到flex中,