[Newbies] chain reaction

Christine Wolfe cwdw01 at earthlink.net
Fri Nov 6 15:36:32 UTC 2009


I have an image morph X on top of which I have added two other morphs: A and
B.  I want to be able to click on morph A and have it move and at the end of
its motion, automatically trigger the movement of morph B.

 

Here's my dilemma.

 

A, B, and X are all instances of different classes of morphs that I defined.

 

X has two instance variables, a and b to which I assign new instances of the
classes A and B.

 

a responds to the mouse down event by moving - that part works.

 

Now I want B to move too without the user having to do any more clicking.

 

If I try to add a method to A that calls a movement method in B, it doesn't
know what B is - I assume because at this point, I'm just defining the
classes and they don't know about the instance names of other objects.

 

I will greatly appreciate it if you can help me think of a way to make a
chain reaction and a group of morphs based on clicking only one of the
morphs.

 

Thanks!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20091106/93c2fbc3/attachment.htm


More information about the Beginners mailing list