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

#1 2011-08-22 14:06:58

Abigail1101
Scratcher
Registered: 2011-07-31
Posts: 43

Backgrounds

I have a project, http://scratch.mit.edu/projects/Abigail1101/1969787, that has a bit of a complication in the script. I had to copy 'background no' from the stage to a sprite. It was vital in the project. However, when I tested it a red line appeared around it. Help!


Let's hope I'm online. I think I am... well maybe...

Offline

 

#2 2011-08-22 15:37:41

JJROCKER
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Backgrounds

That means there is something wrong with the script


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://img255.imageshack.us/img255/3491/signature1y.jpg&link2=http://img577.imageshack.us/img577/5272/signature1sx.jpg&link3=http://img4.imageshack.us/img4/8514/signature1et.jpg&link4=http://i.imgur.com/POEpQyZ.png&link5=http://img163.imageshack.us/img163/4640/jjrockerfinal.jpg

Offline

 

#3 2011-08-22 17:27:25

Abigail1101
Scratcher
Registered: 2011-07-31
Posts: 43

Re: Backgrounds

How should I fix it?


Let's hope I'm online. I think I am... well maybe...

Offline

 

#4 2011-08-22 18:20:01

cheddargirl
Scratch Team
Registered: 2008-09-15
Posts: 1000+

Re: Backgrounds

Abigail1101 wrote:

I have a project, http://scratch.mit.edu/projects/Abigail1101/1969787, that has a bit of a complication in the script. I had to copy 'background no' from the stage to a sprite. It was vital in the project. However, when I tested it a red line appeared around it. Help!

Hey abigail, a red line around the scrip mean that there's some kind or error in the script. I have a feeling that the error here is the block associated with the costumes.

You see, the stage uses the block http://wiki.scratch.mit.edu/images/Background_Number.png for the stage's costumes.

However, a sprite uses the block http://wiki.scratch.mit.edu/images/Costume_Number.png for the sprite costumes.

When you moved the script from the stage to a sprite, the sprite could not read the http://wiki.scratch.mit.edu/images/Background_Number.png block so it has a red line around the script.

I took a look at the project, the error is in the "Grouch" sprite, yes? To fix it, just create a global variable that will copy the number of the stage background costume something like:
forever
  set (variable) to (background #)

and then use your new variable in the sprite's scripts instead of the (background #) block.  smile

Last edited by cheddargirl (2011-08-22 18:26:21)


http://i.imgur.com/8QRYx.png
Everything is better when you add a little cheddar, because when you have cheese your life is at ease  smile

Offline

 

#5 2011-08-23 06:47:38

Abigail1101
Scratcher
Registered: 2011-07-31
Posts: 43

Re: Backgrounds

Thanks!


Let's hope I'm online. I think I am... well maybe...

Offline

 

Board footer