# \[help\] Making a Scrollbar Invisible until on{release}

**URL:** <https://forum.kirupa.com/t/help-making-a-scrollbar-invisible-until-on-release/347>\
**Category:** flash\
**Created:** [July 15, 2002, 1:40am UTC](https://forum.kirupa.com/t/help-making-a-scrollbar-invisible-until-on-release/347 "2002-07-15T01:40:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kruza](https://avatars.discourse-cdn.com/v4/letter/k/a9a28c/32.png) [@kruza](https://forum.kirupa.com/u/kruza)\
**Post date:** [July 15, 2002, 1:40am UTC](https://forum.kirupa.com/t/help-making-a-scrollbar-invisible-until-on-release/347/1 "2002-07-15T01:40:57Z")

</div>

I need help in making a scrollbar invisible until a button is pressed. (in actionscript)

thanks in advance!

---

<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:** [July 15, 2002, 2:42am UTC](https://forum.kirupa.com/t/help-making-a-scrollbar-invisible-until-on-release/347/2 "2002-07-15T02:42:42Z")

</div>

hmm… no idea why you would want that, but here’s the answer for Flash MX using the scrollbar component.

for frame 1 of the main timeline, enter the following actionscript  
bar.\_alpha=0; //this turns your scrollbar to invisible  
status=“on”; //use this if you want to keep track of the status in  
//a button toggle situation

if you want a button to toggle it on and off…  
create your button  
for the button actions, enter the following:

on(release){  
if(status==“on”){  
\_root.bar.\_alpha=0;  
\_root.status=“off”;  
} else {  
\_root.bar.\_alpha=100;  
\_root.status=“on”;  
}  
}

this translates to:

when the mouse button is released

check to see what the value of the variable status is

if the value of status is on (meaning the scrollbar is visible)

change to scrollbar \_alpha setting to 0 (therefore making it invisible)

and change the value of the status variable to “off” so I know it’s off next time

else… this means… if upon checking the bar was already off,  
then make it visible (by setting \_alpha to 100) and change status to on.

NOTE: You must give the scrollbar component an instance name. I called it “bar”.

---

<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:** [July 17, 2002, 12:54pm UTC](https://forum.kirupa.com/t/help-making-a-scrollbar-invisible-until-on-release/347/3 "2002-07-17T12:54:41Z")

</div>

thanks alot mr.montoya!
