play/stop
the19thbear
Member Posts: 102
Hi.
Im having a simple problem here.
I want to have a play/stop button. The button starts out with a value=0 which equals stopped.
Value 1 equals playing.
i have then made a counter to display what value the button has - it gives me a visual 1 or 0 so i can check what is going on.
i have done this:
Made an integer attribute called stop/play - have the default value=0
Made a button with the following rules:
If actor is pressed+stop/play attribute is 0=change attribute=1
then another rule in the button:
If actor is pressed+stop/play attribute value is 1=change attribute=0
that way i should have made a simple on/off switch that goes between 0 and 1. But it doesnt!
When i test the project, and press the button the value 0 in shows me a flickering between the 2 values and then goes to value 1=playing. when i press the button again, the value doesnt change.
whats wrong?
thanks alot!:)
Im having a simple problem here.
I want to have a play/stop button. The button starts out with a value=0 which equals stopped.
Value 1 equals playing.
i have then made a counter to display what value the button has - it gives me a visual 1 or 0 so i can check what is going on.
i have done this:
Made an integer attribute called stop/play - have the default value=0
Made a button with the following rules:
If actor is pressed+stop/play attribute is 0=change attribute=1
then another rule in the button:
If actor is pressed+stop/play attribute value is 1=change attribute=0
that way i should have made a simple on/off switch that goes between 0 and 1. But it doesnt!
When i test the project, and press the button the value 0 in shows me a flickering between the 2 values and then goes to value 1=playing. when i press the button again, the value doesnt change.
whats wrong?
thanks alot!:)
Comments
it worked with the +1)%2 !! thanks! what does this actually do?
thanks again!