Skip to content
Technologies · Foundation · Creating with Code · Term 3

Adding Interactivity: Events

Students will learn to use event blocks (e.g., 'when flag clicked', 'when space key pressed') to make their programs interactive.

ACARA Content DescriptionsAC9TDEFP01

About This Topic

In Foundation Technologies, students add interactivity to block-based programs using event blocks like 'when flag clicked' and 'when space key pressed'. These blocks teach programs to wait for and respond to user actions, aligning with AC9TDEFP01. Students explain how events trigger code, design programs starting on key presses, and compare event types such as clicks, keys, and messages. This builds on prior sequencing to create responsive projects like interactive sprites.

Events introduce computational thinking concepts of input and control flow. Students shift from linear scripts to conditional responses, preparing for debugging and iteration in digital technologies. They explore how user actions drive program behavior, connecting coding to real-world interactions like games and apps.

Active learning shines here through immediate feedback in coding environments. When students click flags or press keys to see sprites react, abstract triggers become concrete. Pair debugging and group remixing foster collaboration, experimentation, and persistence, making events memorable and fun.

Key Questions

  1. Explain how an 'event' makes a program respond to user actions.
  2. Design a program that starts when a specific key is pressed.
  3. Compare different events that can trigger actions in a program.

Learning Objectives

  • Explain how an event block triggers a specific action in a block-based program.
  • Design a simple program that responds to a keyboard event, such as pressing the space bar.
  • Compare and contrast the functionality of different event blocks, like 'when flag clicked' and 'when this sprite clicked'.
  • Identify the user action that corresponds to a given event block in a program.

Before You Start

Sequencing Instructions

Why: Students need to understand that code runs in a specific order before they can learn how events change that order.

Basic Sprite Movement

Why: Students should be familiar with making a sprite perform a simple action, like moving or changing appearance, to then apply events to control these actions.

Key Vocabulary

EventAn action that a program can detect, like clicking a mouse or pressing a key. Events make programs interactive by starting actions.
Event BlockA special block in coding that waits for a specific event to happen before running the code stacked below it.
TriggerThe specific event that causes a block of code to run. For example, pressing the 'space' key can trigger a sprite to move.
User ActionSomething a person does to interact with a program, such as clicking a button or typing on a keyboard.

Watch Out for These Misconceptions

Common MisconceptionPrograms start running automatically without any event.

What to Teach Instead

Event blocks like 'when flag clicked' pause code until triggered. Show side-by-side projects, one with and one without an event; students observe the difference. Pair discussions help them articulate why events are needed for user control.

Common MisconceptionOnly one event can be used per program.

What to Teach Instead

Multiple events stack and run independently, like flag for start and keys for actions. Students experiment in small groups by adding extras to a base project, noting how they coexist. This reveals layering through trial and error.

Common MisconceptionEvents only work at the program's start.

What to Teach Instead

Events trigger anytime, enabling ongoing interactivity. Demo a looping sprite with mid-action key events; individuals remix to test. Peer sharing corrects over-reliance on start-only thinking.

Active Learning Ideas

See all activities

Real-World Connections

  • Video game developers use event programming to make characters jump when a player presses the 'A' button or move when directional keys are activated. This allows for player control and interaction within the game world.
  • Website designers use events to create interactive elements. For instance, clicking a 'Submit' button triggers the form to send information, or hovering over an image might cause it to enlarge.

Assessment Ideas

Exit Ticket

Provide students with a simple program snippet showing an event block (e.g., 'when flag clicked') and a sprite action. Ask them to write one sentence explaining what will happen when the flag is clicked and one sentence describing what kind of user action triggers this event.

Quick Check

During a coding activity, ask students: 'What event makes your sprite start moving?' or 'If you want your sprite to say 'Hello' when you click it, what event block would you use?' Observe student responses and provide immediate feedback.

Discussion Prompt

Pose the question: 'Imagine you are making a program where a cat chases a mouse. What different events could make the cat start moving?' Encourage students to share ideas like clicking the cat, pressing a key, or when the mouse appears.

Frequently Asked Questions

How do events make programs interactive in Foundation coding?
Events like 'when flag clicked' or 'when space key pressed' wait for user input before running code blocks. This lets sprites move, speak, or change on command, turning static scripts into responsive experiences. Students design cat games or stories, building skills in control flow per AC9TDEFP01.
What are good activities for teaching coding events to beginners?
Use pair challenges for key presses making sprites dance, small group story builders with sequenced events, and individual remixes of samples. Whole-class live coding demos let everyone predict and test. These keep sessions under 40 minutes, with clear steps for scaffolding.
How can active learning help students grasp programming events?
Active approaches provide instant visual feedback: press a key, watch the sprite jump. Pairs debug together, spotting missed triggers faster than solo work. Group remixing encourages comparing events, while whole-class demos build prediction skills. This hands-on cycle boosts engagement and retention over passive watching.
What common errors occur when Foundation students use event blocks?
Students forget events and wonder why code does not run, or add too many without stacking properly. They may think keys work without focus on the stage. Address with think-pair-share: predict, test, explain fixes. Structured remixing reinforces correct patterns quickly.