# I need to remove all the extras from a class

**URL:** https://forum.kirupa.com/t/i-need-to-remove-all-the-extras-from-a-class/289812
**Category:** flash
**Created:** [June 4, 2009, 11:26pm UTC](https://forum.kirupa.com/t/i-need-to-remove-all-the-extras-from-a-class/289812 "2009-06-04T23:26:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![portuswebs](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@portuswebs](https://forum.kirupa.com/u/portuswebs)
#### Post date: [June 4, 2009, 11:26pm UTC](https://forum.kirupa.com/t/i-need-to-remove-all-the-extras-from-a-class/289812/1 "2009-06-04T23:26:43Z")

</div>

I am making a game and I want to remove all that I dont need from a class:

I just need:  
addEventListener  
removeEventListener  
dispatchEvent  
graphics  
x  
y

```auto
package  
{
	import flash.display.Graphics;
	import flash.display.Stage;
	import flash.events.EventDispatcher;
	
	public class MinUnit extends EventDispatcher
	{
		public var graphics:Graphics;
		
		public var stage:Stage;
		
		public var x:Number;
		public var y:Number;
		
		public function MinUnit()
		{
			graphics.beginFill(0xFF0000);
			graphics.drawRect(-1, -1, 2, 2);
			graphics.endFill();
			
			stage = root;
			
			x = Math.random() * stage.stageWidth;
			y = Math.random() * stage.stageHeight;
		}
		
	}
	
}

```

but I dont know how to make it work?

what am I doing wrong or what is missing?

thanks
