You can use the clear screen` function to turn off all the LED on the screen. Let's illustrate this concept with a small script where the user has to press the button A to turn off the screen. Let's start by adding the code to show an animation.
```blocks
basic.showLeds(`
# # # # #
# # # # #
. . . . .
. . . . .
. . . . .
`)
basic.showLeds(`
# # # # #
# # # # #
# # # # #
# # # # #
. . . . .
`)
basic.showLeds(`
. . . . .
. . . . .
# # # # #
# # # # #
. . . . .
`)
basic.showLeds(`
. . . . .
. . . . .
. . . . .
# # # # #
# # # # #
`)
```
We add another line of code that registers an *event handler*`on button pressed`*A* and calls `clear screen`.