The "Ask () and Wait" Block
-
Prerequisite
Description
The Ask() and Wait block is a Stack Block in the Sensing Category. It is used to ask a question and wait for the answer.
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/58b1c5ec-55fb-4db3-ae44-0d0c198f3dce.PNG" width="650" style="">
How does the Ask() Block Work?
When you click on the Ask() block, it shows a Speech bubble (Dialogue Box)
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/4f12ec71-eb55-4088-b1c8-cade56b648d9.PNG" width="150" style=""> just like the “Say Block”, and also shows an “Input Box” at the bottom of Stage.
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/258df4bd-ae0c-4659-9b04-74558d60a025.PNG" width="340" style="">
The Input Box and Speech bubble will stay on the Stage and wait for you to type an “answer”.
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/d0c03ac2-3b3f-4dd1-bbd6-1296b6577936.gif" width="800" style="border-radius: 5px; border: 1px solid #29622d;">
How to Close the Input Box?
You can type an answer in the Input Box or leave it blank. To close the Input box you need to click the “checkmark”
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/2104debb-8eff-4365-86ca-6fa26ca3fe29.PNG" width="40" style=""> or press “ENTER” on your keyboard.
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/5e63e761-83ed-4a0d-9501-9b8f881c05c4.gif" width="800" style="border-radius: 5px; border: 1px solid #29622d;">
How to check the Answer?
With “Answer” Block:
If you want to see the answer on Stage, you can check (click) the “Checkbox” in front of the “Answer” block in the Sensing category.
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/19cf29e1-d68b-4d6a-b3cb-6e80fc44f43a.PNG" width="100" style="">
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/9ee649d5-5528-4429-b3b5-6258364fc063.gif" width="800" style="border-radius: 5px; border: 1px solid #29622d;">
With “Say” Block:
You can also put the “Answer” block in the “Say Block” to show the Input box answer in a Speech bubble.
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/84e1e1a9-23ea-43d2-977b-3c06e754fb92.gif" width="800" style="border-radius: 5px; border: 1px solid #29622d;">
Ask() Block with an Empty Input
If you use the “Ask() and wait” block with an empty input, it will only show the input box at the bottom.
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/6291a795-5ce7-4e3c-a6fc-1a6d2a295c2d.gif" width="800" style="border-radius: 5px; border: 1px solid #29622d;">
Stop Asking and Close the Input Box
Sometimes you may not want to wait for the user to type in the answer. You can use the “stop asking” block to close the input box:
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/bea34ee5-d9d7-469a-b4ea-493f14190fcd.gif" width="600" style="border-radius: 5px; border: 1px solid #29622d;">
The Blocks Below “Ask() and Wait” Block Will Wait
If the Input box is open on Stage, the blocks attached below the “Ask()” block will not run until the Input box is closed.
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/3c797b18-d322-4d7e-ae60-7bde206a9fe6.gif" width="800" style="border-radius: 5px; border: 1px solid #29622d;">
-
I CreatiCode pinned this topic on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login