Accordian Issue

Jun 16, 2021

Hi I am having an issue with my accordian i am trying to create. At present i only have one in.. with the theory that i'll duplicate them once i've got the triggers correct; but at the minute i'm tearing my hair out! I'm hoping when you open the .story file it's straight forward to see my issue when i go to press the cross again it doesn't close and reset itself! Please help! I also want it so that when the video or media completes on the second layer it loads back to the orignal slide so it can be closed. 

Any help please?

2 Replies
Walt Hamilton

Last question first: Set the layer with the  media to hide itself when the timeline ends and set the timeline to end when the media ends. (Or you can create a trigger to hide the layer when the media ends.)

The first change I would suggest is to get rid of this trigger:


All objects with a Selected state have a built-in superpower that changes their state to "Selected" when they are clicked. If you create a trigger to take that same action, you run the risk of conflicting with the built-in action, and that can get really messy.

I think you can simplify your thinking, and get the accordion to work. I know this is really tempting, and seems glamorous, but it isn't reliable:


Reading "Take action when state of XXX is ..." makes most people think they are dealing with "Take action when state of XXX BECOMES ...". But if there actually is an agent on the screen that listens for state changes, it is very far down the priority list and/or is effective only under certain conditions. If you want absolute reliability, use the agent that listens for variable change ("Take action when variable XXX changes"). It has high priority, and is effective under all conditions.

Even easier; to use the built-in superpowers.  You have two basic actions you want on this slide. Have new options show/hide when + is clicked, and have a video play when > is clicked. So get rid of the "When state of +Button" triggers. Any action that changes the state of the + Button can change the value of the variable.  Put all the actions on the two buttons.

Use the superpower of the Selected state: when it is clicked, it toggles (changes) back and forth between Selected and Normal. All the actions you want can happen when the +Button is clicked, depending on its state. So check out The left + button. When it is clicked, it first changes to Selected, then performs the actions in the list that depend on it being in Selected state. When it is clicked again, it first changes to Normal, then performs the actions in the list that depend on it not being in a Selected state. ( You can't use "if state is Normal", because "Selected" is a Normal state.)

However, there are times when you may need to keep track of the status of the accordion. That's when you use a variable like OpenClose, and the superpower of T/F variables. You can toggle T/F variables. When you write the trigger, instead of "set", use "toggle", like I did in the right + Button.

 If you need more help, I posted a more complete sample here: