Help please: can't get behavior script to work

Ian McKnight iangmcknight at gmail.com
Sat Oct 23 10:29:29 EDT 2010


Hi Andre

It does help when you read the manual :) I did read it but I missed the
significance of the last line!

Anyway problem is solved all I need do is pass the mouseWithin message in
each button - not a great price to pay.

And thank you for your very quick reply.


On 23 October 2010 15:01, André Bisseret <andre.bisseret at wanadoo.fr> wrote:

> Bonjour Ian,
>
> I just tried the following
> - created:
> - a stack
> - a group "grButton" of 3 buttons: Button1, Button2, Button3
> - another group "grBtn" of 3 buttons: Btn1, Btn2, Btn3
> - grouped the two groups in a super group "grGlobal"
>
> - a button "BtnBehavior"
> - a field "fldTarget"
>
> - put the following handler in the script of "BtnBehavior":
> on mouseWithin
> put the short name of the target into fld "fldTarget"
> end mouseWithin
>
> Finally i set the behavior of grp "grGlobal" to the long id of btn
> "btnBehavior" of this card.
>
> Hoping that replicate your problem,
> Well:
> Does not work with mouseWithin
>
> But that works with other messages: with mouseUp, with mouseDown, with
> mouseMove, with mouseEnter
>
> Seems that the explanation is the last line of the doc on "mouseWithin" in
> the Dictionary:
>
> Note:  If there is no mouseWithinhandler in the target object'sscript, no
> mouseWithinmessage is sent, even if there is a mouseWithinhandler in an
> object that's further along the message path.
>
> HTH
>
> Best regards from Grenoble
>
> André
>
> Le 23 oct. 10 à 13:19, Ian McKnight a écrit :
>
>
>> Hi
>>
>> I have a number of buttons which are grouped together, and then this group
>> is grouped with other similar groups to form a super-group. I have in
>> excess
>> of 300 buttons then that each represent a date. When I put the mouse over
>> any one of the buttons I want to access an array and display the relevant
>> information for that day in a separate field. I have a mouseWithin handler
>> to access the data.
>>
>> When the mouseWithin handler is in the script of the actual button all
>> works
>> as it should.
>>
>> When I move the script to a separate button and set the behavior of my
>> original button to it - nothing happens. The Inspector shows the behavior
>> location correctly.
>>
>> There are no other mouseWithin handlers in the message path.
>>
>> This is the line I used in the message box to set the behavior of the
>> first
>> of my buttons.
>>
>> set the behavior of btn "checkBx 0" of grp "sepGrp" of cd "calendar" to
>> the
>> long id of btn "behave" of cd "calendar"
>>
>> I even tried referencing all the groups but still nothing happened.
>>
>> set the behavior of btn "checkBx 0" of grp "sepGrp" of grp "calendargrp"
>> of
>> cd "calendar" to the long id of btn "behave" of cd "calendar"
>>
>> This is the corresponding behavior entry from the Inspector
>>
>> button id 1647 of stack "timeTable3"
>>
>> which resolves to the button with my mousewithin script.
>>
>> I can strip out the core of the script into a separate handler and place
>> it
>> in the card script but I'd rather not replicate the remaining code 300+
>> times (even though it is only a dozen lines) if I can get behaviors to
>> work.
>>
>>
>> I'm using LiveCode 4.5 Bld 1080
>>
>> Can anyone suggest what I'm doing wrong?
>>
>>
>> Thanks.
>>
>>
>> --
>> Regards
>>
>>
>> Ian McKnight
>>
>> iangmcknight at gmail.com
>> =======================
>> _______________________________________________
>> 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
>>
>> ---------------------------------------------------------------------------------------
>> Orange vous informe que cet  e-mail a ete controle par l'anti-virus mail.
>> Aucun virus connu a ce jour par nos services n'a ete detecte.
>>
>>
>>
>
>
> _______________________________________________
> 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
>



-- 
Regards


Ian McKnight

iangmcknight at gmail.com
=======================



More information about the use-livecode mailing list