有没有办法获得点击事件,然后重定向swf嵌入对象?
以下是我目前的代码,但它似乎没有工作
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="560" height="80" id="ad_cat" align="">
<param name="movie" value="http://roadsonline.com.au/assets/ads/COA0460_560x80.swf?clickTAG=catredir.php">
<param name="wmode" value="transparent" />
<embed src="http://roadsonline.com.au/assets/ads/COA0460_560x80.swf?clickTAG=catredir.php" quality="high" width="560" height="80" name="movie" wmode="transparent" align="" type="application/x-shockwave-flash" plugins page="http://www.macromedia.com/go/getflashplayer">
</object>
答案 0 :(得分:0)
有两个部分,HTML和SWF中的clickTAG。
我相信你的HTML应该有效 - 尽管我推荐像http://yoursite.com/redirect.php这样的硬链接。那么让我们谈谈Flash吧?
我为我的员工写了一篇关于点击标签的教程,这解释了你需要在flash中做什么。这是AS2:
AS3 ClickTAG:
import flash.display.MovieClip;
var hit = new MovieClip();
hit.graphics.beginFill(0xFFFFFF);
hit.graphics.drawRect(0,0,stage.stageWidth,stage.stageHeight);
var clicky = new SimpleButton(null,null,null,hit);
this.addChild(clicky);
clicky.addEventListener(MouseEvent.CLICK, function(e){
if(root.loaderInfo.parameters.clickTAG) navigateToURL(new URLRequest(root.loaderInfo.parameters.clickTAG), "_blank");
e.stopPropagation();
});
进一步阅读: http://helpx.adobe.com/flash/kb/pass-variables-swfs-flashvars.html