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)
Offline
Thank you! I was looking all over ScratchFrameMorph for some reason...
Offline
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
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?
Offline
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
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)
Offline
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?
Offline
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.
Offline
bump :)
Offline
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
Offline
It works! Thanks so much for the help!
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...
Offline
bump :)
Offline
ComputerProgrammer wrote:
It works! Thanks so much for the help!
![]()
![]()
![]()
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
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
Offline
wiki.scratch.mit.edu/wiki/OOP <= Wrote this article myself!
Offline
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)
Offline