Google Classroom
GeoGebraGeoGebra Classroom

Creating Buttons

Creating Buttons Applet

Creating a Button to Create Dynamic Shapes

Step 1: Creating numbers for your problem
  • Type in the following numbers into the input box.
    • a = RandomBetween(3, 10)   (Randomly chooses side lengths for a regular polygon)  
    • **Note: You will see no changes on your screen yet. This creates a random number value that you can use, but you don't see it**
Step 2: Creating a regular polygon
  • Create a regular polygon by clicking on the polygon tool and selecting "Regular Polygon"
  • Draw the first side of the polygon by drawing a segment between two points.
  • In the pop-up box, type "a" for the number of Vertices in the polygon.
  • Press "OK" to create the polygon.
Step 3: Creating a button to update the shape
  • Select the Button feature from the slider's drop down box.
  • In the pop-up box, put "New Shape" as the caption.
  • Type "UpdateConstruction[]" in the GeoGebra script box
  • Press "OK" to create the button.
  • Test out your button and see the shape change each time you click the button.