Troubles with groups..

Ken Ray kray at sonsothunder.com
Wed Nov 19 15:40:06 EST 2003


Steve, 

What you're looking for is "the owner of the target". In this case, the
target (the field or button) gets the message, and "the owner of the
target" refers to the group that contains the field/button.

So my recommendation is to take the scripts out of the field and button,
and put this in the script of the group:

on mouseUp
  DoStuff (the long owner of the target)
end mouseUp

This will call the DoStuff handler (or whatever you want to call) in
your card script, and pass it the long id of the group (since the
button/field is the target).

HTH,

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/ 

> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com 
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of 
> Stephen King
> Sent: Wednesday, November 19, 2003 1:28 PM
> To: use-revolution at lists.runrev.com
> Subject: Troubles with groups..
> 
> 
> Hi All,
> 
> I'm sure this is really simple (and has probably been 
> answered many times before - and apologies if it has), but a 
> review of the dox doesn't seem to help, nor could I find what 
> I was looking for in the archives.
> 
> I have a number of groups on a card each of which has a field 
> and and image over it (same size). Each group is uniquely 
> named ("group1", group2...) but the field and image are the 
> same for each (ie Field "Front" and Image "Back").
> 
> My problem is with messages.. when the group is clicked, I 
> want to send a message to the card giving the group name. 
> What seems to happen though is that either the field or image 
> (whichever is
> visible) receives the click, not the group. I then tried 
> putting pass MouseUp  into the field and image script - this 
> certainly gives the message to the group script, but when the 
> handler in the card is called, the target is still the Field 
> or Image not the group.
> 
> I need the group name passed up so I know what group the card 
> handler has to act on (basically reveal or hide and check the 
> data in the field of the specific group), or to be able to 
> mouseUp on the group not image or field that comprise the 
> group. Ideally, I would like the same script in each group 
> rather than have to put the group name specifically in the 
> group script
> 
> Another thought - is the layer number of the group and its 
> object important? At the moment layer number of the group is 
> lower than its objects.
> 
> Hope this is clear and any help would be appreciated.
> 
> Cheers
> Steve
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com 
> http://lists.runrev.com/mailman/listinfo/use-> revolution
> 




More information about the use-livecode mailing list