Two questions about stopping and reversing counting attributes...??

LokitoesLokitoes Member, PRO Posts: 187

Hi all,

I'm wanting to make a sort of sliding timeline feature that changes certain attributes in three separate states, over two keypresses. Let's call them state 0,1,2. I would like different things to happen in these states. The user needs to be able to press ONE key to take them up the scale - 0 to 1, 1 to 2. But at that point I don't want them to be able to go further as there is no further, there's only three possible states. I then want them to be able to use a DIFFERENT button to come back down the scale, from 2 to 1, 1 to 0, then, again, the attribute should not be able to go further.

So the integer would have to be somehow constrained between 0 and 2?? Because one of the problems is if someone decides to just keep pressing the button over and over again and it counts up to ten or whatever, my other button going back from 2,1,0 is going to have to count through a lot of nothing before getting started or it just won't work at all I imagine.

I started by using an integer attribute to simply change an image on keypress but all I know how to do is to revert it back to 0 after they've gone past two, which isn't right. Of course I also need it to be able to go either way from 1 - so if someone is on 1 they have the option of pressing either up to 2 or down to 0.

How would I do this and is integer attribute even the best thing to be using for this? :s

Hope this makes sense and thanks for any help you can give me!!

Comments

Sign In or Register to comment.