[squeakland] Tools to Export Images from Etoys (eventually directly to a Blog Post)

Steve Thomas sthomas1 at gosargon.com
Mon Apr 4 12:53:58 EDT 2011


On Mon, Apr 4, 2011 at 10:09 AM, Bert Freudenberg <bert at freudenbergs.de>wrote:

> On 04.04.2011, at 15:20, Steve Thomas wrote:
>
> How can I detect if a player variable is a book object? (sometimes it is
> hard to click on the book and if you get another object and try to run the
> script an exception is thrown).
>
>
> (var costume *class* isKindOf: BookMorph) ifTrue: [...]
>

So I got this code to work (simple test where I "croak" if book and "chomp"
if Not):
script1
(self getMyPlayer costume isKindOf: BookMorph)
ifTrue: [self beep: 'croak']
ifFalse: [self beep: 'chomp']

But when I add the word class it does NOT croak even if I have the player
set to a bookMorph
script1
(self getMyPlayer costume *class* isKindOf: BookMorph)
ifTrue: [self beep: 'croak']
ifFalse: [self beep: 'chomp']

So I assume the above is okay.

Stephen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakland.org/pipermail/squeakland/attachments/20110404/158254d2/attachment.html>


More information about the squeakland mailing list