This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-03-09 06:41:02

Cyedia
New Scratcher
Registered: 2012-03-09
Posts: 2

How do you make buttons?

How do use buttons, like to click on multiple choice answers?

Offline

 

#2 2012-03-09 07:28:26

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: How do you make buttons?

Make a sprite for each option, and put

when [button1] clicked
set [answer v] to [answer1]
in each.
This is an example; replace the SET TO with your answer code.

Offline

 

#3 2012-03-09 07:30:02

slinger
Scratcher
Registered: 2011-06-21
Posts: 1000+

Re: How do you make buttons?

I assume you mean a radio button like thing?'
If you want to make something like that you would
1. place your button sprites on hte screen
2. make a variable that says something like "selected" and set it to "false"
3. then for each button make a script that detects if the sprite is clicked set the variable "selected" to "true".
4. then on each button sprite make a test to see if "selected" is true and if it is then don't let them be clicked by maybe a "stop script" block or something.


http://s0.bcbits.com/img/buttons/bandcamp_130x27_blue.png

Offline

 

#4 2012-03-14 17:32:25

Cyedia
New Scratcher
Registered: 2012-03-09
Posts: 2

Re: How do you make buttons?

Thank you!

Offline

 

Board footer