I'm working on a project that require users to rate a video - click stars shapes which sets the state to selected. Then on the following slide create an exemplar answer showing the number of stars selected on the previous slide along with feedback. How can I change the state of an object on slide depending what was selected previously?
It sounds like you already have five stars on your stage, each with 2 states. For example we will say those state names are Normal and Selected.
First, you will want to create a variable to store this information:
On the Triggers panel, Click Manage project variables
Click Create a new variable
Give the variable a Name like starRating
Set the Type to Number
Leave the Value set to 0
Next, you will want to set the variable to the number of stars the user selected. So, on the page, where they initially select the star rating:
Select the first star the user could click on.
On the Triggers panel, click Create a new trigger
Set the Action to Adjust variable
Set the Variable to the variable name. In this case starRating
Set the Operator to = Assignment
Set the Value tothe number of the corresponding star. In this case its the first star so, 1
Set When to User Clicks
Set Object to whatever the name of the first star is (We will call it Star 1)
Click OK
*Repeat this process for the remaining 4 stars
Finally, we will want to show that same star rating on the future slide. There are a couple ways to do this, lets set a trigger for each individual star when the timeline starts. On the page where we recall need to recall the previously selected rating, do the following:
(It will help if we don't have any objects selected to start. Storyline will assume we are targeting the slide rather than a specific object)
On the Triggers panel, click Create a new trigger
Set the Action to Change state of
Set On Object to whatever the name of the first star is (In this case Star 1)
Set To State to Selected
Set When to Timeline starts
Set Object to the name of the slide. (We will call it 1.2 Star Rating)
We will need to add a new condition here so click the blue +
Set List to Variables
Set If to starRating
Set Operator to >= Greater than or equal to
Set Type to Value
Set Value to the star number are wanting to target. In this case 1
Click OK
*Repeat this process for the remaining 4 stars
There may be some additional adjusting you wish to do but this will give you a good start.
I included a .story file that should have what you are looking for here. It has some extra triggers and techniques to make sure the functionality is clean. Feel free to use, adjust, or reference anything here. Also let me know if you have any questions or want to try it a different way!
5 Replies
Hi Sumentha,
One way to do this would be to use a variable.
It sounds like you already have five stars on your stage, each with 2 states. For example we will say those state names are Normal and Selected.
First, you will want to create a variable to store this information:
Next, you will want to set the variable to the number of stars the user selected. So, on the page, where they initially select the star rating:
Finally, we will want to show that same star rating on the future slide. There are a couple ways to do this, lets set a trigger for each individual star when the timeline starts. On the page where we recall need to recall the previously selected rating, do the following:
(It will help if we don't have any objects selected to start. Storyline will assume we are targeting the slide rather than a specific object)
There may be some additional adjusting you wish to do but this will give you a good start.
Hope it helps!
I included a .story file that should have what you are looking for here. It has some extra triggers and techniques to make sure the functionality is clean. Feel free to use, adjust, or reference anything here. Also let me know if you have any questions or want to try it a different way!
Hi Adam
Thank you so much for the detailed instruction and the example. Much appreciated. I will certainly try to re-create this in my project.
Thanks again!
Sumetha
Hi Adam
The tutorial is great. Dynamically adding and reducing the star rating is brilliant. I
Best regards
Sumetha
Thanks Sumentha! I hope everything works out for you. Please let me know if you have any additional questions
This discussion is closed. You can start a new discussion or contact Articulate Support.