HTML flash 增加 a href 链接

阅读(3114)

有些场景下,不能或不允许在flash 内部实现链接跳转;更多时候,作为第三方,可以严格控制跳转地址。

不能像其他标签一样,在flash 的<object>或 <embed> 标签外,直接写上<a> 链接,但可以通过将链接定位覆盖到flash 上来实现。

以下代码来自于Google 广告中flash 的插入。

<div style="margin:0 auto;z-index:-1;width:300px;height:250px">
    <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="300" height="200">
        <param name="movie" value="http://www.adobe.com/jp/events/cs3_web_edition_tour/swfs/perform.swf">
        <param name="quality" value="high">
        <embed src="http://www.adobe.com/jp/events/cs3_web_edition_tour/swfs/perform.swf" wmode="opaque" quality="high" flashvars="switchSound=off" pluginspage="http://www.macromedia.com/go/getflashplayer" allowscriptaccess="never" type="application/x-shockwave-flash" width="300" height="250">
        <param name="wmode" value="opaque">
        <param name="FlashVars" value="switchSound=off">
        <param name="allowscriptaccess" value="never">
    </object>
</div>
<div style="cursor:hand;z-index:1;visibility:visible; width:300px; height:250px; margin-top:-250px;">
    <a href="http://kaifage.com/" target="_blank" style="position:absolute;top:0;left:0;display:block;width:300px;height:250px;">占位</a>
</div>

Tags: