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

#1 2012-07-17 20:26:14

ComputerProgrammer
Scratcher
Registered: 2008-08-25
Posts: 100+

Enable motion for stage

Where in the browser would you find the place(s) where you can remove the "Stage selected: no motion blocks" message? I am working on a mod with stage motion blocks (pan, zoom, etc.) but I cannot find where I can erase the message.

Last edited by ComputerProgrammer (2012-07-20 22:53:39)


What do scratch blocks and oak trees have in common? Click here to find out!

Offline

 

#2 2012-07-17 20:42:08

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: Enable motion for stage

Scratch-Objects >> ScriptableScratchMorph >> blocks >> viewerPageForMotion


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#3 2012-07-17 21:01:33

ComputerProgrammer
Scratcher
Registered: 2008-08-25
Posts: 100+

Re: Enable motion for stage

Thank you! I was looking all over ScratchFrameMorph for some reason...


What do scratch blocks and oak trees have in common? Click here to find out!

Offline

 

#4 2012-07-17 21:02:30

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: Enable motion for stage

Happy to help.  smile


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#5 2012-07-17 22:45:59

chanmanpartyman
Scratcher
Registered: 2011-05-30
Posts: 500+

Re: Enable motion for stage

Most people believe the pan blocks belong in looks.
But anyways, this has been answered and should be closed to prevent necroposts.

Last edited by chanmanpartyman (2012-07-17 22:46:41)

Offline

 

#6 2012-07-18 16:55:13

ComputerProgrammer
Scratcher
Registered: 2008-08-25
Posts: 100+

Re: Enable motion for stage

One more question: I'm trying to execute ScratchScriptEditorMorph > updateLockButton in my "make draggable/undraggable" blocks, but I cannot seem to be able to refer to something in another category. How would this be done?


What do scratch blocks and oak trees have in common? Click here to find out!

Offline

 

#7 2012-07-18 18:14:50

chanmanpartyman
Scratcher
Registered: 2011-05-30
Posts: 500+

Re: Enable motion for stage

Are you calling it by it's class? (ScratchScriptEditorMorph  updateLockButton)
and I'm no expert, but you might have to do: self updateLockButton

Last edited by chanmanpartyman (2012-07-18 18:15:19)

Offline

 

#8 2012-07-18 19:53:07

ComputerProgrammer
Scratcher
Registered: 2008-08-25
Posts: 100+

Re: Enable motion for stage

I have tried the following:

  updateLockButton

  self updateLockButton

  ScratchScriptEditorMorph updateLockButton

  self ScratchScriptEditorMorph updateLockButton
 
  | t1 |
  t1 _ self ownerThatIsA: ScratchScriptEditorMorph.
  t1 updateLockButton

  | t1 |
  t1 _ ScratchScriptEditorMorph.
  t1 updateLockButton

None worked. Any suggestions?

Last edited by ComputerProgrammer (2012-07-19 20:39:58)


What do scratch blocks and oak trees have in common? Click here to find out!

Offline

 

#9 2012-07-19 20:47:58

ComputerProgrammer
Scratcher
Registered: 2008-08-25
Posts: 100+

Re: Enable motion for stage

In other words, Scratch-Objects ⪼ ScratchSpriteMorph ⪼ MakeDraggable looks like this:

MakeDraggable
    draggable _ true

I would like to execute Scratch-UI-Panes ⪼ ScratchScriptEditorMorph ⪼ updateLockButton right after "draggable _ true", something like this...

MakeDraggable
    draggable _ true.
    ScratchScriptEditorMorph updateLockButton

...except that the above does not work. Can someone please tell me how to refer to something in another category like this?


What do scratch blocks and oak trees have in common? Click here to find out!

Offline

 

#10 2012-07-19 20:50:11

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Enable motion for stage

That's because ScratchScriptEditorEditorMorph is actually a class. You want to send the message to an instance of a class. Not that I know how to do that, but that's your problem.  smile


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#11 2012-07-20 17:46:58

ComputerProgrammer
Scratcher
Registered: 2008-08-25
Posts: 100+

Re: Enable motion for stage

bump :)


What do scratch blocks and oak trees have in common? Click here to find out!

Offline

 

#12 2012-07-20 18:10:03

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: Enable motion for stage

Here is the whole method:

draggable: d
    | frame offscreen |
    self draggable: d.
    frame _ self ownerThatIsA: ScratchFrameMorph.
    frame _ frame ifNil: [offscreen _ self ownerThatIsA: OffscreenWorldMorph.
        offscreen ifNil: [nil]
            ifNotNil: [frame]].
    frame ifNil: [^ self].
    frame scriptsPane updateLockButton

smile


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#13 2012-07-21 16:44:11

ComputerProgrammer
Scratcher
Registered: 2008-08-25
Posts: 100+

Re: Enable motion for stage

It works! Thanks so much for the help!  big_smile   big_smile   big_smile
P.S. I am a learning Squeaker, so if you can explain how you figured that out, please can you do so? It would help me figure out many similar problems I am having with my mod...


What do scratch blocks and oak trees have in common? Click here to find out!

Offline

 

#14 2012-07-22 10:19:41

ComputerProgrammer
Scratcher
Registered: 2008-08-25
Posts: 100+

Re: Enable motion for stage

bump :)


What do scratch blocks and oak trees have in common? Click here to find out!

Offline

 

#15 2012-07-22 12:22:28

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Enable motion for stage

ComputerProgrammer wrote:

It works! Thanks so much for the help!  big_smile   big_smile   big_smile
P.S. I am a learning Squeaker, so if you can explain how you figured that out, please can you do so? It would help me figure out many similar problems I am having with my mod...

I'm not MathWizz, but I can explain as well  smile

Every method in a class can be in two places: the instance or the class.

Class methods can be called using ClassName nameOfMethod. They are completely independent of everything and can be called from anywhere. However, they cannot access the variables of that class.

Instance methods can be called only either within the same class using "self" or using a variable where that specific instance is stored (like MathWizz did using scriptsPane). They belong to a specific instance of a class and do not really interfere with the other instances. These methods can access and change various variables inside that instance.

To clarify what instances and classes are:
Imagine there's a car factory. Classes are the model of a car, a kind of definition of what goes where and what features it has (variables and methods). Instances are the actual cars that are made every day in the factory; they're all the same to start with because they originate from the same model (or class), and then they get individually customised by running their methods and changing their variables.

If you want reading material, this stuff is called Object Oriented Programming  big_smile

Offline

 

#16 2012-07-22 12:23:59

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Enable motion for stage

wiki.scratch.mit.edu/wiki/OOP <= Wrote this article myself!  smile


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#17 2012-07-22 13:49:57

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: Enable motion for stage

Hardmath123 wrote:

wiki.scratch.mit.edu/wiki/OOP <= Wrote this article myself! :)

Oooh, nice! :) Should you link from/to this article?

[/offtopic]

Last edited by blob8108 (2012-07-22 13:57:38)


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

Board footer