⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tracer.as

📁 flex 实现的一个showcase 喜欢flex的朋友可以
💻 AS
字号:
package com.teknision.debug
{
	
	import flash.events.*;
	import flash.net.*;
	import flash.utils.getTimer;
	
	import mx.core.Application;
	import mx.core.UIComponent;
	import mx.managers.*;

	public class Tracer extends UIComponent
	{
		
		static public var asyncError:String = "asyncError";
		static public var securityError:String = "securityError";
		static public var statusEvent:String = "statusEvent";
		
		static public function trace(i_msg:String,i_thread:String):void{

			var myLC:LocalConnection = new LocalConnection();
			
			myLC.addEventListener(AsyncErrorEvent.ASYNC_ERROR,handleAsyncError);
			myLC.addEventListener(SecurityErrorEvent.SECURITY_ERROR,handleSecurityError);
			myLC.addEventListener(StatusEvent.STATUS,handleStatus);
			
			myLC.allowDomain("*");
			var traceObj:Object = new Object();
			traceObj.timestamp = getTimer();
			traceObj.message = i_msg;
			traceObj.threadpath = i_thread;
			traceObj.project = Tracer.getProjectName();
			myLC.send('_tektrace', 'onTraceData',traceObj);

		}
		
		static public function getProjectName():String{

			var myName:String = Application.application.name;
			return myName;
			
		}
		
		static public function handleAsyncError(event:AsyncErrorEvent):void{
			
		}
		
		static public function handleSecurityError(event:SecurityErrorEvent):void{
			
		}
		
		static public function handleStatus(event:StatusEvent):void{
			
		}
		
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -