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

#1 2010-09-30 16:57:56

majormax
Scratcher
Registered: 2008-04-06
Posts: 1000+

I know nXIII will answer this

Is there a way to get something from the Scratch-Objects class to run something in the Scratch-Paint class?

Offline

 

#2 2010-09-30 17:06:33

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: I know nXIII will answer this

What do you mean?


nXIII

Offline

 

#3 2010-09-30 17:08:53

majormax
Scratcher
Registered: 2008-04-06
Posts: 1000+

Re: I know nXIII will answer this

Basically, I want to make a block that uses a method that is in another class.
(In this case, Scratch-Paint)

Offline

 

#4 2010-09-30 17:41:45

Billybob-Mario
Scratcher
Registered: 2008-01-05
Posts: 500+

Re: I know nXIII will answer this

Do you want to make a paint sprite block?

You just need to do:

Code:

| t1 |
t1 _ self ownerThatIsA: ScratchFrameMorph.
t1 paintNewSpriteMorph

Offline

 

#5 2010-09-30 20:00:16

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: I know nXIII will answer this

majormax wrote:

Basically, I want to make a block that uses a method that is in another class.
(In this case, Scratch-Paint)

but Scratch-Paint isn't a class!


nXIII

Offline

 

#6 2010-10-01 06:40:49

majormax
Scratcher
Registered: 2008-04-06
Posts: 1000+

Re: I know nXIII will answer this

Oh...

Offline

 

#7 2010-10-01 07:05:58

majormax
Scratcher
Registered: 2008-04-06
Posts: 1000+

Re: I know nXIII will answer this

http://www.majorrom.com/personalfilehosting/scratch-objectsisred.png
I need to get a block in Scratch-Objects (Red) to execute something in Scratch-Paint (blue). The reason I said Class is because what you get when you right click that area.

Offline

 

#8 2010-10-01 14:48:46

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: I know nXIII will answer this

majormax wrote:

http://www.majorrom.com/personalfilehos … sisred.png
I need to get a block in Scratch-Objects (Red) to execute something in Scratch-Paint (blue). The reason I said Class is because what you get when you right click that area.

Are you trying to send a message to a class in a different category? Or are you trying to create an instance of a class? Are you trying to send a message to an instance? Stop talking about categories, they don't have ANY EFFECT on the evaluation of the code, they are 100% for organization.


nXIII

Offline

 

Board footer