this group, versus this background

Ken Ray kray at sonsothunder.com
Mon Apr 19 13:31:02 EDT 2004


Jim,

I can't answer why Rev does what it does, but you can refer to the group
that "owns" the objects it contains by asking for "the owner" of the object.
For example, if you click on one of your graphic controls, and the script
says:

on mouseUp
  put the short name of the owner of me into tGroupName
  -- etc.
end mouseUp

... you'll get the name of the group (since the "owner" of the graphics is
the group).

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 
> Jim Hurley
> Sent: Monday, April 19, 2004 12:59 AM
> To: use-revolution at lists.runrev.com
> Subject: this group, versus this background
> 
> 
> I have a stack with one card, and one group with 5 graphic controls. 
> This is not a background group.
> 
> I have a script line in one of the controls within the group:
> 
>      put the short name of this group into theName
> 
> This brings up an error message: "Can't find background"
> 
> If I change the line to
> 
>     put the short name of this background into theName
> 
> all is well.
> 
> But RR also accepts
> 
>     put the short name of first group into theName
>     put the short name of last group into theName
> 
> (Since there is only one group, these yield the same result.)
> 
> But it won't take "this group" despite the fact that this is not a 
> group with background behavior. Why does RR recognize "first", 
> "last", but not "this" when referring to group, while it does 
> recognizer "this background" even though it is a group without 
> background behavior?
> 
> It is important to me to be able to reference the group using "this" 
> since there will be multiple groups with different names, but with 
> the same control names, so I can't use ID numbers. That is what I 
> want to be able to say in a control within the group:
> 
> on mouseUp
>    put the short name of this group into theGroupName
>    set the r1 of graphic "myGraphic" of group theGroupName  to 8
>    etc.
> 
> There are other graphics with the same name "myGraphic" but in 
> different group on the same card.
> 
> I can use "this background" but I don't see why I shouldn't be using 
> "this group".
> 
> Jim
> _______________________________________________
> 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