• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Is it impossible to disable the [down] state in a button symbol?

Explorer ,
Dec 06, 2018 Dec 06, 2018

Copy link to clipboard

Copied

I have a button symbol on stage (not a movie clip button - a native button symbol).

It has an Up, Over, and Hit frame, but no Down frame.

When the user clicks the button, it flashes and repeats the Over frame.  I want it to just do nothing.

I've tried saying stage.mouseChildren=false; but this does nothing, as I am told that this is exclusively for movie clips and not button symbols.

Is there any way to disable the Down frame in a button symbol?  Or do I just have to remake all of my buttons as movie clips with event listeners?

Views

298

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 08, 2018 Dec 08, 2018

Thanks.

When the states change the Movie Clip in the over and the down states starts over. This happens because the simple button stores each state as a separate Sprite and when the user interacts these sprites switch.

I don't think that is impossible to overcome this but I do think it would require a lot of effort that in the end wouldn't justify the usage of these buttons that are supposed to be... simple.

So what I suggest to you is to use Movie Clips as buttons instead whenever you need a more

...

Votes

Translate

Translate
LEGEND ,
Dec 06, 2018 Dec 06, 2018

Copy link to clipboard

Copied

I'm so confused. What exactly have you done to this poor button? Why would you set mouseChildren=false on it? Are you saying you don't want it to respond in any way at all when clicked? If so then why is it a button? If it's just a regular button that you don't want to have a distinct Down state, then... don't give it a a distinct Down state. Just make its Down state frame identical to its Up or Over frame, whichever you prefer.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 06, 2018 Dec 06, 2018

Copy link to clipboard

Copied

I want to use the button to display an animation when the mouse is over it.  This works fine.  There is a movieclip in the [over] state.  I don't want the user to be able to click the button, because when they do, it resets the animation as if just starting the [over] state again.

I tried having a blank keyframe, an identical frame to the [over] state, and a regular frame - none of these work.

I tried having the [down] state be a graphic symbol that starts on frame 130 (after the animation of the movieclip is done) - this still resets the animation when clicked.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 06, 2018 Dec 06, 2018

Copy link to clipboard

Copied

jostrom  wrote

I don't want the user to be able to click the button...

Being clicked is the sole purpose in life of a button. This is the sort of thing that happens when you try to use the wrong tool for the job.

As you say, you should have implemented this as a movieclip with mouse over/out listeners.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 06, 2018 Dec 06, 2018

Copy link to clipboard

Copied

Hi.

These buttons belong to the SimpleButton class. Each state is exported as a separate Sprite.

What you can do is to create a simple class that sets the down state to be the same as one of the remaining states. Like this:

- [CustomSimpleButton.as]

package

{

     import flash.display.SimpleButton;

     public class CustomSimpleButton extends SimpleButton

     {

          public function CustomSimpleButton()

          {

               downState = overState;

          }

     }

}

- Go to the Library;

- Choose all the simple buttons you have there;

- Go to their properties;

- Check Export for ActionScript;

- Set the Base Class field to CustomSimpleButton.

FLA download:

animate_cc_simple_button_disable_down_state.zip - Google Drive

Regards,

JC

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 06, 2018 Dec 06, 2018

Copy link to clipboard

Copied

Thank you - I'll try this solution tonight and report back.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 07, 2018 Dec 07, 2018

Copy link to clipboard

Copied

JC, thank you again for your help.  I've tried your solution and replicated the problem in your file.

I changed the down state for Button 1 to a movieclip and put a tweened animation in it.  When I click the button, it resets the down state.

https://drive.google.com/open?id=1yYioq_bkqbszfdT-ZN9-lGOuRmHXwdpy

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 08, 2018 Dec 08, 2018

Copy link to clipboard

Copied

Thanks.

When the states change the Movie Clip in the over and the down states starts over. This happens because the simple button stores each state as a separate Sprite and when the user interacts these sprites switch.

I don't think that is impossible to overcome this but I do think it would require a lot of effort that in the end wouldn't justify the usage of these buttons that are supposed to be... simple.

So what I suggest to you is to use Movie Clips as buttons instead whenever you need a more sophisticated interactivity.

Regards,

JC

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 10, 2018 Dec 10, 2018

Copy link to clipboard

Copied

Sorry, could have sworn I replied to this and marked the answer as correct.  Just wanted to say thanks again.  I am starting the buttons from scratch as you suggested.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 10, 2018 Dec 10, 2018

Copy link to clipboard

Copied

LATEST

You're welcome and no problem!

The important thing is that you achieve what you want.

Regards,

JC

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines