how to change button target based on variable state
My training has 4 sections and a test. page 2 has 4 buttons which target each of the four sections. The fifth button targets the test.
- button 1 - jumps to section 1
- button 2 - jumps to section 2
- button 3 - jumps to section 3
- button 4 - jumps to sections 4
- button 5 - jumps to test
I do not want button 5 to jump to the test unless 1-4 have been completed. If clicked before 1-4 are completed i would like a popup to appear saying they must complete 1-4.
I have a variable representing each section (sectionOneComplete, SectionTwoComplete, etc). I have it set so that the last page of each section changes the that sections variable from false to true.
I have a state on buttons 1-4 called completed. Each is set to change to state 'completed' when timeline starts if variableName is equal to true.
I two triggers set to button 5:
- jump to slide 6.1(this is the first slide in test scene)
- when the user clicks
- if button1's state is equal to completed
- if button2's state is equal to completed
- if button3's state is equal to completed
- if button4's state is equal to completed
- show layer NotYet
- when user clicks
- if button1's state is not equal to completed
- if button2's state is not equal to completed
- if button3's state is not equal to completed
- if button4's state is not equal to completed
The voices in my head tell me this should work. But is is not. Any idea why? Anyone have a better way of accomplishing my goal (not letting them access the test till they have completed the first 4 sections?
Thank you in advance for your time and attention!