This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.
  • Index
  •  » FAQ
  •  » Question on variables

#26 2008-08-18 01:44:41

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Question on variables

1. You cannot save and load variables.

2. To show and hide variable displays you must make another sprite cover the displays. There isn't any better way unfortunately.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#27 2008-08-18 03:54:18

BlueFlame
Scratcher
Registered: 2008-08-17
Posts: 100+

Re: Question on variables

Thank you heaps! This will be really useful!

BlueFlame


Scape - The mindbending puzzle by coolstuff  big_smile

Offline

 

#28 2008-08-25 08:41:00

SneakyPolkaDotz
Scratcher
Registered: 2008-07-27
Posts: 18

Re: Question on variables

i have a question about variable sliders...how do you get them on your projects? i can't figure it out!


blessed are the cracked; for it is they who let in the light

Offline

 

#29 2008-08-26 08:32:33

natalie
Scratch Team
Registered: 2007-03-07
Posts: 100+

Re: Question on variables

Hi!

To get a variable slider, try to double-click on the variable monitor (on the stage).

Or you can right-click (Ctrl+click on the Mac), and choose "slider."

Offline

 

#30 2010-05-07 00:41:59

Pricky
Scratcher
Registered: 2010-05-02
Posts: 2

Re: Question on variables

how do i make a score and name appeare inn the scoreboard

Offline

 

#31 2010-06-05 05:28:58

superpikachu
Scratcher
Registered: 2009-09-20
Posts: 6

Re: Question on variables

I know VERY basic variable stuff, please could someone tell me how  to make a SLIDER variable,Thanks a lot,Superpikachu.   tongue   yikes

Offline

 

#32 2010-06-05 05:34:30

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: Question on variables

superpikachu wrote:

I know VERY basic variable stuff, please could someone tell me how  to make a SLIDER variable,Thanks a lot,Superpikachu.   tongue   yikes

