sb.receiveEvent
sb.receiveEvent(channel)
Receive an event from a Storyboard IO channel. This is a blocking call so the UI may become unresponsive when used if it takes a while for the event to be received.
Parameters
| Parameter | Type | Description |
|---|---|---|
channel | string | A Storyboard IO channel to receive the event on. |
Returns
| Type | Description |
|---|---|
object | An object containing name, target, format and a data variables from a received event. |
Example
// Receive a Storyboard IO event with data payload x, y, z
var ev = sb.receiveEvent("my_channel");
if(ev != null) {
print(ev.name)
print(ev.data)
}
//To disconnect from my_channel
sb.greioDisconnect("my_channel", true);