<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="web.WebForm1" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>sdf</title>
<script type="text/javascript">
function doPassVar(){
window.document.myFlash.OperationType("2");//赋值方式
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<div>
<object id="myFlash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="800" height="600" id="flashvars" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="xp1.swf" />
<param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />
<embed src="xp1.swf" quality="high" bgcolor="#ffffff" width="800" height="600" name="flashvars" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
<input id="wo" value="点击我" onclick="doPassVar()" type="button" />
</div>
</div>
</form>
</body>
</html>
赋值,其实就是找到Object的ID,然后是Flash的方法,Operation,括号里面就是传过去的参数。
但是可以传值了,接下来的是浏览器的兼容问题,IE可以,但是Google、Firefox不支持。
所以又可以考虑用swfObject.js来操作flash与js的交互