Button
|
Top Previous Next |
1. | Start with a new project (File | New) and save the file as "mybutton.swi"
|
|
2. | Create a button.
|
|
Select the Layout Panel and use the Rectangle tool to create a small rectangle or square.
|
Use the Text Tool to create the static text "=".
|
Move the static text over the rectangle, then select both the text and the shape. Use the Modify menu and select Grouping then Group as Button.
|
Name the button b1 and select the checkboxes as shown below
|
The resulting script should be displayed:
|
Add the trace statement trace("Button Released"); using the Menu commands Add Script | Debugging | trace(...). The resulting script should look like:
|
4. | Test the button by selecting the Debug tab among the Panels displayed on the right hand side of the 'Layout' Panel. Press the 'Play' button to run your Movie. Each time the left mouse button is pressed while over the button, the statement "Button Pressed" should appear in the 'Debug' Panel
|
|