2012-10-03 123 views
0

有沒有辦法獲得點擊事件,然後在swf嵌入對象上重定向?Flash重定向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

有兩個部分,HTML和SWF文件的clickTAG。

我相信你的html應該工作 - 雖然我建議像http://yoursite.com/redirect.php這樣的硬鏈接。所以讓我們談談Flash吧?

我寫了一篇關於我的員工的點擊標籤的教程,後面說明了您需要在Flash中做什麼。這是AS2:

http://ryanhollingsworth.com/index.php/banner-ad-tutorials/item/34-actionscript-20-basic-clicktag-and-fundamentals

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