Demo 0. This is based on my blog entry.
The TBC code is as follows.
loop(
await( click( b0 ) && out("0") ) >
await(
click( b1a ) && out("1A")
,
click( b1b ) && out("1B")
) >
await( click( b2 ) && out("2" )
)
The haxe code is here.