What's the best way to do objects?

Björnke von Gierke bvg at mac.com
Tue Mar 1 10:34:00 EST 2011


On 1 Mar 2011, at 16:11, Colin Holgate wrote:

> on mouseUp
>   new Button
>   set the name of button the number of buttons to "myobj"
>   --set the script of button myobj to field "my script"
set the behaviour of button "myobj" to the long  id of button "my script"
>   send dosomethingspecial to button "myobj"
> end mouseUp

Ok you can't use a field, but beyond that? totally working? But I just don't see any advantage in that. Instead, use the message path, and you'l be much more easily able to do things in the flow it's intended to be in. Asking for orientational objects does not actually give you more ease of use, but increases complexity. For example, behaviours are akward and hard to figure out where what is to edit and adjust. They're also single use, you can't have several of different ones per object. Using the message path however is very natural, so instead of the above case:

on mouseUp
  doSomethingSpecial
end mouseUp

where in the card/stack/group/library script you have the handler:

on dosomethingspecial
  put "hello world"
end dosomethingspecial


-- 

official ChatRev page:
http://bjoernke.com?target=chatrev


Chat with other RunRev developers:
go stack URL "http://bjoernke.com/chatrev/chatrev1.3b3.rev"





More information about the use-livecode mailing list