Simple Show / Hide Button

Hi,
I working on an example in which I will have 1 button.
When the scene loads I have a movie clip which I set _visible = false. When you click the button once the hidden movie is shown. When you the the button a 2nd time the now visible movie is hidden & so on. I started out by creating a movie clip symbol & then put a button in it. I initialize the variable “condition” = 0 on the 1st frame of this move cip. I then dragged this movie clip to the main scene & added the following script:

on (press) {
&nbsp &nbsp &nbsp &nbsp if (condition == 0) {
&nbsp &nbsp &nbsp &nbsp _root.insbox._visible = true
&nbsp &nbsp &nbsp &nbsp condition == 10
}}
&nbsp &nbsp &nbsp &nbsp

on (press) {
&nbsp &nbsp &nbsp &nbsp if (condition == 10) {
&nbsp &nbsp &nbsp &nbsp _root.insbox._visible = false
&nbsp &nbsp &nbsp &nbsp condtion = 0
}}

When you click the button the 1st time the movie clips becomes visible. When you click a 2nd time becomes invisible. Then it won’t work again from there.

Any suggestions?
Thank you.
Tim

There’s a typo :

 on (press) {
        if (condition == 10) {
        _root.insbox._visible = false
        ** condition = 0**
}}

Thank you. Could it be that simple?
Does the logic look good to you?

yes it is that simple and yes the logic is good.

Here’s the code:
It’s not working for me & for something that should be so simple it’s driving me crazy. I going to upload the .fla in a sec. If you guy could take a look for me I’d appreciate it. You can find it at members.aol.com/webclickusa/fla
Thanks again

on (press) {
&nbsp &nbsp &nbsp &nbsp if (condition == 0) {
&nbsp &nbsp &nbsp &nbsp _root.insbox._visible = true
&nbsp &nbsp &nbsp &nbsp condition = 10
&nbsp &nbsp &nbsp &nbsp
}}
&nbsp &nbsp &nbsp &nbsp

on (press) {
&nbsp &nbsp &nbsp &nbsp if (condition == 10) {
&nbsp &nbsp &nbsp &nbsp _root.insbox._visible = false
&nbsp &nbsp &nbsp &nbsp condition = 0
}}

try

on(press){
if(condition == true){
_root.insbox._visible = 0 //this makes it invisible
condition = false
}else{
_root.insbox._visible = 1 //this makes it visible
condition = true
}
}

haven’t tried it cuz i’m not near my machine.

Jubba,
Thanks, much appreciated.
working perfectly. Be forwarned, I may
flood you with more questions as I try to learn
AS.

Take care,
Tim

no problem my friend. I am happy to help.