Components can communicate with other components in two ways:
- Overidding subcomponent instance states
- Emitting custom Actions
Every component has its own internal collection of States. Subcomponents automatically display their available states as timeline rows when instantiated (see below). To override the default values of these states, create new keyframes with the overriding values you'd like to pass in. Note that you can set these values to match the states within the consuming component using expressions.
Components can also pass messages to other components using Actions combined with the
To do so, create a custom Action on the component on which you want to receive the message.
This subcomponent's custom Action can be called from any other component by using an element or frame Action along with the
.send() takes 3 arguments. Here's an example call:
this.send('down', 'MyCustomAction', 'hello').
The first argument indicates which direction along the component tree you want to send the message. The options are
* . (Using
* broadcasts all directions simultaneously.) The second argument specifies the custom Action you desire to trigger. The third, optional, argument holds any data you want to send into the custom Action for reference.