Custom Slider Bar not working

Post your own tutorials, guides and demos.

Post » Fri Aug 29, 2008 5:30 pm

Hi, I'm trying to add up the value of each sliderbar. But I can't get it to work.

what's wrong?
Follow me on Twitter @evgLabs
B
33
S
14
G
4
Posts: 251
Reputation: 4,049

Post » Fri Aug 29, 2008 5:47 pm

Event 4 should read:
Text: set private variable 'total' to 0

This resets the counter 'total', because the next event does the counting.

Then event 6 should read:
Set text to Text('Total')
ie. display the total found by event 5.

Overall you're doing this:
Reset count to 0
Count the total
Display the total

Your current file omits the 'reset count to 0' stage, so the next time the events are read, it's adding even more to the old total.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Fri Aug 29, 2008 6:21 pm

Yep, that got it. I tend to forget about ordering the events.

THANK YOU!
Follow me on Twitter @evgLabs
B
33
S
14
G
4
Posts: 251
Reputation: 4,049


Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 0 guests