2009

Table Of Contents
Type 1 in the Value field.
3. Add a key press event:
In the events view, click .
In the properties view, select the Key Pressed option in the Trigger On field.
Click the Press Key button, and press 1 on your keyboard.
4. Add a play animation action:
In the actions view, click .
In the properties view, select Door 1 in the Animation field.
Select the Pause at End check box.
End in the Starting At field.
Start in the Ending At field.
5. In the events view, right-click the first event (On Variable), and click Logic > End on the shortcut
menu.
When this script runs, if the door was previously opened, it will close when you press '1' on the
keyboard.
Testing the Results
To open and close your door:
1. Click the Toggle Scripts button on the Animation toolbar.
2. Press '1' to open the Gatehouse door.
3. Press '1' again to close the Gatehouse door.
Animation Exercise
435