Forum Discussion
Creating a drop-down menu with layers and triggers
I have been stuck trying to make the triggers work on a drop-down menu I created.
I created the initial drop down from a rectangle shape on the base layer. Then, created a trigger so that when the user clicks this rectangle shape, it shows a new layer. On the new layer are more rectangles that appear directly below the drop down. There are states created for each so when the user hovers over each shape, it becomes highlighted.
The problem comes when I try to create a trigger for the initial drop down on the base layer to change states. I want the answer the user selects in the new layer to fill in the original rectangle on the base layer.
I have looked for tutorials and can't figure out what I'm doing wrong.
Any advice?
- MariaCSStaff
Hi, Lisa.
Thank you for reaching out!
If it works for your design, my suggestion is to use a variable to hold a value, depending on the choice selected:
- Create a text variable. In my example, it's called OptionSelected, with a default value of "Choose an option".
- Insert a reference to that variable on the initial drop-down on your base layer.
- On your layer that lists the different options, add triggers to change the value of the variable when the user clicks a specific option:
Here's a preview:
I hope this helps!
- LisaBrigandiCommunity Member
My apologies Maria, but I don't see "Set" as an option on my Trigger Wizard action list (there's no "object trigger" section even when I create new objects like shapes and buttons). I am still learning Storyline, so I hope this isn't too basic!
- MariaCSStaff
Hi, Lisa.
No apologies are necessary! I'm happy to clarify!
When you create the trigger Adjust variable, "Set" will be the only option for Text variables. If you use a number variable, instead, clicking the word Set will give you additional options (Add, Subtract, Multiply and Divide). On a True/False variable, you will also see Toggle.
Let me know if that helps!
- LisaBrigandiCommunity Member
If you have a moment, could you look at my slide? I feel like I've followed the steps, but I must be still missing something. It still doesn't work in the preview.
- MariaCSStaff
Hi, Lisa.
Thank you for sharing the .story file!
You only have to make two adjustments, so it works as expected:
- On your base slide, you need to add a reference to the variable DropDown so it shows its value. Since the default value is "Select response", that's what it will initially say, and you don't have to type that manually. (Insert > Reference > DropDown)
- The second adjustment was on your layer Dropdown List 1. The order of triggers is important in Storyline, so I moved the trigger that sets the variable's value to execute before the one that hides the layer.
Let me know if that works!
- LisaBrigandiCommunity Member
Oh, perfect! Thank you for all your help!