Skip to main content
raven+crow
Known Participant
November 30, 2023
Question

Best way to show four different layers one at a time

  • November 30, 2023
  • 1 reply
  • 796 views

Hey all. New to the community and Animate and wondering if I can get some help on a concept I'm having trouble teasing out.

Basically, I'm trying to create an informational graphic that allows users to click on one of four buttons and show different corresponding information in the main circle —images attached of the four graphics with filler content. In actuality, the real graphic will show different intertnal text in the big circle whebn each of those four top buttons are clicked.

 

I had originally created motion tweens for each layer going from 0 to 100 on the Alpha and back to 0, with two stop actions, then made the four top  buttons trigger each tween accrodingly. But that breaks after two layers, I realize now.

 

I'm hoping there's a better way to animmate and make the big circle info change with the top buttons being clicked?

 

And thanks in advance, all!

    This topic has been closed for replies.

    1 reply

    kglad
    Community Expert
    Community Expert
    November 30, 2023

    i don't know what your post title means, but all layers always show unless you take steps to hide them.

     

    as for your screenshot, it looks pretty simple to just use keyframes to show different displays, or if the only differences are the text, use a dynamic textfield and code to show the different content.

    raven+crow
    Known Participant
    December 1, 2023

    Hm, yeah, still having issues—I've coded the four buttons (I thought) to go to each of the keyframes:


    var _this = this;
    /*
    Clicking on the specified symbol instance executes a function.
    */
    _this.StableButton.on('click', function(){
    /*
    Moves the playhead to the specified frame number in the timeline and continues playback from that frame.
    Can be used on the main timeline or on movie clip timelines.
    */
    _this.gotoAndPlay(2);
    });


    var _this = this;
    /*
    Clicking on the specified symbol instance executes a function.
    */
    _this.ReluctantButton.on('click', function(){
    /*
    Moves the playhead to the specified frame number in the timeline and continues playback from that frame.
    Can be used on the main timeline or on movie clip timelines.
    */
    _this.gotoAndPlay(3);
    });


    var _this = this;
    /*
    Clicking on the specified symbol instance executes a function.
    */
    _this.OverwhelmedButton.on('click', function(){
    /*
    Moves the playhead to the specified frame number in the timeline and continues playback from that frame.
    Can be used on the main timeline or on movie clip timelines.
    */
    _this.gotoAndPlay(4);
    });


    var _this = this;
    /*
    Clicking on the specified symbol instance executes a function.
    */
    _this.FirefightingButton.on('click', function(){
    /*
    Moves the playhead to the specified frame number in the timeline and continues playback from that frame.
    Can be used on the main timeline or on movie clip timelines.
    */
    _this.gotoAndPlay(5);
    });


    But the buttons aren't working as they should or going to the right places. Not sure what I'm doing wrong here....

     

    raven+crow
    Known Participant
    December 1, 2023

    you can use frame labels, too.  that might make it easier for you.to code.

     

    otherwise, copy and paste a screenshot of your main timeline and siw your updated code.


    great—I think I've got it working now. thanks so much for all the help