请看帮助中的ExternalInterface类,它可以直接操作JS
ExternalInterface.call
以下是用这个函数做的示例:
复制内容到剪贴板
代码:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>testa</title>
<script>
var a=628//在JS中只需申明,在FLASH中就可以能过ExternalInterface获得。
</script>
</head>
<body bgcolor="#ffffff">
<!-- 影片中使用的 URL-->
<!-- 影片中使用的文本-->
<!-- saved from url=(0013)about:internet -->
<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="550" height="400" id="testa" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="testa.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="testa.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="testa" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>