Skip to main content
Known Participant
December 17, 2016
Answered

How to make a button stay in the active state after it's been clicked

  • December 17, 2016
  • 1 reply
  • 2766 views

Can anyone offer a simple way to have a button stay active after it has been clicked?

Similar to the gradient with white type ITI button in the attached image.

Thanks in advance.

    This topic has been closed for replies.
    Correct answer Colin Holgate

    Thanks for the advise Colin, can you please explain how I would achieve that? Do you know of any tutorials that might help me with accomplishing that task?


    I don't know if there is a tutorial, but these would be the steps, using the Scene 2 About Me as an example:

    In the library, right-click on the About me button, and select Duplicate. Give the duplicate a different name, like About me Active.

    On the stage, select the About me button and do a Copy. Do a Paste in Place, which will put a second copy of the button on top of itself.

    While the copy is selected, click on the Swap button in the Properties panel, and swap it for About me Active.

    Double-click into the button you just did the swap on, and click and drag frame 3 over to frame 1.

    Click on frame 2 and press Delete, and the same with frame 4.

    You should now have a gray version of the button, sat on top of the regular one.

    Because you have a key frame in frame 10 of Scene 2 you would want to copy the new button you just made in frame 1, and Paste in Place it in frame 10.

    1 reply

    kglad
    Community Expert
    Community Expert
    December 17, 2016

    the easiest way is to use a movieclip button and explicitly display its states by using gotoAndStop.

    but you can control button states by using the simplebutton upState, downState and overState properties.  eg,

    after clicking:

    your_btn.upState=your_btn.downState;

    but i recommend you using a movieclip button to make it easier for you to understand what you're doing.

    Known Participant
    December 17, 2016

    Hi- and thanks for the recommendation. However, I'm wondering what would be the simplest way to implement the solution to the .fla file in the attached link. Would I need to redo all of the buttons in all of the scenes?

    Dropbox - AnimateProject_Complete copy.fla

    Known Participant
    December 17, 2016

    Looking at your FLA, and easy solution would be to put another version of the button on top of the current section button, to look like the active state. The using MovieClip and remembering states may not work out easily because you're using different scenes.


    Thanks for the advise Colin, can you please explain how I would achieve that? Do you know of any tutorials that might help me with accomplishing that task?