Behavior states

Behaviors consist of several states, which are each arrangements of layers. The layers in a behavior are defined in the canvas view, not the Behavior Designer. You cannot add or remove layers within the Behavior Designer, but you can hide them.

The first state (or “initial state”) is automatically created and is not editable, as indicated by a lock icon in the top-left corner of that state.

Each state has its own set of links. Links can be created between the states of your behavior. Creating a link on one state does not create a corresponding link on the other states.

Create a state

To create a new state, do one of the following: - Click the plus button to the right of the states in the header are of the Behavior Designer - Choose the Behavior > New State menu item

Once you’ve created a new state, modify the layers in that state to correspond with your desired interaction.

Choose the active state

Clicking a state thumbnail in the Behavior Designer’s header will navigate to that state and the animation from your current state to the chosen one will be visible.

The selected state has a colored border. The previously selected state is indicated by a light colored border.

Toggle states

To toggle back and forth between the current state and the previously chosen one: - Press the space key on your keyboard. - Choose the Behavior > Toggle to Previous State from the menu

Toggle states in slow motion

It can be useful to see the animation between states in slow motion. To toggle states in slow motion do one of the following: - Hold shift while clicking on a state thumbnail - Hold shift while pressing the space key on your keyboard - Choose the Behavior > Toggle in Slow Motion menu item

Delete a state

To delete a state, right click the state’s thumbnail and choose delete.

Rename a state

Giving descriptive names to your states can be very helpful as they become more complicated. To rename a state, do one of the following: - Double click on the existing name of the state - Use the command+r keyboard shortcut - Choose the Edit > Rename menu item

Modify the initial state

If you find yourself needing to modify the initial (locked) state of a behavior, exit the behavior designer and edit it in the canvas.

Change the default state

In the canvas with a behavior selected, you can change the default state that will be displayed when the prototype is viewed. In the inspector, locate the behavior and change the “Default State” menu to the desired state.

Note that when the default state is set to a state other than the initial state, any layers that are tagged in the behavior will be locked in the canvas. Groups containing locked layers will also be locked. To modify those, edit the behavior.