给flash添加链接的三种方法

时间:2012-2-29     作者:smarteng     分类: WEB相关


一,用flash软件,给动画添加超链接
on(release) {
getUrl(http://haotushu.sinaapp.com);
}
 
二,动画没有超链接的情况下,在网页上实现,婚纱摄影
<button style="width:你的FLASH宽度;height:你的FLASH高度;background:transparent;border:o;padding:0;cursor:hand" onclick="window.location.href='链接地址'"> 
<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="460" height="145">
    <param name="movie" value="images/swf/5.swf">
    <param name="quality" value="high">
    <param name="wmode" value="transparent">
    <embed src="images/swf/5.swf" width="460" height="145" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>
    </object></button>

三.不能直接用a标签,应该用js+css来实现 
<div style="z-index:100; background:#333; width:950px; height:205px; overflow:hidden;"> 
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" height="150" width="950">
<param name="movie" value="http://img.uu1001.cn/wrappler_swf3/2012-01-30/ae/31/27743529_d9ca79868ef64a338c9185fe38f58312_950x150.swf">
<param name="wmode" value="transparent">
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="http://img.uu1001.cn/wrappler_swf3/2012-01-30/ae/31/27743529_d9ca79868ef64a338c9185fe38f58312_950x150.swf" height="150" width="950">
<param name="wmode" value="transparent">
</object>
<!--<![endif]-->
</object>
<div onclick="window.open('http://haotushu.sinaapp.com','')" style="z-index:99; position:relative; width:950px; height:205px; left:0; top:-205px; cursor:hand;> 
</div> 
</div>
上面这种方法,如果想在当前页面打开,可用:
 <div onclick="window.location.href=' http://haotushu.sinaapp.com '" style="z-index:99; position:relative; width:950px; height:150px; left:0;top:-150px;cursor:pointer;"> </div>
最后一种方法的代码在ie6及firefox1.5和chrome上测试通过。 
其他两种未做测试,请使用最后一种 ,
不过还是建议把链接做到flash里面,并非所有浏览器都支持这样的做法, 
要动态更新链接可以as+xml来实现。