Navigation:  Examples >

Example 3: Manipulate Element During Simulation

Previous pageReturn to chapter overviewNext page

Example 3: Manipulate Element During Simulation

Run This Example in New Window

We already know that clicking on the "Add Action" button in the toolbar of behavior editor will bring up a list of available actions.


Actually there are more actions, which are not listed here.  ForeUI provides a set of actions that belongs to the "Operate on Element..." category.  These actions can be selected when you choose the element to operate on.

After clicking on the "Operate on Element..." menu item, you will see this window:


Here you should click the "Choose" button to pick one or more elements to manipulate.  You will see the element picker like this:


As usual you can choose element in the plot editing area (hold SHIFT to select more elements).  Let's select two buttons (Button_1 and Button_2) and then click the "Select 2 Elements" button, you will see all available actions for tweaking the elements in a drop-down list.


After selecting the "Change Location" action, you can input the action parameters.  Here we use "+=30" as the new value of X coordinate, means the button will move right 30 pixels a time.


Here is the final behavior definition:


Now let's run it, it works as we expected! Each time we click any of the two buttons, they move right a bit (30 pixels).  You can view this online example to see the result, or download the plot file.