Thanx everyone who replied to my query. Its been a great help indeed

Thanx
Manisha
--

On Fri, 20 Oct 2000 16:58:20  
 Luke Wigley wrote:
>Kerry Thompson wrote
>
>>> I have a query the answer to which i hope is very simple. When we give a
>>> behaviour script the mouseup handler is followd by "me" . What does this
>>> stand for?
>> 
>> Briefly, "me" is the instance of the behavior or parent script--in your
>> case, probably a behavior attached to a sprite.
>
>You can also think of the "me" a being like the identity or address of the
>behaviour or script object.
>
>Handlers in moviescripts can be called by just using their name, but the
>handlers contained in a behaviour or object are kept separate. To access a
>handler in a behaviour, you must address the behaviour containing the
>handler. 
>
>For example, say you had 10 behaviours with "on Dance" handlers in them.  If
>you type "Dance" into the message window, director has no way of knowing
>which behaviour is meant to get the "Dance" message (if you had "on Dance"
>in a movieScript, it would get the message though, since handlers in
>moviescripts do not need to be addressed).
>
>If you type "sendSprite(1, #Dance)" or call(#Dance, sprite(1)", you are
>specifying which behaviour you want to send the message to. So when Director
>sends the behaviour the 'Dance' message, it also includes the address (the
>reference to the object) as the first parameter. By convention, this
>reference is called "me", but you could call it anything you wanted.
>
>If you were never going to send parameters with the "Dance" message, then
>you could probably not bother including "me" in the handler name. For
>example, a behaviour like this will work
>
>  property spriteNum
>
>  on dance
>    put "Sprite " & spriteNum & " is dancing"
>  end
>
>Its probably a good idea to always include the "me" parameter, though,
>because the "me" paramter is still sent with the message, even though you
>are not catching it.
>
>A common error is forgetting to include "me", and sending the behaviour a
>message with a parameter - for example
>
>
>  on dance style
>    put style  
>  end
>
> [message window]  sendSprite(1, #dance, #ska)
>
>This will not work as expected because the first parameter will be the
>object reference, not the expected one.
>
>
>
>To make things more complicated, consider this behaviour:
>
>  on dance me, style
>    showStyle(style)
>  end
>
>  on showStyle style
>    put style
>  end
>
>  [message window]  sendSprite(1, #dance, #ska)
>
>the  #dance message gets sent to the behaviour, the first parameter is the
>address, which we're ignoring, and we get the dance style from the second
>parameter. So far so good. The dance handler then calls the unaddressed
>"showStyle" handler. If this handler is in the behaviour, it will be found
>and no address is sent with it as a parameter (same as if it was in a
>moviescript). That will work fine. However, if the showStyle handler was in
>a different behaviour, then we'd get an error message because Director
>wouldnt know where to find it.
>
>Luke
>
>
>[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!]
>
>


10% cash back on all your calls through 2000 at Lycos Communications at 
http://comm.lycos.com

[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