package com.phidgets.events
{
	import com.phidgets.Phidget;
	import com.phidgets.PhidgetError;
	import flash.events.Event;
	
	public class PhidgetErrorEvent extends Event
	{
		public static const ERROR	:String = "error";
		
		private var _error:PhidgetError;
		private var _sender:Object;
		
		public function PhidgetErrorEvent (type:String,sender:Object,error:PhidgetError) {
			super(type);
			_error = error;
			_sender = sender;
		}
		
		override public function toString():String{
				return "[ Phidget Error Event: "+_error.message+ " ]";
		}
		
		public function get Error():PhidgetError{ 
			return _error;
		}
		
		public function get Sender():Object {
			return _sender;
		}
	}
}