Pages

quarta-feira, 25 de janeiro de 2017

BP Compendium 3: Flip Flop

Flip Flop


A Flip Flop has two output pins identified by A and B. When the Flip Flop is executed, only one of the output pins is executed. On the next run, only the other pin will be executed.

Output

  • Is A: Boolean value. If true, indicates that pin A is running. If false, pin B is running.


Example Usage: 

In the image below the Flip Flop is being used to show or hide a shield when the space bar is pressed. The value of the variable "Is A" is being used to determine the visibility of the shield.

Click to enlarge

In another example, the Flip Flop is being used along with a Timeline to simulate the movement of an elevator. The first run of the Flip Flop uses the "Play" pin of the Timeline that moves the elevator up. At the end of the Timeline, the "Finished" pin executes the Flip Flop that this time will use the "Reverse" pin of the Timeline to move the elevator down. When the Timeline finishes the reverse movement, it starts all over again.

Click to enlarge