[Newbies] chain reaction
cwdw01 at earthlink.net
Fri Nov 6 16:23:05 UTC 2009
Oh Markus!!! You are a genius!!!
From: beginners-bounces at lists.squeakfoundation.org
[mailto:beginners-bounces at lists.squeakfoundation.org] On Behalf Of Markus
Sent: Friday, November 06, 2009 10:54 AM
To: A friendly place to get answers to even the most basic questions about
Subject: Re: [Newbies] chain reaction
"on top of which I have added two other morphs:"
If that means that you have added a and b as submorphs of X then you
each morph knows its owner and can access it via "owner".
So you could tell the instance of A to call its owner X to trigger the
instance of B.
As X knows both of them you can write sth. along the lines of
A >> move
"now I am ready"
self owner triggerActionsAfterAHasMoved
X >> triggerActionsAfterAHasMoved
Hope that helps
Am 06.11.2009 um 16:36 schrieb Christine Wolfe:
> 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.
> Heres my dilemma.
> A, B, and X are all instances of different classes of morphs that I
> 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
> If I try to add a method to A that calls a movement method in B, it
> doesnt know what B is I assume because at this point, Im just
> defining the classes and they dont 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.
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
Beginners mailing list
Beginners at lists.squeakfoundation.org
More information about the Beginners