# Slider bar to control \_alpha etc

**URL:** https://forum.kirupa.com/t/slider-bar-to-control--alpha-etc/11728
**Category:** Uncategorized
**Created:** [January 21, 2003, 4:29pm UTC](https://forum.kirupa.com/t/slider-bar-to-control--alpha-etc/11728 "2003-01-21T16:29:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![funkyjones](https://avatars.discourse-cdn.com/v4/letter/f/43a26b/32.png) [@funkyjones](https://forum.kirupa.com/u/funkyjones)
#### Post date: [January 21, 2003, 4:29pm UTC](https://forum.kirupa.com/t/slider-bar-to-control--alpha-etc/11728/1 "2003-01-21T16:29:20Z")

</div>

Hi!  
Im trying to do a slider bar that can controlls a MC \_alpha value.  
I have done a bar that is 100 pixles and the button is in the middle of the bar. And can go +50 x and -50 x.  
Please help me out with this one! What code shall i put on the slider?

/mvh ZeusVL

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 21, 2003, 5:09pm UTC](https://forum.kirupa.com/t/slider-bar-to-control--alpha-etc/11728/2 "2003-01-21T17:09:48Z")

</div>

the easiest way to do it is to start the sliderbar at 0 (within the whole ‘slider’ clip) and have it go to 100 since that is your range (alpha between 0 - 100) The problem here is that you might want to flip the way the slider operates, ie one direction is 0 and the other is 100 as opposed to vise versa. To fix that, just set the \_alpha to be based on 100 - the slider position.

Your going based on x (sideways slider) so youd have code like (using startdrag for simplicities sake)

// button in sliderbar  
on(press){  
startDrag(this,false,0,100,0,0);  
}  
on(release, releaseOutside){  
stopDrag();  
}

// sliderbar clip containing slider bar button  
onClipEvent(enterFrame){  
\_root.whateverClip.\_alpha = 100-\_x;  
}

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 21, 2003, 6:10pm UTC](https://forum.kirupa.com/t/slider-bar-to-control--alpha-etc/11728/3 "2003-01-21T18:10:52Z")

</div>

Hey!  
Thanks man! It helpt alot!  
Thank you!
