第一种.使用html中object 的param传参FlashVars,如下:
复制代码
代码如下:<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="900" height="300" id="FlashZhuan" >
<param name="movie" value="zhuanpan.swf">
<param name="FlashVars" value="prizeResult=3">
<param name="quality" value="high">
<param name="menu" value="false">
<param name="wmode" value="transparent">
<param name="allowScriptAccess" value="always" />
<embed src="zhuanpan.swf" FlashVars="prizeResult=3" allowScriptAccess="always" wmode="transparent" menu="false" quality="high" width="510" height="510" type="application/x-shockwave-flash" pluginspage="http://get.adobe.com/cn/flashplayer/" name="FlashZhuan"/>
</object>
在flash的AS3.0中取出参数,命令行如下:
复制代码
代码如下:var paramObj:Object = stage.loaderInfo.parameters;
var prizeResult = Number(paramObj["prizeResult"]);