Skip to main content
Participating Frequently
August 15, 2014
Question

How do you create a button that links to a number increasing

  • August 15, 2014
  • 1 reply
  • 329 views

I would to create a button. Whenever you click it increase the value of a designated spot. So the spot would start off with 0. Click the button then it changes to one.

Click it again then it changes to 2 etc. Are there any tutorials anywhere to do this?

Thanks

This topic has been closed for replies.

1 reply

Lilybiri
Legend
August 15, 2014

Use an advanced standard action (to avoid the playhead progression): Increment v_...  with 1 where v_... is a defined user variable. Give it a default value of 0. What do you want to do with this variable? What do you mean by 'increase the value of a designated spot'?

wazoooAuthor
Participating Frequently
August 16, 2014

Im trying to create a easy game where users will click through slides and click on hidden objects. Every time they click on a hidden object they receive 1 point. The point will display at the bottom of every page. Then show the total at the end of slide presentation

Lilybiri
Legend
August 16, 2014

You have to reflect little bit more: what do you want to happen when the user clicks multiple times on the same object? I suppose you will not want to increment the score on the second... click? You know that 'cheating' is a normal behavior if you don't take into account that kind of situations. The easiest way would be to disable the click box once it is clicked, or if you have only one click box/slide to advance immediately to the next slide. You also don't tell if you allow backwards navigation? A possible first work flow could be (regret that you don't mention the version you are on):

  • create a user variable v_score with a default value of 0
  • insert that variable in a text container (can be shape or caption) on the first slide and display that container for the rest of the project, always on top (this will show the score on each slide)
  • for the click box on that slide create an advanced (or shared action):
    • Increment v_score with 1
    • Disable CB_one    where CB_one is the name of the click box, this name has to be edited on each slide because each click box will have a unique name

If you want the second proposition, replace the Disable statement by (or add the statement if you'll allow backwards navigation): Go to Next Slide.

To show the total at the end (if the displayed text container is not sufficient), insert v_score again in a text container.