ActionScript 3 As3:仅在生产模式下跟踪网页浏览量

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ActionScript 3 As3:仅在生产模式下跟踪网页浏览量相关的知识,希望对你有一定的参考价值。

var mc:MovieClip = new MovieClip();
	mc.buttonMode = true;
	mc.addEventListener( MouseEvent.CLICK, trackEventHandler, false, 0, true );

function isProductionMode():Boolean
{
	var runtimeEvironment:String = Capabilities.playerType;

	if (runtimeEvironment == "External" || runtimeEvironment == "StandAlone"){
		return false;
	} else {
		return true;
	}
}

function trackEventHandler( e:Event ):void
{
	//If the Complied Flash Player is on the HTML page, give it a Page View
	if( isProductionMode() ){
	    navigateToURL(new URLRequest("analytics._trackPageView()"), '_self');
	}
}

以上是关于ActionScript 3 As3:仅在生产模式下跟踪网页浏览量的主要内容,如果未能解决你的问题,请参考以下文章