Av Rolf

As you know almost everything can be done in FileMaker. Most of the time I do all sorts of administrative solutions, this time I will try to do a twinkling Christmas tree.

This is the result!

The FileMaker database I use for the Christmas tree is small, without any fields, only one layout and two scripts to start and stop the twinkling.

The background is a nice Christmas tree I found on Pixabay.

I have placed 18 text object in front of the tree, each one should be a light. All text objects are 9x9 pixels with rounded corners, the objects then looks like circles.

I have entered 1, 2, 3, 4 etc. up to 18 in the text objects respectively. The reason is I want to use the Self function, it will return the text in the object.

I have a variable, $$lampa (yes, I know but it is the Swedish word for light), which I set to a random value from 0 to 4 every tenth of a second. The variable is repeated, the Self function is used to get the repetition for each object.

Every text object has a condition, when the random value for the light is 1 or 2 it will become yellow, when it is 3 it will become green, and 4 for red. When it is 0 the object is hidden. I use 2 values for yellow because I want most of the lights to be yellow.

The lights are turned on with a simple script, endless looping. In every loop, I loop through all the lights and set a random value. Before the next loop I refresh the window and let the script wait for 1/10 of a second.

If you want more lights you can duplicate a text object in layout mode, and change the text of the duplicate to the next number (19, 20 etc).

To start the twinkling you have to start the script, click the blue button top right. The script looks like:

Click the red cross top right to turn off the twinkling, and stop the script.

Download the database file here: ChristmasTree.fmp12

Merry Christmas!


2022-12-28 Tawfiq

Thank you, this is beautiful!

Skriv en kommentar

Din epost-adress stannar hos oss.