Flash中的代码
页面中的方法
思路...
页面中利用LoadVar(<param name = "FlashVars" id = "FlashVars" value = "id" >)传递值给Flash,Flash中通过刷新本Flash(onEnterFrame ),来动态更新接收到的值.
缺点:
不断刷新本FLASH,占用CPU资源.
在寻找其他方法中...
还是那句:为什么...macromedia的Flash remoting for .net不支持直接调用页面里的方法呢?
onEnterFrame = function () {
var tmp_id = id;//id为来自页面的变量
}
var tmp_id = id;//id为来自页面的变量
}
页面中的方法
<script>
function f_change(fid)
{
document.all("Object1").SetVariable("id",fid)
}
</script>
function f_change(fid)
{
document.all("Object1").SetVariable("id",fid)
}
</script>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="550" height="400" id="Object1">
<param name="movie" value="test.swf">
<param name="quality" value="high">
<param name = "FlashVars" id = "FlashVars" value = "id" >
<embed src="test.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="550" height="400"></embed></object><br />
<asp:Label ID="Label1" runat="server"></asp:Label>
<br />
<button onclick = "Javascript:f_change(123)">test</button>
<button onclick = "javascript:f_change(456)">test</button>
<param name="movie" value="test.swf">
<param name="quality" value="high">
<param name = "FlashVars" id = "FlashVars" value = "id" >
<embed src="test.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="550" height="400"></embed></object><br />
<asp:Label ID="Label1" runat="server"></asp:Label>
<br />
<button onclick = "Javascript:f_change(123)">test</button>
<button onclick = "javascript:f_change(456)">test</button>
思路...
页面中利用LoadVar(<param name = "FlashVars" id = "FlashVars" value = "id" >)传递值给Flash,Flash中通过刷新本Flash(onEnterFrame ),来动态更新接收到的值.
缺点:
不断刷新本FLASH,占用CPU资源.
在寻找其他方法中...
还是那句:为什么...macromedia的Flash remoting for .net不支持直接调用页面里的方法呢?