# Slider Scale

**URL:** https://forum.kirupa.com/t/slider-scale/89669
**Category:** flash
**Created:** [May 10, 2005, 5:07pm UTC](https://forum.kirupa.com/t/slider-scale/89669 "2005-05-10T17:07:21Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![luke\_s](https://avatars.discourse-cdn.com/v4/letter/l/e36b37/32.png) [@luke\_s](https://forum.kirupa.com/u/luke_s)
#### Post date: [May 10, 2005, 5:07pm UTC](https://forum.kirupa.com/t/slider-scale/89669/1 "2005-05-10T17:07:21Z")

</div>

Pls excuse if this is elementary, but thats where I’m at with AS.

I’ve built a volume slider based off the slider tutorial here on Kurupa. That works great, Thing is I also have a Speaker Icon that I want to animate in size and/or alpha based on the position of the slider.

I thought I’d be able to do just the following in my main timeline as that works for volume:

//Works for Volume  
this.onEnterFrame=function(){  
inSound.setVolume(volumeSlider.ratio);  
}

//Doesn’t work for Alpha etc.  
this.onEnterFrame=function(){  
volume\_mc.\_alpha(volumeSlider.ratio);  
}\*/

here’s the code from my slider mc.

this.ratio=90 ;  
dragger.onPress=function(){  
this.startDrag(true,0,this.\_y,line.\_width,this.\_y);  
this.onEnterFrame=function(){  
ratio=Math.round(this.\_x\*100/line.\_width);  
\_root.volume = ratio;  
}  
}  
dragger.onRelease=dragger.onreleaseOutside=stopDrag;
