SCRIPTS IN GROUPS

Dan Shafer revdan at danshafer.com
Sat Aug 6 12:56:11 EDT 2005


While I'm not sure this can be characterized as a bug, I'd call it a  
surprising feature. And it has a particularly intriguing problem if  
you have multiple background groups. In that case, the background  
groups live in layers, of course, each of which is the effective size  
of the card. So the topmost background intercepts all mouseUps (and  
presumably other such messages) that fall outside the bounds of any  
object or other group on the card. I can see where that might cause a  
programming dilemma or at least confusion.

I don't think it's necessary to avoid putting scripts in groups, but  
it is necessary to be careful what messages you write scripts for in  
the groups so that you can handle the flow of messages properly.


On Aug 6, 2005, at 6:41 AM, Bill wrote:

> I just looked at it again and the group with the script that  
> responds to the
> mouseup is not inside another group. It is the only group on the  
> card and it
> is very small and scripts in it respond to a mouse-up when you click
> anywhere in the card and well outside the group. It's background  
> behavior is
> set to true.
>
> My solution is to be careful not to put scripts in groups from now on.
>
>
> On 8/6/05 9:02 AM, "Jon" <jbondy at sover.net> wrote:
>
>
>> Is it really true that a Group that is not in the Background takes up
>> (i.e., accepts mouse events from) the whole card?!?
>>
>> :)
>>
>> Jon
>>
>>
>> Bill wrote:
>>
>>
>>> Thanks. It sure helps. I feel like a loser, sort of, but more and  
>>> more I am
>>> avoiding groups because they confuse me. I should have realized what
>>> "setting the background behavior to true" would do. I have to  
>>> think of a
>>> group as always taking up the whole area of the card and not just  
>>> the
>>> bounded area that it appears to take up.
>>>
>>>
>>> On 8/6/05 8:37 AM, "Klaus Major" <klaus at major-k.de> wrote:
>>>
>>>
>>>
>>>
>>>> Hi Bill,
>>>>
>>>>
>>>>
>>>>
>>>>> How come if you have a script in a group, and that group is the
>>>>> same size as
>>>>> a button, the "mouse-up" handler in the group responds when you  
>>>>> click
>>>>> anywhere in the card and not just directly over the group?
>>>>>
>>>>>
>>>>>
>>>> if the "backgroundbehavior" of that group = true, then this is the
>>>> correct behavior!
>>>>
>>>> That script is put into the message path AFTER the card:
>>>>
>>>> object -> (group with NO bg behav.) -> card -> BG (= group WITH bg
>>>> behav.) -> stack...
>>>>
>>>> I alsways check "the owner of the target" in these cases in the bg
>>>> script.
>>>>
>>>> on mouseup
>>>>     if the owner of the target = me then
>>>>      ## an object INSIDE that group was clicked
>>>>     end if
>>>> end mouseup
>>>>
>>>> Hope that helps.
>>>>
>>>>
>>>>
>>>> Regards
>>>>
>>>> Klaus Major
>>>> klaus at major-k.de
>>>> http://www.major-k.de
>>>>
>>>> _______________________________________________
>>>> use-revolution mailing list
>>>> use-revolution at lists.runrev.com
>>>> Please visit this url to subscribe, unsubscribe and manage your  
>>>> subscription
>>>> preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>            |    |    |
>>>           )_)  )_)  )_)
>>>          )___))___))___)\
>>>         )____)____)_____)\\
>>>       _____|____|____|____\\\__
>>> -------\                   /--------- http:// 
>>> www.bluewatermaritime.com
>>> ^^^^^ ^^^^^^^^^^^^^^^^^^^^^
>>>  ^^^^      ^^^^     ^^^    ^^
>>>       ^^^^      ^^^
>>>
>>> 24 hour cell: (787) 378-6190
>>> fax: (787) 809-8426
>>>
>>> Blue Water Maritime
>>> P.O. Box 91
>>> Puerto Real, PR 00740
>>>
>>>
>>>
>>> _______________________________________________
>>> use-revolution mailing list
>>> use-revolution at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your  
>>> subscription
>>> preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>>
>>>
>>>
>>>
>>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your  
>> subscription
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>>
>>
>
>             |    |    |
>            )_)  )_)  )_)
>           )___))___))___)\
>          )____)____)_____)\\
>        _____|____|____|____\\\__
> -------\                   /--------- http://www.bluewatermaritime.com
>  ^^^^^ ^^^^^^^^^^^^^^^^^^^^^
>   ^^^^      ^^^^     ^^^    ^^
>        ^^^^      ^^^
>
> 24 hour cell: (787) 378-6190
> fax: (787) 809-8426
>
> Blue Water Maritime
> P.O. Box 91
> Puerto Real, PR 00740
>
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dan Shafer, Revolution Consultant and Author
http://www.shafermedia.com
Get my book, "Revolution: Software at the Speed of Thought"
 From http://www.revolutionpros.com, Click "My Stuff"






More information about the use-livecode mailing list