Fandom

Livecode Wiki

Properties

Redirected from Property

1,968pages on
this wiki
Add New Page
Comments0 Share

Every object has it's standard properties, for example a button has a name, a label, etc.

You can change a property using the property inspector window or using script code.

Let's analyse how to write a code to change a property.

Instead of using put you have to use set to change a property value, moreover you have to specify the objects owner of the property:

set the foregroundcolor of button "test" to red

If your script refers to the object that contains it, you can use the magic word me. So you can write:

set the foregroundcolor of me to red

Unfortunately the name is a property like the others, so many object can have the same name, this can lead to problems since LiveCode refer always to the first object in object hierarchy with that name. Fortunately every object have always an unique ID number (automatically created by LiveCode), so you can use it when many object have the same name. See the next example:

set the foregroundcolor of button ID 1734  to red

Remember to always specify before the ID what the object is. ID are always showed in property inspector window title.

NOTE: using another word (set) instead of put is an important aspect of LiveCode, it reminds the user that all values stored using put will be lost, and only with set will it be stored.

Property listEdit

Please help us to complete this list:


Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.