To make a slider variable, simply double-click on the readout (the bit that appears on the stage. Or, you can right-click it, and select "slider"  smile


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

#33 2010-06-05 05:36:27

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Question on variables

You can follow the instructions below.  smile

1. Show the variable on the project display.
2. Right-click it.
3. Select "slider".

You're done! If you want to set the minimum and maximum values allowed, follow the below steps:

1. Right-click the variable display again.
2. Select "set slider min and max".
3. Enter in numbers in the window that appears
4. Click "OK".


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#34 2010-07-18 16:23:44

Knobbygirl9
Scratcher
Registered: 2010-05-26
Posts: 3

Re: Question on variables

hi, i have a question about variables, when u go to the section for them u see the 'scroll x' but when i dowloaded a progect is said 'scroll X' what's the difference if any? :l

Offline

 

#35 2010-07-18 16:47:10

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Question on variables

Knobbygirl9 wrote:

hi, i have a question about variables, when u go to the section for them u see the 'scroll x' but when i dowloaded a progect is said 'scroll X' what's the difference if any? :l

Sorry, I don't quite get what you mean... Do you mean the "change (x) by" and "set (x) to" blocks? Sometimes people use a variable called scroll x for scrolling, but they still use the aforementioned blocks.

Offline

 

#36 2010-09-10 15:47:08

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: Question on variables

I have a trick: try right - clicking one (mac = ctrl = click) and see what happens!


Marzipan11 must learn to not spoil

Offline

 

#37 2010-10-15 13:42:11

platform710
Scratcher
Registered: 2010-04-23
Posts: 100+

Re: Question on variables

Variables are like boxes of information that can vary in value or what it is showing. You can do what ever you want with them. Move variable steps, go to X variable Y variable. you can keep score, you can measure lives in a game. Whatever you want. Does that help?  smile


http://i54.tinypic.com/2wn8hnb.gif

Offline

 

#38 2010-10-17 10:04:44

NeilWest
Scratcher
Registered: 2010-01-06
Posts: 1000+

Re: Question on variables

I know most of you have trouble with varibles, but the simplest way of using them is look at their blocks, it could help you see what you can do.
P.S: Don't be afraid of using letters, they can handle them too!

Offline

 

#39 2010-11-10 17:23:29

mastertetris
New Scratcher
Registered: 2010-09-03
Posts: 1

Re: Question on variables

Does anybody know how to get the variable boxes to stay in one place?
When I uploaded my game they moved back to they're original spot before I moved them.

Offline

 

#40 2010-11-10 17:41:17

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Question on variables

You must have the variable shown when you save. click all of the boxes to check you want to have in the right place, even if the variable doesn't there at that time, just make sure it hides in the beginning. save and upload and it should be there.

Offline

 

#41 2010-11-22 22:07:03

ruggboy1_test
New Scratcher
Registered: 2010-11-22
Posts: 1

Re: Question on variables

archmage wrote:

As kevin said thats a hard question to answer because variables have infinite applications. In case you don't what a variable is it is a number you can alter and use in your if statements and other code involving numbers.

I recommend you look at the role variables play in some simple projects and use your imagination to see how you can apply variables to your own projects.

It doesn't have to be a number. It can be a word.

Offline

 

#42 2010-11-25 20:10:58

mrsnake
New Scratcher
Registered: 2010-11-25
Posts: 1

Re: Question on variables

how do i keep score

Offline

 

#43 2011-01-06 07:19:46

SgtVile
New Scratcher
Registered: 2010-12-19
Posts: 1

Re: Question on variables

How do you change variables? I made 2 variables, and im stuck on variable 2. I need to get something from variable 1 without deleting 2 then remaking. Is there any way?

Offline

 

#44 2011-01-06 17:04:38

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Question on variables

I'm not sure what you mean... could you explain further?


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#45 2011-02-27 09:07:22

DIALGA7
Scratcher
Registered: 2011-02-09
Posts: 7

Re: Question on variables

Is there a way to get variables to stay in one spot?

Offline

 

#46 2011-02-27 09:52:43

mathematics
Scratcher
Registered: 2009-03-01
Posts: 1000+

Re: Question on variables

DIALGA7 wrote:

Is there a way to get variables to stay in one spot?

Check out Problem 5 in Problems that have been resolved already.

Last edited by mathematics (2011-04-02 02:40:09)

Offline

 

#47 2011-04-02 00:14:59

TVflea
Scratcher
Registered: 2010-08-14
Posts: 1000+

Re: Question on variables

when i was a kid ( i still am) i thought that if you made a varible, you made a new block  lol  i was dumb


-iNetMaster-'s not dead, get used to it. ! big_smile .
http://is.gd/YrQzXX

Offline

 

#48 2011-04-10 04:11:13

spkshark
Scratcher
Registered: 2011-03-05
Posts: 65

Re: Question on variables

Well, you know how in video games, it says SCORE: 357645.
Thats what they do


http://d2bm3ljpacyxu8.cloudfront.net/width/300/crop/0,0,300x145/spkshark.webs.com/scratch%20script.gif

Offline

 

#49 2011-04-10 04:19:09

spkshark
Scratcher
Registered: 2011-03-05
Posts: 65

Re: Question on variables

For example, this is how to add points in a pacman game:
<when green flag clicked>
<forever if><touching[ pacman
<change{ score }by( 1


http://d2bm3ljpacyxu8.cloudfront.net/width/300/crop/0,0,300x145/spkshark.webs.com/scratch%20script.gif

Offline

 

#50 2011-04-10 11:29:27

User52
New Scratcher
Registered: 2010-11-11
Posts: 4

Re: Question on variables

Hey i saw this topic and thought i could post my question here. i cant post a topic yet idk why. anyway, i'm making a pokemon simulator with advance damage calculation, but when i tst it, part of the equation turns red. i thought it could be because i dont have parentheses () but i dont know how to add them. help please?

Offline

 
  • Index
  •  » FAQ
  •  » Question on variables

Board footer