How do I change the script for 100 buttons in one time?
Jim Ault
jimaultwins at yahoo.com
Thu Mar 4 14:25:01 EST 2010
Yours is the best solution, Jacques, if using Rev 3.0 or later.
Repeat loops will work on all versions 2.2+
Jim Ault
Las Vegas
On Mar 4, 2010, at 11:05 AM, Jacques Hausser wrote:
> Hi William
>
> A good case for using behaviors ! Set the script of an hidden btn
> "BCommonScript" as you want and then put somewhere in the opening
> process of your stack:
>
> repeat with i = 1 to 100
> put "d" &i into tButtonName
> set the behavior of btn tbuttonName to the long ID of button
> "BCommonscript"
> end repeat
>
> Jacques
>
> Le 4 mars 2010 à 19:46, William de Smet a écrit :
>
>> Hi there,
>>
>> I have a stack with 100 buttons in it and they all have the same
>> script.
>> The buttons are called "d1" to "d100".
>>
>> How do I change the code for all of them in one time?
>> I don't feel like copy/paste 100 times.
>>
>
More information about the use-livecode
mailing list