mouseDown message sent but not triggering the handler in a behavior

Mark Schonewille m.schonewille at economy-x-talk.com
Thu Jul 15 13:09:38 EDT 2010


Hi Andre,

I have created a button with the following script:

on mouseUp
      if the id of the target is 1005 then hide fld 1
      hide fld 1
end mouseUp

on mouseDown
      if the id of the target is 1005 then show fld 1
end mouseDown

I have also created an additional button and have grouped it and set  
its behaviour to the long id of the first button. There's also a field  
on the card.

After quitting Revolution and re-opening the stack, all works as  
expected. How is your stack different from mine?

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Download the Installer Maker plugin for Runtime Revolution at http://qurl.tk/ce

On 15 jul 2010, at 13:38, Andre.Bisseret wrote:

>
> Le 15 juil. 10 à 11:44, Scott Rossi a écrit :
>
>> Recently, Richmond wrote:
>>
>>> Just "for fun" I grouped the btn and put this in the script-editor  
>>> of
>>> the group:
>>>
>>> on mouseDown
>>>  put "Hello"
>>> end mouseDown
>>>
>>> AND; when clicked the script in the button WAS executed, and the  
>>> script
>>> in the group WAS NOT
>>> executed.
>>
>>
>> Because the script of the button intercepted the mouseDown message.
>>
>> btn -> group -> card -> stack
>>
>> The message hierarchy has several more options than this (see the  
>> list
>> archives), but this applies to what you are doing.
>>
>> If you want the group mouseDown handler to trigger, you need to  
>> remove the
>> button script, or pass the mouseDown message from the button by  
>> adding "pass
>> mouseDown" to the button's script.
>>
> Bonjour Scott,
>
> In my case, the script of the button is empty.
> The handlers are in the script of the behavior to which the button  
> is set (in fact, I was wrong: it is not a behavior of the group of  
> the button; the behavior of the button is directly set to a behavior  
> button, sorry ;-).
>
> This behavior button relates to several buttons with something like :
> if the short name of the target is "suchButton" then
>
> so that the message path is
> button > behavior
>
> What I don't understand is why the handler is not taken into account  
> on the first mouseDown message (which is actually sent) while it is  
> taken into account on any subsequent mouseDown message!
>
> Best regards
>
> André




More information about the use-livecode mailing list