How to change the state of a shape depending on what was clicked on a previous slide?

Mar 30, 2017

Hi 

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? 

Any advise is greatly appreciated!

Many thanks

Sumetha

5 Replies
Adam Hoe

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:

  • 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 to the 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.

Hope it helps!

 

This discussion is closed. You can start a new discussion or contact Articulate Support.