Combined Events

Jim Ault JimAultWins at yahoo.com
Tue Mar 21 13:12:16 EST 2006


Why are you using "theButton" as a parameter?

First, where is the mouseDown handler?

In the message path, it should be either
in the button or field the user clicks
or in the card, stack, or back script behind the button or field.

If the mouseDown handler is in the button or field, use
on mouseDown
since the button clicked is known.

If the mouseDown handler is in the card or stack script then use

on mouseDown
   answer the target
   if the target contains "button 1 " then
      -- a button was clicked and its number is 1
      ...do this
   end if
end mouseDown

Jim Ault
Las Vegas

On 3/21/06 9:43 AM, "Jeff Honken" <jhonken at x12.info> wrote:

> Jim,
>   That's exactly what I'm looking for but why on a windows box doesn't
> the left mouse click work.  Here's the code:
> 
> on returnInField
>   hello
> end returnInField
> 
> on mouseDown theButton
>   if theButton is 1 then
>     hello
>   else
>   end if
> end mouseDown 
>  
>  
> on hello
>   answer "Hello World"
> end hello
> 
> 
> Jeff
> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of Jim Ault
> Sent: Tuesday, March 21, 2006 10:09 AM
> To: How to use Revolution
> Subject: Re: Combined Events
> 
> oops. Too early in the morning.. wrong answer since I miss read the
> question.
> 
> 
> 
> On 3/21/06 9:06 AM, "Jim Ault" <JimAultWins at yahoo.com> wrote:
> 
>> The usual practice is to make a handler either
>> a function or a procedure
>> that is called from either
>> more than one handler or
>> more than one event or
>> both events and handlers
>> 
>> 
>>> on returnInField
>>        hello
>>> end returnInField
>>> 
>>> on mouseDown
>>        hello
>>> end mouseDown
>> 
>> on hello
>>    play annoyingMusic.aif
>>    get word 1 of the long date
>>    answer "Hello, it's "& it
>> end hello
>> 
>> ----------------
>> The following does not make sense in xTalk
>> on thisMessage or thatMessage
>> 
>> end thisMessage or thatMessage
>> 
>> Jim Ault
>> Las Vegas
>> 
>> On 3/21/06 8:39 AM, "Jeff Honken" <jhonken at x12.info> wrote:
>> 
>>> Wouter,
>>>   Thank you for the reply but I'm a little confused with your answer.
> I
>>> want the same code "answer Hello" to run in a field no matter if I
> click
>>> on the field with the mouse or press the enter key in the field and I
>>> don't want to:
>>> 
>>> on returnInField
>>>     answer "Hello"
>>> end returnInField
>>> 
>>> on mouseDown
>>>   answer "Hello"
>>> end mouseDown
>>> 
>>> 
>>> What I would like is something like this that will work:
>>> 
>>> on returnInField or mouseDown
>>>     answer "Hello"
>>> end returnInField or mouseDown
>>> 
>>> 
>>> 
>>> 
>>> -----Original Message-----
>>> From: use-revolution-bounces at lists.runrev.com
>>> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of Wouter
>>> Sent: Tuesday, March 21, 2006 9:13 AM
>>> To: How to use Revolution
>>> Subject: Re: Combined Events
>>> 
>>> for example:
>>> 
>>> on returninfield
>>>    mousedown
>>> end returninfield
>>> 
>>> Greetings,
>>> Wouter
>>> 
>>> On 21 Mar 2006, at 17:03, Jeff Honken wrote:
>>> 
>>>> 
>>>> Is there any way to combine events so you don't have to have
> redundant
>>>> code.  I would like the same code to run on both the "on
>>>> returnInField"
>>>> and "on mouseDown" events.  Jeff
>>> 
>>> _______________________________________________
>>> 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
>> 
>> 
>> _______________________________________________
>> 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
> 
> 
> 
> _______________________________________________
> 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





More information about the use-livecode mailing list