(function(window){	function Alien(bitmapSequence, spriteSheet, _width, _height, _sequence, _color)	{		this.bitmapSequence	= bitmapSequence;		this.spriteSheet	= spriteSheet;		this.width			= _width;		this.height			= _height;		this.sequence		= _sequence;		this.color			= _color;		this.shotFired		= new signals.Signal();		this.reloadTimer	= null;		this.shootTimer		= null;		this.initialize();	}	Alien.prototype = new Container();		Alien.prototype.width		= 0;		Alien.prototype.height		= 0;		Alien.prototype.color		= '#000';		Alien.prototype.sequence	= null;		// Constructor:		Alien.prototype.Container_initialize = Alien.prototype.initialize;	// Unique to avoid overiding base class		/**		* INIT METHODS		*/		Alien.prototype.initialize = function()		{			this.Container_initialize();			this.bitmapSequence.gotoAndStop(this.sequence);			this.addChild(this.bitmapSequence);		}		Alien.prototype.inHitArea = function(point)		{			var global	= new Point(this.parent.x + this.x, this.parent.y + this.y); // localToGlobal() method seems to have a bug...?!			if(point.x >= global.x && point.x <= global.x + this.width && point.y >= global.y && point.y <= global.y + this.height) return true;			return false;		}		Alien.prototype.shoot = function()		{			this.bitmapSequence.gotoAndStop(this.bitmapSequence.nextSequence);			this.shotFired.dispatch(new Point(this.x + this.width/2, this.y + this.height));			var _this	= this;			this.reloadTimer	= new Timer(800, 1);			this.reloadTimer.TIMER_COMPLETED.addOnce(function(){_this.reload();});			this.reloadTimer.start();		}		Alien.prototype.reload = function()		{			this.destroyTimers();			this.bitmapSequence.gotoAndStop(this.bitmapSequence.nextSequence);			var _this	= this;			this.shootTimer	= new Timer(MathUtils.randRange(5000, 15000), 1);			this.shootTimer.TIMER_COMPLETED.addOnce(function(){_this.shoot();});			this.shootTimer.start();		}		/**		* DESTROY METHODS		*/		Alien.prototype.disable = function()		{			this.destroyTimers();			this.shotFired.removeAll();		}		Alien.prototype.destroyTimers = function()		{			if(this.shootTimer)			{				this.shootTimer.dispose();				this.shootTimer	= null;			}			if(this.reloadTimer)			{				this.reloadTimer.dispose();				this.reloadTimer	= null;			}		}		/**		* RENDERING METHODS		*/		Alien.prototype.enable = function()		{			this.bitmapSequence.gotoAndStop(this.bitmapSequence.nextSequence);			this.reload();		}	window.Alien = Alien;}(window));
