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

#1 2010-11-21 15:02:03

Usmanproductions
Scratcher
Registered: 2009-11-26
Posts: 11

Buttons

So I made 2 buttons in my new project, one is an up arrow and the other is a down arrow. When I press the up arrow, thecharacter's eyes are supposed to change costumes up. Then when I press the down arrow, the character eyes are supposed to change costumes going down. However, it doesn't work. Here are my blocks I used


Up arrow:

http://i868.photobucket.com/albums/ab246/triplehhhhhh/NewBitmapImage24.jpg

Down arrow:

http://i868.photobucket.com/albums/ab246/triplehhhhhh/NewBitmapImage23.jpg

Offline

 

#2 2010-11-21 15:19:25

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Buttons

Well, the problem is that when you click a button, it checks the condition of the variable and sets it, then checks and sets it again. For example, in the first script, if eyes = 1, it sets it to 3, and then it checks to see if it's 3 and sets it to 2. The first script should look like this:
http://i54.tinypic.com/2150qx3.gif


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#3 2010-11-21 15:27:50

Usmanproductions
Scratcher
Registered: 2009-11-26
Posts: 11

Re: Buttons

Ahh, thanks Harakou. I understand it now.

Offline

 

Board footer