# AS3 event slider problem within a class

**URL:** <https://forum.kirupa.com/t/as3-event-slider-problem-within-a-class/314015>\
**Category:** flash\
**Created:** [September 16, 2010, 6:08am UTC](https://forum.kirupa.com/t/as3-event-slider-problem-within-a-class/314015 "2010-09-16T06:08:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LordScruffo](https://avatars.discourse-cdn.com/v4/letter/l/82dd89/32.png) [@LordScruffo](https://forum.kirupa.com/u/LordScruffo)\
**Post date:** [September 16, 2010, 6:08am UTC](https://forum.kirupa.com/t/as3-event-slider-problem-within-a-class/314015/1 "2010-09-16T06:08:47Z")

</div>

Hi,

I’ve got this code inside a package, and it’s not working… i get nothing. it seems to allow me to move movieclips around, but not change the value of the slider. or change the value of text fields.

what am i doing wrong?

public function makeSliders():void {  
var westHousingSlider:Slider = new Slider();  
westHousingSlider.value = 1;  
westHousingSlider.minimum = 1;  
westHousingSlider.maximum = 20;  
westHousingSlider.liveDragging = true;  
westHousingSlider.snapInterval = 1;  
westHousingSlider.tickInterval = westHousingSlider.snapInterval;  
westHousingSlider.width=180;

```
		addChild(westHousingSlider);
		westHousingSlider.x = 1352.3; westHousingSlider.y = 544.75; 
		westHousingSlider.addEventListener (SliderEvent.CHANGE, resizeWestHousing);
		
		
		var westRetailSlider:Slider = new Slider();
		westRetailSlider.value = 10;
		westRetailSlider.minimum = 1;
		westRetailSlider.maximum = 20;
		westRetailSlider.liveDragging = true;
		westRetailSlider.snapInterval = 1;
		westRetailSlider.tickInterval = westRetailSlider.snapInterval;
		westRetailSlider.width=180;

	
		addChild(westRetailSlider);
	}

	
	public function resizeWestHousing(event:SliderEvent):void{
		if(event.target.value == 1){
		westRetailSlider.value = 6;
		
		}

```

thanks,

Lord Scruffo
