<- Last Tutorial Home Next ->

Set the Branches.

Start setting the branches with the first button, the Play Audio button.

Double click on the button marked Play Audio to see the Object Browser.

Click on the Events tab.

Note: The OZONE is an event driven system. What this means is that every control notifies the OZONE when something is happening to it and when the control does something important. The event lists are different for most controls. Above is the event list for the V_Graph Button control. You see that the first event is Branch on Realize. The very first thing a control does is become realized. Realization is the act of being able to do work like show images, or in the case of a button, take input. You can see that the next event is Click. When a user clicks this button the event is fired and the OZONE is aware that the button was clicked. Next OZONE looks in this _BranchTo property to see what to do when that Click event happens. The other events occur based on the location and action of the cursor relative to this control. We will concentrate of the first two events.

Branch on realize.

When the control first appears in the Output View during script execution it is realized. This Branch is set to tell OZONE what to do next after the control is realized.

While the project is running we want to show the two buttons at the same time and wait for one of them to be pressed before we take a desired branch path. So after the first button shows up we want to show the second. This requires us to branch on realize to the next button. We have already labeled it Exit Button.

 

Set the branches for this Button control.

  1. The Branch on Realize event is   the first in the list. We have to match that event with a label for the control we want to go to before the button is pressed. Click in the right side of the table next to the event name Branch on Realize. Look drop down box label Exit Button. Select this label with a single mouse click.
  2. You will notice that the label is copied into the  table on the same line as the event that was selected.
  3. We want to branch to the WAV Player when the button is clicked, so now select open area right of the word Click.
  4. Select the label WAV Player from the drop down list.
  5. You will notice that the label is copied into the left table on the same line as the new event, Click.

 

Set the branch for the Exit control

  1. Click on the button captioned Exit and see the Object Browser. Double click if you closed the Property Browser.
  2. Select the Events tab
  3. Do not set a Branch on Realize branch. We want to wait at this button for the user to make a selection so we do not want to go on until a branch has occurred.
  4. When this button is clicked we want to branch, so select area to the right of  the Click event.
  5. Select the label Out from the drop down list.
  6. You will see Out next to the Click event.
  7. Click on OK when this is done.

 Set the branch for the WAV Player control

We want to go back to the buttons once the audio is playing so we can exit with the Exit button, or choose to hear the audio again. To do this we have to branch back to the button. Let's use the MAP view this time.

Switch over to the map view. map.jpg (1018 bytes)

Move the Icons around until they look like this. (This is not required by I find it easier this way.)

newmap.jpg (25110 bytes)

  1. Click on the icon that represents the audio control and see the Object Browser.
  2. Position the mouse over the WAV player and hold the Ctrl key.
  3. Now press and hold the LEFT mouse button and drag a line from the WAV player to the Exit button.
  4. When the line is over the Exit button let go of the left mouse button.
  5. A dialogue pops up.eventdiag2.jpg (30087 bytes)
  6. Select the Branch on Realize event. We want this branch because when the audio plays we want to go right back to the buttons.
  7. Select OK

Now when the audio plays you can click the buttons again.
We could have set all the branches this way.

 


logo5gif.gif (1878 bytes)
Home