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

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

thanks in advance!

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”.

thanks alot mr.montoya!