Change visiblity upon clicking a button

I have a mc tracking as a button with a working on(release) statement.

Within the on release statement is this code that doesn’t work for me:

_root.playbtn.pause_mc._visible = true;
_root.playbtn.play_mc._visible = true;

The first layer of the button has a mc with instance called play_mc
And the second layer of the button with a mc instance called pause_mc

The button instance on the stage is called playbtn.

thanks for your help

Use the same movie clip for both buttons. Place each button picture on a different frame in the movie clip timeline. Then place the stop(); command in each frame, then use this code in the main timeline:

playbtn.onRelease = function()    {
    this.play();
}

this should fix your problem

thanks, i just noticed a very weird problem.

I created a new blank movie
Imported two images
Created a new mc
put image 1 as frame 1 with stop(); in the frame
put image 2 as frame 2 with stop(); in the frame
dropped the new symbol on my stage and set it as a button
when I run the movie, and put my mouseover the button, it acts like i have some mouseover action and changes frames

This is where I was going to use your code, but couldn’t get that far because of this problem.

its really odd.

could you upload your flash file?

thanks

this is just the stupid button that I was having problems with.

Here you go - just leave your movieclip as a movieclip (instead of a button) and all is well.

That works out perfectly thank you!

I didn’t realize that non buttons can have onrelease

You’re welcome, and I personally would recommend to never use buttons. Back in Flash 4 you had to, but since then you’re better off using movieClips for everything. Well, that’s my personally choice anyway :slight_smile: