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

#1 2007-06-25 11:44:01

mohlar
Scratcher
Registered: 2007-05-24
Posts: 100+

Slider display doesn't reflect variable values.

OK - I've got a first version of my graphing program running and (thanks to Kevin's hints) the slider controls do control the starting values for a calculation. The two variables on display duly update ..... but they don't reflect the starting values nor what happens afterwards, even though the graph does. I've tried setting F1 and F2 to 1 and 2 respectively. I've used other values and I've used a 'random -100 to 100' for both and the graph is always spot on - but the displays ALWAYS start with F1 value as 1 and F2 value as 2 so they always cycle through the same sequence of incorrect results. 

A THIRD variable (guess what - it's called F3) is simply where a calculation result is stored per cycle and that DOES display correctly.

The answer is presumably simple but my ageing brain can't spot it.

Offline

 

#2 2007-06-25 16:14:23

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: Slider display doesn't reflect variable values.

Have you shared this yet?  Might be easier to suggest fixes if we could see it.


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#3 2007-06-25 17:15:55

mohlar
Scratcher
Registered: 2007-05-24
Posts: 100+

Re: Slider display doesn't reflect variable values.

Not yet - I'm not really a fan of posting projects that are faulty ...... in development, yes, but faulty, no. If I can't crack it, I'll have to. Thanks.

Offline

 

#4 2007-06-25 18:26:56

johnm
Scratcher
Registered: 2007-03-08
Posts: 100+

Re: Slider display doesn't reflect variable values.

What are the value ranges of your variables? Sliders have a default range of 0-100. So if, for example, your variables are always less than 1 then the sliders might always be pinned at the left end of their range. You can set the range of a slider by right-clicking on the variable readout (with the slider showing) and selecting "set slider min and max". (This has to be done while you're building your project; it can't be done in presentation mode or in the Java player.)

Hope that helps.

  -- John

Last edited by johnm (2007-06-25 18:29:27)

Offline

 

Board footer