Navigation:  How-To >

Define Page's Behavior

Previous pageReturn to chapter overviewNext page

You can also define the behavior for the entire page.  Just follow the steps below:

1.Open the behavior editor view.
2.Click the "Add Behavior" button in the toolbar and then select "For Pages..."
3.Select the page(s).  You can select multiple pages if you want to define behavior for them together.

add_behavior

The step 1 and step 2 can also be achieved by pressing Ctrl+D (Command + D in Mac OS X).

In step 3, you will see the page chooser window:

page_chooser

The current page will be selected by default.  So you can switch to target page first, and then press Ctrl+D (or do step 1 and 2), you can finish step 3 by directly click the "Select ? Page" button.  Then you will see the behavior owner in the behavior editor:

add_flow_or_action

After that you can define the event handler by adding event, flow control or/and action.

Add Event

The "Add Event" button is enabled when you select the behavior (node with red flag icon).  That means you can continue defining the behavior by adding events into it.  All available events (according to owner type, you can find all available events in Events Reference) will be listed in a popup menu when you click the "Add Event" button.

add_event_for_page

.After adding the event, it will be selected by default and the "Add Flow Control" and "Add Action" buttons will be enabled now.

add_flow_or_action

Add Flow Control or/and Action

Defining the behavior is just like creating flowchart.  The event is the start point, and you can append flow controls (looping, branching, delay etc.) and actions under it.

If you click the "Add Flow Control" button, all available flow controls will be listed in a popup menu (more details can be found in Flow Control Reference):

add_control_flow

If you click the "Add Action" button, all available flow controls will be listed in a popup menu (more details can be found in Action Reference):

add_action_list

Here is an example.  If page 1, 2 or 4 is loaded, a message window will popup and tell you which page is loaded.

page_behavior_example

You can add as much event handlers as you need for pages.  When running HTML5 simulation, all your defined behaviors will be converted to Javascript.