I'm trying to adjust the text of a variable depending on which button the user selects. When I reference the variable later on, nothing comes up... Can the "value" of a variable be text or does it have to be a number?
Assuming TravelerType is a text variable, i.e., neither numeric nor True/False, your trigger should work.
Are you sure the trigger is being launched, i.e., is Button 2 changing sate in previews, when hovered and clicked?
One thing I do to troubleshoot variables is just place a text box on the stage, with the text: VariableName = %VariableName% This allows me to see, in previews, what my variables are doing.
If all else fails, try uploading the project so we can take a look at the code.
I posted this a few minutes ago, but it didn't seem to take. I've inserted 3 buttons that change the text entry variable, based on which button is selected. The reference is then carried over onto the following slide. Not sure if this is what you were looking for, but perhaps between this and the suggestion from Carlos, it's a start.
It looks good, but you're right, it wasn't working. I played with the Federal employee button.
On a hunch, I removed the text from the button itself, inserted a text box on the button and pasted the text into the text box. Then I "attached" the variable to the text box. For good measure, I also copied/pasted the "jump to slide" trigger onto the text box. And it seems to be working. You should be able to do the same for the Invitational Traveler.
Not sure if this is a bug. Perhaps someone from Articulate, or one of the SuperHeroes, will weigh in.
The issue you're seeing is related to trigger execution precedence: if you have multiple triggers on an object, they execute from the top to the bottom (in the triggers pane). The 'jump to next slide' trigger was firing first, and giving control to the next slide before the Variable assignment trigger could fire.
Just flip their order on the triggers pane so the assignment happens BEFORE the jump, and you're back in business
Carlos, you called it! !@#$% trigger order I try to always remember to check that first, but had neglected to do so this time. The reason my "fix" worked is because the triggers ended up on top "automatically." Tx for the reminder!
7 Replies
Hi Leon,
Assuming TravelerType is a text variable, i.e., neither numeric nor True/False, your trigger should work.
Are you sure the trigger is being launched, i.e., is Button 2 changing sate in previews, when hovered and clicked?
One thing I do to troubleshoot variables is just place a text box on the stage, with the text: VariableName = %VariableName% This allows me to see, in previews, what my variables are doing.
If all else fails, try uploading the project so we can take a look at the code.
Cheers,
Carlos
Hi Leon,
I posted this a few minutes ago, but it didn't seem to take. I've inserted 3 buttons that change the text entry variable, based on which button is selected. The reference is then carried over onto the following slide. Not sure if this is what you were looking for, but perhaps between this and the suggestion from Carlos, it's a start.
Thanks so much for your quick reply Carlos and Rebecca.
I thought I did something similar but the Traveler Type isn't appearing on the next slide.
I'm attaching my Storyline file here.
Any insights on where I've gone wrong?
Hi Leon,
It looks good, but you're right, it wasn't working. I played with the Federal employee button.
On a hunch, I removed the text from the button itself, inserted a text box on the button and pasted the text into the text box. Then I "attached" the variable to the text box. For good measure, I also copied/pasted the "jump to slide" trigger onto the text box. And it seems to be working. You should be able to do the same for the Invitational Traveler.
Not sure if this is a bug. Perhaps someone from Articulate, or one of the SuperHeroes, will weigh in.
Hi Leon,
Thanks for posting your .story file.
The issue you're seeing is related to trigger execution precedence: if you have multiple triggers on an object, they execute from the top to the bottom (in the triggers pane). The 'jump to next slide' trigger was firing first, and giving control to the next slide before the Variable assignment trigger could fire.
Just flip their order on the triggers pane so the assignment happens BEFORE the jump, and you're back in business
Cheers,
Carlos
Thanks so much Carlos and Rebecca. It works like a charm now!
Carlos, you called it! !@#$% trigger order
I try to always remember to check that first, but had neglected to do so this time. The reason my "fix" worked is because the triggers ended up on top "automatically." Tx for the reminder!
Leon, glad it's working.
This discussion is closed. You can start a new discussion or contact Articulate Support.