Buttons that interact with each other

Comments

2 comments

  • Avatar
    Tony Redhead

    Hi Nadine,

    I posted an update earlier in the day but Jack, one of our fantastic Oomph designers, came up with a much better way so I've removed it. However I've extended his work a bit and added some function to the buttons so selecting the same button will also close the panel.

    What we have are two buttons, ButtonOne and ButtonTwo. Both buttons have hyperlinks named the same way "ButtonOne" and "ButtonTwo". There is also a field with a hyperlink named "PanelReveal" where our information panels will be displayed.

    screenshot190.png

    In the project folder 20-Reveal, there is a P1-1.pdf file that contains the two buttons and the panel field. There are three folders "PanelReveal", "ButtonOne" and "ButtonTwo".

    PanelReveal holds a S1-1.pdf file of three pages, the first page is blank so the field will be transparent on loading, the second page is Panel1 and the third page is Panel2.

    ButtonOne and ButtonTwo both hold S1-1.pdf files of two pages each. The first and second pages have hyperlinks that show and hide the panels as well as swapping between pages one and two.

    screenshot191.png

    The trick to get them working together is to make sure that every time a button is tapped it resets the other one.

    Therefore the script on Page 1 of S1-1.pdf in the folder ButtonOne is;

    Action,PanelReveal,Page=2,Action,ButtonTwo,Page=1,Action,ButtonOne,Page=2

    So the action becomes:

    1. Go to Page 2 of PanelReveal 
    2. Set the ButtonTwo to Page 1
    3. Set the ButtonOne to Page 2

    and the script on Page 2 of S1-1.pdf in the folder ButtonOne is;

    Action,PanelReveal,Page=1,Action,ButtonTwo,Page=1,Action,ButtonOne,Page=1

    and the action becomes:

    1. Go to Page 1 of PanelReveal
    2. Set the ButtonTwo to Page 1
    3. Set the ButtonOne to Page 1

    Then it's basically repeated for the ButtonTwo with the following scripts for Pages 1 & 2;

    Action,PanelReveal,Page=3,Action,ButtonOne,Page=1,Action,ButtonTwo,Page=2

    and

    Action,PanelReveal,Page=1,Action,ButtonOne,Page=1,Action,ButtonTwo,Page=1

    This way no matter which order the buttons are tapped in they will either show or hide the Object Pages properly.

    I've attached sample files.

    Note: it's important that the button that's being tapped Action is last in the list. If there is another Action for a different object after it, it won't work.

    regards,

    Tony

  • Avatar
    Tony Redhead

    Find attached an InDesign .idml file with the pages that make up the Button-Panel-Reveal.

     

    Tony

Please sign in to leave a comment.

Powered by Zendesk