Groups and backgrounds

Ken Ray kray at sonsothunder.com
Thu Jul 8 04:20:33 EDT 2004


Troy,

It should work just that way. I opened a new stack in Rev, grouped a couple
of objects, set the backgroundBehavior of the group to true and put this
script in the script of the group:

on Test
  answer "Hello"
end Test

Then I created a button that was just sitting on the card with:

on mouseUp
  Test
end mouseUp

Sure enough, when I clicked it, I got a "hello" dialog.

Can you try my simple example and see if it works for you? If so, it may be
something else we need to look at...

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 
> Troy Rollins
> Sent: Wednesday, July 07, 2004 11:16 PM
> To: How to use Revolution
> Subject: Re: Groups and backgrounds
> 
> 
> 
> On Jul 7, 2004, at 11:09 PM, Rob Cozens wrote:
> 
> >
> >> I tend to put most of my scripts at the group level, 
> rather than the
> >> object level. On some of these groups I select "background 
> behavior" 
> >> in the property inspector. I had understood that this 
> would put the 
> >> group in the message path between the card and the stack... but it 
> >> doesn't seem to behave like that.
> >
> > The background behavior property has nothing to do with the message
> > path: it simply determines whether the group is included on any new 
> > card created in the stack.
> 
> See below...
> 
> >
> >> If my group has a method... er, handler called 
> "groupAction" and the
> >> group is "background behavior TRUE" then I had thought that *any* 
> >> object on the card could do like -
> >>
> >> on mouseUp
> >> 	groupAction
> >> end mouseUp
> >
> > Not *any* object on the card: just controls in the group.
> 
> Sorry. Still confused. Accodring to the dox -
> 
> ---------------
> If a group's backgroundBehavior is false, the group is in the message 
> path for all controls it owns, but is not in the message path of any 
> other object.
> 
> If a group's backgroundBehavior property is true, the group 
> is also in 
> the message path for any cards it is placed on.
> ---------------
> 
> What you are describing is the former. What I want is the latter.
> 
> --
> Troy
> RPSystems, Ltd.
> http://www.rpsystems.net
> 
> _______________________________________________
> 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