Change Button Color with script - Solved
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Change Button Color with script - Solved
I guess I am a really slow learner.
I have looked through several resources and I have tried several variations of code, but still cannot change the fill color of my button.
Can someone tell me What I am doing wrong. My code is below:
set the buttonColor of button Button1 to "131,250,199"
Thanks,
David
I have looked through several resources and I have tried several variations of code, but still cannot change the fill color of my button.
Can someone tell me What I am doing wrong. My code is below:
set the buttonColor of button Button1 to "131,250,199"
Thanks,
David
Last edited by DR White on Thu Sep 19, 2013 2:59 am, edited 1 time in total.
Re: Change Button Color with script
Try "backgroundColor"
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Change Button Color with script
Hi again.
And be careful. LiveCode is so english-like, that it is tempting to make up words that seem logical, but in fact do not exist, or worse, are used in a different way. You will luck out now and then, though, but always check the dictionary.
"ButtonColor". Makes sense; no such word. But at least you have the flavor of the language. There is a formal syntax, though, and you must check for it.
Craig Newman
And be careful. LiveCode is so english-like, that it is tempting to make up words that seem logical, but in fact do not exist, or worse, are used in a different way. You will luck out now and then, though, but always check the dictionary.
"ButtonColor". Makes sense; no such word. But at least you have the flavor of the language. There is a formal syntax, though, and you must check for it.
Craig Newman
Re: Change Button Color with script
One neat little trick I have learned, is to look at the property inspector. When you figure out how to change a property there, mouse over the control you used and it will give you the property name to be used in a script.
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Change Button Color with script
Magice.
Mostly correct, and I never really made that connection. Cool.
But it is not purely an aid to locating properties, though mostly it works well for that. I was playing around in the "size and position" tab, and the tooltips there are either just explanatory, or not well assigned. ("left" shows the tooltip "loc", for example)
Craig
Mostly correct, and I never really made that connection. Cool.
But it is not purely an aid to locating properties, though mostly it works well for that. I was playing around in the "size and position" tab, and the tooltips there are either just explanatory, or not well assigned. ("left" shows the tooltip "loc", for example)
Craig
Re: Change Button Color with script
True it is not perfect, especially with more complex properties that can me modified in multiple ways, but it at the least gives you a starting point of where to look in the dictionary. It has been an extremely helpful learning tool for me.dunbarx wrote:Magice.
Mostly correct, and I never really made that connection. Cool.
But it is not purely an aid to locating properties, though mostly it works well for that. I was playing around in the "size and position" tab, and the tooltips there are either just explanatory, or not well assigned. ("left" shows the tooltip "loc", for example)
Craig
Re: Change Button Color with script
WOW Magice!
That works GREAT!
Thanks!
That works GREAT!
Thanks!