Guran wrote:

> "on myOwnHandler me"
> is not the way to use the me parameter. "me" can only be used
> together with for example "mouseDown", "mouseEnter" etc.

This isn't true at all.  "on myOwnHandler me" is exactly the way to use
'me', so long as this handler is placed within either a sprite or frame
behavior, or within a parent script.  The 'me' keyword refers to the current
instance of whichever object 

For example: assume you've written a behavior, & that it contains this
handler:

on mShowMyRef me
  put me
end

Now drop that behavior onto two sprites and run the movie.  At runtime when
the handlers are called, you'll get something like:

-- <offspring "MyBehavior" 4 2145e8>
-- <offspring "MyBehavior" 4 214534>

You'll notice the memory address is different between these two references.
Of course it is -- while there's only one 'me' in the behavior's handler,
there are two instances of it in memory.

Also notice that 'me' is used only by convention; you can use whatever you
like.  Lingo's 'me' is ananogous to C++'s 'this' (anybody correct me if I'm
wrong).  

> [snip]
> Does the same thing as you want...

This handler may end up doing what you want, but if you leave out 'me', or
whatever instance reference parameter you decide to use, you'll find your
behavior handlers and object methods breaking down all around you.

Hope this helps,
Rob

/*********************************
* Rob Wingate, Software Human    *
* http://www.vingage.com         *
* mailto:[EMAIL PROTECTED] *
*********************************/

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to