How to make a button in Etoys 4.1 update 2390 change color of a morph

Mike Stramba <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.squeak.squeakland
Message-ID <CAA5vqSYbhm_iz5-znC57T1G82-ar6sHCzXLnhG_9xfCtE+97Zg@mail.gmail.com>
I'm trying to setup a simple etoys project with a playfield, button
and rectange.

When the button is pushed the rectangle should change color from it's
default of black to red.

1)I've dragged out a playfield, button and rectangle from the
supplies,  placing the rectangle, and button inside the rectangle.

2) I opened a viewer on the button, and dragged the empty script to an
empty place on the workarea (not in the playfield), then added a test
tile, and a "button down?" condition to the test.

When viewing the script textually it shows :
------------------------
script1
	ActiveHand anyButtonPressed
-----------------------------------------------------

3) I then switched the button script back to "revert to tile version"

4) I opened a viewer on the rectangle, and dragged the 'Rectangle1's
color' tile to the workarea, and tried to drop it into the  Test /
"yes" slot in the button's script editor, but it doesn't accept it.

Do I need to use a variable (player type) in the button script to
reference the rectangle's color attribute ?

If so, how ?

-----------------
I could do this same thing "manually" just using a custom class
subclassed from morph,  adding code to the handle down etc, but am
trying to figure out how to using the supposedly "eaier" Etoys :/

Mike
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.