PDA

View Full Version : Hide button


jan
11-15-2001, 05:51 PM
Hello,
I m a newbee flasher when it goes about actionscript.
My question is very simple I think:

How can I hide a button when somebody clicks on it?


In the tutorials I read something about the "setProperty"

I thought this was the code to do it:

on (release) {
("button1", _visible, "False");
}

But it wouldn't work :mad: I have also read the tutorial about paths and I think the path is OK.

I think the aswer will be simple?? Hope somebody can help me!!
:( :)

Bye,

Jan

Billy T
11-15-2001, 09:29 PM
Do you have your button embedded in a movieclip?

I could be wrong but I think you need to do this in order to target it...

I just did a test in which I placed the button inside a movie which I placed on the stage. I gave the movie an instance name of "button".

I then gave the button inside that movie an action of

on (release) {
_root.button._visible = 0
}

and it worked

hope that helps

PS I'll up the file

jan
11-15-2001, 10:14 PM
Great!! I looked at your example file and it works very good. It does exactly what I was searching for.

Really thank you!!:D


Jan

tg
11-16-2001, 12:02 AM
your code

on (release) {
("button1", _visible, "False");
}

would have worked if you had actually used the setProperty action like this

on (release) {
setProperty("button1", _visible, "False");
}

you were really close,
i beleive for most actionscripters billyt's syntax is the preferred way to write the same code.